OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2885 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2885 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2886 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); | 2886 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
2887 } | 2887 } |
2888 } | 2888 } |
2889 | 2889 |
2890 | 2890 |
2891 template <class T> | 2891 template <class T> |
2892 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2892 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2893 DCHECK(FLAG_vector_ics); | 2893 DCHECK(FLAG_vector_ics); |
2894 Register vector = ToRegister(instr->temp_vector()); | 2894 Register vector = ToRegister(instr->temp_vector()); |
2895 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); | 2895 DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); |
2896 __ li(vector, instr->hydrogen()->feedback_vector()); | 2896 __ li(vector, instr->hydrogen()->feedback_vector()); |
2897 // No need to allocate this register. | 2897 // No need to allocate this register. |
2898 DCHECK(FullVectorLoadConvention::SlotRegister().is(a0)); | 2898 DCHECK(VectorLoadICDescriptor::SlotRegister().is(a0)); |
2899 __ li(FullVectorLoadConvention::SlotRegister(), | 2899 __ li(VectorLoadICDescriptor::SlotRegister(), |
2900 Operand(Smi::FromInt(instr->hydrogen()->slot()))); | 2900 Operand(Smi::FromInt(instr->hydrogen()->slot()))); |
2901 } | 2901 } |
2902 | 2902 |
2903 | 2903 |
2904 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2904 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2905 DCHECK(ToRegister(instr->context()).is(cp)); | 2905 DCHECK(ToRegister(instr->context()).is(cp)); |
2906 DCHECK(ToRegister(instr->global_object()) | 2906 DCHECK(ToRegister(instr->global_object()) |
2907 .is(LoadConvention::ReceiverRegister())); | 2907 .is(LoadDescriptor::ReceiverRegister())); |
2908 DCHECK(ToRegister(instr->result()).is(v0)); | 2908 DCHECK(ToRegister(instr->result()).is(v0)); |
2909 | 2909 |
2910 __ li(LoadConvention::NameRegister(), Operand(instr->name())); | 2910 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2911 if (FLAG_vector_ics) { | 2911 if (FLAG_vector_ics) { |
2912 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2912 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2913 } | 2913 } |
2914 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2914 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2915 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2915 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
2916 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2916 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2917 } | 2917 } |
2918 | 2918 |
2919 | 2919 |
2920 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2920 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3024 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 3024 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
3025 object = result; | 3025 object = result; |
3026 } | 3026 } |
3027 MemOperand operand = FieldMemOperand(object, offset); | 3027 MemOperand operand = FieldMemOperand(object, offset); |
3028 __ Load(result, operand, access.representation()); | 3028 __ Load(result, operand, access.representation()); |
3029 } | 3029 } |
3030 | 3030 |
3031 | 3031 |
3032 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3032 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3033 DCHECK(ToRegister(instr->context()).is(cp)); | 3033 DCHECK(ToRegister(instr->context()).is(cp)); |
3034 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 3034 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3035 DCHECK(ToRegister(instr->result()).is(v0)); | 3035 DCHECK(ToRegister(instr->result()).is(v0)); |
3036 | 3036 |
3037 // Name is always in a2. | 3037 // Name is always in a2. |
3038 __ li(LoadConvention::NameRegister(), Operand(instr->name())); | 3038 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3039 if (FLAG_vector_ics) { | 3039 if (FLAG_vector_ics) { |
3040 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3040 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3041 } | 3041 } |
3042 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3042 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
3043 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3043 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3044 } | 3044 } |
3045 | 3045 |
3046 | 3046 |
3047 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3047 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3048 Register scratch = scratch0(); | 3048 Register scratch = scratch0(); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3333 DCHECK_EQ(-1, shift_size); | 3333 DCHECK_EQ(-1, shift_size); |
3334 __ sra(scratch0(), key, 1); | 3334 __ sra(scratch0(), key, 1); |
3335 __ Addu(scratch0(), base, scratch0()); | 3335 __ Addu(scratch0(), base, scratch0()); |
3336 return MemOperand(scratch0(), base_offset); | 3336 return MemOperand(scratch0(), 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(cp)); | 3342 DCHECK(ToRegister(instr->context()).is(cp)); |
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4149 EMIT_REMEMBERED_SET, | 4149 EMIT_REMEMBERED_SET, |
4150 instr->hydrogen()->SmiCheckForWriteBarrier(), | 4150 instr->hydrogen()->SmiCheckForWriteBarrier(), |
4151 instr->hydrogen()->PointersToHereCheckForValue()); | 4151 instr->hydrogen()->PointersToHereCheckForValue()); |
4152 } | 4152 } |
4153 } | 4153 } |
4154 } | 4154 } |
4155 | 4155 |
4156 | 4156 |
4157 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4157 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4158 DCHECK(ToRegister(instr->context()).is(cp)); | 4158 DCHECK(ToRegister(instr->context()).is(cp)); |
4159 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4159 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4160 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4160 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4161 | 4161 |
4162 __ li(StoreConvention::NameRegister(), Operand(instr->name())); | 4162 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4163 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 4163 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
4164 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4164 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4165 } | 4165 } |
4166 | 4166 |
4167 | 4167 |
4168 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4168 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4169 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4169 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4170 Operand operand(0); | 4170 Operand operand(0); |
4171 Register reg; | 4171 Register reg; |
4172 if (instr->index()->IsConstantOperand()) { | 4172 if (instr->index()->IsConstantOperand()) { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4380 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4380 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4381 DoStoreKeyedFixedDoubleArray(instr); | 4381 DoStoreKeyedFixedDoubleArray(instr); |
4382 } else { | 4382 } else { |
4383 DoStoreKeyedFixedArray(instr); | 4383 DoStoreKeyedFixedArray(instr); |
4384 } | 4384 } |
4385 } | 4385 } |
4386 | 4386 |
4387 | 4387 |
4388 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4388 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4389 DCHECK(ToRegister(instr->context()).is(cp)); | 4389 DCHECK(ToRegister(instr->context()).is(cp)); |
4390 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 4390 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4391 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); | 4391 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4392 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 4392 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4393 | 4393 |
4394 Handle<Code> ic = (instr->strict_mode() == STRICT) | 4394 Handle<Code> ic = (instr->strict_mode() == STRICT) |
4395 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4395 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4396 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4396 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4397 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4397 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4398 } | 4398 } |
4399 | 4399 |
4400 | 4400 |
4401 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4401 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
4402 Register object_reg = ToRegister(instr->object()); | 4402 Register object_reg = ToRegister(instr->object()); |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5898 __ li(at, scope_info); | 5898 __ li(at, scope_info); |
5899 __ Push(at, ToRegister(instr->function())); | 5899 __ Push(at, ToRegister(instr->function())); |
5900 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5900 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5901 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5901 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5902 } | 5902 } |
5903 | 5903 |
5904 | 5904 |
5905 #undef __ | 5905 #undef __ |
5906 | 5906 |
5907 } } // namespace v8::internal | 5907 } } // namespace v8::internal |
OLD | NEW |