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

Unified Diff: src/stub-cache.cc

Issue 11344012: Make so that array length property access uses a new IC that tracks the array map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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/stub-cache.h ('k') | src/type-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 5eb0cbaa1cb7158b182a241130de7081a082fd51..75f56b4580cba8811ff9d0adac150d93ed062775 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -173,6 +173,27 @@ Handle<Code> StubCache::ComputeLoadCallback(Handle<String> name,
}
+Handle<Code> StubCache::ComputeLoadArrayLength(Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder) {
+ ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
+ Code::Flags flags =
+ Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::CALLBACKS,
+ Code::ExtraICStateForeignCallbackArrayLength);
+ Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
+ if (probe->IsCode()) return Handle<Code>::cast(probe);
+
+ LoadStubCompiler compiler(isolate_);
+ Handle<Code> code =
+ compiler.CompileLoadArrayLength(name, receiver, holder);
+ PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
+ GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
+ JSObject::UpdateMapCodeCache(receiver, name, code);
+ return code;
+}
+
+
Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
@@ -1373,9 +1394,12 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
}
-Handle<Code> LoadStubCompiler::GetCode(Code::StubType type,
- Handle<String> name) {
- Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
+Handle<Code> LoadStubCompiler::GetCode(
+ Code::StubType type,
+ Handle<String> name,
+ Code::ExtraICStateForeignCallback callbackType) {
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, type, Code::ExtraICState(callbackType));
Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
« no previous file with comments | « src/stub-cache.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698