SrcKey: implement lineNumber()
commit80b7181023f59ce618d76a609794503648bb0557
authorJan Oravec <jan@fb.com>
Thu, 22 Oct 2020 20:10:19 +0000 (22 13:10 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 22 Oct 2020 20:14:50 +0000 (22 13:14 -0700)
treea690962bb438e3cf5caab10239f4cf818f9326bf
parent26ce3654932b3ae91b4a993dddfe8f768bc95ce5
SrcKey: implement lineNumber()

Summary:
There are many places in the codebase that try to obtain a line number for
a SrcKey.

Move this functionality to SrcKey::lineNumber() and unify it so that prologues
point to the first line of the function declaration.

While there, fix two bugs:
- vtune-jit.cpp: resolving line number from a line number (my recent bug)
- print.cpp: iroff() is a sequence number of IR instruction within a bytecode, adding it to bcOff() is meaningless and computing a line number from that even more so; the rest will be fixed in the next diff

Eliminates some usage of offset()s in prologues and improves debugging and
tracing output.

Reviewed By: oulgen

Differential Revision: D24441375

fbshipit-source-id: 4a7675b7b6aec94512456bbc59b0e3a070f2f75a
hphp/runtime/vm/jit/irgen-create.cpp
hphp/runtime/vm/jit/irgen-iter-spec.cpp
hphp/runtime/vm/jit/irgen-minstr.cpp
hphp/runtime/vm/jit/print.cpp
hphp/runtime/vm/jit/prof-data-serialize.cpp
hphp/runtime/vm/jit/vtune-jit.cpp
hphp/runtime/vm/srckey-inl.h
hphp/runtime/vm/srckey.cpp
hphp/runtime/vm/srckey.h