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

Side by Side Diff: src/parsing/parser-base.h

Issue 2266973002: Allocate script scopes using a separate constructor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update test Created 4 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
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 ~ParsingModeScope() { 600 ~ParsingModeScope() {
601 parser_->mode_ = old_mode_; 601 parser_->mode_ = old_mode_;
602 } 602 }
603 603
604 private: 604 private:
605 ParserBase* parser_; 605 ParserBase* parser_;
606 Mode old_mode_; 606 Mode old_mode_;
607 }; 607 };
608 608
609 DeclarationScope* NewScriptScope() { 609 DeclarationScope* NewScriptScope() {
610 return new (zone()) DeclarationScope(zone(), nullptr, SCRIPT_SCOPE); 610 return new (zone()) DeclarationScope(zone());
611 } 611 }
612 612
613 DeclarationScope* NewVarblockScope() { 613 DeclarationScope* NewVarblockScope() {
614 return new (zone()) DeclarationScope(zone(), scope(), BLOCK_SCOPE); 614 return new (zone()) DeclarationScope(zone(), scope(), BLOCK_SCOPE);
615 } 615 }
616 616
617 ModuleScope* NewModuleScope(DeclarationScope* parent) { 617 ModuleScope* NewModuleScope(DeclarationScope* parent) {
618 return new (zone()) ModuleScope(zone(), parent, ast_value_factory()); 618 return new (zone()) ModuleScope(zone(), parent, ast_value_factory());
619 } 619 }
620 620
(...skipping 3133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3754 has_seen_constructor_ = true; 3754 has_seen_constructor_ = true;
3755 return; 3755 return;
3756 } 3756 }
3757 } 3757 }
3758 3758
3759 3759
3760 } // namespace internal 3760 } // namespace internal
3761 } // namespace v8 3761 } // namespace v8
3762 3762
3763 #endif // V8_PARSING_PARSER_BASE_H 3763 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698