OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 __ Unreachable(); | 646 __ Unreachable(); |
647 } | 647 } |
648 | 648 |
649 __ Bind(&slow); | 649 __ Bind(&slow); |
650 | 650 |
651 __ Push(lhs, rhs); | 651 __ Push(lhs, rhs); |
652 // Figure out which native to call and setup the arguments. | 652 // Figure out which native to call and setup the arguments. |
653 if (cond == eq && strict()) { | 653 if (cond == eq && strict()) { |
654 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); | 654 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); |
655 } else { | 655 } else { |
656 Builtins::JavaScript native; | 656 int context_index; |
657 if (cond == eq) { | 657 if (cond == eq) { |
658 native = Builtins::EQUALS; | 658 context_index = Context::EQUALS_BUILTIN_INDEX; |
659 } else { | 659 } else { |
660 native = | 660 context_index = is_strong(strength()) |
661 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; | 661 ? Context::COMPARE_STRONG_BUILTIN_INDEX |
| 662 : Context::COMPARE_BUILTIN_INDEX; |
662 int ncr; // NaN compare result | 663 int ncr; // NaN compare result |
663 if ((cond == lt) || (cond == le)) { | 664 if ((cond == lt) || (cond == le)) { |
664 ncr = GREATER; | 665 ncr = GREATER; |
665 } else { | 666 } else { |
666 DCHECK((cond == gt) || (cond == ge)); // remaining cases | 667 DCHECK((cond == gt) || (cond == ge)); // remaining cases |
667 ncr = LESS; | 668 ncr = LESS; |
668 } | 669 } |
669 __ Mov(x10, Smi::FromInt(ncr)); | 670 __ Mov(x10, Smi::FromInt(ncr)); |
670 __ Push(x10); | 671 __ Push(x10); |
671 } | 672 } |
672 | 673 |
673 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 674 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
674 // tagged as a small integer. | 675 // tagged as a small integer. |
675 __ InvokeBuiltin(native, JUMP_FUNCTION); | 676 __ InvokeBuiltin(context_index, JUMP_FUNCTION); |
676 } | 677 } |
677 | 678 |
678 __ Bind(&miss); | 679 __ Bind(&miss); |
679 GenerateMiss(masm); | 680 GenerateMiss(masm); |
680 } | 681 } |
681 | 682 |
682 | 683 |
683 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { | 684 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
684 CPURegList saved_regs = kCallerSaved; | 685 CPURegList saved_regs = kCallerSaved; |
685 CPURegList saved_fp_regs = kCallerSavedFP; | 686 CPURegList saved_fp_regs = kCallerSavedFP; |
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2811 int argc, | 2812 int argc, |
2812 Register function, | 2813 Register function, |
2813 Register type, | 2814 Register type, |
2814 Label* non_function) { | 2815 Label* non_function) { |
2815 // Check for function proxy. | 2816 // Check for function proxy. |
2816 // x10 : function type. | 2817 // x10 : function type. |
2817 __ CompareAndBranch(type, JS_FUNCTION_PROXY_TYPE, ne, non_function); | 2818 __ CompareAndBranch(type, JS_FUNCTION_PROXY_TYPE, ne, non_function); |
2818 __ Push(function); // put proxy as additional argument | 2819 __ Push(function); // put proxy as additional argument |
2819 __ Mov(x0, argc + 1); | 2820 __ Mov(x0, argc + 1); |
2820 __ Mov(x2, 0); | 2821 __ Mov(x2, 0); |
2821 __ GetBuiltinFunction(x1, Builtins::CALL_FUNCTION_PROXY); | 2822 __ GetBuiltinFunction(x1, Context::CALL_FUNCTION_PROXY_BUILTIN_INDEX); |
2822 { | 2823 { |
2823 Handle<Code> adaptor = | 2824 Handle<Code> adaptor = |
2824 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); | 2825 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
2825 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 2826 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
2826 } | 2827 } |
2827 | 2828 |
2828 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 2829 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
2829 // of the original receiver from the call site). | 2830 // of the original receiver from the call site). |
2830 __ Bind(non_function); | 2831 __ Bind(non_function); |
2831 __ Poke(function, argc * kXRegSize); | 2832 __ Poke(function, argc * kXRegSize); |
2832 __ Mov(x0, argc); // Set up the number of arguments. | 2833 __ Mov(x0, argc); // Set up the number of arguments. |
2833 __ Mov(x2, 0); | 2834 __ Mov(x2, 0); |
2834 __ GetBuiltinFunction(function, Builtins::CALL_NON_FUNCTION); | 2835 __ GetBuiltinFunction(function, Context::CALL_NON_FUNCTION_BUILTIN_INDEX); |
2835 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2836 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
2836 RelocInfo::CODE_TARGET); | 2837 RelocInfo::CODE_TARGET); |
2837 } | 2838 } |
2838 | 2839 |
2839 | 2840 |
2840 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) { | 2841 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) { |
2841 // Wrap the receiver and patch it back onto the stack. | 2842 // Wrap the receiver and patch it back onto the stack. |
2842 { FrameScope frame_scope(masm, StackFrame::INTERNAL); | 2843 { FrameScope frame_scope(masm, StackFrame::INTERNAL); |
2843 __ Push(x1); | 2844 __ Push(x1); |
2844 __ Mov(x0, x3); | 2845 __ Mov(x0, x3); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2972 __ Ldr(cons_stub, | 2973 __ Ldr(cons_stub, |
2973 FieldMemOperand(shared_func_info, | 2974 FieldMemOperand(shared_func_info, |
2974 SharedFunctionInfo::kConstructStubOffset)); | 2975 SharedFunctionInfo::kConstructStubOffset)); |
2975 __ Add(cons_stub_code, cons_stub, Code::kHeaderSize - kHeapObjectTag); | 2976 __ Add(cons_stub_code, cons_stub, Code::kHeaderSize - kHeapObjectTag); |
2976 __ Br(cons_stub_code); | 2977 __ Br(cons_stub_code); |
2977 | 2978 |
2978 Label do_call; | 2979 Label do_call; |
2979 __ Bind(&slow); | 2980 __ Bind(&slow); |
2980 __ Cmp(object_type, JS_FUNCTION_PROXY_TYPE); | 2981 __ Cmp(object_type, JS_FUNCTION_PROXY_TYPE); |
2981 __ B(ne, &non_function_call); | 2982 __ B(ne, &non_function_call); |
2982 __ GetBuiltinFunction(x1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); | 2983 __ GetBuiltinFunction( |
| 2984 x1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); |
2983 __ B(&do_call); | 2985 __ B(&do_call); |
2984 | 2986 |
2985 __ Bind(&non_function_call); | 2987 __ Bind(&non_function_call); |
2986 __ GetBuiltinFunction(x1, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 2988 __ GetBuiltinFunction( |
| 2989 x1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); |
2987 | 2990 |
2988 __ Bind(&do_call); | 2991 __ Bind(&do_call); |
2989 // Set expected number of arguments to zero (not changing x0). | 2992 // Set expected number of arguments to zero (not changing x0). |
2990 __ Mov(x2, 0); | 2993 __ Mov(x2, 0); |
2991 __ Jump(isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2994 __ Jump(isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
2992 RelocInfo::CODE_TARGET); | 2995 RelocInfo::CODE_TARGET); |
2993 } | 2996 } |
2994 | 2997 |
2995 | 2998 |
2996 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { | 2999 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3985 __ Bind(¬_string); | 3988 __ Bind(¬_string); |
3986 | 3989 |
3987 Label not_oddball; | 3990 Label not_oddball; |
3988 __ Cmp(x1, ODDBALL_TYPE); | 3991 __ Cmp(x1, ODDBALL_TYPE); |
3989 __ B(ne, ¬_oddball); | 3992 __ B(ne, ¬_oddball); |
3990 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); | 3993 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); |
3991 __ Ret(); | 3994 __ Ret(); |
3992 __ Bind(¬_oddball); | 3995 __ Bind(¬_oddball); |
3993 | 3996 |
3994 __ Push(x0); // Push argument. | 3997 __ Push(x0); // Push argument. |
3995 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); | 3998 __ InvokeBuiltin(Context::TO_NUMBER_BUILTIN_INDEX, JUMP_FUNCTION); |
3996 } | 3999 } |
3997 | 4000 |
3998 | 4001 |
3999 void StringHelper::GenerateFlatOneByteStringEquals( | 4002 void StringHelper::GenerateFlatOneByteStringEquals( |
4000 MacroAssembler* masm, Register left, Register right, Register scratch1, | 4003 MacroAssembler* masm, Register left, Register right, Register scratch1, |
4001 Register scratch2, Register scratch3) { | 4004 Register scratch2, Register scratch3) { |
4002 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); | 4005 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); |
4003 Register result = x0; | 4006 Register result = x0; |
4004 Register left_length = scratch1; | 4007 Register left_length = scratch1; |
4005 Register right_length = scratch2; | 4008 Register right_length = scratch2; |
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5908 MemOperand(fp, 6 * kPointerSize), NULL); | 5911 MemOperand(fp, 6 * kPointerSize), NULL); |
5909 } | 5912 } |
5910 | 5913 |
5911 | 5914 |
5912 #undef __ | 5915 #undef __ |
5913 | 5916 |
5914 } // namespace internal | 5917 } // namespace internal |
5915 } // namespace v8 | 5918 } // namespace v8 |
5916 | 5919 |
5917 #endif // V8_TARGET_ARCH_ARM64 | 5920 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |