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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6694 matching lines...) Expand 10 before | Expand all | Expand 10 after
6705 } 6705 }
6706 if (i::FLAG_turbo) { 6706 if (i::FLAG_turbo) {
6707 // With turbofan we generate one return location per return statement, 6707 // With turbofan we generate one return location per return statement,
6708 // each has line = 5, column = 0 as statement position. 6708 // each has line = 5, column = 0 as statement position.
6709 CHECK(returns_count == 4); 6709 CHECK(returns_count == 4);
6710 } else { 6710 } else {
6711 // Without turbofan we generate one return location. 6711 // Without turbofan we generate one return location.
6712 CHECK(returns_count == 1); 6712 CHECK(returns_count == 1);
6713 } 6713 }
6714 } 6714 }
6715
6716 TEST(DebugEvaluateNoSideEffect) {
6717 LocalContext env;
6718 i::Isolate* isolate = CcTest::i_isolate();
6719 i::HandleScope scope(isolate);
6720 i::List<i::Handle<i::JSFunction>> list;
6721 {
6722 i::HeapIterator iterator(isolate->heap());
6723 while (i::HeapObject* obj = iterator.next()) {
6724 if (!obj->IsJSFunction()) continue;
6725 i::JSFunction* fun = i::JSFunction::cast(obj);
6726 list.Add(i::Handle<i::JSFunction>(fun));
6727 }
6728 }
6729
6730 // Perform side effect check on all built-in functions. The side effect check
6731 // itself contains additional sanity checks.
6732 for (i::Handle<i::JSFunction> fun : list) {
6733 bool failed = false;
6734 {
6735 i::NoSideEffectScope scope(isolate, true);
6736 failed = !isolate->debug()->PerformSideEffectCheck(fun);
6737 }
6738 if (failed) isolate->clear_pending_exception();
6739 }
6740 }
OLDNEW
« 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