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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2702 | 2702 |
2703 | 2703 |
2704 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2704 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2705 DCHECK(ToRegister(instr->context()).is(esi)); | 2705 DCHECK(ToRegister(instr->context()).is(esi)); |
2706 DCHECK(ToRegister(instr->global_object()) | 2706 DCHECK(ToRegister(instr->global_object()) |
2707 .is(LoadDescriptor::ReceiverRegister())); | 2707 .is(LoadDescriptor::ReceiverRegister())); |
2708 DCHECK(ToRegister(instr->result()).is(eax)); | 2708 DCHECK(ToRegister(instr->result()).is(eax)); |
2709 | 2709 |
2710 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 2710 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
2711 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2711 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2712 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2712 Handle<Code> ic = |
2713 isolate(), instr->typeof_mode(), PREMONOMORPHIC) | 2713 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode()) |
2714 .code(); | 2714 .code(); |
2715 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2715 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2716 } | 2716 } |
2717 | 2717 |
2718 | 2718 |
2719 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2719 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2720 Register context = ToRegister(instr->context()); | 2720 Register context = ToRegister(instr->context()); |
2721 Register result = ToRegister(instr->result()); | 2721 Register result = ToRegister(instr->result()); |
2722 __ mov(result, ContextOperand(context, instr->slot_index())); | 2722 __ mov(result, ContextOperand(context, instr->slot_index())); |
2723 | 2723 |
2724 if (instr->hydrogen()->RequiresHoleCheck()) { | 2724 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 } | 2813 } |
2814 | 2814 |
2815 | 2815 |
2816 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2816 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2817 DCHECK(ToRegister(instr->context()).is(esi)); | 2817 DCHECK(ToRegister(instr->context()).is(esi)); |
2818 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2818 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2819 DCHECK(ToRegister(instr->result()).is(eax)); | 2819 DCHECK(ToRegister(instr->result()).is(eax)); |
2820 | 2820 |
2821 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 2821 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
2822 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2822 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
2823 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2823 Handle<Code> ic = |
2824 isolate(), NOT_INSIDE_TYPEOF, | 2824 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_INSIDE_TYPEOF).code(); |
2825 instr->hydrogen()->initialization_state()) | |
2826 .code(); | |
2827 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2825 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2828 } | 2826 } |
2829 | 2827 |
2830 | 2828 |
2831 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2829 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2832 Register function = ToRegister(instr->function()); | 2830 Register function = ToRegister(instr->function()); |
2833 Register temp = ToRegister(instr->temp()); | 2831 Register temp = ToRegister(instr->temp()); |
2834 Register result = ToRegister(instr->result()); | 2832 Register result = ToRegister(instr->result()); |
2835 | 2833 |
2836 // Get the prototype or initial map from the function. | 2834 // Get the prototype or initial map from the function. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3044 base_offset); | 3042 base_offset); |
3045 } | 3043 } |
3046 } | 3044 } |
3047 | 3045 |
3048 | 3046 |
3049 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3047 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3050 DCHECK(ToRegister(instr->context()).is(esi)); | 3048 DCHECK(ToRegister(instr->context()).is(esi)); |
3051 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3049 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3052 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3050 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3053 | 3051 |
3054 if (instr->hydrogen()->HasVectorAndSlot()) { | 3052 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3055 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
3056 } | |
3057 | 3053 |
3058 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3054 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); |
3059 isolate(), instr->hydrogen()->initialization_state()) | |
3060 .code(); | |
3061 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3055 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3062 } | 3056 } |
3063 | 3057 |
3064 | 3058 |
3065 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3059 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3066 Register result = ToRegister(instr->result()); | 3060 Register result = ToRegister(instr->result()); |
3067 | 3061 |
3068 if (instr->hydrogen()->from_inlined()) { | 3062 if (instr->hydrogen()->from_inlined()) { |
3069 __ lea(result, Operand(esp, -2 * kPointerSize)); | 3063 __ lea(result, Operand(esp, -2 * kPointerSize)); |
3070 } else if (instr->hydrogen()->arguments_adaptor()) { | 3064 } else if (instr->hydrogen()->arguments_adaptor()) { |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4027 instr->hydrogen()->PointersToHereCheckForValue()); | 4021 instr->hydrogen()->PointersToHereCheckForValue()); |
4028 } | 4022 } |
4029 } | 4023 } |
4030 | 4024 |
4031 | 4025 |
4032 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4026 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4033 DCHECK(ToRegister(instr->context()).is(esi)); | 4027 DCHECK(ToRegister(instr->context()).is(esi)); |
4034 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4028 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4035 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4029 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4036 | 4030 |
4037 if (instr->hydrogen()->HasVectorAndSlot()) { | 4031 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); |
4038 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); | |
4039 } | |
4040 | 4032 |
4041 __ mov(StoreDescriptor::NameRegister(), instr->name()); | 4033 __ mov(StoreDescriptor::NameRegister(), instr->name()); |
4042 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 4034 Handle<Code> ic = |
4043 isolate(), instr->language_mode(), | 4035 CodeFactory::StoreICInOptimizedCode(isolate(), instr->language_mode()) |
4044 instr->hydrogen()->initialization_state()).code(); | 4036 .code(); |
4045 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4037 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4046 } | 4038 } |
4047 | 4039 |
4048 | 4040 |
4049 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4041 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4050 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; | 4042 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; |
4051 if (instr->index()->IsConstantOperand()) { | 4043 if (instr->index()->IsConstantOperand()) { |
4052 __ cmp(ToOperand(instr->length()), | 4044 __ cmp(ToOperand(instr->length()), |
4053 ToImmediate(LConstantOperand::cast(instr->index()), | 4045 ToImmediate(LConstantOperand::cast(instr->index()), |
4054 instr->hydrogen()->length()->representation())); | 4046 instr->hydrogen()->length()->representation())); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4253 } | 4245 } |
4254 } | 4246 } |
4255 | 4247 |
4256 | 4248 |
4257 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4249 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4258 DCHECK(ToRegister(instr->context()).is(esi)); | 4250 DCHECK(ToRegister(instr->context()).is(esi)); |
4259 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4251 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4260 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 4252 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4261 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4253 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4262 | 4254 |
4263 if (instr->hydrogen()->HasVectorAndSlot()) { | 4255 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); |
4264 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
4265 } | |
4266 | 4256 |
4267 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | 4257 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( |
4268 isolate(), instr->language_mode(), | 4258 isolate(), instr->language_mode()) |
4269 instr->hydrogen()->initialization_state()).code(); | 4259 .code(); |
4270 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4260 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4271 } | 4261 } |
4272 | 4262 |
4273 | 4263 |
4274 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 4264 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
4275 Register object = ToRegister(instr->object()); | 4265 Register object = ToRegister(instr->object()); |
4276 Register temp = ToRegister(instr->temp()); | 4266 Register temp = ToRegister(instr->temp()); |
4277 Label no_memento_found; | 4267 Label no_memento_found; |
4278 __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found); | 4268 __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found); |
4279 DeoptimizeIf(equal, instr, Deoptimizer::kMementoFound); | 4269 DeoptimizeIf(equal, instr, Deoptimizer::kMementoFound); |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5866 __ bind(deferred->exit()); | 5856 __ bind(deferred->exit()); |
5867 __ bind(&done); | 5857 __ bind(&done); |
5868 } | 5858 } |
5869 | 5859 |
5870 #undef __ | 5860 #undef __ |
5871 | 5861 |
5872 } // namespace internal | 5862 } // namespace internal |
5873 } // namespace v8 | 5863 } // namespace v8 |
5874 | 5864 |
5875 #endif // V8_TARGET_ARCH_X87 | 5865 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |