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 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
9 #include "src/mips64/lithium-codegen-mips64.h" | 9 #include "src/mips64/lithium-codegen-mips64.h" |
10 #include "src/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/mips64/lithium-gap-resolver-mips64.h" |
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2862 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2862 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2863 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); | 2863 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
2864 } | 2864 } |
2865 } | 2865 } |
2866 | 2866 |
2867 | 2867 |
2868 template <class T> | 2868 template <class T> |
2869 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2869 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2870 DCHECK(FLAG_vector_ics); | 2870 DCHECK(FLAG_vector_ics); |
2871 Register vector = ToRegister(instr->temp_vector()); | 2871 Register vector = ToRegister(instr->temp_vector()); |
2872 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); | 2872 DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); |
2873 __ li(vector, instr->hydrogen()->feedback_vector()); | 2873 __ li(vector, instr->hydrogen()->feedback_vector()); |
2874 // No need to allocate this register. | 2874 // No need to allocate this register. |
2875 DCHECK(FullVectorLoadConvention::SlotRegister().is(a0)); | 2875 DCHECK(VectorLoadICDescriptor::SlotRegister().is(a0)); |
2876 __ li(FullVectorLoadConvention::SlotRegister(), | 2876 __ li(VectorLoadICDescriptor::SlotRegister(), |
2877 Operand(Smi::FromInt(instr->hydrogen()->slot()))); | 2877 Operand(Smi::FromInt(instr->hydrogen()->slot()))); |
2878 } | 2878 } |
2879 | 2879 |
2880 | 2880 |
2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2882 DCHECK(ToRegister(instr->context()).is(cp)); | 2882 DCHECK(ToRegister(instr->context()).is(cp)); |
2883 DCHECK(ToRegister(instr->global_object()) | 2883 DCHECK(ToRegister(instr->global_object()) |
2884 .is(LoadConvention::ReceiverRegister())); | 2884 .is(LoadDescriptor::ReceiverRegister())); |
2885 DCHECK(ToRegister(instr->result()).is(v0)); | 2885 DCHECK(ToRegister(instr->result()).is(v0)); |
2886 | 2886 |
2887 __ li(LoadConvention::NameRegister(), Operand(instr->name())); | 2887 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2888 if (FLAG_vector_ics) { | 2888 if (FLAG_vector_ics) { |
2889 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2889 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2890 } | 2890 } |
2891 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2891 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2892 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2892 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
2893 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2893 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2894 } | 2894 } |
2895 | 2895 |
2896 | 2896 |
2897 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2897 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); | 3015 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); |
3016 offset += kPointerSize / 2; | 3016 offset += kPointerSize / 2; |
3017 representation = Representation::Integer32(); | 3017 representation = Representation::Integer32(); |
3018 } | 3018 } |
3019 __ Load(result, FieldMemOperand(object, offset), representation); | 3019 __ Load(result, FieldMemOperand(object, offset), representation); |
3020 } | 3020 } |
3021 | 3021 |
3022 | 3022 |
3023 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3023 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3024 DCHECK(ToRegister(instr->context()).is(cp)); | 3024 DCHECK(ToRegister(instr->context()).is(cp)); |
3025 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3025 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3026 DCHECK(ToRegister(instr->result()).is(v0)); | 3026 DCHECK(ToRegister(instr->result()).is(v0)); |
3027 | 3027 |
3028 // Name is always in a2. | 3028 // Name is always in a2. |
3029 __ li(LoadConvention::NameRegister(), Operand(instr->name())); | 3029 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3030 if (FLAG_vector_ics) { | 3030 if (FLAG_vector_ics) { |
3031 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3031 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3032 } | 3032 } |
3033 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3033 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
3034 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3034 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3035 } | 3035 } |
3036 | 3036 |
3037 | 3037 |
3038 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3038 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3039 Register scratch = scratch0(); | 3039 Register scratch = scratch0(); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3365 __ dsra(scratch0(), key, -shift_size); | 3365 __ dsra(scratch0(), key, -shift_size); |
3366 } | 3366 } |
3367 __ Daddu(scratch0(), base, scratch0()); | 3367 __ Daddu(scratch0(), base, scratch0()); |
3368 return MemOperand(scratch0(), base_offset); | 3368 return MemOperand(scratch0(), base_offset); |
3369 } | 3369 } |
3370 } | 3370 } |
3371 | 3371 |
3372 | 3372 |
3373 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3373 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3374 DCHECK(ToRegister(instr->context()).is(cp)); | 3374 DCHECK(ToRegister(instr->context()).is(cp)); |
3375 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3375 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3376 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); | 3376 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3377 | 3377 |
3378 if (FLAG_vector_ics) { | 3378 if (FLAG_vector_ics) { |
3379 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3379 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3380 } | 3380 } |
3381 | 3381 |
3382 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3382 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
3383 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3383 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3384 } | 3384 } |
3385 | 3385 |
3386 | 3386 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4187 kSaveFPRegs, | 4187 kSaveFPRegs, |
4188 EMIT_REMEMBERED_SET, | 4188 EMIT_REMEMBERED_SET, |
4189 instr->hydrogen()->SmiCheckForWriteBarrier(), | 4189 instr->hydrogen()->SmiCheckForWriteBarrier(), |
4190 instr->hydrogen()->PointersToHereCheckForValue()); | 4190 instr->hydrogen()->PointersToHereCheckForValue()); |
4191 } | 4191 } |
4192 } | 4192 } |
4193 | 4193 |
4194 | 4194 |
4195 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4195 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4196 DCHECK(ToRegister(instr->context()).is(cp)); | 4196 DCHECK(ToRegister(instr->context()).is(cp)); |
4197 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4197 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4198 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4198 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4199 | 4199 |
4200 __ li(StoreConvention::NameRegister(), Operand(instr->name())); | 4200 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4201 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 4201 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
4202 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4202 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4203 } | 4203 } |
4204 | 4204 |
4205 | 4205 |
4206 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4206 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4207 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4207 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4208 Operand operand((int64_t)0); | 4208 Operand operand((int64_t)0); |
4209 Register reg; | 4209 Register reg; |
4210 if (instr->index()->IsConstantOperand()) { | 4210 if (instr->index()->IsConstantOperand()) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4451 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4451 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4452 DoStoreKeyedFixedDoubleArray(instr); | 4452 DoStoreKeyedFixedDoubleArray(instr); |
4453 } else { | 4453 } else { |
4454 DoStoreKeyedFixedArray(instr); | 4454 DoStoreKeyedFixedArray(instr); |
4455 } | 4455 } |
4456 } | 4456 } |
4457 | 4457 |
4458 | 4458 |
4459 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4459 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4460 DCHECK(ToRegister(instr->context()).is(cp)); | 4460 DCHECK(ToRegister(instr->context()).is(cp)); |
4461 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4461 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4462 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); | 4462 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4463 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4463 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4464 | 4464 |
4465 Handle<Code> ic = (instr->strict_mode() == STRICT) | 4465 Handle<Code> ic = (instr->strict_mode() == STRICT) |
4466 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4466 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4467 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4467 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4468 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4468 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4469 } | 4469 } |
4470 | 4470 |
4471 | 4471 |
4472 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4472 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
4473 Register object_reg = ToRegister(instr->object()); | 4473 Register object_reg = ToRegister(instr->object()); |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5936 __ li(at, scope_info); | 5936 __ li(at, scope_info); |
5937 __ Push(at, ToRegister(instr->function())); | 5937 __ Push(at, ToRegister(instr->function())); |
5938 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5938 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5939 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5939 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5940 } | 5940 } |
5941 | 5941 |
5942 | 5942 |
5943 #undef __ | 5943 #undef __ |
5944 | 5944 |
5945 } } // namespace v8::internal | 5945 } } // namespace v8::internal |
OLD | NEW |