Index: src/arm/builtins-arm.cc |
=================================================================== |
--- src/arm/builtins-arm.cc (revision 2740) |
+++ src/arm/builtins-arm.cc (working copy) |
@@ -214,9 +214,13 @@ |
// Enter an internal frame. |
__ EnterInternalFrame(); |
- // Setup the context from the function argument. |
+ // Set up the context from the function argument. |
__ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
+ // Set up the roots register. |
+ ExternalReference roots_address = ExternalReference::roots_address(); |
+ __ mov(r10, Operand(roots_address)); |
+ |
// Push the function and the receiver onto the stack. |
__ push(r1); |
__ push(r2); |
@@ -239,7 +243,7 @@ |
// Initialize all JavaScript callee-saved registers, since they will be seen |
// by the garbage collector as part of handlers. |
- __ mov(r4, Operand(Factory::undefined_value())); |
+ __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); |
__ mov(r5, Operand(r4)); |
__ mov(r6, Operand(r4)); |
__ mov(r7, Operand(r4)); |
@@ -282,7 +286,7 @@ |
{ Label done; |
__ tst(r0, Operand(r0)); |
__ b(ne, &done); |
- __ mov(r2, Operand(Factory::undefined_value())); |
+ __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
__ push(r2); |
__ add(r0, r0, Operand(1)); |
__ bind(&done); |
@@ -323,10 +327,10 @@ |
__ tst(r2, Operand(kSmiTagMask)); |
__ b(eq, &call_to_object); |
- __ mov(r3, Operand(Factory::null_value())); |
+ __ LoadRoot(r3, Heap::kNullValueRootIndex); |
__ cmp(r2, r3); |
__ b(eq, &use_global_receiver); |
- __ mov(r3, Operand(Factory::undefined_value())); |
+ __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); |
__ cmp(r2, r3); |
__ b(eq, &use_global_receiver); |
@@ -492,10 +496,10 @@ |
__ ldr(r0, MemOperand(fp, kRecvOffset)); |
__ tst(r0, Operand(kSmiTagMask)); |
__ b(eq, &call_to_object); |
- __ mov(r1, Operand(Factory::null_value())); |
+ __ LoadRoot(r1, Heap::kNullValueRootIndex); |
__ cmp(r0, r1); |
__ b(eq, &use_global_receiver); |
- __ mov(r1, Operand(Factory::undefined_value())); |
+ __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); |
__ cmp(r0, r1); |
__ b(eq, &use_global_receiver); |
@@ -665,7 +669,7 @@ |
// r1: function |
// r2: expected number of arguments |
// r3: code entry to call |
- __ mov(ip, Operand(Factory::undefined_value())); |
+ __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
__ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2)); |
__ sub(r2, r2, Operand(4 * kPointerSize)); // Adjust for frame. |