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

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

Issue 1259203002: [turbofan] Implement tail calls with differing stack parameter counts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bugs in frameless tail calls Created 5 years, 4 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
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/runtime/runtime.h" 8 #include "src/runtime/runtime.h"
9 #include "src/unique.h" 9 #include "src/unique.h"
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 friend size_t hash_value(CallFunctionParameters const& p) { 81 friend size_t hash_value(CallFunctionParameters const& p) {
82 return base::hash_combine(p.bit_field_, p.feedback_); 82 return base::hash_combine(p.bit_field_, p.feedback_);
83 } 83 }
84 84
85 typedef BitField<size_t, 0, 28> ArityField; 85 typedef BitField<size_t, 0, 28> ArityField;
86 typedef BitField<CallFunctionFlags, 28, 2> FlagsField; 86 typedef BitField<CallFunctionFlags, 28, 2> FlagsField;
87 typedef BitField<LanguageMode, 30, 2> LanguageModeField; 87 typedef BitField<LanguageMode, 30, 2> LanguageModeField;
88 88
89 const uint32_t bit_field_; 89 const uint32_t bit_field_;
90 const VectorSlotPair feedback_; 90 const VectorSlotPair feedback_;
91 bool tail_call_mode_; 91 TailCallMode tail_call_mode_;
92 }; 92 };
93 93
94 size_t hash_value(CallFunctionParameters const&); 94 size_t hash_value(CallFunctionParameters const&);
95 95
96 std::ostream& operator<<(std::ostream&, CallFunctionParameters const&); 96 std::ostream& operator<<(std::ostream&, CallFunctionParameters const&);
97 97
98 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op); 98 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op);
99 99
100 100
101 // Defines the arity and the ID for a runtime function call. This is used as a 101 // Defines the arity and the ID for a runtime function call. This is used as a
102 // parameter by JSCallRuntime operators. 102 // parameter by JSCallRuntime operators.
103 class CallRuntimeParameters final { 103 class CallRuntimeParameters final {
104 public: 104 public:
105 CallRuntimeParameters(Runtime::FunctionId id, size_t arity) 105 CallRuntimeParameters(Runtime::FunctionId id, size_t arity, TailCallMode mode)
106 : id_(id), arity_(arity) {} 106 : id_(id), arity_(arity), mode_(mode) {}
107 107
108 Runtime::FunctionId id() const { return id_; } 108 Runtime::FunctionId id() const { return id_; }
109 size_t arity() const { return arity_; } 109 size_t arity() const { return arity_; }
110 TailCallMode mode() const { return mode_; }
110 111
111 private: 112 private:
112 const Runtime::FunctionId id_; 113 const Runtime::FunctionId id_;
113 const size_t arity_; 114 const size_t arity_;
115 const TailCallMode mode_;
114 }; 116 };
115 117
116 bool operator==(CallRuntimeParameters const&, CallRuntimeParameters const&); 118 bool operator==(CallRuntimeParameters const&, CallRuntimeParameters const&);
117 bool operator!=(CallRuntimeParameters const&, CallRuntimeParameters const&); 119 bool operator!=(CallRuntimeParameters const&, CallRuntimeParameters const&);
118 120
119 size_t hash_value(CallRuntimeParameters const&); 121 size_t hash_value(CallRuntimeParameters const&);
120 122
121 std::ostream& operator<<(std::ostream&, CallRuntimeParameters const&); 123 std::ostream& operator<<(std::ostream&, CallRuntimeParameters const&);
122 124
123 const CallRuntimeParameters& CallRuntimeParametersOf(const Operator* op); 125 const CallRuntimeParameters& CallRuntimeParametersOf(const Operator* op);
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 const Operator* Create(); 477 const Operator* Create();
476 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info, 478 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info,
477 PretenureFlag pretenure); 479 PretenureFlag pretenure);
478 const Operator* CreateLiteralArray(int literal_flags); 480 const Operator* CreateLiteralArray(int literal_flags);
479 const Operator* CreateLiteralObject(int literal_flags); 481 const Operator* CreateLiteralObject(int literal_flags);
480 482
481 const Operator* CallFunction( 483 const Operator* CallFunction(
482 size_t arity, CallFunctionFlags flags, LanguageMode language_mode, 484 size_t arity, CallFunctionFlags flags, LanguageMode language_mode,
483 VectorSlotPair const& feedback = VectorSlotPair(), 485 VectorSlotPair const& feedback = VectorSlotPair(),
484 TailCallMode tail_call_mode = NO_TAIL_CALLS); 486 TailCallMode tail_call_mode = NO_TAIL_CALLS);
485 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); 487 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity,
488 TailCallMode mode = ALLOW_TAIL_CALLS);
486 489
487 const Operator* CallConstruct(int arguments); 490 const Operator* CallConstruct(int arguments);
488 491
489 const Operator* LoadProperty(const VectorSlotPair& feedback, 492 const Operator* LoadProperty(const VectorSlotPair& feedback,
490 LanguageMode language_mode); 493 LanguageMode language_mode);
491 const Operator* LoadNamed(const Unique<Name>& name, 494 const Operator* LoadNamed(const Unique<Name>& name,
492 const VectorSlotPair& feedback, 495 const VectorSlotPair& feedback,
493 LanguageMode language_mode); 496 LanguageMode language_mode);
494 497
495 const Operator* StoreProperty(LanguageMode language_mode, 498 const Operator* StoreProperty(LanguageMode language_mode,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 Zone* const zone_; 550 Zone* const zone_;
548 551
549 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); 552 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
550 }; 553 };
551 554
552 } // namespace compiler 555 } // namespace compiler
553 } // namespace internal 556 } // namespace internal
554 } // namespace v8 557 } // namespace v8
555 558
556 #endif // V8_COMPILER_JS_OPERATOR_H_ 559 #endif // V8_COMPILER_JS_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698