OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2843 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
2844 DeoptimizeIf(equal, instr->environment()); | 2844 DeoptimizeIf(equal, instr->environment()); |
2845 } | 2845 } |
2846 } | 2846 } |
2847 | 2847 |
2848 | 2848 |
2849 template <class T> | 2849 template <class T> |
2850 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2850 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2851 DCHECK(FLAG_vector_ics); | 2851 DCHECK(FLAG_vector_ics); |
2852 Register vector = ToRegister(instr->temp_vector()); | 2852 Register vector = ToRegister(instr->temp_vector()); |
2853 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); | 2853 DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); |
2854 __ Move(vector, instr->hydrogen()->feedback_vector()); | 2854 __ Move(vector, instr->hydrogen()->feedback_vector()); |
2855 // No need to allocate this register. | 2855 // No need to allocate this register. |
2856 DCHECK(VectorLoadConvention::SlotRegister().is(rax)); | 2856 DCHECK(VectorLoadICDescriptor::SlotRegister().is(rax)); |
2857 __ Move(VectorLoadConvention::SlotRegister(), | 2857 __ Move(VectorLoadICDescriptor::SlotRegister(), |
2858 Smi::FromInt(instr->hydrogen()->slot())); | 2858 Smi::FromInt(instr->hydrogen()->slot())); |
2859 } | 2859 } |
2860 | 2860 |
2861 | 2861 |
2862 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2862 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2863 DCHECK(ToRegister(instr->context()).is(rsi)); | 2863 DCHECK(ToRegister(instr->context()).is(rsi)); |
2864 DCHECK(ToRegister(instr->global_object()) | 2864 DCHECK(ToRegister(instr->global_object()) |
2865 .is(LoadConvention::ReceiverRegister())); | 2865 .is(LoadDescriptor::ReceiverRegister())); |
2866 DCHECK(ToRegister(instr->result()).is(rax)); | 2866 DCHECK(ToRegister(instr->result()).is(rax)); |
2867 | 2867 |
2868 __ Move(LoadConvention::NameRegister(), instr->name()); | 2868 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
2869 if (FLAG_vector_ics) { | 2869 if (FLAG_vector_ics) { |
2870 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2870 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2871 } | 2871 } |
2872 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2872 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2873 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2873 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
2874 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2874 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2875 } | 2875 } |
2876 | 2876 |
2877 | 2877 |
2878 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2878 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2998 DCHECK(kSmiTagSize + kSmiShiftSize == 32); | 2998 DCHECK(kSmiTagSize + kSmiShiftSize == 32); |
2999 offset += kPointerSize / 2; | 2999 offset += kPointerSize / 2; |
3000 representation = Representation::Integer32(); | 3000 representation = Representation::Integer32(); |
3001 } | 3001 } |
3002 __ Load(result, FieldOperand(object, offset), representation); | 3002 __ Load(result, FieldOperand(object, offset), representation); |
3003 } | 3003 } |
3004 | 3004 |
3005 | 3005 |
3006 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3006 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3007 DCHECK(ToRegister(instr->context()).is(rsi)); | 3007 DCHECK(ToRegister(instr->context()).is(rsi)); |
3008 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3008 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3009 DCHECK(ToRegister(instr->result()).is(rax)); | 3009 DCHECK(ToRegister(instr->result()).is(rax)); |
3010 | 3010 |
3011 __ Move(LoadConvention::NameRegister(), instr->name()); | 3011 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
3012 if (FLAG_vector_ics) { | 3012 if (FLAG_vector_ics) { |
3013 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3013 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3014 } | 3014 } |
3015 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3015 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
3016 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3016 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3017 } | 3017 } |
3018 | 3018 |
3019 | 3019 |
3020 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3020 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3021 Register function = ToRegister(instr->function()); | 3021 Register function = ToRegister(instr->function()); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3282 return Operand(elements_pointer_reg, | 3282 return Operand(elements_pointer_reg, |
3283 ToRegister(key), | 3283 ToRegister(key), |
3284 scale_factor, | 3284 scale_factor, |
3285 offset); | 3285 offset); |
3286 } | 3286 } |
3287 } | 3287 } |
3288 | 3288 |
3289 | 3289 |
3290 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3290 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3291 DCHECK(ToRegister(instr->context()).is(rsi)); | 3291 DCHECK(ToRegister(instr->context()).is(rsi)); |
3292 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3292 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3293 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); | 3293 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3294 | 3294 |
3295 if (FLAG_vector_ics) { | 3295 if (FLAG_vector_ics) { |
3296 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3296 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3297 } | 3297 } |
3298 | 3298 |
3299 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3299 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
3300 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3300 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3301 } | 3301 } |
3302 | 3302 |
3303 | 3303 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4182 kSaveFPRegs, | 4182 kSaveFPRegs, |
4183 EMIT_REMEMBERED_SET, | 4183 EMIT_REMEMBERED_SET, |
4184 hinstr->SmiCheckForWriteBarrier(), | 4184 hinstr->SmiCheckForWriteBarrier(), |
4185 hinstr->PointersToHereCheckForValue()); | 4185 hinstr->PointersToHereCheckForValue()); |
4186 } | 4186 } |
4187 } | 4187 } |
4188 | 4188 |
4189 | 4189 |
4190 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4190 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4191 DCHECK(ToRegister(instr->context()).is(rsi)); | 4191 DCHECK(ToRegister(instr->context()).is(rsi)); |
4192 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4192 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4193 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4193 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4194 | 4194 |
4195 __ Move(StoreConvention::NameRegister(), instr->hydrogen()->name()); | 4195 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name()); |
4196 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 4196 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
4197 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4197 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4198 } | 4198 } |
4199 | 4199 |
4200 | 4200 |
4201 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4201 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4202 Representation representation = instr->hydrogen()->length()->representation(); | 4202 Representation representation = instr->hydrogen()->length()->representation(); |
4203 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); | 4203 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); |
4204 DCHECK(representation.IsSmiOrInteger32()); | 4204 DCHECK(representation.IsSmiOrInteger32()); |
4205 | 4205 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4447 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4447 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4448 DoStoreKeyedFixedDoubleArray(instr); | 4448 DoStoreKeyedFixedDoubleArray(instr); |
4449 } else { | 4449 } else { |
4450 DoStoreKeyedFixedArray(instr); | 4450 DoStoreKeyedFixedArray(instr); |
4451 } | 4451 } |
4452 } | 4452 } |
4453 | 4453 |
4454 | 4454 |
4455 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4455 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4456 DCHECK(ToRegister(instr->context()).is(rsi)); | 4456 DCHECK(ToRegister(instr->context()).is(rsi)); |
4457 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4457 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4458 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); | 4458 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4459 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4459 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4460 | 4460 |
4461 Handle<Code> ic = instr->strict_mode() == STRICT | 4461 Handle<Code> ic = instr->strict_mode() == STRICT |
4462 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4462 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4463 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4463 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4464 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4464 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4465 } | 4465 } |
4466 | 4466 |
4467 | 4467 |
4468 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4468 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
4469 Register object_reg = ToRegister(instr->object()); | 4469 Register object_reg = ToRegister(instr->object()); |
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5850 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5850 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5851 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5851 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5852 } | 5852 } |
5853 | 5853 |
5854 | 5854 |
5855 #undef __ | 5855 #undef __ |
5856 | 5856 |
5857 } } // namespace v8::internal | 5857 } } // namespace v8::internal |
5858 | 5858 |
5859 #endif // V8_TARGET_ARCH_X64 | 5859 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |