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

Unified Diff: src/ast.h

Issue 5699002: RFC: Switch to ast ids (instead of positions) for type feedback. (Closed)
Patch Set: Cleanup Created 10 years 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/ast.h
diff --git a/src/ast.h b/src/ast.h
index cdf456f67b6e5e2b66cdee56b3a9c19b50a3deed..4f5980cbc6ed3f2f16a9d9c88052faf5751a6730 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -133,8 +133,6 @@ class AstNode: public ZoneObject {
};
#undef DECLARE_TYPE_ENUM
- static const int kNoNumber = -1;
-
AstNode() : id_(GetNextId()) { count_++; }
virtual ~AstNode() { }
@@ -161,20 +159,20 @@ class AstNode: public ZoneObject {
static int Count() { return count_; }
static void ResetIds() { current_id_ = 0; }
- unsigned id() const { return id_; }
+ AstId id() const { return id_; }
protected:
- static unsigned GetNextId() { return current_id_++; }
- static unsigned ReserveIdRange(int n) {
- unsigned tmp = current_id_;
+ static AstId GetNextId() { return current_id_++; }
+ static AstId ReserveIdRange(int n) {
+ AstId tmp = current_id_;
current_id_ += n;
return tmp;
}
private:
- static unsigned current_id_;
- static unsigned count_;
- unsigned id_;
+ static AstId current_id_;
+ static AstId count_;
+ AstId id_;
};
@@ -438,7 +436,7 @@ class IterationStatement: public BreakableStatement {
void set_body(Statement* stmt) { body_ = stmt; }
// Bailout support.
- int OsrEntryId() const { return osr_entry_id_; }
+ AstId OsrEntryId() const { return osr_entry_id_; }
virtual int ContinueId() const = 0;
// Code generation
@@ -454,7 +452,7 @@ class IterationStatement: public BreakableStatement {
private:
Statement* body_;
BreakTarget continue_target_;
- int osr_entry_id_;
+ AstId osr_entry_id_;
};
@@ -1585,7 +1583,7 @@ class Assignment: public Expression {
}
// Bailout support.
- int compound_bailout_id() const { return compound_bailout_id_; }
+ AstId compound_bailout_id() const { return compound_bailout_id_; }
private:
Token::Value op_;
@@ -1593,7 +1591,7 @@ class Assignment: public Expression {
Expression* value_;
int pos_;
BinaryOperation* binary_operation_;
- int compound_bailout_id_;
+ AstId compound_bailout_id_;
bool block_start_;
bool block_end_;

Powered by Google App Engine
This is Rietveld 408576698