• Leszek Swirski's avatar
    [liveedit] Patch changed SFIs' constant pools · 084d472f
    Leszek Swirski authored
    When live edit patches a script, it distinguishes between 'changed' and
    'unchanged' functions, and unchanged functions have their position and
    source script patched to the new script instead of being replaced by a
    new SFI.
    
    However, if a 'changed' function has an inner 'unchanged' function, it
    also holds a pointer to the inner function in its bytecode constant
    pool. This constant pool entry was not being updated for changed
    functions (it was for unchanged), and therefore the outer changed
    function would compile the redundant new function instead of the old,
    patched, unchanged function.
    
    This patch fixes this by patching 'changed' functions' bytecode constant
    pools. This is done by swapping the script and script function list
    position of the old new and old 'unchanged' function, rather than just
    setting the script (and position) on the old one, and using the new
    function (now pointing at the old script) to read off the old function
    literal id. This could also be done by reading the function_literal_id
    off the new function, but we are soon removing that field anyway.
    
    Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
    Change-Id: Ib22078c06539c795b418d29a493d8224ecea182e
    Reviewed-on: https://chromium-review.googlesource.com/1127941Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#54321}
    084d472f
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...