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

Unified Diff: src/ic/ic.cc

Issue 969733003: Prefill with correct contextual load ICs in fullcodegen. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't prefill if we'll serialize the code 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/x64/full-codegen-x64.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 fad3adb5591208eb2d0e8473431d50e1d0643293..4a0e6c8102820eb035bdf2262e1c1d1e73b2353f 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -949,6 +949,38 @@ Handle<Code> LoadIC::initialize_stub(Isolate* isolate,
}
+Handle<Code> LoadIC::load_global(Isolate* isolate, Handle<GlobalObject> global,
+ Handle<String> name) {
+ Handle<ScriptContextTable> script_contexts(
+ global->native_context()->script_context_table());
+
+ ScriptContextTable::LookupResult lookup_result;
+ if (ScriptContextTable::Lookup(script_contexts, name, &lookup_result)) {
+ return initialize_stub(isolate, LoadICState(CONTEXTUAL).GetExtraICState());
+ }
+
+ Handle<Map> global_map(global->map());
+ Handle<Code> handler = PropertyHandlerCompiler::Find(
+ name, global_map, Code::LOAD_IC, kCacheOnReceiver, Code::NORMAL);
+ if (handler.is_null()) {
+ LookupIterator it(global, name);
+ if (!it.IsFound() || !it.GetHolder<JSObject>().is_identical_to(global) ||
+ it.state() != LookupIterator::DATA) {
+ return initialize_stub(isolate,
+ LoadICState(CONTEXTUAL).GetExtraICState());
+ }
+ NamedLoadHandlerCompiler compiler(isolate, global_map, global,
+ kCacheOnReceiver);
+ Handle<PropertyCell> cell = it.GetPropertyCell();
+ handler = compiler.CompileLoadGlobal(cell, name, it.IsConfigurable());
+ Map::UpdateCodeCache(global_map, name, handler);
+ }
+ return PropertyICCompiler::ComputeMonomorphic(
+ Code::LOAD_IC, name, handle(global->map()), handler,
+ LoadICState(CONTEXTUAL).GetExtraICState());
+}
+
+
Handle<Code> LoadIC::initialize_stub_in_optimized_code(
Isolate* isolate, ExtraICState extra_state, State initialization_state) {
if (FLAG_vector_ics) {
« no previous file with comments | « src/ic/ic.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698