| 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 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 __ TailCallStub(&stub); | 2584 __ TailCallStub(&stub); |
| 2585 } | 2585 } |
| 2586 | 2586 |
| 2587 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { | 2587 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { |
| 2588 // The NonNumberToNumber stub takes one argument in r2. | 2588 // The NonNumberToNumber stub takes one argument in r2. |
| 2589 __ AssertNotNumber(r2); | 2589 __ AssertNotNumber(r2); |
| 2590 | 2590 |
| 2591 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | 2591 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); |
| 2592 // r2: receiver | 2592 // r2: receiver |
| 2593 // r3: receiver instance type | 2593 // r3: receiver instance type |
| 2594 StringToNumberStub stub(masm->isolate()); | 2594 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, lt); |
| 2595 __ TailCallStub(&stub, lt); | |
| 2596 | 2595 |
| 2597 Label not_oddball; | 2596 Label not_oddball; |
| 2598 __ CmpP(r3, Operand(ODDBALL_TYPE)); | 2597 __ CmpP(r3, Operand(ODDBALL_TYPE)); |
| 2599 __ bne(¬_oddball, Label::kNear); | 2598 __ bne(¬_oddball, Label::kNear); |
| 2600 __ LoadP(r2, FieldMemOperand(r2, Oddball::kToNumberOffset)); | 2599 __ LoadP(r2, FieldMemOperand(r2, Oddball::kToNumberOffset)); |
| 2601 __ b(r14); | 2600 __ b(r14); |
| 2602 __ bind(¬_oddball); | 2601 __ bind(¬_oddball); |
| 2603 | 2602 |
| 2604 __ push(r2); // Push argument. | 2603 __ push(r2); // Push argument. |
| 2605 __ TailCallRuntime(Runtime::kToNumber); | 2604 __ TailCallRuntime(Runtime::kToNumber); |
| 2606 } | 2605 } |
| 2607 | 2606 |
| 2608 void StringToNumberStub::Generate(MacroAssembler* masm) { | |
| 2609 // The StringToNumber stub takes one argument in r2. | |
| 2610 __ AssertString(r2); | |
| 2611 | |
| 2612 // Check if string has a cached array index. | |
| 2613 Label runtime; | |
| 2614 __ LoadlW(r4, FieldMemOperand(r2, String::kHashFieldOffset)); | |
| 2615 __ And(r0, r4, Operand(String::kContainsCachedArrayIndexMask)); | |
| 2616 __ bne(&runtime); | |
| 2617 __ IndexFromHash(r4, r2); | |
| 2618 __ Ret(); | |
| 2619 | |
| 2620 __ bind(&runtime); | |
| 2621 __ push(r2); // Push argument. | |
| 2622 __ TailCallRuntime(Runtime::kStringToNumber); | |
| 2623 } | |
| 2624 | |
| 2625 void ToStringStub::Generate(MacroAssembler* masm) { | 2607 void ToStringStub::Generate(MacroAssembler* masm) { |
| 2626 // The ToString stub takes one argument in r2. | 2608 // The ToString stub takes one argument in r2. |
| 2627 Label done; | 2609 Label done; |
| 2628 Label is_number; | 2610 Label is_number; |
| 2629 __ JumpIfSmi(r2, &is_number); | 2611 __ JumpIfSmi(r2, &is_number); |
| 2630 | 2612 |
| 2631 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | 2613 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); |
| 2632 // r2: receiver | 2614 // r2: receiver |
| 2633 // r3: receiver instance type | 2615 // r3: receiver instance type |
| 2634 __ blt(&done); | 2616 __ blt(&done); |
| (...skipping 2971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5606 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5588 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5607 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5589 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5608 } | 5590 } |
| 5609 | 5591 |
| 5610 #undef __ | 5592 #undef __ |
| 5611 | 5593 |
| 5612 } // namespace internal | 5594 } // namespace internal |
| 5613 } // namespace v8 | 5595 } // namespace v8 |
| 5614 | 5596 |
| 5615 #endif // V8_TARGET_ARCH_S390 | 5597 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |