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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 2886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2897 Register cons_stub = jump_reg; | 2897 Register cons_stub = jump_reg; |
2898 Register cons_stub_code = jump_reg; | 2898 Register cons_stub_code = jump_reg; |
2899 __ Ldr(shared_func_info, | 2899 __ Ldr(shared_func_info, |
2900 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); | 2900 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
2901 __ Ldr(cons_stub, | 2901 __ Ldr(cons_stub, |
2902 FieldMemOperand(shared_func_info, | 2902 FieldMemOperand(shared_func_info, |
2903 SharedFunctionInfo::kConstructStubOffset)); | 2903 SharedFunctionInfo::kConstructStubOffset)); |
2904 __ Add(cons_stub_code, cons_stub, Code::kHeaderSize - kHeapObjectTag); | 2904 __ Add(cons_stub_code, cons_stub, Code::kHeaderSize - kHeapObjectTag); |
2905 __ Br(cons_stub_code); | 2905 __ Br(cons_stub_code); |
2906 | 2906 |
2907 Label do_call; | |
2908 __ Bind(&slow); | 2907 __ Bind(&slow); |
2909 __ Cmp(object_type, JS_FUNCTION_PROXY_TYPE); | 2908 { |
2910 __ B(ne, &non_function_call); | 2909 __ Cmp(object_type, JS_FUNCTION_PROXY_TYPE); |
2911 __ GetBuiltinFunction( | 2910 __ B(ne, &non_function_call); |
2912 x1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2911 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies. |
2913 __ B(&do_call); | 2912 __ Ldr(x1, FieldMemOperand(x1, JSFunctionProxy::kConstructTrapOffset)); |
| 2913 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2914 | 2914 |
2915 __ Bind(&non_function_call); | 2915 __ Bind(&non_function_call); |
2916 __ GetBuiltinFunction( | 2916 { |
2917 x1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2917 // Determine the delegate for the target (if any). |
2918 | 2918 FrameScope scope(masm, StackFrame::INTERNAL); |
2919 __ Bind(&do_call); | 2919 __ SmiTag(x0); |
2920 // Set expected number of arguments to zero (not changing x0). | 2920 __ Push(x0, x1); |
2921 __ Mov(x2, 0); | 2921 __ CallRuntime(Runtime::kGetConstructorDelegate, 1); |
2922 __ Jump(isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2922 __ Mov(x1, x0); |
2923 RelocInfo::CODE_TARGET); | 2923 __ Pop(x0); |
| 2924 __ SmiUntag(x0); |
| 2925 } |
| 2926 // The delegate is always a regular function. |
| 2927 __ AssertFunction(x1); |
| 2928 __ Jump(masm->isolate()->builtins()->CallFunction(), |
| 2929 RelocInfo::CODE_TARGET); |
| 2930 } |
2924 } | 2931 } |
2925 | 2932 |
2926 | 2933 |
2927 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { | 2934 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
2928 __ Ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 2935 __ Ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
2929 __ Ldr(vector, FieldMemOperand(vector, | 2936 __ Ldr(vector, FieldMemOperand(vector, |
2930 JSFunction::kSharedFunctionInfoOffset)); | 2937 JSFunction::kSharedFunctionInfoOffset)); |
2931 __ Ldr(vector, FieldMemOperand(vector, | 2938 __ Ldr(vector, FieldMemOperand(vector, |
2932 SharedFunctionInfo::kFeedbackVectorOffset)); | 2939 SharedFunctionInfo::kFeedbackVectorOffset)); |
2933 } | 2940 } |
(...skipping 3061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5995 MemOperand(fp, 6 * kPointerSize), NULL); | 6002 MemOperand(fp, 6 * kPointerSize), NULL); |
5996 } | 6003 } |
5997 | 6004 |
5998 | 6005 |
5999 #undef __ | 6006 #undef __ |
6000 | 6007 |
6001 } // namespace internal | 6008 } // namespace internal |
6002 } // namespace v8 | 6009 } // namespace v8 |
6003 | 6010 |
6004 #endif // V8_TARGET_ARCH_ARM64 | 6011 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |