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

Unified Diff: src/ast.h

Issue 633373003: Simplify AST ID generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 2 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 | « no previous file | src/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 506afa2d954ea83967ca8831bb8b29817c076a6f..1f227b90b11ff1d628f1a42a8029aa15245d8437 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -184,7 +184,7 @@ class AstNode: public ZoneObject {
// For generating IDs for AstNodes.
class IdGen {
public:
- explicit IdGen(int id = 0) : id_(id) {}
+ IdGen() : id_(BailoutId::FirstUsable().ToInt()) {}
int GetNextId() { return ReserveIdRange(1); }
int ReserveIdRange(int n) {
@@ -195,6 +195,8 @@ class AstNode: public ZoneObject {
private:
int id_;
+
+ DISALLOW_COPY_AND_ASSIGN(IdGen);
};
#define DECLARE_TYPE_ENUM(type) k##type,
« no previous file with comments | « no previous file | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698