v8/test/debugger/debug
Alexey Kozyatinskiy 0896586083 [inspector] improve return position of explicit return in non-async function
Goal of this CL: explicit return from non-async function has position after
return expression as return position (will unblock [1]).

BytecodeArrayBuilder has SetStatementPosition and SetExpressionPosition methods.
If one of these methods is called then next generated bytecode will get passed
position. It's general treatment for most cases.
Unfortunately it doesn't work for Returns:
- debugger requires source positions exactly on kReturn bytecode in stepping
  implementation,
- BytecodeGenerator::BuildReturn and BytecodeGenerator::BuildAsyncReturn
  generates more then one bytecode and general solution will put return position
  on first generated bytecode,
- it's not easy to split BuildReturn function into two parts to allow something
  like following in BytecodeGenerator::VisitReturnStatement since generated
  bytecodes are actually controlled by execution_control().
..->BuildReturnPrologue();
..->SetReturnPosition(stmt);
..->Return();

In this CL we pass ReturnStatement through ExecutionControl and use it for
position when we emit return bytecode right here.

So this CL only will improve return position for returns inside of non-async
functions, I'll address async functions later.

[1] https://chromium-review.googlesource.com/c/543161/

Change-Id: Iede512c120b00c209990bf50c20e7d23dc0d65db
Reviewed-on: https://chromium-review.googlesource.com/560738
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46687}
2017-07-14 19:10:13 +00:00
..
compiler [debug-wrapper] Adapt tests, breakpoint.actual_location 2016-11-21 09:29:17 +00:00
es6 [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
es8 [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
harmony [parser] avoid complex for-loop desugaring when possible 2017-04-19 19:08:40 +00:00
ignition [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
regress [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
wasm [asm.js] Fix debugger test to check listener exception. 2017-03-29 10:46:45 +00:00
debug-allscopes-on-debugger.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-backtrace.js [debug-wrapper] migrate some scope related tests 2016-12-14 07:20:33 +00:00
debug-break-inline.js [debug-wrapper] Conditional breaks, locals, evaluate, scopes 2016-11-11 12:08:34 +00:00
debug-break-native.js [debug-wrapper] Further extend the debug wrapper 2016-11-16 08:34:44 +00:00
debug-breakpoints.js [debug-wrapper] Further extend the debug wrapper 2016-11-16 08:34:44 +00:00
debug-clearbreakpoint.js [debug-wrapper] migrate some scope related tests 2016-12-14 07:20:33 +00:00
debug-compile-event.js [debug-wrapper] Further extend the debug wrapper 2016-11-16 08:34:44 +00:00
debug-compile-optimized.js Use --opt instead of --crankshaft in tests. 2017-04-28 14:20:39 +00:00
debug-conditional-breakpoints.js [debug-wrapper] Migrate more tests 2016-11-22 12:44:18 +00:00
debug-constructor.js [debugger] Stepping and break-related functions in wrapper 2016-11-08 13:54:37 +00:00
debug-enable-disable-breakpoints.js [debug-wrapper] Further extend the debug wrapper 2016-11-16 08:34:44 +00:00
debug-eval-scope.js [debug] Add Eval scope type to inspector protocol 2016-11-23 07:30:23 +00:00
debug-evaluate-bool-constructor.js [debug-wrapper] migrate some scope related tests 2016-12-14 07:20:33 +00:00
debug-evaluate-closure.js [debugger] remove debugger statement support from FCG/CS. 2017-02-22 08:45:09 +00:00
debug-evaluate-declaration.js [debug-wrapper] Conditional breaks, locals, evaluate, scopes 2016-11-11 12:08:34 +00:00
debug-evaluate-locals-capturing.js [debug-wrapper] Conditional breaks, locals, evaluate, scopes 2016-11-11 12:08:34 +00:00
debug-evaluate-locals-optimized-double.js [debug] Add Eval scope type to inspector protocol 2016-11-23 07:30:23 +00:00
debug-evaluate-locals-optimized.js [debug-wrapper] Conditional breaks, locals, evaluate, scopes 2016-11-11 12:08:34 +00:00
debug-evaluate-locals.js [debug-wrapper] Adapt tests, breakpoint.actual_location 2016-11-21 09:29:17 +00:00
debug-evaluate-modify-catch-block-scope.js [debug-wrapper] Conditional breaks, locals, evaluate, scopes 2016-11-11 12:08:34 +00:00
debug-evaluate-modify-this.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-evaluate-nested-let.js Use --opt instead of --crankshaft in tests. 2017-04-28 14:20:39 +00:00
debug-evaluate-no-side-effect-async.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-no-side-effect-builtins-2.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-no-side-effect-builtins.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-no-side-effect-control.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-no-side-effect-iife.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-no-side-effect-ops.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-no-side-effect.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-evaluate-shadowed-context-2.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-evaluate-shadowed-context.js [debug-wrapper] Migrate more tests 2016-11-22 12:44:18 +00:00
debug-evaluate-with.js [ignition/turbo] Perform liveness analysis on the bytecodes 2016-11-29 12:27:15 +00:00
debug-evaluate.js [debug-wrapper] migrate some scope related tests 2016-12-14 07:20:33 +00:00
debug-event-listener.js [debug-wrapper] Add caught/uncaught to exception pauses 2016-11-10 09:05:29 +00:00
debug-exceptions.js [debug-wrapper] Add caught/uncaught to exception pauses 2016-11-10 09:05:29 +00:00
debug-function-scopes.js [debug-wrapper] Migrate more tests 2016-11-22 12:44:18 +00:00
debug-generator-break-on-stack.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-generator-break.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-liveedit-1.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-2.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-3.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-4.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-check-stack.js [liveedit] reimplement frame restarting. 2017-01-27 07:31:03 +00:00
debug-liveedit-compile-error.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-diff.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-double-call.js Count closures using the feedback vector cell map, specialize if count==1. 2017-02-10 15:19:19 +00:00
debug-liveedit-exceptions.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-literals.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-newsource.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-patch-positions-replace.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-replace-code.js [liveedit] reimplement frame restarting. 2017-01-27 07:31:03 +00:00
debug-liveedit-restart-frame.js [ignition/turbo] Perform liveness analysis on the bytecodes 2016-11-29 12:27:15 +00:00
debug-liveedit-stack-padding.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-liveedit-stepin.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-liveedit-utils.js [debug-wrapper] LiveEdit, frame.restart(), breakpoints 2016-11-17 08:43:59 +00:00
debug-materialized.js [debug-wrapper] Conditional breaks, locals, evaluate, scopes 2016-11-11 12:08:34 +00:00
debug-modules-set-variable-value.js [modules] Fix setting variables via debug-scopes. 2017-06-15 15:46:48 +00:00
debug-multiple-breakpoints.js [debug-wrapper] Migrate more tests 2016-11-22 12:44:18 +00:00
debug-multiple-var-decl.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-negative-break-points.js [debug-wrapper] Migrate more tests 2016-11-22 12:44:18 +00:00
debug-optimize.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-print.js [elements] Rename FAST elements kinds 2017-06-30 13:31:44 +00:00
debug-receiver.js [debug-wrapper] Migrate more tests 2016-11-22 12:44:18 +00:00
debug-return-value.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-scopes-suspended-generators.js [Interpreter] Replace --ignition flag with a --stress-fullcodegen 2017-07-13 13:05:00 +00:00
debug-scopes.js Fix debugger's frame inspection for optimized Array.forEach. 2017-06-27 10:56:42 +00:00
debug-script.js [inspector] prepared console before moving into builtins 2017-03-29 23:04:49 +00:00
debug-set-variable-value.js [debugger] remove debugger statement support from FCG/CS. 2017-02-22 08:45:09 +00:00
debug-setbreakpoint.js [debug-wrapper] migrate some scope related tests 2016-12-14 07:20:33 +00:00
debug-sourceinfo.js [debug-wrapper] clearAllBreakPoints and several scripts functions 2016-11-17 09:34:18 +00:00
debug-stack-check-position.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step-2.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step-3.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step-4.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step-end-of-script.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step-into-json.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-step-into-valueof.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-step-stub-callfunction.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step-turbofan.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-step.js [debugger] correctly annotate scripts with debug id. 2017-03-13 09:13:43 +00:00
debug-stepin-accessor-ic.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-accessor.js Revert "Revert "Reland "Introducing an event loop mechanism for d8.""" 2017-05-10 18:34:10 +00:00
debug-stepin-builtin-callback-opt.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-stepin-builtin-callback.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-builtin.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-call-function-stub.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-construct-call.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-constructor.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-foreach.js [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
debug-stepin-function-call.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepin-property-function-call.js Use --opt instead of --crankshaft in tests. 2017-04-28 14:20:39 +00:00
debug-stepnext-do-while.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-recursive-function.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part1.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part2.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part3.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part4.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part5.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part6.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part7.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-scope-part8.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
debug-stepout-to-builtin.js [debugger] Further stepping support in test wrapper 2016-11-07 12:25:24 +00:00
for-in-opt.js [debugger] Migrate more debugger tests to inspector 2016-11-08 10:39:08 +00:00
function-source.js [debug-wrapper] clearAllBreakPoints and several scripts functions 2016-11-17 09:34:18 +00:00
regress-3225.js Make non-Module generators only context allocate parameters. 2017-05-24 13:54:57 +00:00
regress-5207.js [ignition/turbo] Perform liveness analysis on the bytecodes 2016-11-29 12:27:15 +00:00