| 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/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2872 DCHECK(ToRegister(instr->context()).is(esi)); | 2872 DCHECK(ToRegister(instr->context()).is(esi)); |
| 2873 DCHECK(ToRegister(instr->global_object()) | 2873 DCHECK(ToRegister(instr->global_object()) |
| 2874 .is(LoadDescriptor::ReceiverRegister())); | 2874 .is(LoadDescriptor::ReceiverRegister())); |
| 2875 DCHECK(ToRegister(instr->result()).is(eax)); | 2875 DCHECK(ToRegister(instr->result()).is(eax)); |
| 2876 | 2876 |
| 2877 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 2877 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
| 2878 if (FLAG_vector_ics) { | 2878 if (FLAG_vector_ics) { |
| 2879 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2879 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2880 } | 2880 } |
| 2881 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2881 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 2882 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); | 2882 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 2883 PREMONOMORPHIC).code(); |
| 2883 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2884 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2884 } | 2885 } |
| 2885 | 2886 |
| 2886 | 2887 |
| 2887 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2888 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
| 2888 Register value = ToRegister(instr->value()); | 2889 Register value = ToRegister(instr->value()); |
| 2889 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); | 2890 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); |
| 2890 | 2891 |
| 2891 // If the cell we are storing to contains the hole it could have | 2892 // If the cell we are storing to contains the hole it could have |
| 2892 // been deleted from the property dictionary. In that case, we need | 2893 // been deleted from the property dictionary. In that case, we need |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3008 | 3009 |
| 3009 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3010 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 3010 DCHECK(ToRegister(instr->context()).is(esi)); | 3011 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3011 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3012 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3012 DCHECK(ToRegister(instr->result()).is(eax)); | 3013 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3013 | 3014 |
| 3014 __ mov(LoadDescriptor::NameRegister(), instr->name()); | 3015 __ mov(LoadDescriptor::NameRegister(), instr->name()); |
| 3015 if (FLAG_vector_ics) { | 3016 if (FLAG_vector_ics) { |
| 3016 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3017 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 3017 } | 3018 } |
| 3018 Handle<Code> ic = | 3019 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 3019 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); | 3020 isolate(), NOT_CONTEXTUAL, |
| 3021 instr->hydrogen()->initialization_state()).code(); |
| 3020 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3022 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3021 } | 3023 } |
| 3022 | 3024 |
| 3023 | 3025 |
| 3024 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3026 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 3025 Register function = ToRegister(instr->function()); | 3027 Register function = ToRegister(instr->function()); |
| 3026 Register temp = ToRegister(instr->temp()); | 3028 Register temp = ToRegister(instr->temp()); |
| 3027 Register result = ToRegister(instr->result()); | 3029 Register result = ToRegister(instr->result()); |
| 3028 | 3030 |
| 3029 // Get the prototype or initial map from the function. | 3031 // Get the prototype or initial map from the function. |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4167 } | 4169 } |
| 4168 } | 4170 } |
| 4169 | 4171 |
| 4170 | 4172 |
| 4171 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4173 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 4172 DCHECK(ToRegister(instr->context()).is(esi)); | 4174 DCHECK(ToRegister(instr->context()).is(esi)); |
| 4173 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4175 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
| 4174 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4176 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
| 4175 | 4177 |
| 4176 __ mov(StoreDescriptor::NameRegister(), instr->name()); | 4178 __ mov(StoreDescriptor::NameRegister(), instr->name()); |
| 4177 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); | 4179 Handle<Code> ic = |
| 4180 StoreIC::initialize_stub(isolate(), instr->language_mode(), |
| 4181 instr->hydrogen()->initialization_state()); |
| 4178 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4182 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4179 } | 4183 } |
| 4180 | 4184 |
| 4181 | 4185 |
| 4182 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4186 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 4183 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; | 4187 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; |
| 4184 if (instr->index()->IsConstantOperand()) { | 4188 if (instr->index()->IsConstantOperand()) { |
| 4185 __ cmp(ToOperand(instr->length()), | 4189 __ cmp(ToOperand(instr->length()), |
| 4186 ToImmediate(LConstantOperand::cast(instr->index()), | 4190 ToImmediate(LConstantOperand::cast(instr->index()), |
| 4187 instr->hydrogen()->length()->representation())); | 4191 instr->hydrogen()->length()->representation())); |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5774 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5778 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5775 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5779 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5776 } | 5780 } |
| 5777 | 5781 |
| 5778 | 5782 |
| 5779 #undef __ | 5783 #undef __ |
| 5780 | 5784 |
| 5781 } } // namespace v8::internal | 5785 } } // namespace v8::internal |
| 5782 | 5786 |
| 5783 #endif // V8_TARGET_ARCH_IA32 | 5787 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |