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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.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_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 2844 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 2855
2856 __ mov(LoadDescriptor::NameRegister(), instr->name()); 2856 __ mov(LoadDescriptor::NameRegister(), instr->name());
2857 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2857 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2858 Handle<Code> ic = 2858 Handle<Code> ic =
2859 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), 2859 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
2860 SLOPPY, PREMONOMORPHIC).code(); 2860 SLOPPY, PREMONOMORPHIC).code();
2861 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2861 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2862 } 2862 }
2863 2863
2864 2864
2865 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) {
2866 DCHECK(ToRegister(instr->context()).is(esi));
2867 DCHECK(ToRegister(instr->result()).is(eax));
2868
2869 __ mov(LoadGlobalViaContextDescriptor::DepthRegister(),
2870 Immediate(Smi::FromInt(instr->depth())));
2871 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(),
2872 Immediate(Smi::FromInt(instr->slot_index())));
2873 __ mov(LoadGlobalViaContextDescriptor::NameRegister(), instr->name());
2874
2875 Handle<Code> stub =
2876 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code();
2877 CallCode(stub, RelocInfo::CODE_TARGET, instr);
2878 }
2879
2880
2865 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2881 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2866 Register context = ToRegister(instr->context()); 2882 Register context = ToRegister(instr->context());
2867 Register result = ToRegister(instr->result()); 2883 Register result = ToRegister(instr->result());
2868 __ mov(result, ContextOperand(context, instr->slot_index())); 2884 __ mov(result, ContextOperand(context, instr->slot_index()));
2869 2885
2870 if (instr->hydrogen()->RequiresHoleCheck()) { 2886 if (instr->hydrogen()->RequiresHoleCheck()) {
2871 __ cmp(result, factory()->the_hole_value()); 2887 __ cmp(result, factory()->the_hole_value());
2872 if (instr->hydrogen()->DeoptimizesOnHole()) { 2888 if (instr->hydrogen()->DeoptimizesOnHole()) {
2873 DeoptimizeIf(equal, instr, Deoptimizer::kHole); 2889 DeoptimizeIf(equal, instr, Deoptimizer::kHole);
2874 } else { 2890 } else {
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
4111 } 4127 }
4112 4128
4113 __ mov(StoreDescriptor::NameRegister(), instr->name()); 4129 __ mov(StoreDescriptor::NameRegister(), instr->name());
4114 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( 4130 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
4115 isolate(), instr->language_mode(), 4131 isolate(), instr->language_mode(),
4116 instr->hydrogen()->initialization_state()).code(); 4132 instr->hydrogen()->initialization_state()).code();
4117 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4133 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4118 } 4134 }
4119 4135
4120 4136
4137 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) {
4138 DCHECK(ToRegister(instr->context()).is(esi));
4139 DCHECK(ToRegister(instr->value())
4140 .is(StoreGlobalViaContextDescriptor::ValueRegister()));
4141
4142 __ mov(StoreGlobalViaContextDescriptor::DepthRegister(),
4143 Immediate(Smi::FromInt(instr->depth())));
4144 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(),
4145 Immediate(Smi::FromInt(instr->slot_index())));
4146 __ mov(StoreGlobalViaContextDescriptor::NameRegister(), instr->name());
4147
4148 Handle<Code> stub =
4149 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(),
4150 instr->language_mode()).code();
4151 CallCode(stub, RelocInfo::CODE_TARGET, instr);
4152 }
4153
4154
4121 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4155 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4122 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; 4156 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal;
4123 if (instr->index()->IsConstantOperand()) { 4157 if (instr->index()->IsConstantOperand()) {
4124 __ cmp(ToOperand(instr->length()), 4158 __ cmp(ToOperand(instr->length()),
4125 ToImmediate(LConstantOperand::cast(instr->index()), 4159 ToImmediate(LConstantOperand::cast(instr->index()),
4126 instr->hydrogen()->length()->representation())); 4160 instr->hydrogen()->length()->representation()));
4127 cc = CommuteCondition(cc); 4161 cc = CommuteCondition(cc);
4128 } else if (instr->length()->IsConstantOperand()) { 4162 } else if (instr->length()->IsConstantOperand()) {
4129 __ cmp(ToOperand(instr->index()), 4163 __ cmp(ToOperand(instr->index()),
4130 ToImmediate(LConstantOperand::cast(instr->length()), 4164 ToImmediate(LConstantOperand::cast(instr->length()),
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
5819 RecordSafepoint(Safepoint::kNoLazyDeopt); 5853 RecordSafepoint(Safepoint::kNoLazyDeopt);
5820 } 5854 }
5821 5855
5822 5856
5823 #undef __ 5857 #undef __
5824 5858
5825 } // namespace internal 5859 } // namespace internal
5826 } // namespace v8 5860 } // namespace v8
5827 5861
5828 #endif // V8_TARGET_ARCH_IA32 5862 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698