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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2559 // r5: from index (untagged) | 2559 // r5: from index (untagged) |
2560 __ SmiTag(r5, r5); | 2560 __ SmiTag(r5, r5); |
2561 StringCharAtGenerator generator(r2, r5, r4, r2, &runtime, &runtime, &runtime, | 2561 StringCharAtGenerator generator(r2, r5, r4, r2, &runtime, &runtime, &runtime, |
2562 RECEIVER_IS_STRING); | 2562 RECEIVER_IS_STRING); |
2563 generator.GenerateFast(masm); | 2563 generator.GenerateFast(masm); |
2564 __ Drop(3); | 2564 __ Drop(3); |
2565 __ Ret(); | 2565 __ Ret(); |
2566 generator.SkipSlow(masm, &runtime); | 2566 generator.SkipSlow(masm, &runtime); |
2567 } | 2567 } |
2568 | 2568 |
2569 void ToNumberStub::Generate(MacroAssembler* masm) { | |
2570 // The ToNumber stub takes one argument in r2. | |
2571 STATIC_ASSERT(kSmiTag == 0); | |
2572 __ TestIfSmi(r2); | |
2573 __ Ret(eq); | |
2574 | |
2575 __ CompareObjectType(r2, r3, r3, HEAP_NUMBER_TYPE); | |
2576 // r2: receiver | |
2577 // r3: receiver instance type | |
2578 Label not_heap_number; | |
2579 __ bne(¬_heap_number); | |
2580 __ Ret(); | |
2581 __ bind(¬_heap_number); | |
2582 | |
2583 NonNumberToNumberStub stub(masm->isolate()); | |
2584 __ TailCallStub(&stub); | |
2585 } | |
2586 | |
2587 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { | |
2588 // The NonNumberToNumber stub takes one argument in r2. | |
2589 __ AssertNotNumber(r2); | |
2590 | |
2591 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | |
2592 // r2: receiver | |
2593 // r3: receiver instance type | |
2594 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, lt); | |
2595 | |
2596 Label not_oddball; | |
2597 __ CmpP(r3, Operand(ODDBALL_TYPE)); | |
2598 __ bne(¬_oddball, Label::kNear); | |
2599 __ LoadP(r2, FieldMemOperand(r2, Oddball::kToNumberOffset)); | |
2600 __ b(r14); | |
2601 __ bind(¬_oddball); | |
2602 | |
2603 __ push(r2); // Push argument. | |
2604 __ TailCallRuntime(Runtime::kToNumber); | |
2605 } | |
2606 | |
2607 void ToStringStub::Generate(MacroAssembler* masm) { | 2569 void ToStringStub::Generate(MacroAssembler* masm) { |
2608 // The ToString stub takes one argument in r2. | 2570 // The ToString stub takes one argument in r2. |
2609 Label done; | 2571 Label done; |
2610 Label is_number; | 2572 Label is_number; |
2611 __ JumpIfSmi(r2, &is_number); | 2573 __ JumpIfSmi(r2, &is_number); |
2612 | 2574 |
2613 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | 2575 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); |
2614 // r2: receiver | 2576 // r2: receiver |
2615 // r3: receiver instance type | 2577 // r3: receiver instance type |
2616 __ blt(&done); | 2578 __ blt(&done); |
(...skipping 2971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5588 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5550 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5589 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5551 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5590 } | 5552 } |
5591 | 5553 |
5592 #undef __ | 5554 #undef __ |
5593 | 5555 |
5594 } // namespace internal | 5556 } // namespace internal |
5595 } // namespace v8 | 5557 } // namespace v8 |
5596 | 5558 |
5597 #endif // V8_TARGET_ARCH_S390 | 5559 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |