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

Unified Diff: src/stub-cache.cc

Issue 1539034: Add inline caches for loading non-existing properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 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
Index: src/stub-cache.cc
===================================================================
--- src/stub-cache.cc (revision 4394)
+++ src/stub-cache.cc (working copy)
@@ -93,6 +93,28 @@
}
+Object* StubCache::ComputeLoadNonExisting(String* name, JSObject* receiver) {
+ // The code stub for loading non-existing properties can be reused
+ // for all names, so we use the empty_string as the name in the map
+ // code cache.
+ Code::Flags flags =
+ Code::ComputeMonomorphicFlags(Code::LOAD_IC, NON_EXISTING);
+ Object* code = receiver->map()->FindInCodeCache(Heap::empty_string(), flags);
+ if (code->IsUndefined()) {
+ LoadStubCompiler compiler;
+ code = compiler.CompileLoadNonExisting(receiver);
+ if (code->IsFailure()) return code;
+ PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG,
+ Code::cast(code),
+ Heap::empty_string()));
+ Object* result = receiver->map()->UpdateCodeCache(Heap::empty_string(),
+ Code::cast(code));
+ if (result->IsFailure()) return result;
+ }
+ return Set(name, receiver->map(), Code::cast(code));
+}
+
+
Object* StubCache::ComputeLoadField(String* name,
JSObject* receiver,
JSObject* holder,
« src/stub-cache.h ('K') | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698