| Index: src/scopes.cc
|
| diff --git a/src/scopes.cc b/src/scopes.cc
|
| index 63ae7ec1099627c187043ac2cb62e6e4d270f131..0bb1c625b327fd1dbe5e49964979ebaeb627f0de 100644
|
| --- a/src/scopes.cc
|
| +++ b/src/scopes.cc
|
| @@ -170,10 +170,13 @@ void Scope::SetDefaults(ScopeType scope_type, Scope* outer_scope,
|
| asm_function_ = outer_scope != NULL && outer_scope->asm_module_;
|
| // Inherit the language mode from the parent scope.
|
| language_mode_ = outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY;
|
| + asm_mode_ = (outer_scope == NULL || outer_scope->asm_mode_ == ASM_NO)
|
| + ? ASM_NO
|
| + : (scope_type == FUNCTION_SCOPE ? ASM_FUNCTION : outer_scope->asm_mode_);
|
| outer_scope_calls_sloppy_eval_ = false;
|
| inner_scope_calls_eval_ = false;
|
| inner_scope_uses_arguments_ = false;
|
| - force_eager_compilation_ = false;
|
| + force_eager_compilation_ = asm_mode_ == ASM_FUNCTION;
|
| force_context_allocation_ = (outer_scope != NULL && !is_function_scope())
|
| ? outer_scope->has_forced_context_allocation() : false;
|
| num_var_or_const_ = 0;
|
| @@ -189,6 +192,7 @@ void Scope::SetDefaults(ScopeType scope_type, Scope* outer_scope,
|
| if (!scope_info.is_null()) {
|
| scope_calls_eval_ = scope_info->CallsEval();
|
| language_mode_ = scope_info->language_mode();
|
| + asm_mode_ = scope_info->asm_mode();
|
| block_scope_is_class_scope_ = scope_info->block_scope_is_class_scope();
|
| function_kind_ = scope_info->function_kind();
|
| }
|
| @@ -921,6 +925,11 @@ void Scope::Print(int n) {
|
| } else if (is_strict(language_mode())) {
|
| Indent(n1, "// strict mode scope\n");
|
| }
|
| + if (asm_mode() == ASM_FUNCTION) {
|
| + Indent(n1, "// asm function\n");
|
| + } else if (asm_mode() == ASM_MODULE) {
|
| + Indent(n1, "// asm module\n");
|
| + }
|
| if (scope_inside_with_) Indent(n1, "// scope inside 'with'\n");
|
| if (scope_contains_with_) Indent(n1, "// scope contains 'with'\n");
|
| if (scope_calls_eval_) Indent(n1, "// scope calls 'eval'\n");
|
| @@ -1287,6 +1296,8 @@ void Scope::PropagateScopeInfo(bool outer_scope_calls_sloppy_eval ) {
|
| inner_scope_uses_arguments_ = true;
|
| }
|
| }
|
| + // TODO(bradnelson):
|
| + // Do we want to prevent propagating if this is an ASM function?
|
| if (inner->force_eager_compilation_) {
|
| force_eager_compilation_ = true;
|
| }
|
|
|