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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 CodeStubInterfaceDescriptor* descriptor, | 24 CodeStubInterfaceDescriptor* descriptor, |
25 int constant_stack_parameter_count) { | 25 int constant_stack_parameter_count) { |
26 // cp: context | 26 // cp: context |
27 // x1: function | 27 // x1: function |
28 // x2: allocation site with elements kind | 28 // x2: allocation site with elements kind |
29 // x0: number of arguments to the constructor function | 29 // x0: number of arguments to the constructor function |
30 Address deopt_handler = Runtime::FunctionForId( | 30 Address deopt_handler = Runtime::FunctionForId( |
31 Runtime::kArrayConstructor)->entry; | 31 Runtime::kArrayConstructor)->entry; |
32 | 32 |
33 if (constant_stack_parameter_count == 0) { | 33 if (constant_stack_parameter_count == 0) { |
34 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( | 34 ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); |
35 CallDescriptorKey::ArrayConstructorConstantArgCountCall); | |
36 descriptor->Initialize(major, call_descriptor, deopt_handler, | 35 descriptor->Initialize(major, call_descriptor, deopt_handler, |
37 constant_stack_parameter_count, | 36 constant_stack_parameter_count, |
38 JS_FUNCTION_STUB_MODE); | 37 JS_FUNCTION_STUB_MODE); |
39 } else { | 38 } else { |
40 CallInterfaceDescriptor* call_descriptor = | 39 ArrayConstructorDescriptor call_descriptor(isolate); |
41 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); | |
42 descriptor->Initialize(major, call_descriptor, x0, deopt_handler, | 40 descriptor->Initialize(major, call_descriptor, x0, deopt_handler, |
43 constant_stack_parameter_count, | 41 constant_stack_parameter_count, |
44 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); | 42 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
45 } | 43 } |
46 } | 44 } |
47 | 45 |
48 | 46 |
49 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 47 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
50 CodeStubInterfaceDescriptor* descriptor) { | 48 CodeStubInterfaceDescriptor* descriptor) { |
51 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); | 49 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); |
(...skipping 13 matching lines...) Expand all Loading... |
65 | 63 |
66 | 64 |
67 static void InitializeInternalArrayConstructorDescriptor( | 65 static void InitializeInternalArrayConstructorDescriptor( |
68 Isolate* isolate, CodeStub::Major major, | 66 Isolate* isolate, CodeStub::Major major, |
69 CodeStubInterfaceDescriptor* descriptor, | 67 CodeStubInterfaceDescriptor* descriptor, |
70 int constant_stack_parameter_count) { | 68 int constant_stack_parameter_count) { |
71 Address deopt_handler = Runtime::FunctionForId( | 69 Address deopt_handler = Runtime::FunctionForId( |
72 Runtime::kInternalArrayConstructor)->entry; | 70 Runtime::kInternalArrayConstructor)->entry; |
73 | 71 |
74 if (constant_stack_parameter_count == 0) { | 72 if (constant_stack_parameter_count == 0) { |
75 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( | 73 InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); |
76 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); | |
77 descriptor->Initialize(major, call_descriptor, deopt_handler, | 74 descriptor->Initialize(major, call_descriptor, deopt_handler, |
78 constant_stack_parameter_count, | 75 constant_stack_parameter_count, |
79 JS_FUNCTION_STUB_MODE); | 76 JS_FUNCTION_STUB_MODE); |
80 } else { | 77 } else { |
81 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( | 78 InternalArrayConstructorDescriptor call_descriptor(isolate); |
82 CallDescriptorKey::InternalArrayConstructorCall); | |
83 descriptor->Initialize(major, call_descriptor, x0, deopt_handler, | 79 descriptor->Initialize(major, call_descriptor, x0, deopt_handler, |
84 constant_stack_parameter_count, | 80 constant_stack_parameter_count, |
85 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); | 81 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
86 } | 82 } |
87 } | 83 } |
88 | 84 |
89 | 85 |
90 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 86 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
91 CodeStubInterfaceDescriptor* descriptor) { | 87 CodeStubInterfaceDescriptor* descriptor) { |
92 InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), | 88 InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 __ SetStackPointer(csp); | 1420 __ SetStackPointer(csp); |
1425 __ PopCalleeSavedRegisters(); | 1421 __ PopCalleeSavedRegisters(); |
1426 // After this point, we must not modify jssp because it is a callee-saved | 1422 // After this point, we must not modify jssp because it is a callee-saved |
1427 // register which we have just restored. | 1423 // register which we have just restored. |
1428 __ Ret(); | 1424 __ Ret(); |
1429 } | 1425 } |
1430 | 1426 |
1431 | 1427 |
1432 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 1428 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
1433 Label miss; | 1429 Label miss; |
1434 Register receiver = LoadConvention::ReceiverRegister(); | 1430 Register receiver = LoadDescriptor::ReceiverRegister(); |
1435 | 1431 |
1436 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, | 1432 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, |
1437 x11, &miss); | 1433 x11, &miss); |
1438 | 1434 |
1439 __ Bind(&miss); | 1435 __ Bind(&miss); |
1440 PropertyAccessCompiler::TailCallBuiltin( | 1436 PropertyAccessCompiler::TailCallBuiltin( |
1441 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 1437 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
1442 } | 1438 } |
1443 | 1439 |
1444 | 1440 |
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4298 __ Add(x1, x1, 1); | 4294 __ Add(x1, x1, 1); |
4299 } | 4295 } |
4300 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 4296 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
4301 __ Drop(x1); | 4297 __ Drop(x1); |
4302 // Return to IC Miss stub, continuation still on stack. | 4298 // Return to IC Miss stub, continuation still on stack. |
4303 __ Ret(); | 4299 __ Ret(); |
4304 } | 4300 } |
4305 | 4301 |
4306 | 4302 |
4307 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { | 4303 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4308 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); | 4304 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
4309 VectorLoadStub stub(isolate(), state()); | 4305 VectorLoadStub stub(isolate(), state()); |
4310 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 4306 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
4311 } | 4307 } |
4312 | 4308 |
4313 | 4309 |
4314 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 4310 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4315 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); | 4311 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
4316 VectorKeyedLoadStub stub(isolate()); | 4312 VectorKeyedLoadStub stub(isolate()); |
4317 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 4313 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
4318 } | 4314 } |
4319 | 4315 |
4320 | 4316 |
4321 static unsigned int GetProfileEntryHookCallSize(MacroAssembler* masm) { | 4317 static unsigned int GetProfileEntryHookCallSize(MacroAssembler* masm) { |
4322 // The entry hook is a "BumpSystemStackPointer" instruction (sub), | 4318 // The entry hook is a "BumpSystemStackPointer" instruction (sub), |
4323 // followed by a "Push lr" instruction, followed by a call. | 4319 // followed by a "Push lr" instruction, followed by a call. |
4324 unsigned int size = | 4320 unsigned int size = |
4325 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize); | 4321 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize); |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5141 MemOperand(fp, 6 * kPointerSize), | 5137 MemOperand(fp, 6 * kPointerSize), |
5142 NULL); | 5138 NULL); |
5143 } | 5139 } |
5144 | 5140 |
5145 | 5141 |
5146 #undef __ | 5142 #undef __ |
5147 | 5143 |
5148 } } // namespace v8::internal | 5144 } } // namespace v8::internal |
5149 | 5145 |
5150 #endif // V8_TARGET_ARCH_ARM64 | 5146 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |