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 3145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3156 | 3156 |
3157 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3157 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
3158 DCHECK(ToRegister(instr->context()).is(esi)); | 3158 DCHECK(ToRegister(instr->context()).is(esi)); |
3159 DCHECK(ToRegister(instr->global_object()) | 3159 DCHECK(ToRegister(instr->global_object()) |
3160 .is(LoadDescriptor::ReceiverRegister())); | 3160 .is(LoadDescriptor::ReceiverRegister())); |
3161 DCHECK(ToRegister(instr->result()).is(eax)); | 3161 DCHECK(ToRegister(instr->result()).is(eax)); |
3162 | 3162 |
3163 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3163 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
3164 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3164 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
3165 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3165 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
3166 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 3166 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
3167 PREMONOMORPHIC).code(); | 3167 PREMONOMORPHIC).code(); |
3168 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3168 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3169 } | 3169 } |
3170 | 3170 |
3171 | 3171 |
3172 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3172 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
3173 Register context = ToRegister(instr->context()); | 3173 Register context = ToRegister(instr->context()); |
3174 Register result = ToRegister(instr->result()); | 3174 Register result = ToRegister(instr->result()); |
3175 __ mov(result, ContextOperand(context, instr->slot_index())); | 3175 __ mov(result, ContextOperand(context, instr->slot_index())); |
3176 | 3176 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3266 } | 3266 } |
3267 | 3267 |
3268 | 3268 |
3269 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3269 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3270 DCHECK(ToRegister(instr->context()).is(esi)); | 3270 DCHECK(ToRegister(instr->context()).is(esi)); |
3271 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3271 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3272 DCHECK(ToRegister(instr->result()).is(eax)); | 3272 DCHECK(ToRegister(instr->result()).is(eax)); |
3273 | 3273 |
3274 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3274 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
3275 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3275 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3276 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 3276 Handle<Code> ic = |
3277 isolate(), NOT_CONTEXTUAL, | 3277 CodeFactory::LoadICInOptimizedCode( |
3278 instr->hydrogen()->initialization_state()).code(); | 3278 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3279 instr->hydrogen()->initialization_state()).code(); |
3279 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3280 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3280 } | 3281 } |
3281 | 3282 |
3282 | 3283 |
3283 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3284 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3284 Register function = ToRegister(instr->function()); | 3285 Register function = ToRegister(instr->function()); |
3285 Register temp = ToRegister(instr->temp()); | 3286 Register temp = ToRegister(instr->temp()); |
3286 Register result = ToRegister(instr->result()); | 3287 Register result = ToRegister(instr->result()); |
3287 | 3288 |
3288 // Get the prototype or initial map from the function. | 3289 // Get the prototype or initial map from the function. |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3508 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3509 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3509 DCHECK(ToRegister(instr->context()).is(esi)); | 3510 DCHECK(ToRegister(instr->context()).is(esi)); |
3510 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3511 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3511 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3512 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3512 | 3513 |
3513 if (instr->hydrogen()->HasVectorAndSlot()) { | 3514 if (instr->hydrogen()->HasVectorAndSlot()) { |
3514 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3515 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3515 } | 3516 } |
3516 | 3517 |
3517 Handle<Code> ic = | 3518 Handle<Code> ic = |
3518 CodeFactory::KeyedLoadICInOptimizedCode( | 3519 Handle<Code> ic = |
3519 isolate(), instr->hydrogen()->initialization_state()).code(); | 3520 CodeFactory::KeyedLoadICInOptimizedCode( |
| 3521 isolate(), instr->hydrogen()->language_mode(), |
| 3522 instr->hydrogen()->initialization_state()).code(); |
3520 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3523 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3521 } | 3524 } |
3522 | 3525 |
3523 | 3526 |
3524 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3527 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3525 Register result = ToRegister(instr->result()); | 3528 Register result = ToRegister(instr->result()); |
3526 | 3529 |
3527 if (instr->hydrogen()->from_inlined()) { | 3530 if (instr->hydrogen()->from_inlined()) { |
3528 __ lea(result, Operand(esp, -2 * kPointerSize)); | 3531 __ lea(result, Operand(esp, -2 * kPointerSize)); |
3529 } else { | 3532 } else { |
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6444 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6447 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6445 } | 6448 } |
6446 | 6449 |
6447 | 6450 |
6448 #undef __ | 6451 #undef __ |
6449 | 6452 |
6450 } // namespace internal | 6453 } // namespace internal |
6451 } // namespace v8 | 6454 } // namespace v8 |
6452 | 6455 |
6453 #endif // V8_TARGET_ARCH_X87 | 6456 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |