 Chromium Code Reviews
 Chromium Code Reviews Issue 6691058:
  Restart AST node numbering when we enter a function.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 6691058:
  Restart AST node numbering when we enter a function.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/parser.cc | 
| diff --git a/src/parser.cc b/src/parser.cc | 
| index 22d4d3f1fe0ed9b101e2d666b1928f219f1c650d..93d0932645b25e9883a6f79a125c967cb0441531 100644 | 
| --- a/src/parser.cc | 
| +++ b/src/parser.cc | 
| @@ -1,4 +1,4 @@ | 
| -// Copyright 2010 the V8 project authors. All rights reserved. | 
| +// Copyright 2011 the V8 project authors. All rights reserved. | 
| // Redistribution and use in source and binary forms, with or without | 
| // modification, are permitted provided that the following conditions are | 
| // met: | 
| @@ -3545,6 +3545,9 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, | 
| Scanner::Location name_loc = Scanner::NoLocation(); | 
| Scanner::Location dupe_loc = Scanner::NoLocation(); | 
| Scanner::Location reserved_loc = Scanner::NoLocation(); | 
| + Isolate* isolate = Isolate::Current(); | 
| 
Kevin Millikin (Chromium)
2011/04/05 15:56:11
You should probably call (the parser's) isolate()
 | 
| + unsigned old_ast_node_id = isolate->ast_node_id(); | 
| + isolate->set_ast_node_id(1); | 
| bool done = (peek() == Token::RPAREN); | 
| while (!done) { | 
| @@ -3621,14 +3624,14 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, | 
| // End position greater than end of stream is safe, and hard to check. | 
| ReportInvalidPreparseData(name, CHECK_OK); | 
| } | 
| - isolate()->counters()->total_preparse_skipped()->Increment( | 
| + isolate->counters()->total_preparse_skipped()->Increment( | 
| end_pos - function_block_pos); | 
| // Seek to position just before terminal '}'. | 
| scanner().SeekForward(end_pos - 1); | 
| materialized_literal_count = entry.literal_count(); | 
| expected_property_count = entry.property_count(); | 
| only_simple_this_property_assignments = false; | 
| - this_property_assignments = isolate()->factory()->empty_fixed_array(); | 
| + this_property_assignments = isolate->factory()->empty_fixed_array(); | 
| Expect(Token::RBRACE, CHECK_OK); | 
| } else { | 
| ParseSourceElements(body, Token::RBRACE, CHECK_OK); | 
| @@ -3642,6 +3645,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, | 
| Expect(Token::RBRACE, CHECK_OK); | 
| end_pos = scanner().location().end_pos; | 
| } | 
| + isolate->set_ast_node_id(old_ast_node_id); | 
| // Validate strict mode. | 
| if (top_scope_->is_strict_mode()) { | 
| @@ -3652,8 +3656,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, | 
| Scanner::Location location = Scanner::Location(position, start_pos); | 
| ReportMessageAt(location, | 
| "strict_function_name", Vector<const char*>::empty()); | 
| - *ok = false; | 
| - return NULL; | 
| + *ok = false; return NULL; | 
| } | 
| if (name_loc.IsValid()) { | 
| ReportMessageAt(name_loc, "strict_param_name", |