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

Unified Diff: src/stub-cache.cc

Issue 494153002: Avoid one repeated property lookup when computing store ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments (triggering a bug in doing so) Created 6 years, 4 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/x64/stub-cache-x64.cc » ('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 4a7a7a69a0802f1c105818029846144fec3d1e11..620060533152c8e526025adb8649143e1d0ff134 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -614,14 +614,18 @@ RUNTIME_FUNCTION(StorePropertyWithInterceptor) {
Handle<Name> name = args.at<Name>(1);
Handle<Object> value = args.at<Object>(2);
#ifdef DEBUG
- if (receiver->IsJSGlobalProxy()) {
- PrototypeIterator iter(isolate, receiver);
- DCHECK(iter.IsAtEnd() ||
- Handle<JSGlobalObject>::cast(PrototypeIterator::GetCurrent(iter))
- ->HasNamedInterceptor());
- } else {
- DCHECK(receiver->HasNamedInterceptor());
+ PrototypeIterator iter(isolate, receiver,
+ PrototypeIterator::START_AT_RECEIVER);
+ bool found = false;
+ while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)) {
+ Handle<Object> current = PrototypeIterator::GetCurrent(iter);
+ if (current->IsJSObject() &&
+ Handle<JSObject>::cast(current)->HasNamedInterceptor()) {
+ found = true;
+ break;
+ }
}
+ DCHECK(found);
#endif
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
@@ -1007,8 +1011,8 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition(
}
-Handle<Code> NamedStoreHandlerCompiler::CompileStoreField(LookupResult* lookup,
- Handle<Name> name) {
+Handle<Code> NamedStoreHandlerCompiler::CompileStoreField(
+ LookupIterator* lookup, Handle<Name> name) {
Label miss;
GenerateStoreField(lookup, value(), &miss);
__ bind(&miss);
« no previous file with comments | « 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