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

Side by Side Diff: src/parser.cc

Issue 7979001: Scope tree serialization and ScopeIterator cleanup. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | src/runtime.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // top scope to the incoming scope, and the destructor resets it. Additionally, 464 // top scope to the incoming scope, and the destructor resets it. Additionally,
465 // LexicalScope stores transient information used during parsing. 465 // LexicalScope stores transient information used during parsing.
466 466
467 467
468 class SaveScope BASE_EMBEDDED { 468 class SaveScope BASE_EMBEDDED {
469 public: 469 public:
470 SaveScope(Parser* parser, Scope* scope) 470 SaveScope(Parser* parser, Scope* scope)
471 : parser_(parser), 471 : parser_(parser),
472 previous_top_scope_(parser->top_scope_) { 472 previous_top_scope_(parser->top_scope_) {
473 parser->top_scope_ = scope; 473 parser->top_scope_ = scope;
474 scope->SetSourceBegStatementPos(parser_->scanner().location().beg_pos);
Kevin Millikin (Chromium) 2011/10/05 08:43:36 I'm leery of setting this implicitly. It's too ea
Steven 2011/10/06 19:09:27 Doing it explicitly now as it also gives me more c
474 } 475 }
475 476
476 ~SaveScope() { 477 ~SaveScope() {
478 parser_->top_scope_->SetSourceEndStatementPos(
479 parser_->scanner().location().beg_pos);
477 parser_->top_scope_ = previous_top_scope_; 480 parser_->top_scope_ = previous_top_scope_;
478 } 481 }
479 482
480 private: 483 private:
481 // Bookkeeping 484 // Bookkeeping
482 Parser* parser_; 485 Parser* parser_;
483 // Previous values 486 // Previous values
484 Scope* previous_top_scope_; 487 Scope* previous_top_scope_;
485 }; 488 };
486 489
(...skipping 3389 matching lines...) Expand 10 before | Expand all | Expand 10 after
3876 materialized_literal_count, 3879 materialized_literal_count,
3877 expected_property_count, 3880 expected_property_count,
3878 only_simple_this_property_assignments, 3881 only_simple_this_property_assignments,
3879 this_property_assignments, 3882 this_property_assignments,
3880 num_parameters, 3883 num_parameters,
3881 start_pos, 3884 start_pos,
3882 end_pos, 3885 end_pos,
3883 type, 3886 type,
3884 has_duplicate_parameters); 3887 has_duplicate_parameters);
3885 function_literal->set_function_token_position(function_token_position); 3888 function_literal->set_function_token_position(function_token_position);
3889 scope->SetSourceBegStatementPos(start_pos);
Kevin Millikin (Chromium) 2011/10/05 08:43:36 It's a bit warty that some scopes have positions s
Steven 2011/10/06 19:09:27 Removed the local variables and removed them from
3890 scope->SetSourceEndStatementPos(end_pos);
3886 3891
3887 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); 3892 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal);
3888 return function_literal; 3893 return function_literal;
3889 } 3894 }
3890 3895
3891 3896
3892 Expression* Parser::ParseV8Intrinsic(bool* ok) { 3897 Expression* Parser::ParseV8Intrinsic(bool* ok) {
3893 // CallRuntime :: 3898 // CallRuntime ::
3894 // '%' Identifier Arguments 3899 // '%' Identifier Arguments
3895 3900
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after
5207 result = parser.ParseProgram(source, 5212 result = parser.ParseProgram(source,
5208 info->is_global(), 5213 info->is_global(),
5209 info->StrictMode()); 5214 info->StrictMode());
5210 } 5215 }
5211 } 5216 }
5212 info->SetFunction(result); 5217 info->SetFunction(result);
5213 return (result != NULL); 5218 return (result != NULL);
5214 } 5219 }
5215 5220
5216 } } // namespace v8::internal 5221 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698