Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 89d349ff7238d21859f422e7661bd4de85e6ca34..e1e87546a9c23cf3ad8d798b07e95590f6f2e041 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -3280,6 +3280,13 @@ void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) { |
// Store the new target we were called with in the given variable. |
builder()->LoadAccumulatorWithRegister(Register::new_target()); |
VisitVariableAssignment(variable, Token::INIT, FeedbackVectorSlot::Invalid()); |
+ |
+ // TODO(mstarzinger): The <new.target> register is not set by the deoptimizer |
+ // and we need to make sure {BytecodeRegisterOptimizer} flushes its state |
+ // before a local variable containing the <new.target> is used. Using a label |
+ // as below flushes the entire pipeline, we should be more specific here. |
+ BytecodeLabel flush_state_label; |
+ builder()->Bind(&flush_state_label); |
} |
void BytecodeGenerator::VisitFunctionClosureForContext() { |