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

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

Issue 1412153003: PPC: [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
« no previous file with comments | « no previous file | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 3316 matching lines...) Expand 10 before | Expand all | Expand 10 after
3327 __ bne(&not_oddball); 3327 __ bne(&not_oddball);
3328 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset)); 3328 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset));
3329 __ blr(); 3329 __ blr();
3330 __ bind(&not_oddball); 3330 __ bind(&not_oddball);
3331 3331
3332 __ push(r3); // Push argument. 3332 __ push(r3); // Push argument.
3333 __ TailCallRuntime(Runtime::kToNumber, 1, 1); 3333 __ TailCallRuntime(Runtime::kToNumber, 1, 1);
3334 } 3334 }
3335 3335
3336 3336
3337 void ToLengthStub::Generate(MacroAssembler* masm) {
3338 // The ToLength stub takes one argument in r3.
3339 Label not_smi;
3340 __ JumpIfNotSmi(r3, &not_smi);
3341 STATIC_ASSERT(kSmiTag == 0);
3342 __ cmpi(r3, Operand::Zero());
3343 if (CpuFeatures::IsSupported(ISELECT)) {
3344 __ isel(lt, r3, r0, r3);
3345 } else {
3346 Label positive;
3347 __ bgt(&positive);
3348 __ li(r3, Operand::Zero());
3349 __ bind(&positive);
3350 }
3351 __ Ret();
3352 __ bind(&not_smi);
3353
3354 __ push(r3); // Push argument.
3355 __ TailCallRuntime(Runtime::kToLength, 1, 1);
3356 }
3357
3358
3337 void ToStringStub::Generate(MacroAssembler* masm) { 3359 void ToStringStub::Generate(MacroAssembler* masm) {
3338 // The ToString stub takes one argument in r3. 3360 // The ToString stub takes one argument in r3.
3339 Label is_number; 3361 Label is_number;
3340 __ JumpIfSmi(r3, &is_number); 3362 __ JumpIfSmi(r3, &is_number);
3341 3363
3342 __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE); 3364 __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE);
3343 // r3: receiver 3365 // r3: receiver
3344 // r4: receiver instance type 3366 // r4: receiver instance type
3345 __ Ret(lt); 3367 __ Ret(lt);
3346 3368
(...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after
5841 kStackUnwindSpace, NULL, 5863 kStackUnwindSpace, NULL,
5842 MemOperand(fp, 6 * kPointerSize), NULL); 5864 MemOperand(fp, 6 * kPointerSize), NULL);
5843 } 5865 }
5844 5866
5845 5867
5846 #undef __ 5868 #undef __
5847 } // namespace internal 5869 } // namespace internal
5848 } // namespace v8 5870 } // namespace v8
5849 5871
5850 #endif // V8_TARGET_ARCH_PPC 5872 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698