| 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 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2839 if (FLAG_vector_ics) { | 2839 if (FLAG_vector_ics) { |
| 2840 Register vector = ToRegister(instr->temp_vector()); | 2840 Register vector = ToRegister(instr->temp_vector()); |
| 2841 DCHECK(vector.is(LoadIC::VectorRegister())); | 2841 DCHECK(vector.is(LoadIC::VectorRegister())); |
| 2842 __ mov(vector, instr->hydrogen()->feedback_vector()); | 2842 __ mov(vector, instr->hydrogen()->feedback_vector()); |
| 2843 // No need to allocate this register. | 2843 // No need to allocate this register. |
| 2844 DCHECK(LoadIC::SlotRegister().is(eax)); | 2844 DCHECK(LoadIC::SlotRegister().is(eax)); |
| 2845 __ mov(LoadIC::SlotRegister(), | 2845 __ mov(LoadIC::SlotRegister(), |
| 2846 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); | 2846 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
| 2847 } | 2847 } |
| 2848 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2848 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 2849 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2849 ExtraICState extra_state = LoadIC::ComputeExtraICState( |
| 2850 mode, LoadIC::NORMAL_LOOKUP); |
| 2851 Handle<Code> ic = LoadIC::initialize_stub(isolate(), extra_state); |
| 2850 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2852 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2851 } | 2853 } |
| 2852 | 2854 |
| 2853 | 2855 |
| 2854 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2856 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
| 2855 Register value = ToRegister(instr->value()); | 2857 Register value = ToRegister(instr->value()); |
| 2856 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); | 2858 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); |
| 2857 | 2859 |
| 2858 // If the cell we are storing to contains the hole it could have | 2860 // If the cell we are storing to contains the hole it could have |
| 2859 // been deleted from the property dictionary. In that case, we need | 2861 // been deleted from the property dictionary. In that case, we need |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2981 __ mov(LoadIC::NameRegister(), instr->name()); | 2983 __ mov(LoadIC::NameRegister(), instr->name()); |
| 2982 if (FLAG_vector_ics) { | 2984 if (FLAG_vector_ics) { |
| 2983 Register vector = ToRegister(instr->temp_vector()); | 2985 Register vector = ToRegister(instr->temp_vector()); |
| 2984 DCHECK(vector.is(LoadIC::VectorRegister())); | 2986 DCHECK(vector.is(LoadIC::VectorRegister())); |
| 2985 __ mov(vector, instr->hydrogen()->feedback_vector()); | 2987 __ mov(vector, instr->hydrogen()->feedback_vector()); |
| 2986 // No need to allocate this register. | 2988 // No need to allocate this register. |
| 2987 DCHECK(LoadIC::SlotRegister().is(eax)); | 2989 DCHECK(LoadIC::SlotRegister().is(eax)); |
| 2988 __ mov(LoadIC::SlotRegister(), | 2990 __ mov(LoadIC::SlotRegister(), |
| 2989 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); | 2991 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
| 2990 } | 2992 } |
| 2991 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 2993 LoadIC::PropertyLookupMode lookup_mode = |
| 2994 instr->is_own_property() |
| 2995 ? LoadIC::OWN_PROPERTY_LOOKUP |
| 2996 : LoadIC::NORMAL_LOOKUP; |
| 2997 ExtraICState extra_state = LoadIC::ComputeExtraICState( |
| 2998 NOT_CONTEXTUAL, lookup_mode); |
| 2999 Handle<Code> ic = LoadIC::initialize_stub(isolate(), extra_state); |
| 2992 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3000 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2993 } | 3001 } |
| 2994 | 3002 |
| 2995 | 3003 |
| 2996 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3004 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 2997 Register function = ToRegister(instr->function()); | 3005 Register function = ToRegister(instr->function()); |
| 2998 Register temp = ToRegister(instr->temp()); | 3006 Register temp = ToRegister(instr->temp()); |
| 2999 Register result = ToRegister(instr->result()); | 3007 Register result = ToRegister(instr->result()); |
| 3000 | 3008 |
| 3001 // Get the prototype or initial map from the function. | 3009 // Get the prototype or initial map from the function. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3215 if (FLAG_vector_ics) { | 3223 if (FLAG_vector_ics) { |
| 3216 Register vector = ToRegister(instr->temp_vector()); | 3224 Register vector = ToRegister(instr->temp_vector()); |
| 3217 DCHECK(vector.is(LoadIC::VectorRegister())); | 3225 DCHECK(vector.is(LoadIC::VectorRegister())); |
| 3218 __ mov(vector, instr->hydrogen()->feedback_vector()); | 3226 __ mov(vector, instr->hydrogen()->feedback_vector()); |
| 3219 // No need to allocate this register. | 3227 // No need to allocate this register. |
| 3220 DCHECK(LoadIC::SlotRegister().is(eax)); | 3228 DCHECK(LoadIC::SlotRegister().is(eax)); |
| 3221 __ mov(LoadIC::SlotRegister(), | 3229 __ mov(LoadIC::SlotRegister(), |
| 3222 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); | 3230 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
| 3223 } | 3231 } |
| 3224 | 3232 |
| 3225 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3233 LoadIC::PropertyLookupMode lookup_mode = |
| 3234 instr->is_own_property() |
| 3235 ? LoadIC::OWN_PROPERTY_LOOKUP |
| 3236 : LoadIC::NORMAL_LOOKUP; |
| 3237 ExtraICState extra_state = LoadIC::ComputeExtraICState( |
| 3238 NOT_CONTEXTUAL, lookup_mode); |
| 3239 Handle<Code> ic = KeyedLoadIC::initialize_stub(isolate(), extra_state); |
| 3226 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3240 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3227 } | 3241 } |
| 3228 | 3242 |
| 3229 | 3243 |
| 3230 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3244 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 3231 Register result = ToRegister(instr->result()); | 3245 Register result = ToRegister(instr->result()); |
| 3232 | 3246 |
| 3233 if (instr->hydrogen()->from_inlined()) { | 3247 if (instr->hydrogen()->from_inlined()) { |
| 3234 __ lea(result, Operand(esp, -2 * kPointerSize)); | 3248 __ lea(result, Operand(esp, -2 * kPointerSize)); |
| 3235 } else { | 3249 } else { |
| (...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5675 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5689 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5676 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5690 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5677 } | 5691 } |
| 5678 | 5692 |
| 5679 | 5693 |
| 5680 #undef __ | 5694 #undef __ |
| 5681 | 5695 |
| 5682 } } // namespace v8::internal | 5696 } } // namespace v8::internal |
| 5683 | 5697 |
| 5684 #endif // V8_TARGET_ARCH_IA32 | 5698 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |