Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index d363d4d6ab29847abca988e340afc65862e9eff2..a21a7358362f2a6793599bd77b8a7b1624173723 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2587,15 +2587,29 @@ int JSFunction::NumberOfLiterals() { |
Object* JSBuiltinsObject::javascript_builtin(Builtins::JavaScript id) { |
ASSERT(0 <= id && id < kJSBuiltinsCount); |
- return READ_FIELD(this, kJSBuiltinsOffset + (id * kPointerSize)); |
+ return READ_FIELD(this, OffsetOfFunctionWithId(id)); |
} |
void JSBuiltinsObject::set_javascript_builtin(Builtins::JavaScript id, |
Object* value) { |
ASSERT(0 <= id && id < kJSBuiltinsCount); |
- WRITE_FIELD(this, kJSBuiltinsOffset + (id * kPointerSize), value); |
- WRITE_BARRIER(this, kJSBuiltinsOffset + (id * kPointerSize)); |
+ WRITE_FIELD(this, OffsetOfFunctionWithId(id), value); |
+ WRITE_BARRIER(this, OffsetOfFunctionWithId(id)); |
+} |
+ |
+ |
+Code* JSBuiltinsObject::javascript_builtin_code(Builtins::JavaScript id) { |
+ ASSERT(0 <= id && id < kJSBuiltinsCount); |
+ return Code::cast(READ_FIELD(this, OffsetOfCodeWithId(id))); |
+} |
+ |
+ |
+void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, |
+ Code* value) { |
+ ASSERT(0 <= id && id < kJSBuiltinsCount); |
+ WRITE_FIELD(this, OffsetOfCodeWithId(id), value); |
+ ASSERT(!Heap::InNewSpace(value)); |
} |