Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index a8380330271805e71c4f07f502999cbf05f2e5e0..34ed5e8fac12503c4f4b4f6a2fe9cf5463a7e01a 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -1495,6 +1495,11 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
__ Move(descriptor.GetRegisterParameter(2), expr->pattern()); |
__ Move(descriptor.GetRegisterParameter(3), Smi::FromInt(expr->flags())); |
__ Call(callable.code(), RelocInfo::CODE_TARGET); |
+ |
+ // Reload the context register after the call as i.e. TurboFan code stubs |
+ // won't preserve the context register. |
+ LoadFromFrameField(StandardFrameConstants::kContextOffset, |
+ context_register()); |
context()->Plug(result_register()); |
} |