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

Unified Diff: src/ast/scopeinfo.cc

Issue 2253913002: Move asm_module_ and asm_function_ down to DeclarationScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test 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
« no previous file with comments | « no previous file | src/ast/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopeinfo.cc
diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
index 28562df144ea1b2823bbbb684795ffbefa1d7ddb..7189de33727ebee08a61321ef9f092fe6e6e661e 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -83,13 +83,17 @@ Handle<ScopeInfo> ScopeInfo::Create(Isolate* isolate, Zone* zone,
Factory* factory = isolate->factory();
Handle<ScopeInfo> scope_info = factory->NewScopeInfo(length);
- bool has_simple_parameters =
- scope->is_function_scope() &&
- scope->AsDeclarationScope()->has_simple_parameters();
- FunctionKind function_kind =
- scope->is_declaration_scope()
- ? scope->AsDeclarationScope()->function_kind()
- : kNormalFunction;
+ bool has_simple_parameters = false;
+ bool asm_module = false;
+ bool asm_function = false;
+ FunctionKind function_kind = kNormalFunction;
+ if (scope->is_function_scope()) {
+ DeclarationScope* function_scope = scope->AsDeclarationScope();
+ has_simple_parameters = function_scope->has_simple_parameters();
+ asm_module = function_scope->asm_module();
+ asm_function = function_scope->asm_function();
+ function_kind = function_scope->function_kind();
+ }
// Encode the flags.
int flags = ScopeTypeField::encode(scope->scope_type()) |
@@ -100,8 +104,8 @@ Handle<ScopeInfo> ScopeInfo::Create(Isolate* isolate, Zone* zone,
HasNewTargetField::encode(has_new_target) |
FunctionVariableField::encode(function_name_info) |
FunctionVariableMode::encode(function_variable_mode) |
- AsmModuleField::encode(scope->asm_module()) |
- AsmFunctionField::encode(scope->asm_function()) |
+ AsmModuleField::encode(asm_module) |
+ AsmFunctionField::encode(asm_function) |
HasSimpleParametersField::encode(has_simple_parameters) |
FunctionKindField::encode(function_kind);
scope_info->SetFlags(flags);
« no previous file with comments | « no previous file | src/ast/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698