Commit 2dd21c33 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[LiveEdit] Disable bytecode flushing on liveedit.

If liveedit patches a script there might be a mismatch between
the bytecode on a stackframe and the bytecode on the JSFunction
for that same frame. This allows the patched bytecode on the
JSFunction to be flushed which breaks the invariant that all
JSFunctions with live stack activations are compiled. To prevent
this disable bytecode flushing when liveedit patches a script.

BUG=v8:11445

Change-Id: I79e7403dfb6dfc317d4313f8cab5118b12c67ed9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2775577
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73559}
parent 7f091226
......@@ -1116,6 +1116,13 @@ void LiveEdit::PatchScript(Isolate* isolate, Handle<Script> script,
return;
}
// Patching a script means that the bytecode on the stack may no longer
// correspond to the bytecode of the JSFunction for that frame. As a result
// it is no longer safe to flush bytecode since we might flush the new
// bytecode for a JSFunction that is on the stack with an old bytecode, which
// breaks the invariant that any JSFunction active on the stack is compiled.
isolate->set_disable_bytecode_flushing(true);
std::map<int, int> start_position_to_unchanged_id;
for (const auto& mapping : unchanged) {
FunctionData* data = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment