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

Side by Side Diff: src/mips64/lithium-codegen-mips64.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: rebase 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
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/x64/lithium-codegen-x64.cc » ('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 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 2894 matching lines...) Expand 10 before | Expand all | Expand 10 after
2905 DCHECK(ToRegister(instr->context()).is(cp)); 2905 DCHECK(ToRegister(instr->context()).is(cp));
2906 DCHECK(ToRegister(instr->global_object()) 2906 DCHECK(ToRegister(instr->global_object())
2907 .is(LoadDescriptor::ReceiverRegister())); 2907 .is(LoadDescriptor::ReceiverRegister()));
2908 DCHECK(ToRegister(instr->result()).is(v0)); 2908 DCHECK(ToRegister(instr->result()).is(v0));
2909 2909
2910 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); 2910 __ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
2911 if (FLAG_vector_ics) { 2911 if (FLAG_vector_ics) {
2912 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2912 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2913 } 2913 }
2914 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2914 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2915 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); 2915 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode,
2916 PREMONOMORPHIC).code();
2916 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2917 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2917 } 2918 }
2918 2919
2919 2920
2920 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2921 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2921 Register value = ToRegister(instr->value()); 2922 Register value = ToRegister(instr->value());
2922 Register cell = scratch0(); 2923 Register cell = scratch0();
2923 2924
2924 // Load the cell. 2925 // Load the cell.
2925 __ li(cell, Operand(instr->hydrogen()->cell().handle())); 2926 __ li(cell, Operand(instr->hydrogen()->cell().handle()));
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3047 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3047 DCHECK(ToRegister(instr->context()).is(cp)); 3048 DCHECK(ToRegister(instr->context()).is(cp));
3048 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3049 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3049 DCHECK(ToRegister(instr->result()).is(v0)); 3050 DCHECK(ToRegister(instr->result()).is(v0));
3050 3051
3051 // Name is always in a2. 3052 // Name is always in a2.
3052 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); 3053 __ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
3053 if (FLAG_vector_ics) { 3054 if (FLAG_vector_ics) {
3054 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3055 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3055 } 3056 }
3056 Handle<Code> ic = 3057 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
3057 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); 3058 isolate(), NOT_CONTEXTUAL,
3059 instr->hydrogen()->initialization_state()).code();
3058 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3060 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3059 } 3061 }
3060 3062
3061 3063
3062 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3064 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3063 Register scratch = scratch0(); 3065 Register scratch = scratch0();
3064 Register function = ToRegister(instr->function()); 3066 Register function = ToRegister(instr->function());
3065 Register result = ToRegister(instr->result()); 3067 Register result = ToRegister(instr->result());
3066 3068
3067 // Get the prototype or initial map from the function. 3069 // Get the prototype or initial map from the function.
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
4306 } 4308 }
4307 } 4309 }
4308 4310
4309 4311
4310 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4312 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4311 DCHECK(ToRegister(instr->context()).is(cp)); 4313 DCHECK(ToRegister(instr->context()).is(cp));
4312 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4314 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4313 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4315 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4314 4316
4315 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); 4317 __ li(StoreDescriptor::NameRegister(), Operand(instr->name()));
4316 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); 4318 Handle<Code> ic =
4319 StoreIC::initialize_stub(isolate(), instr->language_mode(),
4320 instr->hydrogen()->initialization_state());
4317 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4321 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4318 } 4322 }
4319 4323
4320 4324
4321 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4325 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4322 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; 4326 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs;
4323 Operand operand((int64_t)0); 4327 Operand operand((int64_t)0);
4324 Register reg; 4328 Register reg;
4325 if (instr->index()->IsConstantOperand()) { 4329 if (instr->index()->IsConstantOperand()) {
4326 operand = ToOperand(instr->index()); 4330 operand = ToOperand(instr->index());
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
6058 __ li(at, scope_info); 6062 __ li(at, scope_info);
6059 __ Push(at, ToRegister(instr->function())); 6063 __ Push(at, ToRegister(instr->function()));
6060 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6064 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6061 RecordSafepoint(Safepoint::kNoLazyDeopt); 6065 RecordSafepoint(Safepoint::kNoLazyDeopt);
6062 } 6066 }
6063 6067
6064 6068
6065 #undef __ 6069 #undef __
6066 6070
6067 } } // namespace v8::internal 6071 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698