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

Unified Diff: src/compiler/linkage.cc

Issue 1108563002: Detect simple tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle callers with args Created 5 years, 8 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
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 29d4388857fdf781f8b614c9f32a37adca859b19..f117f9f076d298bd16d51c48c89e7f7298b89ba3 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -34,7 +34,7 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) {
// TODO(svenpanne) Output properties etc. and be less cryptic.
return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount()
<< "j" << d.JSParameterCount() << "i" << d.InputCount() << "f"
- << d.FrameStateCount();
+ << d.FrameStateCount() << "t" << d.IsTailCallAllowed();
}
@@ -141,6 +141,17 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
}
+bool CallDescriptor::UsesOnlyRegisters() const {
+ for (size_t i = 0; i < InputCount(); ++i) {
+ if (!GetInputLocation(i).is_register()) return false;
+ }
+ for (size_t i = 0; i < ReturnCount(); ++i) {
+ if (!GetReturnLocation(i).is_register()) return false;
+ }
+ return true;
+}
+
+
//==============================================================================
// Provide unimplemented methods on unsupported architectures, to at least link.
//==============================================================================

Powered by Google App Engine
This is Rietveld 408576698