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

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

Issue 1228113008: Crankshaft part of the 'loads and stores to global vars through property cell shortcuts' feature. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments + regression test Created 5 years, 5 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
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | src/x87/lithium-x87.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3135 3135
3136 __ mov(LoadDescriptor::NameRegister(), instr->name()); 3136 __ mov(LoadDescriptor::NameRegister(), instr->name());
3137 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 3137 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
3138 Handle<Code> ic = 3138 Handle<Code> ic =
3139 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), 3139 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
3140 SLOPPY, PREMONOMORPHIC).code(); 3140 SLOPPY, PREMONOMORPHIC).code();
3141 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3141 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3142 } 3142 }
3143 3143
3144 3144
3145 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) {
3146 DCHECK(ToRegister(instr->context()).is(esi));
3147 DCHECK(ToRegister(instr->result()).is(eax));
3148
3149 __ mov(LoadGlobalViaContextDescriptor::DepthRegister(),
3150 Immediate(Smi::FromInt(instr->depth())));
3151 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(),
3152 Immediate(Smi::FromInt(instr->slot_index())));
3153 __ mov(LoadGlobalViaContextDescriptor::NameRegister(), instr->name());
3154
3155 Handle<Code> stub =
3156 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code();
3157 CallCode(stub, RelocInfo::CODE_TARGET, instr);
3158 }
3159
3160
3145 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 3161 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
3146 Register context = ToRegister(instr->context()); 3162 Register context = ToRegister(instr->context());
3147 Register result = ToRegister(instr->result()); 3163 Register result = ToRegister(instr->result());
3148 __ mov(result, ContextOperand(context, instr->slot_index())); 3164 __ mov(result, ContextOperand(context, instr->slot_index()));
3149 3165
3150 if (instr->hydrogen()->RequiresHoleCheck()) { 3166 if (instr->hydrogen()->RequiresHoleCheck()) {
3151 __ cmp(result, factory()->the_hole_value()); 3167 __ cmp(result, factory()->the_hole_value());
3152 if (instr->hydrogen()->DeoptimizesOnHole()) { 3168 if (instr->hydrogen()->DeoptimizesOnHole()) {
3153 DeoptimizeIf(equal, instr, Deoptimizer::kHole); 3169 DeoptimizeIf(equal, instr, Deoptimizer::kHole);
3154 } else { 3170 } else {
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
4514 } 4530 }
4515 4531
4516 __ mov(StoreDescriptor::NameRegister(), instr->name()); 4532 __ mov(StoreDescriptor::NameRegister(), instr->name());
4517 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( 4533 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
4518 isolate(), instr->language_mode(), 4534 isolate(), instr->language_mode(),
4519 instr->hydrogen()->initialization_state()).code(); 4535 instr->hydrogen()->initialization_state()).code();
4520 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4536 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4521 } 4537 }
4522 4538
4523 4539
4540 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) {
4541 DCHECK(ToRegister(instr->context()).is(esi));
4542 DCHECK(ToRegister(instr->value())
4543 .is(StoreGlobalViaContextDescriptor::ValueRegister()));
4544
4545 __ mov(StoreGlobalViaContextDescriptor::DepthRegister(),
4546 Immediate(Smi::FromInt(instr->depth())));
4547 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(),
4548 Immediate(Smi::FromInt(instr->slot_index())));
4549 __ mov(StoreGlobalViaContextDescriptor::NameRegister(), instr->name());
4550
4551 Handle<Code> stub =
4552 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(),
4553 instr->language_mode()).code();
4554 CallCode(stub, RelocInfo::CODE_TARGET, instr);
4555 }
4556
4557
4524 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4558 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4525 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; 4559 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal;
4526 if (instr->index()->IsConstantOperand()) { 4560 if (instr->index()->IsConstantOperand()) {
4527 __ cmp(ToOperand(instr->length()), 4561 __ cmp(ToOperand(instr->length()),
4528 ToImmediate(LConstantOperand::cast(instr->index()), 4562 ToImmediate(LConstantOperand::cast(instr->index()),
4529 instr->hydrogen()->length()->representation())); 4563 instr->hydrogen()->length()->representation()));
4530 cc = CommuteCondition(cc); 4564 cc = CommuteCondition(cc);
4531 } else if (instr->length()->IsConstantOperand()) { 4565 } else if (instr->length()->IsConstantOperand()) {
4532 __ cmp(ToOperand(instr->index()), 4566 __ cmp(ToOperand(instr->index()),
4533 ToImmediate(LConstantOperand::cast(instr->length()), 4567 ToImmediate(LConstantOperand::cast(instr->length()),
(...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after
6433 RecordSafepoint(Safepoint::kNoLazyDeopt); 6467 RecordSafepoint(Safepoint::kNoLazyDeopt);
6434 } 6468 }
6435 6469
6436 6470
6437 #undef __ 6471 #undef __
6438 6472
6439 } // namespace internal 6473 } // namespace internal
6440 } // namespace v8 6474 } // namespace v8
6441 6475
6442 #endif // V8_TARGET_ARCH_X87 6476 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | src/x87/lithium-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698