Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 1412963002: [runtime] Implement %_ToLength via ToLengthStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3161 __ b(ne, &not_oddball); 3161 __ b(ne, &not_oddball);
3162 __ ldr(r0, FieldMemOperand(r0, Oddball::kToNumberOffset)); 3162 __ ldr(r0, FieldMemOperand(r0, Oddball::kToNumberOffset));
3163 __ Ret(); 3163 __ Ret();
3164 __ bind(&not_oddball); 3164 __ bind(&not_oddball);
3165 3165
3166 __ push(r0); // Push argument. 3166 __ push(r0); // Push argument.
3167 __ TailCallRuntime(Runtime::kToNumber, 1, 1); 3167 __ TailCallRuntime(Runtime::kToNumber, 1, 1);
3168 } 3168 }
3169 3169
3170 3170
3171 void ToLengthStub::Generate(MacroAssembler* masm) {
3172 // The ToLength stub takes one argument in r0.
3173 Label not_smi;
3174 __ JumpIfNotSmi(r0, &not_smi);
3175 STATIC_ASSERT(kSmiTag == 0);
3176 __ tst(r0, r0);
3177 __ mov(r0, Operand(0), LeaveCC, lt);
3178 __ Ret();
3179 __ bind(&not_smi);
3180
3181 __ push(r0); // Push argument.
3182 __ TailCallRuntime(Runtime::kToLength, 1, 1);
3183 }
3184
3185
3171 void ToStringStub::Generate(MacroAssembler* masm) { 3186 void ToStringStub::Generate(MacroAssembler* masm) {
3172 // The ToString stub takes one argument in r0. 3187 // The ToString stub takes one argument in r0.
3173 Label is_number; 3188 Label is_number;
3174 __ JumpIfSmi(r0, &is_number); 3189 __ JumpIfSmi(r0, &is_number);
3175 3190
3176 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); 3191 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE);
3177 // r0: receiver 3192 // r0: receiver
3178 // r1: receiver instance type 3193 // r1: receiver instance type
3179 __ Ret(lo); 3194 __ Ret(lo);
3180 3195
(...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after
5547 MemOperand(fp, 6 * kPointerSize), NULL); 5562 MemOperand(fp, 6 * kPointerSize), NULL);
5548 } 5563 }
5549 5564
5550 5565
5551 #undef __ 5566 #undef __
5552 5567
5553 } // namespace internal 5568 } // namespace internal
5554 } // namespace v8 5569 } // namespace v8
5555 5570
5556 #endif // V8_TARGET_ARCH_ARM 5571 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | src/full-codegen/arm/full-codegen-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698