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

Unified Diff: src/ic/ic.cc

Issue 945313003: emit premonomorphic ics for keyed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index ef8e069fda99301efa30c9223af4253e221a7442..0d40ea673a29c0130d17230e12ae087907a8f4e6 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -944,9 +944,6 @@ Handle<Code> LoadIC::initialize_stub(Isolate* isolate,
Handle<Code> LoadIC::initialize_stub_in_optimized_code(
Isolate* isolate, ExtraICState extra_state, State initialization_state) {
- DCHECK(initialization_state == UNINITIALIZED ||
- initialization_state == PREMONOMORPHIC ||
- initialization_state == MEGAMORPHIC);
if (FLAG_vector_ics) {
return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode();
}
@@ -964,11 +961,45 @@ Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) {
}
-Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(Isolate* isolate) {
+Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(
+ Isolate* isolate, State initialization_state) {
if (FLAG_vector_ics) {
return VectorKeyedLoadStub(isolate).GetCode();
}
- return initialize_stub(isolate);
+ switch (initialization_state) {
+ case UNINITIALIZED:
+ return isolate->builtins()->KeyedLoadIC_Initialize();
+ case PREMONOMORPHIC:
+ return isolate->builtins()->KeyedLoadIC_PreMonomorphic();
+ case MEGAMORPHIC:
+ return isolate->builtins()->KeyedLoadIC_Megamorphic();
+ default:
+ UNREACHABLE();
+ }
+ return Handle<Code>();
+}
+
+
+Handle<Code> KeyedStoreIC::initialize_stub(Isolate* isolate,
+ LanguageMode language_mode,
+ State initialization_state) {
+ switch (initialization_state) {
+ case UNINITIALIZED:
+ return is_strict(language_mode)
+ ? isolate->builtins()->KeyedStoreIC_Initialize_Strict()
+ : isolate->builtins()->KeyedStoreIC_Initialize();
+ case PREMONOMORPHIC:
+ return is_strict(language_mode)
+ ? isolate->builtins()->KeyedStoreIC_PreMonomorphic_Strict()
+ : isolate->builtins()->KeyedStoreIC_PreMonomorphic();
+ case MEGAMORPHIC:
+ return is_strict(language_mode)
+ ? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict()
+ : isolate->builtins()->KeyedStoreIC_Megamorphic();
+ default:
+ UNREACHABLE();
+ }
+ return Handle<Code>();
}
« no previous file with comments | « src/ic/ic.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698