Fix line numbers in suspended frames when optimizing.
commitf5db57c85ad6e8bdb868f25f9d02ffa8d1bf580d
authorAlexey Toptygin <alexeyt@fb.com>
Sun, 8 Dec 2019 07:45:12 +0000 (7 23:45 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 8 Dec 2019 07:48:56 +0000 (7 23:48 -0800)
tree45a423b0fa6750f67725d50d133bf051ed8beb02
parent79a4f072318a100339821432849b69a644492657
Fix line numbers in suspended frames when optimizing.

Summary:
Instead of storing the offset we resume at in resumables, store the offset we suspended at. This doesn't affect the jit, since it uses a separate resume address that isn't changing. In slow resume paths in the interpreter and debugger we can compute the resume offset from the suspend offset.

This allows backtraces to have correct line numbers for suspended frames when the optimizer removes bytecodes after e.g. an Await and the bytecode we resume at is at a line far from the place we suspended.

Reviewed By: ricklavoie

Differential Revision: D18874724

fbshipit-source-id: c1edd6eb7ca572a340f99a0cc7c109a2d4d3acfc
19 files changed:
hphp/runtime/base/backtrace.cpp
hphp/runtime/base/execution-context.cpp
hphp/runtime/debugger/cmd/cmd_next.cpp
hphp/runtime/ext/asio/ext_async-function-wait-handle.cpp
hphp/runtime/ext/asio/ext_async-function-wait-handle.h
hphp/runtime/ext/asio/ext_async-generator-wait-handle.cpp
hphp/runtime/ext/asio/ext_async-generator-wait-handle.h
hphp/runtime/ext/asio/ext_async-generator.cpp
hphp/runtime/ext/asio/ext_async-generator.h
hphp/runtime/ext/generator/ext_generator.cpp
hphp/runtime/ext/generator/ext_generator.h
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/jit/extra-data.h
hphp/runtime/vm/jit/irgen-resumable.cpp
hphp/runtime/vm/jit/irlower-resumable.cpp
hphp/runtime/vm/resumable.h
hphp/test/slow/async/suspend_backtrace.php [new file with mode: 0644]
hphp/test/slow/async/suspend_backtrace.php.expect [new file with mode: 0644]
hphp/tools/gdb/frame.py