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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 CodeStubInterfaceDescriptor* descriptor, | 25 CodeStubInterfaceDescriptor* descriptor, |
26 int constant_stack_parameter_count) { | 26 int constant_stack_parameter_count) { |
27 // register state | 27 // register state |
28 // eax -- number of arguments | 28 // eax -- number of arguments |
29 // edi -- function | 29 // edi -- function |
30 // ebx -- allocation site with elements kind | 30 // ebx -- allocation site with elements kind |
31 Address deopt_handler = Runtime::FunctionForId( | 31 Address deopt_handler = Runtime::FunctionForId( |
32 Runtime::kArrayConstructor)->entry; | 32 Runtime::kArrayConstructor)->entry; |
33 | 33 |
34 if (constant_stack_parameter_count == 0) { | 34 if (constant_stack_parameter_count == 0) { |
35 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( | 35 ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); |
36 CallDescriptorKey::ArrayConstructorConstantArgCountCall); | |
37 descriptor->Initialize(major, call_descriptor, deopt_handler, | 36 descriptor->Initialize(major, call_descriptor, deopt_handler, |
38 constant_stack_parameter_count, | 37 constant_stack_parameter_count, |
39 JS_FUNCTION_STUB_MODE); | 38 JS_FUNCTION_STUB_MODE); |
40 } else { | 39 } else { |
41 CallInterfaceDescriptor* call_descriptor = | 40 ArrayConstructorDescriptor call_descriptor(isolate); |
42 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); | |
43 descriptor->Initialize(major, call_descriptor, eax, deopt_handler, | 41 descriptor->Initialize(major, call_descriptor, eax, deopt_handler, |
44 constant_stack_parameter_count, | 42 constant_stack_parameter_count, |
45 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); | 43 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
46 } | 44 } |
47 } | 45 } |
48 | 46 |
49 | 47 |
50 static void InitializeInternalArrayConstructorDescriptor( | 48 static void InitializeInternalArrayConstructorDescriptor( |
51 Isolate* isolate, CodeStub::Major major, | 49 Isolate* isolate, CodeStub::Major major, |
52 CodeStubInterfaceDescriptor* descriptor, | 50 CodeStubInterfaceDescriptor* descriptor, |
53 int constant_stack_parameter_count) { | 51 int constant_stack_parameter_count) { |
54 // register state | 52 // register state |
55 // eax -- number of arguments | 53 // eax -- number of arguments |
56 // edi -- constructor function | 54 // edi -- constructor function |
57 Address deopt_handler = Runtime::FunctionForId( | 55 Address deopt_handler = Runtime::FunctionForId( |
58 Runtime::kInternalArrayConstructor)->entry; | 56 Runtime::kInternalArrayConstructor)->entry; |
59 | 57 |
60 if (constant_stack_parameter_count == 0) { | 58 if (constant_stack_parameter_count == 0) { |
61 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( | 59 InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); |
62 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); | |
63 descriptor->Initialize(major, call_descriptor, deopt_handler, | 60 descriptor->Initialize(major, call_descriptor, deopt_handler, |
64 constant_stack_parameter_count, | 61 constant_stack_parameter_count, |
65 JS_FUNCTION_STUB_MODE); | 62 JS_FUNCTION_STUB_MODE); |
66 } else { | 63 } else { |
67 CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( | 64 InternalArrayConstructorDescriptor call_descriptor(isolate); |
68 CallDescriptorKey::InternalArrayConstructorCall); | |
69 descriptor->Initialize(major, call_descriptor, eax, deopt_handler, | 65 descriptor->Initialize(major, call_descriptor, eax, deopt_handler, |
70 constant_stack_parameter_count, | 66 constant_stack_parameter_count, |
71 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); | 67 JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
72 } | 68 } |
73 } | 69 } |
74 | 70 |
75 | 71 |
76 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 72 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
77 CodeStubInterfaceDescriptor* descriptor) { | 73 CodeStubInterfaceDescriptor* descriptor) { |
78 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); | 74 InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 327 |
332 | 328 |
333 void MathPowStub::Generate(MacroAssembler* masm) { | 329 void MathPowStub::Generate(MacroAssembler* masm) { |
334 // No SSE2 support | 330 // No SSE2 support |
335 UNREACHABLE(); | 331 UNREACHABLE(); |
336 } | 332 } |
337 | 333 |
338 | 334 |
339 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 335 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
340 Label miss; | 336 Label miss; |
341 Register receiver = LoadConvention::ReceiverRegister(); | 337 Register receiver = LoadDescriptor::ReceiverRegister(); |
342 | 338 |
343 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax, | 339 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax, |
344 ebx, &miss); | 340 ebx, &miss); |
345 __ bind(&miss); | 341 __ bind(&miss); |
346 PropertyAccessCompiler::TailCallBuiltin( | 342 PropertyAccessCompiler::TailCallBuiltin( |
347 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 343 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
348 } | 344 } |
349 | 345 |
350 | 346 |
351 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 347 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
(...skipping 3529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3881 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 3877 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
3882 __ pop(ecx); | 3878 __ pop(ecx); |
3883 int additional_offset = | 3879 int additional_offset = |
3884 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; | 3880 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; |
3885 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); | 3881 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); |
3886 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. | 3882 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. |
3887 } | 3883 } |
3888 | 3884 |
3889 | 3885 |
3890 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { | 3886 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { |
3891 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); | 3887 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
3892 VectorLoadStub stub(isolate(), state()); | 3888 VectorLoadStub stub(isolate(), state()); |
3893 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); | 3889 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
3894 } | 3890 } |
3895 | 3891 |
3896 | 3892 |
3897 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 3893 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
3898 EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); | 3894 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
3899 VectorKeyedLoadStub stub(isolate()); | 3895 VectorKeyedLoadStub stub(isolate()); |
3900 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); | 3896 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
3901 } | 3897 } |
3902 | 3898 |
3903 | 3899 |
3904 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 3900 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
3905 if (masm->isolate()->function_entry_hook() != NULL) { | 3901 if (masm->isolate()->function_entry_hook() != NULL) { |
3906 ProfileEntryHookStub stub(masm->isolate()); | 3902 ProfileEntryHookStub stub(masm->isolate()); |
3907 masm->CallStub(&stub); | 3903 masm->CallStub(&stub); |
3908 } | 3904 } |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4405 Operand(ebp, 7 * kPointerSize), | 4401 Operand(ebp, 7 * kPointerSize), |
4406 NULL); | 4402 NULL); |
4407 } | 4403 } |
4408 | 4404 |
4409 | 4405 |
4410 #undef __ | 4406 #undef __ |
4411 | 4407 |
4412 } } // namespace v8::internal | 4408 } } // namespace v8::internal |
4413 | 4409 |
4414 #endif // V8_TARGET_ARCH_X87 | 4410 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |