OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 127 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
128 Isolate* isolate, | 128 Isolate* isolate, |
129 CodeStubInterfaceDescriptor* descriptor) { | 129 CodeStubInterfaceDescriptor* descriptor) { |
130 static Register registers[] = { rdx }; | 130 static Register registers[] = { rdx }; |
131 descriptor->register_param_count_ = 1; | 131 descriptor->register_param_count_ = 1; |
132 descriptor->register_params_ = registers; | 132 descriptor->register_params_ = registers; |
133 descriptor->deoptimization_handler_ = NULL; | 133 descriptor->deoptimization_handler_ = NULL; |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 void KeyedArrayCallStub::InitializeInterfaceDescriptor( | |
138 Isolate* isolate, | |
139 CodeStubInterfaceDescriptor* descriptor) { | |
140 static Register registers[] = { rcx }; | |
141 descriptor->register_param_count_ = 1; | |
142 descriptor->register_params_ = registers; | |
143 descriptor->continuation_type_ = TAIL_CALL_CONTINUATION; | |
144 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | |
145 descriptor->deoptimization_handler_ = | |
146 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure); | |
147 } | |
148 | |
149 | |
150 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 137 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
151 Isolate* isolate, | 138 Isolate* isolate, |
152 CodeStubInterfaceDescriptor* descriptor) { | 139 CodeStubInterfaceDescriptor* descriptor) { |
153 static Register registers[] = { rdx, rcx, rax }; | 140 static Register registers[] = { rdx, rcx, rax }; |
154 descriptor->register_param_count_ = 3; | 141 descriptor->register_param_count_ = 3; |
155 descriptor->register_params_ = registers; | 142 descriptor->register_params_ = registers; |
156 descriptor->deoptimization_handler_ = | 143 descriptor->deoptimization_handler_ = |
157 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | 144 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); |
158 } | 145 } |
159 | 146 |
(...skipping 5304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5464 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 5451 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
5465 __ PopReturnAddressTo(rcx); | 5452 __ PopReturnAddressTo(rcx); |
5466 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE | 5453 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE |
5467 ? kPointerSize | 5454 ? kPointerSize |
5468 : 0; | 5455 : 0; |
5469 __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size, additional_offset)); | 5456 __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size, additional_offset)); |
5470 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack. | 5457 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack. |
5471 } | 5458 } |
5472 | 5459 |
5473 | 5460 |
5474 void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) { | |
5475 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); | |
5476 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET); | |
5477 __ movq(rdi, rax); | |
5478 int parameter_count_offset = | |
5479 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | |
5480 __ movq(rax, MemOperand(rbp, parameter_count_offset)); | |
5481 // The parameter count above includes the receiver for the arguments passed to | |
5482 // the deoptimization handler. Subtract the receiver for the parameter count | |
5483 // for the call. | |
5484 __ subl(rax, Immediate(1)); | |
5485 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | |
5486 ParameterCount argument_count(rax); | |
5487 __ InvokeFunction( | |
5488 rdi, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | |
5489 } | |
5490 | |
5491 | |
5492 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 5461 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
5493 if (masm->isolate()->function_entry_hook() != NULL) { | 5462 if (masm->isolate()->function_entry_hook() != NULL) { |
5494 // It's always safe to call the entry hook stub, as the hook itself | 5463 // It's always safe to call the entry hook stub, as the hook itself |
5495 // is not allowed to call back to V8. | 5464 // is not allowed to call back to V8. |
5496 AllowStubCallsScope allow_stub_calls(masm, true); | 5465 AllowStubCallsScope allow_stub_calls(masm, true); |
5497 | 5466 |
5498 ProfileEntryHookStub stub; | 5467 ProfileEntryHookStub stub; |
5499 masm->CallStub(&stub); | 5468 masm->CallStub(&stub); |
5500 } | 5469 } |
5501 } | 5470 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5871 __ bind(&fast_elements_case); | 5840 __ bind(&fast_elements_case); |
5872 GenerateCase(masm, FAST_ELEMENTS); | 5841 GenerateCase(masm, FAST_ELEMENTS); |
5873 } | 5842 } |
5874 | 5843 |
5875 | 5844 |
5876 #undef __ | 5845 #undef __ |
5877 | 5846 |
5878 } } // namespace v8::internal | 5847 } } // namespace v8::internal |
5879 | 5848 |
5880 #endif // V8_TARGET_ARCH_X64 | 5849 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |