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

Unified Diff: src/compiler/linkage.h

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/js-generic-lowering.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage.h
diff --git a/src/compiler/linkage.h b/src/compiler/linkage.h
index fa34adb7c2e0926f9579eecaac86a22efe2f76ff..aa680689d7ab7d9871740b2daab881f9e7710c12 100644
--- a/src/compiler/linkage.h
+++ b/src/compiler/linkage.h
@@ -27,11 +27,23 @@ class LinkageLocation {
public:
explicit LinkageLocation(int location) : location_(location) {}
+ bool is_register() const {
+ return 0 <= location_ && location_ <= ANY_REGISTER;
+ }
+
static const int16_t ANY_REGISTER = 1023;
static const int16_t MAX_STACK_SLOT = 32767;
static LinkageLocation AnyRegister() { return LinkageLocation(ANY_REGISTER); }
+ bool operator==(const LinkageLocation& other) const {
+ return location_ == other.location_;
+ }
+
+ bool operator!=(const LinkageLocation& other) const {
+ return !(*this == other);
+ }
+
private:
friend class CallDescriptor;
friend class OperandGenerator;
@@ -61,6 +73,7 @@ class CallDescriptor final : public ZoneObject {
kPatchableCallSite = 1u << 1,
kNeedsNopAfterCall = 1u << 2,
kHasExceptionHandler = 1u << 3,
+ kSupportsTailCalls = 1u << 4,
kPatchableCallSiteWithNop = kPatchableCallSite | kNeedsNopAfterCall
};
typedef base::Flags<Flag> Flags;
@@ -108,6 +121,7 @@ class CallDescriptor final : public ZoneObject {
Flags flags() const { return flags_; }
bool NeedsFrameState() const { return flags() & kNeedsFrameState; }
+ bool SupportsTailCalls() const { return flags() & kSupportsTailCalls; }
LinkageLocation GetReturnLocation(size_t index) const {
return location_sig_->GetReturn(index);
@@ -137,6 +151,10 @@ class CallDescriptor final : public ZoneObject {
const char* debug_name() const { return debug_name_; }
+ bool UsesOnlyRegisters() const;
+
+ bool HasSameReturnLocationsAs(const CallDescriptor* other) const;
+
private:
friend class Linkage;
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698