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

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

Issue 1364373003: Full code shouldn't embed the type feedback vector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. Created 5 years, 2 months 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
OLDNEW
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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 __ movp(rcx, FieldOperand(rcx, SharedFunctionInfo::kConstructStubOffset)); 2016 __ movp(rcx, FieldOperand(rcx, SharedFunctionInfo::kConstructStubOffset));
2017 __ leap(rcx, FieldOperand(rcx, Code::kHeaderSize)); 2017 __ leap(rcx, FieldOperand(rcx, Code::kHeaderSize));
2018 __ jmp(rcx); 2018 __ jmp(rcx);
2019 2019
2020 __ bind(&non_function); 2020 __ bind(&non_function);
2021 __ movp(rdx, rdi); 2021 __ movp(rdx, rdi);
2022 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 2022 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
2023 } 2023 }
2024 2024
2025 2025
2026 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
2027 __ movp(vector, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
2028 __ movp(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
2029 __ movp(vector, FieldOperand(vector,
2030 SharedFunctionInfo::kFeedbackVectorOffset));
2031 }
2032
2033
2034 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { 2026 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
2035 // rdi - function 2027 // rdi - function
2036 // rdx - slot id 2028 // rdx - slot id
2037 // rbx - vector 2029 // rbx - vector
2038 // rcx - allocation site (loaded from vector[slot]). 2030 // rcx - allocation site (loaded from vector[slot]).
2039 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r8); 2031 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r8);
2040 __ cmpp(rdi, r8); 2032 __ cmpp(rdi, r8);
2041 __ j(not_equal, miss); 2033 __ j(not_equal, miss);
2042 2034
2043 __ movp(rax, Immediate(arg_count())); 2035 __ movp(rax, Immediate(arg_count()));
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after
4220 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 4212 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
4221 __ PopReturnAddressTo(rcx); 4213 __ PopReturnAddressTo(rcx);
4222 int additional_offset = 4214 int additional_offset =
4223 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; 4215 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0;
4224 __ leap(rsp, MemOperand(rsp, rbx, times_pointer_size, additional_offset)); 4216 __ leap(rsp, MemOperand(rsp, rbx, times_pointer_size, additional_offset));
4225 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack. 4217 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack.
4226 } 4218 }
4227 4219
4228 4220
4229 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { 4221 void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
4230 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); 4222 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
4231 LoadICStub stub(isolate(), state()); 4223 LoadICStub stub(isolate(), state());
4232 stub.GenerateForTrampoline(masm); 4224 stub.GenerateForTrampoline(masm);
4233 } 4225 }
4234 4226
4235 4227
4236 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 4228 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
4237 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); 4229 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
4238 KeyedLoadICStub stub(isolate(), state()); 4230 KeyedLoadICStub stub(isolate(), state());
4239 stub.GenerateForTrampoline(masm); 4231 stub.GenerateForTrampoline(masm);
4240 } 4232 }
4241 4233
4242 4234
4243 static void HandleArrayCases(MacroAssembler* masm, Register feedback, 4235 static void HandleArrayCases(MacroAssembler* masm, Register feedback,
4244 Register receiver_map, Register scratch1, 4236 Register receiver_map, Register scratch1,
4245 Register scratch2, Register scratch3, 4237 Register scratch2, Register scratch3,
4246 bool is_polymorphic, Label* miss) { 4238 bool is_polymorphic, Label* miss) {
4247 // feedback initially contains the feedback array 4239 // feedback initially contains the feedback array
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
4429 __ bind(&miss); 4421 __ bind(&miss);
4430 KeyedLoadIC::GenerateMiss(masm); 4422 KeyedLoadIC::GenerateMiss(masm);
4431 4423
4432 __ bind(&load_smi_map); 4424 __ bind(&load_smi_map);
4433 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); 4425 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex);
4434 __ jmp(&compare_map); 4426 __ jmp(&compare_map);
4435 } 4427 }
4436 4428
4437 4429
4438 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) { 4430 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
4439 EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister()); 4431 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
4440 VectorStoreICStub stub(isolate(), state()); 4432 VectorStoreICStub stub(isolate(), state());
4441 stub.GenerateForTrampoline(masm); 4433 stub.GenerateForTrampoline(masm);
4442 } 4434 }
4443 4435
4444 4436
4445 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { 4437 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
4446 EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister()); 4438 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
4447 VectorKeyedStoreICStub stub(isolate(), state()); 4439 VectorKeyedStoreICStub stub(isolate(), state());
4448 stub.GenerateForTrampoline(masm); 4440 stub.GenerateForTrampoline(masm);
4449 } 4441 }
4450 4442
4451 4443
4452 void VectorStoreICStub::Generate(MacroAssembler* masm) { 4444 void VectorStoreICStub::Generate(MacroAssembler* masm) {
4453 GenerateImpl(masm, false); 4445 GenerateImpl(masm, false);
4454 } 4446 }
4455 4447
4456 4448
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
4623 __ bind(&miss); 4615 __ bind(&miss);
4624 KeyedStoreIC::GenerateMiss(masm); 4616 KeyedStoreIC::GenerateMiss(masm);
4625 4617
4626 __ bind(&load_smi_map); 4618 __ bind(&load_smi_map);
4627 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); 4619 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex);
4628 __ jmp(&compare_map); 4620 __ jmp(&compare_map);
4629 } 4621 }
4630 4622
4631 4623
4632 void CallICTrampolineStub::Generate(MacroAssembler* masm) { 4624 void CallICTrampolineStub::Generate(MacroAssembler* masm) {
4633 EmitLoadTypeFeedbackVector(masm, rbx); 4625 __ EmitLoadTypeFeedbackVector(rbx);
4634 CallICStub stub(isolate(), state()); 4626 CallICStub stub(isolate(), state());
4635 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); 4627 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
4636 } 4628 }
4637 4629
4638 4630
4639 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 4631 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
4640 if (masm->isolate()->function_entry_hook() != NULL) { 4632 if (masm->isolate()->function_entry_hook() != NULL) {
4641 ProfileEntryHookStub stub(masm->isolate()); 4633 ProfileEntryHookStub stub(masm->isolate());
4642 masm->CallStub(&stub); 4634 masm->CallStub(&stub);
4643 } 4635 }
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
5574 kStackSpace, nullptr, return_value_operand, NULL); 5566 kStackSpace, nullptr, return_value_operand, NULL);
5575 } 5567 }
5576 5568
5577 5569
5578 #undef __ 5570 #undef __
5579 5571
5580 } // namespace internal 5572 } // namespace internal
5581 } // namespace v8 5573 } // namespace v8
5582 5574
5583 #endif // V8_TARGET_ARCH_X64 5575 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698