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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 2185 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
2186 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset)); | 2186 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset)); |
2187 __ mov(vector, FieldOperand(vector, | 2187 __ mov(vector, FieldOperand(vector, |
2188 SharedFunctionInfo::kFeedbackVectorOffset)); | 2188 SharedFunctionInfo::kFeedbackVectorOffset)); |
2189 } | 2189 } |
2190 | 2190 |
2191 | 2191 |
2192 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { | 2192 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
2193 // edi - function | 2193 // edi - function |
2194 // edx - slot id | 2194 // edx - slot id |
| 2195 // ebx - vector |
2195 Label miss; | 2196 Label miss; |
2196 int argc = arg_count(); | 2197 int argc = arg_count(); |
2197 ParameterCount actual(argc); | 2198 ParameterCount actual(argc); |
2198 | 2199 |
2199 EmitLoadTypeFeedbackVector(masm, ebx); | |
2200 | |
2201 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 2200 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
2202 __ cmp(edi, ecx); | 2201 __ cmp(edi, ecx); |
2203 __ j(not_equal, &miss); | 2202 __ j(not_equal, &miss); |
2204 | 2203 |
2205 __ mov(eax, arg_count()); | 2204 __ mov(eax, arg_count()); |
2206 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 2205 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
2207 FixedArray::kHeaderSize)); | 2206 FixedArray::kHeaderSize)); |
2208 | 2207 |
2209 // Verify that ecx contains an AllocationSite | 2208 // Verify that ecx contains an AllocationSite |
2210 Factory* factory = masm->isolate()->factory(); | 2209 Factory* factory = masm->isolate()->factory(); |
(...skipping 15 matching lines...) Expand all Loading... |
2226 CallAsMethod()); | 2225 CallAsMethod()); |
2227 | 2226 |
2228 // Unreachable. | 2227 // Unreachable. |
2229 __ int3(); | 2228 __ int3(); |
2230 } | 2229 } |
2231 | 2230 |
2232 | 2231 |
2233 void CallICStub::Generate(MacroAssembler* masm) { | 2232 void CallICStub::Generate(MacroAssembler* masm) { |
2234 // edi - function | 2233 // edi - function |
2235 // edx - slot id | 2234 // edx - slot id |
| 2235 // ebx - vector |
2236 Isolate* isolate = masm->isolate(); | 2236 Isolate* isolate = masm->isolate(); |
2237 const int with_types_offset = | 2237 const int with_types_offset = |
2238 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); | 2238 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); |
2239 const int generic_offset = | 2239 const int generic_offset = |
2240 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); | 2240 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); |
2241 Label extra_checks_or_miss, slow_start; | 2241 Label extra_checks_or_miss, slow_start; |
2242 Label slow, non_function, wrap, cont; | 2242 Label slow, non_function, wrap, cont; |
2243 Label have_js_function; | 2243 Label have_js_function; |
2244 int argc = arg_count(); | 2244 int argc = arg_count(); |
2245 ParameterCount actual(argc); | 2245 ParameterCount actual(argc); |
2246 | 2246 |
2247 EmitLoadTypeFeedbackVector(masm, ebx); | |
2248 | |
2249 // The checks. First, does edi match the recorded monomorphic target? | 2247 // The checks. First, does edi match the recorded monomorphic target? |
2250 __ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size, | 2248 __ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size, |
2251 FixedArray::kHeaderSize)); | 2249 FixedArray::kHeaderSize)); |
2252 __ j(not_equal, &extra_checks_or_miss); | 2250 __ j(not_equal, &extra_checks_or_miss); |
2253 | 2251 |
2254 __ bind(&have_js_function); | 2252 __ bind(&have_js_function); |
2255 if (CallAsMethod()) { | 2253 if (CallAsMethod()) { |
2256 EmitContinueIfStrictOrNative(masm, &cont); | 2254 EmitContinueIfStrictOrNative(masm, &cont); |
2257 | 2255 |
2258 // Load the receiver from the stack. | 2256 // Load the receiver from the stack. |
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4330 } | 4328 } |
4331 | 4329 |
4332 | 4330 |
4333 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 4331 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4334 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); | 4332 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
4335 VectorKeyedLoadStub stub(isolate()); | 4333 VectorKeyedLoadStub stub(isolate()); |
4336 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); | 4334 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
4337 } | 4335 } |
4338 | 4336 |
4339 | 4337 |
| 4338 void CallICTrampolineStub::Generate(MacroAssembler* masm) { |
| 4339 EmitLoadTypeFeedbackVector(masm, ebx); |
| 4340 CallICStub stub(isolate(), state()); |
| 4341 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 4342 } |
| 4343 |
| 4344 |
| 4345 void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) { |
| 4346 EmitLoadTypeFeedbackVector(masm, ebx); |
| 4347 CallIC_ArrayStub stub(isolate(), state()); |
| 4348 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 4349 } |
| 4350 |
| 4351 |
4340 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 4352 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
4341 if (masm->isolate()->function_entry_hook() != NULL) { | 4353 if (masm->isolate()->function_entry_hook() != NULL) { |
4342 ProfileEntryHookStub stub(masm->isolate()); | 4354 ProfileEntryHookStub stub(masm->isolate()); |
4343 masm->CallStub(&stub); | 4355 masm->CallStub(&stub); |
4344 } | 4356 } |
4345 } | 4357 } |
4346 | 4358 |
4347 | 4359 |
4348 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { | 4360 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
4349 // Save volatile registers. | 4361 // Save volatile registers. |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5062 ApiParameterOperand(2), kStackSpace, nullptr, | 5074 ApiParameterOperand(2), kStackSpace, nullptr, |
5063 Operand(ebp, 7 * kPointerSize), NULL); | 5075 Operand(ebp, 7 * kPointerSize), NULL); |
5064 } | 5076 } |
5065 | 5077 |
5066 | 5078 |
5067 #undef __ | 5079 #undef __ |
5068 | 5080 |
5069 } } // namespace v8::internal | 5081 } } // namespace v8::internal |
5070 | 5082 |
5071 #endif // V8_TARGET_ARCH_IA32 | 5083 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |