porffor 0.16.0-ab08df866 → 0.16.0-b099006b8
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/compiler/assemble.js +5 -4
- package/compiler/builtins.js +2 -2
- package/compiler/codegen.js +5 -16
- package/compiler/cyclone.js +535 -0
- package/compiler/decompile.js +3 -1
- package/compiler/havoc.js +93 -0
- package/compiler/index.js +89 -6
- package/compiler/opt.js +1 -37
- package/compiler/pgo.js +207 -0
- package/compiler/prefs.js +6 -1
- package/compiler/wrap.js +53 -12
- package/no_pgo.txt +923 -0
- package/package.json +1 -1
- package/pgo.txt +916 -0
- package/runner/index.js +13 -8
- /package/runner/{profiler.js → profile.js} +0 -0
package/runner/index.js
CHANGED
@@ -64,7 +64,12 @@ if (['run', 'wasm', 'native', 'c', 'profile', 'debug', 'debug-wasm'].includes(fi
|
|
64
64
|
process.argv.splice(process.argv.indexOf(file), 1);
|
65
65
|
|
66
66
|
if (file === 'profile') {
|
67
|
-
await import('./
|
67
|
+
await import('./profile.js');
|
68
|
+
await new Promise(() => {}); // do nothing for the rest of this file
|
69
|
+
}
|
70
|
+
|
71
|
+
if (file === 'debug') {
|
72
|
+
await import('./debug.js');
|
68
73
|
await new Promise(() => {}); // do nothing for the rest of this file
|
69
74
|
}
|
70
75
|
|
@@ -76,11 +81,6 @@ if (['run', 'wasm', 'native', 'c', 'profile', 'debug', 'debug-wasm'].includes(fi
|
|
76
81
|
process.argv.push('--asur', '--wasm-debug');
|
77
82
|
}
|
78
83
|
|
79
|
-
if (file === 'debug') {
|
80
|
-
await import('./debug.js');
|
81
|
-
await new Promise(() => {}); // do nothing for the rest of this file
|
82
|
-
}
|
83
|
-
|
84
84
|
file = process.argv.slice(2).find(x => x[0] !== '-');
|
85
85
|
|
86
86
|
const nonOptOutFile = process.argv.slice(process.argv.indexOf(file) + 1).find(x => x[0] !== '-');
|
@@ -89,6 +89,8 @@ if (['run', 'wasm', 'native', 'c', 'profile', 'debug', 'debug-wasm'].includes(fi
|
|
89
89
|
}
|
90
90
|
}
|
91
91
|
|
92
|
+
globalThis.file = file;
|
93
|
+
|
92
94
|
if (!file) {
|
93
95
|
if (process.argv.includes('-v') || process.argv.includes('--version')) {
|
94
96
|
// just print version
|
@@ -115,17 +117,20 @@ const print = str => {
|
|
115
117
|
process.stdout.write(str);
|
116
118
|
};
|
117
119
|
|
120
|
+
let runStart;
|
118
121
|
try {
|
119
122
|
if (process.argv.includes('-b')) {
|
120
123
|
const { wasm, exports } = await compile(source, process.argv.includes('--module') ? [ 'module' ] : [], {}, print);
|
121
124
|
|
125
|
+
runStart = performance.now();
|
122
126
|
if (!process.argv.includes('--no-run')) exports.main();
|
123
127
|
|
124
128
|
console.log(`\n\nwasm size: ${wasm.byteLength} bytes`);
|
125
129
|
} else {
|
126
130
|
const { exports } = await compile(source, process.argv.includes('--module') ? [ 'module' ] : [], {}, print);
|
127
131
|
|
128
|
-
|
132
|
+
runStart = performance.now();
|
133
|
+
if (!process.argv.includes('--no-run')) exports.main();
|
129
134
|
}
|
130
135
|
// if (cache) process.stdout.write(cache);
|
131
136
|
} catch (e) {
|
@@ -133,4 +138,4 @@ try {
|
|
133
138
|
console.error(process.argv.includes('-i') ? e : `${e.constructor.name}: ${e.message}`);
|
134
139
|
}
|
135
140
|
|
136
|
-
if (process.argv.includes('-t')) console.log(`${process.argv.includes('-b') ? '' : '\n\n'}total time: ${(performance.now() - start).toFixed(2)}ms`);
|
141
|
+
if (process.argv.includes('-t')) console.log(`${process.argv.includes('-b') ? '' : '\n\n'}total time: ${(performance.now() - start).toFixed(2)}ms\nexecution time: ${(performance.now() - runStart).toFixed(2)}ms`);
|
File without changes
|