OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 131 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
132 Isolate* isolate, | 132 Isolate* isolate, |
133 CodeStubInterfaceDescriptor* descriptor) { | 133 CodeStubInterfaceDescriptor* descriptor) { |
134 static Register registers[] = { edx }; | 134 static Register registers[] = { edx }; |
135 descriptor->register_param_count_ = 1; | 135 descriptor->register_param_count_ = 1; |
136 descriptor->register_params_ = registers; | 136 descriptor->register_params_ = registers; |
137 descriptor->deoptimization_handler_ = NULL; | 137 descriptor->deoptimization_handler_ = NULL; |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 void KeyedArrayCallStub::InitializeInterfaceDescriptor( | |
142 Isolate* isolate, | |
143 CodeStubInterfaceDescriptor* descriptor) { | |
144 static Register registers[] = { ecx }; | |
145 descriptor->register_param_count_ = 1; | |
146 descriptor->register_params_ = registers; | |
147 descriptor->continuation_type_ = TAIL_CALL_CONTINUATION; | |
148 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | |
149 descriptor->deoptimization_handler_ = | |
150 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure); | |
151 } | |
152 | |
153 | |
154 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 141 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
155 Isolate* isolate, | 142 Isolate* isolate, |
156 CodeStubInterfaceDescriptor* descriptor) { | 143 CodeStubInterfaceDescriptor* descriptor) { |
157 static Register registers[] = { edx, ecx, eax }; | 144 static Register registers[] = { edx, ecx, eax }; |
158 descriptor->register_param_count_ = 3; | 145 descriptor->register_param_count_ = 3; |
159 descriptor->register_params_ = registers; | 146 descriptor->register_params_ = registers; |
160 descriptor->deoptimization_handler_ = | 147 descriptor->deoptimization_handler_ = |
161 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | 148 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); |
162 } | 149 } |
163 | 150 |
(...skipping 5501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5665 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 5652 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
5666 __ pop(ecx); | 5653 __ pop(ecx); |
5667 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE | 5654 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE |
5668 ? kPointerSize | 5655 ? kPointerSize |
5669 : 0; | 5656 : 0; |
5670 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); | 5657 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); |
5671 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. | 5658 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. |
5672 } | 5659 } |
5673 | 5660 |
5674 | 5661 |
5675 void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) { | |
5676 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); | |
5677 __ call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); | |
5678 __ mov(edi, eax); | |
5679 int parameter_count_offset = | |
5680 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | |
5681 __ mov(eax, MemOperand(ebp, parameter_count_offset)); | |
5682 // The parameter count above includes the receiver for the arguments passed to | |
5683 // the deoptimization handler. Subtract the receiver for the parameter count | |
5684 // for the call. | |
5685 __ sub(eax, Immediate(1)); | |
5686 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | |
5687 ParameterCount argument_count(eax); | |
5688 __ InvokeFunction( | |
5689 edi, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | |
5690 } | |
5691 | |
5692 | |
5693 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 5662 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
5694 if (masm->isolate()->function_entry_hook() != NULL) { | 5663 if (masm->isolate()->function_entry_hook() != NULL) { |
5695 // It's always safe to call the entry hook stub, as the hook itself | 5664 // It's always safe to call the entry hook stub, as the hook itself |
5696 // is not allowed to call back to V8. | 5665 // is not allowed to call back to V8. |
5697 AllowStubCallsScope allow_stub_calls(masm, true); | 5666 AllowStubCallsScope allow_stub_calls(masm, true); |
5698 | 5667 |
5699 ProfileEntryHookStub stub; | 5668 ProfileEntryHookStub stub; |
5700 masm->CallStub(&stub); | 5669 masm->CallStub(&stub); |
5701 } | 5670 } |
5702 } | 5671 } |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6060 __ bind(&fast_elements_case); | 6029 __ bind(&fast_elements_case); |
6061 GenerateCase(masm, FAST_ELEMENTS); | 6030 GenerateCase(masm, FAST_ELEMENTS); |
6062 } | 6031 } |
6063 | 6032 |
6064 | 6033 |
6065 #undef __ | 6034 #undef __ |
6066 | 6035 |
6067 } } // namespace v8::internal | 6036 } } // namespace v8::internal |
6068 | 6037 |
6069 #endif // V8_TARGET_ARCH_IA32 | 6038 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |