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

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

Issue 2561103003: [Turbofan] Add CallConstructWithSpread JSOperator. (Closed)
Patch Set: Add line spaces back that auto-format zapped Created 4 years 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/opcodes.h » ('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 fa55c40837906bdd7924dd36464606f652bb6eee..f577a455a8ee06c3a78fac6bd97eb9c4722be1f1 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -80,6 +80,30 @@ CallConstructParameters const& CallConstructParametersOf(Operator const* op) {
return OpParameter<CallConstructParameters>(op);
}
+bool operator==(CallConstructWithSpreadParameters const& lhs,
+ CallConstructWithSpreadParameters const& rhs) {
+ return lhs.arity() == rhs.arity();
+}
+
+bool operator!=(CallConstructWithSpreadParameters const& lhs,
+ CallConstructWithSpreadParameters const& rhs) {
+ return !(lhs == rhs);
+}
+
+size_t hash_value(CallConstructWithSpreadParameters const& p) {
+ return base::hash_combine(p.arity());
+}
+
+std::ostream& operator<<(std::ostream& os,
+ CallConstructWithSpreadParameters const& p) {
+ return os << p.arity();
+}
+
+CallConstructWithSpreadParameters const& CallConstructWithSpreadParametersOf(
+ Operator const* op) {
+ DCHECK_EQ(IrOpcode::kJSCallConstructWithSpread, op->opcode());
+ return OpParameter<CallConstructWithSpreadParameters>(op);
+}
std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) {
os << p.arity() << ", " << p.frequency() << ", " << p.convert_mode() << ", "
@@ -647,6 +671,14 @@ const Operator* JSOperatorBuilder::CallConstruct(
parameters); // parameter
}
+const Operator* JSOperatorBuilder::CallConstructWithSpread(uint32_t arity) {
+ CallConstructWithSpreadParameters parameters(arity);
+ return new (zone()) Operator1<CallConstructWithSpreadParameters>( // --
+ IrOpcode::kJSCallConstructWithSpread, Operator::kNoProperties, // opcode
+ "JSCallConstructWithSpread", // name
+ parameters.arity(), 1, 1, 1, 1, 2, // counts
+ parameters); // parameter
+}
const Operator* JSOperatorBuilder::ConvertReceiver(
ConvertReceiverMode convert_mode) {
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698