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

Side by Side Diff: src/x64/lithium-codegen-x64.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/ppc/lithium-ppc.cc ('k') | src/x64/lithium-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_X64 7 #if V8_TARGET_ARCH_X64
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 2872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2883 2883
2884 __ Move(LoadDescriptor::NameRegister(), instr->name()); 2884 __ Move(LoadDescriptor::NameRegister(), instr->name());
2885 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2885 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2886 Handle<Code> ic = 2886 Handle<Code> ic =
2887 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), 2887 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
2888 SLOPPY, PREMONOMORPHIC).code(); 2888 SLOPPY, PREMONOMORPHIC).code();
2889 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2889 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2890 } 2890 }
2891 2891
2892 2892
2893 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) {
2894 DCHECK(ToRegister(instr->context()).is(rsi));
2895 DCHECK(ToRegister(instr->result()).is(rax));
2896
2897 __ Move(LoadGlobalViaContextDescriptor::DepthRegister(),
2898 Smi::FromInt(instr->depth()));
2899 __ Move(LoadGlobalViaContextDescriptor::SlotRegister(),
2900 Smi::FromInt(instr->slot_index()));
2901 __ Move(LoadGlobalViaContextDescriptor::NameRegister(), instr->name());
2902
2903 Handle<Code> stub =
2904 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code();
2905 CallCode(stub, RelocInfo::CODE_TARGET, instr);
2906 }
2907
2908
2893 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2909 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2894 Register context = ToRegister(instr->context()); 2910 Register context = ToRegister(instr->context());
2895 Register result = ToRegister(instr->result()); 2911 Register result = ToRegister(instr->result());
2896 __ movp(result, ContextOperand(context, instr->slot_index())); 2912 __ movp(result, ContextOperand(context, instr->slot_index()));
2897 if (instr->hydrogen()->RequiresHoleCheck()) { 2913 if (instr->hydrogen()->RequiresHoleCheck()) {
2898 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2914 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2899 if (instr->hydrogen()->DeoptimizesOnHole()) { 2915 if (instr->hydrogen()->DeoptimizesOnHole()) {
2900 DeoptimizeIf(equal, instr, Deoptimizer::kHole); 2916 DeoptimizeIf(equal, instr, Deoptimizer::kHole);
2901 } else { 2917 } else {
2902 Label is_not_hole; 2918 Label is_not_hole;
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4235 } 4251 }
4236 4252
4237 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name()); 4253 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name());
4238 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( 4254 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
4239 isolate(), instr->language_mode(), 4255 isolate(), instr->language_mode(),
4240 instr->hydrogen()->initialization_state()).code(); 4256 instr->hydrogen()->initialization_state()).code();
4241 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4257 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4242 } 4258 }
4243 4259
4244 4260
4261 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) {
4262 DCHECK(ToRegister(instr->context()).is(rsi));
4263 DCHECK(ToRegister(instr->value())
4264 .is(StoreGlobalViaContextDescriptor::ValueRegister()));
4265
4266 __ Move(StoreGlobalViaContextDescriptor::DepthRegister(),
4267 Smi::FromInt(instr->depth()));
4268 __ Move(StoreGlobalViaContextDescriptor::SlotRegister(),
4269 Smi::FromInt(instr->slot_index()));
4270 __ Move(StoreGlobalViaContextDescriptor::NameRegister(), instr->name());
4271
4272 Handle<Code> stub =
4273 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(),
4274 instr->language_mode()).code();
4275 CallCode(stub, RelocInfo::CODE_TARGET, instr);
4276 }
4277
4278
4245 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4279 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4246 Representation representation = instr->hydrogen()->length()->representation(); 4280 Representation representation = instr->hydrogen()->length()->representation();
4247 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); 4281 DCHECK(representation.Equals(instr->hydrogen()->index()->representation()));
4248 DCHECK(representation.IsSmiOrInteger32()); 4282 DCHECK(representation.IsSmiOrInteger32());
4249 4283
4250 Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal; 4284 Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal;
4251 if (instr->length()->IsConstantOperand()) { 4285 if (instr->length()->IsConstantOperand()) {
4252 int32_t length = ToInteger32(LConstantOperand::cast(instr->length())); 4286 int32_t length = ToInteger32(LConstantOperand::cast(instr->length()));
4253 Register index = ToRegister(instr->index()); 4287 Register index = ToRegister(instr->index());
4254 if (representation.IsSmi()) { 4288 if (representation.IsSmi()) {
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
6019 RecordSafepoint(Safepoint::kNoLazyDeopt); 6053 RecordSafepoint(Safepoint::kNoLazyDeopt);
6020 } 6054 }
6021 6055
6022 6056
6023 #undef __ 6057 #undef __
6024 6058
6025 } // namespace internal 6059 } // namespace internal
6026 } // namespace v8 6060 } // namespace v8
6027 6061
6028 #endif // V8_TARGET_ARCH_X64 6062 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/lithium-ppc.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698