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

Unified Diff: src/ic.cc

Issue 24272005: ic: perform interceptor query in LookupForWrite (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 163172d8eb4df42e68c395c528f1864fb68ca49c..641fe0d29ce957c4835b1b9033303e465204b806 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1607,13 +1607,22 @@ static bool LookupForWrite(Handle<JSObject> receiver,
if (lookup->IsReadOnly() || !lookup->IsCacheable()) return false;
if (lookup->holder() == *receiver) {
- if (lookup->IsInterceptor() &&
- receiver->GetNamedInterceptor()->setter()->IsUndefined()) {
- receiver->LocalLookupRealNamedProperty(*name, lookup);
- return lookup->IsFound() &&
- !lookup->IsReadOnly() &&
- lookup->CanHoldValue(value) &&
- lookup->IsCacheable();
+ if (lookup->IsInterceptor()) {
+ bool found_and_writable;
+ if (receiver->GetNamedInterceptor()->setter()->IsUndefined()) {
+ receiver->LocalLookupRealNamedProperty(*name, lookup);
+ found_and_writable = lookup->IsFound() &&
+ !lookup->IsReadOnly() &&
+ lookup->CanHoldValue(value);
+ } else {
+ ASSERT(lookup->representation()->IsNone());
Toon Verwaest 2013/09/23 13:09:59 Why would the representation be none? It's explici
+ PropertyAttributes attrs =
+ lookup->holder()->GetPropertyAttributeWithInterceptor(*receiver,
+ *name,
+ true);
+ found_and_writable = attrs != ABSENT && (attrs & READ_ONLY) == 0;
+ }
+ return found_and_writable && lookup->IsCacheable();
}
return lookup->CanHoldValue(value);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698