OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 __ tst(r2, Operand(String::kContainsCachedArrayIndexMask)); | 2687 __ tst(r2, Operand(String::kContainsCachedArrayIndexMask)); |
2688 __ b(ne, &runtime); | 2688 __ b(ne, &runtime); |
2689 __ IndexFromHash(r2, r0); | 2689 __ IndexFromHash(r2, r0); |
2690 __ Ret(); | 2690 __ Ret(); |
2691 | 2691 |
2692 __ bind(&runtime); | 2692 __ bind(&runtime); |
2693 __ Push(r0); // Push argument. | 2693 __ Push(r0); // Push argument. |
2694 __ TailCallRuntime(Runtime::kStringToNumber); | 2694 __ TailCallRuntime(Runtime::kStringToNumber); |
2695 } | 2695 } |
2696 | 2696 |
2697 void ToLengthStub::Generate(MacroAssembler* masm) { | |
2698 // The ToLength stub takes one argument in r0. | |
2699 Label not_smi; | |
2700 __ JumpIfNotSmi(r0, ¬_smi); | |
2701 STATIC_ASSERT(kSmiTag == 0); | |
2702 __ tst(r0, r0); | |
2703 __ mov(r0, Operand(0), LeaveCC, lt); | |
2704 __ Ret(); | |
2705 __ bind(¬_smi); | |
2706 | |
2707 __ push(r0); // Push argument. | |
2708 __ TailCallRuntime(Runtime::kToLength); | |
2709 } | |
2710 | |
2711 | |
2712 void ToStringStub::Generate(MacroAssembler* masm) { | 2697 void ToStringStub::Generate(MacroAssembler* masm) { |
2713 // The ToString stub takes one argument in r0. | 2698 // The ToString stub takes one argument in r0. |
2714 Label is_number; | 2699 Label is_number; |
2715 __ JumpIfSmi(r0, &is_number); | 2700 __ JumpIfSmi(r0, &is_number); |
2716 | 2701 |
2717 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); | 2702 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); |
2718 // r0: receiver | 2703 // r0: receiver |
2719 // r1: receiver instance type | 2704 // r1: receiver instance type |
2720 __ Ret(lo); | 2705 __ Ret(lo); |
2721 | 2706 |
(...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5567 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5552 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5568 } | 5553 } |
5569 | 5554 |
5570 | 5555 |
5571 #undef __ | 5556 #undef __ |
5572 | 5557 |
5573 } // namespace internal | 5558 } // namespace internal |
5574 } // namespace v8 | 5559 } // namespace v8 |
5575 | 5560 |
5576 #endif // V8_TARGET_ARCH_ARM | 5561 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |