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

Side by Side Diff: src/compiler/js-operator.h

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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_JS_OPERATOR_H_ 5 #ifndef V8_COMPILER_JS_OPERATOR_H_
6 #define V8_COMPILER_JS_OPERATOR_H_ 6 #define V8_COMPILER_JS_OPERATOR_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/runtime/runtime.h" 10 #include "src/runtime/runtime.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 float const frequency_; 152 float const frequency_;
153 VectorSlotPair const feedback_; 153 VectorSlotPair const feedback_;
154 }; 154 };
155 155
156 size_t hash_value(CallFunctionParameters const&); 156 size_t hash_value(CallFunctionParameters const&);
157 157
158 std::ostream& operator<<(std::ostream&, CallFunctionParameters const&); 158 std::ostream& operator<<(std::ostream&, CallFunctionParameters const&);
159 159
160 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op); 160 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op);
161 161
162 // Defines the arity for a JavaScript constructor call with a spread as the last
163 // parameters. This is used as a parameter by JSCallConstructWithSpread
164 // operators.
165 class CallFunctionWithSpreadParameters final {
166 public:
167 explicit CallFunctionWithSpreadParameters(uint32_t arity) : arity_(arity) {}
168
169 uint32_t arity() const { return arity_; }
170
171 private:
172 uint32_t const arity_;
173 };
174
175 bool operator==(CallFunctionWithSpreadParameters const&,
176 CallFunctionWithSpreadParameters const&);
177 bool operator!=(CallFunctionWithSpreadParameters const&,
178 CallFunctionWithSpreadParameters const&);
179
180 size_t hash_value(CallFunctionWithSpreadParameters const&);
181
182 std::ostream& operator<<(std::ostream&,
183 CallFunctionWithSpreadParameters const&);
184
185 CallFunctionWithSpreadParameters const& CallFunctionWithSpreadParametersOf(
186 Operator const*);
162 187
163 // Defines the arity and the ID for a runtime function call. This is used as a 188 // Defines the arity and the ID for a runtime function call. This is used as a
164 // parameter by JSCallRuntime operators. 189 // parameter by JSCallRuntime operators.
165 class CallRuntimeParameters final { 190 class CallRuntimeParameters final {
166 public: 191 public:
167 CallRuntimeParameters(Runtime::FunctionId id, size_t arity) 192 CallRuntimeParameters(Runtime::FunctionId id, size_t arity)
168 : id_(id), arity_(arity) {} 193 : id_(id), arity_(arity) {}
169 194
170 Runtime::FunctionId id() const { return id_; } 195 Runtime::FunctionId id() const { return id_; }
171 size_t arity() const { return arity_; } 196 size_t arity() const { return arity_; }
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 int literal_flags, int literal_index, 570 int literal_flags, int literal_index,
546 int number_of_properties); 571 int number_of_properties);
547 const Operator* CreateLiteralRegExp(Handle<String> constant_pattern, 572 const Operator* CreateLiteralRegExp(Handle<String> constant_pattern,
548 int literal_flags, int literal_index); 573 int literal_flags, int literal_index);
549 574
550 const Operator* CallFunction( 575 const Operator* CallFunction(
551 size_t arity, float frequency = 0.0f, 576 size_t arity, float frequency = 0.0f,
552 VectorSlotPair const& feedback = VectorSlotPair(), 577 VectorSlotPair const& feedback = VectorSlotPair(),
553 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, 578 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
554 TailCallMode tail_call_mode = TailCallMode::kDisallow); 579 TailCallMode tail_call_mode = TailCallMode::kDisallow);
580 const Operator* CallFunctionWithSpread(uint32_t arity);
555 const Operator* CallRuntime(Runtime::FunctionId id); 581 const Operator* CallRuntime(Runtime::FunctionId id);
556 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); 582 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
557 const Operator* CallRuntime(const Runtime::Function* function, size_t arity); 583 const Operator* CallRuntime(const Runtime::Function* function, size_t arity);
558 const Operator* CallConstruct(uint32_t arity, float frequency, 584 const Operator* CallConstruct(uint32_t arity, float frequency,
559 VectorSlotPair const& feedback); 585 VectorSlotPair const& feedback);
560 const Operator* CallConstructWithSpread(uint32_t arity); 586 const Operator* CallConstructWithSpread(uint32_t arity);
561 587
562 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode); 588 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode);
563 589
564 const Operator* LoadProperty(VectorSlotPair const& feedback); 590 const Operator* LoadProperty(VectorSlotPair const& feedback);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 Zone* const zone_; 651 Zone* const zone_;
626 652
627 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); 653 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
628 }; 654 };
629 655
630 } // namespace compiler 656 } // namespace compiler
631 } // namespace internal 657 } // namespace internal
632 } // namespace v8 658 } // namespace v8
633 659
634 #endif // V8_COMPILER_JS_OPERATOR_H_ 660 #endif // V8_COMPILER_JS_OPERATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698