Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 17d64f2fe87397646383b24a9d80a332f8560d57..bbf75392e7f3b4a720b1951ea7807ed31f9c81fd 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -1933,7 +1933,7 @@ Statement* Parser::ParseSubStatement(ZoneList<const AstRawString*>* labels, |
factory()->NewBlock(labels, 1, false, RelocInfo::kNoPosition); |
Target target(&this->target_stack_, result); |
Statement* statement = ParseStatementAsUnlabelled(labels, CHECK_OK); |
- if (result) result->AddStatement(statement, zone()); |
+ if (result) result->statements()->Add(statement, zone()); |
adamk
2015/10/05 17:39:28
Looks like these were all changed in this patch (f
|
return result; |
} |
} |
@@ -2361,7 +2361,7 @@ Block* Parser::ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok) { |
while (peek() != Token::RBRACE) { |
Statement* stat = ParseStatement(NULL, CHECK_OK); |
if (stat && !stat->IsEmpty()) { |
- result->AddStatement(stat, zone()); |
+ result->statements()->Add(stat, zone()); |
} |
} |
Expect(Token::RBRACE, CHECK_OK); |
@@ -2390,7 +2390,7 @@ Block* Parser::ParseScopedBlock(ZoneList<const AstRawString*>* labels, |
while (peek() != Token::RBRACE) { |
Statement* stat = ParseStatementListItem(CHECK_OK); |
if (stat && !stat->IsEmpty()) { |
- body->AddStatement(stat, zone()); |
+ body->statements()->Add(stat, zone()); |
} |
} |
} |
@@ -3029,12 +3029,12 @@ Statement* Parser::ParseSwitchStatement(ZoneList<const AstRawString*>* labels, |
tag->position()); |
Statement* tag_statement = |
factory()->NewExpressionStatement(tag_assign, RelocInfo::kNoPosition); |
- switch_block->AddStatement(tag_statement, zone()); |
+ switch_block->statements()->Add(tag_statement, zone()); |
// make statement: undefined; |
// This is needed so the tag isn't returned as the value, in case the switch |
// statements don't have a value. |
- switch_block->AddStatement( |
+ switch_block->statements()->Add( |
factory()->NewExpressionStatement( |
factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), |
RelocInfo::kNoPosition), |
@@ -3064,7 +3064,7 @@ Statement* Parser::ParseSwitchStatement(ZoneList<const AstRawString*>* labels, |
cases->Add(clause, zone()); |
} |
switch_statement->Initialize(tag_read, cases); |
- cases_block->AddStatement(switch_statement, zone()); |
+ cases_block->statements()->Add(switch_statement, zone()); |
} |
Expect(Token::RBRACE, CHECK_OK); |
@@ -3072,7 +3072,7 @@ Statement* Parser::ParseSwitchStatement(ZoneList<const AstRawString*>* labels, |
cases_scope = cases_scope->FinalizeBlockScope(); |
cases_block->set_scope(cases_scope); |
- switch_block->AddStatement(cases_block, zone()); |
+ switch_block->statements()->Add(cases_block, zone()); |
return switch_block; |
} |
@@ -3163,7 +3163,7 @@ TryStatement* Parser::ParseTryStatement(bool* ok) { |
factory()->NewTryCatchStatement(try_block, catch_scope, catch_variable, |
catch_block, RelocInfo::kNoPosition); |
try_block = factory()->NewBlock(NULL, 1, false, RelocInfo::kNoPosition); |
- try_block->AddStatement(statement, zone()); |
+ try_block->statements()->Add(statement, zone()); |
catch_block = NULL; // Clear to indicate it's been handled. |
} |
@@ -3384,7 +3384,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
RelocInfo::kNoPosition); |
// Add statement: let/const x = i. |
- outer_block->AddStatement(init, zone()); |
+ outer_block->statements()->Add(init, zone()); |
const AstRawString* temp_name = ast_value_factory()->dot_for_string(); |
@@ -3398,7 +3398,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
Token::ASSIGN, temp_proxy, proxy, RelocInfo::kNoPosition); |
Statement* assignment_statement = factory()->NewExpressionStatement( |
assignment, RelocInfo::kNoPosition); |
- outer_block->AddStatement(assignment_statement, zone()); |
+ outer_block->statements()->Add(assignment_statement, zone()); |
temps.Add(temp, zone()); |
} |
@@ -3412,11 +3412,11 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
Token::ASSIGN, first_proxy, const1, RelocInfo::kNoPosition); |
Statement* assignment_statement = |
factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition); |
- outer_block->AddStatement(assignment_statement, zone()); |
+ outer_block->statements()->Add(assignment_statement, zone()); |
} |
// make statement: undefined; |
- outer_block->AddStatement( |
+ outer_block->statements()->Add( |
factory()->NewExpressionStatement( |
factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), |
RelocInfo::kNoPosition), |
@@ -3429,7 +3429,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
// in this function that looks up break targets. |
ForStatement* outer_loop = |
factory()->NewForStatement(NULL, RelocInfo::kNoPosition); |
- outer_block->AddStatement(outer_loop, zone()); |
+ outer_block->statements()->Add(outer_loop, zone()); |
outer_block->set_scope(for_scope); |
scope_ = inner_scope; |
@@ -3456,7 +3456,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition); |
DCHECK(init->position() != RelocInfo::kNoPosition); |
proxy->var()->set_initializer_position(init->position()); |
- ignore_completion_block->AddStatement(assignment_statement, zone()); |
+ ignore_completion_block->statements()->Add(assignment_statement, zone()); |
} |
// Make statement: if (first == 1) { first = 0; } else { next; } |
@@ -3482,7 +3482,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
} |
Statement* clear_first_or_next = factory()->NewIfStatement( |
compare, clear_first, next, RelocInfo::kNoPosition); |
- ignore_completion_block->AddStatement(clear_first_or_next, zone()); |
+ ignore_completion_block->statements()->Add(clear_first_or_next, zone()); |
} |
Variable* flag = scope_->NewTemporary(temp_name); |
@@ -3494,9 +3494,9 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
Token::ASSIGN, flag_proxy, const1, RelocInfo::kNoPosition); |
Statement* assignment_statement = |
factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition); |
- ignore_completion_block->AddStatement(assignment_statement, zone()); |
+ ignore_completion_block->statements()->Add(assignment_statement, zone()); |
} |
- inner_block->AddStatement(ignore_completion_block, zone()); |
+ inner_block->statements()->Add(ignore_completion_block, zone()); |
// Make cond expression for main loop: flag == 1. |
Expression* flag_cond = NULL; |
{ |
@@ -3548,7 +3548,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
// and ensures that any break or continue statements in body point to |
// the right place. |
loop->Initialize(NULL, flag_cond, compound_next_statement, body_or_stop); |
- inner_block->AddStatement(loop, zone()); |
+ inner_block->statements()->Add(loop, zone()); |
// Make statement: if (flag == 1) { break; } |
{ |
@@ -3565,7 +3565,7 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
Statement* empty = factory()->NewEmptyStatement(RelocInfo::kNoPosition); |
Statement* if_flag_break = |
factory()->NewIfStatement(compare, stop, empty, RelocInfo::kNoPosition); |
- inner_block->AddStatement(if_flag_break, zone()); |
+ inner_block->statements()->Add(if_flag_break, zone()); |
} |
inner_scope->set_end_position(scanner()->location().end_pos); |
@@ -3646,7 +3646,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, |
each_beg_pos, each_end_pos); |
init_block = factory()->NewBlock( |
nullptr, 2, true, parsing_result.descriptor.declaration_pos); |
- init_block->AddStatement( |
+ init_block->statements()->Add( |
factory()->NewExpressionStatement( |
factory()->NewAssignment( |
Token::ASSIGN, single_var, |
@@ -3709,8 +3709,8 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, |
CHECK_OK); |
} |
- body_block->AddStatement(each_initialization_block, zone()); |
- body_block->AddStatement(body, zone()); |
+ body_block->statements()->Add(each_initialization_block, zone()); |
+ body_block->statements()->Add(body, zone()); |
VariableProxy* temp_proxy = |
factory()->NewVariableProxy(temp, each_beg_pos, each_end_pos); |
InitializeForEachStatement(loop, temp_proxy, enumerable, body_block); |
@@ -3746,7 +3746,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, |
for_scope = for_scope->FinalizeBlockScope(); |
// Parsed for-in loop w/ variable declarations. |
if (init_block != nullptr) { |
- init_block->AddStatement(loop, zone()); |
+ init_block->statements()->Add(loop, zone()); |
if (for_scope != nullptr) { |
init_block->set_scope(for_scope); |
} |
@@ -3864,8 +3864,8 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, |
DCHECK(init != NULL); |
Block* block = |
factory()->NewBlock(NULL, 2, false, RelocInfo::kNoPosition); |
- block->AddStatement(init, zone()); |
- block->AddStatement(loop, zone()); |
+ block->statements()->Add(init, zone()); |
+ block->statements()->Add(loop, zone()); |
block->set_scope(for_scope); |
loop->Initialize(NULL, cond, next, body); |
result = block; |
@@ -4544,11 +4544,11 @@ Block* Parser::BuildParameterInitializationBlock( |
loop->Initialize(init, cond, next, body); |
- init_block->AddStatement( |
+ init_block->statements()->Add( |
factory()->NewExpressionStatement(init_array, RelocInfo::kNoPosition), |
zone()); |
- init_block->AddStatement(loop, zone()); |
+ init_block->statements()->Add(loop, zone()); |
descriptor.initialization_pos = pos; |
} |
@@ -4579,7 +4579,7 @@ Block* Parser::BuildParameterInitializationBlock( |
if (param_scope != nullptr) { |
CheckConflictingVarDeclarations(param_scope, CHECK_OK); |
} |
- init_block->AddStatement(param_block, zone()); |
+ init_block->statements()->Add(param_block, zone()); |
} |
} |
return init_block; |