• 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
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
OWNERS Loading commit data...
debug-coverage.cc Loading commit data...
debug-coverage.h Loading commit data...
debug-evaluate.cc Loading commit data...
debug-evaluate.h Loading commit data...
debug-frames.cc Loading commit data...
debug-frames.h Loading commit data...
debug-interface.h Loading commit data...
debug-scope-iterator.cc Loading commit data...
debug-scope-iterator.h Loading commit data...
debug-scopes.cc Loading commit data...
debug-scopes.h Loading commit data...
debug-stack-trace-iterator.cc Loading commit data...
debug-stack-trace-iterator.h Loading commit data...
debug-type-profile.cc Loading commit data...
debug-type-profile.h Loading commit data...
debug.cc Loading commit data...
debug.h Loading commit data...
interface-types.h Loading commit data...
liveedit.cc Loading commit data...
liveedit.h Loading commit data...