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

Unified Diff: src/interpreter/interpreter.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/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | 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 a6e9317e0f03e2d8a3175314f1b258d77be8bae4..170576402c027e4e39545dfd0eec0b24c97cb6e8 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -721,23 +721,6 @@ void Interpreter::DoJumpIfFalseConstant(
}
-void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
- compiler::InterpreterAssembler* assembler) {
- Node* constant_elements = __ GetAccumulator();
- Node* literal_index_raw = __ BytecodeOperandIdx8(0);
- Node* literal_index = __ SmiTag(literal_index_raw);
- Node* flags_raw = __ BytecodeOperandImm8(1);
- Node* flags = __ SmiTag(flags_raw);
- Node* closure = __ LoadRegister(Register::function_closure());
- Node* literals_array =
- __ LoadObjectField(closure, JSFunction::kLiteralsOffset);
- Node* result = __ CallRuntime(function_id, literals_array, literal_index,
- constant_elements, flags);
- __ SetAccumulator(result);
- __ Dispatch();
-}
-
-
// JumpIfToBooleanTrue <imm8>
//
// Jump by number of bytes represented by an immediate operand if the object
@@ -804,6 +787,44 @@ void Interpreter::DoJumpIfToBooleanFalseConstant(
}
+// CreateRegExpLiteral <idx> <flags_reg>
+//
+// Creates a regular expression literal for literal index <idx> with flags held
+// in <flags_reg> and the pattern in the accumulator.
+void Interpreter::DoCreateRegExpLiteral(
+ compiler::InterpreterAssembler* assembler) {
+ Node* pattern = __ GetAccumulator();
+ Node* literal_index_raw = __ BytecodeOperandIdx8(0);
+ Node* literal_index = __ SmiTag(literal_index_raw);
+ Node* flags_reg = __ BytecodeOperandReg8(1);
+ Node* flags = __ LoadRegister(flags_reg);
+ Node* closure = __ LoadRegister(Register::function_closure());
+ Node* literals_array =
+ __ LoadObjectField(closure, JSFunction::kLiteralsOffset);
+ Node* result = __ CallRuntime(Runtime::kMaterializeRegExpLiteral,
+ literals_array, literal_index, pattern, flags);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
+void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
+ compiler::InterpreterAssembler* assembler) {
+ Node* constant_elements = __ GetAccumulator();
+ Node* literal_index_raw = __ BytecodeOperandIdx8(0);
+ Node* literal_index = __ SmiTag(literal_index_raw);
+ Node* flags_raw = __ BytecodeOperandImm8(1);
+ Node* flags = __ SmiTag(flags_raw);
+ Node* closure = __ LoadRegister(Register::function_closure());
+ Node* literals_array =
+ __ LoadObjectField(closure, JSFunction::kLiteralsOffset);
+ Node* result = __ CallRuntime(function_id, literals_array, literal_index,
+ constant_elements, flags);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
// CreateArrayLiteral <idx> <flags>
//
// Creates an array literal for literal index <idx> with flags <flags> and
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698