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

Unified Diff: src/objects-debug.cc

Issue 1549793003: [proxies] Improve JSProxyVerify and test most proxy invariants. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index e7ee7eca7731c3fe9593055f4fc2906b7ec1dfd5..a33e61de4c87e46d26dd7e5077e46a912e92e660 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -818,8 +818,22 @@ void JSRegExp::JSRegExpVerify() {
void JSProxy::JSProxyVerify() {
CHECK(IsJSProxy());
+ VerifyPointer(target());
VerifyPointer(handler());
+ if (target()->IsCallable()) {
Igor Sheludko 2015/12/23 17:04:52 You could probably rewrite these ifs like this:
Camillo Bruni 2015/12/23 19:07:01 Sometimes I really wonder how I got so far with pr
+ CHECK(map()->is_callable());
+ if (target()->IsConstructor()) {
+ CHECK(map()->is_constructor());
+ } else {
+ CHECK(!map()->is_constructor());
+ }
+ } else {
+ CHECK(!map()->is_callable());
+ }
CHECK(hash()->IsSmi() || hash()->IsUndefined());
+ CHECK(map()->prototype()->IsNull());
+ // There should be not properties on a Proxy.
Igor Sheludko 2015/12/23 17:04:52 s/not/no/
+ CHECK_EQ(0, map()->NumberOfOwnDescriptors());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698