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

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

Issue 2639233002: [Turbofan] Add CallFunctionWithSpread JSOperator. (Closed)
Patch Set: Set CL dependency to bytecode CL Created 3 years, 11 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/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 bb246b5b580616512060221bed55bcb71a0fe909..01e66a4c74d4d9a9d52dd195be89a6484adecfff 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -118,6 +118,30 @@ const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) {
return OpParameter<CallFunctionParameters>(op);
}
+bool operator==(CallFunctionWithSpreadParameters const& lhs,
+ CallFunctionWithSpreadParameters const& rhs) {
+ return lhs.arity() == rhs.arity();
+}
+
+bool operator!=(CallFunctionWithSpreadParameters const& lhs,
+ CallFunctionWithSpreadParameters const& rhs) {
+ return !(lhs == rhs);
+}
+
+size_t hash_value(CallFunctionWithSpreadParameters const& p) {
+ return base::hash_combine(p.arity());
+}
+
+std::ostream& operator<<(std::ostream& os,
+ CallFunctionWithSpreadParameters const& p) {
+ return os << p.arity();
+}
+
+CallFunctionWithSpreadParameters const& CallFunctionWithSpreadParametersOf(
+ Operator const* op) {
+ DCHECK_EQ(IrOpcode::kJSCallFunctionWithSpread, op->opcode());
+ return OpParameter<CallFunctionWithSpreadParameters>(op);
+}
bool operator==(CallRuntimeParameters const& lhs,
CallRuntimeParameters const& rhs) {
@@ -712,6 +736,14 @@ const Operator* JSOperatorBuilder::CallFunction(
parameters); // parameter
}
+const Operator* JSOperatorBuilder::CallFunctionWithSpread(uint32_t arity) {
+ CallFunctionWithSpreadParameters parameters(arity);
+ return new (zone()) Operator1<CallFunctionWithSpreadParameters>( // --
+ IrOpcode::kJSCallFunctionWithSpread, Operator::kNoProperties, // opcode
+ "JSCallFunctionWithSpread", // name
+ parameters.arity(), 1, 1, 1, 1, 2, // counts
+ parameters); // parameter
+}
const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id) {
const Runtime::Function* f = Runtime::FunctionForId(id);
« 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