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

Unified Diff: src/parsing/rewriter.cc

Issue 2209573002: Separate Scope into DeclarationScope and Scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move has_simple_parameters_ to DeclarationScope Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: src/parsing/rewriter.cc
diff --git a/src/parsing/rewriter.cc b/src/parsing/rewriter.cc
index 8f81653e257ab8690b1e7ecea87276db94df58e2..49f1ae1b4e00987d5b766a1044da000240811802 100644
--- a/src/parsing/rewriter.cc
+++ b/src/parsing/rewriter.cc
@@ -13,7 +13,7 @@ namespace internal {
class Processor final : public AstVisitor<Processor> {
public:
- Processor(Isolate* isolate, Scope* closure_scope, Variable* result,
+ Processor(Isolate* isolate, DeclarationScope* closure_scope, Variable* result,
AstValueFactory* ast_value_factory)
: result_(result),
result_assigned_(false),
@@ -22,11 +22,11 @@ class Processor final : public AstVisitor<Processor> {
zone_(ast_value_factory->zone()),
closure_scope_(closure_scope),
factory_(ast_value_factory) {
- DCHECK_EQ(closure_scope, closure_scope->ClosureScope());
+ DCHECK_EQ(closure_scope, closure_scope->GetClosureScope());
InitializeAstVisitor(isolate);
}
- Processor(Parser* parser, Scope* closure_scope, Variable* result,
+ Processor(Parser* parser, DeclarationScope* closure_scope, Variable* result,
AstValueFactory* ast_value_factory)
: result_(result),
result_assigned_(false),
@@ -35,7 +35,7 @@ class Processor final : public AstVisitor<Processor> {
zone_(ast_value_factory->zone()),
closure_scope_(closure_scope),
factory_(ast_value_factory) {
- DCHECK_EQ(closure_scope, closure_scope->ClosureScope());
+ DCHECK_EQ(closure_scope, closure_scope->GetClosureScope());
InitializeAstVisitor(parser->stack_limit());
}
@@ -43,7 +43,7 @@ class Processor final : public AstVisitor<Processor> {
bool result_assigned() const { return result_assigned_; }
Zone* zone() { return zone_; }
- Scope* closure_scope() { return closure_scope_; }
+ DeclarationScope* closure_scope() { return closure_scope_; }
AstNodeFactory* factory() { return &factory_; }
// Returns ".result = value"
@@ -77,7 +77,7 @@ class Processor final : public AstVisitor<Processor> {
bool is_set_;
Zone* zone_;
- Scope* closure_scope_;
+ DeclarationScope* closure_scope_;
AstNodeFactory factory_;
// Node visitors.
@@ -339,7 +339,7 @@ bool Rewriter::Rewrite(ParseInfo* info) {
Scope* scope = function->scope();
DCHECK_NOT_NULL(scope);
if (!scope->is_script_scope() && !scope->is_eval_scope()) return true;
- Scope* closure_scope = scope->ClosureScope();
+ DeclarationScope* closure_scope = scope->GetClosureScope();
ZoneList<Statement*>* body = function->body();
if (!body->is_empty()) {
@@ -365,12 +365,12 @@ bool Rewriter::Rewrite(ParseInfo* info) {
return true;
}
-bool Rewriter::Rewrite(Parser* parser, Scope* closure_scope, DoExpression* expr,
- AstValueFactory* factory) {
+bool Rewriter::Rewrite(Parser* parser, DeclarationScope* closure_scope,
+ DoExpression* expr, AstValueFactory* factory) {
Block* block = expr->block();
- DCHECK_EQ(closure_scope, closure_scope->ClosureScope());
+ DCHECK_EQ(closure_scope, closure_scope->GetClosureScope());
DCHECK(block->scope() == nullptr ||
- block->scope()->ClosureScope() == closure_scope);
+ block->scope()->GetClosureScope() == closure_scope);
ZoneList<Statement*>* body = block->statements();
VariableProxy* result = expr->result();
Variable* result_var = result->var();

Powered by Google App Engine
This is Rietveld 408576698