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 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2682 // -- r1 : requested object size (untagged) | 2682 // -- r1 : requested object size (untagged) |
2683 // -- lr : return address | 2683 // -- lr : return address |
2684 // ----------------------------------- | 2684 // ----------------------------------- |
2685 __ SmiTag(r1); | 2685 __ SmiTag(r1); |
2686 __ Move(r2, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2686 __ Move(r2, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2687 __ Push(r1, r2); | 2687 __ Push(r1, r2); |
2688 __ Move(cp, Smi::FromInt(0)); | 2688 __ Move(cp, Smi::FromInt(0)); |
2689 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2689 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2690 } | 2690 } |
2691 | 2691 |
| 2692 // static |
| 2693 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
| 2694 // The StringToNumber stub takes one argument in r0. |
| 2695 __ AssertString(r0); |
| 2696 |
| 2697 // Check if string has a cached array index. |
| 2698 Label runtime; |
| 2699 __ ldr(r2, FieldMemOperand(r0, String::kHashFieldOffset)); |
| 2700 __ tst(r2, Operand(String::kContainsCachedArrayIndexMask)); |
| 2701 __ b(ne, &runtime); |
| 2702 __ IndexFromHash(r2, r0); |
| 2703 __ Ret(); |
| 2704 |
| 2705 __ bind(&runtime); |
| 2706 __ Push(r0); // Push argument. |
| 2707 __ TailCallRuntime(Runtime::kStringToNumber); |
| 2708 } |
| 2709 |
2692 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2710 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2693 // ----------- S t a t e ------------- | 2711 // ----------- S t a t e ------------- |
2694 // -- r0 : actual number of arguments | 2712 // -- r0 : actual number of arguments |
2695 // -- r1 : function (passed through to callee) | 2713 // -- r1 : function (passed through to callee) |
2696 // -- r2 : expected number of arguments | 2714 // -- r2 : expected number of arguments |
2697 // -- r3 : new target (passed through to callee) | 2715 // -- r3 : new target (passed through to callee) |
2698 // ----------------------------------- | 2716 // ----------------------------------- |
2699 | 2717 |
2700 Label invoke, dont_adapt_arguments, stack_overflow; | 2718 Label invoke, dont_adapt_arguments, stack_overflow; |
2701 | 2719 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 } | 2831 } |
2814 } | 2832 } |
2815 | 2833 |
2816 | 2834 |
2817 #undef __ | 2835 #undef __ |
2818 | 2836 |
2819 } // namespace internal | 2837 } // namespace internal |
2820 } // namespace v8 | 2838 } // namespace v8 |
2821 | 2839 |
2822 #endif // V8_TARGET_ARCH_ARM | 2840 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |