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

Side by Side Diff: src/ic/ic.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/ic/ic.h ('k') | src/ic/ic-compiler.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 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 ExtraICState extra_state) { 936 ExtraICState extra_state) {
937 if (FLAG_vector_ics) { 937 if (FLAG_vector_ics) {
938 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode(); 938 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode();
939 } 939 }
940 940
941 return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state); 941 return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state);
942 } 942 }
943 943
944 944
945 Handle<Code> LoadIC::initialize_stub_in_optimized_code( 945 Handle<Code> LoadIC::initialize_stub_in_optimized_code(
946 Isolate* isolate, ExtraICState extra_state) { 946 Isolate* isolate, ExtraICState extra_state, State initialization_state) {
947 DCHECK(initialization_state == UNINITIALIZED ||
948 initialization_state == PREMONOMORPHIC ||
949 initialization_state == MEGAMORPHIC);
947 if (FLAG_vector_ics) { 950 if (FLAG_vector_ics) {
948 return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode(); 951 return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode();
949 } 952 }
950 return initialize_stub(isolate, extra_state); 953 return PropertyICCompiler::ComputeLoad(isolate, initialization_state,
954 extra_state);
951 } 955 }
952 956
953 957
954 Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) { 958 Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) {
955 if (FLAG_vector_ics) { 959 if (FLAG_vector_ics) {
956 return KeyedLoadICTrampolineStub(isolate).GetCode(); 960 return KeyedLoadICTrampolineStub(isolate).GetCode();
957 } 961 }
958 962
959 return isolate->builtins()->KeyedLoadIC_Initialize(); 963 return isolate->builtins()->KeyedLoadIC_Initialize();
960 } 964 }
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 1557
1554 Handle<Code> CallIC::initialize_stub_in_optimized_code( 1558 Handle<Code> CallIC::initialize_stub_in_optimized_code(
1555 Isolate* isolate, int argc, CallICState::CallType call_type) { 1559 Isolate* isolate, int argc, CallICState::CallType call_type) {
1556 CallICStub stub(isolate, CallICState(argc, call_type)); 1560 CallICStub stub(isolate, CallICState(argc, call_type));
1557 Handle<Code> code = stub.GetCode(); 1561 Handle<Code> code = stub.GetCode();
1558 return code; 1562 return code;
1559 } 1563 }
1560 1564
1561 1565
1562 Handle<Code> StoreIC::initialize_stub(Isolate* isolate, 1566 Handle<Code> StoreIC::initialize_stub(Isolate* isolate,
1563 LanguageMode language_mode) { 1567 LanguageMode language_mode,
1568 State initialization_state) {
1569 DCHECK(initialization_state == UNINITIALIZED ||
1570 initialization_state == PREMONOMORPHIC ||
1571 initialization_state == MEGAMORPHIC);
1564 ExtraICState extra_state = ComputeExtraICState(language_mode); 1572 ExtraICState extra_state = ComputeExtraICState(language_mode);
1565 Handle<Code> ic = 1573 Handle<Code> ic = PropertyICCompiler::ComputeStore(
1566 PropertyICCompiler::ComputeStore(isolate, UNINITIALIZED, extra_state); 1574 isolate, initialization_state, extra_state);
1567 return ic; 1575 return ic;
1568 } 1576 }
1569 1577
1570 1578
1571 Handle<Code> StoreIC::megamorphic_stub() { 1579 Handle<Code> StoreIC::megamorphic_stub() {
1572 if (kind() == Code::STORE_IC) { 1580 if (kind() == Code::STORE_IC) {
1573 return PropertyICCompiler::ComputeStore(isolate(), MEGAMORPHIC, 1581 return PropertyICCompiler::ComputeStore(isolate(), MEGAMORPHIC,
1574 extra_ic_state()); 1582 extra_ic_state());
1575 } else { 1583 } else {
1576 DCHECK(kind() == Code::KEYED_STORE_IC); 1584 DCHECK(kind() == Code::KEYED_STORE_IC);
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 static const Address IC_utilities[] = { 2967 static const Address IC_utilities[] = {
2960 #define ADDR(name) FUNCTION_ADDR(name), 2968 #define ADDR(name) FUNCTION_ADDR(name),
2961 IC_UTIL_LIST(ADDR) NULL 2969 IC_UTIL_LIST(ADDR) NULL
2962 #undef ADDR 2970 #undef ADDR
2963 }; 2971 };
2964 2972
2965 2973
2966 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 2974 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
2967 } 2975 }
2968 } // namespace v8::internal 2976 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/ic.h ('k') | src/ic/ic-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698