Lines Matching refs:scope
5 #include "src/objects/scope-info.h"
14 #include "src/objects/scope-info-inl.h"
61 Handle<ScopeInfo> ScopeInfo::Create(IsolateT* isolate, Zone* zone, Scope* scope,
66 // Stack allocated block scope variables are allocated in the parent
67 // declaration scope, but are recorded in the block scope's scope info. First
68 // slot index indicates at which offset a particular scope starts in the
69 // parent declaration scope.
70 for (Variable* var : *scope->locals()) {
85 if (scope->is_declaration_scope() &&
86 scope->AsDeclarationScope()->has_this_declaration()) {
87 Variable* var = scope->AsDeclarationScope()->receiver();
100 DCHECK(module_vars_count == 0 || scope->is_module_scope());
103 DCHECK_EQ(scope->ContextLocalCount(), context_local_count);
106 // in the scope info object.
111 scope->is_declaration_scope() &&
112 scope->AsDeclarationScope()->new_target_var() != nullptr;
114 const bool has_inferred_function_name = scope->is_function_scope();
118 if (scope->is_function_scope()) {
119 if (scope->AsDeclarationScope()->function_var() != nullptr) {
120 Variable* var = scope->AsDeclarationScope()->function_var();
130 // Always reserve space for the debug name in the scope info.
133 } else if (scope->is_module_scope() || scope->is_script_scope() ||
134 scope->is_eval_scope()) {
135 // Always reserve space for the debug name in the scope info.
142 scope->is_class_scope()
143 ? scope->AsClassScope()->brand() != nullptr
144 : scope->IsConstructorScope() &&
145 scope->AsDeclarationScope()->class_scope_has_private_brand();
147 scope->is_class_scope()
148 ? scope->AsClassScope()->should_save_class_variable_index()
152 const bool has_position_info = NeedsPositionInfo(scope->scope_type());
154 scope->is_declaration_scope()
155 ? scope->AsDeclarationScope()->num_parameters()
160 if (scope->is_module_scope()) {
162 scope->AsModuleScope()->module());
181 (scope->is_module_scope()
203 if (scope->is_function_scope()) {
204 DeclarationScope* function_scope = scope->AsDeclarationScope();
211 if (scope->is_declaration_scope()) {
212 function_kind = scope->AsDeclarationScope()->function_kind();
214 scope->AsDeclarationScope()->sloppy_eval_can_extend_vars();
219 ScopeTypeBits::encode(scope->scope_type()) |
221 LanguageModeBit::encode(scope->language_mode()) |
222 DeclarationScopeBit::encode(scope->is_declaration_scope()) |
233 IsDebugEvaluateScopeBit::encode(scope->is_debug_evaluate_scope()) |
235 scope->ForceContextForLanguageMode()) |
237 scope->private_name_lookup_skips_outer_class()) |
238 HasContextExtensionSlotBit::encode(scope->HasContextExtensionSlot()) |
239 IsReplModeScopeBit::encode(scope->is_repl_mode_scope()) |
248 if (scope->is_module_scope()) {
262 for (Variable* var : *scope->locals()) {
268 int local_index = var->index() - scope->ContextHeaderLength();
319 if (scope->is_declaration_scope()) {
328 Variable* parameter = scope->AsDeclarationScope()->parameter(i);
330 int param_index = parameter->index() - scope->ContextHeaderLength();
342 // If the scope is a class scope and has used static private methods, save
346 Variable* class_variable = scope->AsClassScope()->class_variable();
362 Variable* var = scope->AsDeclarationScope()->function_var();
383 scope_info.set(index++, Smi::FromInt(scope->start_position()));
384 scope_info.set(index++, Smi::FromInt(scope->end_position()));
387 // If present, add the outer scope info.
394 if (scope->is_module_scope()) {
408 DCHECK_EQ(scope->num_heap_slots(), scope_info_handle->ContextLength());
415 Scope* scope,
419 Scope* scope,