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

Side by Side Diff: src/ast/scopeinfo.cc

Issue 2537093002: Check some more invariants on SFIs. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/objects-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/ast/context-slot-cache.h" 7 #include "src/ast/context-slot-cache.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/ast/variables.h" 9 #include "src/ast/variables.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 (scope->is_module_scope() 136 (scope->is_module_scope()
137 ? 2 + kModuleVariableEntryLength * module_vars_count 137 ? 2 + kModuleVariableEntryLength * module_vars_count
138 : 0); 138 : 0);
139 139
140 Factory* factory = isolate->factory(); 140 Factory* factory = isolate->factory();
141 Handle<ScopeInfo> scope_info = factory->NewScopeInfo(length); 141 Handle<ScopeInfo> scope_info = factory->NewScopeInfo(length);
142 142
143 bool has_simple_parameters = false; 143 bool has_simple_parameters = false;
144 bool asm_module = false; 144 bool asm_module = false;
145 bool asm_function = false; 145 bool asm_function = false;
146 FunctionKind function_kind = kNormalFunction;
147 if (scope->is_function_scope()) { 146 if (scope->is_function_scope()) {
148 DeclarationScope* function_scope = scope->AsDeclarationScope(); 147 DeclarationScope* function_scope = scope->AsDeclarationScope();
149 has_simple_parameters = function_scope->has_simple_parameters(); 148 has_simple_parameters = function_scope->has_simple_parameters();
150 asm_module = function_scope->asm_module(); 149 asm_module = function_scope->asm_module();
151 asm_function = function_scope->asm_function(); 150 asm_function = function_scope->asm_function();
152 function_kind = function_scope->function_kind(); 151 }
152 FunctionKind function_kind = kNormalFunction;
153 if (scope->is_declaration_scope()) {
154 function_kind = scope->AsDeclarationScope()->function_kind();
153 } 155 }
154 156
155 // Encode the flags. 157 // Encode the flags.
156 int flags = 158 int flags =
157 ScopeTypeField::encode(scope->scope_type()) | 159 ScopeTypeField::encode(scope->scope_type()) |
158 CallsEvalField::encode(scope->calls_eval()) | 160 CallsEvalField::encode(scope->calls_eval()) |
159 LanguageModeField::encode(scope->language_mode()) | 161 LanguageModeField::encode(scope->language_mode()) |
160 DeclarationScopeField::encode(scope->is_declaration_scope()) | 162 DeclarationScopeField::encode(scope->is_declaration_scope()) |
161 ReceiverVariableField::encode(receiver_info) | 163 ReceiverVariableField::encode(receiver_info) |
162 HasNewTargetField::encode(has_new_target) | 164 HasNewTargetField::encode(has_new_target) |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 if (String::cast(entry->local_name())->Equals(*local_name)) { 968 if (String::cast(entry->local_name())->Equals(*local_name)) {
967 return entry; 969 return entry;
968 } 970 }
969 } 971 }
970 UNREACHABLE(); 972 UNREACHABLE();
971 return Handle<ModuleInfoEntry>(); 973 return Handle<ModuleInfoEntry>();
972 } 974 }
973 975
974 } // namespace internal 976 } // namespace internal
975 } // namespace v8 977 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698