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/ia32/code-stubs-ia32.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 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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); 2169 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize));
2170 __ jmp(ecx); 2170 __ jmp(ecx);
2171 2171
2172 __ bind(&non_function); 2172 __ bind(&non_function);
2173 if (IsSuperConstructorCall()) __ Drop(1); 2173 if (IsSuperConstructorCall()) __ Drop(1);
2174 __ mov(edx, edi); 2174 __ mov(edx, edi);
2175 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 2175 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
2176 } 2176 }
2177 2177
2178 2178
2179 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
2180 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
2181 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
2182 __ mov(vector, FieldOperand(vector,
2183 SharedFunctionInfo::kFeedbackVectorOffset));
2184 }
2185
2186
2187 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { 2179 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
2188 // edi - function 2180 // edi - function
2189 // edx - slot id 2181 // edx - slot id
2190 // ebx - vector 2182 // ebx - vector
2191 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); 2183 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
2192 __ cmp(edi, ecx); 2184 __ cmp(edi, ecx);
2193 __ j(not_equal, miss); 2185 __ j(not_equal, miss);
2194 2186
2195 __ mov(eax, arg_count()); 2187 __ mov(eax, arg_count());
2196 // Reload ecx. 2188 // Reload ecx.
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after
4304 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 4296 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
4305 __ pop(ecx); 4297 __ pop(ecx);
4306 int additional_offset = 4298 int additional_offset =
4307 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; 4299 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0;
4308 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); 4300 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset));
4309 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. 4301 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
4310 } 4302 }
4311 4303
4312 4304
4313 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { 4305 void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
4314 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); 4306 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
4315 LoadICStub stub(isolate(), state()); 4307 LoadICStub stub(isolate(), state());
4316 stub.GenerateForTrampoline(masm); 4308 stub.GenerateForTrampoline(masm);
4317 } 4309 }
4318 4310
4319 4311
4320 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 4312 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
4321 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); 4313 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
4322 KeyedLoadICStub stub(isolate(), state()); 4314 KeyedLoadICStub stub(isolate(), state());
4323 stub.GenerateForTrampoline(masm); 4315 stub.GenerateForTrampoline(masm);
4324 } 4316 }
4325 4317
4326 4318
4327 static void HandleArrayCases(MacroAssembler* masm, Register receiver, 4319 static void HandleArrayCases(MacroAssembler* masm, Register receiver,
4328 Register key, Register vector, Register slot, 4320 Register key, Register vector, Register slot,
4329 Register feedback, bool is_polymorphic, 4321 Register feedback, bool is_polymorphic,
4330 Label* miss) { 4322 Label* miss) {
4331 // feedback initially contains the feedback array 4323 // feedback initially contains the feedback array
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
4535 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, 4527 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size,
4536 FixedArray::kHeaderSize + kPointerSize)); 4528 FixedArray::kHeaderSize + kPointerSize));
4537 HandleArrayCases(masm, receiver, key, vector, slot, feedback, false, &miss); 4529 HandleArrayCases(masm, receiver, key, vector, slot, feedback, false, &miss);
4538 4530
4539 __ bind(&miss); 4531 __ bind(&miss);
4540 KeyedLoadIC::GenerateMiss(masm); 4532 KeyedLoadIC::GenerateMiss(masm);
4541 } 4533 }
4542 4534
4543 4535
4544 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) { 4536 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
4545 EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister()); 4537 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
4546 VectorStoreICStub stub(isolate(), state()); 4538 VectorStoreICStub stub(isolate(), state());
4547 stub.GenerateForTrampoline(masm); 4539 stub.GenerateForTrampoline(masm);
4548 } 4540 }
4549 4541
4550 4542
4551 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { 4543 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
4552 EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister()); 4544 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
4553 VectorKeyedStoreICStub stub(isolate(), state()); 4545 VectorKeyedStoreICStub stub(isolate(), state());
4554 stub.GenerateForTrampoline(masm); 4546 stub.GenerateForTrampoline(masm);
4555 } 4547 }
4556 4548
4557 4549
4558 void VectorStoreICStub::Generate(MacroAssembler* masm) { 4550 void VectorStoreICStub::Generate(MacroAssembler* masm) {
4559 GenerateImpl(masm, false); 4551 GenerateImpl(masm, false);
4560 } 4552 }
4561 4553
4562 4554
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4895 FixedArray::kHeaderSize + kPointerSize)); 4887 FixedArray::kHeaderSize + kPointerSize));
4896 HandlePolymorphicStoreCase(masm, receiver, key, vector, slot, scratch, &miss); 4888 HandlePolymorphicStoreCase(masm, receiver, key, vector, slot, scratch, &miss);
4897 4889
4898 __ bind(&miss); 4890 __ bind(&miss);
4899 __ pop(value); 4891 __ pop(value);
4900 KeyedStoreIC::GenerateMiss(masm); 4892 KeyedStoreIC::GenerateMiss(masm);
4901 } 4893 }
4902 4894
4903 4895
4904 void CallICTrampolineStub::Generate(MacroAssembler* masm) { 4896 void CallICTrampolineStub::Generate(MacroAssembler* masm) {
4905 EmitLoadTypeFeedbackVector(masm, ebx); 4897 __ EmitLoadTypeFeedbackVector(ebx);
4906 CallICStub stub(isolate(), state()); 4898 CallICStub stub(isolate(), state());
4907 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); 4899 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
4908 } 4900 }
4909 4901
4910 4902
4911 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 4903 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
4912 if (masm->isolate()->function_entry_hook() != NULL) { 4904 if (masm->isolate()->function_entry_hook() != NULL) {
4913 ProfileEntryHookStub stub(masm->isolate()); 4905 ProfileEntryHookStub stub(masm->isolate());
4914 masm->CallStub(&stub); 4906 masm->CallStub(&stub);
4915 } 4907 }
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
5823 Operand(ebp, 7 * kPointerSize), NULL); 5815 Operand(ebp, 7 * kPointerSize), NULL);
5824 } 5816 }
5825 5817
5826 5818
5827 #undef __ 5819 #undef __
5828 5820
5829 } // namespace internal 5821 } // namespace internal
5830 } // namespace v8 5822 } // namespace v8
5831 5823
5832 #endif // V8_TARGET_ARCH_IA32 5824 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698