parseman 0.61.1 → 0.61.3
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/dist/analysis/diagnostics.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/index.js +26 -17
- package/dist/index.js.map +2 -2
- package/dist/plugin/evaluator.d.ts.map +1 -1
- package/dist/plugin/index.d.ts +10 -4
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +125 -48
- package/dist/plugin/index.js.map +3 -3
- package/dist/table/compile-rule-map.d.ts.map +1 -1
- package/dist/table/index.js +26 -17
- package/dist/table/index.js.map +1 -1
- package/dist/table/select-hot.d.ts +20 -1
- package/dist/table/select-hot.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/plugin/evaluator.ts +42 -2
- package/src/plugin/index.ts +67 -26
- package/src/table/compile-rule-map.ts +8 -21
- package/src/table/select-hot.ts +35 -4
- package/src/version.ts +1 -1
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -5653,7 +5653,7 @@ function sourceLeaf(root, fn) {
|
|
|
5653
5653
|
}
|
|
5654
5654
|
|
|
5655
5655
|
// src/version.ts
|
|
5656
|
-
var PARSEMAN_VERSION = "0.61.
|
|
5656
|
+
var PARSEMAN_VERSION = "0.61.3";
|
|
5657
5657
|
|
|
5658
5658
|
// src/table/lex-body.ts
|
|
5659
5659
|
function buildLexBodyRecognizer(spec, constants) {
|
|
@@ -19520,13 +19520,21 @@ function selectHotSites(code, entries, siteBytes, budget, profile) {
|
|
|
19520
19520
|
let spent = 0;
|
|
19521
19521
|
for (const ip of ranked) {
|
|
19522
19522
|
if (w(ip) === 0) break;
|
|
19523
|
-
|
|
19524
|
-
if (spent
|
|
19525
|
-
spent += bytes2;
|
|
19523
|
+
spent += siteBytes.get(ip);
|
|
19524
|
+
if (spent > budget) break;
|
|
19526
19525
|
selected.add(ip);
|
|
19527
19526
|
}
|
|
19528
19527
|
return selected;
|
|
19529
19528
|
}
|
|
19529
|
+
function fitHotSites(code, entries, siteBytes, fixed, ceiling, sourceBytes, profile) {
|
|
19530
|
+
const ranked = [...selectHotSites(code, entries, siteBytes, ceiling - fixed, profile)];
|
|
19531
|
+
for (; ranked.length > 0; ranked.pop()) {
|
|
19532
|
+
const sites = new Set(ranked);
|
|
19533
|
+
const bytes2 = sourceBytes(sites);
|
|
19534
|
+
if (bytes2 <= ceiling) return { sites, bytes: bytes2 };
|
|
19535
|
+
}
|
|
19536
|
+
return void 0;
|
|
19537
|
+
}
|
|
19530
19538
|
function staticWeights(code, entries) {
|
|
19531
19539
|
let weight = /* @__PURE__ */ new Map();
|
|
19532
19540
|
const kids = [];
|
|
@@ -19666,19 +19674,20 @@ function compileRuleMap(ruleMap, opts = {}) {
|
|
|
19666
19674
|
}
|
|
19667
19675
|
const ceiling = budget / SUPERCOMPILE_GROWTH;
|
|
19668
19676
|
if (ceiling <= fixed) return none;
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19677
|
+
const fit = fitHotSites(
|
|
19678
|
+
artifact.code,
|
|
19679
|
+
Object.values(artifact.rules),
|
|
19680
|
+
siteBytes,
|
|
19681
|
+
fixed,
|
|
19682
|
+
ceiling,
|
|
19683
|
+
(sites) => emitAssemblySource(table, artifact, cfg, roots, true, sites, true).source.length,
|
|
19684
|
+
profile
|
|
19685
|
+
);
|
|
19686
|
+
if (fit !== void 0) return { sites: fit.sites, bytes: Math.ceil(fit.bytes * SUPERCOMPILE_GROWTH) };
|
|
19687
|
+
return {
|
|
19688
|
+
...none,
|
|
19689
|
+
refusal: `a site within its ${Math.floor(ceiling)} B selection ceiling (the prelude alone is ${fixed} B)`
|
|
19690
|
+
};
|
|
19682
19691
|
};
|
|
19683
19692
|
return {
|
|
19684
19693
|
keys: ruleMap.map(([key]) => key),
|