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

Unified Diff: src/compiler/js-operator.cc

Issue 1475973002: [turbofan] Introduce proper JSCreateLiteralRegExp operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use ReplaceWithStubCall. Created 5 years, 1 month 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/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.cc
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
index a771cd543494644e7fc598c39ecebb5f6ab1590d..9975217f97e5851ed5e46d049b8bdd652f13e071 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -412,7 +412,7 @@ const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) {
bool operator==(CreateLiteralParameters const& lhs,
CreateLiteralParameters const& rhs) {
- return lhs.constants().location() == rhs.constants().location() &&
+ return lhs.constant().location() == rhs.constant().location() &&
lhs.flags() == rhs.flags() && lhs.index() == rhs.index();
}
@@ -424,18 +424,19 @@ bool operator!=(CreateLiteralParameters const& lhs,
size_t hash_value(CreateLiteralParameters const& p) {
- return base::hash_combine(p.constants().location(), p.flags(), p.index());
+ return base::hash_combine(p.constant().location(), p.flags(), p.index());
}
std::ostream& operator<<(std::ostream& os, CreateLiteralParameters const& p) {
- return os << Brief(*p.constants()) << ", " << p.flags() << ", " << p.index();
+ return os << Brief(*p.constant()) << ", " << p.flags() << ", " << p.index();
}
const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op) {
DCHECK(op->opcode() == IrOpcode::kJSCreateLiteralArray ||
- op->opcode() == IrOpcode::kJSCreateLiteralObject);
+ op->opcode() == IrOpcode::kJSCreateLiteralObject ||
+ op->opcode() == IrOpcode::kJSCreateLiteralRegExp);
return OpParameter<CreateLiteralParameters>(op);
}
@@ -779,6 +780,18 @@ const Operator* JSOperatorBuilder::CreateLiteralObject(
}
+const Operator* JSOperatorBuilder::CreateLiteralRegExp(
+ Handle<String> constant_pattern, int literal_flags, int literal_index) {
+ CreateLiteralParameters parameters(constant_pattern, literal_flags,
+ literal_index);
+ return new (zone()) Operator1<CreateLiteralParameters>( // --
+ IrOpcode::kJSCreateLiteralRegExp, Operator::kNoProperties, // opcode
+ "JSCreateLiteralRegExp", // name
+ 1, 1, 1, 1, 1, 2, // counts
+ parameters); // parameter
+}
+
+
const Operator* JSOperatorBuilder::CreateFunctionContext(int slot_count) {
return new (zone()) Operator1<int>( // --
IrOpcode::kJSCreateFunctionContext, Operator::kNoProperties, // opcode
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698