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

Unified Diff: src/interpreter/interpreter.cc

Issue 1737633002: [Interpreter] Use FastCloneRegExpStub for CreateRegExpLiteral. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 38d534f43faf505d2626a2678c0f507068ad8ebd..ea8d61d4872e2fc96a2003fc7fc2c6c9956105db 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1573,7 +1573,20 @@ void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
// Creates a regular expression literal for literal index <literal_idx> with
// <flags> and the pattern in <pattern_idx>.
void Interpreter::DoCreateRegExpLiteral(InterpreterAssembler* assembler) {
- DoCreateLiteral(Runtime::kCreateRegExpLiteral, assembler);
+ Callable callable = CodeFactory::FastCloneRegExp(isolate_);
+ Node* target = __ HeapConstant(callable.code());
+ Node* index = __ BytecodeOperandIdx(0);
+ Node* pattern = __ LoadConstantPoolEntry(index);
+ Node* literal_index_raw = __ BytecodeOperandIdx(1);
+ Node* literal_index = __ SmiTag(literal_index_raw);
+ Node* flags_raw = __ BytecodeOperandImm(2);
+ Node* flags = __ SmiTag(flags_raw);
+ Node* closure = __ LoadRegister(Register::function_closure());
+ Node* context = __ GetContext();
+ Node* result = __ CallStub(callable.descriptor(), target, context, closure,
+ literal_index, pattern, flags);
+ __ SetAccumulator(result);
+ __ Dispatch();
}
@@ -1582,7 +1595,7 @@ void Interpreter::DoCreateRegExpLiteral(InterpreterAssembler* assembler) {
// Creates a regular expression literal for literal index <literal_idx> with
// <flags> and the pattern in <pattern_idx>.
void Interpreter::DoCreateRegExpLiteralWide(InterpreterAssembler* assembler) {
- DoCreateLiteral(Runtime::kCreateRegExpLiteral, assembler);
+ DoCreateRegExpLiteral(assembler);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698