| 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 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3109 | 3109 |
| 3110 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3110 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 3111 DCHECK(ToRegister(instr->context()).is(esi)); | 3111 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3112 DCHECK(ToRegister(instr->global_object()) | 3112 DCHECK(ToRegister(instr->global_object()) |
| 3113 .is(LoadDescriptor::ReceiverRegister())); | 3113 .is(LoadDescriptor::ReceiverRegister())); |
| 3114 DCHECK(ToRegister(instr->result()).is(eax)); | 3114 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3115 | 3115 |
| 3116 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3116 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
| 3117 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3117 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 3118 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3118 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 3119 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, | 3119 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 3120 PREMONOMORPHIC).code(); | 3120 PREMONOMORPHIC).code(); |
| 3121 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3121 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3122 } | 3122 } |
| 3123 | 3123 |
| 3124 | 3124 |
| 3125 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3125 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 3126 Register context = ToRegister(instr->context()); | 3126 Register context = ToRegister(instr->context()); |
| 3127 Register result = ToRegister(instr->result()); | 3127 Register result = ToRegister(instr->result()); |
| 3128 __ mov(result, ContextOperand(context, instr->slot_index())); | 3128 __ mov(result, ContextOperand(context, instr->slot_index())); |
| 3129 | 3129 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3219 } | 3219 } |
| 3220 | 3220 |
| 3221 | 3221 |
| 3222 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3222 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 3223 DCHECK(ToRegister(instr->context()).is(esi)); | 3223 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3224 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3224 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3225 DCHECK(ToRegister(instr->result()).is(eax)); | 3225 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3226 | 3226 |
| 3227 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3227 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
| 3228 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3228 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 3229 Handle<Code> ic = | 3229 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 3230 CodeFactory::LoadICInOptimizedCode( | 3230 isolate(), NOT_CONTEXTUAL, |
| 3231 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), | 3231 instr->hydrogen()->initialization_state()).code(); |
| 3232 instr->hydrogen()->initialization_state()).code(); | |
| 3233 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3232 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3234 } | 3233 } |
| 3235 | 3234 |
| 3236 | 3235 |
| 3237 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3236 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 3238 Register function = ToRegister(instr->function()); | 3237 Register function = ToRegister(instr->function()); |
| 3239 Register temp = ToRegister(instr->temp()); | 3238 Register temp = ToRegister(instr->temp()); |
| 3240 Register result = ToRegister(instr->result()); | 3239 Register result = ToRegister(instr->result()); |
| 3241 | 3240 |
| 3242 // Get the prototype or initial map from the function. | 3241 // Get the prototype or initial map from the function. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3461 | 3460 |
| 3462 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3461 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 3463 DCHECK(ToRegister(instr->context()).is(esi)); | 3462 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3464 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3463 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3465 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3464 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
| 3466 | 3465 |
| 3467 if (instr->hydrogen()->HasVectorAndSlot()) { | 3466 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 3468 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3467 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
| 3469 } | 3468 } |
| 3470 | 3469 |
| 3471 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3470 Handle<Code> ic = |
| 3472 isolate(), instr->hydrogen()->language_mode(), | 3471 CodeFactory::KeyedLoadICInOptimizedCode( |
| 3473 instr->hydrogen()->initialization_state()).code(); | 3472 isolate(), instr->hydrogen()->initialization_state()).code(); |
| 3474 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3473 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3475 } | 3474 } |
| 3476 | 3475 |
| 3477 | 3476 |
| 3478 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3477 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 3479 Register result = ToRegister(instr->result()); | 3478 Register result = ToRegister(instr->result()); |
| 3480 | 3479 |
| 3481 if (instr->hydrogen()->from_inlined()) { | 3480 if (instr->hydrogen()->from_inlined()) { |
| 3482 __ lea(result, Operand(esp, -2 * kPointerSize)); | 3481 __ lea(result, Operand(esp, -2 * kPointerSize)); |
| 3483 } else { | 3482 } else { |
| (...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6398 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6397 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6399 } | 6398 } |
| 6400 | 6399 |
| 6401 | 6400 |
| 6402 #undef __ | 6401 #undef __ |
| 6403 | 6402 |
| 6404 } // namespace internal | 6403 } // namespace internal |
| 6405 } // namespace v8 | 6404 } // namespace v8 |
| 6406 | 6405 |
| 6407 #endif // V8_TARGET_ARCH_X87 | 6406 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |