Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 1131760db3c6b0b194ce64d6a649792d471e59ab..7eb76e1238d3747c633f693a64ac76060482751e 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -1309,15 +1309,19 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { |
+ ASSERT(!target.is(r1)); |
+ |
+ // Load the builtins object into target register. |
+ ldr(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
+ ldr(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset)); |
+ |
// Load the JavaScript builtin function from the builtins object. |
- ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
- ldr(r1, FieldMemOperand(r1, GlobalObject::kBuiltinsOffset)); |
- int builtins_offset = |
- JSBuiltinsObject::kJSBuiltinsOffset + (id * kPointerSize); |
- ldr(r1, FieldMemOperand(r1, builtins_offset)); |
- // Load the code entry point from the function into the target register. |
- ldr(target, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
- ldr(target, FieldMemOperand(target, SharedFunctionInfo::kCodeOffset)); |
+ ldr(r1, FieldMemOperand(target, |
+ JSBuiltinsObject::OffsetOfFunctionWithId(id))); |
+ |
+ // Load the code entry point from the builtins object. |
+ ldr(target, FieldMemOperand(target, |
+ JSBuiltinsObject::OffsetOfCodeWithId(id))); |
add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); |
} |