| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 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 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3145 DCHECK(ToRegister(instr->context()).is(esi)); | 3145 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3146 DCHECK(ToRegister(instr->global_object()) | 3146 DCHECK(ToRegister(instr->global_object()) |
| 3147 .is(LoadDescriptor::ReceiverRegister())); | 3147 .is(LoadDescriptor::ReceiverRegister())); |
| 3148 DCHECK(ToRegister(instr->result()).is(eax)); | 3148 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3149 | 3149 |
| 3150 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3150 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
| 3151 if (FLAG_vector_ics) { | 3151 if (FLAG_vector_ics) { |
| 3152 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3152 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 3153 } | 3153 } |
| 3154 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3154 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 3155 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); | 3155 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 3156 PREMONOMORPHIC).code(); |
| 3156 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3157 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3157 } | 3158 } |
| 3158 | 3159 |
| 3159 | 3160 |
| 3160 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 3161 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
| 3161 Register value = ToRegister(instr->value()); | 3162 Register value = ToRegister(instr->value()); |
| 3162 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); | 3163 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); |
| 3163 | 3164 |
| 3164 // If the cell we are storing to contains the hole it could have | 3165 // If the cell we are storing to contains the hole it could have |
| 3165 // been deleted from the property dictionary. In that case, we need | 3166 // been deleted from the property dictionary. In that case, we need |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 | 3276 |
| 3276 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3277 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 3277 DCHECK(ToRegister(instr->context()).is(esi)); | 3278 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3278 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3279 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3279 DCHECK(ToRegister(instr->result()).is(eax)); | 3280 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3280 | 3281 |
| 3281 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3282 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
| 3282 if (FLAG_vector_ics) { | 3283 if (FLAG_vector_ics) { |
| 3283 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3284 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 3284 } | 3285 } |
| 3285 Handle<Code> ic = | 3286 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 3286 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); | 3287 isolate(), NOT_CONTEXTUAL, |
| 3288 instr->hydrogen()->initialization_state()).code(); |
| 3287 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3289 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3288 } | 3290 } |
| 3289 | 3291 |
| 3290 | 3292 |
| 3291 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3293 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 3292 Register function = ToRegister(instr->function()); | 3294 Register function = ToRegister(instr->function()); |
| 3293 Register temp = ToRegister(instr->temp()); | 3295 Register temp = ToRegister(instr->temp()); |
| 3294 Register result = ToRegister(instr->result()); | 3296 Register result = ToRegister(instr->result()); |
| 3295 | 3297 |
| 3296 // Get the prototype or initial map from the function. | 3298 // Get the prototype or initial map from the function. |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4564 } | 4566 } |
| 4565 } | 4567 } |
| 4566 | 4568 |
| 4567 | 4569 |
| 4568 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4570 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 4569 DCHECK(ToRegister(instr->context()).is(esi)); | 4571 DCHECK(ToRegister(instr->context()).is(esi)); |
| 4570 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4572 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
| 4571 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4573 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
| 4572 | 4574 |
| 4573 __ mov(StoreDescriptor::NameRegister(), instr->name()); | 4575 __ mov(StoreDescriptor::NameRegister(), instr->name()); |
| 4574 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); | 4576 Handle<Code> ic = |
| 4577 StoreIC::initialize_stub(isolate(), instr->language_mode(), |
| 4578 instr->hydrogen()->initialization_state()); |
| 4575 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4579 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4576 } | 4580 } |
| 4577 | 4581 |
| 4578 | 4582 |
| 4579 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4583 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 4580 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; | 4584 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; |
| 4581 if (instr->index()->IsConstantOperand()) { | 4585 if (instr->index()->IsConstantOperand()) { |
| 4582 __ cmp(ToOperand(instr->length()), | 4586 __ cmp(ToOperand(instr->length()), |
| 4583 ToImmediate(LConstantOperand::cast(instr->index()), | 4587 ToImmediate(LConstantOperand::cast(instr->index()), |
| 4584 instr->hydrogen()->length()->representation())); | 4588 instr->hydrogen()->length()->representation())); |
| (...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6380 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6384 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6381 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6385 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6382 } | 6386 } |
| 6383 | 6387 |
| 6384 | 6388 |
| 6385 #undef __ | 6389 #undef __ |
| 6386 | 6390 |
| 6387 } } // namespace v8::internal | 6391 } } // namespace v8::internal |
| 6388 | 6392 |
| 6389 #endif // V8_TARGET_ARCH_X87 | 6393 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |