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

Side by Side Diff: src/ast.h

Issue 1375203004: Fix completion of try..finally. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | src/rewriter.cc » ('j') | src/rewriter.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/ast-value-factory.h" 9 #include "src/ast-value-factory.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 456
457 class Block final : public BreakableStatement { 457 class Block final : public BreakableStatement {
458 public: 458 public:
459 DECLARE_NODE_TYPE(Block) 459 DECLARE_NODE_TYPE(Block)
460 460
461 void AddStatement(Statement* statement, Zone* zone) { 461 void AddStatement(Statement* statement, Zone* zone) {
462 statements_.Add(statement, zone); 462 statements_.Add(statement, zone);
463 } 463 }
464 464
465 void InsertStatementAt(int index, Statement* statement, Zone* zone) {
rossberg 2015/10/01 09:59:24 Instead of adding yet another redundant helper, ca
neis 2015/10/01 10:56:48 Done.
466 statements_.InsertAt(index, statement, zone);
467 }
468
465 ZoneList<Statement*>* statements() { return &statements_; } 469 ZoneList<Statement*>* statements() { return &statements_; }
466 bool ignore_completion_value() const { return ignore_completion_value_; } 470 bool ignore_completion_value() const { return ignore_completion_value_; }
467 471
468 static int num_ids() { return parent_num_ids() + 1; } 472 static int num_ids() { return parent_num_ids() + 1; }
469 BailoutId DeclsId() const { return BailoutId(local_id(0)); } 473 BailoutId DeclsId() const { return BailoutId(local_id(0)); }
470 474
471 bool IsJump() const override { 475 bool IsJump() const override {
472 return !statements_.is_empty() && statements_.last()->IsJump() 476 return !statements_.is_empty() && statements_.last()->IsJump()
473 && labels() == NULL; // Good enough as an approximation... 477 && labels() == NULL; // Good enough as an approximation...
474 } 478 }
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
3198 // ---------------------------------------------------------------------------- 3202 // ----------------------------------------------------------------------------
3199 // AstNode factory 3203 // AstNode factory
3200 3204
3201 class AstNodeFactory final BASE_EMBEDDED { 3205 class AstNodeFactory final BASE_EMBEDDED {
3202 public: 3206 public:
3203 explicit AstNodeFactory(AstValueFactory* ast_value_factory) 3207 explicit AstNodeFactory(AstValueFactory* ast_value_factory)
3204 : local_zone_(ast_value_factory->zone()), 3208 : local_zone_(ast_value_factory->zone()),
3205 parser_zone_(ast_value_factory->zone()), 3209 parser_zone_(ast_value_factory->zone()),
3206 ast_value_factory_(ast_value_factory) {} 3210 ast_value_factory_(ast_value_factory) {}
3207 3211
3212 AstValueFactory* ast_value_factory() const { return ast_value_factory_; }
3213
3208 VariableDeclaration* NewVariableDeclaration( 3214 VariableDeclaration* NewVariableDeclaration(
3209 VariableProxy* proxy, VariableMode mode, Scope* scope, int pos, 3215 VariableProxy* proxy, VariableMode mode, Scope* scope, int pos,
3210 bool is_class_declaration = false, int declaration_group_start = -1) { 3216 bool is_class_declaration = false, int declaration_group_start = -1) {
3211 return new (parser_zone_) 3217 return new (parser_zone_)
3212 VariableDeclaration(parser_zone_, proxy, mode, scope, pos, 3218 VariableDeclaration(parser_zone_, proxy, mode, scope, pos,
3213 is_class_declaration, declaration_group_start); 3219 is_class_declaration, declaration_group_start);
3214 } 3220 }
3215 3221
3216 FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy, 3222 FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
3217 VariableMode mode, 3223 VariableMode mode,
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 // the parser-level zone. 3633 // the parser-level zone.
3628 Zone* parser_zone_; 3634 Zone* parser_zone_;
3629 AstValueFactory* ast_value_factory_; 3635 AstValueFactory* ast_value_factory_;
3630 }; 3636 };
3631 3637
3632 3638
3633 } // namespace internal 3639 } // namespace internal
3634 } // namespace v8 3640 } // namespace v8
3635 3641
3636 #endif // V8_AST_H_ 3642 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/rewriter.cc » ('j') | src/rewriter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698