@markw65/monkeyc-optimizer 1.1.33 → 1.1.34
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 +1 -932
- package/build/api.cjs +31 -31
- package/build/{chunk-7ANQTFGD.cjs → chunk-QBCVUVLD.cjs} +163 -46
- package/build/optimizer.cjs +17 -17
- package/build/sdk-util.cjs +14 -14
- package/build/src/api.d.ts +1 -1
- package/build/src/readprg.d.ts +0 -6
- package/build/src/src/api.d.ts +51 -0
- package/build/src/src/ast.d.ts +59 -0
- package/build/src/src/build.d.ts +7 -0
- package/build/src/src/cftinfo.d.ts +32 -0
- package/build/src/src/control-flow.d.ts +22 -0
- package/build/src/src/data-flow.d.ts +107 -0
- package/build/src/src/driver.d.ts +2 -0
- package/build/src/src/function-info.d.ts +14 -0
- package/build/src/src/inliner.d.ts +13 -0
- package/build/src/src/jungles.d.ts +66 -0
- package/build/src/src/launch.d.ts +5 -0
- package/build/src/src/logger.d.ts +6 -0
- package/build/src/src/manifest.d.ts +11 -0
- package/build/src/src/mc-rewrite.d.ts +13 -0
- package/build/src/src/negative-fixups.d.ts +1 -0
- package/build/src/src/optimizer-types.d.ts +249 -0
- package/build/src/src/optimizer.d.ts +100 -0
- package/build/src/src/pragma-checker.d.ts +3 -0
- package/build/src/src/pre.d.ts +2 -0
- package/build/src/src/projects.d.ts +26 -0
- package/build/src/src/readprg/array-init.d.ts +3 -0
- package/build/src/src/readprg/bytecode.d.ts +72 -0
- package/build/src/src/readprg/cflow.d.ts +17 -0
- package/build/src/src/readprg/data.d.ts +4 -0
- package/build/src/src/readprg/dce.d.ts +6 -0
- package/build/src/src/readprg/emit.d.ts +23 -0
- package/build/src/src/readprg/exceptions.d.ts +10 -0
- package/build/src/src/readprg/header.d.ts +15 -0
- package/build/src/src/readprg/interp.d.ts +21 -0
- package/build/src/src/readprg/linenum.d.ts +29 -0
- package/build/src/src/readprg/locals.d.ts +3 -0
- package/build/src/src/readprg/opcodes.d.ts +279 -0
- package/build/src/src/readprg/optimize.d.ts +3 -0
- package/build/src/src/readprg/pre.d.ts +2 -0
- package/build/src/src/readprg/sharing.d.ts +2 -0
- package/build/src/src/readprg/signer.d.ts +8 -0
- package/build/src/src/readprg/symbols.d.ts +19 -0
- package/build/src/src/readprg.d.ts +25 -0
- package/build/src/src/resources.d.ts +12 -0
- package/build/src/src/sdk-util.d.ts +28 -0
- package/build/src/src/type-flow/could-be.d.ts +5 -0
- package/build/src/src/type-flow/dead-store.d.ts +18 -0
- package/build/src/src/type-flow/interp-binary.d.ts +4 -0
- package/build/src/src/type-flow/interp-call.d.ts +16 -0
- package/build/src/src/type-flow/interp.d.ts +33 -0
- package/build/src/src/type-flow/intersection-type.d.ts +4 -0
- package/build/src/src/type-flow/minimize-locals.d.ts +4 -0
- package/build/src/src/type-flow/minimize-modules.d.ts +3 -0
- package/build/src/src/type-flow/optimize.d.ts +7 -0
- package/build/src/src/type-flow/sub-type.d.ts +2 -0
- package/build/src/src/type-flow/type-flow-util.d.ts +27 -0
- package/build/src/src/type-flow/types.d.ts +204 -0
- package/build/src/src/type-flow/union-type.d.ts +4 -0
- package/build/src/src/type-flow.d.ts +18 -0
- package/build/src/src/unused-exprs.d.ts +3 -0
- package/build/src/src/util.d.ts +33 -0
- package/build/src/src/variable-renamer.d.ts +4 -0
- package/build/src/src/visitor.d.ts +5 -0
- package/build/src/src/worker-pool.d.ts +4 -0
- package/build/src/src/worker-task.d.ts +88 -0
- package/build/src/src/worker-thread.d.ts +1 -0
- package/build/src/src/xml-util.d.ts +172 -0
- package/build/src/test/mocha/bytecode.spec.d.ts +1 -0
- package/build/src/test/mocha/coudbe.spec.d.ts +2 -0
- package/build/src/test/mocha/intersection.spec.d.ts +2 -0
- package/build/src/test/mocha/root.spec.d.ts +1 -0
- package/build/src/test/mocha/subtype.spec.d.ts +2 -0
- package/build/src/test/mocha/test-utils.d.ts +6 -0
- package/build/src/test/mocha/types.spec.d.ts +1 -0
- package/build/src/type-flow/interp.d.ts +3 -1
- package/build/src/type-flow/types.d.ts +1 -1
- package/build/worker-thread.cjs +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BuildConfig, ProgramStateAnalysis, StateNodeDecl } from "../../src/optimizer-types";
|
|
2
|
+
import { ExactOrUnion } from "../../src/type-flow/types";
|
|
3
|
+
export declare function create_program_analysis(source: string, filename: string, config: BuildConfig): Promise<ProgramStateAnalysis>;
|
|
4
|
+
export declare function find_by_name(state: ProgramStateAnalysis, name: string): StateNodeDecl[];
|
|
5
|
+
export declare function find_type_by_name(state: ProgramStateAnalysis, name: string): ExactOrUnion;
|
|
6
|
+
export declare function assertNonNull<T>(obj: T, message?: string): asserts obj is NonNullable<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function typeTests(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mctree } from "@markw65/prettier-plugin-monkeyc";
|
|
2
2
|
import { DiagnosticType, FunctionStateNode, ProgramStateAnalysis } from "../optimizer-types";
|
|
3
|
-
import { ExactOrUnion } from "./types";
|
|
3
|
+
import { ExactOrUnion, ObjectType } from "./types";
|
|
4
4
|
export type TypeMap = Map<mctree.Node, ExactOrUnion>;
|
|
5
5
|
export type InterpStackElem = {
|
|
6
6
|
value: ExactOrUnion;
|
|
@@ -29,3 +29,5 @@ export declare function deEnumerate(t: ExactOrUnion): ExactOrUnion;
|
|
|
29
29
|
export declare function evaluateNode(istate: InterpState, node: mctree.Node): void;
|
|
30
30
|
export declare function roundToFloat(value: number): number;
|
|
31
31
|
export declare function mustBeIdentical(a: ExactOrUnion, b: ExactOrUnion): boolean;
|
|
32
|
+
export declare function isByteArray(object: ExactOrUnion): boolean | undefined;
|
|
33
|
+
export declare function isByteArrayData(objectData: NonNullable<ObjectType["value"]>): boolean | undefined;
|
|
@@ -26,7 +26,7 @@ export declare const enum TypeTag {
|
|
|
26
26
|
Typedef = 262144,
|
|
27
27
|
Any = 524287
|
|
28
28
|
}
|
|
29
|
-
export declare function typeTagName(tag: TypeTag): "
|
|
29
|
+
export declare function typeTagName(tag: TypeTag): "Symbol" | "Object" | "Number" | "Float" | "Double" | "Long" | "String" | "Char" | "Boolean" | "Null" | "Never" | "False" | "True" | "Decimal" | "Numeric" | "Array" | "Dictionary" | "Method" | "Module" | "Function" | "Class" | "Enum" | "Typedef" | "Any";
|
|
30
30
|
export declare const LastTypeTag = TypeTag.Typedef;
|
|
31
31
|
export declare const SingletonTypeTagsConst: number;
|
|
32
32
|
export declare const UnionDataTypeTagsConst: number;
|
package/build/worker-thread.cjs
CHANGED
|
@@ -21,17 +21,17 @@ __export(worker_thread_exports, {
|
|
|
21
21
|
default: () => worker_thread_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(worker_thread_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_QBCVUVLD = require("./chunk-QBCVUVLD.cjs");
|
|
25
25
|
var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
|
|
26
26
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
27
27
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
28
28
|
var import_node_worker_threads = require("node:worker_threads");
|
|
29
29
|
var require_worker_thread = (0, import_chunk_ABYVSU2C.__commonJS)({
|
|
30
30
|
"src/worker-thread.ts"() {
|
|
31
|
-
(0,
|
|
31
|
+
(0, import_chunk_QBCVUVLD.init_worker_task)();
|
|
32
32
|
if (import_node_worker_threads.parentPort) {
|
|
33
33
|
import_node_worker_threads.parentPort.on("message", async (task) => {
|
|
34
|
-
return import_node_worker_threads.parentPort.postMessage(await (0,
|
|
34
|
+
return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_QBCVUVLD.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED