Compute BCMarker fixup offsets lazily
commitce0261ab57ac83af47cbd66d1db34293e40e29ed
authorJan Oravec <jan@fb.com>
Fri, 8 Oct 2021 00:47:15 +0000 (7 17:47 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 8 Oct 2021 00:49:44 +0000 (7 17:49 -0700)
treec535bca3f08886775c093f02bbbdafb8cedc7782
parent8c5546848df876c19db76455b974bd01956f51cf
Compute BCMarker fixup offsets lazily

Summary:
BCMarker has sufficient amount of information to compute all offsets on demand,
which is simpler than updating it from store-elim.

- fixupSk(): just lookup the first unpublished BeginInlining opcode
- fixupSBOff(): new helper that represents an offset between stack bases
- frameSBOff(): the semantics is undefined for non-BeginInlining frames,
  fortunately it is used only when inlining, so just use adjusted fixupSBOff()
- fixupBcSPOff(): instead of adjusting bcSPOff(), compute the fixup version of
  it on demand and update all relevant callers from bcSPOff() to
  fixupBcSPOff(); note that some callers used during irgen (before store-elim)
  were expecting non-fixup semantic, keep these at bcSPOff() so they continue
  to work once we stop emitting InlineCall during irgen

Reviewed By: ricklavoie

Differential Revision: D31357421

fbshipit-source-id: c49cfbe2cbcfdb415339dd06ee9ae3ec4011c5c1
hphp/runtime/vm/jit/bc-marker.cpp
hphp/runtime/vm/jit/bc-marker.h
hphp/runtime/vm/jit/irlower-call.cpp
hphp/runtime/vm/jit/irlower-internal.cpp
hphp/runtime/vm/jit/irlower-ret.cpp
hphp/runtime/vm/jit/memory-effects.cpp
hphp/runtime/vm/jit/store-elim.cpp
hphp/runtime/vm/jit/vasm-internal-inl.h
hphp/runtime/vm/jit/vasm-internal.cpp