From ad4f2b996b789023d9d9cc1941f615cbecebb8d4 Mon Sep 17 00:00:00 2001 From: "erik.corry@gmail.com" Date: Thu, 26 Apr 2012 11:58:34 +0000 Subject: [PATCH] Remove unwarranted assumptions about inlining from a debugger test. Review URL: https://chromiumcodereview.appspot.com/10239003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- .../debug-evaluate-locals-optimized-double.js | 32 +++++++++++-------- .../debug-evaluate-locals-optimized.js | 32 +++++++++++-------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/test/mjsunit/debug-evaluate-locals-optimized-double.js b/test/mjsunit/debug-evaluate-locals-optimized-double.js index cf25c0c095..242276d389 100644 --- a/test/mjsunit/debug-evaluate-locals-optimized-double.js +++ b/test/mjsunit/debug-evaluate-locals-optimized-double.js @@ -56,6 +56,11 @@ function arraySum(arr) { return arr.reduce(function (a, b) { return a + b; }, 0); } +function isCurrentlyOptimized(fun) { + // See runtime.cc. + return (%GetOptimizationStatus(fun) & 1) != 0; +} + function listener(event, exec_state, event_data, data) { try { if (event == Debug.DebugEvent.Break) @@ -148,23 +153,22 @@ function listener(event, exec_state, event_data, data) { assertFalse(frame.isConstructCall()); } - // When function f is optimized (1 means YES, see runtime.cc) we - // expect an optimized frame for f with g1, g2 and g3 inlined. - if (%GetOptimizationStatus(f) == 1) { - if (i == 1 || i == 2 || i == 3) { - assertTrue(frame.isOptimizedFrame()); - assertTrue(frame.isInlinedFrame()); - assertEquals(4 - i, frame.inlinedFrameIndex()); - } else if (i == 4) { - assertTrue(frame.isOptimizedFrame()); - assertFalse(frame.isInlinedFrame()); - } else { - assertFalse(frame.isOptimizedFrame()); - assertFalse(frame.isInlinedFrame()); - } + if (i > 4) { + assertFalse(frame.isOptimizedFrame()); + assertFalse(frame.isInlinedFrame()); } } + // When function f is optimized we expect an optimized frame for f. We + // can't say whether or not the top 3 frames (g1, g2 and g3) are + // optimized and inlined. + var frame4 = exec_state.frame(4); + + if (isCurrentlyOptimized(f)) { + assertTrue(frame4.isOptimizedFrame()); + assertFalse(frame4.isInlinedFrame()); + } + // Indicate that all was processed. listenerComplete = true; } diff --git a/test/mjsunit/debug-evaluate-locals-optimized.js b/test/mjsunit/debug-evaluate-locals-optimized.js index c88a683a8c..4dca463342 100644 --- a/test/mjsunit/debug-evaluate-locals-optimized.js +++ b/test/mjsunit/debug-evaluate-locals-optimized.js @@ -46,6 +46,11 @@ function arraySum(arr) { return arr.reduce(function (a, b) { return a + b; }, 0); } +function isCurrentlyOptimized(fun) { + // See runtime.cc. + return (%GetOptimizationStatus(fun) & 1) != 0; +} + function listener(event, exec_state, event_data, data) { try { if (event == Debug.DebugEvent.Break) @@ -138,23 +143,22 @@ function listener(event, exec_state, event_data, data) { assertFalse(frame.isConstructCall()); } - // When function f is optimized (1 means YES, see runtime.cc) we - // expect an optimized frame for f with g1, g2 and g3 inlined. - if (%GetOptimizationStatus(f) == 1) { - if (i == 1 || i == 2 || i == 3) { - assertTrue(frame.isOptimizedFrame()); - assertTrue(frame.isInlinedFrame()); - assertEquals(4 - i, frame.inlinedFrameIndex()); - } else if (i == 4) { - assertTrue(frame.isOptimizedFrame()); - assertFalse(frame.isInlinedFrame()); - } else { - assertFalse(frame.isOptimizedFrame()); - assertFalse(frame.isInlinedFrame()); - } + if (i > 4) { + assertFalse(frame.isOptimizedFrame()); + assertFalse(frame.isInlinedFrame()); } } + // When function f is optimized we expect an optimized frame for f. We + // can't say whether or not the top 3 frames (g1, g2 and g3) are + // optimized and inlined. + var frame4 = exec_state.frame(4); + + if (isCurrentlyOptimized(f)) { + assertTrue(frame4.isOptimizedFrame()); + assertFalse(frame4.isInlinedFrame()); + } + // Indicate that all was processed. listenerComplete = true; }