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

Unified Diff: src/runtime/runtime-debug.cc

Issue 1492863002: [proxies] Make Object.prototype.isPrototypeOf work with proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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/prototype.h ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index fd99b6ddc5589788bc1fed996d6a201aa1bb5038..598e027401e8a249262a70929c9a4ba10d9a408f 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -1350,6 +1350,17 @@ RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) {
}
+static bool HasInPrototypeChainIgnoringProxies(Isolate* isolate, Object* object,
+ Object* proto) {
+ PrototypeIterator iter(isolate, object, PrototypeIterator::START_AT_RECEIVER);
+ while (true) {
+ iter.AdvanceIgnoringProxies();
+ if (iter.IsAtEnd()) return false;
+ if (iter.IsAtEnd(proto)) return true;
+ }
+}
+
+
// Scan the heap for objects with direct references to an object
// args[0]: the object to find references to
// args[1]: constructor function for instances to exclude (Mirror)
@@ -1379,7 +1390,7 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
// Check filter if supplied. This is normally used to avoid
// references from mirror objects.
if (!filter->IsUndefined() &&
- obj->HasInPrototypeChain(isolate, *filter)) {
+ HasInPrototypeChainIgnoringProxies(isolate, obj, *filter)) {
continue;
}
if (obj->IsJSGlobalObject()) {
« no previous file with comments | « src/prototype.h ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698