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

Side by Side Diff: src/ast-numbering.cc

Issue 1399893002: [es7] implement |do| expressions proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Less code duplication in Rewriter Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast-numbering.h" 5 #include "src/ast-numbering.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/scopes.h" 8 #include "src/scopes.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 128
129 void AstNumberingVisitor::VisitNativeFunctionLiteral( 129 void AstNumberingVisitor::VisitNativeFunctionLiteral(
130 NativeFunctionLiteral* node) { 130 NativeFunctionLiteral* node) {
131 IncrementNodeCount(); 131 IncrementNodeCount();
132 DisableOptimization(kNativeFunctionLiteral); 132 DisableOptimization(kNativeFunctionLiteral);
133 node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); 133 node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids()));
134 } 134 }
135 135
136 136
137 void AstNumberingVisitor::VisitDoExpression(DoExpression* node) {
138 IncrementNodeCount();
139 node->set_base_id(ReserveIdRange(DoExpression::num_ids()));
140 Visit(node->block());
141 Visit(node->result());
142 }
143
144
137 void AstNumberingVisitor::VisitLiteral(Literal* node) { 145 void AstNumberingVisitor::VisitLiteral(Literal* node) {
138 IncrementNodeCount(); 146 IncrementNodeCount();
139 node->set_base_id(ReserveIdRange(Literal::num_ids())); 147 node->set_base_id(ReserveIdRange(Literal::num_ids()));
140 } 148 }
141 149
142 150
143 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { 151 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) {
144 IncrementNodeCount(); 152 IncrementNodeCount();
145 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); 153 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids()));
146 } 154 }
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 } 580 }
573 581
574 582
575 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, 583 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
576 FunctionLiteral* function) { 584 FunctionLiteral* function) {
577 AstNumberingVisitor visitor(isolate, zone); 585 AstNumberingVisitor visitor(isolate, zone);
578 return visitor.Renumber(function); 586 return visitor.Renumber(function);
579 } 587 }
580 } // namespace internal 588 } // namespace internal
581 } // namespace v8 589 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698