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/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2820 AllowDeferredHandleDereference vector_structure_check; | 2820 AllowDeferredHandleDereference vector_structure_check; |
2821 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2821 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
2822 __ mov(vector_register, vector); | 2822 __ mov(vector_register, vector); |
2823 // No need to allocate this register. | 2823 // No need to allocate this register. |
2824 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); | 2824 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); |
2825 int index = vector->GetIndex(slot); | 2825 int index = vector->GetIndex(slot); |
2826 __ mov(slot_register, Immediate(Smi::FromInt(index))); | 2826 __ mov(slot_register, Immediate(Smi::FromInt(index))); |
2827 } | 2827 } |
2828 | 2828 |
2829 | 2829 |
| 2830 template <class T> |
| 2831 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { |
| 2832 Register vector_register = ToRegister(instr->temp_vector()); |
| 2833 Register slot_register = ToRegister(instr->temp_slot()); |
| 2834 |
| 2835 AllowDeferredHandleDereference vector_structure_check; |
| 2836 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 2837 __ mov(vector_register, vector); |
| 2838 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); |
| 2839 int index = vector->GetIndex(slot); |
| 2840 __ mov(slot_register, Immediate(Smi::FromInt(index))); |
| 2841 } |
| 2842 |
| 2843 |
2830 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2844 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2831 DCHECK(ToRegister(instr->context()).is(esi)); | 2845 DCHECK(ToRegister(instr->context()).is(esi)); |
2832 DCHECK(ToRegister(instr->global_object()) | 2846 DCHECK(ToRegister(instr->global_object()) |
2833 .is(LoadDescriptor::ReceiverRegister())); | 2847 .is(LoadDescriptor::ReceiverRegister())); |
2834 DCHECK(ToRegister(instr->result()).is(eax)); | 2848 DCHECK(ToRegister(instr->result()).is(eax)); |
2835 | 2849 |
2836 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 2850 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
2837 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2851 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2838 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2852 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2839 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2853 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4077 instr->hydrogen()->PointersToHereCheckForValue()); | 4091 instr->hydrogen()->PointersToHereCheckForValue()); |
4078 } | 4092 } |
4079 } | 4093 } |
4080 | 4094 |
4081 | 4095 |
4082 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4096 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4083 DCHECK(ToRegister(instr->context()).is(esi)); | 4097 DCHECK(ToRegister(instr->context()).is(esi)); |
4084 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4098 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4085 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4099 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4086 | 4100 |
| 4101 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 4102 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); |
| 4103 } |
| 4104 |
4087 __ mov(StoreDescriptor::NameRegister(), instr->name()); | 4105 __ mov(StoreDescriptor::NameRegister(), instr->name()); |
4088 Handle<Code> ic = | 4106 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( |
4089 StoreIC::initialize_stub(isolate(), instr->language_mode(), | 4107 isolate(), instr->language_mode(), |
4090 instr->hydrogen()->initialization_state()); | 4108 instr->hydrogen()->initialization_state()).code(); |
4091 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4109 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4092 } | 4110 } |
4093 | 4111 |
4094 | 4112 |
4095 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4113 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4096 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; | 4114 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; |
4097 if (instr->index()->IsConstantOperand()) { | 4115 if (instr->index()->IsConstantOperand()) { |
4098 __ cmp(ToOperand(instr->length()), | 4116 __ cmp(ToOperand(instr->length()), |
4099 ToImmediate(LConstantOperand::cast(instr->index()), | 4117 ToImmediate(LConstantOperand::cast(instr->index()), |
4100 instr->hydrogen()->length()->representation())); | 4118 instr->hydrogen()->length()->representation())); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4257 } | 4275 } |
4258 } | 4276 } |
4259 | 4277 |
4260 | 4278 |
4261 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4279 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4262 DCHECK(ToRegister(instr->context()).is(esi)); | 4280 DCHECK(ToRegister(instr->context()).is(esi)); |
4263 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4281 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4264 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 4282 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4265 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4283 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4266 | 4284 |
| 4285 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 4286 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); |
| 4287 } |
| 4288 |
4267 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | 4289 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( |
4268 isolate(), instr->language_mode(), | 4290 isolate(), instr->language_mode(), |
4269 instr->hydrogen()->initialization_state()).code(); | 4291 instr->hydrogen()->initialization_state()).code(); |
4270 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4292 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4271 } | 4293 } |
4272 | 4294 |
4273 | 4295 |
4274 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 4296 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
4275 Register object = ToRegister(instr->object()); | 4297 Register object = ToRegister(instr->object()); |
4276 Register temp = ToRegister(instr->temp()); | 4298 Register temp = ToRegister(instr->temp()); |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5783 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5805 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5784 } | 5806 } |
5785 | 5807 |
5786 | 5808 |
5787 #undef __ | 5809 #undef __ |
5788 | 5810 |
5789 } // namespace internal | 5811 } // namespace internal |
5790 } // namespace v8 | 5812 } // namespace v8 |
5791 | 5813 |
5792 #endif // V8_TARGET_ARCH_IA32 | 5814 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |