Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 71783003: Reland and fix "Add support for keyed-call on arrays of fast elements" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test + fix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/typing.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
137 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 150 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
138 Isolate* isolate, 151 Isolate* isolate,
139 CodeStubInterfaceDescriptor* descriptor) { 152 CodeStubInterfaceDescriptor* descriptor) {
140 static Register registers[] = { rdx, rcx, rax }; 153 static Register registers[] = { rdx, rcx, rax };
141 descriptor->register_param_count_ = 3; 154 descriptor->register_param_count_ = 3;
142 descriptor->register_params_ = registers; 155 descriptor->register_params_ = registers;
143 descriptor->deoptimization_handler_ = 156 descriptor->deoptimization_handler_ =
144 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 157 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
145 } 158 }
146 159
(...skipping 5304 matching lines...) Expand 10 before | Expand all | Expand 10 after
5451 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 5464 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
5452 __ PopReturnAddressTo(rcx); 5465 __ PopReturnAddressTo(rcx);
5453 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE 5466 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE
5454 ? kPointerSize 5467 ? kPointerSize
5455 : 0; 5468 : 0;
5456 __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size, additional_offset)); 5469 __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size, additional_offset));
5457 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack. 5470 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack.
5458 } 5471 }
5459 5472
5460 5473
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
5461 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 5492 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
5462 if (masm->isolate()->function_entry_hook() != NULL) { 5493 if (masm->isolate()->function_entry_hook() != NULL) {
5463 // It's always safe to call the entry hook stub, as the hook itself 5494 // It's always safe to call the entry hook stub, as the hook itself
5464 // is not allowed to call back to V8. 5495 // is not allowed to call back to V8.
5465 AllowStubCallsScope allow_stub_calls(masm, true); 5496 AllowStubCallsScope allow_stub_calls(masm, true);
5466 5497
5467 ProfileEntryHookStub stub; 5498 ProfileEntryHookStub stub;
5468 masm->CallStub(&stub); 5499 masm->CallStub(&stub);
5469 } 5500 }
5470 } 5501 }
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
5840 __ bind(&fast_elements_case); 5871 __ bind(&fast_elements_case);
5841 GenerateCase(masm, FAST_ELEMENTS); 5872 GenerateCase(masm, FAST_ELEMENTS);
5842 } 5873 }
5843 5874
5844 5875
5845 #undef __ 5876 #undef __
5846 5877
5847 } } // namespace v8::internal 5878 } } // namespace v8::internal
5848 5879
5849 #endif // V8_TARGET_ARCH_X64 5880 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/typing.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698