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

Unified Diff: src/isolate.cc

Issue 376233002: Introduce a PrototypeIterator class and use it for prototype access (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 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/ic-inl.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 0dbce1fed543a13d415819910f06c9715c0c016f..5e7fc71cd8f4abd70d4727f45eee6e54855a7d69 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -21,6 +21,7 @@
#include "src/lithium-allocator.h"
#include "src/log.h"
#include "src/messages.h"
+#include "src/prototype.h"
#include "src/regexp-stack.h"
#include "src/runtime-profiler.h"
#include "src/sampler.h"
@@ -982,10 +983,10 @@ bool Isolate::IsErrorObject(Handle<Object> obj) {
js_builtins_object(), error_key).ToHandleChecked();
DisallowHeapAllocation no_gc;
- for (Object* prototype = *obj; !prototype->IsNull();
- prototype = prototype->GetPrototype(this)) {
- if (!prototype->IsJSObject()) return false;
- if (JSObject::cast(prototype)->map()->constructor() ==
+ for (PrototypeIterator iter(this, *obj, PrototypeIterator::START_AT_RECEIVER);
+ !iter.IsAtEnd(); iter.Advance()) {
+ if (iter.GetCurrent()->IsJSProxy()) return false;
+ if (JSObject::cast(iter.GetCurrent())->map()->constructor() ==
*error_constructor) {
return true;
}
« no previous file with comments | « src/ic-inl.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698