| Index: src/arm/builtins-arm.cc
|
| diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
|
| index f9f73450a0bb2a21fc7f79af164ba6890fff10cd..6420e7b7fc6b4f503e6a399cab869b0d63ad45d2 100644
|
| --- a/src/arm/builtins-arm.cc
|
| +++ b/src/arm/builtins-arm.cc
|
| @@ -213,42 +213,39 @@
|
| // ----------- S t a t e -------------
|
| // -- r0 : number of arguments
|
| // -- r1 : constructor function
|
| - // -- r3 : original constructor
|
| // -- lr : return address
|
| // -- sp[(argc - n - 1) * 4] : arg[n] (zero based)
|
| // -- sp[argc * 4] : receiver
|
| // -----------------------------------
|
|
|
| - // 1. Load the first argument into r2 and get rid of the rest (including the
|
| + // 1. Load the first argument into r0 and get rid of the rest (including the
|
| // receiver).
|
| {
|
| Label no_arguments, done;
|
| __ sub(r0, r0, Operand(1), SetCC);
|
| __ b(lo, &no_arguments);
|
| - __ ldr(r2, MemOperand(sp, r0, LSL, kPointerSizeLog2, PreIndex));
|
| + __ ldr(r0, MemOperand(sp, r0, LSL, kPointerSizeLog2, PreIndex));
|
| __ Drop(2);
|
| __ b(&done);
|
| __ bind(&no_arguments);
|
| - __ LoadRoot(r2, Heap::kempty_stringRootIndex);
|
| + __ LoadRoot(r0, Heap::kempty_stringRootIndex);
|
| __ Drop(1);
|
| __ bind(&done);
|
| }
|
|
|
| - // 2. Make sure r2 is a string.
|
| + // 2. Make sure r0 is a string.
|
| {
|
| Label convert, done_convert;
|
| - __ JumpIfSmi(r2, &convert);
|
| - __ CompareObjectType(r2, r4, r4, FIRST_NONSTRING_TYPE);
|
| + __ JumpIfSmi(r0, &convert);
|
| + __ CompareObjectType(r0, r2, r2, FIRST_NONSTRING_TYPE);
|
| __ b(lo, &done_convert);
|
| __ bind(&convert);
|
| {
|
| FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| ToStringStub stub(masm->isolate());
|
| - __ Push(r1, r3);
|
| - __ Move(r0, r2);
|
| + __ Push(r1);
|
| __ CallStub(&stub);
|
| - __ Move(r2, r0);
|
| - __ Pop(r1, r3);
|
| + __ Pop(r1);
|
| }
|
| __ bind(&done_convert);
|
| }
|
| @@ -256,18 +253,13 @@
|
| // 3. Allocate a JSValue wrapper for the string.
|
| {
|
| // ----------- S t a t e -------------
|
| - // -- r2 : the first argument
|
| + // -- r0 : the first argument
|
| // -- r1 : constructor function
|
| - // -- r3 : original constructor
|
| // -- lr : return address
|
| // -----------------------------------
|
|
|
| - Label allocate, done_allocate, rt_call;
|
| -
|
| - // Fall back to runtime if the original constructor and function differ.
|
| - __ cmp(r1, r3);
|
| - __ b(ne, &rt_call);
|
| -
|
| + Label allocate, done_allocate;
|
| + __ Move(r2, r0);
|
| __ Allocate(JSValue::kSize, r0, r3, r4, &allocate, TAG_OBJECT);
|
| __ bind(&done_allocate);
|
|
|
| @@ -291,18 +283,6 @@
|
| __ Pop(r1, r2);
|
| }
|
| __ b(&done_allocate);
|
| -
|
| - // Fallback to the runtime to create new object.
|
| - __ bind(&rt_call);
|
| - {
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| - __ Push(r1, r2);
|
| - __ Push(r1, r3); // constructor function, original constructor
|
| - __ CallRuntime(Runtime::kNewObject, 2);
|
| - __ Pop(r1, r2);
|
| - }
|
| - __ str(r2, FieldMemOperand(r0, JSValue::kValueOffset));
|
| - __ Ret();
|
| }
|
| }
|
|
|
| @@ -520,8 +500,8 @@
|
| // r3: original constructor
|
| __ bind(&rt_call);
|
|
|
| - __ push(r1); // constructor function
|
| - __ push(r3); // original constructor
|
| + __ push(r1); // argument 2/1: constructor function
|
| + __ push(r3); // argument 3/2: original constructor
|
| __ CallRuntime(Runtime::kNewObject, 2);
|
| __ mov(r4, r0);
|
|
|
|
|