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

Side by Side Diff: src/mips/lithium-codegen-mips.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/ia32/lithium-ia32.cc ('k') | src/mips/lithium-mips.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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 2888
2889 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); 2889 __ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
2890 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2890 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2891 Handle<Code> ic = 2891 Handle<Code> ic =
2892 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), 2892 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
2893 SLOPPY, PREMONOMORPHIC).code(); 2893 SLOPPY, PREMONOMORPHIC).code();
2894 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2894 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2895 } 2895 }
2896 2896
2897 2897
2898 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) {
2899 DCHECK(ToRegister(instr->context()).is(cp));
2900 DCHECK(ToRegister(instr->result()).is(v0));
2901
2902 __ li(LoadGlobalViaContextDescriptor::DepthRegister(),
2903 Operand(Smi::FromInt(instr->depth())));
2904 __ li(LoadGlobalViaContextDescriptor::SlotRegister(),
2905 Operand(Smi::FromInt(instr->slot_index())));
2906 __ li(LoadGlobalViaContextDescriptor::NameRegister(), Operand(instr->name()));
2907
2908 Handle<Code> stub =
2909 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code();
2910 CallCode(stub, RelocInfo::CODE_TARGET, instr);
2911 }
2912
2913
2898 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2914 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2899 Register context = ToRegister(instr->context()); 2915 Register context = ToRegister(instr->context());
2900 Register result = ToRegister(instr->result()); 2916 Register result = ToRegister(instr->result());
2901 2917
2902 __ lw(result, ContextOperand(context, instr->slot_index())); 2918 __ lw(result, ContextOperand(context, instr->slot_index()));
2903 if (instr->hydrogen()->RequiresHoleCheck()) { 2919 if (instr->hydrogen()->RequiresHoleCheck()) {
2904 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2920 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2905 2921
2906 if (instr->hydrogen()->DeoptimizesOnHole()) { 2922 if (instr->hydrogen()->DeoptimizesOnHole()) {
2907 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); 2923 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at));
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
4181 } 4197 }
4182 4198
4183 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); 4199 __ li(StoreDescriptor::NameRegister(), Operand(instr->name()));
4184 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( 4200 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
4185 isolate(), instr->language_mode(), 4201 isolate(), instr->language_mode(),
4186 instr->hydrogen()->initialization_state()).code(); 4202 instr->hydrogen()->initialization_state()).code();
4187 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4203 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4188 } 4204 }
4189 4205
4190 4206
4207 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) {
4208 DCHECK(ToRegister(instr->context()).is(cp));
4209 DCHECK(ToRegister(instr->value())
4210 .is(StoreGlobalViaContextDescriptor::ValueRegister()));
4211
4212 __ li(StoreGlobalViaContextDescriptor::DepthRegister(),
4213 Operand(Smi::FromInt(instr->depth())));
4214 __ li(StoreGlobalViaContextDescriptor::SlotRegister(),
4215 Operand(Smi::FromInt(instr->slot_index())));
4216 __ li(StoreGlobalViaContextDescriptor::NameRegister(),
4217 Operand(instr->name()));
4218
4219 Handle<Code> stub =
4220 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(),
4221 instr->language_mode()).code();
4222 CallCode(stub, RelocInfo::CODE_TARGET, instr);
4223 }
4224
4225
4191 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4226 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4192 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; 4227 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs;
4193 Operand operand(0); 4228 Operand operand(0);
4194 Register reg; 4229 Register reg;
4195 if (instr->index()->IsConstantOperand()) { 4230 if (instr->index()->IsConstantOperand()) {
4196 operand = ToOperand(instr->index()); 4231 operand = ToOperand(instr->index());
4197 reg = ToRegister(instr->length()); 4232 reg = ToRegister(instr->length());
4198 cc = CommuteCondition(cc); 4233 cc = CommuteCondition(cc);
4199 } else { 4234 } else {
4200 reg = ToRegister(instr->index()); 4235 reg = ToRegister(instr->index());
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
6044 __ Push(at, ToRegister(instr->function())); 6079 __ Push(at, ToRegister(instr->function()));
6045 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6080 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6046 RecordSafepoint(Safepoint::kNoLazyDeopt); 6081 RecordSafepoint(Safepoint::kNoLazyDeopt);
6047 } 6082 }
6048 6083
6049 6084
6050 #undef __ 6085 #undef __
6051 6086
6052 } // namespace internal 6087 } // namespace internal
6053 } // namespace v8 6088 } // namespace v8
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698