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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2457 __ bne(¬_oddball); | 2457 __ bne(¬_oddball); |
2458 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); | 2458 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); |
2459 __ Ret(); | 2459 __ Ret(); |
2460 __ bind(¬_oddball); | 2460 __ bind(¬_oddball); |
2461 | 2461 |
2462 __ push(r3); // Push argument. | 2462 __ push(r3); // Push argument. |
2463 __ TailCallRuntime(Runtime::kToString); | 2463 __ TailCallRuntime(Runtime::kToString); |
2464 } | 2464 } |
2465 | 2465 |
2466 | 2466 |
2467 void ToNameStub::Generate(MacroAssembler* masm) { | |
2468 // The ToName stub takes one argument in r3. | |
2469 Label is_number; | |
2470 __ JumpIfSmi(r3, &is_number); | |
2471 | |
2472 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
2473 __ CompareObjectType(r3, r4, r4, LAST_NAME_TYPE); | |
2474 // r3: receiver | |
2475 // r4: receiver instance type | |
2476 __ Ret(le); | |
2477 | |
2478 Label not_heap_number; | |
2479 __ cmpi(r4, Operand(HEAP_NUMBER_TYPE)); | |
2480 __ bne(¬_heap_number); | |
2481 __ bind(&is_number); | |
2482 NumberToStringStub stub(isolate()); | |
2483 __ TailCallStub(&stub); | |
2484 __ bind(¬_heap_number); | |
2485 | |
2486 Label not_oddball; | |
2487 __ cmpi(r4, Operand(ODDBALL_TYPE)); | |
2488 __ bne(¬_oddball); | |
2489 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); | |
2490 __ Ret(); | |
2491 __ bind(¬_oddball); | |
2492 | |
2493 __ push(r3); // Push argument. | |
2494 __ TailCallRuntime(Runtime::kToName); | |
2495 } | |
2496 | |
2497 | |
2498 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 2467 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
2499 Register left, | 2468 Register left, |
2500 Register right, | 2469 Register right, |
2501 Register scratch1, | 2470 Register scratch1, |
2502 Register scratch2) { | 2471 Register scratch2) { |
2503 Register length = scratch1; | 2472 Register length = scratch1; |
2504 | 2473 |
2505 // Compare lengths. | 2474 // Compare lengths. |
2506 Label strings_not_equal, check_zero_length; | 2475 Label strings_not_equal, check_zero_length; |
2507 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); | 2476 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); |
(...skipping 2964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5472 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 5441 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
5473 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5442 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5474 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5443 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5475 } | 5444 } |
5476 | 5445 |
5477 #undef __ | 5446 #undef __ |
5478 } // namespace internal | 5447 } // namespace internal |
5479 } // namespace v8 | 5448 } // namespace v8 |
5480 | 5449 |
5481 #endif // V8_TARGET_ARCH_PPC | 5450 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |