| OLD | NEW |
| 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 Loading... |
| 3327 __ bne(¬_oddball); | 3327 __ bne(¬_oddball); |
| 3328 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset)); | 3328 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset)); |
| 3329 __ blr(); | 3329 __ blr(); |
| 3330 __ bind(¬_oddball); | 3330 __ bind(¬_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, ¬_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(¬_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 Loading... |
| 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 |
| OLD | NEW |