Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1410853002: [Interpreter] Add support for RegExp literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698