diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-07-21 22:20:37 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-07-21 22:20:37 -0700 |
commit | f319e126218dcaafdb0ccf7e968ff839f8327bba (patch) | |
tree | 209546d94cdc6c19f69ef92e3ec057301369f416 /deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js | |
parent | ef1be160d66b7da8bc2da857b1c33c6f680d86f1 (diff) | |
download | node-new-f319e126218dcaafdb0ccf7e968ff839f8327bba.tar.gz |
Upgrade V8 to 3.4.14
Diffstat (limited to 'deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js')
-rw-r--r-- | deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js b/deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js index 584d1afdab..9ed1dbbedb 100644 --- a/deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js +++ b/deps/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js @@ -44,21 +44,44 @@ function listener(event, exec_state, event_data, data) { for (var i = 0; i < exec_state.frameCount(); i++) { var frame = exec_state.frame(i); if (i < exec_state.frameCount() - 1) { - // All frames except the bottom one has normal variables a and b. + var expected_a = i * 2 + 1 + (i * 2 + 1) / 100; + var expected_b = i * 2 + 2 + (i * 2 + 2) / 100; + var expected_x = (i + 1) * 2 + 1 + ((i + 1) * 2 + 1) / 100; + var expected_y = (i + 1) * 2 + 2 + ((i + 1) * 2 + 2) / 100; + + // All frames except the bottom one has normal variables a and b. assertEquals('a', frame.localName(0)); assertEquals('b', frame.localName(1)); - assertEquals(i * 2 + 1 + (i * 2 + 1) / 100, - frame.localValue(0).value()); - assertEquals(i * 2 + 2 + (i * 2 + 2) / 100, - frame.localValue(1).value()); + assertEquals(expected_a, frame.localValue(0).value()); + assertEquals(expected_b, frame.localValue(1).value()); // All frames except the bottom one has arguments variables x and y. assertEquals('x', frame.argumentName(0)); assertEquals('y', frame.argumentName(1)); - assertEquals((i + 1) * 2 + 1 + ((i + 1) * 2 + 1) / 100, - frame.argumentValue(0).value()); - assertEquals((i + 1) * 2 + 2 + ((i + 1) * 2 + 2) / 100, - frame.argumentValue(1).value()); + assertEquals(expected_x, frame.argumentValue(0).value()); + assertEquals(expected_y, frame.argumentValue(1).value()); + + // All frames except the bottom one have two scopes. + assertEquals(2, frame.scopeCount()); + assertEquals(debug.ScopeType.Local, frame.scope(0).scopeType()); + assertEquals(debug.ScopeType.Global, frame.scope(1).scopeType()); + assertEquals(expected_a, frame.scope(0).scopeObject().value()['a']); + assertEquals(expected_b, frame.scope(0).scopeObject().value()['b']); + assertEquals(expected_x, frame.scope(0).scopeObject().value()['x']); + assertEquals(expected_y, frame.scope(0).scopeObject().value()['y']); + + // Evaluate in the inlined frame. + assertEquals(expected_a, frame.evaluate('a').value()); + assertEquals(expected_x, frame.evaluate('x').value()); + assertEquals(expected_x, frame.evaluate('arguments[0]').value()); + assertEquals(expected_a + expected_b + expected_x + expected_y, + frame.evaluate('a + b + x + y').value()); + assertEquals(expected_x + expected_y, + frame.evaluate('arguments[0] + arguments[1]').value()); + } else { + // The bottom frame only have the global scope. + assertEquals(1, frame.scopeCount()); + assertEquals(debug.ScopeType.Global, frame.scope(0).scopeType()); } // Check the frame function. @@ -75,12 +98,13 @@ function listener(event, exec_state, event_data, data) { // Check for construct call. assertEquals(testingConstructCall && i == 4, frame.isConstructCall()); - // When function f is optimized (2 means YES, see runtime.cc) we + // 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) == 2) { + 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()); |