| 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();
|
| + }
|
| +}
|
|
|