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

Unified Diff: src/scopes.cc

Issue 1161393007: OLD type Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 6 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 | « src/scopes.h ('k') | src/typing-asm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/scopes.h ('k') | src/typing-asm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698