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-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2961 __ cmp(result, factory()->the_hole_value()); | 2961 __ cmp(result, factory()->the_hole_value()); |
2962 DeoptimizeIf(equal, instr->environment()); | 2962 DeoptimizeIf(equal, instr->environment()); |
2963 } | 2963 } |
2964 } | 2964 } |
2965 | 2965 |
2966 | 2966 |
2967 template <class T> | 2967 template <class T> |
2968 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2968 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2969 DCHECK(FLAG_vector_ics); | 2969 DCHECK(FLAG_vector_ics); |
2970 Register vector = ToRegister(instr->temp_vector()); | 2970 Register vector = ToRegister(instr->temp_vector()); |
2971 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); | 2971 DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); |
2972 __ mov(vector, instr->hydrogen()->feedback_vector()); | 2972 __ mov(vector, instr->hydrogen()->feedback_vector()); |
2973 // No need to allocate this register. | 2973 // No need to allocate this register. |
2974 DCHECK(FullVectorLoadConvention::SlotRegister().is(eax)); | 2974 DCHECK(VectorLoadICDescriptor::SlotRegister().is(eax)); |
2975 __ mov(FullVectorLoadConvention::SlotRegister(), | 2975 __ mov(VectorLoadICDescriptor::SlotRegister(), |
2976 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); | 2976 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
2977 } | 2977 } |
2978 | 2978 |
2979 | 2979 |
2980 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2980 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2981 DCHECK(ToRegister(instr->context()).is(esi)); | 2981 DCHECK(ToRegister(instr->context()).is(esi)); |
2982 DCHECK(ToRegister(instr->global_object()) | 2982 DCHECK(ToRegister(instr->global_object()) |
2983 .is(LoadConvention::ReceiverRegister())); | 2983 .is(LoadDescriptor::ReceiverRegister())); |
2984 DCHECK(ToRegister(instr->result()).is(eax)); | 2984 DCHECK(ToRegister(instr->result()).is(eax)); |
2985 | 2985 |
2986 __ mov(LoadConvention::NameRegister(), instr->name()); | 2986 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
2987 if (FLAG_vector_ics) { | 2987 if (FLAG_vector_ics) { |
2988 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2988 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2989 } | 2989 } |
2990 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2990 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2991 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2991 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
2992 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2992 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2993 } | 2993 } |
2994 | 2994 |
2995 | 2995 |
2996 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2996 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3108 } else if (operand->IsRegister()) { | 3108 } else if (operand->IsRegister()) { |
3109 __ push(ToRegister(operand)); | 3109 __ push(ToRegister(operand)); |
3110 } else { | 3110 } else { |
3111 __ push(ToOperand(operand)); | 3111 __ push(ToOperand(operand)); |
3112 } | 3112 } |
3113 } | 3113 } |
3114 | 3114 |
3115 | 3115 |
3116 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3116 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3117 DCHECK(ToRegister(instr->context()).is(esi)); | 3117 DCHECK(ToRegister(instr->context()).is(esi)); |
3118 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3118 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3119 DCHECK(ToRegister(instr->result()).is(eax)); | 3119 DCHECK(ToRegister(instr->result()).is(eax)); |
3120 | 3120 |
3121 __ mov(LoadConvention::NameRegister(), instr->name()); | 3121 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
3122 if (FLAG_vector_ics) { | 3122 if (FLAG_vector_ics) { |
3123 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3123 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3124 } | 3124 } |
3125 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3125 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
3126 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3126 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3127 } | 3127 } |
3128 | 3128 |
3129 | 3129 |
3130 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3130 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3131 Register function = ToRegister(instr->function()); | 3131 Register function = ToRegister(instr->function()); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3333 return Operand(elements_pointer_reg, | 3333 return Operand(elements_pointer_reg, |
3334 ToRegister(key), | 3334 ToRegister(key), |
3335 scale_factor, | 3335 scale_factor, |
3336 base_offset); | 3336 base_offset); |
3337 } | 3337 } |
3338 } | 3338 } |
3339 | 3339 |
3340 | 3340 |
3341 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3341 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3342 DCHECK(ToRegister(instr->context()).is(esi)); | 3342 DCHECK(ToRegister(instr->context()).is(esi)); |
3343 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3343 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3344 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); | 3344 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3345 | 3345 |
3346 if (FLAG_vector_ics) { | 3346 if (FLAG_vector_ics) { |
3347 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3347 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3348 } | 3348 } |
3349 | 3349 |
3350 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3350 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
3351 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3351 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3352 } | 3352 } |
3353 | 3353 |
3354 | 3354 |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3969 temp, | 3969 temp, |
3970 EMIT_REMEMBERED_SET, | 3970 EMIT_REMEMBERED_SET, |
3971 instr->hydrogen()->SmiCheckForWriteBarrier(), | 3971 instr->hydrogen()->SmiCheckForWriteBarrier(), |
3972 instr->hydrogen()->PointersToHereCheckForValue()); | 3972 instr->hydrogen()->PointersToHereCheckForValue()); |
3973 } | 3973 } |
3974 } | 3974 } |
3975 | 3975 |
3976 | 3976 |
3977 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 3977 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
3978 DCHECK(ToRegister(instr->context()).is(esi)); | 3978 DCHECK(ToRegister(instr->context()).is(esi)); |
3979 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 3979 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
3980 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 3980 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
3981 | 3981 |
3982 __ mov(StoreConvention::NameRegister(), instr->name()); | 3982 __ mov(StoreDescriptor::NameRegister(), instr->name()); |
3983 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 3983 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
3984 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3984 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3985 } | 3985 } |
3986 | 3986 |
3987 | 3987 |
3988 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 3988 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
3989 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; | 3989 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; |
3990 if (instr->index()->IsConstantOperand()) { | 3990 if (instr->index()->IsConstantOperand()) { |
3991 __ cmp(ToOperand(instr->length()), | 3991 __ cmp(ToOperand(instr->length()), |
3992 ToImmediate(LConstantOperand::cast(instr->index()), | 3992 ToImmediate(LConstantOperand::cast(instr->index()), |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4180 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4180 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4181 DoStoreKeyedFixedDoubleArray(instr); | 4181 DoStoreKeyedFixedDoubleArray(instr); |
4182 } else { | 4182 } else { |
4183 DoStoreKeyedFixedArray(instr); | 4183 DoStoreKeyedFixedArray(instr); |
4184 } | 4184 } |
4185 } | 4185 } |
4186 | 4186 |
4187 | 4187 |
4188 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4188 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4189 DCHECK(ToRegister(instr->context()).is(esi)); | 4189 DCHECK(ToRegister(instr->context()).is(esi)); |
4190 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4190 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4191 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); | 4191 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4192 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4192 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4193 | 4193 |
4194 Handle<Code> ic = instr->strict_mode() == STRICT | 4194 Handle<Code> ic = instr->strict_mode() == STRICT |
4195 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4195 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4196 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4196 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4197 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4197 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4198 } | 4198 } |
4199 | 4199 |
4200 | 4200 |
4201 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 4201 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
4202 Register object = ToRegister(instr->object()); | 4202 Register object = ToRegister(instr->object()); |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5703 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5703 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5704 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5704 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5705 } | 5705 } |
5706 | 5706 |
5707 | 5707 |
5708 #undef __ | 5708 #undef __ |
5709 | 5709 |
5710 } } // namespace v8::internal | 5710 } } // namespace v8::internal |
5711 | 5711 |
5712 #endif // V8_TARGET_ARCH_X87 | 5712 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |