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

Unified Diff: src/ast/scopeinfo.cc

Issue 2331323006: Store whether a with scope is actually a debug-eval scope in the scope info (Closed)
Patch Set: 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 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 a8614bdd5b10f9525b7378adb95258f910be32b6..d3014274d40bf1abdf2cb708fdcde9f0be9bb273 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -155,18 +155,20 @@ Handle<ScopeInfo> ScopeInfo::Create(Isolate* isolate, Zone* zone, Scope* scope,
}
// Encode the flags.
- int flags = ScopeTypeField::encode(scope->scope_type()) |
- CallsEvalField::encode(scope->calls_eval()) |
- LanguageModeField::encode(scope->language_mode()) |
- DeclarationScopeField::encode(scope->is_declaration_scope()) |
- ReceiverVariableField::encode(receiver_info) |
- HasNewTargetField::encode(has_new_target) |
- FunctionVariableField::encode(function_name_info) |
- AsmModuleField::encode(asm_module) |
- AsmFunctionField::encode(asm_function) |
- HasSimpleParametersField::encode(has_simple_parameters) |
- FunctionKindField::encode(function_kind) |
- HasOuterScopeInfoField::encode(has_outer_scope_info);
+ int flags =
+ ScopeTypeField::encode(scope->scope_type()) |
+ CallsEvalField::encode(scope->calls_eval()) |
+ LanguageModeField::encode(scope->language_mode()) |
+ DeclarationScopeField::encode(scope->is_declaration_scope()) |
+ ReceiverVariableField::encode(receiver_info) |
+ HasNewTargetField::encode(has_new_target) |
+ FunctionVariableField::encode(function_name_info) |
+ AsmModuleField::encode(asm_module) |
+ AsmFunctionField::encode(asm_function) |
+ HasSimpleParametersField::encode(has_simple_parameters) |
+ FunctionKindField::encode(function_kind) |
+ HasOuterScopeInfoField::encode(has_outer_scope_info) |
+ IsDebugEvaluateScopeField::encode(scope->is_debug_evaluate_scope());
scope_info->SetFlags(flags);
scope_info->SetParameterCount(parameter_count);
@@ -302,7 +304,8 @@ Handle<ScopeInfo> ScopeInfo::CreateForWithScope(
FunctionVariableField::encode(NONE) | AsmModuleField::encode(false) |
AsmFunctionField::encode(false) | HasSimpleParametersField::encode(true) |
FunctionKindField::encode(kNormalFunction) |
- HasOuterScopeInfoField::encode(has_outer_scope_info);
+ HasOuterScopeInfoField::encode(has_outer_scope_info) |
+ IsDebugEvaluateScopeField::encode(false);
scope_info->SetFlags(flags);
scope_info->SetParameterCount(0);
@@ -355,7 +358,8 @@ Handle<ScopeInfo> ScopeInfo::CreateGlobalThisBinding(Isolate* isolate) {
AsmModuleField::encode(false) | AsmFunctionField::encode(false) |
HasSimpleParametersField::encode(has_simple_parameters) |
FunctionKindField::encode(FunctionKind::kNormalFunction) |
- HasOuterScopeInfoField::encode(has_outer_scope_info);
+ HasOuterScopeInfoField::encode(has_outer_scope_info) |
+ IsDebugEvaluateScopeField::encode(false);
scope_info->SetFlags(flags);
scope_info->SetParameterCount(parameter_count);
scope_info->SetStackLocalCount(stack_local_count);
@@ -491,6 +495,23 @@ bool ScopeInfo::HasOuterScopeInfo() {
}
}
+bool ScopeInfo::IsDebugEvaluateScope() {
+ if (length() > 0) {
+ return IsDebugEvaluateScopeField::decode(Flags());
+ } else {
+ return false;
+ }
+}
+
+void ScopeInfo::SetIsDebugEvaluateScope() {
+ if (length() > 0) {
+ DCHECK_EQ(scope_type(), WITH_SCOPE);
+ SetFlags(Flags() | IsDebugEvaluateScopeField::encode(true));
+ } else {
+ UNREACHABLE();
+ }
+}
+
bool ScopeInfo::HasHeapAllocatedLocals() {
if (length() > 0) {
return ContextLocalCount() > 0;
« 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