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