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, | 3119 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
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 = CodeFactory::LoadICInOptimizedCode( | 3229 Handle<Code> ic = |
3230 isolate(), NOT_CONTEXTUAL, | 3230 CodeFactory::LoadICInOptimizedCode( |
3231 instr->hydrogen()->initialization_state()).code(); | 3231 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3232 instr->hydrogen()->initialization_state()).code(); |
3232 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3233 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3233 } | 3234 } |
3234 | 3235 |
3235 | 3236 |
3236 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3237 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3237 Register function = ToRegister(instr->function()); | 3238 Register function = ToRegister(instr->function()); |
3238 Register temp = ToRegister(instr->temp()); | 3239 Register temp = ToRegister(instr->temp()); |
3239 Register result = ToRegister(instr->result()); | 3240 Register result = ToRegister(instr->result()); |
3240 | 3241 |
3241 // Get the prototype or initial map from the function. | 3242 // Get the prototype or initial map from the function. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3460 | 3461 |
3461 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3462 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3462 DCHECK(ToRegister(instr->context()).is(esi)); | 3463 DCHECK(ToRegister(instr->context()).is(esi)); |
3463 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3464 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3464 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3465 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3465 | 3466 |
3466 if (instr->hydrogen()->HasVectorAndSlot()) { | 3467 if (instr->hydrogen()->HasVectorAndSlot()) { |
3467 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3468 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3468 } | 3469 } |
3469 | 3470 |
3470 Handle<Code> ic = | 3471 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
3471 CodeFactory::KeyedLoadICInOptimizedCode( | 3472 isolate(), instr->hydrogen()->language_mode(), |
3472 isolate(), instr->hydrogen()->initialization_state()).code(); | 3473 instr->hydrogen()->initialization_state()).code(); |
3473 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3474 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3474 } | 3475 } |
3475 | 3476 |
3476 | 3477 |
3477 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3478 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3478 Register result = ToRegister(instr->result()); | 3479 Register result = ToRegister(instr->result()); |
3479 | 3480 |
3480 if (instr->hydrogen()->from_inlined()) { | 3481 if (instr->hydrogen()->from_inlined()) { |
3481 __ lea(result, Operand(esp, -2 * kPointerSize)); | 3482 __ lea(result, Operand(esp, -2 * kPointerSize)); |
3482 } else { | 3483 } else { |
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6397 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6398 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6398 } | 6399 } |
6399 | 6400 |
6400 | 6401 |
6401 #undef __ | 6402 #undef __ |
6402 | 6403 |
6403 } // namespace internal | 6404 } // namespace internal |
6404 } // namespace v8 | 6405 } // namespace v8 |
6405 | 6406 |
6406 #endif // V8_TARGET_ARCH_X87 | 6407 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |