1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Flags: --turbo-filter=g --allow-natives-syntax
7 // Test that Debug::PrepareForBreakPoints can deal with turbofan code (g)
8 // on the stack. Without deoptimization support, we will not be able to
9 // replace optimized code for g by unoptimized code with debug break slots.
10 // This would cause stepping to fail (V8 issue 3660).
22 return a + b; // Break 4
33 function listener(event, exec_state, event_data, data) {
34 if (event != Debug.DebugEvent.Break) return;
36 exec_state.prepareStep(Debug.StepAction.StepNext, 1);
37 print(exec_state.frame(0).sourceLineText());
38 var match = exec_state.frame(0).sourceLineText().match(/Break (\d)/);
40 assertEquals(break_count++, parseInt(match[1]));
49 %OptimizeFunctionOnNextCall(g);
51 Debug.setListener(listener);
55 Debug.setListener(null); // Break 9
56 assertNull(exception);
57 assertEquals(10, break_count);