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

Unified Diff: src/ast.cc

Issue 569573002: Remove redundant ids from AST (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Cleaner structure for reserving ids in AST Created 6 years, 3 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/ast.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index ab9050daa0eee24e0e78d021e7e46c9b6b062b7f..7e591e496daa0aa71fd59cdc9d5eeeb4e3329b37 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -105,9 +105,14 @@ Assignment::Assignment(Zone* zone, Token::Value op, Expression* target,
target_(target),
value_(value),
binary_operation_(NULL),
- assignment_id_(id_gen->GetNextId()),
is_uninitialized_(false),
- store_mode_(STANDARD_STORE) {}
+ store_mode_(STANDARD_STORE) {
+#ifdef DEBUG
+ int assignment_id =
+#endif
+ id_gen->ReserveIdRange(kClassIdRange); // reserve assignment id
+ DCHECK(assignment_id == AssignmentId().ToInt());
+ }
Token::Value Assignment::binary_op() const {
@@ -992,10 +997,13 @@ CaseClause::CaseClause(Zone* zone, Expression* label,
: Expression(zone, pos, id_gen),
label_(label),
statements_(statements),
- compare_type_(Type::None(zone)),
- compare_id_(id_gen->GetNextId()),
- entry_id_(id_gen->GetNextId()) {}
-
+ compare_type_(Type::None(zone)) {
+#ifdef DEBUG
+ int compare_id =
+#endif
+ id_gen->ReserveIdRange(kClassIdRange);
+ DCHECK(compare_id == CompareId().ToInt());
+ }
#define REGULAR_NODE(NodeType) \
void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
« no previous file with comments | « src/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698