Chromium Code Reviews| 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/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2692 | 2692 |
| 2693 // Check if string has a cached array index. | 2693 // Check if string has a cached array index. |
| 2694 Label runtime; | 2694 Label runtime; |
| 2695 __ ldr(r2, FieldMemOperand(r0, String::kHashFieldOffset)); | 2695 __ ldr(r2, FieldMemOperand(r0, String::kHashFieldOffset)); |
| 2696 __ tst(r2, Operand(String::kContainsCachedArrayIndexMask)); | 2696 __ tst(r2, Operand(String::kContainsCachedArrayIndexMask)); |
| 2697 __ b(ne, &runtime); | 2697 __ b(ne, &runtime); |
| 2698 __ IndexFromHash(r2, r0); | 2698 __ IndexFromHash(r2, r0); |
| 2699 __ Ret(); | 2699 __ Ret(); |
| 2700 | 2700 |
| 2701 __ bind(&runtime); | 2701 __ bind(&runtime); |
| 2702 __ Push(r0); // Push argument. | 2702 { |
| 2703 __ TailCallRuntime(Runtime::kStringToNumber); | 2703 FrameScope frame(masm, StackFrame::INTERNAL); |
| 2704 // Push argument. | |
| 2705 __ Push(r0); | |
| 2706 // We cannot use a tail call here because this builtin can also be called | |
| 2707 // from wasm. | |
| 2708 __ CallRuntime(Runtime::kToNumber); | |
|
Benedikt Meurer
2016/06/21 08:32:48
kStringToNumber here and on all other ports.
ahaas
2016/06/21 08:52:58
done.
| |
| 2709 } | |
| 2710 __ Ret(); | |
| 2704 } | 2711 } |
| 2705 | 2712 |
| 2706 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2713 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
| 2707 // The ToNumber stub takes one argument in r0. | 2714 // The ToNumber stub takes one argument in r0. |
| 2708 STATIC_ASSERT(kSmiTag == 0); | 2715 STATIC_ASSERT(kSmiTag == 0); |
| 2709 __ tst(r0, Operand(kSmiTagMask)); | 2716 __ tst(r0, Operand(kSmiTagMask)); |
| 2710 __ Ret(eq); | 2717 __ Ret(eq); |
| 2711 | 2718 |
| 2712 __ CompareObjectType(r0, r1, r1, HEAP_NUMBER_TYPE); | 2719 __ CompareObjectType(r0, r1, r1, HEAP_NUMBER_TYPE); |
| 2713 // r0: receiver | 2720 // r0: receiver |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 2727 // r1: receiver instance type | 2734 // r1: receiver instance type |
| 2728 __ Jump(masm->isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, | 2735 __ Jump(masm->isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, |
| 2729 lo); | 2736 lo); |
| 2730 | 2737 |
| 2731 Label not_oddball; | 2738 Label not_oddball; |
| 2732 __ cmp(r1, Operand(ODDBALL_TYPE)); | 2739 __ cmp(r1, Operand(ODDBALL_TYPE)); |
| 2733 __ b(ne, ¬_oddball); | 2740 __ b(ne, ¬_oddball); |
| 2734 __ ldr(r0, FieldMemOperand(r0, Oddball::kToNumberOffset)); | 2741 __ ldr(r0, FieldMemOperand(r0, Oddball::kToNumberOffset)); |
| 2735 __ Ret(); | 2742 __ Ret(); |
| 2736 __ bind(¬_oddball); | 2743 __ bind(¬_oddball); |
| 2737 | 2744 { |
| 2738 __ Push(r0); // Push argument. | 2745 FrameScope frame(masm, StackFrame::INTERNAL); |
| 2739 __ TailCallRuntime(Runtime::kToNumber); | 2746 // Push argument. |
| 2747 __ Push(r0); | |
| 2748 // We cannot use a tail call here because this builtin can also be called | |
| 2749 // from wasm. | |
| 2750 __ CallRuntime(Runtime::kToNumber); | |
| 2751 } | |
| 2752 __ Ret(); | |
| 2740 } | 2753 } |
| 2741 | 2754 |
| 2742 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2755 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
| 2743 // ----------- S t a t e ------------- | 2756 // ----------- S t a t e ------------- |
| 2744 // -- r0 : actual number of arguments | 2757 // -- r0 : actual number of arguments |
| 2745 // -- r1 : function (passed through to callee) | 2758 // -- r1 : function (passed through to callee) |
| 2746 // -- r2 : expected number of arguments | 2759 // -- r2 : expected number of arguments |
| 2747 // -- r3 : new target (passed through to callee) | 2760 // -- r3 : new target (passed through to callee) |
| 2748 // ----------------------------------- | 2761 // ----------------------------------- |
| 2749 | 2762 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2863 } | 2876 } |
| 2864 } | 2877 } |
| 2865 | 2878 |
| 2866 | 2879 |
| 2867 #undef __ | 2880 #undef __ |
| 2868 | 2881 |
| 2869 } // namespace internal | 2882 } // namespace internal |
| 2870 } // namespace v8 | 2883 } // namespace v8 |
| 2871 | 2884 |
| 2872 #endif // V8_TARGET_ARCH_ARM | 2885 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |