| /arkcompiler/runtime_core/static_core/plugins/ets/compiler/docs/ |
| D | interop_intrinsic_opt_doc.md | 4 Before the optimization, each call to Ecmascript method is enclosed by its own local scope (see [js… 10 …scope creations and destructions reduces time needed for GC to remove local objects. Also the foll… 23 ### Scope merging 26 * number of scope creations on any execution path is not increased *in most cases* 31 Scope merging is done in 3 stages, moving from more local to more global transforms. Number of obje… 33 …erop-try-single-scope` is enabled and there are no calls to non-interop methods, enclose the metho… 35 …ack current scope status (whether we are inside scope, after scope end or there were no scopes yet… 37 …scope switches (scope start or scope ends). If we remove these scope switches, blocks from `S` wil… 39 …h unique scope. We use a greedy approach and simply do not merge `S` with neighbouring scopes if e… 41 …scope which may start at several `CreateScope` intrinsics is bad for further optimization. Having … [all …]
|
| /arkcompiler/ets_frontend/ets2panda/compiler/core/ |
| D | envScope.h | 19 #include "varbinder/scope.h" 35 explicit ScopeContext(CodeGen *cg, varbinder::Scope *newScope); 43 varbinder::Scope *prevScope_; 78 explicit LoopEnvScope(PandaGen *pg, varbinder::LoopScope *scope, LabelTarget target) in LoopEnvScope() argument 79 … : scope_(NeedEnv(scope) ? scope : nullptr), regScope_(pg, scope), lexEnvCtx_(this, pg, target) in LoopEnvScope() 81 CopyBindings(pg, scope, varbinder::VariableFlags::PER_ITERATION); in LoopEnvScope() 84 explicit LoopEnvScope(PandaGen *pg, LabelTarget target, varbinder::LoopScope *scope) in LoopEnvScope() argument 85 : scope_(NeedEnv(scope) ? scope : nullptr), regScope_(pg), lexEnvCtx_(this, pg, target) in LoopEnvScope() 87 CopyBindings(pg, scope, varbinder::VariableFlags::PER_ITERATION); in LoopEnvScope() 90 explicit LoopEnvScope(PandaGen *pg, varbinder::LoopDeclarationScope *scope) in LoopEnvScope() argument [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ast_verifier/invariants/ |
| D | checkScopeDeclaration.cpp | 19 #include "varbinder/scope.h" 36 auto const *const scope = var->GetScope(); in operator ()() local 37 if (scope == nullptr) { in operator ()() 42 return CheckScope(scope); in operator ()() 45 CheckResult CheckScopeDeclaration::CheckScope(varbinder::Scope const *const scope) in CheckScope() argument 47 auto const *const node = scope->Node(); in CheckScope() 54 AddCheckMessage("NODE IS NOT SCOPE BEARER", *node); in CheckScope() 58 if (node->Scope() == scope) { in CheckScope() 62 if (node->Scope()->IsFunctionScope()) { in CheckScope() 63 auto const *const functionScope = node->Scope()->AsFunctionScope(); in CheckScope() [all …]
|
| /arkcompiler/ets_frontend/arkguard/test/ut/utils/ |
| D | ScopeAnalyzer.spec.ts | 30 Scope, 81 it('is Global Scope', function () { 82 let curScope = new Scope('curScope', sourceFile, ScopeKind.GLOBAL); 86 it('is not Global Scope', function () { 87 let curScope = new Scope('curScope', sourceFile, ScopeKind.MODULE); 93 it('is Function Scope', function () { 94 let curScope = new Scope('curScope', sourceFile, ScopeKind.FUNCTION); 98 it('is not Function Scope', function () { 99 let curScope = new Scope('curScope', sourceFile, ScopeKind.MODULE); 105 it('is Class Scope', function () { [all …]
|
| /arkcompiler/ets_frontend/es2panda/compiler/base/ |
| D | hoisting.cpp | 26 ASSERT(pg->Scope()->IsModuleScope()); in StoreModuleVarOrLocalVar() 27 auto *var = pg->Scope()->FindLocal(decl->Name()); in StoreModuleVarOrLocalVar() 42 auto *scope = pg->Scope(); in HoistVar() local 43 if (scope->IsGlobalScope()) { in HoistVar() 49 auto *funcScope = scope->EnclosingFunctionVariableScope(); in HoistVar() 51 if (scope->HasParamScope() && funcScope->ParamScope()->HasParam(decl->Name())) { in HoistVar() 55 binder::ScopeFindResult result(decl->Name(), scope, 0, var); in HoistVar() 68 const auto &internalName = scriptFunction->Scope()->InternalName(); in HoistFunction() 69 auto *scope = pg->Scope(); in HoistFunction() local 70 if (scope->IsGlobalScope()) { in HoistFunction() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/varbinder/ |
| D | TypedBinder.cpp | 31 Scope *scope = nullptr; in BuildSignatureDeclarationBaseParams() local 35 scope = typeNode->AsETSFunctionType()->Scope(); in BuildSignatureDeclarationBaseParams() 39 scope = typeNode->AsTSFunctionType()->Scope(); in BuildSignatureDeclarationBaseParams() 43 scope = typeNode->AsTSConstructorType()->Scope(); in BuildSignatureDeclarationBaseParams() 47 scope = typeNode->AsTSSignatureDeclaration()->Scope(); in BuildSignatureDeclarationBaseParams() 51 scope = typeNode->AsTSMethodSignature()->Scope(); in BuildSignatureDeclarationBaseParams() 60 ES2PANDA_ASSERT(scope && scope->IsFunctionParamScope()); in BuildSignatureDeclarationBaseParams() 62 …auto scopeCtx = LexicalScope<FunctionParamScope>::Enter(this, scope->AsFunctionParamScope(), false… in BuildSignatureDeclarationBaseParams()
|
| D | variable.cpp | 19 #include "varbinder/scope.h" 47 void LocalVariable::SetLexical(Scope *scope) in SetLexical() argument 53 VariableScope *varScope = scope->EnclosingVariableScope(); in SetLexical() 58 void GlobalVariable::SetLexical([[maybe_unused]] Scope *scope) {} in SetLexical() argument 59 void ModuleVariable::SetLexical([[maybe_unused]] Scope *scope) {} in SetLexical() argument 60 void EnumVariable::SetLexical([[maybe_unused]] Scope *scope) {} in SetLexical() argument
|
| /arkcompiler/ets_frontend/ets2panda/compiler/base/ |
| D | hoisting.cpp | 19 #include "varbinder/scope.h" 25 auto *scope = pg->Scope(); in HoistVar() local 27 if (scope->IsGlobalScope()) { in HoistVar() 33 varbinder::ConstScopeFindResult result(decl->Name(), scope, 0, var); in HoistVar() 42 auto *scope = pg->Scope(); in HoistFunction() local 44 const auto &internalName = scriptFunction->Scope()->InternalName(); in HoistFunction() 46 if (scope->IsGlobalScope()) { in HoistFunction() 52 ES2PANDA_ASSERT(scope->IsFunctionScope() || scope->IsCatchScope() || scope->IsLocalScope() || in HoistFunction() 53 scope->IsModuleScope()); in HoistFunction() 54 varbinder::ConstScopeFindResult result(decl->Name(), scope, 0, var); in HoistFunction() [all …]
|
| /arkcompiler/ets_frontend/es2panda/binder/ |
| D | variable.cpp | 18 #include <binder/scope.h> 42 void LocalVariable::SetLexical(Scope *scope, util::PatchFix *patchFixHelper) in SetLexical() argument 48 VariableScope *varScope = scope->IsFunctionParamScope() ? in SetLexical() 49 scope->AsFunctionParamScope()->GetFunctionScope() : scope->EnclosingVariableScope(); in SetLexical() 81 void GlobalVariable::SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *pat… in SetLexical() argument 82 void ModuleVariable::SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *pat… in SetLexical() argument 83 void EnumVariable::SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patch… in SetLexical() argument 84 void NamespaceVariable::SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *… in SetLexical() argument 85 void ImportEqualsVariable::SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFi… in SetLexical() argument 86 void EnumLiteralVariable::SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix… in SetLexical() argument
|
| D | variable.h | 35 class Scope; variable 124 virtual void SetLexical(Scope *scope, util::PatchFix *patchFixHelper = nullptr) = 0; in VARIABLE_TYPES() 167 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 183 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 195 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 265 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 283 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 313 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 347 …void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::PatchFix *patchFixHelper = n… 349 Scope *GetScope() in GetScope() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/homecheck/src/model/ |
| D | VarInfo.ts | 16 import { Scope } from './Scope'; 20 scope: Scope; property in VarInfo 22 constructor(stmt: Stmt, scope: Scope) { 24 this.scope = scope;
|
| D | Scope.ts | 19 const logger = Logger.getLogger(LOG_MODULE_TYPE.HOMECHECK, 'Scope'); 37 export class Scope { class 38 parentScope: Scope | null; 39 childScopeList: Array<Scope>; 45 …constructor(parent: Scope | null, defList: Array<Variable>, level: number, type: ScopeType = Scope… 47 this.childScopeList = new Array<Scope>(); 54 public setChildScope(child: Scope): void {
|
| /arkcompiler/ets_frontend/es2panda/compiler/core/ |
| D | envScope.h | 19 #include <binder/scope.h> 36 explicit ScopeContext(PandaGen *pg, binder::Scope *newScope); 44 binder::Scope *prevScope_; 71 explicit VariableEnvScope(PandaGen *pg, binder::VariableScope *scope, LabelTarget target) in VariableEnvScope() argument 72 …: scope_(InitVariableContext(pg, scope) ? scope : nullptr), regScope_(pg, scope), lexEnvCtx_(this,… in VariableEnvScope() 81 binder::VariableScope *Scope() const in Scope() function 91 bool InitVariableContext(PandaGen *pg, binder::VariableScope *scope); 99 explicit LoopEnvScope(PandaGen *pg, binder::LoopScope *scope, LabelTarget target) in LoopEnvScope() argument 100 : VariableEnvScope(pg, scope, target) in LoopEnvScope() 104 explicit LoopEnvScope(PandaGen *pg, LabelTarget target, binder::LoopScope *scope) in LoopEnvScope() argument [all …]
|
| /arkcompiler/ets_frontend/arkguard/src/utils/ |
| D | ScopeAnalyzer.ts | 81 * kind of a scope 87 * A map used to track whether identifiers without symbols are in the top-level scope. 102 * type of scope 118 export function isGlobalScope(scope: Scope): boolean { 119 return scope.kind === ScopeKind.GLOBAL; 122 export function isFunctionScope(scope: Scope): boolean { 123 return scope.kind === ScopeKind.FUNCTION; 126 export function isClassScope(scope: Scope): boolean { 127 return scope.kind === ScopeKind.CLASS; 130 export function isInterfaceScope(scope: Scope): boolean { [all …]
|
| /arkcompiler/ets_frontend/es2panda/typescript/types/ |
| D | enumLiteralType.h | 22 class Scope; variable 31 EnumLiteralType(util::StringView name, binder::Scope *scope, EnumLiteralTypeKind kind) in EnumLiteralType() argument 32 : Type(TypeFlag::ENUM_LITERAL), name_(name), scope_(scope), kind_(kind) in EnumLiteralType() 36 binder::Scope *Scope() in Scope() function 41 const binder::Scope *Scope() const in Scope() function 60 binder::Scope *scope_;
|
| /arkcompiler/ets_frontend/ets2panda/checker/types/ts/ |
| D | enumLiteralType.h | 22 class Scope; variable 30 EnumLiteralType(util::StringView name, varbinder::Scope *scope, EnumLiteralTypeKind kind) in EnumLiteralType() argument 31 : Type(TypeFlag::ENUM_LITERAL), name_(name), scope_(scope), kind_(kind) in EnumLiteralType() 35 varbinder::Scope *Scope() in Scope() function 40 const varbinder::Scope *Scope() const in Scope() function 59 varbinder::Scope *scope_;
|
| /arkcompiler/runtime_core/static_core/runtime/tooling/inspector/types/ |
| D | scope.cpp | 16 #include "types/scope.h" 21 static const char *GetTypeString(Scope::Type type) in GetTypeString() 24 case Scope::Type::GLOBAL: in GetTypeString() 26 case Scope::Type::LOCAL: in GetTypeString() 34 Scope::Scope(Scope::Type type, RemoteObject object, std::optional<std::string> name) in Scope() function in ark::tooling::inspector::Scope 39 void Scope::Serialize(JsonObjectBuilder &builder) const in Serialize()
|
| /arkcompiler/toolchain/tooling/static/types/ |
| D | scope.cpp | 16 #include "types/scope.h" 21 static const char *GetTypeString(Scope::Type type) in GetTypeString() 24 case Scope::Type::GLOBAL: in GetTypeString() 26 case Scope::Type::LOCAL: in GetTypeString() 34 Scope::Scope(Scope::Type type, RemoteObject object, std::optional<std::string> name) in Scope() function in ark::tooling::inspector::Scope 39 void Scope::Serialize(JsonObjectBuilder &builder) const in Serialize()
|
| /arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/ |
| D | capturedVariables.cpp | 26 static void AddScopes(ir::AstNode *node, std::set<varbinder::Scope *> &scopes) noexcept in AddScopes() 28 if (node->Scope()->IsFunctionScope()) { in AddScopes() 29 scopes.emplace(node->Scope()->AsFunctionScope()->ParamScope()); in AddScopes() 31 if (node->Scope()->IsCatchScope()) { in AddScopes() 32 scopes.emplace(node->Scope()->AsCatchScope()->ParamScope()); in AddScopes() 34 if (node->Scope()->IsLoopScope()) { in AddScopes() 35 scopes.emplace(node->Scope()->AsLoopScope()->DeclScope()); in AddScopes() 37 scopes.emplace(node->Scope()); in AddScopes() 40 static varbinder::Variable *FindVariable(ir::Identifier *ident, std::set<varbinder::Scope *> const … in FindVariable() 43 …// NOTE! For some unknown reasons :) variables exist in scope collections but are not set to iden… in FindVariable() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/evaluate/ |
| D | irCheckHelper.cpp | 31 bool IrCheckHelper::CheckNewNode(ir::AstNode *node, varbinder::Scope *scope, ir::AstNode *parentCla… in CheckNewNode() argument 39 if (scope == nullptr) { in CheckNewNode() 40 scope = checker_->Scope(); in CheckNewNode() 43 recursiveDecls_.emplace_back(program, scope, parentClass, node); in CheckNewNode() 72 auto [program, scope, parent, node] = recursiveDecls_.front(); in CheckDecls() 74 …pers::DoScopedAction(checker_, varBinder_, program, scope, parent, [this, node = node, scope = sco… in CheckDecls() 75 varBinder_->ResolveReferencesForScope(node, scope); in CheckDecls() 88 auto [program, scope, parent, node] = *iter; in HandleCustomNodes() 89 helpers::DoScopedAction(checker_, varBinder_, program, scope, parent, in HandleCustomNodes()
|
| D | irCheckHelper.h | 36 class Scope; variable 49 ScopedAstNode(parser::Program *p, varbinder::Scope *s, ir::AstNode *parent, ir::AstNode *n) in ScopedAstNode() 50 : program(p), scope(s), parentClass(parent), node(n) in ScopedAstNode() 56 varbinder::Scope *scope {nullptr}; 69 * @brief Runs scope and type checks on the given IR node 71 * @param scope to which node is relative to - if null, current checker scope is taken. 74 * either it or `scope` must be non-null. 77 …bool CheckNewNode(ir::AstNode *node, varbinder::Scope *scope, ir::AstNode *parentClass, parser::Pr…
|
| /arkcompiler/ets_frontend/es2panda/parser/transformer/ |
| D | transformer.h | 22 #include "binder/scope.h" 34 binder::Scope *scope; member 39 binder::Scope *scope; member 195 binder::Scope *FindExportVariableInTsModuleScope(util::StringView name) const; 196 …binder::Variable *FindTSModuleVariable(const ir::Expression *node, const binder::Scope *scope, boo… 200 …bool IsInstantiatedImportEquals(const ir::TSImportEqualsDeclaration *node, binder::Scope *scope) c… 221 bool IsStringInitForEnumMember(const ir::Expression *expr, binder::Scope *scope) const; 222 …bool IsStringForMemberExpression(const ir::MemberExpression *memberExpr, binder::Scope *scope) con… 225 binder::Scope *scope) const; 226 void FindLocalTSVariables(binder::Scope *scope, const util::StringView name, [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/homecheck/src/utils/checker/ |
| D | StringUtils.ts | 21 import { Scope } from '../../model/Scope'; 46 valueStmtInfo.scope = (tmpStmt as StmtExt).scope; 75 let scope = CheckerStorage.getInstance().getScope(importArkFile.getFilePath()); 76 if (!scope) { 79 for (let varDef of scope.defList) { 89 let defStmtInfo = new VarInfo(stmt, scope); 98 let scope: Scope = valueStmtInfo.scope; 101 if (!scope || !scope.defList) { 104 let defLists = scope.defList; 110 let nearReDefStmtInfo = new VarInfo(defVar.defStmt, scope); [all …]
|
| /arkcompiler/ets_frontend/arkguard/src/transformers/rename/ |
| D | RenameIdentifierTransformer.ts | 75 Scope, 129 * 3. do scope analysis for identifier obfuscations 203 let rootScope: Scope = manager.getRootScope(); 206 … let renameProcessors: ((scope: Scope) => void)[] = [renameLabelsInScope, renameNamesInScope]; 241 * @param scope scope, such as global, module, function, block 244 function getMangledNamesInScope(scope: Scope, processors: ((scope: Scope) => void)[]): void { 246 process(scope); 250 while (scope.children.length > 0) { 251 subScope = scope.children.pop(); 257 // process symbols in scope, exclude property name. [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/debugger/src/arkdb/ |
| D | layouts.py | 32 from .debug_types import DEFAULT_DEPTH, Frame, Paused, Scope 45 async def _add_rows(table: Table, scope: Scope): argument 47 f":red_triangle_pointed_down: [table.header]{scope.data.type_}[/table.header]", 48 Text(f"{scope.data.object_.description}", style="repr.str"), 50 props = await scope.mirror_variables() 74 …# NOTE(dslynko, #22497): now global scope is ignored by default, because it enumerates all classes… 77 for scope in frame.scopes(): 78 if (scopes is None or scope.data.type_ in scopes) and (scope.data.type_ not in skip_scopes): 79 await _add_rows(table, scope) 82 f":red_triangle_pointed_up: [table.header]{scope.data.type_}[/table.header]", [all …]
|