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

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

Issue 2890023004: [turbofan] Avoid allocating rest parameters for spread calls. (Closed)
Patch Set: Created 3 years, 7 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/js-typed-lowering.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 1b894d7cc1e384b5d6ff960c22dafd54ff9620bb..b8156a23f4305e14ab3f31e32bf0ca3b593a26ab 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -57,6 +57,17 @@ ToBooleanHints ToBooleanHintsOf(Operator const* op) {
return OpParameter<ToBooleanHints>(op);
}
+std::ostream& operator<<(std::ostream& os,
+ ConstructForwardVarargsParameters const& p) {
+ return os << p.arity() << ", " << p.start_index();
+}
+
+ConstructForwardVarargsParameters const& ConstructForwardVarargsParametersOf(
+ Operator const* op) {
+ DCHECK_EQ(IrOpcode::kJSConstructForwardVarargs, op->opcode());
+ return OpParameter<ConstructForwardVarargsParameters>(op);
+}
+
bool operator==(ConstructParameters const& lhs,
ConstructParameters const& rhs) {
return lhs.arity() == rhs.arity() && lhs.frequency() == rhs.frequency() &&
@@ -118,7 +129,8 @@ const CallParameters& CallParametersOf(const Operator* op) {
std::ostream& operator<<(std::ostream& os,
CallForwardVarargsParameters const& p) {
- return os << p.start_index() << ", " << p.tail_call_mode();
+ return os << p.arity() << ", " << p.start_index() << ", "
+ << p.tail_call_mode();
}
CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
@@ -743,12 +755,12 @@ const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) {
}
const Operator* JSOperatorBuilder::CallForwardVarargs(
- uint32_t start_index, TailCallMode tail_call_mode) {
- CallForwardVarargsParameters parameters(start_index, tail_call_mode);
+ size_t arity, uint32_t start_index, TailCallMode tail_call_mode) {
+ CallForwardVarargsParameters parameters(arity, start_index, tail_call_mode);
return new (zone()) Operator1<CallForwardVarargsParameters>( // --
IrOpcode::kJSCallForwardVarargs, Operator::kNoProperties, // opcode
"JSCallForwardVarargs", // name
- 2, 1, 1, 1, 1, 2, // counts
+ parameters.arity(), 1, 1, 1, 1, 2, // counts
parameters); // parameter
}
@@ -798,6 +810,16 @@ const Operator* JSOperatorBuilder::CallRuntime(const Runtime::Function* f,
parameters); // parameter
}
+const Operator* JSOperatorBuilder::ConstructForwardVarargs(
+ size_t arity, uint32_t start_index) {
+ ConstructForwardVarargsParameters parameters(arity, start_index);
+ return new (zone()) Operator1<ConstructForwardVarargsParameters>( // --
+ IrOpcode::kJSConstructForwardVarargs, Operator::kNoProperties, // opcode
+ "JSConstructForwardVarargs", // name
+ parameters.arity(), 1, 1, 1, 1, 2, // counts
+ parameters); // parameter
+}
+
const Operator* JSOperatorBuilder::Construct(uint32_t arity,
CallFrequency frequency,
VectorSlotPair const& feedback) {
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698