OLD | NEW |
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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); | 1876 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); |
1877 __ jmp(ecx); | 1877 __ jmp(ecx); |
1878 | 1878 |
1879 __ bind(&non_function); | 1879 __ bind(&non_function); |
1880 if (IsSuperConstructorCall()) __ Drop(1); | 1880 if (IsSuperConstructorCall()) __ Drop(1); |
1881 __ mov(edx, edi); | 1881 __ mov(edx, edi); |
1882 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1882 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
1883 } | 1883 } |
1884 | 1884 |
1885 | 1885 |
1886 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { | |
1887 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | |
1888 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset)); | |
1889 __ mov(vector, FieldOperand(vector, | |
1890 SharedFunctionInfo::kFeedbackVectorOffset)); | |
1891 } | |
1892 | |
1893 | |
1894 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { | 1886 void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { |
1895 // edi - function | 1887 // edi - function |
1896 // edx - slot id | 1888 // edx - slot id |
1897 // ebx - vector | 1889 // ebx - vector |
1898 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 1890 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
1899 __ cmp(edi, ecx); | 1891 __ cmp(edi, ecx); |
1900 __ j(not_equal, miss); | 1892 __ j(not_equal, miss); |
1901 | 1893 |
1902 __ mov(eax, arg_count()); | 1894 __ mov(eax, arg_count()); |
1903 // Reload ecx. | 1895 // Reload ecx. |
(...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3984 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 3976 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
3985 __ pop(ecx); | 3977 __ pop(ecx); |
3986 int additional_offset = | 3978 int additional_offset = |
3987 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; | 3979 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; |
3988 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); | 3980 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); |
3989 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. | 3981 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. |
3990 } | 3982 } |
3991 | 3983 |
3992 | 3984 |
3993 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { | 3985 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { |
3994 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); | 3986 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister()); |
3995 LoadICStub stub(isolate(), state()); | 3987 LoadICStub stub(isolate(), state()); |
3996 stub.GenerateForTrampoline(masm); | 3988 stub.GenerateForTrampoline(masm); |
3997 } | 3989 } |
3998 | 3990 |
3999 | 3991 |
4000 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 3992 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4001 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); | 3993 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister()); |
4002 KeyedLoadICStub stub(isolate(), state()); | 3994 KeyedLoadICStub stub(isolate(), state()); |
4003 stub.GenerateForTrampoline(masm); | 3995 stub.GenerateForTrampoline(masm); |
4004 } | 3996 } |
4005 | 3997 |
4006 | 3998 |
4007 static void HandleArrayCases(MacroAssembler* masm, Register receiver, | 3999 static void HandleArrayCases(MacroAssembler* masm, Register receiver, |
4008 Register key, Register vector, Register slot, | 4000 Register key, Register vector, Register slot, |
4009 Register feedback, bool is_polymorphic, | 4001 Register feedback, bool is_polymorphic, |
4010 Label* miss) { | 4002 Label* miss) { |
4011 // feedback initially contains the feedback array | 4003 // feedback initially contains the feedback array |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4215 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, | 4207 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, |
4216 FixedArray::kHeaderSize + kPointerSize)); | 4208 FixedArray::kHeaderSize + kPointerSize)); |
4217 HandleArrayCases(masm, receiver, key, vector, slot, feedback, false, &miss); | 4209 HandleArrayCases(masm, receiver, key, vector, slot, feedback, false, &miss); |
4218 | 4210 |
4219 __ bind(&miss); | 4211 __ bind(&miss); |
4220 KeyedLoadIC::GenerateMiss(masm); | 4212 KeyedLoadIC::GenerateMiss(masm); |
4221 } | 4213 } |
4222 | 4214 |
4223 | 4215 |
4224 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) { | 4216 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) { |
4225 EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister()); | 4217 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); |
4226 VectorStoreICStub stub(isolate(), state()); | 4218 VectorStoreICStub stub(isolate(), state()); |
4227 stub.GenerateForTrampoline(masm); | 4219 stub.GenerateForTrampoline(masm); |
4228 } | 4220 } |
4229 | 4221 |
4230 | 4222 |
4231 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { | 4223 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { |
4232 EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister()); | 4224 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); |
4233 VectorKeyedStoreICStub stub(isolate(), state()); | 4225 VectorKeyedStoreICStub stub(isolate(), state()); |
4234 stub.GenerateForTrampoline(masm); | 4226 stub.GenerateForTrampoline(masm); |
4235 } | 4227 } |
4236 | 4228 |
4237 | 4229 |
4238 void VectorStoreICStub::Generate(MacroAssembler* masm) { | 4230 void VectorStoreICStub::Generate(MacroAssembler* masm) { |
4239 GenerateImpl(masm, false); | 4231 GenerateImpl(masm, false); |
4240 } | 4232 } |
4241 | 4233 |
4242 | 4234 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4575 FixedArray::kHeaderSize + kPointerSize)); | 4567 FixedArray::kHeaderSize + kPointerSize)); |
4576 HandlePolymorphicStoreCase(masm, receiver, key, vector, slot, scratch, &miss); | 4568 HandlePolymorphicStoreCase(masm, receiver, key, vector, slot, scratch, &miss); |
4577 | 4569 |
4578 __ bind(&miss); | 4570 __ bind(&miss); |
4579 __ pop(value); | 4571 __ pop(value); |
4580 KeyedStoreIC::GenerateMiss(masm); | 4572 KeyedStoreIC::GenerateMiss(masm); |
4581 } | 4573 } |
4582 | 4574 |
4583 | 4575 |
4584 void CallICTrampolineStub::Generate(MacroAssembler* masm) { | 4576 void CallICTrampolineStub::Generate(MacroAssembler* masm) { |
4585 EmitLoadTypeFeedbackVector(masm, ebx); | 4577 __ EmitLoadTypeFeedbackVector(ebx); |
4586 CallICStub stub(isolate(), state()); | 4578 CallICStub stub(isolate(), state()); |
4587 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); | 4579 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
4588 } | 4580 } |
4589 | 4581 |
4590 | 4582 |
4591 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 4583 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
4592 if (masm->isolate()->function_entry_hook() != NULL) { | 4584 if (masm->isolate()->function_entry_hook() != NULL) { |
4593 ProfileEntryHookStub stub(masm->isolate()); | 4585 ProfileEntryHookStub stub(masm->isolate()); |
4594 masm->CallStub(&stub); | 4586 masm->CallStub(&stub); |
4595 } | 4587 } |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5503 Operand(ebp, 7 * kPointerSize), NULL); | 5495 Operand(ebp, 7 * kPointerSize), NULL); |
5504 } | 5496 } |
5505 | 5497 |
5506 | 5498 |
5507 #undef __ | 5499 #undef __ |
5508 | 5500 |
5509 } // namespace internal | 5501 } // namespace internal |
5510 } // namespace v8 | 5502 } // namespace v8 |
5511 | 5503 |
5512 #endif // V8_TARGET_ARCH_X87 | 5504 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |