From b3229c2f0f768742f5d43d23572be7893674ee42 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Wed, 11 Jun 2025 13:41:20 +0300 Subject: [PATCH 1/9] Use cached context as instead of regular context Signed-off-by: Alexander Gorshenev --- ui2abc/libarkts/src-host/es2panda.ts | 44 +++++++++++++++++-- .../libarkts/src/arkts-api/peers/Context.ts | 17 ++++++- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/ui2abc/libarkts/src-host/es2panda.ts b/ui2abc/libarkts/src-host/es2panda.ts index 8f314a43e..bf1b629b7 100644 --- a/ui2abc/libarkts/src-host/es2panda.ts +++ b/ui2abc/libarkts/src-host/es2panda.ts @@ -15,12 +15,12 @@ import * as fs from "node:fs" import * as path from "node:path" -import { checkSDK, arktsGlobal as global, metaDatabase, runTransformer, CompilationOptions, findStdlib } from "@koalaui/libarkts" +import { checkSDK, arktsGlobal as global, metaDatabase, runTransformer, CompilationOptions, findStdlib, collectDependencies } from "@koalaui/libarkts" import { CheckedBackFilter, PluginContextImpl } from "@koalaui/libarkts" import { Command } from "commander" import { filterSource, isNumber, throwError } from "@koalaui/libarkts" import { Es2pandaContextState } from "@koalaui/libarkts" -import { Options, AstNode, Config, Context, createETSModuleFromContext, proceedToState, ProgramTransformer, rebindSubtree, recheckSubtree, dumpProgramInfo, dumpArkTsConfigInfo } from "@koalaui/libarkts" +import { Options, AstNode, Config, Context, GlobalContext, createETSModuleFromContext, proceedToState, ProgramTransformer, rebindSubtree, recheckSubtree, dumpProgramInfo, dumpArkTsConfigInfo } from "@koalaui/libarkts" function parseCommandLineArgs() { const commander = new Command() @@ -141,6 +141,7 @@ function restartCompiler(source: string, configPath: string, filePath: string, s } function invokeWithPlugins( + globalContext: GlobalContext, configPath: string, filePath: string, outputPath: string, @@ -171,7 +172,7 @@ function invokeWithPlugins( if (!global.configIsInitialized()) throw new Error(`Wrong config: path=${configPath} file=${filePath} stdlib=${stdlib} output=${outputPath}`) fs.mkdirSync(path.dirname(outputPath), {recursive: true}) - const compilerContext = Context.createFromFile(filePath, configPath, stdlib, outputPath)! + const compilerContext = Context.createCacheFromFile(filePath, compilerConfig, globalContext, true) global.compilerContext = compilerContext pluginNames.push(`_proceed_to_binary`) @@ -316,6 +317,37 @@ function readAndSortPlugins(configDir: string, plugins: any[]) { return pluginsByState } +function findDependencies(files: string[]): string[] { + // TODO: need dependencies + return files +} + +function findOutputDependencies(files: string[]): string[] { + // TODO: need dependencies + return files +} + +function createConfig(configPath: string, filePath?: string, outPath?: string): Config { + const values = [ + '_', + '--arktsconfig', + configPath, + '--extension', + 'ets', + '--stdlib', + findStdlib() + ] + if (outPath) { + values.push('--output') + values.push(outPath) + } + if (filePath) { + values.push(filePath) + } + console.log(values) + return Config.create(values) +} + export function main() { checkSDK() const { files, configPath, outputs, dumpAst, restartStages, stage } = parseCommandLineArgs() @@ -329,9 +361,13 @@ export function main() { const pluginNames = plugins.map((it: any) => `${it.name}-${it.stage}`) const pluginContext = new PluginContextImpl() const pluginsByState = readAndSortPlugins(configDir, plugins) + const filesWithDependencies = collectDependencies(files, configPath) + + const globalConfig = createConfig(configPath) + const globalContext = GlobalContext.create(globalConfig, filesWithDependencies) for (var i = 0; i < files.length; i++) { - invokeWithPlugins(configPath, files[i], outputs[i], pluginsByState, dumpAst, restartStages, stage, pluginNames, pluginContext) + invokeWithPlugins(globalContext, configPath, files[i], outputs[i], pluginsByState, dumpAst, restartStages, stage, pluginNames, pluginContext) } } diff --git a/ui2abc/libarkts/src/arkts-api/peers/Context.ts b/ui2abc/libarkts/src/arkts-api/peers/Context.ts index 83f5fd45b..d598bc939 100644 --- a/ui2abc/libarkts/src/arkts-api/peers/Context.ts +++ b/ui2abc/libarkts/src/arkts-api/peers/Context.ts @@ -62,7 +62,18 @@ export class Context extends ArktsObject { ) } - static createCacheFromFile(filePath: string, configPath: string, stdlibPath: string, globalContext: GlobalContext, isExternal: boolean) { + static createCacheFromFile(filePath: string, config: Config, globalContext: GlobalContext, isExternal: boolean) { + return new Context( + global.es2panda._CreateCacheContextFromFile( + config.peer, + passString(filePath), + globalContext.peer, + isExternal + ) + ) + } +/* + static createCacheFromFile(filePath: string, outputPath: string, configPath: string, stdlibPath: string, globalContext: GlobalContext, isExternal: boolean) { const config = Config.create([ "", "--arktsconfig", @@ -71,6 +82,8 @@ export class Context extends ArktsObject { 'ets', '--stdlib', stdlibPath, + '--output', + outputPath, filePath ]) return new Context( @@ -82,7 +95,7 @@ export class Context extends ArktsObject { ) ) } - +*/ destroy() { if (this.peer != nullptr) { global.es2panda._DestroyContext(this.peer) -- Gitee From 69e64826217063786e4292524747c654dac706de Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 11 Jun 2025 15:47:37 +0300 Subject: [PATCH 2/9] Update Signed-off-by: Nikolay Igotti --- incremental/tools/panda/arkts/ui2abc | 2 +- ui2abc/libarkts/src-host/es2panda.ts | 3 ++- ui2abc/libarkts/src/arkts-api/utilities/public.ts | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/incremental/tools/panda/arkts/ui2abc b/incremental/tools/panda/arkts/ui2abc index e9c4652a4..d362852ba 100755 --- a/incremental/tools/panda/arkts/ui2abc +++ b/incremental/tools/panda/arkts/ui2abc @@ -14,5 +14,5 @@ # limitations under the License. SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"` -PANDA_SDK_PATH=${PANDA_SDK_PATH:=$SCRIPT_DIR/../node_modules/@panda/sdk} node $SCRIPT_DIR/../../../../ui2abc/libarkts/lib/es2panda.js "$@" +echo PANDA_SDK_PATH=${PANDA_SDK_PATH:=$SCRIPT_DIR/../node_modules/@panda/sdk} node $SCRIPT_DIR/../../../../ui2abc/libarkts/lib/es2panda.js "$@" diff --git a/ui2abc/libarkts/src-host/es2panda.ts b/ui2abc/libarkts/src-host/es2panda.ts index bf1b629b7..b85e1851e 100644 --- a/ui2abc/libarkts/src-host/es2panda.ts +++ b/ui2abc/libarkts/src-host/es2panda.ts @@ -363,7 +363,8 @@ export function main() { const pluginsByState = readAndSortPlugins(configDir, plugins) const filesWithDependencies = collectDependencies(files, configPath) - const globalConfig = createConfig(configPath) + const globalConfig = createConfig(configPath, files[0], outputs[0]) + console.log(`found ${filesWithDependencies.length} dependencies ${filesWithDependencies[0]}`) const globalContext = GlobalContext.create(globalConfig, filesWithDependencies) for (var i = 0; i < files.length; i++) { diff --git a/ui2abc/libarkts/src/arkts-api/utilities/public.ts b/ui2abc/libarkts/src/arkts-api/utilities/public.ts index d9668af9c..e21932974 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/public.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/public.ts @@ -36,6 +36,7 @@ import { Config } from "../peers/Config" import { Context } from "../peers/Context" import { NodeCache } from "../node-cache" import { programGetExternalSources } from "../node-utilities/Program" +import { defaultFilter, listPrograms } from "../plugins" export function createETSModuleFromContext(): ETSModule { let program = global.es2panda._ContextProgram(global.context) @@ -217,11 +218,14 @@ export function collectDependencies(files: string[], configPath: string): string for (let file of files) { const context = Context.createFromFile(file, configPath, findStdlib(), "/tmp/foo.abc")! global.compilerContext = context + proceedToState(Es2pandaContextState.ES2PANDA_STATE_PARSED) let sources = programGetExternalSources(context.program, context.peer) sources.forEach(source => { - source.programs.forEach(program => { - result.add(program.absoluteName) - }) + if (defaultFilter(source.getName())) + source.programs.forEach(program => { + if (defaultFilter(program.moduleName)) + result.add(program.absoluteName) + }) }) context.destroy() } -- Gitee From bfc32940cd657424d02625c4dbb9cb663e54ebee Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 11 Jun 2025 16:08:01 +0300 Subject: [PATCH 3/9] Typo Signed-off-by: Nikolay Igotti --- incremental/tools/panda/arkts/ui2abc | 2 +- ui2abc/libarkts/src-host/es2panda.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/incremental/tools/panda/arkts/ui2abc b/incremental/tools/panda/arkts/ui2abc index d362852ba..e9c4652a4 100755 --- a/incremental/tools/panda/arkts/ui2abc +++ b/incremental/tools/panda/arkts/ui2abc @@ -14,5 +14,5 @@ # limitations under the License. SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"` -echo PANDA_SDK_PATH=${PANDA_SDK_PATH:=$SCRIPT_DIR/../node_modules/@panda/sdk} node $SCRIPT_DIR/../../../../ui2abc/libarkts/lib/es2panda.js "$@" +PANDA_SDK_PATH=${PANDA_SDK_PATH:=$SCRIPT_DIR/../node_modules/@panda/sdk} node $SCRIPT_DIR/../../../../ui2abc/libarkts/lib/es2panda.js "$@" diff --git a/ui2abc/libarkts/src-host/es2panda.ts b/ui2abc/libarkts/src-host/es2panda.ts index b85e1851e..52191db8c 100644 --- a/ui2abc/libarkts/src-host/es2panda.ts +++ b/ui2abc/libarkts/src-host/es2panda.ts @@ -364,7 +364,6 @@ export function main() { const filesWithDependencies = collectDependencies(files, configPath) const globalConfig = createConfig(configPath, files[0], outputs[0]) - console.log(`found ${filesWithDependencies.length} dependencies ${filesWithDependencies[0]}`) const globalContext = GlobalContext.create(globalConfig, filesWithDependencies) for (var i = 0; i < files.length; i++) { -- Gitee From d5c7f51da8de6c592346bc8f9c189cc4ce4176a6 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 11 Jun 2025 16:42:07 +0300 Subject: [PATCH 4/9] Update Signed-off-by: Nikolay Igotti --- .../libarkts/native/src/generated/bridges.cc | 101 +++++- ui2abc/libarkts/src-host/es2panda.ts | 3 + .../src/arkts-api/utilities/public.ts | 1 + .../libarkts/src/generated/Es2pandaEnums.ts | 314 +++++++++--------- .../src/generated/Es2pandaNativeModule.ts | 33 +- .../src/generated/peers/ClassDefinition.ts | 8 +- .../src/generated/peers/IfStatement.ts | 5 + .../libarkts/src/generated/peers/Literal.ts | 8 + .../libarkts/src/generated/peers/SrcDumper.ts | 22 +- .../src/generated/peers/UnaryExpression.ts | 5 + .../src/generated/peers/WhileStatement.ts | 5 + ui2abc/libarkts/src/plugin-utils.ts | 16 +- 12 files changed, 320 insertions(+), 201 deletions(-) diff --git a/ui2abc/libarkts/native/src/generated/bridges.cc b/ui2abc/libarkts/native/src/generated/bridges.cc index b91259ba4..d8d866576 100644 --- a/ui2abc/libarkts/native/src/generated/bridges.cc +++ b/ui2abc/libarkts/native/src/generated/bridges.cc @@ -625,6 +625,16 @@ KNativePointer impl_IfStatementTest(KNativePointer context, KNativePointer recei } KOALA_INTEROP_2(IfStatementTest, KNativePointer, KNativePointer, KNativePointer); +void impl_IfStatementSetTest(KNativePointer context, KNativePointer receiver, KNativePointer test) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + const auto _test = reinterpret_cast(test); + GetImpl()->IfStatementSetTest(_context, _receiver, _test); + return ; +} +KOALA_INTEROP_V3(IfStatementSetTest, KNativePointer, KNativePointer, KNativePointer); + KNativePointer impl_IfStatementConsequentConst(KNativePointer context, KNativePointer receiver) { const auto _context = reinterpret_cast(context); @@ -4867,19 +4877,19 @@ KNativePointer impl_ClassDefinitionFunctionalReferenceReferencedMethodConst(KNat const auto _context = reinterpret_cast(context); const auto _receiver = reinterpret_cast(receiver); auto result = GetImpl()->ClassDefinitionFunctionalReferenceReferencedMethodConst(_context, _receiver); - return StageArena::strdup(result); + return (void*)result; } KOALA_INTEROP_2(ClassDefinitionFunctionalReferenceReferencedMethodConst, KNativePointer, KNativePointer, KNativePointer); -void impl_ClassDefinitionSetFunctionalReferenceReferencedMethod(KNativePointer context, KNativePointer receiver, KStringPtr& functionalReferenceReferencedMethod) +void impl_ClassDefinitionSetFunctionalReferenceReferencedMethod(KNativePointer context, KNativePointer receiver, KNativePointer functionalReferenceReferencedMethod) { const auto _context = reinterpret_cast(context); const auto _receiver = reinterpret_cast(receiver); - const auto _functionalReferenceReferencedMethod = getStringCopy(functionalReferenceReferencedMethod); + const auto _functionalReferenceReferencedMethod = reinterpret_cast(functionalReferenceReferencedMethod); GetImpl()->ClassDefinitionSetFunctionalReferenceReferencedMethod(_context, _receiver, _functionalReferenceReferencedMethod); return ; } -KOALA_INTEROP_V3(ClassDefinitionSetFunctionalReferenceReferencedMethod, KNativePointer, KNativePointer, KStringPtr); +KOALA_INTEROP_V3(ClassDefinitionSetFunctionalReferenceReferencedMethod, KNativePointer, KNativePointer, KNativePointer); KNativePointer impl_ClassDefinitionLocalPrefixConst(KNativePointer context, KNativePointer receiver) { @@ -6890,6 +6900,16 @@ KNativePointer impl_UnaryExpressionArgumentConst(KNativePointer context, KNative } KOALA_INTEROP_2(UnaryExpressionArgumentConst, KNativePointer, KNativePointer, KNativePointer); +void impl_UnaryExpressionSetArgument(KNativePointer context, KNativePointer receiver, KNativePointer arg) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + const auto _arg = reinterpret_cast(arg); + GetImpl()->UnaryExpressionSetArgument(_context, _receiver, _arg); + return ; +} +KOALA_INTEROP_V3(UnaryExpressionSetArgument, KNativePointer, KNativePointer, KNativePointer); + KNativePointer impl_CreateForInStatement(KNativePointer context, KNativePointer left, KNativePointer right, KNativePointer body) { const auto _context = reinterpret_cast(context); @@ -8433,6 +8453,25 @@ KNativePointer impl_TSParenthesizedTypeTypeConst(KNativePointer context, KNative } KOALA_INTEROP_2(TSParenthesizedTypeTypeConst, KNativePointer, KNativePointer, KNativePointer); +KBoolean impl_LiteralIsFoldedConst(KNativePointer context, KNativePointer receiver) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + auto result = GetImpl()->LiteralIsFoldedConst(_context, _receiver); + return result; +} +KOALA_INTEROP_2(LiteralIsFoldedConst, KBoolean, KNativePointer, KNativePointer); + +void impl_LiteralSetFolded(KNativePointer context, KNativePointer receiver, KBoolean folded) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + const auto _folded = static_cast(folded); + GetImpl()->LiteralSetFolded(_context, _receiver, _folded); + return ; +} +KOALA_INTEROP_V3(LiteralSetFolded, KNativePointer, KNativePointer, KBoolean); + KNativePointer impl_CreateCharLiteral(KNativePointer context) { const auto _context = reinterpret_cast(context); @@ -9188,6 +9227,16 @@ KNativePointer impl_WhileStatementTest(KNativePointer context, KNativePointer re } KOALA_INTEROP_2(WhileStatementTest, KNativePointer, KNativePointer, KNativePointer); +void impl_WhileStatementSetTest(KNativePointer context, KNativePointer receiver, KNativePointer test) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + const auto _test = reinterpret_cast(test); + GetImpl()->WhileStatementSetTest(_context, _receiver, _test); + return ; +} +KOALA_INTEROP_V3(WhileStatementSetTest, KNativePointer, KNativePointer, KNativePointer); + KNativePointer impl_WhileStatementBodyConst(KNativePointer context, KNativePointer receiver) { const auto _context = reinterpret_cast(context); @@ -12030,45 +12079,65 @@ void impl_SrcDumperAdd(KNativePointer context, KNativePointer receiver, KStringP } KOALA_INTEROP_V3(SrcDumperAdd, KNativePointer, KNativePointer, KStringPtr); -void impl_SrcDumperAdd1(KNativePointer context, KNativePointer receiver, KInt i) +void impl_SrcDumperAdd1(KNativePointer context, KNativePointer receiver, KBoolean i) { const auto _context = reinterpret_cast(context); const auto _receiver = reinterpret_cast(receiver); - const auto _i = static_cast(i); + const auto _i = static_cast(i); GetImpl()->SrcDumperAdd1(_context, _receiver, _i); return ; } -KOALA_INTEROP_V3(SrcDumperAdd1, KNativePointer, KNativePointer, KInt); +KOALA_INTEROP_V3(SrcDumperAdd1, KNativePointer, KNativePointer, KBoolean); + +void impl_SrcDumperAdd2(KNativePointer context, KNativePointer receiver, KInt i) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + const auto _i = static_cast(i); + GetImpl()->SrcDumperAdd2(_context, _receiver, _i); + return ; +} +KOALA_INTEROP_V3(SrcDumperAdd2, KNativePointer, KNativePointer, KInt); + +void impl_SrcDumperAdd3(KNativePointer context, KNativePointer receiver, KInt i) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + const auto _i = static_cast(i); + GetImpl()->SrcDumperAdd3(_context, _receiver, _i); + return ; +} +KOALA_INTEROP_V3(SrcDumperAdd3, KNativePointer, KNativePointer, KInt); -void impl_SrcDumperAdd2(KNativePointer context, KNativePointer receiver, KLong l) +void impl_SrcDumperAdd4(KNativePointer context, KNativePointer receiver, KLong l) { const auto _context = reinterpret_cast(context); const auto _receiver = reinterpret_cast(receiver); const auto _l = static_cast(l); - GetImpl()->SrcDumperAdd2(_context, _receiver, _l); + GetImpl()->SrcDumperAdd4(_context, _receiver, _l); return ; } -KOALA_INTEROP_V3(SrcDumperAdd2, KNativePointer, KNativePointer, KLong); +KOALA_INTEROP_V3(SrcDumperAdd4, KNativePointer, KNativePointer, KLong); -void impl_SrcDumperAdd3(KNativePointer context, KNativePointer receiver, KFloat f) +void impl_SrcDumperAdd5(KNativePointer context, KNativePointer receiver, KFloat f) { const auto _context = reinterpret_cast(context); const auto _receiver = reinterpret_cast(receiver); const auto _f = static_cast(f); - GetImpl()->SrcDumperAdd3(_context, _receiver, _f); + GetImpl()->SrcDumperAdd5(_context, _receiver, _f); return ; } -KOALA_INTEROP_V3(SrcDumperAdd3, KNativePointer, KNativePointer, KFloat); +KOALA_INTEROP_V3(SrcDumperAdd5, KNativePointer, KNativePointer, KFloat); -void impl_SrcDumperAdd4(KNativePointer context, KNativePointer receiver, KDouble d) +void impl_SrcDumperAdd6(KNativePointer context, KNativePointer receiver, KDouble d) { const auto _context = reinterpret_cast(context); const auto _receiver = reinterpret_cast(receiver); const auto _d = static_cast(d); - GetImpl()->SrcDumperAdd4(_context, _receiver, _d); + GetImpl()->SrcDumperAdd6(_context, _receiver, _d); return ; } -KOALA_INTEROP_V3(SrcDumperAdd4, KNativePointer, KNativePointer, KDouble); +KOALA_INTEROP_V3(SrcDumperAdd6, KNativePointer, KNativePointer, KDouble); KNativePointer impl_SrcDumperStrConst(KNativePointer context, KNativePointer receiver) { diff --git a/ui2abc/libarkts/src-host/es2panda.ts b/ui2abc/libarkts/src-host/es2panda.ts index 52191db8c..37ffd5657 100644 --- a/ui2abc/libarkts/src-host/es2panda.ts +++ b/ui2abc/libarkts/src-host/es2panda.ts @@ -172,6 +172,7 @@ function invokeWithPlugins( if (!global.configIsInitialized()) throw new Error(`Wrong config: path=${configPath} file=${filePath} stdlib=${stdlib} output=${outputPath}`) fs.mkdirSync(path.dirname(outputPath), {recursive: true}) + console.log(`will create ${globalContext.peer.toString(16)} ${filePath}`) const compilerContext = Context.createCacheFromFile(filePath, compilerConfig, globalContext, true) global.compilerContext = compilerContext @@ -369,6 +370,8 @@ export function main() { for (var i = 0; i < files.length; i++) { invokeWithPlugins(globalContext, configPath, files[i], outputs[i], pluginsByState, dumpAst, restartStages, stage, pluginNames, pluginContext) } + globalContext.destroy() + globalConfig.destroy() } function reportErrorAndExit(message: string): never { diff --git a/ui2abc/libarkts/src/arkts-api/utilities/public.ts b/ui2abc/libarkts/src/arkts-api/utilities/public.ts index e21932974..2e105dbf6 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/public.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/public.ts @@ -215,6 +215,7 @@ export function findStdlib(): string { export function collectDependencies(files: string[], configPath: string): string[] { const result = new Set() + files.forEach(it => result.add(it)) for (let file of files) { const context = Context.createFromFile(file, configPath, findStdlib(), "/tmp/foo.abc")! global.compilerContext = context diff --git a/ui2abc/libarkts/src/generated/Es2pandaEnums.ts b/ui2abc/libarkts/src/generated/Es2pandaEnums.ts index 07b1308ff..446f0536a 100644 --- a/ui2abc/libarkts/src/generated/Es2pandaEnums.ts +++ b/ui2abc/libarkts/src/generated/Es2pandaEnums.ts @@ -626,28 +626,6 @@ export enum Es2pandaMappedOption { MAPPED_OPTION_PLUS = 1, MAPPED_OPTION_MINUS = 2 } -export enum Es2pandaBoxingUnboxingFlags { - BOXING_UNBOXING_FLAGS_NONE = 0, - BOXING_UNBOXING_FLAGS_BOX_TO_BOOLEAN = 1, - BOXING_UNBOXING_FLAGS_BOX_TO_BYTE = 2, - BOXING_UNBOXING_FLAGS_BOX_TO_SHORT = 4, - BOXING_UNBOXING_FLAGS_BOX_TO_CHAR = 8, - BOXING_UNBOXING_FLAGS_BOX_TO_INT = 16, - BOXING_UNBOXING_FLAGS_BOX_TO_LONG = 32, - BOXING_UNBOXING_FLAGS_BOX_TO_FLOAT = 64, - BOXING_UNBOXING_FLAGS_BOX_TO_DOUBLE = 128, - BOXING_UNBOXING_FLAGS_BOX_TO_ENUM = 256, - BOXING_UNBOXING_FLAGS_UNBOX_TO_BOOLEAN = 512, - BOXING_UNBOXING_FLAGS_UNBOX_TO_BYTE = 1024, - BOXING_UNBOXING_FLAGS_UNBOX_TO_SHORT = 2048, - BOXING_UNBOXING_FLAGS_UNBOX_TO_CHAR = 4096, - BOXING_UNBOXING_FLAGS_UNBOX_TO_INT = 8192, - BOXING_UNBOXING_FLAGS_UNBOX_TO_LONG = 16384, - BOXING_UNBOXING_FLAGS_UNBOX_TO_FLOAT = 32768, - BOXING_UNBOXING_FLAGS_UNBOX_TO_DOUBLE = 65536, - BOXING_UNBOXING_FLAGS_BOXING_FLAG = 511, - BOXING_UNBOXING_FLAGS_UNBOXING_FLAG = 130560 -} export enum Es2pandaClassDefinitionModifiers { CLASS_DEFINITION_MODIFIERS_NONE = 0, CLASS_DEFINITION_MODIFIERS_DECLARATION = 1, @@ -689,35 +667,37 @@ export enum Es2pandaOperandType { } export enum Es2pandaTypeRelationFlag { TYPE_RELATION_FLAG_NONE = 0, - TYPE_RELATION_FLAG_NARROWING = 1, - TYPE_RELATION_FLAG_WIDENING = 2, - TYPE_RELATION_FLAG_BOXING = 4, - TYPE_RELATION_FLAG_UNBOXING = 8, - TYPE_RELATION_FLAG_CAPTURE = 16, - TYPE_RELATION_FLAG_STRING = 32, - TYPE_RELATION_FLAG_VALUE_SET = 64, - TYPE_RELATION_FLAG_UNCHECKED = 128, - TYPE_RELATION_FLAG_NO_THROW = 256, - TYPE_RELATION_FLAG_SELF_REFERENCE = 512, - TYPE_RELATION_FLAG_NO_RETURN_TYPE_CHECK = 1024, - TYPE_RELATION_FLAG_DIRECT_RETURN = 2048, - TYPE_RELATION_FLAG_NO_WIDENING = 4096, - TYPE_RELATION_FLAG_NO_BOXING = 8192, - TYPE_RELATION_FLAG_NO_UNBOXING = 16384, - TYPE_RELATION_FLAG_ONLY_CHECK_WIDENING = 32768, - TYPE_RELATION_FLAG_ONLY_CHECK_BOXING_UNBOXING = 65536, - TYPE_RELATION_FLAG_IN_ASSIGNMENT_CONTEXT = 131072, - TYPE_RELATION_FLAG_IN_CASTING_CONTEXT = 262144, - TYPE_RELATION_FLAG_UNCHECKED_CAST = 524288, - TYPE_RELATION_FLAG_IGNORE_TYPE_PARAMETERS = 1048576, - TYPE_RELATION_FLAG_CHECK_PROXY = 2097152, - TYPE_RELATION_FLAG_NO_CHECK_TRAILING_LAMBDA = 4194304, - TYPE_RELATION_FLAG_NO_THROW_GENERIC_TYPEALIAS = 8388608, - TYPE_RELATION_FLAG_OVERRIDING_CONTEXT = 16777216, - TYPE_RELATION_FLAG_IGNORE_REST_PARAM = 33554432, - TYPE_RELATION_FLAG_ASSIGNMENT_CONTEXT = 14, - TYPE_RELATION_FLAG_BRIDGE_CHECK = 17826816, - TYPE_RELATION_FLAG_CASTING_CONTEXT = 524303 + TYPE_RELATION_FLAG_WIDENING = 1, + TYPE_RELATION_FLAG_BOXING = 2, + TYPE_RELATION_FLAG_UNBOXING = 4, + TYPE_RELATION_FLAG_CAPTURE = 8, + TYPE_RELATION_FLAG_STRING = 16, + TYPE_RELATION_FLAG_VALUE_SET = 32, + TYPE_RELATION_FLAG_UNCHECKED = 64, + TYPE_RELATION_FLAG_NO_THROW = 128, + TYPE_RELATION_FLAG_SELF_REFERENCE = 256, + TYPE_RELATION_FLAG_NO_RETURN_TYPE_CHECK = 512, + TYPE_RELATION_FLAG_DIRECT_RETURN = 1024, + TYPE_RELATION_FLAG_NO_WIDENING = 2048, + TYPE_RELATION_FLAG_NO_BOXING = 4096, + TYPE_RELATION_FLAG_NO_UNBOXING = 8192, + TYPE_RELATION_FLAG_ONLY_CHECK_WIDENING = 16384, + TYPE_RELATION_FLAG_ONLY_CHECK_BOXING_UNBOXING = 32768, + TYPE_RELATION_FLAG_IN_ASSIGNMENT_CONTEXT = 65536, + TYPE_RELATION_FLAG_IN_CASTING_CONTEXT = 131072, + TYPE_RELATION_FLAG_UNCHECKED_CAST = 262144, + TYPE_RELATION_FLAG_IGNORE_TYPE_PARAMETERS = 524288, + TYPE_RELATION_FLAG_CHECK_PROXY = 1048576, + TYPE_RELATION_FLAG_NO_CHECK_TRAILING_LAMBDA = 2097152, + TYPE_RELATION_FLAG_NO_THROW_GENERIC_TYPEALIAS = 4194304, + TYPE_RELATION_FLAG_OVERRIDING_CONTEXT = 8388608, + TYPE_RELATION_FLAG_IGNORE_REST_PARAM = 16777216, + TYPE_RELATION_FLAG_STRING_TO_CHAR = 33554432, + TYPE_RELATION_FLAG_OVERLOADING_CONTEXT = 67108864, + TYPE_RELATION_FLAG_NO_SUBSTITUTION_NEEDED = 134217728, + TYPE_RELATION_FLAG_ASSIGNMENT_CONTEXT = 7, + TYPE_RELATION_FLAG_BRIDGE_CHECK = 8912896, + TYPE_RELATION_FLAG_CASTING_CONTEXT = 262151 } export enum Es2pandaRelationResult { RELATION_RESULT_TRUE = 0, @@ -834,6 +814,7 @@ export enum Es2pandaSignatureFlags { SIGNATURE_FLAGS_RETHROWS = 131072, SIGNATURE_FLAGS_EXTENSION_FUNCTION = 262144, SIGNATURE_FLAGS_DUPLICATE_ASM = 524288, + SIGNATURE_FLAGS_BRIDGE = 1048576, SIGNATURE_FLAGS_INTERNAL_PROTECTED = 1040, SIGNATURE_FLAGS_GETTER_OR_SETTER = 49152, SIGNATURE_FLAGS_THROWING = 196608 @@ -985,31 +966,31 @@ export enum Es2pandaGlobalTypeId { GLOBAL_TYPE_ID_ETS_INT_BUILTIN = 51, GLOBAL_TYPE_ID_ETS_INTEGRAL_BUILTIN = 52, GLOBAL_TYPE_ID_ETS_LONG_BUILTIN = 53, - GLOBAL_TYPE_ID_ETS_MAP_BUILTIN = 54, - GLOBAL_TYPE_ID_ETS_RECORD_BUILTIN = 55, - GLOBAL_TYPE_ID_ETS_ERROR_BUILTIN = 56, - GLOBAL_TYPE_ID_ETS_RUNTIME_BUILTIN = 57, - GLOBAL_TYPE_ID_ETS_RUNTIME_LINKER_BUILTIN = 58, - GLOBAL_TYPE_ID_ETS_SET_BUILTIN = 59, - GLOBAL_TYPE_ID_ETS_SHORT_BUILTIN = 60, - GLOBAL_TYPE_ID_ETS_STACK_TRACE_ELEMENT_BUILTIN = 61, - GLOBAL_TYPE_ID_ETS_STACK_TRACE_BUILTIN = 62, - GLOBAL_TYPE_ID_ETS_ARRAY_INDEX_OUT_OF_BOUNDS_ERROR_BUILTIN = 63, - GLOBAL_TYPE_ID_ETS_ARITHMETIC_ERROR_BUILTIN = 64, - GLOBAL_TYPE_ID_ETS_CLASS_CAST_ERROR_BUILTIN = 65, - GLOBAL_TYPE_ID_ETS_ASSERTION_ERROR_BUILTIN = 66, - GLOBAL_TYPE_ID_ETS_DIVIDE_BY_ZERO_ERROR_BUILTIN = 67, - GLOBAL_TYPE_ID_ETS_NULL_POINTER_ERROR_BUILTIN = 68, - GLOBAL_TYPE_ID_ETS_UNCAUGHT_EXCEPTION_ERROR_BUILTIN = 69, - GLOBAL_TYPE_ID_ETS_STRING_BUILTIN = 70, - GLOBAL_TYPE_ID_ETS_STRING_BUILDER_BUILTIN = 71, - GLOBAL_TYPE_ID_ETS_TYPE_BUILTIN = 72, - GLOBAL_TYPE_ID_ETS_TYPES_BUILTIN = 73, - GLOBAL_TYPE_ID_ETS_PROMISE_BUILTIN = 74, - GLOBAL_TYPE_ID_ETS_FUNCTION_BUILTIN = 75, - GLOBAL_TYPE_ID_ETS_REGEXP_BUILTIN = 76, - GLOBAL_TYPE_ID_ETS_ARRAY_BUILTIN = 77, - GLOBAL_TYPE_ID_ETS_ARRAY = 78, + GLOBAL_TYPE_ID_ETS_NUMERIC_BUILTIN = 54, + GLOBAL_TYPE_ID_ETS_MAP_BUILTIN = 55, + GLOBAL_TYPE_ID_ETS_RECORD_BUILTIN = 56, + GLOBAL_TYPE_ID_ETS_ERROR_BUILTIN = 57, + GLOBAL_TYPE_ID_ETS_RUNTIME_BUILTIN = 58, + GLOBAL_TYPE_ID_ETS_RUNTIME_LINKER_BUILTIN = 59, + GLOBAL_TYPE_ID_ETS_SET_BUILTIN = 60, + GLOBAL_TYPE_ID_ETS_SHORT_BUILTIN = 61, + GLOBAL_TYPE_ID_ETS_STACK_TRACE_ELEMENT_BUILTIN = 62, + GLOBAL_TYPE_ID_ETS_STACK_TRACE_BUILTIN = 63, + GLOBAL_TYPE_ID_ETS_ARRAY_INDEX_OUT_OF_BOUNDS_ERROR_BUILTIN = 64, + GLOBAL_TYPE_ID_ETS_ARITHMETIC_ERROR_BUILTIN = 65, + GLOBAL_TYPE_ID_ETS_CLASS_CAST_ERROR_BUILTIN = 66, + GLOBAL_TYPE_ID_ETS_ASSERTION_ERROR_BUILTIN = 67, + GLOBAL_TYPE_ID_ETS_DIVIDE_BY_ZERO_ERROR_BUILTIN = 68, + GLOBAL_TYPE_ID_ETS_NULL_POINTER_ERROR_BUILTIN = 69, + GLOBAL_TYPE_ID_ETS_UNCAUGHT_EXCEPTION_ERROR_BUILTIN = 70, + GLOBAL_TYPE_ID_ETS_STRING_BUILTIN = 71, + GLOBAL_TYPE_ID_ETS_STRING_BUILDER_BUILTIN = 72, + GLOBAL_TYPE_ID_ETS_TYPE_BUILTIN = 73, + GLOBAL_TYPE_ID_ETS_TYPES_BUILTIN = 74, + GLOBAL_TYPE_ID_ETS_PROMISE_BUILTIN = 75, + GLOBAL_TYPE_ID_ETS_FUNCTION_BUILTIN = 76, + GLOBAL_TYPE_ID_ETS_REGEXP_BUILTIN = 77, + GLOBAL_TYPE_ID_ETS_ARRAY_BUILTIN = 78, GLOBAL_TYPE_ID_ETS_INTEROP_JSRUNTIME_BUILTIN = 79, GLOBAL_TYPE_ID_ETS_INTEROP_JSVALUE_BUILTIN = 80, GLOBAL_TYPE_ID_ETS_BOX_BUILTIN = 81, @@ -1023,96 +1004,97 @@ export enum Es2pandaGlobalTypeId { GLOBAL_TYPE_ID_ETS_DOUBLE_BOX_BUILTIN = 89, GLOBAL_TYPE_ID_ETS_BIG_INT_BUILTIN = 90, GLOBAL_TYPE_ID_ETS_BIG_INT = 91, - GLOBAL_TYPE_ID_ETS_FUNCTION0_CLASS = 92, - GLOBAL_TYPE_ID_ETS_FUNCTION1_CLASS = 93, - GLOBAL_TYPE_ID_ETS_FUNCTION2_CLASS = 94, - GLOBAL_TYPE_ID_ETS_FUNCTION3_CLASS = 95, - GLOBAL_TYPE_ID_ETS_FUNCTION4_CLASS = 96, - GLOBAL_TYPE_ID_ETS_FUNCTION5_CLASS = 97, - GLOBAL_TYPE_ID_ETS_FUNCTION6_CLASS = 98, - GLOBAL_TYPE_ID_ETS_FUNCTION7_CLASS = 99, - GLOBAL_TYPE_ID_ETS_FUNCTION8_CLASS = 100, - GLOBAL_TYPE_ID_ETS_FUNCTION9_CLASS = 101, - GLOBAL_TYPE_ID_ETS_FUNCTION10_CLASS = 102, - GLOBAL_TYPE_ID_ETS_FUNCTION11_CLASS = 103, - GLOBAL_TYPE_ID_ETS_FUNCTION12_CLASS = 104, - GLOBAL_TYPE_ID_ETS_FUNCTION13_CLASS = 105, - GLOBAL_TYPE_ID_ETS_FUNCTION14_CLASS = 106, - GLOBAL_TYPE_ID_ETS_FUNCTION15_CLASS = 107, - GLOBAL_TYPE_ID_ETS_FUNCTION16_CLASS = 108, - GLOBAL_TYPE_ID_ETS_FUNCTIONN_CLASS = 109, - GLOBAL_TYPE_ID_ETS_LAMBDA0_CLASS = 110, - GLOBAL_TYPE_ID_ETS_LAMBDA1_CLASS = 111, - GLOBAL_TYPE_ID_ETS_LAMBDA2_CLASS = 112, - GLOBAL_TYPE_ID_ETS_LAMBDA3_CLASS = 113, - GLOBAL_TYPE_ID_ETS_LAMBDA4_CLASS = 114, - GLOBAL_TYPE_ID_ETS_LAMBDA5_CLASS = 115, - GLOBAL_TYPE_ID_ETS_LAMBDA6_CLASS = 116, - GLOBAL_TYPE_ID_ETS_LAMBDA7_CLASS = 117, - GLOBAL_TYPE_ID_ETS_LAMBDA8_CLASS = 118, - GLOBAL_TYPE_ID_ETS_LAMBDA9_CLASS = 119, - GLOBAL_TYPE_ID_ETS_LAMBDA10_CLASS = 120, - GLOBAL_TYPE_ID_ETS_LAMBDA11_CLASS = 121, - GLOBAL_TYPE_ID_ETS_LAMBDA12_CLASS = 122, - GLOBAL_TYPE_ID_ETS_LAMBDA13_CLASS = 123, - GLOBAL_TYPE_ID_ETS_LAMBDA14_CLASS = 124, - GLOBAL_TYPE_ID_ETS_LAMBDA15_CLASS = 125, - GLOBAL_TYPE_ID_ETS_LAMBDA16_CLASS = 126, - GLOBAL_TYPE_ID_ETS_LAMBDAN_CLASS = 127, - GLOBAL_TYPE_ID_ETS_FUNCTIONR0_CLASS = 128, - GLOBAL_TYPE_ID_ETS_FUNCTIONR1_CLASS = 129, - GLOBAL_TYPE_ID_ETS_FUNCTIONR2_CLASS = 130, - GLOBAL_TYPE_ID_ETS_FUNCTIONR3_CLASS = 131, - GLOBAL_TYPE_ID_ETS_FUNCTIONR4_CLASS = 132, - GLOBAL_TYPE_ID_ETS_FUNCTIONR5_CLASS = 133, - GLOBAL_TYPE_ID_ETS_FUNCTIONR6_CLASS = 134, - GLOBAL_TYPE_ID_ETS_FUNCTIONR7_CLASS = 135, - GLOBAL_TYPE_ID_ETS_FUNCTIONR8_CLASS = 136, - GLOBAL_TYPE_ID_ETS_FUNCTIONR9_CLASS = 137, - GLOBAL_TYPE_ID_ETS_FUNCTIONR10_CLASS = 138, - GLOBAL_TYPE_ID_ETS_FUNCTIONR11_CLASS = 139, - GLOBAL_TYPE_ID_ETS_FUNCTIONR12_CLASS = 140, - GLOBAL_TYPE_ID_ETS_FUNCTIONR13_CLASS = 141, - GLOBAL_TYPE_ID_ETS_FUNCTIONR14_CLASS = 142, - GLOBAL_TYPE_ID_ETS_FUNCTIONR15_CLASS = 143, - GLOBAL_TYPE_ID_ETS_FUNCTIONR16_CLASS = 144, - GLOBAL_TYPE_ID_ETS_LAMBDAR0_CLASS = 145, - GLOBAL_TYPE_ID_ETS_LAMBDAR1_CLASS = 146, - GLOBAL_TYPE_ID_ETS_LAMBDAR2_CLASS = 147, - GLOBAL_TYPE_ID_ETS_LAMBDAR3_CLASS = 148, - GLOBAL_TYPE_ID_ETS_LAMBDAR4_CLASS = 149, - GLOBAL_TYPE_ID_ETS_LAMBDAR5_CLASS = 150, - GLOBAL_TYPE_ID_ETS_LAMBDAR6_CLASS = 151, - GLOBAL_TYPE_ID_ETS_LAMBDAR7_CLASS = 152, - GLOBAL_TYPE_ID_ETS_LAMBDAR8_CLASS = 153, - GLOBAL_TYPE_ID_ETS_LAMBDAR9_CLASS = 154, - GLOBAL_TYPE_ID_ETS_LAMBDAR10_CLASS = 155, - GLOBAL_TYPE_ID_ETS_LAMBDAR11_CLASS = 156, - GLOBAL_TYPE_ID_ETS_LAMBDAR12_CLASS = 157, - GLOBAL_TYPE_ID_ETS_LAMBDAR13_CLASS = 158, - GLOBAL_TYPE_ID_ETS_LAMBDAR14_CLASS = 159, - GLOBAL_TYPE_ID_ETS_LAMBDAR15_CLASS = 160, - GLOBAL_TYPE_ID_ETS_LAMBDAR16_CLASS = 161, - GLOBAL_TYPE_ID_ETS_TUPLE0_CLASS = 162, - GLOBAL_TYPE_ID_ETS_TUPLE1_CLASS = 163, - GLOBAL_TYPE_ID_ETS_TUPLE2_CLASS = 164, - GLOBAL_TYPE_ID_ETS_TUPLE3_CLASS = 165, - GLOBAL_TYPE_ID_ETS_TUPLE4_CLASS = 166, - GLOBAL_TYPE_ID_ETS_TUPLE5_CLASS = 167, - GLOBAL_TYPE_ID_ETS_TUPLE6_CLASS = 168, - GLOBAL_TYPE_ID_ETS_TUPLE7_CLASS = 169, - GLOBAL_TYPE_ID_ETS_TUPLE8_CLASS = 170, - GLOBAL_TYPE_ID_ETS_TUPLE9_CLASS = 171, - GLOBAL_TYPE_ID_ETS_TUPLE10_CLASS = 172, - GLOBAL_TYPE_ID_ETS_TUPLE11_CLASS = 173, - GLOBAL_TYPE_ID_ETS_TUPLE12_CLASS = 174, - GLOBAL_TYPE_ID_ETS_TUPLE13_CLASS = 175, - GLOBAL_TYPE_ID_ETS_TUPLE14_CLASS = 176, - GLOBAL_TYPE_ID_ETS_TUPLE15_CLASS = 177, - GLOBAL_TYPE_ID_ETS_TUPLE16_CLASS = 178, - GLOBAL_TYPE_ID_ETS_TUPLEN_CLASS = 179, - GLOBAL_TYPE_ID_TYPE_ERROR = 180, - GLOBAL_TYPE_ID_COUNT = 181 + GLOBAL_TYPE_ID_ETS_ARRAY = 92, + GLOBAL_TYPE_ID_ETS_FUNCTION0_CLASS = 93, + GLOBAL_TYPE_ID_ETS_FUNCTION1_CLASS = 94, + GLOBAL_TYPE_ID_ETS_FUNCTION2_CLASS = 95, + GLOBAL_TYPE_ID_ETS_FUNCTION3_CLASS = 96, + GLOBAL_TYPE_ID_ETS_FUNCTION4_CLASS = 97, + GLOBAL_TYPE_ID_ETS_FUNCTION5_CLASS = 98, + GLOBAL_TYPE_ID_ETS_FUNCTION6_CLASS = 99, + GLOBAL_TYPE_ID_ETS_FUNCTION7_CLASS = 100, + GLOBAL_TYPE_ID_ETS_FUNCTION8_CLASS = 101, + GLOBAL_TYPE_ID_ETS_FUNCTION9_CLASS = 102, + GLOBAL_TYPE_ID_ETS_FUNCTION10_CLASS = 103, + GLOBAL_TYPE_ID_ETS_FUNCTION11_CLASS = 104, + GLOBAL_TYPE_ID_ETS_FUNCTION12_CLASS = 105, + GLOBAL_TYPE_ID_ETS_FUNCTION13_CLASS = 106, + GLOBAL_TYPE_ID_ETS_FUNCTION14_CLASS = 107, + GLOBAL_TYPE_ID_ETS_FUNCTION15_CLASS = 108, + GLOBAL_TYPE_ID_ETS_FUNCTION16_CLASS = 109, + GLOBAL_TYPE_ID_ETS_FUNCTIONN_CLASS = 110, + GLOBAL_TYPE_ID_ETS_LAMBDA0_CLASS = 111, + GLOBAL_TYPE_ID_ETS_LAMBDA1_CLASS = 112, + GLOBAL_TYPE_ID_ETS_LAMBDA2_CLASS = 113, + GLOBAL_TYPE_ID_ETS_LAMBDA3_CLASS = 114, + GLOBAL_TYPE_ID_ETS_LAMBDA4_CLASS = 115, + GLOBAL_TYPE_ID_ETS_LAMBDA5_CLASS = 116, + GLOBAL_TYPE_ID_ETS_LAMBDA6_CLASS = 117, + GLOBAL_TYPE_ID_ETS_LAMBDA7_CLASS = 118, + GLOBAL_TYPE_ID_ETS_LAMBDA8_CLASS = 119, + GLOBAL_TYPE_ID_ETS_LAMBDA9_CLASS = 120, + GLOBAL_TYPE_ID_ETS_LAMBDA10_CLASS = 121, + GLOBAL_TYPE_ID_ETS_LAMBDA11_CLASS = 122, + GLOBAL_TYPE_ID_ETS_LAMBDA12_CLASS = 123, + GLOBAL_TYPE_ID_ETS_LAMBDA13_CLASS = 124, + GLOBAL_TYPE_ID_ETS_LAMBDA14_CLASS = 125, + GLOBAL_TYPE_ID_ETS_LAMBDA15_CLASS = 126, + GLOBAL_TYPE_ID_ETS_LAMBDA16_CLASS = 127, + GLOBAL_TYPE_ID_ETS_LAMBDAN_CLASS = 128, + GLOBAL_TYPE_ID_ETS_FUNCTIONR0_CLASS = 129, + GLOBAL_TYPE_ID_ETS_FUNCTIONR1_CLASS = 130, + GLOBAL_TYPE_ID_ETS_FUNCTIONR2_CLASS = 131, + GLOBAL_TYPE_ID_ETS_FUNCTIONR3_CLASS = 132, + GLOBAL_TYPE_ID_ETS_FUNCTIONR4_CLASS = 133, + GLOBAL_TYPE_ID_ETS_FUNCTIONR5_CLASS = 134, + GLOBAL_TYPE_ID_ETS_FUNCTIONR6_CLASS = 135, + GLOBAL_TYPE_ID_ETS_FUNCTIONR7_CLASS = 136, + GLOBAL_TYPE_ID_ETS_FUNCTIONR8_CLASS = 137, + GLOBAL_TYPE_ID_ETS_FUNCTIONR9_CLASS = 138, + GLOBAL_TYPE_ID_ETS_FUNCTIONR10_CLASS = 139, + GLOBAL_TYPE_ID_ETS_FUNCTIONR11_CLASS = 140, + GLOBAL_TYPE_ID_ETS_FUNCTIONR12_CLASS = 141, + GLOBAL_TYPE_ID_ETS_FUNCTIONR13_CLASS = 142, + GLOBAL_TYPE_ID_ETS_FUNCTIONR14_CLASS = 143, + GLOBAL_TYPE_ID_ETS_FUNCTIONR15_CLASS = 144, + GLOBAL_TYPE_ID_ETS_FUNCTIONR16_CLASS = 145, + GLOBAL_TYPE_ID_ETS_LAMBDAR0_CLASS = 146, + GLOBAL_TYPE_ID_ETS_LAMBDAR1_CLASS = 147, + GLOBAL_TYPE_ID_ETS_LAMBDAR2_CLASS = 148, + GLOBAL_TYPE_ID_ETS_LAMBDAR3_CLASS = 149, + GLOBAL_TYPE_ID_ETS_LAMBDAR4_CLASS = 150, + GLOBAL_TYPE_ID_ETS_LAMBDAR5_CLASS = 151, + GLOBAL_TYPE_ID_ETS_LAMBDAR6_CLASS = 152, + GLOBAL_TYPE_ID_ETS_LAMBDAR7_CLASS = 153, + GLOBAL_TYPE_ID_ETS_LAMBDAR8_CLASS = 154, + GLOBAL_TYPE_ID_ETS_LAMBDAR9_CLASS = 155, + GLOBAL_TYPE_ID_ETS_LAMBDAR10_CLASS = 156, + GLOBAL_TYPE_ID_ETS_LAMBDAR11_CLASS = 157, + GLOBAL_TYPE_ID_ETS_LAMBDAR12_CLASS = 158, + GLOBAL_TYPE_ID_ETS_LAMBDAR13_CLASS = 159, + GLOBAL_TYPE_ID_ETS_LAMBDAR14_CLASS = 160, + GLOBAL_TYPE_ID_ETS_LAMBDAR15_CLASS = 161, + GLOBAL_TYPE_ID_ETS_LAMBDAR16_CLASS = 162, + GLOBAL_TYPE_ID_ETS_TUPLE0_CLASS = 163, + GLOBAL_TYPE_ID_ETS_TUPLE1_CLASS = 164, + GLOBAL_TYPE_ID_ETS_TUPLE2_CLASS = 165, + GLOBAL_TYPE_ID_ETS_TUPLE3_CLASS = 166, + GLOBAL_TYPE_ID_ETS_TUPLE4_CLASS = 167, + GLOBAL_TYPE_ID_ETS_TUPLE5_CLASS = 168, + GLOBAL_TYPE_ID_ETS_TUPLE6_CLASS = 169, + GLOBAL_TYPE_ID_ETS_TUPLE7_CLASS = 170, + GLOBAL_TYPE_ID_ETS_TUPLE8_CLASS = 171, + GLOBAL_TYPE_ID_ETS_TUPLE9_CLASS = 172, + GLOBAL_TYPE_ID_ETS_TUPLE10_CLASS = 173, + GLOBAL_TYPE_ID_ETS_TUPLE11_CLASS = 174, + GLOBAL_TYPE_ID_ETS_TUPLE12_CLASS = 175, + GLOBAL_TYPE_ID_ETS_TUPLE13_CLASS = 176, + GLOBAL_TYPE_ID_ETS_TUPLE14_CLASS = 177, + GLOBAL_TYPE_ID_ETS_TUPLE15_CLASS = 178, + GLOBAL_TYPE_ID_ETS_TUPLE16_CLASS = 179, + GLOBAL_TYPE_ID_ETS_TUPLEN_CLASS = 180, + GLOBAL_TYPE_ID_TYPE_ERROR = 181, + GLOBAL_TYPE_ID_COUNT = 182 } export enum Es2pandaMethodDefinitionKind { METHOD_DEFINITION_KIND_NONE = 0, diff --git a/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts b/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts index 8cad16f69..833446f05 100644 --- a/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts +++ b/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts @@ -217,6 +217,9 @@ export class Es2pandaNativeModule { _IfStatementTest(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } + _IfStatementSetTest(context: KNativePointer, receiver: KNativePointer, test: KNativePointer): void { + throw new Error("This methods was not overloaded by native module initialization") + } _IfStatementConsequentConst(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } @@ -1519,10 +1522,10 @@ export class Es2pandaNativeModule { _ClassDefinitionLocalIndexConst(context: KNativePointer, receiver: KNativePointer): KInt { throw new Error("This methods was not overloaded by native module initialization") } - _ClassDefinitionFunctionalReferenceReferencedMethodConst(context: KNativePointer, receiver: KNativePointer): KStringPtr { + _ClassDefinitionFunctionalReferenceReferencedMethodConst(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } - _ClassDefinitionSetFunctionalReferenceReferencedMethod(context: KNativePointer, receiver: KNativePointer, functionalReferenceReferencedMethod: KStringPtr): void { + _ClassDefinitionSetFunctionalReferenceReferencedMethod(context: KNativePointer, receiver: KNativePointer, functionalReferenceReferencedMethod: KNativePointer): void { throw new Error("This methods was not overloaded by native module initialization") } _ClassDefinitionLocalPrefixConst(context: KNativePointer, receiver: KNativePointer): KStringPtr { @@ -2152,6 +2155,9 @@ export class Es2pandaNativeModule { _UnaryExpressionArgumentConst(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } + _UnaryExpressionSetArgument(context: KNativePointer, receiver: KNativePointer, arg: KNativePointer): void { + throw new Error("This methods was not overloaded by native module initialization") + } _CreateForInStatement(context: KNativePointer, left: KNativePointer, right: KNativePointer, body: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } @@ -2629,6 +2635,12 @@ export class Es2pandaNativeModule { _TSParenthesizedTypeTypeConst(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } + _LiteralIsFoldedConst(context: KNativePointer, receiver: KNativePointer): KBoolean { + throw new Error("This methods was not overloaded by native module initialization") + } + _LiteralSetFolded(context: KNativePointer, receiver: KNativePointer, folded: KBoolean): void { + throw new Error("This methods was not overloaded by native module initialization") + } _CreateCharLiteral(context: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } @@ -2860,6 +2872,9 @@ export class Es2pandaNativeModule { _WhileStatementTest(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } + _WhileStatementSetTest(context: KNativePointer, receiver: KNativePointer, test: KNativePointer): void { + throw new Error("This methods was not overloaded by native module initialization") + } _WhileStatementBodyConst(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } @@ -3733,16 +3748,22 @@ export class Es2pandaNativeModule { _SrcDumperAdd(context: KNativePointer, receiver: KNativePointer, str: KStringPtr): void { throw new Error("This methods was not overloaded by native module initialization") } - _SrcDumperAdd1(context: KNativePointer, receiver: KNativePointer, i: KInt): void { + _SrcDumperAdd1(context: KNativePointer, receiver: KNativePointer, i: KBoolean): void { + throw new Error("This methods was not overloaded by native module initialization") + } + _SrcDumperAdd2(context: KNativePointer, receiver: KNativePointer, i: KInt): void { + throw new Error("This methods was not overloaded by native module initialization") + } + _SrcDumperAdd3(context: KNativePointer, receiver: KNativePointer, i: KInt): void { throw new Error("This methods was not overloaded by native module initialization") } - _SrcDumperAdd2(context: KNativePointer, receiver: KNativePointer, l: KLong): void { + _SrcDumperAdd4(context: KNativePointer, receiver: KNativePointer, l: KLong): void { throw new Error("This methods was not overloaded by native module initialization") } - _SrcDumperAdd3(context: KNativePointer, receiver: KNativePointer, f: KFloat): void { + _SrcDumperAdd5(context: KNativePointer, receiver: KNativePointer, f: KFloat): void { throw new Error("This methods was not overloaded by native module initialization") } - _SrcDumperAdd4(context: KNativePointer, receiver: KNativePointer, d: KDouble): void { + _SrcDumperAdd6(context: KNativePointer, receiver: KNativePointer, d: KDouble): void { throw new Error("This methods was not overloaded by native module initialization") } _SrcDumperStrConst(context: KNativePointer, receiver: KNativePointer): KStringPtr { diff --git a/ui2abc/libarkts/src/generated/peers/ClassDefinition.ts b/ui2abc/libarkts/src/generated/peers/ClassDefinition.ts index 05a2d9788..92df6f120 100644 --- a/ui2abc/libarkts/src/generated/peers/ClassDefinition.ts +++ b/ui2abc/libarkts/src/generated/peers/ClassDefinition.ts @@ -172,12 +172,12 @@ export class ClassDefinition extends TypedAstNode { get localIndex(): number { return global.generatedEs2panda._ClassDefinitionLocalIndexConst(global.context, this.peer) } - get functionalReferenceReferencedMethod(): string { - return unpackString(global.generatedEs2panda._ClassDefinitionFunctionalReferenceReferencedMethodConst(global.context, this.peer)) + get functionalReferenceReferencedMethod(): MethodDefinition | undefined { + return unpackNode(global.generatedEs2panda._ClassDefinitionFunctionalReferenceReferencedMethodConst(global.context, this.peer)) } /** @deprecated */ - setFunctionalReferenceReferencedMethod(functionalReferenceReferencedMethod: string): this { - global.generatedEs2panda._ClassDefinitionSetFunctionalReferenceReferencedMethod(global.context, this.peer, functionalReferenceReferencedMethod) + setFunctionalReferenceReferencedMethod(functionalReferenceReferencedMethod?: MethodDefinition): this { + global.generatedEs2panda._ClassDefinitionSetFunctionalReferenceReferencedMethod(global.context, this.peer, passNode(functionalReferenceReferencedMethod)) return this } get localPrefix(): string { diff --git a/ui2abc/libarkts/src/generated/peers/IfStatement.ts b/ui2abc/libarkts/src/generated/peers/IfStatement.ts index a5f0e8960..d5c6b1dd5 100644 --- a/ui2abc/libarkts/src/generated/peers/IfStatement.ts +++ b/ui2abc/libarkts/src/generated/peers/IfStatement.ts @@ -45,6 +45,11 @@ export class IfStatement extends Statement { get test(): Expression | undefined { return unpackNode(global.generatedEs2panda._IfStatementTest(global.context, this.peer)) } + /** @deprecated */ + setTest(test?: Expression): this { + global.generatedEs2panda._IfStatementSetTest(global.context, this.peer, passNode(test)) + return this + } get consequent(): Statement | undefined { return unpackNode(global.generatedEs2panda._IfStatementConsequent(global.context, this.peer)) } diff --git a/ui2abc/libarkts/src/generated/peers/Literal.ts b/ui2abc/libarkts/src/generated/peers/Literal.ts index 9bd3d2c11..fc110007e 100644 --- a/ui2abc/libarkts/src/generated/peers/Literal.ts +++ b/ui2abc/libarkts/src/generated/peers/Literal.ts @@ -33,6 +33,14 @@ export class Literal extends Expression { constructor(pointer: KNativePointer) { super(pointer) } + get isFolded(): boolean { + return global.generatedEs2panda._LiteralIsFoldedConst(global.context, this.peer) + } + /** @deprecated */ + setFolded(folded: boolean): this { + global.generatedEs2panda._LiteralSetFolded(global.context, this.peer, folded) + return this + } protected readonly brandLiteral: undefined } export function isLiteral(node: object | undefined): node is Literal { diff --git a/ui2abc/libarkts/src/generated/peers/SrcDumper.ts b/ui2abc/libarkts/src/generated/peers/SrcDumper.ts index 35021bb83..8ec090e54 100644 --- a/ui2abc/libarkts/src/generated/peers/SrcDumper.ts +++ b/ui2abc/libarkts/src/generated/peers/SrcDumper.ts @@ -46,18 +46,28 @@ export class SrcDumper extends ArktsObject { return this } /** @deprecated */ - add2(l: number): this { - global.generatedEs2panda._SrcDumperAdd2(global.context, this.peer, l) + add2(i: number): this { + global.generatedEs2panda._SrcDumperAdd2(global.context, this.peer, i) return this } /** @deprecated */ - add3(f: number): this { - global.generatedEs2panda._SrcDumperAdd3(global.context, this.peer, f) + add3(i: number): this { + global.generatedEs2panda._SrcDumperAdd3(global.context, this.peer, i) return this } /** @deprecated */ - add4(d: number): this { - global.generatedEs2panda._SrcDumperAdd4(global.context, this.peer, d) + add4(l: number): this { + global.generatedEs2panda._SrcDumperAdd4(global.context, this.peer, l) + return this + } + /** @deprecated */ + add5(f: number): this { + global.generatedEs2panda._SrcDumperAdd5(global.context, this.peer, f) + return this + } + /** @deprecated */ + add6(d: number): this { + global.generatedEs2panda._SrcDumperAdd6(global.context, this.peer, d) return this } get str(): string { diff --git a/ui2abc/libarkts/src/generated/peers/UnaryExpression.ts b/ui2abc/libarkts/src/generated/peers/UnaryExpression.ts index ea848cb11..71e0c9b9a 100644 --- a/ui2abc/libarkts/src/generated/peers/UnaryExpression.ts +++ b/ui2abc/libarkts/src/generated/peers/UnaryExpression.ts @@ -48,6 +48,11 @@ export class UnaryExpression extends Expression { get argument(): Expression | undefined { return unpackNode(global.generatedEs2panda._UnaryExpressionArgument(global.context, this.peer)) } + /** @deprecated */ + setArgument(arg?: Expression): this { + global.generatedEs2panda._UnaryExpressionSetArgument(global.context, this.peer, passNode(arg)) + return this + } protected readonly brandUnaryExpression: undefined } export function isUnaryExpression(node: object | undefined): node is UnaryExpression { diff --git a/ui2abc/libarkts/src/generated/peers/WhileStatement.ts b/ui2abc/libarkts/src/generated/peers/WhileStatement.ts index 0f487a883..d0e3dc3e0 100644 --- a/ui2abc/libarkts/src/generated/peers/WhileStatement.ts +++ b/ui2abc/libarkts/src/generated/peers/WhileStatement.ts @@ -46,6 +46,11 @@ export class WhileStatement extends LoopStatement { get test(): Expression | undefined { return unpackNode(global.generatedEs2panda._WhileStatementTest(global.context, this.peer)) } + /** @deprecated */ + setTest(test?: Expression): this { + global.generatedEs2panda._WhileStatementSetTest(global.context, this.peer, passNode(test)) + return this + } get body(): Statement | undefined { return unpackNode(global.generatedEs2panda._WhileStatementBody(global.context, this.peer)) } diff --git a/ui2abc/libarkts/src/plugin-utils.ts b/ui2abc/libarkts/src/plugin-utils.ts index f491f8969..c5b1e3479 100644 --- a/ui2abc/libarkts/src/plugin-utils.ts +++ b/ui2abc/libarkts/src/plugin-utils.ts @@ -33,9 +33,8 @@ export interface RunTransformerHooks { onProgramTransformEnd?(options: CompilationOptions): void } -class ASTCache { +class ProcessedPrograms { processedPrograms = new Set() - constructor() { } find(program: Program): boolean { return this.processedPrograms.has(program.absoluteName) } @@ -51,6 +50,11 @@ export function runTransformer(prog: Program, state: Es2pandaContextState, resta // The first program provided by program provider is the main program let currentProgram = provider.next() let isMainProgram = true + let processed = pluginContext.parameter("ProcessedPrograms") + if (!processed) { + processed = new ProcessedPrograms() + pluginContext.setParameter("ProcessedPrograms", processed) + } while (currentProgram) { // Options passed to plugin and hooks @@ -74,7 +78,13 @@ export function runTransformer(prog: Program, state: Es2pandaContextState, resta // Run the plugin itself if (options.isMainProgram || !onlyModifyMain) { - transform?.(currentProgram, options, pluginContext) + if (!processed.find(currentProgram)) { + transform?.(currentProgram, options, pluginContext) + if (state == Es2pandaContextState.ES2PANDA_STATE_CHECKED) + processed.update(currentProgram) + } else { + console.log(`${currentProgram.absoluteName} already processed`) + } } // Run some common plugins that should be run after plugin usage and depends on the current stage -- Gitee From dd86f84c2bf5b592c4c814bbb1d04c21c9dbae75 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 11 Jun 2025 17:22:28 +0300 Subject: [PATCH 5/9] Update Signed-off-by: Nikolay Igotti --- incremental/common/src/Matrix33.ts | 4 ++-- incremental/compat/src/arkts/double.ts | 8 ++++++++ incremental/compat/src/index.ts | 2 ++ incremental/compat/src/typescript/double.ts | 8 ++++++++ ui2abc/libarkts/src/arkts-api/utilities/public.ts | 4 ++-- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/incremental/common/src/Matrix33.ts b/incremental/common/src/Matrix33.ts index 9ff2feb33..b3cdb6ab4 100644 --- a/incremental/common/src/Matrix33.ts +++ b/incremental/common/src/Matrix33.ts @@ -13,13 +13,13 @@ * limitations under the License. */ -import { Array_from_number, float32, float64 } from "@koalaui/compat" +import { Array_from_number, float32, float64, float32To64 } from "@koalaui/compat" export function mat33(array?: Float32Array): Matrix33 { return (array == undefined) ? new Matrix33 () : new Matrix33(array) } -const tolerance: float32 = (1.0 / (1 << 12)) +const tolerance: float32 = float32To64(1.0 / (1 << 12)) export class Matrix33 { public readonly array: Float32Array diff --git a/incremental/compat/src/arkts/double.ts b/incremental/compat/src/arkts/double.ts index ed3fb70a5..fc8219517 100644 --- a/incremental/compat/src/arkts/double.ts +++ b/incremental/compat/src/arkts/double.ts @@ -15,6 +15,14 @@ */ import { float64, int32, float32 } from "./types" +export function float32To64(value: float32): float64 { + return Float.toDouble(value) +} + +export function float64To32(value: float64): float32 { + return Double.toFloat(value) +} + export function asFloat64(value: string): float64 { return (new Number(value)).valueOf() } diff --git a/incremental/compat/src/index.ts b/incremental/compat/src/index.ts index 96204982b..c9df2fc74 100644 --- a/incremental/compat/src/index.ts +++ b/incremental/compat/src/index.ts @@ -23,6 +23,8 @@ export { asString, float32FromBits, int32BitsFromFloat, + float32To64, + float64To32, Thunk, finalizerRegister, finalizerUnregister, diff --git a/incremental/compat/src/typescript/double.ts b/incremental/compat/src/typescript/double.ts index 64ed41d2a..bd00e7a70 100644 --- a/incremental/compat/src/typescript/double.ts +++ b/incremental/compat/src/typescript/double.ts @@ -19,6 +19,14 @@ export function asFloat64(value: string): float64 { return Number(value) } +export function float32To64(value: float32): float64 { + return value +} + +export function float64To32(value: float64): float32 { + return value +} + export function asString(value: float64 | undefined): string | undefined { return value?.toString() } diff --git a/ui2abc/libarkts/src/arkts-api/utilities/public.ts b/ui2abc/libarkts/src/arkts-api/utilities/public.ts index 2e105dbf6..31cfe8fbb 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/public.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/public.ts @@ -19,11 +19,11 @@ import { KNativePointer, nullptr } from "@koalaui/interop" import { passNode, passNodeArray, unpackNodeArray, unpackNonNullableNode } from "./private" import { Es2pandaContextState, Es2pandaModifierFlags } from "../../generated/Es2pandaEnums" import type { AstNode } from "../peers/AstNode" +import * as path from "path" import { type AnnotationUsage, ClassDefinition, ClassProperty, - ETSImportDeclaration, ETSModule, isClassDefinition, isFunctionDeclaration, @@ -210,7 +210,7 @@ export function findStdlib(): string { defaultPandaSdk, `PANDA_SDK_PATH not set, assuming ${defaultPandaSdk}` ) - return `${sdk}/ets/stdlib` + return path.resolve(`${sdk}/ets/stdlib`) } export function collectDependencies(files: string[], configPath: string): string[] { -- Gitee From 1d59e89b8ab6f475a434c3d1ba940d3754ff3c71 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 11 Jun 2025 17:23:35 +0300 Subject: [PATCH 6/9] Update Signed-off-by: Nikolay Igotti --- incremental/common/src/Matrix33.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incremental/common/src/Matrix33.ts b/incremental/common/src/Matrix33.ts index b3cdb6ab4..c7087e645 100644 --- a/incremental/common/src/Matrix33.ts +++ b/incremental/common/src/Matrix33.ts @@ -13,13 +13,13 @@ * limitations under the License. */ -import { Array_from_number, float32, float64, float32To64 } from "@koalaui/compat" +import { Array_from_number, float32, float64, float64To32 } from "@koalaui/compat" export function mat33(array?: Float32Array): Matrix33 { return (array == undefined) ? new Matrix33 () : new Matrix33(array) } -const tolerance: float32 = float32To64(1.0 / (1 << 12)) +const tolerance: float32 = float64To32(1.0 / (1 << 12)) export class Matrix33 { public readonly array: Float32Array -- Gitee From 7a45a175c566ca6d31024f18ed3b349982ac4b53 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Wed, 11 Jun 2025 17:35:13 +0300 Subject: [PATCH 7/9] Almost working cached contexts Signed-off-by: Alexander Gorshenev --- incremental/runtime/package.json | 4 ++-- ui2abc/libarkts/arktsconfig.json | 2 +- ui2abc/libarkts/package.json | 6 ++--- ui2abc/libarkts/plugins/input/library.ets | 2 ++ ui2abc/libarkts/plugins/input/main.ets | 2 ++ ui2abc/libarkts/src-host/es2panda.ts | 4 ++-- ui2abc/libarkts/src/arkts-api/peers/Config.ts | 1 + .../src/arkts-api/utilities/public.ts | 24 ++++++++++++------- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/incremental/runtime/package.json b/incremental/runtime/package.json index 1a3f83f18..937b77476 100644 --- a/incremental/runtime/package.json +++ b/incremental/runtime/package.json @@ -38,7 +38,7 @@ "annotate": "npm run compile --prefix ../../ui2abc/annotate && node ../../ui2abc/annotate", "fast-arktsc": "npm run compile --prefix ../../ui2abc/fast-arktsc", "build:runtime:inc:ui2abc": "npm run annotate && npm run fast-arktsc && node ../../ui2abc/fast-arktsc --config ./ui2abcconfig.json --compiler ../tools/panda/arkts/ui2abc --link-name ./build/runtime.abc --restart-stages --group-by 5 && PANDA_SDK_PATH=${PANDA_SDK_PATH:=../tools/panda/node_modules/@panda/sdk} ninja ${NINJA_OPTIONS} -f build/build.ninja", - "build:runtime:inc:ui2abc:recheck": "npm run annotate && npm run fast-arktsc && node ../../ui2abc/fast-arktsc --config ./ui2abcconfig-recheck.json --compiler ../tools/panda/arkts/ui2abc --link-name ./build/runtime.abc --group-by 5 && PANDA_SDK_PATH=${PANDA_SDK_PATH:=../tools/panda/node_modules/@panda/sdk} ninja ${NINJA_OPTIONS} -f build/recheck/build.ninja", + "build:runtime:inc:ui2abc:recheck": "npm run annotate && npm run fast-arktsc && node ../../ui2abc/fast-arktsc --config ./ui2abcconfig-recheck.json --compiler ../tools/panda/arkts/ui2abc --link-name ./build/runtime.abc --group-by 2 && PANDA_SDK_PATH=${PANDA_SDK_PATH:=../tools/panda/node_modules/@panda/sdk} ninja ${NINJA_OPTIONS} -f build/recheck/build.ninja", "build:runtime:with:tests": "npm run unmemoize:with:tests && fast-arktsc --config ./arktsconfig-test-unmemoized.json --compiler ../tools/panda/arkts/arktsc --link-name ./build/runtime-tests.abc && ninja ${NINJA_OPTIONS} -f build/unmemoized/abc/build.ninja", "build:incremental:components": "npm run build:compat && npm run build:common && npm run build:runtime", "build:incremental:components:inc": "npm run build:compat:inc && npm run build:common:inc && npm run build:runtime:inc", @@ -65,4 +65,4 @@ "mocha": "^9.2.2", "source-map-support": "^0.5.21" } -} \ No newline at end of file +} diff --git a/ui2abc/libarkts/arktsconfig.json b/ui2abc/libarkts/arktsconfig.json index 3a00d970d..bf0d40aaf 100644 --- a/ui2abc/libarkts/arktsconfig.json +++ b/ui2abc/libarkts/arktsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "package0": "@koalaui/example", "outDir": "./build/abc", + "package": "test", "baseUrl": ".", "plugins": [ { diff --git a/ui2abc/libarkts/package.json b/ui2abc/libarkts/package.json index d5127b0d6..edc94f9bf 100644 --- a/ui2abc/libarkts/package.json +++ b/ui2abc/libarkts/package.json @@ -50,8 +50,8 @@ "compile:js": "npm run compile:src && rollup -c rollup.lib.mjs && rollup -c rollup.es2panda.mjs", "compile:gn": "npm run compile:koala:interop && npm run compile:js", "compile:plugins": "npx rollup -c ./rollup.printer-plugin.mjs && npx rollup -c ./rollup.no-visitor-plugin.mjs ", - "restart": "node ../fast-arktsc --config arktsconfig.json --compiler ../../incremental/tools/panda/arkts/ui2abc --link-name ./build/abc/main.abc --restart-stages && ninja -f build/abc/build.ninja", - "direct": "node ../fast-arktsc --config arktsconfig.json --compiler ../../incremental/tools/panda/arkts/ui2abc --link-name ./build/abc/main.abc && ninja -f build/abc/build.ninja", + "restart": "node ../fast-arktsc --config arktsconfig.json --compiler ../../incremental/tools/panda/arkts/ui2abc --link-name ./build/abc/out.abc --restart-stages && ninja -f build/abc/build.ninja", + "direct": "node ../fast-arktsc --group-by 2 --config arktsconfig.json --compiler ../../incremental/tools/panda/arkts/ui2abc --link-name ./build/abc/out.abc && ninja -v -f build/abc/build.ninja", "run": "npm run compile && npm run compile:plugins && npm run direct", "run:memo": "npm run compile && npm run compile:plugins && npm run compile --prefix ../memo-plugin && npm run memo", "run:abc": "$npm_package_config_panda_sdk_path/linux_host_tools/bin/ark --load-runtimes=ets --boot-panda-files=$npm_package_config_panda_sdk_path/ets/etsstdlib.abc ./main.abc main.ETSGLOBAL::main", @@ -70,4 +70,4 @@ "regenerate:ohos": "npx --yes @idlizer/arktscgen@$npm_package_config_gen_version --panda-sdk-path ${PANDA_SDK_PATH:=$npm_package_config_ohos_panda_sdk_path} --output-dir ../ --options-file ./generator/options.json5 --no-initialize", "reinstall:regenerate": "npm run panda:sdk:reinstall && npm run regenerate" } -} \ No newline at end of file +} diff --git a/ui2abc/libarkts/plugins/input/library.ets b/ui2abc/libarkts/plugins/input/library.ets index 6a90478cc..da40709d5 100644 --- a/ui2abc/libarkts/plugins/input/library.ets +++ b/ui2abc/libarkts/plugins/input/library.ets @@ -13,6 +13,8 @@ * limitations under the License. */ +import { Third } from "./third" + export function testFunction(): string { return "yes" } diff --git a/ui2abc/libarkts/plugins/input/main.ets b/ui2abc/libarkts/plugins/input/main.ets index 4846a65a9..3396ced67 100644 --- a/ui2abc/libarkts/plugins/input/main.ets +++ b/ui2abc/libarkts/plugins/input/main.ets @@ -13,6 +13,8 @@ * limitations under the License. */ +import { Third } from "./third" + enum X { A = 17 } diff --git a/ui2abc/libarkts/src-host/es2panda.ts b/ui2abc/libarkts/src-host/es2panda.ts index 37ffd5657..db2e957db 100644 --- a/ui2abc/libarkts/src-host/es2panda.ts +++ b/ui2abc/libarkts/src-host/es2panda.ts @@ -173,7 +173,7 @@ function invokeWithPlugins( throw new Error(`Wrong config: path=${configPath} file=${filePath} stdlib=${stdlib} output=${outputPath}`) fs.mkdirSync(path.dirname(outputPath), {recursive: true}) console.log(`will create ${globalContext.peer.toString(16)} ${filePath}`) - const compilerContext = Context.createCacheFromFile(filePath, compilerConfig, globalContext, true) + const compilerContext = Context.createCacheFromFile(filePath, compilerConfig, globalContext, false) global.compilerContext = compilerContext pluginNames.push(`_proceed_to_binary`) @@ -362,7 +362,7 @@ export function main() { const pluginNames = plugins.map((it: any) => `${it.name}-${it.stage}`) const pluginContext = new PluginContextImpl() const pluginsByState = readAndSortPlugins(configDir, plugins) - const filesWithDependencies = collectDependencies(files, configPath) + const filesWithDependencies = collectDependencies(files, configPath) + "/home/huawei/koala_projects/incremental/runtime/annotations/index.ts" const globalConfig = createConfig(configPath, files[0], outputs[0]) const globalContext = GlobalContext.create(globalConfig, filesWithDependencies) diff --git a/ui2abc/libarkts/src/arkts-api/peers/Config.ts b/ui2abc/libarkts/src/arkts-api/peers/Config.ts index 894fcbb75..20a671fa2 100644 --- a/ui2abc/libarkts/src/arkts-api/peers/Config.ts +++ b/ui2abc/libarkts/src/arkts-api/peers/Config.ts @@ -28,6 +28,7 @@ export class Config extends ArktsObject { static create( input: readonly string[] ): Config { + console.log(input) return new Config( global.es2panda._CreateConfig(input.length, passStringArray(input)) ) diff --git a/ui2abc/libarkts/src/arkts-api/utilities/public.ts b/ui2abc/libarkts/src/arkts-api/utilities/public.ts index 31cfe8fbb..b51e70200 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/public.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/public.ts @@ -95,7 +95,7 @@ export function proceedToState(state: Es2pandaContextState): void { const before = Date.now() global.es2panda._ProceedToState(global.context, state) const after = Date.now() - global.profiler.proceededToState(after-before) + global.profiler.proceededToState(after - before) NodeCache.clear() checkErrors() } @@ -182,12 +182,12 @@ export function hasModifierFlag(node: AstNode, flag: Es2pandaModifierFlags): boo } export function modifiersToString(modifiers: Es2pandaModifierFlags): string { - return Object.values(Es2pandaModifierFlags) - .filter(isNumber) - .map(it => { - console.log(it.valueOf(), Es2pandaModifierFlags[it], modifiers.valueOf() & it) - return ((modifiers.valueOf() & it) === it) ? Es2pandaModifierFlags[it] : "" - }).join(" ") + return Object.values(Es2pandaModifierFlags) + .filter(isNumber) + .map(it => { + console.log(it.valueOf(), Es2pandaModifierFlags[it], modifiers.valueOf() & it) + return ((modifiers.valueOf() & it) === it) ? Es2pandaModifierFlags[it] : "" + }).join(" ") } export function nameIfIdentifier(node: AstNode): string { @@ -198,7 +198,7 @@ export function nameIfETSModule(node: AstNode): string { return isETSModule(node) ? `'${node.ident?.name}'` : "" } -export function asString(node: AstNode|undefined): string { +export function asString(node: AstNode | undefined): string { return `${node?.constructor.name} ${node ? nameIfIdentifier(node) : undefined}` } @@ -215,11 +215,12 @@ export function findStdlib(): string { export function collectDependencies(files: string[], configPath: string): string[] { const result = new Set() - files.forEach(it => result.add(it)) for (let file of files) { + console.log("collectDeps", file) const context = Context.createFromFile(file, configPath, findStdlib(), "/tmp/foo.abc")! global.compilerContext = context proceedToState(Es2pandaContextState.ES2PANDA_STATE_PARSED) + /* let sources = programGetExternalSources(context.program, context.peer) sources.forEach(source => { if (defaultFilter(source.getName())) @@ -228,7 +229,12 @@ export function collectDependencies(files: string[], configPath: string): string result.add(program.absoluteName) }) }) + */ + listPrograms(context.program).forEach( + it => result.add(it.absoluteName) + ) context.destroy() } + console.log(result) return Array.from(result) } -- Gitee From e1618b27324b6d3148daca1a58a42ab71a934e1a Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Wed, 11 Jun 2025 17:42:06 +0300 Subject: [PATCH 8/9] update Signed-off-by: Alexander Gorshenev --- ui2abc/libarkts/src-host/es2panda.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui2abc/libarkts/src-host/es2panda.ts b/ui2abc/libarkts/src-host/es2panda.ts index db2e957db..bf3e72059 100644 --- a/ui2abc/libarkts/src-host/es2panda.ts +++ b/ui2abc/libarkts/src-host/es2panda.ts @@ -362,7 +362,7 @@ export function main() { const pluginNames = plugins.map((it: any) => `${it.name}-${it.stage}`) const pluginContext = new PluginContextImpl() const pluginsByState = readAndSortPlugins(configDir, plugins) - const filesWithDependencies = collectDependencies(files, configPath) + "/home/huawei/koala_projects/incremental/runtime/annotations/index.ts" + const filesWithDependencies = collectDependencies(files, configPath) const globalConfig = createConfig(configPath, files[0], outputs[0]) const globalContext = GlobalContext.create(globalConfig, filesWithDependencies) -- Gitee From edcce57b7555dd14300ff5c44c82195ccc7d636d Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Wed, 11 Jun 2025 17:44:08 +0300 Subject: [PATCH 9/9] third Signed-off-by: Alexander Gorshenev --- ui2abc/libarkts/plugins/input/third.ets | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ui2abc/libarkts/plugins/input/third.ets diff --git a/ui2abc/libarkts/plugins/input/third.ets b/ui2abc/libarkts/plugins/input/third.ets new file mode 100644 index 000000000..49cb0f708 --- /dev/null +++ b/ui2abc/libarkts/plugins/input/third.ets @@ -0,0 +1,3 @@ + +export class Third {} + -- Gitee