| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index db4e0fed2416554afc676609979d00e0317acf46..22a4661aa9621a16aba817a6fdee6a40a12fbadf 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -345,18 +345,17 @@ class ParserTraits::Checkpoint
|
| : public ParserBase<ParserTraits>::CheckpointBase {
|
| public:
|
| explicit Checkpoint(ParserBase<ParserTraits>* parser)
|
| - : CheckpointBase(parser) {
|
| - isolate_ = parser->zone()->isolate();
|
| - saved_ast_node_id_ = isolate_->ast_node_id();
|
| + : CheckpointBase(parser), parser_(parser) {
|
| + saved_ast_node_id_ = *(parser_->ast_node_id_counter_);
|
| }
|
|
|
| void Restore() {
|
| CheckpointBase::Restore();
|
| - isolate_->set_ast_node_id(saved_ast_node_id_);
|
| + *(parser_->ast_node_id_counter_) = saved_ast_node_id_;
|
| }
|
|
|
| private:
|
| - Isolate* isolate_;
|
| + ParserBase<ParserTraits>* parser_;
|
| int saved_ast_node_id_;
|
| };
|
|
|
| @@ -734,7 +733,8 @@ FunctionLiteral* ParserTraits::ParseFunctionLiteral(
|
| Parser::Parser(CompilationInfo* info)
|
| : ParserBase<ParserTraits>(&scanner_,
|
| info->isolate()->stack_guard()->real_climit(),
|
| - info->extension(), NULL, info->zone(), this),
|
| + info->extension(), NULL, info->zone(),
|
| + info->ast_node_id_counter(), this),
|
| isolate_(info->isolate()),
|
| script_(info->script()),
|
| scanner_(isolate_->unicode_cache()),
|
| @@ -749,7 +749,7 @@ Parser::Parser(CompilationInfo* info)
|
| pending_error_arg_(NULL),
|
| pending_error_char_arg_(NULL) {
|
| DCHECK(!script_.is_null());
|
| - isolate_->set_ast_node_id(0);
|
| + *(info->ast_node_id_counter()) = 0;
|
| set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping);
|
| set_allow_modules(!info->is_native() && FLAG_harmony_modules);
|
| set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native());
|
| @@ -861,7 +861,8 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
|
|
|
| // Enters 'scope'.
|
| FunctionState function_state(&function_state_, &scope_, scope, zone(),
|
| - ast_value_factory_);
|
| + ast_value_factory_,
|
| + info->ast_node_id_counter());
|
|
|
| scope_->SetStrictMode(info->strict_mode());
|
| ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone());
|
| @@ -979,7 +980,8 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
|
| }
|
| original_scope_ = scope;
|
| FunctionState function_state(&function_state_, &scope_, scope, zone(),
|
| - ast_value_factory_);
|
| + ast_value_factory_,
|
| + info()->ast_node_id_counter());
|
| DCHECK(scope->strict_mode() == SLOPPY || info()->strict_mode() == STRICT);
|
| DCHECK(info()->strict_mode() == shared_info->strict_mode());
|
| scope->SetStrictMode(shared_info->strict_mode());
|
| @@ -3442,7 +3444,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
|
| // Parse function body.
|
| {
|
| FunctionState function_state(&function_state_, &scope_, scope, zone(),
|
| - ast_value_factory_);
|
| + ast_value_factory_,
|
| + info()->ast_node_id_counter());
|
| scope_->SetScopeName(function_name);
|
|
|
| if (is_generator) {
|
|
|