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

Unified Diff: src/parser.cc

Issue 713813002: Revert "Fix stepping in for-loops." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/mips64/full-codegen-mips64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 99448169cbf74d7003d64595ad306320222d6022..e34854fe7adacd564655429abd05a62caa2d4b20 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2939,7 +2939,7 @@ void Parser::InitializeForEachStatement(ForEachStatement* stmt,
// var iterator = subject[Symbol.iterator]();
assign_iterator = factory()->NewAssignment(
Token::ASSIGN, factory()->NewVariableProxy(iterator),
- GetIterator(subject, factory()), subject->position());
+ GetIterator(subject, factory()), RelocInfo::kNoPosition);
// var result = iterator.next();
{
@@ -2950,11 +2950,11 @@ void Parser::InitializeForEachStatement(ForEachStatement* stmt,
iterator_proxy, next_literal, RelocInfo::kNoPosition);
ZoneList<Expression*>* next_arguments =
new(zone()) ZoneList<Expression*>(0, zone());
- Expression* next_call = factory()->NewCall(next_property, next_arguments,
- subject->position());
+ Expression* next_call = factory()->NewCall(
+ next_property, next_arguments, RelocInfo::kNoPosition);
Expression* result_proxy = factory()->NewVariableProxy(result);
- next_result = factory()->NewAssignment(Token::ASSIGN, result_proxy,
- next_call, subject->position());
+ next_result = factory()->NewAssignment(
+ Token::ASSIGN, result_proxy, next_call, RelocInfo::kNoPosition);
}
// result.done
@@ -2973,8 +2973,8 @@ void Parser::InitializeForEachStatement(ForEachStatement* stmt,
Expression* result_proxy = factory()->NewVariableProxy(result);
Expression* result_value = factory()->NewProperty(
result_proxy, value_literal, RelocInfo::kNoPosition);
- assign_each = factory()->NewAssignment(Token::ASSIGN, each, result_value,
- each->position());
+ assign_each = factory()->NewAssignment(
+ Token::ASSIGN, each, result_value, RelocInfo::kNoPosition);
}
for_of->Initialize(each, subject, body,
@@ -3152,7 +3152,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
// ForStatement ::
// 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement
- int stmt_pos = peek_position();
+ int pos = peek_position();
Statement* init = NULL;
ZoneList<const AstRawString*> let_bindings(1, zone());
@@ -3175,20 +3175,19 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
CHECK_OK);
bool accept_OF = decl_props == kHasNoInitializers;
ForEachStatement::VisitMode mode;
- int each_pos = position();
if (name != NULL && CheckInOrOf(accept_OF, &mode)) {
Interface* interface =
is_const ? Interface::NewConst() : Interface::NewValue();
ForEachStatement* loop =
- factory()->NewForEachStatement(mode, labels, stmt_pos);
+ factory()->NewForEachStatement(mode, labels, pos);
Target target(&this->target_stack_, loop);
Expression* enumerable = ParseExpression(true, CHECK_OK);
Expect(Token::RPAREN, CHECK_OK);
VariableProxy* each =
- scope_->NewUnresolved(factory(), name, interface, each_pos);
+ scope_->NewUnresolved(factory(), name, interface);
Statement* body = ParseStatement(NULL, CHECK_OK);
InitializeForEachStatement(loop, each, enumerable, body);
Block* result =
@@ -3215,7 +3214,6 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
bool accept_IN = name != NULL && decl_props != kHasInitializers;
bool accept_OF = decl_props == kHasNoInitializers;
ForEachStatement::VisitMode mode;
- int each_pos = position();
if (accept_IN && CheckInOrOf(accept_OF, &mode)) {
// Rewrite a for-in statement of the form
@@ -3237,7 +3235,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
ast_value_factory()->dot_for_string());
VariableProxy* temp_proxy = factory()->NewVariableProxy(temp);
ForEachStatement* loop =
- factory()->NewForEachStatement(mode, labels, stmt_pos);
+ factory()->NewForEachStatement(mode, labels, pos);
Target target(&this->target_stack_, loop);
// The expression does not see the loop variable.
@@ -3246,8 +3244,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
scope_ = for_scope;
Expect(Token::RPAREN, CHECK_OK);
- VariableProxy* each = scope_->NewUnresolved(
- factory(), name, Interface::NewValue(), each_pos);
+ VariableProxy* each = scope_->NewUnresolved(factory(), name);
Statement* body = ParseStatement(NULL, CHECK_OK);
Block* body_block =
factory()->NewBlock(NULL, 3, false, RelocInfo::kNoPosition);
@@ -3281,7 +3278,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
expression, lhs_location, "invalid_lhs_in_for", CHECK_OK);
ForEachStatement* loop =
- factory()->NewForEachStatement(mode, labels, stmt_pos);
+ factory()->NewForEachStatement(mode, labels, pos);
Target target(&this->target_stack_, loop);
Expression* enumerable = ParseExpression(true, CHECK_OK);
@@ -3297,13 +3294,14 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
return loop;
} else {
- init = factory()->NewExpressionStatement(expression, position());
+ init = factory()->NewExpressionStatement(
+ expression, RelocInfo::kNoPosition);
}
}
}
// Standard 'for' loop
- ForStatement* loop = factory()->NewForStatement(labels, stmt_pos);
+ ForStatement* loop = factory()->NewForStatement(labels, pos);
Target target(&this->target_stack_, loop);
// Parsed initializer at this point.
@@ -3326,9 +3324,8 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
Statement* next = NULL;
if (peek() != Token::RPAREN) {
- int next_pos = position();
Expression* exp = ParseExpression(true, CHECK_OK);
- next = factory()->NewExpressionStatement(exp, next_pos);
+ next = factory()->NewExpressionStatement(exp, RelocInfo::kNoPosition);
}
Expect(Token::RPAREN, CHECK_OK);
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698