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 |