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

Side by Side Diff: src/x64/lithium-codegen-x64.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: 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
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 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 DCHECK(ToRegister(instr->context()).is(rsi)); 2878 DCHECK(ToRegister(instr->context()).is(rsi));
2879 DCHECK(ToRegister(instr->global_object()) 2879 DCHECK(ToRegister(instr->global_object())
2880 .is(LoadDescriptor::ReceiverRegister())); 2880 .is(LoadDescriptor::ReceiverRegister()));
2881 DCHECK(ToRegister(instr->result()).is(rax)); 2881 DCHECK(ToRegister(instr->result()).is(rax));
2882 2882
2883 __ Move(LoadDescriptor::NameRegister(), instr->name()); 2883 __ Move(LoadDescriptor::NameRegister(), instr->name());
2884 if (FLAG_vector_ics) { 2884 if (FLAG_vector_ics) {
2885 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2885 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2886 } 2886 }
2887 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2887 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2888 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); 2888 Handle<Code> ic =
2889 CodeFactory::LoadICInOptimizedCode(isolate(), mode, UNINITIALIZED).code();
2889 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2890 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2890 } 2891 }
2891 2892
2892 2893
2893 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2894 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2894 Register value = ToRegister(instr->value()); 2895 Register value = ToRegister(instr->value());
2895 Handle<Cell> cell_handle = instr->hydrogen()->cell().handle(); 2896 Handle<Cell> cell_handle = instr->hydrogen()->cell().handle();
2896 2897
2897 // If the cell we are storing to contains the hole it could have 2898 // If the cell we are storing to contains the hole it could have
2898 // been deleted from the property dictionary. In that case, we need 2899 // been deleted from the property dictionary. In that case, we need
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3021 3022
3022 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3023 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3023 DCHECK(ToRegister(instr->context()).is(rsi)); 3024 DCHECK(ToRegister(instr->context()).is(rsi));
3024 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3025 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3025 DCHECK(ToRegister(instr->result()).is(rax)); 3026 DCHECK(ToRegister(instr->result()).is(rax));
3026 3027
3027 __ Move(LoadDescriptor::NameRegister(), instr->name()); 3028 __ Move(LoadDescriptor::NameRegister(), instr->name());
3028 if (FLAG_vector_ics) { 3029 if (FLAG_vector_ics) {
3029 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3030 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3030 } 3031 }
3031 Handle<Code> ic = 3032 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
3032 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); 3033 isolate(), NOT_CONTEXTUAL,
3034 instr->hydrogen()->initialization_state()).code();
3033 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3035 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3034 } 3036 }
3035 3037
3036 3038
3037 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3039 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3038 Register function = ToRegister(instr->function()); 3040 Register function = ToRegister(instr->function());
3039 Register result = ToRegister(instr->result()); 3041 Register result = ToRegister(instr->result());
3040 3042
3041 // Get the prototype or initial map from the function. 3043 // Get the prototype or initial map from the function.
3042 __ movp(result, 3044 __ movp(result,
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
4262 } 4264 }
4263 } 4265 }
4264 4266
4265 4267
4266 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4268 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4267 DCHECK(ToRegister(instr->context()).is(rsi)); 4269 DCHECK(ToRegister(instr->context()).is(rsi));
4268 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4270 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4269 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4271 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4270 4272
4271 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name()); 4273 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name());
4272 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); 4274 Handle<Code> ic =
4275 StoreIC::initialize_stub(isolate(), instr->language_mode(),
4276 instr->hydrogen()->initialization_state());
4273 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4277 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4274 } 4278 }
4275 4279
4276 4280
4277 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4281 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4278 Representation representation = instr->hydrogen()->length()->representation(); 4282 Representation representation = instr->hydrogen()->length()->representation();
4279 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); 4283 DCHECK(representation.Equals(instr->hydrogen()->index()->representation()));
4280 DCHECK(representation.IsSmiOrInteger32()); 4284 DCHECK(representation.IsSmiOrInteger32());
4281 4285
4282 Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal; 4286 Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal;
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
5930 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5934 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5931 RecordSafepoint(Safepoint::kNoLazyDeopt); 5935 RecordSafepoint(Safepoint::kNoLazyDeopt);
5932 } 5936 }
5933 5937
5934 5938
5935 #undef __ 5939 #undef __
5936 5940
5937 } } // namespace v8::internal 5941 } } // namespace v8::internal
5938 5942
5939 #endif // V8_TARGET_ARCH_X64 5943 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698