Commit 32055b9d authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[ignition] Properly track validity of the bytecode array.

The debugger replaces the bytecode array when breakpoints are set
by walking the stack and mutating the dedicated stack slots for the
bytecode arrays. This means that Ignition has to properly reload the
bytecode array after calls, which works for a single call inside a
bytecode handler, but fails if there are multiple calls.

R=rmcilroy@chromium.org

Change-Id: Ia7744edc91490014d77ad9ad17a328cab5f8530f
Reviewed-on: https://chromium-review.googlesource.com/603410Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47190}
parent 4455db16
...@@ -33,6 +33,7 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state, ...@@ -33,6 +33,7 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state,
bytecode_offset_(this, MachineType::PointerRepresentation()), bytecode_offset_(this, MachineType::PointerRepresentation()),
interpreted_frame_pointer_(this, MachineType::PointerRepresentation()), interpreted_frame_pointer_(this, MachineType::PointerRepresentation()),
bytecode_array_(this, MachineRepresentation::kTagged), bytecode_array_(this, MachineRepresentation::kTagged),
bytecode_array_valid_(true),
dispatch_table_(this, MachineType::PointerRepresentation()), dispatch_table_(this, MachineType::PointerRepresentation()),
accumulator_(this, MachineRepresentation::kTagged), accumulator_(this, MachineRepresentation::kTagged),
accumulator_use_(AccumulatorUse::kNone), accumulator_use_(AccumulatorUse::kNone),
...@@ -180,10 +181,9 @@ Node* InterpreterAssembler::BytecodeOffset() { ...@@ -180,10 +181,9 @@ Node* InterpreterAssembler::BytecodeOffset() {
Node* InterpreterAssembler::BytecodeArrayTaggedPointer() { Node* InterpreterAssembler::BytecodeArrayTaggedPointer() {
// Force a re-load of the bytecode array after every call in case the debugger // Force a re-load of the bytecode array after every call in case the debugger
// has been activated. // has been activated.
if (made_call_ && if (!bytecode_array_valid_) {
(bytecode_array_.value() ==
Parameter(InterpreterDispatchDescriptor::kBytecodeArray))) {
bytecode_array_.Bind(LoadRegister(Register::bytecode_array())); bytecode_array_.Bind(LoadRegister(Register::bytecode_array()));
bytecode_array_valid_ = true;
} }
return bytecode_array_.value(); return bytecode_array_.value();
} }
...@@ -539,6 +539,7 @@ void InterpreterAssembler::CallPrologue() { ...@@ -539,6 +539,7 @@ void InterpreterAssembler::CallPrologue() {
DCHECK(stack_pointer_before_call_ == nullptr); DCHECK(stack_pointer_before_call_ == nullptr);
stack_pointer_before_call_ = LoadStackPointer(); stack_pointer_before_call_ = LoadStackPointer();
} }
bytecode_array_valid_ = false;
made_call_ = true; made_call_ = true;
} }
......
...@@ -363,6 +363,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler { ...@@ -363,6 +363,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
CodeStubAssembler::Variable bytecode_offset_; CodeStubAssembler::Variable bytecode_offset_;
CodeStubAssembler::Variable interpreted_frame_pointer_; CodeStubAssembler::Variable interpreted_frame_pointer_;
CodeStubAssembler::Variable bytecode_array_; CodeStubAssembler::Variable bytecode_array_;
bool bytecode_array_valid_;
CodeStubAssembler::Variable dispatch_table_; CodeStubAssembler::Variable dispatch_table_;
CodeStubAssembler::Variable accumulator_; CodeStubAssembler::Variable accumulator_;
AccumulatorUse accumulator_use_; AccumulatorUse accumulator_use_;
......
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