Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index dc36fb1aa5f7cdf075dbd0addb6f55e3e41e1e1b..74b06ea41e6305105fdc832ff0d793518640472a 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -503,7 +503,14 @@ void BytecodeGenerator::VisitLiteral(Literal* expr) { |
void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
- UNIMPLEMENTED(); |
+ // Materialize a regular expression literal. |
+ TemporaryRegisterScope temporary_register_scope(builder()); |
+ Register flags = temporary_register_scope.NewRegister(); |
+ builder() |
+ ->LoadLiteral(expr->flags()) |
+ .StoreAccumulatorInRegister(flags) |
+ .LoadLiteral(expr->pattern()) |
+ .CreateRegExpLiteral(expr->literal_index(), flags); |
} |