@markw65/monkeyc-optimizer 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/build/api.cjs +34 -34
- package/build/{chunk-DCGJCC63.cjs → chunk-563GVBVT.cjs} +19481 -18385
- package/build/{chunk-APACX34C.cjs → chunk-HHQDDCTP.cjs} +6 -4
- package/build/optimizer.cjs +19 -19
- package/build/sdk-util.cjs +15 -15
- package/build/src/api.d.ts +1 -1
- package/build/src/optimizer-types.d.ts +1 -0
- package/build/src/readprg/array-init.d.ts +2 -1
- package/build/src/readprg/bytecode.d.ts +5 -2
- package/build/src/readprg/cflow.d.ts +10 -0
- package/build/src/readprg/dce.d.ts +4 -1
- package/build/src/readprg/interp.d.ts +20 -0
- package/build/src/readprg/locals.d.ts +3 -0
- package/build/src/readprg.d.ts +4 -3
- package/build/src/type-flow/type-flow-util.d.ts +1 -1
- package/build/src/worker-task.d.ts +1 -0
- package/build/util.cjs +24 -24
- package/build/worker-thread.cjs +5 -5
- package/package.json +3 -3
- package/build/worker-pool.cjs +0 -34
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_HHQDDCTP_exports = {};
|
|
30
|
+
__export(chunk_HHQDDCTP_exports, {
|
|
31
31
|
GenericQueue: () => GenericQueue,
|
|
32
32
|
__commonJS: () => __commonJS,
|
|
33
33
|
__esm: () => __esm,
|
|
@@ -41,6 +41,7 @@ __export(chunk_APACX34C_exports, {
|
|
|
41
41
|
forEach: () => forEach,
|
|
42
42
|
globSome: () => globSome,
|
|
43
43
|
globa: () => globa,
|
|
44
|
+
init_logger: () => init_logger,
|
|
44
45
|
init_util: () => init_util,
|
|
45
46
|
last_modified: () => last_modified,
|
|
46
47
|
log: () => log,
|
|
@@ -57,7 +58,7 @@ __export(chunk_APACX34C_exports, {
|
|
|
57
58
|
spawnByLine: () => spawnByLine,
|
|
58
59
|
wouldLog: () => wouldLog
|
|
59
60
|
});
|
|
60
|
-
module.exports = __toCommonJS(
|
|
61
|
+
module.exports = __toCommonJS(chunk_HHQDDCTP_exports);
|
|
61
62
|
var child_process = __toESM(require("child_process"));
|
|
62
63
|
var fsc = __toESM(require("fs"));
|
|
63
64
|
var fs = __toESM(require("fs/promises"));
|
|
@@ -5461,7 +5462,7 @@ function wouldLog(module2, level) {
|
|
|
5461
5462
|
if (!loggerSettings) {
|
|
5462
5463
|
loggerSettings = getLoggerSettings();
|
|
5463
5464
|
}
|
|
5464
|
-
return (loggerSettings.get(module2) ?? 0) >= level + loggerLevelOffset;
|
|
5465
|
+
return (loggerSettings.get(module2) ?? loggerSettings.get("*") ?? 0) >= level + loggerLevelOffset;
|
|
5465
5466
|
}
|
|
5466
5467
|
function bumpLogging(module2, amount) {
|
|
5467
5468
|
if (!module2) {
|
|
@@ -5802,6 +5803,7 @@ run-parallel/index.js:
|
|
|
5802
5803
|
forEach,
|
|
5803
5804
|
globSome,
|
|
5804
5805
|
globa,
|
|
5806
|
+
init_logger,
|
|
5805
5807
|
init_util,
|
|
5806
5808
|
last_modified,
|
|
5807
5809
|
log,
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,27 +18,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var optimizer_exports = {};
|
|
20
20
|
__export(optimizer_exports, {
|
|
21
|
-
StateNodeAttributes: () =>
|
|
22
|
-
buildOptimizedProject: () =>
|
|
23
|
-
copyRecursiveAsNeeded: () =>
|
|
24
|
-
defaultConfig: () =>
|
|
25
|
-
display: () =>
|
|
26
|
-
generateApiMirTests: () =>
|
|
27
|
-
generateOneConfig: () =>
|
|
28
|
-
generateOptimizedProject: () =>
|
|
29
|
-
getConfig: () =>
|
|
30
|
-
getProjectAnalysis: () =>
|
|
31
|
-
get_jungle: () =>
|
|
32
|
-
isErrorWithLocation: () =>
|
|
33
|
-
launchSimulator: () =>
|
|
34
|
-
manifestProducts: () =>
|
|
35
|
-
mctree: () =>
|
|
36
|
-
simulateProgram: () =>
|
|
21
|
+
StateNodeAttributes: () => import_chunk_563GVBVT.StateNodeAttributes,
|
|
22
|
+
buildOptimizedProject: () => import_chunk_563GVBVT.buildOptimizedProject,
|
|
23
|
+
copyRecursiveAsNeeded: () => import_chunk_HHQDDCTP.copyRecursiveAsNeeded,
|
|
24
|
+
defaultConfig: () => import_chunk_563GVBVT.defaultConfig,
|
|
25
|
+
display: () => import_chunk_563GVBVT.display,
|
|
26
|
+
generateApiMirTests: () => import_chunk_563GVBVT.generateApiMirTests,
|
|
27
|
+
generateOneConfig: () => import_chunk_563GVBVT.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_563GVBVT.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_563GVBVT.getConfig,
|
|
30
|
+
getProjectAnalysis: () => import_chunk_563GVBVT.getProjectAnalysis,
|
|
31
|
+
get_jungle: () => import_chunk_563GVBVT.get_jungle,
|
|
32
|
+
isErrorWithLocation: () => import_chunk_563GVBVT.isErrorWithLocation,
|
|
33
|
+
launchSimulator: () => import_chunk_563GVBVT.launchSimulator,
|
|
34
|
+
manifestProducts: () => import_chunk_563GVBVT.manifestProducts,
|
|
35
|
+
mctree: () => import_chunk_563GVBVT.mctree,
|
|
36
|
+
simulateProgram: () => import_chunk_563GVBVT.simulateProgram
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(optimizer_exports);
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
(0,
|
|
39
|
+
var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
|
|
40
|
+
var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
|
|
41
|
+
(0, import_chunk_563GVBVT.init_optimizer)();
|
|
42
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43
43
|
0 && (module.exports = {
|
|
44
44
|
StateNodeAttributes,
|
package/build/sdk-util.cjs
CHANGED
|
@@ -18,23 +18,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var sdk_util_exports = {};
|
|
20
20
|
__export(sdk_util_exports, {
|
|
21
|
-
SectionKinds: () =>
|
|
22
|
-
appSupport: () =>
|
|
23
|
-
connectiq: () =>
|
|
24
|
-
getDeviceInfo: () =>
|
|
25
|
-
getFunctionDocumentation: () =>
|
|
26
|
-
getLanguages: () =>
|
|
27
|
-
getSdkPath: () =>
|
|
28
|
-
isWin: () =>
|
|
29
|
-
optimizeProgram: () =>
|
|
30
|
-
readPrg: () =>
|
|
31
|
-
readPrgWithOffsets: () =>
|
|
32
|
-
xmlUtil: () =>
|
|
21
|
+
SectionKinds: () => import_chunk_563GVBVT.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_563GVBVT.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_563GVBVT.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_563GVBVT.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_563GVBVT.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_563GVBVT.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_563GVBVT.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_563GVBVT.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_563GVBVT.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_563GVBVT.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_563GVBVT.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_563GVBVT.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
(0,
|
|
35
|
+
var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
|
|
36
|
+
var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
|
|
37
|
+
(0, import_chunk_563GVBVT.init_sdk_util)();
|
|
38
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
39
|
0 && (module.exports = {
|
|
40
40
|
SectionKinds,
|
package/build/src/api.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare function findNamesInScope(declStack: StateNode[][], pattern: stri
|
|
|
26
26
|
parent: StateNode;
|
|
27
27
|
depth: number;
|
|
28
28
|
}][];
|
|
29
|
-
export declare function mapVarDeclsByType(state: ProgramStateAnalysis, decls: StateNodeDecl[], node: mctree.Node, typeMap: TypeMap | null | undefined): (mctree.Identifier | mctree.EnumStringMember | mctree.AsIdentifier |
|
|
29
|
+
export declare function mapVarDeclsByType(state: ProgramStateAnalysis, decls: StateNodeDecl[], node: mctree.Node, typeMap: TypeMap | null | undefined): (mctree.Identifier | mctree.EnumStringMember | mctree.AsIdentifier | FunctionStateNode | ClassStateNode | ModuleStateNode | ProgramStateNode | VariableStateNode | import("./optimizer-types").BlockStateNode | TypedefStateNode | EnumStateNode)[];
|
|
30
30
|
export declare function formatAstLongLines(node: mctree.Node): string;
|
|
31
31
|
export declare function createDocumentationMap(functionDocumentation: {
|
|
32
32
|
name: string;
|
|
@@ -44,6 +44,7 @@ export declare type BuildConfig = {
|
|
|
44
44
|
iterateOptimizer?: boolean;
|
|
45
45
|
covarianceWarnings?: boolean;
|
|
46
46
|
checkTypes?: DiagnosticType | "OFF";
|
|
47
|
+
removeArgc?: boolean;
|
|
47
48
|
};
|
|
48
49
|
export declare type StateNodeDecl = StateNode | mctree.EnumStringMember | mctree.TypedIdentifier;
|
|
49
50
|
export declare type StateNodeDecls = {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Block, Context, FuncEntry } from "./bytecode";
|
|
2
|
-
|
|
2
|
+
import { InterpState } from "./interp";
|
|
3
|
+
export declare function optimizeArrayInit(func: FuncEntry, block: Block, index: number, context: Context, interpState: InterpState | null): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as crypto from "node:crypto";
|
|
3
|
+
import { BuildConfig } from "src/optimizer-types";
|
|
3
4
|
import { xmlUtil } from "../sdk-util";
|
|
4
5
|
import { ExceptionEntry, ExceptionsMap } from "./exceptions";
|
|
5
6
|
import { Header } from "./header";
|
|
@@ -23,6 +24,7 @@ export declare type SectionInfo = {
|
|
|
23
24
|
};
|
|
24
25
|
export declare type Logger = (module: string, level: number, message: string) => void;
|
|
25
26
|
export declare type Context = {
|
|
27
|
+
config: BuildConfig;
|
|
26
28
|
filepath: string;
|
|
27
29
|
sections: Record<number, SectionInfo>;
|
|
28
30
|
header: Header;
|
|
@@ -51,10 +53,11 @@ export declare type FuncEntry = {
|
|
|
51
53
|
export declare function offsetToString(offset: number): string;
|
|
52
54
|
export declare function fixSectionSize(section: SectionKinds, sections: Context["sections"], newSize: number): void;
|
|
53
55
|
export declare function optimizeBytecode(context: Context): void;
|
|
54
|
-
export declare function functionBanner(func: FuncEntry, context: Context | null, pass: string,
|
|
56
|
+
export declare function functionBanner(func: FuncEntry, context: Context | null, pass: string, extra?: (block: Block, footer: boolean) => string): () => string;
|
|
55
57
|
export declare function printFunction(func: FuncEntry, context: Context | null): void;
|
|
56
|
-
export declare function functionToString(func: FuncEntry, context: Context | null,
|
|
58
|
+
export declare function functionToString(func: FuncEntry, context: Context | null, extra?: (block: Block, footer: boolean) => string): string;
|
|
57
59
|
export declare function blockToString(block: Block, context: Context | null): string;
|
|
60
|
+
export declare function lineInfoToString(lineInfo: LineNumber, context: Context | null): string;
|
|
58
61
|
export declare function bytecodeToString(bytecode: Bytecode, symbolTable: SymbolTable | null | undefined): string;
|
|
59
62
|
export declare function findFunctions({ bytecodes, symbolTable, exceptionsMap, }: Context): Map<number, FuncEntry>;
|
|
60
63
|
export declare function makeArgless(bc: Bytecode, op: Opcodes): void;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Block, FuncEntry } from "./bytecode";
|
|
2
|
+
import { Bytecode } from "./opcodes";
|
|
2
3
|
export declare function postOrderTraverse(func: FuncEntry, visitor: (block: Block) => void): void;
|
|
3
4
|
export declare function intersect<T>(a: Set<T>, b: Set<T>): Set<T>;
|
|
4
5
|
export declare type DomLike = Map<number, Set<number>>;
|
|
5
6
|
export declare function computePostDominators(func: FuncEntry): DomLike;
|
|
7
|
+
export declare function postOrderPropagate<T>(func: FuncEntry, preBlock: (block: Block) => T, processBc: (block: Block, bc: Bytecode, state: T) => void, postBlock: (block: Block, state: T) => void, merge: (state: T, predBlock: Block, isExPred: boolean) => boolean): void;
|
|
8
|
+
export declare enum RpoFlags {
|
|
9
|
+
EnqueueTaken = 1,
|
|
10
|
+
EnqueueNext = 2,
|
|
11
|
+
SkipTaken = 4,
|
|
12
|
+
SkipNext = 8,
|
|
13
|
+
RestartBlock = 16
|
|
14
|
+
}
|
|
15
|
+
export declare function rpoPropagate<T>(func: FuncEntry, preBlock: (block: Block) => T, processBc: (block: Block, bc: Bytecode, state: T) => RpoFlags | null | undefined | void, postBlock: (block: Block, state: T) => void, merge: (from: Block, state: T, predBlock: Block, isExSucc: boolean) => boolean): void;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { Context, FuncEntry } from "./bytecode";
|
|
2
2
|
export declare function localDCE(func: FuncEntry, context: Context): boolean;
|
|
3
|
-
export declare function computeLiveLocals(func: FuncEntry):
|
|
3
|
+
export declare function computeLiveLocals(func: FuncEntry): {
|
|
4
|
+
liveInLocals: Map<number, Set<number>>;
|
|
5
|
+
liveOutLocals: Map<number, Set<number>>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExactOrUnion } from "../optimizer";
|
|
2
|
+
import { Context, FuncEntry } from "./bytecode";
|
|
3
|
+
import { Bytecode, Lputv } from "./opcodes";
|
|
4
|
+
interface InterpItemInfo {
|
|
5
|
+
type: ExactOrUnion;
|
|
6
|
+
equivs?: Set<number>;
|
|
7
|
+
}
|
|
8
|
+
export declare type InterpState = {
|
|
9
|
+
stack: InterpItemInfo[];
|
|
10
|
+
locals: InterpItemInfo[];
|
|
11
|
+
loopBlock?: true;
|
|
12
|
+
};
|
|
13
|
+
export declare function cloneState(state: InterpState | null | undefined): InterpState;
|
|
14
|
+
export declare function interpBytecode(bc: Bytecode, localState: InterpState, context: Context): void;
|
|
15
|
+
export declare function interpFunc(func: FuncEntry, context: Context): {
|
|
16
|
+
liveInState: Map<number, InterpState>;
|
|
17
|
+
equivSets: Map<Lputv, Set<number>>;
|
|
18
|
+
};
|
|
19
|
+
export declare function instForType(type: ExactOrUnion, offset: number): Bytecode | null;
|
|
20
|
+
export {};
|
package/build/src/readprg.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import * as crypto from "node:crypto";
|
|
4
|
+
import { BuildConfig } from "./optimizer-types";
|
|
4
5
|
import { SectionInfo } from "./readprg/bytecode";
|
|
5
6
|
import { xmlUtil } from "./sdk-util";
|
|
6
7
|
export declare function readPrg(path: string): Promise<{
|
|
@@ -14,12 +15,12 @@ export declare function readPrgWithOffsets(view: DataView): {
|
|
|
14
15
|
view: DataView;
|
|
15
16
|
sections: Record<number, SectionInfo>;
|
|
16
17
|
};
|
|
17
|
-
export declare function optimizeProgram(filepath: string, devKey?: string | undefined, output?: string): Promise<unknown>;
|
|
18
|
-
export declare function optimizeProgramBuffer(filepath: string, view: DataView, debugXml: xmlUtil.Document, key: crypto.KeyObject | undefined): {
|
|
18
|
+
export declare function optimizeProgram(filepath: string, devKey?: string | undefined, output?: string, config?: BuildConfig): Promise<unknown>;
|
|
19
|
+
export declare function optimizeProgramBuffer(filepath: string, view: DataView, debugXml: xmlUtil.Document, key: crypto.KeyObject | undefined, config: BuildConfig | undefined): {
|
|
19
20
|
signature: Buffer | undefined;
|
|
20
21
|
buffer: Buffer;
|
|
21
22
|
};
|
|
22
|
-
export declare function optimizePrgAndDebug(prgName: string, prgBuffer: ArrayBuffer, prgOffset: number, prgLength: number, xmlName: string, xmlBuffer: ArrayBuffer, xmlOffset: number, xmlLength: number, key: crypto.KeyObject): Promise<{
|
|
23
|
+
export declare function optimizePrgAndDebug(prgName: string, prgBuffer: ArrayBuffer, prgOffset: number, prgLength: number, xmlName: string, xmlBuffer: ArrayBuffer, xmlOffset: number, xmlLength: number, key: crypto.KeyObject, config: BuildConfig | undefined): Promise<{
|
|
23
24
|
sigBuffer: ArrayBufferLike | undefined;
|
|
24
25
|
sigOffset: number | undefined;
|
|
25
26
|
sigLength: number | undefined;
|
|
@@ -17,7 +17,7 @@ export declare function printBlockHeader(block: TypeFlowBlock): void;
|
|
|
17
17
|
export declare function describeEvent(event: Event): string;
|
|
18
18
|
export declare function printBlockEvents(block: TypeFlowBlock, extra?: (event: Event) => string): void;
|
|
19
19
|
export declare function printBlockTrailer(block: TypeFlowBlock): void;
|
|
20
|
-
export declare function findObjectDeclsByProperty(state: ProgramStateAnalysis, object: ExactOrUnion, next: mctree.DottedMemberExpression): [
|
|
20
|
+
export declare function findObjectDeclsByProperty(state: ProgramStateAnalysis, object: ExactOrUnion, next: mctree.DottedMemberExpression): readonly [null, null] | [StateNode[], StateNode[]];
|
|
21
21
|
export declare function refineObjectTypeByDecls(istate: InterpState, object: ExactOrUnion, trueDecls: StateNode[]): ExactOrUnion;
|
|
22
22
|
export declare function findNextObjectType(istate: InterpState, trueDecls: StateNode[], next: mctree.DottedMemberExpression): import("./types").UnionType | import("./types").NumberType | import("./types").LongType | import("./types").FloatType | import("./types").DoubleType | import("./types").CharType | import("./types").StringType | import("./types").ArrayType | import("./types").DictionaryType | import("./types").MethodType | import("./types").ModuleType | import("./types").FunctionType | import("./types").ClassType | import("./types").ObjectType | import("./types").EnumType | import("./types").SymbolType | import("./types").TypedefType | null;
|
|
23
23
|
export declare function resolveDottedMember(istate: InterpState, object: ExactOrUnion, next: mctree.DottedMemberExpression): {
|
|
@@ -41,6 +41,7 @@ interface OptimizePrgAndDebug extends BaseNode {
|
|
|
41
41
|
xmlOffset: number;
|
|
42
42
|
xmlLength: number;
|
|
43
43
|
key: crypto.KeyObject;
|
|
44
|
+
config: BuildConfig | undefined;
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
export declare type WorkerTask = BuildOptimizedProject | GenerateOptimizedProject | GenerateOneConfig | OptimizePrgAndDebug;
|
package/build/util.cjs
CHANGED
|
@@ -18,32 +18,32 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var util_exports = {};
|
|
20
20
|
__export(util_exports, {
|
|
21
|
-
GenericQueue: () =>
|
|
22
|
-
bumpLogging: () =>
|
|
23
|
-
copyRecursiveAsNeeded: () =>
|
|
24
|
-
every: () =>
|
|
25
|
-
first_modified: () =>
|
|
26
|
-
forEach: () =>
|
|
27
|
-
globSome: () =>
|
|
28
|
-
globa: () =>
|
|
29
|
-
last_modified: () =>
|
|
30
|
-
log: () =>
|
|
31
|
-
logger: () =>
|
|
32
|
-
map: () =>
|
|
33
|
-
popcount: () =>
|
|
34
|
-
promiseAll: () =>
|
|
35
|
-
pushUnique: () =>
|
|
36
|
-
readByLine: () =>
|
|
37
|
-
reduce: () =>
|
|
38
|
-
sameArrays: () =>
|
|
39
|
-
setBanner: () =>
|
|
40
|
-
some: () =>
|
|
41
|
-
spawnByLine: () =>
|
|
42
|
-
wouldLog: () =>
|
|
21
|
+
GenericQueue: () => import_chunk_HHQDDCTP.GenericQueue,
|
|
22
|
+
bumpLogging: () => import_chunk_HHQDDCTP.bumpLogging,
|
|
23
|
+
copyRecursiveAsNeeded: () => import_chunk_HHQDDCTP.copyRecursiveAsNeeded,
|
|
24
|
+
every: () => import_chunk_HHQDDCTP.every,
|
|
25
|
+
first_modified: () => import_chunk_HHQDDCTP.first_modified,
|
|
26
|
+
forEach: () => import_chunk_HHQDDCTP.forEach,
|
|
27
|
+
globSome: () => import_chunk_HHQDDCTP.globSome,
|
|
28
|
+
globa: () => import_chunk_HHQDDCTP.globa,
|
|
29
|
+
last_modified: () => import_chunk_HHQDDCTP.last_modified,
|
|
30
|
+
log: () => import_chunk_HHQDDCTP.log,
|
|
31
|
+
logger: () => import_chunk_HHQDDCTP.logger,
|
|
32
|
+
map: () => import_chunk_HHQDDCTP.map,
|
|
33
|
+
popcount: () => import_chunk_HHQDDCTP.popcount,
|
|
34
|
+
promiseAll: () => import_chunk_HHQDDCTP.promiseAll,
|
|
35
|
+
pushUnique: () => import_chunk_HHQDDCTP.pushUnique,
|
|
36
|
+
readByLine: () => import_chunk_HHQDDCTP.readByLine,
|
|
37
|
+
reduce: () => import_chunk_HHQDDCTP.reduce,
|
|
38
|
+
sameArrays: () => import_chunk_HHQDDCTP.sameArrays,
|
|
39
|
+
setBanner: () => import_chunk_HHQDDCTP.setBanner,
|
|
40
|
+
some: () => import_chunk_HHQDDCTP.some,
|
|
41
|
+
spawnByLine: () => import_chunk_HHQDDCTP.spawnByLine,
|
|
42
|
+
wouldLog: () => import_chunk_HHQDDCTP.wouldLog
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(util_exports);
|
|
45
|
-
var
|
|
46
|
-
(0,
|
|
45
|
+
var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
|
|
46
|
+
(0, import_chunk_HHQDDCTP.init_util)();
|
|
47
47
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
48
|
0 && (module.exports = {
|
|
49
49
|
GenericQueue,
|
package/build/worker-thread.cjs
CHANGED
|
@@ -21,15 +21,15 @@ __export(worker_thread_exports, {
|
|
|
21
21
|
default: () => worker_thread_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(worker_thread_exports);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
24
|
+
var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
|
|
25
|
+
var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
|
|
26
26
|
var import_node_worker_threads = require("node:worker_threads");
|
|
27
|
-
var require_worker_thread = (0,
|
|
27
|
+
var require_worker_thread = (0, import_chunk_HHQDDCTP.__commonJS)({
|
|
28
28
|
"src/worker-thread.ts"() {
|
|
29
|
-
(0,
|
|
29
|
+
(0, import_chunk_563GVBVT.init_worker_task)();
|
|
30
30
|
if (import_node_worker_threads.parentPort) {
|
|
31
31
|
import_node_worker_threads.parentPort.on("message", async (task) => {
|
|
32
|
-
return import_node_worker_threads.parentPort.postMessage(await (0,
|
|
32
|
+
return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_563GVBVT.performTask)(task));
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markw65/monkeyc-optimizer",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.22",
|
|
5
5
|
"description": "Source to source optimizer for Garmin Monkey C code",
|
|
6
6
|
"main": "build/optimizer.cjs",
|
|
7
7
|
"types": "build/src/optimizer.d.ts",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
"build-debug": "node esbuild.mjs",
|
|
22
22
|
"build-release": "node esbuild.mjs --release",
|
|
23
23
|
"prepack": "node esbuild.mjs --release",
|
|
24
|
-
"test": "npm run test-mocha && npm run test-optimized && npm run test-unopt && npm run test-remote && npm run test-remote-tests",
|
|
24
|
+
"test": "npm run test-mocha && npm run test-optimized && npm run test-unopt && npm run test-post-only && npm run test-remote && npm run test-remote-tests",
|
|
25
25
|
"test-mocha": "npx mocha --timeout 999999 build/mocha.cjs",
|
|
26
26
|
"test-remote": "node ./test/test.js --showInfo --postOptimize --product=pick-one --github",
|
|
27
27
|
"test-remote-tests": "node ./test/test.js --showInfo --postOptimize --product=pick-one --run-tests --github",
|
|
28
28
|
"test-optimized": "node test/test.js --showInfo --postOptimize --typeCheckLevel Strict --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
29
29
|
"test-unopt": "node test/test.js --typeCheckLevel Strict --skipOptimization --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
30
|
+
"test-post-only": "node test/test.js --typeCheckLevel Strict --skipOptimization --postOptimize --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
30
31
|
"test-garmin-opt": "node test/test.js --typeCheckLevel Strict --skipOptimization --garminOptLevel=2 --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
31
32
|
"eslint": "npx eslint ."
|
|
32
33
|
},
|
|
@@ -36,7 +37,6 @@
|
|
|
36
37
|
"build/sdk-util.cjs",
|
|
37
38
|
"build/api.cjs",
|
|
38
39
|
"build/worker-thread.cjs",
|
|
39
|
-
"build/worker-pool.cjs",
|
|
40
40
|
"build/chunk-*.cjs",
|
|
41
41
|
"build/src/**/*.d.ts"
|
|
42
42
|
],
|
package/build/worker-pool.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var worker_pool_exports = {};
|
|
20
|
-
__export(worker_pool_exports, {
|
|
21
|
-
runTaskInPool: () => import_chunk_DCGJCC63.runTaskInPool,
|
|
22
|
-
startPool: () => import_chunk_DCGJCC63.startPool,
|
|
23
|
-
stopPool: () => import_chunk_DCGJCC63.stopPool
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(worker_pool_exports);
|
|
26
|
-
var import_chunk_DCGJCC63 = require("./chunk-DCGJCC63.cjs");
|
|
27
|
-
var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
|
|
28
|
-
(0, import_chunk_DCGJCC63.init_worker_pool)();
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
runTaskInPool,
|
|
32
|
-
startPool,
|
|
33
|
-
stopPool
|
|
34
|
-
});
|