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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
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 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 | 2417 |
2418 | 2418 |
2419 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2419 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2420 DCHECK(ToRegister(instr->context()).is(esi)); | 2420 DCHECK(ToRegister(instr->context()).is(esi)); |
2421 DCHECK(ToRegister(instr->global_object()) | 2421 DCHECK(ToRegister(instr->global_object()) |
2422 .is(LoadDescriptor::ReceiverRegister())); | 2422 .is(LoadDescriptor::ReceiverRegister())); |
2423 DCHECK(ToRegister(instr->result()).is(eax)); | 2423 DCHECK(ToRegister(instr->result()).is(eax)); |
2424 | 2424 |
2425 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 2425 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
2426 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2426 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2427 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2427 Handle<Code> ic = |
2428 isolate(), instr->typeof_mode(), PREMONOMORPHIC) | 2428 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode()) |
2429 .code(); | 2429 .code(); |
2430 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2430 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2431 } | 2431 } |
2432 | 2432 |
2433 | 2433 |
2434 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2434 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2435 Register context = ToRegister(instr->context()); | 2435 Register context = ToRegister(instr->context()); |
2436 Register result = ToRegister(instr->result()); | 2436 Register result = ToRegister(instr->result()); |
2437 __ mov(result, ContextOperand(context, instr->slot_index())); | 2437 __ mov(result, ContextOperand(context, instr->slot_index())); |
2438 | 2438 |
2439 if (instr->hydrogen()->RequiresHoleCheck()) { | 2439 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2534 } | 2534 } |
2535 | 2535 |
2536 | 2536 |
2537 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2537 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2538 DCHECK(ToRegister(instr->context()).is(esi)); | 2538 DCHECK(ToRegister(instr->context()).is(esi)); |
2539 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2539 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2540 DCHECK(ToRegister(instr->result()).is(eax)); | 2540 DCHECK(ToRegister(instr->result()).is(eax)); |
2541 | 2541 |
2542 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 2542 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
2543 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2543 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
2544 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2544 Handle<Code> ic = |
2545 isolate(), NOT_INSIDE_TYPEOF, | 2545 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_INSIDE_TYPEOF).code(); |
2546 instr->hydrogen()->initialization_state()) | |
2547 .code(); | |
2548 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2546 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2549 } | 2547 } |
2550 | 2548 |
2551 | 2549 |
2552 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2550 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2553 Register function = ToRegister(instr->function()); | 2551 Register function = ToRegister(instr->function()); |
2554 Register temp = ToRegister(instr->temp()); | 2552 Register temp = ToRegister(instr->temp()); |
2555 Register result = ToRegister(instr->result()); | 2553 Register result = ToRegister(instr->result()); |
2556 | 2554 |
2557 // Get the prototype or initial map from the function. | 2555 // Get the prototype or initial map from the function. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 base_offset); | 2766 base_offset); |
2769 } | 2767 } |
2770 } | 2768 } |
2771 | 2769 |
2772 | 2770 |
2773 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2771 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
2774 DCHECK(ToRegister(instr->context()).is(esi)); | 2772 DCHECK(ToRegister(instr->context()).is(esi)); |
2775 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2773 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2776 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 2774 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
2777 | 2775 |
2778 if (instr->hydrogen()->HasVectorAndSlot()) { | 2776 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
2779 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
2780 } | |
2781 | 2777 |
2782 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 2778 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); |
2783 isolate(), instr->hydrogen()->initialization_state()) | |
2784 .code(); | |
2785 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2779 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2786 } | 2780 } |
2787 | 2781 |
2788 | 2782 |
2789 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2783 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
2790 Register result = ToRegister(instr->result()); | 2784 Register result = ToRegister(instr->result()); |
2791 | 2785 |
2792 if (instr->hydrogen()->from_inlined()) { | 2786 if (instr->hydrogen()->from_inlined()) { |
2793 __ lea(result, Operand(esp, -2 * kPointerSize)); | 2787 __ lea(result, Operand(esp, -2 * kPointerSize)); |
2794 } else if (instr->hydrogen()->arguments_adaptor()) { | 2788 } else if (instr->hydrogen()->arguments_adaptor()) { |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3688 instr->hydrogen()->PointersToHereCheckForValue()); | 3682 instr->hydrogen()->PointersToHereCheckForValue()); |
3689 } | 3683 } |
3690 } | 3684 } |
3691 | 3685 |
3692 | 3686 |
3693 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 3687 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
3694 DCHECK(ToRegister(instr->context()).is(esi)); | 3688 DCHECK(ToRegister(instr->context()).is(esi)); |
3695 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 3689 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
3696 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 3690 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
3697 | 3691 |
3698 if (instr->hydrogen()->HasVectorAndSlot()) { | 3692 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); |
3699 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); | |
3700 } | |
3701 | 3693 |
3702 __ mov(StoreDescriptor::NameRegister(), instr->name()); | 3694 __ mov(StoreDescriptor::NameRegister(), instr->name()); |
3703 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 3695 Handle<Code> ic = |
3704 isolate(), instr->language_mode(), | 3696 CodeFactory::StoreICInOptimizedCode(isolate(), instr->language_mode()) |
3705 instr->hydrogen()->initialization_state()).code(); | 3697 .code(); |
3706 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3698 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3707 } | 3699 } |
3708 | 3700 |
3709 | 3701 |
3710 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 3702 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
3711 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; | 3703 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; |
3712 if (instr->index()->IsConstantOperand()) { | 3704 if (instr->index()->IsConstantOperand()) { |
3713 __ cmp(ToOperand(instr->length()), | 3705 __ cmp(ToOperand(instr->length()), |
3714 ToImmediate(LConstantOperand::cast(instr->index()), | 3706 ToImmediate(LConstantOperand::cast(instr->index()), |
3715 instr->hydrogen()->length()->representation())); | 3707 instr->hydrogen()->length()->representation())); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3865 } | 3857 } |
3866 } | 3858 } |
3867 | 3859 |
3868 | 3860 |
3869 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 3861 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
3870 DCHECK(ToRegister(instr->context()).is(esi)); | 3862 DCHECK(ToRegister(instr->context()).is(esi)); |
3871 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 3863 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
3872 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 3864 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
3873 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 3865 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
3874 | 3866 |
3875 if (instr->hydrogen()->HasVectorAndSlot()) { | 3867 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); |
3876 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
3877 } | |
3878 | 3868 |
3879 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | 3869 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( |
3880 isolate(), instr->language_mode(), | 3870 isolate(), instr->language_mode()) |
3881 instr->hydrogen()->initialization_state()).code(); | 3871 .code(); |
3882 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3872 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3883 } | 3873 } |
3884 | 3874 |
3885 | 3875 |
3886 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 3876 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
3887 Register object = ToRegister(instr->object()); | 3877 Register object = ToRegister(instr->object()); |
3888 Register temp = ToRegister(instr->temp()); | 3878 Register temp = ToRegister(instr->temp()); |
3889 Label no_memento_found; | 3879 Label no_memento_found; |
3890 __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found); | 3880 __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found); |
3891 DeoptimizeIf(equal, instr, Deoptimizer::kMementoFound); | 3881 DeoptimizeIf(equal, instr, Deoptimizer::kMementoFound); |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5319 __ bind(deferred->exit()); | 5309 __ bind(deferred->exit()); |
5320 __ bind(&done); | 5310 __ bind(&done); |
5321 } | 5311 } |
5322 | 5312 |
5323 #undef __ | 5313 #undef __ |
5324 | 5314 |
5325 } // namespace internal | 5315 } // namespace internal |
5326 } // namespace v8 | 5316 } // namespace v8 |
5327 | 5317 |
5328 #endif // V8_TARGET_ARCH_IA32 | 5318 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |