Lines Matching refs:scope
67 scope positions (debug only)
69 | scope type << only in debug |
77 | data for inner scope m | << but not for function scopes
82 | data for inner scope 1 |
268 bool PreparseDataBuilder::ScopeNeedsData(Scope* scope) {
269 if (scope->is_function_scope()) {
272 return !IsDefaultConstructor(scope->AsDeclarationScope()->function_kind());
274 if (!scope->is_hidden()) {
275 for (Variable* var : *scope->locals()) {
279 for (Scope* inner = scope->inner_scope(); inner != nullptr;
315 void PreparseDataBuilder::SaveScopeAllocationData(DeclarationScope* scope,
335 // Don't save incomplete scope information when bailed out.
347 byte_data_.WriteUint32(scope->start_position());
348 byte_data_.WriteUint32(scope->end_position());
351 if (ScopeNeedsData(scope)) SaveDataForScope(scope);
356 void PreparseDataBuilder::SaveDataForScope(Scope* scope) {
357 DCHECK_NE(scope->end_position(), kNoSourcePosition);
358 DCHECK(ScopeNeedsData(scope));
362 byte_data_.WriteUint8(scope->scope_type());
367 scope->is_declaration_scope() &&
368 scope->AsDeclarationScope()->sloppy_eval_can_extend_vars()) |
369 InnerScopeCallsEvalField::encode(scope->inner_scope_calls_eval()) |
371 scope->is_function_scope() &&
372 scope->AsDeclarationScope()
375 scope->is_class_scope() &&
376 scope->AsClassScope()->should_save_class_variable_index());
380 if (scope->is_function_scope()) {
381 Variable* function = scope->AsDeclarationScope()->function_var();
385 for (Variable* var : *scope->locals()) {
389 SaveDataForInnerScopes(scope);
413 void PreparseDataBuilder::SaveDataForInnerScopes(Scope* scope) {
417 for (Scope* inner = scope->inner_scope(); inner != nullptr;
627 DeclarationScope* scope, AstValueFactory* ast_value_factory, Zone* zone) {
628 DCHECK_EQ(scope->scope_type(), ScopeType::FUNCTION_SCOPE);
638 DCHECK_EQ(start_position_from_data, scope->start_position());
639 DCHECK_EQ(end_position_from_data, scope->end_position());
642 RestoreDataForScope(scope, ast_value_factory, zone);
644 // Check that we consumed all scope data.
650 Scope* scope, AstValueFactory* ast_value_factory, Zone* zone) {
651 if (scope->is_declaration_scope() &&
652 scope->AsDeclarationScope()->is_skipped_function()) {
656 // It's possible that scope is not present in the data at all (since PreParser
657 // doesn't create the corresponding scope). In this case, the Scope won't
659 if (!PreparseDataBuilder::ScopeNeedsData(scope)) return;
662 DCHECK_EQ(scope_data_->ReadUint8(), scope->scope_type());
667 scope->RecordEvalCall();
670 scope->RecordInnerScopeEvalCall();
673 scope->AsDeclarationScope()->RecordNeedsPrivateNameContextChainRecalc();
676 Variable* var = scope->AsClassScope()->class_variable();
682 DCHECK(scope->AsClassScope()->is_anonymous_class());
683 var = scope->AsClassScope()->DeclareClassVariable(
688 scope->declarations()->Add(declaration);
693 scope->AsClassScope()->set_should_save_class_variable_index();
696 if (scope->is_function_scope()) {
697 Variable* function = scope->AsDeclarationScope()->function_var();
700 for (Variable* var : *scope->locals()) {
704 RestoreDataForInnerScopes(scope, ast_value_factory, zone);
744 Scope* scope, AstValueFactory* ast_value_factory, Zone* zone) {
745 for (Scope* inner = scope->inner_scope(); inner != nullptr;