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

Side by Side Diff: src/parser.cc

Issue 13408005: Force context allocation for variables in generator scopes. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 8 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4374 matching lines...) Expand 10 before | Expand all | Expand 10 after
4385 FunctionLiteral::IsParenthesizedFlag parenthesized = parenthesized_function_ 4385 FunctionLiteral::IsParenthesizedFlag parenthesized = parenthesized_function_
4386 ? FunctionLiteral::kIsParenthesized 4386 ? FunctionLiteral::kIsParenthesized
4387 : FunctionLiteral::kNotParenthesized; 4387 : FunctionLiteral::kNotParenthesized;
4388 FunctionLiteral::IsGeneratorFlag generator = is_generator 4388 FunctionLiteral::IsGeneratorFlag generator = is_generator
4389 ? FunctionLiteral::kIsGenerator 4389 ? FunctionLiteral::kIsGenerator
4390 : FunctionLiteral::kNotGenerator; 4390 : FunctionLiteral::kNotGenerator;
4391 AstProperties ast_properties; 4391 AstProperties ast_properties;
4392 // Parse function body. 4392 // Parse function body.
4393 { FunctionState function_state(this, scope, is_generator, isolate()); 4393 { FunctionState function_state(this, scope, is_generator, isolate());
4394 top_scope_->SetScopeName(function_name); 4394 top_scope_->SetScopeName(function_name);
4395 if (is_generator)
Michael Starzinger 2013/04/05 11:38:42 style: Either the whole conditional on one line or
wingo 2013/04/05 12:25:06 Done.
4396 top_scope_->ForceContextAllocation();
4395 4397
4396 // FormalParameterList :: 4398 // FormalParameterList ::
4397 // '(' (Identifier)*[','] ')' 4399 // '(' (Identifier)*[','] ')'
4398 Expect(Token::LPAREN, CHECK_OK); 4400 Expect(Token::LPAREN, CHECK_OK);
4399 scope->set_start_position(scanner().location().beg_pos); 4401 scope->set_start_position(scanner().location().beg_pos);
4400 Scanner::Location name_loc = Scanner::Location::invalid(); 4402 Scanner::Location name_loc = Scanner::Location::invalid();
4401 Scanner::Location dupe_loc = Scanner::Location::invalid(); 4403 Scanner::Location dupe_loc = Scanner::Location::invalid();
4402 Scanner::Location reserved_loc = Scanner::Location::invalid(); 4404 Scanner::Location reserved_loc = Scanner::Location::invalid();
4403 4405
4404 bool done = (peek() == Token::RPAREN); 4406 bool done = (peek() == Token::RPAREN);
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after
6002 ASSERT(info->isolate()->has_pending_exception()); 6004 ASSERT(info->isolate()->has_pending_exception());
6003 } else { 6005 } else {
6004 result = parser.ParseProgram(); 6006 result = parser.ParseProgram();
6005 } 6007 }
6006 } 6008 }
6007 info->SetFunction(result); 6009 info->SetFunction(result);
6008 return (result != NULL); 6010 return (result != NULL);
6009 } 6011 }
6010 6012
6011 } } // namespace v8::internal 6013 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698