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

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

Issue 2625053006: [debugging] Add %Verify() helper and check verify a HeapObject has a Map. (Closed)
Patch Set: added simple verification in release build Created 3 years, 11 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/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-test.cc
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc
index bf10de842cdfbbd747d3b1825c763d953b6b47c0..8b0229069f757ccb570e1a1c4a18c82eb1e18f01 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -828,5 +828,22 @@ RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) {
return isolate->heap()->ToBoolean(true);
}
+RUNTIME_FUNCTION(Runtime_Verify) {
+ HandleScope shs(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
+#ifdef VERIFY_HEAP
+ object->ObjectVerify();
+#else
+ CHECK(object->IsObject());
+ if (object->IsHeapObject()) {
+ CHECK(HeapObject::cast(*object)->map()->IsMap());
+ } else {
+ CHECK(object->IsSmi());
+ }
+#endif
+ return isolate->heap()->ToBoolean(true);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698