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

Unified Diff: src/isolate.cc

Issue 348313002: Introduce a PrototypeIterator template and use it all over the place (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 6 years, 6 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/json-stringifier.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 89052139dfb598e9f2e3fc46b1998a7746f0ecbf..61381a0f946ab71282a93a5749c6c6a0ce64ccb3 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1001,10 +1001,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<STORE_AS_POINTER, TYPE_BASED_WALK, END_AT_NULL_VALUE>
+ iter(this, *obj); !iter.IsAtEnd(); iter.Advance()) {
+ if (!iter.GetCurrent()->IsJSObject()) return false;
+ if (JSObject::cast(iter.GetCurrent())->map()->constructor() ==
*error_constructor) {
return true;
}
@@ -2183,13 +2183,13 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
// Check that the object prototype hasn't been altered WRT empty elements.
JSObject* initial_object_proto = JSObject::cast(*initial_object_prototype());
- Object* root_array_map_proto = initial_array_proto->GetPrototype();
+ Object* root_array_map_proto = SAFE_GET_PROTOTYPE_FAST(initial_array_proto);
if (root_array_map_proto != initial_object_proto) return false;
if (initial_object_proto->elements() != heap()->empty_fixed_array()) {
return false;
}
- return initial_object_proto->GetPrototype()->IsNull();
+ return SAFE_GET_PROTOTYPE_FAST(initial_object_proto)->IsNull();
}
« no previous file with comments | « src/ic-inl.h ('k') | src/json-stringifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698