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

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: Fixed index type 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
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/linkage-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 29d4388857fdf781f8b614c9f32a37adca859b19..0288f1a357181f8eadec6dbbd4cb03d1f49350ea 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -34,7 +34,17 @@ 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.SupportsTailCalls();
+}
+
+
+bool CallDescriptor::HasSameReturnLocationsAs(
+ const CallDescriptor* other) const {
+ if (ReturnCount() != other->ReturnCount()) return false;
+ for (size_t i = 0; i < ReturnCount(); ++i) {
+ if (GetReturnLocation(i) != other->GetReturnLocation(i)) return false;
+ }
+ return true;
}
@@ -141,6 +151,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.
//==============================================================================
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/linkage-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698