| Index: test/mjsunit/regress/regress-debug-deopt-while-recompile.js
|
| diff --git a/test/mjsunit/regress/regress-131994.js b/test/mjsunit/regress/regress-debug-deopt-while-recompile.js
|
| similarity index 63%
|
| copy from test/mjsunit/regress/regress-131994.js
|
| copy to test/mjsunit/regress/regress-debug-deopt-while-recompile.js
|
| index 8347653a941da257d501277f986ee301a1967f87..3a6623568497b0fe05bce23875d8cd8f3da2a30f 100644
|
| --- a/test/mjsunit/regress/regress-131994.js
|
| +++ b/test/mjsunit/regress/regress-debug-deopt-while-recompile.js
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2012 the V8 project authors. All rights reserved.
|
| +// Copyright 2013 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -25,46 +25,60 @@
|
| // (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: --expose-debug-as debug
|
| -
|
| -// Test that a variable in the local scope that shadows a context-allocated
|
| -// variable is correctly resolved when being evaluated in the debugger.
|
| +// Flags: --expose-debug-as debug --allow-natives-syntax
|
|
|
| Debug = debug.Debug;
|
|
|
| -var exception = false;
|
| -
|
| function listener(event, exec_state, event_data, data) {
|
| if (event != Debug.DebugEvent.Break) return;
|
| - var breakpoint = exec_state.frame(0);
|
| try {
|
| - // Assert correct break point.
|
| - assertTrue(breakpoint.sourceLineText().indexOf("// Break") > -1);
|
| - // Assert correct value.
|
| - assertEquals(3, breakpoint.evaluate('x').value());
|
| + assertEquals("foo", exec_state.frame(0).evaluate("bar").value());
|
| } catch (e) {
|
| exception = e;
|
| - }
|
| -}
|
| + };
|
| + listened++;
|
| +};
|
|
|
| -Debug.setListener(listener);
|
| +var exception = null;
|
| +var listened = 0;
|
|
|
| -function h() {
|
| - var x; // Context-allocated due to g().
|
| +var f = function() {
|
| + var bar = "foo";
|
| + var baz = bar; // Break point should be here.
|
| + return bar;
|
| +}
|
|
|
| - var g = function g() {
|
| - x = -7;
|
| - };
|
| +var g = function() {
|
| + var bar = "foo";
|
| + var baz = bar; // Break point should be here.
|
| + return bar;
|
| +}
|
|
|
| - var f = function f() {
|
| - var x = 3; // Allocated in the local scope.
|
| - debugger; // Break.
|
| - };
|
| +f();
|
| +f();
|
| +g();
|
| +g();
|
|
|
| - f();
|
| +// Mark with builtin.
|
| +%OptimizeFunctionOnNextCall(f);
|
| +if (%IsParallelRecompilationSupported()) {
|
| + %OptimizeFunctionOnNextCall(g, "parallel");
|
| }
|
|
|
| -h();
|
| +// Activate debugger.
|
| +Debug.setListener(listener);
|
| +
|
| + // Set break point.
|
| +Debug.setBreakPoint(f, 2, 0);
|
| +Debug.setBreakPoint(g, 2, 0);
|
| +
|
| +// Trigger break point.
|
| +f();
|
| +g();
|
|
|
| -assertFalse(exception);
|
| +// Assert that break point is set at expected location.
|
| +assertTrue(Debug.showBreakPoints(f).indexOf("[B0]var baz = bar;") > 0);
|
| +assertTrue(Debug.showBreakPoints(g).indexOf("[B0]var baz = bar;") > 0);
|
|
|
| +assertEquals(2, listened);
|
| +assertNull(exception);
|
|
|