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 4410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4421 | 4421 |
4422 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { | 4422 void LoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4423 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); | 4423 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); |
4424 LoadICStub stub(isolate(), state()); | 4424 LoadICStub stub(isolate(), state()); |
4425 stub.GenerateForTrampoline(masm); | 4425 stub.GenerateForTrampoline(masm); |
4426 } | 4426 } |
4427 | 4427 |
4428 | 4428 |
4429 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 4429 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4430 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); | 4430 EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister()); |
4431 KeyedLoadICStub stub(isolate()); | 4431 KeyedLoadICStub stub(isolate(), state()); |
4432 stub.GenerateForTrampoline(masm); | 4432 stub.GenerateForTrampoline(masm); |
4433 } | 4433 } |
4434 | 4434 |
4435 | 4435 |
4436 static void HandleArrayCases(MacroAssembler* masm, Register receiver, | 4436 static void HandleArrayCases(MacroAssembler* masm, Register receiver, |
4437 Register key, Register vector, Register slot, | 4437 Register key, Register vector, Register slot, |
4438 Register feedback, bool is_polymorphic, | 4438 Register feedback, bool is_polymorphic, |
4439 Label* miss) { | 4439 Label* miss) { |
4440 // feedback initially contains the feedback array | 4440 // feedback initially contains the feedback array |
4441 Label next, next_loop, prepare_next; | 4441 Label next, next_loop, prepare_next; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4625 // We have a polymorphic element handler. | 4625 // We have a polymorphic element handler. |
4626 Label polymorphic, try_poly_name; | 4626 Label polymorphic, try_poly_name; |
4627 __ bind(&polymorphic); | 4627 __ bind(&polymorphic); |
4628 HandleArrayCases(masm, receiver, key, vector, slot, feedback, true, &miss); | 4628 HandleArrayCases(masm, receiver, key, vector, slot, feedback, true, &miss); |
4629 | 4629 |
4630 __ bind(¬_array); | 4630 __ bind(¬_array); |
4631 // Is it generic? | 4631 // Is it generic? |
4632 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | 4632 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); |
4633 __ j(not_equal, &try_poly_name); | 4633 __ j(not_equal, &try_poly_name); |
4634 Handle<Code> megamorphic_stub = | 4634 Handle<Code> megamorphic_stub = |
4635 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate()); | 4635 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); |
4636 __ jmp(megamorphic_stub, RelocInfo::CODE_TARGET); | 4636 __ jmp(megamorphic_stub, RelocInfo::CODE_TARGET); |
4637 | 4637 |
4638 __ bind(&try_poly_name); | 4638 __ bind(&try_poly_name); |
4639 // We might have a name in feedback, and a fixed array in the next slot. | 4639 // We might have a name in feedback, and a fixed array in the next slot. |
4640 __ cmp(key, feedback); | 4640 __ cmp(key, feedback); |
4641 __ j(not_equal, &miss); | 4641 __ j(not_equal, &miss); |
4642 // If the name comparison succeeded, we know we have a fixed array with | 4642 // If the name comparison succeeded, we know we have a fixed array with |
4643 // at least one map/handler pair. | 4643 // at least one map/handler pair. |
4644 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, | 4644 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, |
4645 FixedArray::kHeaderSize + kPointerSize)); | 4645 FixedArray::kHeaderSize + kPointerSize)); |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 Operand(ebp, 7 * kPointerSize), NULL); | 5476 Operand(ebp, 7 * kPointerSize), NULL); |
5477 } | 5477 } |
5478 | 5478 |
5479 | 5479 |
5480 #undef __ | 5480 #undef __ |
5481 | 5481 |
5482 } // namespace internal | 5482 } // namespace internal |
5483 } // namespace v8 | 5483 } // namespace v8 |
5484 | 5484 |
5485 #endif // V8_TARGET_ARCH_IA32 | 5485 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |