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

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

Issue 2946893004: [WIP] Start adding JSCallWithVarargs
Patch Set: REBASE Created 3 years, 6 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/handles.h" 10 #include "src/handles.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 typedef BitField<TailCallMode, 30, 1> TailCallModeField; 211 typedef BitField<TailCallMode, 30, 1> TailCallModeField;
212 212
213 uint32_t const bit_field_; 213 uint32_t const bit_field_;
214 }; 214 };
215 215
216 std::ostream& operator<<(std::ostream&, CallForwardVarargsParameters const&); 216 std::ostream& operator<<(std::ostream&, CallForwardVarargsParameters const&);
217 217
218 CallForwardVarargsParameters const& CallForwardVarargsParametersOf( 218 CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
219 Operator const*) WARN_UNUSED_RESULT; 219 Operator const*) WARN_UNUSED_RESULT;
220 220
221 // Defines the flags for a JavaScript call forwarding parameters. This
222 // is used as parameter by JSCallVarargs operators.
223 class CallVarargsParameters final {
224 public:
225 explicit CallVarargsParameters(size_t arity) : arity_(arity) {}
226
227 size_t arity() const { return arity_; }
228
229 bool operator==(CallVarargsParameters const& that) const {
230 return this->arity_ == that.arity_;
231 }
232 bool operator!=(CallVarargsParameters const& that) const {
233 return !(*this == that);
234 }
235
236 private:
237 friend size_t hash_value(CallVarargsParameters const& p) {
238 return p.arity_;
239 }
240
241 const size_t arity_;
242 };
243
244 std::ostream& operator<<(std::ostream&, CallVarargsParameters const&);
245
246 CallVarargsParameters const& CallVarargsParametersOf(Operator const*)
247 WARN_UNUSED_RESULT;
248
221 // Defines the arity and the call flags for a JavaScript function call. This is 249 // Defines the arity and the call flags for a JavaScript function call. This is
222 // used as a parameter by JSCall operators. 250 // used as a parameter by JSCall operators.
223 class CallParameters final { 251 class CallParameters final {
224 public: 252 public:
225 CallParameters(size_t arity, CallFrequency frequency, 253 CallParameters(size_t arity, CallFrequency frequency,
226 VectorSlotPair const& feedback, TailCallMode tail_call_mode, 254 VectorSlotPair const& feedback, TailCallMode tail_call_mode,
227 ConvertReceiverMode convert_mode) 255 ConvertReceiverMode convert_mode)
228 : bit_field_(ArityField::encode(arity) | 256 : bit_field_(ArityField::encode(arity) |
229 ConvertReceiverModeField::encode(convert_mode) | 257 ConvertReceiverModeField::encode(convert_mode) |
230 TailCallModeField::encode(tail_call_mode)), 258 TailCallModeField::encode(tail_call_mode)),
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 const Operator* CreateKeyValueArray(); 747 const Operator* CreateKeyValueArray();
720 const Operator* CreateLiteralArray(Handle<ConstantElementsPair> constant, 748 const Operator* CreateLiteralArray(Handle<ConstantElementsPair> constant,
721 int literal_flags, int literal_index, 749 int literal_flags, int literal_index,
722 int number_of_elements); 750 int number_of_elements);
723 const Operator* CreateLiteralObject(Handle<BoilerplateDescription> constant, 751 const Operator* CreateLiteralObject(Handle<BoilerplateDescription> constant,
724 int literal_flags, int literal_index, 752 int literal_flags, int literal_index,
725 int number_of_properties); 753 int number_of_properties);
726 const Operator* CreateLiteralRegExp(Handle<String> constant_pattern, 754 const Operator* CreateLiteralRegExp(Handle<String> constant_pattern,
727 int literal_flags, int literal_index); 755 int literal_flags, int literal_index);
728 756
729 const Operator* CallForwardVarargs(size_t arity, uint32_t start_index,
730 TailCallMode tail_call_mode);
731 const Operator* Call( 757 const Operator* Call(
732 size_t arity, CallFrequency frequency = CallFrequency(), 758 size_t arity, CallFrequency frequency = CallFrequency(),
733 VectorSlotPair const& feedback = VectorSlotPair(), 759 VectorSlotPair const& feedback = VectorSlotPair(),
734 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, 760 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
735 TailCallMode tail_call_mode = TailCallMode::kDisallow); 761 TailCallMode tail_call_mode = TailCallMode::kDisallow);
762 const Operator* CallForwardVarargs(size_t arity, uint32_t start_index,
763 TailCallMode tail_call_mode);
764 const Operator* CallVarargs(size_t arity);
736 const Operator* CallWithArrayLike(CallFrequency frequency); 765 const Operator* CallWithArrayLike(CallFrequency frequency);
737 const Operator* CallWithSpread(uint32_t arity); 766 const Operator* CallWithSpread(uint32_t arity);
738 const Operator* CallRuntime(Runtime::FunctionId id); 767 const Operator* CallRuntime(Runtime::FunctionId id);
739 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); 768 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
740 const Operator* CallRuntime(const Runtime::Function* function, size_t arity); 769 const Operator* CallRuntime(const Runtime::Function* function, size_t arity);
741 770
742 const Operator* ConstructForwardVarargs(size_t arity, uint32_t start_index); 771 const Operator* ConstructForwardVarargs(size_t arity, uint32_t start_index);
743 const Operator* Construct(uint32_t arity, 772 const Operator* Construct(uint32_t arity,
744 CallFrequency frequency = CallFrequency(), 773 CallFrequency frequency = CallFrequency(),
745 VectorSlotPair const& feedback = VectorSlotPair()); 774 VectorSlotPair const& feedback = VectorSlotPair());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 Zone* const zone_; 851 Zone* const zone_;
823 852
824 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); 853 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
825 }; 854 };
826 855
827 } // namespace compiler 856 } // namespace compiler
828 } // namespace internal 857 } // namespace internal
829 } // namespace v8 858 } // namespace v8
830 859
831 #endif // V8_COMPILER_JS_OPERATOR_H_ 860 #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