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

Unified Diff: src/objects.cc

Issue 2175273002: [ic] Don't call LookupIterator::GetStoreTarget() when receiver is not a JSReceiver. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 4 years, 5 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/lookup.h ('k') | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 6181ed63f901192dff68bc1861120359368d2af8..411dcf74b0d31643085563b80754757249b889ac 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4374,15 +4374,18 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
value, it->GetReceiver(), language_mode);
case LookupIterator::INTERCEPTOR: {
- Handle<Map> store_target_map =
- handle(it->GetStoreTarget()->map(), it->isolate());
+ Handle<Map> store_target_map;
+ if (it->GetReceiver()->IsJSObject()) {
+ store_target_map = handle(it->GetStoreTarget()->map(), it->isolate());
+ }
if (it->HolderIsReceiverOrHiddenPrototype()) {
Maybe<bool> result =
JSObject::SetPropertyWithInterceptor(it, should_throw, value);
if (result.IsNothing() || result.FromJust()) return result;
// Interceptor modified the store target but failed to set the
// property.
- Utils::ApiCheck(*store_target_map == it->GetStoreTarget()->map(),
+ Utils::ApiCheck(store_target_map.is_null() ||
+ *store_target_map == it->GetStoreTarget()->map(),
it->IsElement() ? "v8::IndexedPropertySetterCallback"
: "v8::NamedPropertySetterCallback",
"Interceptor silently changed store target.");
@@ -4395,7 +4398,8 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
}
// Interceptor modified the store target but failed to set the
// property.
- Utils::ApiCheck(*store_target_map == it->GetStoreTarget()->map(),
+ Utils::ApiCheck(store_target_map.is_null() ||
+ *store_target_map == it->GetStoreTarget()->map(),
it->IsElement() ? "v8::IndexedPropertySetterCallback"
: "v8::NamedPropertySetterCallback",
"Interceptor silently changed store target.");
« no previous file with comments | « src/lookup.h ('k') | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698