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

Unified Diff: test/mjsunit/regress/regress-opt-after-debug-deopt.js

Issue 18198003: Abort optimization when debugger is turned on. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « test/mjsunit/regress/regress-debug-deopt-while-recompile.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-opt-after-debug-deopt.js
diff --git a/test/mjsunit/regress/regress-embedded-cons-string.js b/test/mjsunit/regress/regress-opt-after-debug-deopt.js
similarity index 67%
copy from test/mjsunit/regress/regress-embedded-cons-string.js
copy to test/mjsunit/regress/regress-opt-after-debug-deopt.js
index afb3835688565986e45452d038866025ae11b0f0..be12cc56fde38ada0d00a9293e3a4dced3682486 100644
--- a/test/mjsunit/regress/regress-embedded-cons-string.js
+++ b/test/mjsunit/regress/regress-opt-after-debug-deopt.js
@@ -25,8 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --fold-constants --nodead-code-elimination
-// Flags: --expose-gc --allow-natives-syntax
+// Flags: --expose-debug-as debug --allow-natives-syntax
// Flags: --parallel-recompilation --parallel-recompilation-delay=300
if (!%IsParallelRecompilationSupported()) {
@@ -34,33 +33,37 @@ if (!%IsParallelRecompilationSupported()) {
quit();
}
-function assertUnoptimized(fun) {
- assertTrue(%GetOptimizationStatus(fun) != 1);
-}
+Debug = debug.Debug;
-function test(fun) {
- fun();
- fun();
- %OptimizeFunctionOnNextCall(fun, "parallel");
- fun(); // Trigger optimization in the background.
- gc(); // Tenure cons string.
- assertUnoptimized(fun); // Compilation not complete yet.
- %CompleteOptimization(fun); // Compilation embeds tenured cons string.
- gc(); // Visit embedded cons string during mark compact.
-}
+function listener(event, exec_state, event_data, data) {
+ if (event != Debug.DebugEvent.Break) return;
+ try {
+ assertEquals("foo", exec_state.frame(0).evaluate("a").value());
+ } catch (e) {
+ exception = e;
+ };
+ listened++;
+};
-function f() {
- return "abcdefghijklmn" + "123456789";
-}
+var exception = null;
+var listened = 0;
-function g() {
- return "abcdefghijklmn\u2603" + "123456789";
+var f = function() {
+ var a = "foo";
+ var b = a.substring("1");
+ [a, b].sort();
+ return a;
}
-function h() {
- return "abcdefghijklmn\u2603" + "123456789\u2604";
-}
+f();
+f();
+%OptimizeFunctionOnNextCall(f, "parallel"); // Mark with builtin.
+f(); // Kick off parallel recompilation.
+
+Debug.setListener(listener); // Activate debugger.
+Debug.setBreakPoint(f, 2, 0); // Force deopt.
+%CompleteOptimization(f); // Install optimized code.
-test(f);
-test(g);
-test(h);
+f(); // Trigger break point.
+assertEquals(1, listened);
+assertNull(exception);
« no previous file with comments | « test/mjsunit/regress/regress-debug-deopt-while-recompile.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698