Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 892383003: emit premonomorphic ics for loads/stores in optimized code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after
2870 DCHECK(ToRegister(instr->context()).is(esi)); 2870 DCHECK(ToRegister(instr->context()).is(esi));
2871 DCHECK(ToRegister(instr->global_object()) 2871 DCHECK(ToRegister(instr->global_object())
2872 .is(LoadDescriptor::ReceiverRegister())); 2872 .is(LoadDescriptor::ReceiverRegister()));
2873 DCHECK(ToRegister(instr->result()).is(eax)); 2873 DCHECK(ToRegister(instr->result()).is(eax));
2874 2874
2875 __ mov(LoadDescriptor::NameRegister(), instr->name()); 2875 __ mov(LoadDescriptor::NameRegister(), instr->name());
2876 if (FLAG_vector_ics) { 2876 if (FLAG_vector_ics) {
2877 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2877 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2878 } 2878 }
2879 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2879 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2880 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); 2880 Handle<Code> ic =
2881 CodeFactory::LoadICInOptimizedCode(isolate(), mode, UNINITIALIZED).code();
2881 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2882 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2882 } 2883 }
2883 2884
2884 2885
2885 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2886 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2886 Register value = ToRegister(instr->value()); 2887 Register value = ToRegister(instr->value());
2887 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); 2888 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle();
2888 2889
2889 // If the cell we are storing to contains the hole it could have 2890 // If the cell we are storing to contains the hole it could have
2890 // been deleted from the property dictionary. In that case, we need 2891 // been deleted from the property dictionary. In that case, we need
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
3006 3007
3007 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3008 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3008 DCHECK(ToRegister(instr->context()).is(esi)); 3009 DCHECK(ToRegister(instr->context()).is(esi));
3009 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3010 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3010 DCHECK(ToRegister(instr->result()).is(eax)); 3011 DCHECK(ToRegister(instr->result()).is(eax));
3011 3012
3012 __ mov(LoadDescriptor::NameRegister(), instr->name()); 3013 __ mov(LoadDescriptor::NameRegister(), instr->name());
3013 if (FLAG_vector_ics) { 3014 if (FLAG_vector_ics) {
3014 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3015 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3015 } 3016 }
3016 Handle<Code> ic = 3017 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
3017 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); 3018 isolate(), NOT_CONTEXTUAL,
3019 instr->hydrogen()->initialization_state()).code();
3018 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3020 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3019 } 3021 }
3020 3022
3021 3023
3022 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3024 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3023 Register function = ToRegister(instr->function()); 3025 Register function = ToRegister(instr->function());
3024 Register temp = ToRegister(instr->temp()); 3026 Register temp = ToRegister(instr->temp());
3025 Register result = ToRegister(instr->result()); 3027 Register result = ToRegister(instr->result());
3026 3028
3027 // Get the prototype or initial map from the function. 3029 // Get the prototype or initial map from the function.
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4165 } 4167 }
4166 } 4168 }
4167 4169
4168 4170
4169 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4171 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4170 DCHECK(ToRegister(instr->context()).is(esi)); 4172 DCHECK(ToRegister(instr->context()).is(esi));
4171 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4173 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4172 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4174 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4173 4175
4174 __ mov(StoreDescriptor::NameRegister(), instr->name()); 4176 __ mov(StoreDescriptor::NameRegister(), instr->name());
4175 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); 4177 Handle<Code> ic =
4178 StoreIC::initialize_stub(isolate(), instr->language_mode(),
4179 instr->hydrogen()->initialization_state());
4176 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4180 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4177 } 4181 }
4178 4182
4179 4183
4180 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4184 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4181 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; 4185 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal;
4182 if (instr->index()->IsConstantOperand()) { 4186 if (instr->index()->IsConstantOperand()) {
4183 __ cmp(ToOperand(instr->length()), 4187 __ cmp(ToOperand(instr->length()),
4184 ToImmediate(LConstantOperand::cast(instr->index()), 4188 ToImmediate(LConstantOperand::cast(instr->index()),
4185 instr->hydrogen()->length()->representation())); 4189 instr->hydrogen()->length()->representation()));
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
5772 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5776 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5773 RecordSafepoint(Safepoint::kNoLazyDeopt); 5777 RecordSafepoint(Safepoint::kNoLazyDeopt);
5774 } 5778 }
5775 5779
5776 5780
5777 #undef __ 5781 #undef __
5778 5782
5779 } } // namespace v8::internal 5783 } } // namespace v8::internal
5780 5784
5781 #endif // V8_TARGET_ARCH_IA32 5785 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698