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

Side by Side Diff: src/x87/lithium-codegen-x87.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_X87 7 #if V8_TARGET_ARCH_X87
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 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after
3143 DCHECK(ToRegister(instr->context()).is(esi)); 3143 DCHECK(ToRegister(instr->context()).is(esi));
3144 DCHECK(ToRegister(instr->global_object()) 3144 DCHECK(ToRegister(instr->global_object())
3145 .is(LoadDescriptor::ReceiverRegister())); 3145 .is(LoadDescriptor::ReceiverRegister()));
3146 DCHECK(ToRegister(instr->result()).is(eax)); 3146 DCHECK(ToRegister(instr->result()).is(eax));
3147 3147
3148 __ mov(LoadDescriptor::NameRegister(), instr->name()); 3148 __ mov(LoadDescriptor::NameRegister(), instr->name());
3149 if (FLAG_vector_ics) { 3149 if (FLAG_vector_ics) {
3150 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 3150 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
3151 } 3151 }
3152 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 3152 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
3153 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); 3153 Handle<Code> ic =
3154 CodeFactory::LoadICInOptimizedCode(isolate(), mode, UNINITIALIZED).code();
3154 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3155 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3155 } 3156 }
3156 3157
3157 3158
3158 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 3159 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
3159 Register value = ToRegister(instr->value()); 3160 Register value = ToRegister(instr->value());
3160 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); 3161 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle();
3161 3162
3162 // If the cell we are storing to contains the hole it could have 3163 // If the cell we are storing to contains the hole it could have
3163 // been deleted from the property dictionary. In that case, we need 3164 // been deleted from the property dictionary. In that case, we need
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3273 3274
3274 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3275 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3275 DCHECK(ToRegister(instr->context()).is(esi)); 3276 DCHECK(ToRegister(instr->context()).is(esi));
3276 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3277 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3277 DCHECK(ToRegister(instr->result()).is(eax)); 3278 DCHECK(ToRegister(instr->result()).is(eax));
3278 3279
3279 __ mov(LoadDescriptor::NameRegister(), instr->name()); 3280 __ mov(LoadDescriptor::NameRegister(), instr->name());
3280 if (FLAG_vector_ics) { 3281 if (FLAG_vector_ics) {
3281 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3282 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3282 } 3283 }
3283 Handle<Code> ic = 3284 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
3284 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); 3285 isolate(), NOT_CONTEXTUAL,
3286 instr->hydrogen()->initialization_state()).code();
3285 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3287 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3286 } 3288 }
3287 3289
3288 3290
3289 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3291 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3290 Register function = ToRegister(instr->function()); 3292 Register function = ToRegister(instr->function());
3291 Register temp = ToRegister(instr->temp()); 3293 Register temp = ToRegister(instr->temp());
3292 Register result = ToRegister(instr->result()); 3294 Register result = ToRegister(instr->result());
3293 3295
3294 // Get the prototype or initial map from the function. 3296 // Get the prototype or initial map from the function.
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
4562 } 4564 }
4563 } 4565 }
4564 4566
4565 4567
4566 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4568 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4567 DCHECK(ToRegister(instr->context()).is(esi)); 4569 DCHECK(ToRegister(instr->context()).is(esi));
4568 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4570 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4569 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4571 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4570 4572
4571 __ mov(StoreDescriptor::NameRegister(), instr->name()); 4573 __ mov(StoreDescriptor::NameRegister(), instr->name());
4572 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); 4574 Handle<Code> ic =
4575 StoreIC::initialize_stub(isolate(), instr->language_mode(),
4576 instr->hydrogen()->initialization_state());
4573 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4577 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4574 } 4578 }
4575 4579
4576 4580
4577 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4581 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4578 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; 4582 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal;
4579 if (instr->index()->IsConstantOperand()) { 4583 if (instr->index()->IsConstantOperand()) {
4580 __ cmp(ToOperand(instr->length()), 4584 __ cmp(ToOperand(instr->length()),
4581 ToImmediate(LConstantOperand::cast(instr->index()), 4585 ToImmediate(LConstantOperand::cast(instr->index()),
4582 instr->hydrogen()->length()->representation())); 4586 instr->hydrogen()->length()->representation()));
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
6378 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6382 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6379 RecordSafepoint(Safepoint::kNoLazyDeopt); 6383 RecordSafepoint(Safepoint::kNoLazyDeopt);
6380 } 6384 }
6381 6385
6382 6386
6383 #undef __ 6387 #undef __
6384 6388
6385 } } // namespace v8::internal 6389 } } // namespace v8::internal
6386 6390
6387 #endif // V8_TARGET_ARCH_X87 6391 #endif // V8_TARGET_ARCH_X87
OLDNEW
« src/mips64/lithium-codegen-mips64.cc ('K') | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698