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

Unified Diff: test/cctest/test-debug.cc

Issue 2841513002: [debug] additional checks for built-ins calling runtime functions. (Closed)
Patch Set: address comment Created 3 years, 8 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/debug/debug-evaluate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index d542e35888e91ae79c9688295cf6726bf1f7d35b..8a2eb14e1054d375bc8efcb94b622a804a221fcb 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -6712,3 +6712,29 @@ TEST(DebugGetPossibleBreakpointsReturnLocations) {
CHECK(returns_count == 1);
}
}
+
+TEST(DebugEvaluateNoSideEffect) {
+ LocalContext env;
+ i::Isolate* isolate = CcTest::i_isolate();
+ i::HandleScope scope(isolate);
+ i::List<i::Handle<i::JSFunction>> list;
+ {
+ i::HeapIterator iterator(isolate->heap());
+ while (i::HeapObject* obj = iterator.next()) {
+ if (!obj->IsJSFunction()) continue;
+ i::JSFunction* fun = i::JSFunction::cast(obj);
+ list.Add(i::Handle<i::JSFunction>(fun));
+ }
+ }
+
+ // Perform side effect check on all built-in functions. The side effect check
+ // itself contains additional sanity checks.
+ for (i::Handle<i::JSFunction> fun : list) {
+ bool failed = false;
+ {
+ i::NoSideEffectScope scope(isolate, true);
+ failed = !isolate->debug()->PerformSideEffectCheck(fun);
+ }
+ if (failed) isolate->clear_pending_exception();
+ }
+}
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698