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

Unified Diff: src/prototype.h

Issue 2513893003: [ic] Don't check full prototype chain if name is a private symbol. (Closed)
Patch Set: and JSProxy case Created 4 years, 1 month 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/ic/ic.cc ('k') | test/mjsunit/regress/regress-crbug-664802.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prototype.h
diff --git a/src/prototype.h b/src/prototype.h
index 6e9015da63f1d8029592c9632d2b02ae45cc5bc3..d052510b497480292e4c837977c514db89cd6089 100644
--- a/src/prototype.h
+++ b/src/prototype.h
@@ -53,21 +53,35 @@ class PrototypeIterator {
if (where_to_start == kStartAtPrototype) Advance();
}
- explicit PrototypeIterator(Map* receiver_map)
+ explicit PrototypeIterator(Map* receiver_map,
+ WhereToEnd where_to_end = END_AT_NULL)
: isolate_(receiver_map->GetIsolate()),
object_(receiver_map->GetPrototypeChainRootMap(isolate_)->prototype()),
- where_to_end_(END_AT_NULL),
+ where_to_end_(where_to_end),
is_at_end_(object_->IsNull(isolate_)),
- seen_proxies_(0) {}
+ seen_proxies_(0) {
+ if (!is_at_end_ && where_to_end_ == END_AT_NON_HIDDEN) {
+ DCHECK(object_->IsJSReceiver());
+ Map* map = JSReceiver::cast(object_)->map();
+ is_at_end_ = !map->has_hidden_prototype();
+ }
+ }
- explicit PrototypeIterator(Handle<Map> receiver_map)
+ explicit PrototypeIterator(Handle<Map> receiver_map,
+ WhereToEnd where_to_end = END_AT_NULL)
: isolate_(receiver_map->GetIsolate()),
object_(NULL),
handle_(receiver_map->GetPrototypeChainRootMap(isolate_)->prototype(),
isolate_),
- where_to_end_(END_AT_NULL),
+ where_to_end_(where_to_end),
is_at_end_(handle_->IsNull(isolate_)),
- seen_proxies_(0) {}
+ seen_proxies_(0) {
+ if (!is_at_end_ && where_to_end_ == END_AT_NON_HIDDEN) {
+ DCHECK(handle_->IsJSReceiver());
+ Map* map = JSReceiver::cast(*handle_)->map();
+ is_at_end_ = !map->has_hidden_prototype();
+ }
+ }
~PrototypeIterator() {}
« no previous file with comments | « src/ic/ic.cc ('k') | test/mjsunit/regress/regress-crbug-664802.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698