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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2829 } | 2829 } |
2830 } | 2830 } |
2831 | 2831 |
2832 | 2832 |
2833 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2833 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2834 ASSERT(ToRegister(instr->context()).is(esi)); | 2834 ASSERT(ToRegister(instr->context()).is(esi)); |
2835 ASSERT(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); | 2835 ASSERT(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); |
2836 ASSERT(ToRegister(instr->result()).is(eax)); | 2836 ASSERT(ToRegister(instr->result()).is(eax)); |
2837 | 2837 |
2838 __ mov(LoadIC::NameRegister(), instr->name()); | 2838 __ mov(LoadIC::NameRegister(), instr->name()); |
| 2839 if (FLAG_vector_ics) { |
| 2840 Register vector = ToRegister(instr->temp_vector()); |
| 2841 ASSERT(vector.is(LoadIC::VectorRegister())); |
| 2842 __ mov(vector, instr->hydrogen()->feedback_vector()); |
| 2843 // No need to allocate this register. |
| 2844 ASSERT(LoadIC::SlotRegister().is(eax)); |
| 2845 __ mov(LoadIC::SlotRegister(), |
| 2846 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
| 2847 } |
2839 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2848 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2840 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2849 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
2841 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2850 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2842 } | 2851 } |
2843 | 2852 |
2844 | 2853 |
2845 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2854 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
2846 Register value = ToRegister(instr->value()); | 2855 Register value = ToRegister(instr->value()); |
2847 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); | 2856 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); |
2848 | 2857 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 } | 2972 } |
2964 } | 2973 } |
2965 | 2974 |
2966 | 2975 |
2967 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2976 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2968 ASSERT(ToRegister(instr->context()).is(esi)); | 2977 ASSERT(ToRegister(instr->context()).is(esi)); |
2969 ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); | 2978 ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); |
2970 ASSERT(ToRegister(instr->result()).is(eax)); | 2979 ASSERT(ToRegister(instr->result()).is(eax)); |
2971 | 2980 |
2972 __ mov(LoadIC::NameRegister(), instr->name()); | 2981 __ mov(LoadIC::NameRegister(), instr->name()); |
| 2982 if (FLAG_vector_ics) { |
| 2983 Register vector = ToRegister(instr->temp_vector()); |
| 2984 ASSERT(vector.is(LoadIC::VectorRegister())); |
| 2985 __ mov(vector, instr->hydrogen()->feedback_vector()); |
| 2986 // No need to allocate this register. |
| 2987 ASSERT(LoadIC::SlotRegister().is(eax)); |
| 2988 __ mov(LoadIC::SlotRegister(), |
| 2989 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
| 2990 } |
2973 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 2991 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
2974 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2992 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2975 } | 2993 } |
2976 | 2994 |
2977 | 2995 |
2978 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2996 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2979 Register function = ToRegister(instr->function()); | 2997 Register function = ToRegister(instr->function()); |
2980 Register temp = ToRegister(instr->temp()); | 2998 Register temp = ToRegister(instr->temp()); |
2981 Register result = ToRegister(instr->result()); | 2999 Register result = ToRegister(instr->result()); |
2982 | 3000 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3203 base_offset); | 3221 base_offset); |
3204 } | 3222 } |
3205 } | 3223 } |
3206 | 3224 |
3207 | 3225 |
3208 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3226 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3209 ASSERT(ToRegister(instr->context()).is(esi)); | 3227 ASSERT(ToRegister(instr->context()).is(esi)); |
3210 ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); | 3228 ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); |
3211 ASSERT(ToRegister(instr->key()).is(LoadIC::NameRegister())); | 3229 ASSERT(ToRegister(instr->key()).is(LoadIC::NameRegister())); |
3212 | 3230 |
| 3231 if (FLAG_vector_ics) { |
| 3232 Register vector = ToRegister(instr->temp_vector()); |
| 3233 ASSERT(vector.is(LoadIC::VectorRegister())); |
| 3234 __ mov(vector, instr->hydrogen()->feedback_vector()); |
| 3235 // No need to allocate this register. |
| 3236 ASSERT(LoadIC::SlotRegister().is(eax)); |
| 3237 __ mov(LoadIC::SlotRegister(), |
| 3238 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
| 3239 } |
| 3240 |
3213 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3241 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
3214 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3242 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3215 } | 3243 } |
3216 | 3244 |
3217 | 3245 |
3218 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3246 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3219 Register result = ToRegister(instr->result()); | 3247 Register result = ToRegister(instr->result()); |
3220 | 3248 |
3221 if (instr->hydrogen()->from_inlined()) { | 3249 if (instr->hydrogen()->from_inlined()) { |
3222 __ lea(result, Operand(esp, -2 * kPointerSize)); | 3250 __ lea(result, Operand(esp, -2 * kPointerSize)); |
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5655 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5683 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5656 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5684 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5657 } | 5685 } |
5658 | 5686 |
5659 | 5687 |
5660 #undef __ | 5688 #undef __ |
5661 | 5689 |
5662 } } // namespace v8::internal | 5690 } } // namespace v8::internal |
5663 | 5691 |
5664 #endif // V8_TARGET_ARCH_IA32 | 5692 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |