Chromium Code Reviews| Index: src/builtins.cc |
| diff --git a/src/builtins.cc b/src/builtins.cc |
| index 94ff13e072036dc164141e3f75a91710bce84c3d..1e532912841005cd3e50f986ec9be8e3e3f472ed 100644 |
| --- a/src/builtins.cc |
| +++ b/src/builtins.cc |
| @@ -14,6 +14,7 @@ |
| #include "src/heap-profiler.h" |
| #include "src/ic-inl.h" |
| #include "src/mark-compact.h" |
| +#include "src/prototype.h" |
| #include "src/stub-cache.h" |
| #include "src/vm-state-inl.h" |
| @@ -1091,11 +1092,13 @@ BUILTIN(GeneratorPoisonPill) { |
| static inline Object* FindHidden(Heap* heap, |
| Object* object, |
| FunctionTemplateInfo* type) { |
| - if (type->IsTemplateFor(object)) return object; |
| - Object* proto = object->GetPrototype(heap->isolate()); |
| - if (proto->IsJSObject() && |
| - JSObject::cast(proto)->map()->is_hidden_prototype()) { |
| - return FindHidden(heap, proto, type); |
| + for (PrototypeIterator iter(heap->isolate(), object, |
| + PrototypeIterator::START_AT_RECEIVER); |
| + !iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN); iter.Advance()) { |
| + ASSERT(!iter.GetCurrent()->IsJSProxy()); |
|
Toon Verwaest
2014/07/11 09:41:28
What about returning heap->null_value() if iter.Ge
|
| + if (type->IsTemplateFor(iter.GetCurrent())) { |
| + return iter.GetCurrent(); |
| + } |
| } |
| return heap->null_value(); |
| } |