Commit 5fcc52fc authored by yangguo@chromium.org's avatar yangguo@chromium.org

Simplify debug evaluate.

R=peter.rybin@gmail.com
BUG=v8:2585, 173608

Review URL: https://chromiumcodereview.appspot.com/12953002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2820eeb6
This diff is collapsed.
......@@ -1240,6 +1240,7 @@ TEST(TestCodeFlushingIncrementalAbort) {
// code flushing candidate.
SimulateIncrementalMarking();
#ifdef ENABLE_DEBUGGER_SUPPORT
// Enable the debugger and add a breakpoint while incremental marking
// is running so that incremental marking aborts and code flushing is
// disabled.
......@@ -1247,6 +1248,7 @@ TEST(TestCodeFlushingIncrementalAbort) {
Handle<Object> breakpoint_object(Smi::FromInt(0), isolate);
isolate->debug()->SetBreakPoint(function, breakpoint_object, &position);
isolate->debug()->ClearAllBreakPoints();
#endif // ENABLE_DEBUGGER_SUPPORT
// Force optimization now that code flushing is disabled.
{ v8::HandleScope scope(env->GetIsolate());
......@@ -3010,8 +3012,10 @@ TEST(Regress173458) {
// explicitly enqueued.
SimulateIncrementalMarking();
#ifdef ENABLE_DEBUGGER_SUPPORT
// Now enable the debugger which in turn will disable code flushing.
CHECK(isolate->debug()->Load());
#endif // ENABLE_DEBUGGER_SUPPORT
// This cycle will bust the heap and subsequent cycles will go ballistic.
heap->CollectAllGarbage(Heap::kNoGCFlags);
......
......@@ -36,19 +36,20 @@ exception = false;
function h() {
var a = 1;
var b = 2;
var eval = 5; // Overriding eval should not break anything.
debugger; // Breakpoint.
}
function checkFrame0(frame) {
// Frame 0 (h) has normal variables a and b.
var count = frame.localCount();
assertEquals(2, count);
assertEquals(3, count);
for (var i = 0; i < count; ++i) {
var name = frame.localName(i);
var value = frame.localValue(i).value();
if (name == 'a') {
assertEquals(1, value);
} else {
} else if (name !='eval') {
assertEquals('b', name);
assertEquals(2, value);
}
......@@ -115,16 +116,21 @@ function listener(event, exec_state, event_data, data) {
// Evaluating a and b on frames 0, 1 and 2 produces 1, 2, 3, 4, 5 and 6.
assertEquals(1, exec_state.frame(0).evaluate('a').value());
assertEquals(2, exec_state.frame(0).evaluate('b').value());
assertEquals(5, exec_state.frame(0).evaluate('eval').value());
assertEquals(3, exec_state.frame(1).evaluate('a').value());
assertEquals(4, exec_state.frame(1).evaluate('b').value());
assertEquals("function",
typeof exec_state.frame(1).evaluate('eval').value());
assertEquals(5, exec_state.frame(2).evaluate('a').value());
assertEquals(6, exec_state.frame(2).evaluate('b').value());
assertEquals("function",
typeof exec_state.frame(2).evaluate('eval').value());
// Indicate that all was processed.
listenerComplete = true;
}
} catch (e) {
exception = e
print("Caught something. " + e + " " + e.stack);
};
};
......@@ -133,6 +139,6 @@ Debug.setListener(listener);
f();
// Make sure that the debug event listener vas invoked.
assertTrue(listenerComplete);
// Make sure that the debug event listener was invoked.
assertFalse(exception, "exception in listener")
assertTrue(listenerComplete);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment