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

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

Issue 1216933011: [turbofan] Enable tail calls for %_CallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix platform ports Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.h
diff --git a/src/compiler/js-operator.h b/src/compiler/js-operator.h
index 3a7d2ba9157957ec24a78e354e3693edd9404706..d70c8e2096186a4dc8577985d2cf74d4858a3851 100644
--- a/src/compiler/js-operator.h
+++ b/src/compiler/js-operator.h
@@ -45,6 +45,7 @@ bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
size_t hash_value(VectorSlotPair const&);
+enum TailCallMode { NO_TAIL_CALLS, ALLOW_TAIL_CALLS };
// Defines the arity and the call flags for a JavaScript function call. This is
// used as a parameter by JSCallFunction operators.
@@ -52,10 +53,12 @@ class CallFunctionParameters final {
public:
CallFunctionParameters(size_t arity, CallFunctionFlags flags,
LanguageMode language_mode,
- VectorSlotPair const& feedback)
+ VectorSlotPair const& feedback,
+ TailCallMode tail_call_mode)
: bit_field_(ArityField::encode(arity) | FlagsField::encode(flags) |
LanguageModeField::encode(language_mode)),
- feedback_(feedback) {}
+ feedback_(feedback),
+ tail_call_mode_(tail_call_mode) {}
size_t arity() const { return ArityField::decode(bit_field_); }
CallFunctionFlags flags() const { return FlagsField::decode(bit_field_); }
@@ -72,6 +75,8 @@ class CallFunctionParameters final {
return !(*this == that);
}
+ bool AllowTailCalls() const { return tail_call_mode_ == ALLOW_TAIL_CALLS; }
+
private:
friend size_t hash_value(CallFunctionParameters const& p) {
return base::hash_combine(p.bit_field_, p.feedback_);
@@ -83,6 +88,7 @@ class CallFunctionParameters final {
const uint32_t bit_field_;
const VectorSlotPair feedback_;
+ bool tail_call_mode_;
};
size_t hash_value(CallFunctionParameters const&);
@@ -415,7 +421,8 @@ class JSOperatorBuilder final : public ZoneObject {
const Operator* CallFunction(
size_t arity, CallFunctionFlags flags, LanguageMode language_mode,
- VectorSlotPair const& feedback = VectorSlotPair());
+ VectorSlotPair const& feedback = VectorSlotPair(),
+ TailCallMode tail_call_mode = NO_TAIL_CALLS);
const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
const Operator* CallConstruct(int arguments);
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698