| Index: src/prototype.h
|
| diff --git a/src/prototype.h b/src/prototype.h
|
| index e52d20efd8f143a55f9b02b615fecd7065b9e79b..38d6cab9850a0647e68d7ad8087664c91925ac5c 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() {}
|
|
|
|
|