@5ive-tech/sdk 1.1.2
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 +279 -0
- package/dist/FiveSDK.d.ts +336 -0
- package/dist/FiveSDK.js +395 -0
- package/dist/accounts/index.d.ts +254 -0
- package/dist/accounts/index.js +543 -0
- package/dist/assets/vm/dummy.file +0 -0
- package/dist/assets/vm/five_vm_wasm.d.ts +762 -0
- package/dist/assets/vm/five_vm_wasm.js +3754 -0
- package/dist/assets/vm/five_vm_wasm_bg.js +3307 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm +0 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm.d.ts +247 -0
- package/dist/assets/vm/package.json +11 -0
- package/dist/bin/gen-types.d.ts +2 -0
- package/dist/bin/gen-types.js +35 -0
- package/dist/compiler/BytecodeCompiler.d.ts +83 -0
- package/dist/compiler/BytecodeCompiler.js +379 -0
- package/dist/config/ConfigManager.d.ts +13 -0
- package/dist/config/ConfigManager.js +27 -0
- package/dist/config/ProgramIdResolver.d.ts +62 -0
- package/dist/config/ProgramIdResolver.js +104 -0
- package/dist/crypto/index.d.ts +211 -0
- package/dist/crypto/index.js +451 -0
- package/dist/encoding/ParameterEncoder.d.ts +31 -0
- package/dist/encoding/ParameterEncoder.js +278 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +28 -0
- package/dist/lib/bytecode-encoder.d.ts +62 -0
- package/dist/lib/bytecode-encoder.js +281 -0
- package/dist/logging/index.d.ts +9 -0
- package/dist/logging/index.js +10 -0
- package/dist/metadata/index.d.ts +213 -0
- package/dist/metadata/index.js +296 -0
- package/dist/modules/accounts.d.ts +60 -0
- package/dist/modules/accounts.js +275 -0
- package/dist/modules/deploy.d.ts +90 -0
- package/dist/modules/deploy.js +1118 -0
- package/dist/modules/execute.d.ts +90 -0
- package/dist/modules/execute.js +649 -0
- package/dist/modules/fees.d.ts +14 -0
- package/dist/modules/fees.js +112 -0
- package/dist/modules/namespaces.d.ts +39 -0
- package/dist/modules/namespaces.js +190 -0
- package/dist/modules/state-diff.d.ts +35 -0
- package/dist/modules/state-diff.js +342 -0
- package/dist/modules/vm-state.d.ts +7 -0
- package/dist/modules/vm-state.js +44 -0
- package/dist/program/AccountResolver.d.ts +67 -0
- package/dist/program/AccountResolver.js +134 -0
- package/dist/program/BorshSchemaGenerator.d.ts +8 -0
- package/dist/program/BorshSchemaGenerator.js +57 -0
- package/dist/program/FiveProgram.d.ts +144 -0
- package/dist/program/FiveProgram.js +282 -0
- package/dist/program/FunctionBuilder.d.ts +114 -0
- package/dist/program/FunctionBuilder.js +347 -0
- package/dist/program/ProgramAccount.d.ts +38 -0
- package/dist/program/ProgramAccount.js +170 -0
- package/dist/program/TypeGenerator.d.ts +90 -0
- package/dist/program/TypeGenerator.js +195 -0
- package/dist/program/index.d.ts +24 -0
- package/dist/program/index.js +21 -0
- package/dist/project/config.d.ts +5 -0
- package/dist/project/config.js +33 -0
- package/dist/project/toml.d.ts +6 -0
- package/dist/project/toml.js +43 -0
- package/dist/project/workspace.d.ts +160 -0
- package/dist/project/workspace.js +73 -0
- package/dist/testing/AccountMetaGenerator.d.ts +121 -0
- package/dist/testing/AccountMetaGenerator.js +261 -0
- package/dist/testing/AccountTestFixture.d.ts +211 -0
- package/dist/testing/AccountTestFixture.js +530 -0
- package/dist/testing/OnChainAccountManager.d.ts +81 -0
- package/dist/testing/OnChainAccountManager.js +260 -0
- package/dist/testing/StateSerializer.d.ts +65 -0
- package/dist/testing/StateSerializer.js +330 -0
- package/dist/testing/TestDiscovery.d.ts +79 -0
- package/dist/testing/TestDiscovery.js +274 -0
- package/dist/testing/TestRunner.d.ts +117 -0
- package/dist/testing/TestRunner.js +346 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +13 -0
- package/dist/types.d.ts +356 -0
- package/dist/types.js +32 -0
- package/dist/utils/abi.d.ts +31 -0
- package/dist/utils/abi.js +92 -0
- package/dist/utils/transaction.d.ts +5 -0
- package/dist/utils/transaction.js +48 -0
- package/dist/validation/InputValidator.d.ts +142 -0
- package/dist/validation/InputValidator.js +332 -0
- package/dist/validation/index.d.ts +4 -0
- package/dist/validation/index.js +4 -0
- package/dist/wasm/compiler/AbiLogic.d.ts +4 -0
- package/dist/wasm/compiler/AbiLogic.js +37 -0
- package/dist/wasm/compiler/AnalysisLogic.d.ts +6 -0
- package/dist/wasm/compiler/AnalysisLogic.js +61 -0
- package/dist/wasm/compiler/CompilationLogic.d.ts +10 -0
- package/dist/wasm/compiler/CompilationLogic.js +431 -0
- package/dist/wasm/compiler/FiveCompiler.d.ts +48 -0
- package/dist/wasm/compiler/FiveCompiler.js +183 -0
- package/dist/wasm/compiler/InfoLogic.d.ts +6 -0
- package/dist/wasm/compiler/InfoLogic.js +24 -0
- package/dist/wasm/compiler/OptimizationLogic.d.ts +2 -0
- package/dist/wasm/compiler/OptimizationLogic.js +13 -0
- package/dist/wasm/compiler/ValidationLogic.d.ts +7 -0
- package/dist/wasm/compiler/ValidationLogic.js +26 -0
- package/dist/wasm/compiler/index.d.ts +2 -0
- package/dist/wasm/compiler/index.js +2 -0
- package/dist/wasm/compiler/types.d.ts +8 -0
- package/dist/wasm/compiler/types.js +1 -0
- package/dist/wasm/compiler/utils.d.ts +8 -0
- package/dist/wasm/compiler/utils.js +75 -0
- package/dist/wasm/index.d.ts +9 -0
- package/dist/wasm/index.js +12 -0
- package/dist/wasm/instance.d.ts +1 -0
- package/dist/wasm/instance.js +26 -0
- package/dist/wasm/loader.d.ts +7 -0
- package/dist/wasm/loader.js +112 -0
- package/dist/wasm/vm.d.ts +33 -0
- package/dist/wasm/vm.js +250 -0
- package/package.json +59 -0
|
@@ -0,0 +1,3754 @@
|
|
|
1
|
+
/* @ts-self-types="./five_vm_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bytecode analyzer for WASM
|
|
5
|
+
*/
|
|
6
|
+
class BytecodeAnalyzer {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
BytecodeAnalyzerFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_bytecodeanalyzer_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Analyze bytecode and return instruction breakdown (legacy method for compatibility)
|
|
19
|
+
* @param {Uint8Array} bytecode
|
|
20
|
+
* @returns {any}
|
|
21
|
+
*/
|
|
22
|
+
static analyze(bytecode) {
|
|
23
|
+
try {
|
|
24
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
25
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
26
|
+
const len0 = WASM_VECTOR_LEN;
|
|
27
|
+
wasm.bytecodeanalyzer_analyze(retptr, ptr0, len0);
|
|
28
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
29
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
30
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
31
|
+
if (r2) {
|
|
32
|
+
throw takeObject(r1);
|
|
33
|
+
}
|
|
34
|
+
return takeObject(r0);
|
|
35
|
+
} finally {
|
|
36
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get detailed opcode flow analysis - shows execution paths through the bytecode
|
|
41
|
+
* @param {Uint8Array} bytecode
|
|
42
|
+
* @returns {any}
|
|
43
|
+
*/
|
|
44
|
+
static analyze_execution_flow(bytecode) {
|
|
45
|
+
try {
|
|
46
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
47
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
48
|
+
const len0 = WASM_VECTOR_LEN;
|
|
49
|
+
wasm.bytecodeanalyzer_analyze_execution_flow(retptr, ptr0, len0);
|
|
50
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
51
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
52
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
53
|
+
if (r2) {
|
|
54
|
+
throw takeObject(r1);
|
|
55
|
+
}
|
|
56
|
+
return takeObject(r0);
|
|
57
|
+
} finally {
|
|
58
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get detailed information about a specific instruction at an offset
|
|
63
|
+
* @param {Uint8Array} bytecode
|
|
64
|
+
* @param {number} offset
|
|
65
|
+
* @returns {any}
|
|
66
|
+
*/
|
|
67
|
+
static analyze_instruction_at(bytecode, offset) {
|
|
68
|
+
try {
|
|
69
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
70
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
71
|
+
const len0 = WASM_VECTOR_LEN;
|
|
72
|
+
wasm.bytecodeanalyzer_analyze_instruction_at(retptr, ptr0, len0, offset);
|
|
73
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
74
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
75
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
76
|
+
if (r2) {
|
|
77
|
+
throw takeObject(r1);
|
|
78
|
+
}
|
|
79
|
+
return takeObject(r0);
|
|
80
|
+
} finally {
|
|
81
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Advanced semantic analysis with full opcode understanding and instruction flow
|
|
86
|
+
* Performs semantic analysis of bytecode to understand opcode behavior
|
|
87
|
+
* and instruction flow.
|
|
88
|
+
* @param {Uint8Array} bytecode
|
|
89
|
+
* @returns {any}
|
|
90
|
+
*/
|
|
91
|
+
static analyze_semantic(bytecode) {
|
|
92
|
+
try {
|
|
93
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
94
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
95
|
+
const len0 = WASM_VECTOR_LEN;
|
|
96
|
+
wasm.bytecodeanalyzer_analyze_semantic(retptr, ptr0, len0);
|
|
97
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
98
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
99
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
100
|
+
if (r2) {
|
|
101
|
+
throw takeObject(r1);
|
|
102
|
+
}
|
|
103
|
+
return takeObject(r0);
|
|
104
|
+
} finally {
|
|
105
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get summary statistics about the bytecode
|
|
110
|
+
* @param {Uint8Array} bytecode
|
|
111
|
+
* @returns {any}
|
|
112
|
+
*/
|
|
113
|
+
static get_bytecode_summary(bytecode) {
|
|
114
|
+
try {
|
|
115
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
116
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
117
|
+
const len0 = WASM_VECTOR_LEN;
|
|
118
|
+
wasm.bytecodeanalyzer_get_bytecode_summary(retptr, ptr0, len0);
|
|
119
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
120
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
121
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
122
|
+
if (r2) {
|
|
123
|
+
throw takeObject(r1);
|
|
124
|
+
}
|
|
125
|
+
return takeObject(r0);
|
|
126
|
+
} finally {
|
|
127
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (Symbol.dispose) BytecodeAnalyzer.prototype[Symbol.dispose] = BytecodeAnalyzer.prototype.free;
|
|
132
|
+
exports.BytecodeAnalyzer = BytecodeAnalyzer;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Bytecode Encoding utilities for JavaScript (Fixed Size)
|
|
136
|
+
*/
|
|
137
|
+
class BytecodeEncoder {
|
|
138
|
+
__destroy_into_raw() {
|
|
139
|
+
const ptr = this.__wbg_ptr;
|
|
140
|
+
this.__wbg_ptr = 0;
|
|
141
|
+
BytecodeEncoderFinalization.unregister(this);
|
|
142
|
+
return ptr;
|
|
143
|
+
}
|
|
144
|
+
free() {
|
|
145
|
+
const ptr = this.__destroy_into_raw();
|
|
146
|
+
wasm.__wbg_bytecodeencoder_free(ptr, 0);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Decode a u16 value
|
|
150
|
+
* Returns [value, bytes_consumed] or null if invalid
|
|
151
|
+
* @param {Uint8Array} bytes
|
|
152
|
+
* @returns {Array<any> | undefined}
|
|
153
|
+
*/
|
|
154
|
+
static decode_u16(bytes) {
|
|
155
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
157
|
+
const ret = wasm.bytecodeencoder_decode_u16(ptr0, len0);
|
|
158
|
+
return takeObject(ret);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Decode a u32 value
|
|
162
|
+
* Returns [value, bytes_consumed] or null if invalid
|
|
163
|
+
* @param {Uint8Array} bytes
|
|
164
|
+
* @returns {Array<any> | undefined}
|
|
165
|
+
*/
|
|
166
|
+
static decode_u32(bytes) {
|
|
167
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
168
|
+
const len0 = WASM_VECTOR_LEN;
|
|
169
|
+
const ret = wasm.bytecodeencoder_decode_u32(ptr0, len0);
|
|
170
|
+
return takeObject(ret);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Encode a u16 value
|
|
174
|
+
* Returns [size, byte1, byte2]
|
|
175
|
+
* @param {number} value
|
|
176
|
+
* @returns {Array<any>}
|
|
177
|
+
*/
|
|
178
|
+
static encode_u16(value) {
|
|
179
|
+
const ret = wasm.bytecodeencoder_encode_u16(value);
|
|
180
|
+
return takeObject(ret);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Encode a u32 value
|
|
184
|
+
* Returns [size, byte1, byte2, byte3, byte4]
|
|
185
|
+
* @param {number} value
|
|
186
|
+
* @returns {Array<any>}
|
|
187
|
+
*/
|
|
188
|
+
static encode_u32(value) {
|
|
189
|
+
const ret = wasm.bytecodeencoder_encode_u32(value);
|
|
190
|
+
return takeObject(ret);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Calculate encoded size (Always 2 for u16)
|
|
194
|
+
* @param {number} _value
|
|
195
|
+
* @returns {number}
|
|
196
|
+
*/
|
|
197
|
+
static encoded_size_u16(_value) {
|
|
198
|
+
const ret = wasm.bytecodeencoder_encoded_size_u16(_value);
|
|
199
|
+
return ret >>> 0;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Calculate encoded size (Always 4 for u32)
|
|
203
|
+
* @param {number} _value
|
|
204
|
+
* @returns {number}
|
|
205
|
+
*/
|
|
206
|
+
static encoded_size_u32(_value) {
|
|
207
|
+
const ret = wasm.bytecodeencoder_encoded_size_u32(_value);
|
|
208
|
+
return ret >>> 0;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (Symbol.dispose) BytecodeEncoder.prototype[Symbol.dispose] = BytecodeEncoder.prototype.free;
|
|
212
|
+
exports.BytecodeEncoder = BytecodeEncoder;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Execution result.
|
|
216
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
|
|
217
|
+
*/
|
|
218
|
+
const ExecutionStatus = Object.freeze({
|
|
219
|
+
/**
|
|
220
|
+
* All operations completed successfully.
|
|
221
|
+
*/
|
|
222
|
+
Completed: 0, "0": "Completed",
|
|
223
|
+
/**
|
|
224
|
+
* Execution stopped because it hit a system program call that cannot be executed in WASM.
|
|
225
|
+
*/
|
|
226
|
+
StoppedAtSystemCall: 1, "1": "StoppedAtSystemCall",
|
|
227
|
+
/**
|
|
228
|
+
* Execution stopped because it hit an INIT_PDA operation that requires real Solana context.
|
|
229
|
+
*/
|
|
230
|
+
StoppedAtInitPDA: 2, "2": "StoppedAtInitPDA",
|
|
231
|
+
/**
|
|
232
|
+
* Execution stopped because it hit an INVOKE operation that requires real RPC.
|
|
233
|
+
*/
|
|
234
|
+
StoppedAtInvoke: 3, "3": "StoppedAtInvoke",
|
|
235
|
+
/**
|
|
236
|
+
* Execution stopped because it hit an INVOKE_SIGNED operation that requires real RPC.
|
|
237
|
+
*/
|
|
238
|
+
StoppedAtInvokeSigned: 4, "4": "StoppedAtInvokeSigned",
|
|
239
|
+
/**
|
|
240
|
+
* Execution stopped because compute limit was reached.
|
|
241
|
+
*/
|
|
242
|
+
ComputeLimitExceeded: 5, "5": "ComputeLimitExceeded",
|
|
243
|
+
/**
|
|
244
|
+
* Execution failed due to an error.
|
|
245
|
+
*/
|
|
246
|
+
Failed: 6, "6": "Failed",
|
|
247
|
+
});
|
|
248
|
+
exports.ExecutionStatus = ExecutionStatus;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* JavaScript-compatible VM state representation.
|
|
252
|
+
*/
|
|
253
|
+
class FiveVMState {
|
|
254
|
+
__destroy_into_raw() {
|
|
255
|
+
const ptr = this.__wbg_ptr;
|
|
256
|
+
this.__wbg_ptr = 0;
|
|
257
|
+
FiveVMStateFinalization.unregister(this);
|
|
258
|
+
return ptr;
|
|
259
|
+
}
|
|
260
|
+
free() {
|
|
261
|
+
const ptr = this.__destroy_into_raw();
|
|
262
|
+
wasm.__wbg_fivevmstate_free(ptr, 0);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* @returns {bigint}
|
|
266
|
+
*/
|
|
267
|
+
get compute_units() {
|
|
268
|
+
const ret = wasm.fivevmstate_compute_units(this.__wbg_ptr);
|
|
269
|
+
return BigInt.asUintN(64, ret);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @returns {number}
|
|
273
|
+
*/
|
|
274
|
+
get instruction_pointer() {
|
|
275
|
+
const ret = wasm.fivevmstate_instruction_pointer(this.__wbg_ptr);
|
|
276
|
+
return ret >>> 0;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @returns {Array<any>}
|
|
280
|
+
*/
|
|
281
|
+
get stack() {
|
|
282
|
+
const ret = wasm.fivevmstate_stack(this.__wbg_ptr);
|
|
283
|
+
return takeObject(ret);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (Symbol.dispose) FiveVMState.prototype[Symbol.dispose] = FiveVMState.prototype.free;
|
|
287
|
+
exports.FiveVMState = FiveVMState;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Main WASM VM wrapper.
|
|
291
|
+
*/
|
|
292
|
+
class FiveVMWasm {
|
|
293
|
+
__destroy_into_raw() {
|
|
294
|
+
const ptr = this.__wbg_ptr;
|
|
295
|
+
this.__wbg_ptr = 0;
|
|
296
|
+
FiveVMWasmFinalization.unregister(this);
|
|
297
|
+
return ptr;
|
|
298
|
+
}
|
|
299
|
+
free() {
|
|
300
|
+
const ptr = this.__destroy_into_raw();
|
|
301
|
+
wasm.__wbg_fivevmwasm_free(ptr, 0);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Execute VM with input data and accounts (legacy method).
|
|
305
|
+
* @param {Uint8Array} input_data
|
|
306
|
+
* @param {Array<any>} accounts
|
|
307
|
+
* @returns {any}
|
|
308
|
+
*/
|
|
309
|
+
execute(input_data, accounts) {
|
|
310
|
+
try {
|
|
311
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
312
|
+
const ptr0 = passArray8ToWasm0(input_data, wasm.__wbindgen_export);
|
|
313
|
+
const len0 = WASM_VECTOR_LEN;
|
|
314
|
+
wasm.fivevmwasm_execute(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(accounts));
|
|
315
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
316
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
317
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
318
|
+
if (r2) {
|
|
319
|
+
throw takeObject(r1);
|
|
320
|
+
}
|
|
321
|
+
return takeObject(r0);
|
|
322
|
+
} finally {
|
|
323
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Execute VM with partial execution support - stops at system calls.
|
|
328
|
+
* @param {Uint8Array} input_data
|
|
329
|
+
* @param {Array<any>} accounts
|
|
330
|
+
* @returns {TestResult}
|
|
331
|
+
*/
|
|
332
|
+
execute_partial(input_data, accounts) {
|
|
333
|
+
try {
|
|
334
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
335
|
+
const ptr0 = passArray8ToWasm0(input_data, wasm.__wbindgen_export);
|
|
336
|
+
const len0 = WASM_VECTOR_LEN;
|
|
337
|
+
wasm.fivevmwasm_execute_partial(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(accounts));
|
|
338
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
339
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
340
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
341
|
+
if (r2) {
|
|
342
|
+
throw takeObject(r1);
|
|
343
|
+
}
|
|
344
|
+
return TestResult.__wrap(r0);
|
|
345
|
+
} finally {
|
|
346
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Get VM constants for JavaScript
|
|
351
|
+
* @returns {any}
|
|
352
|
+
*/
|
|
353
|
+
static get_constants() {
|
|
354
|
+
const ret = wasm.fivevmwasm_get_constants();
|
|
355
|
+
return takeObject(ret);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Get current VM state
|
|
359
|
+
* @returns {any}
|
|
360
|
+
*/
|
|
361
|
+
get_state() {
|
|
362
|
+
try {
|
|
363
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
364
|
+
wasm.fivevmwasm_get_state(retptr, this.__wbg_ptr);
|
|
365
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
366
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
367
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
368
|
+
if (r2) {
|
|
369
|
+
throw takeObject(r1);
|
|
370
|
+
}
|
|
371
|
+
return takeObject(r0);
|
|
372
|
+
} finally {
|
|
373
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Create new VM instance with bytecode.
|
|
378
|
+
* @param {Uint8Array} _bytecode
|
|
379
|
+
*/
|
|
380
|
+
constructor(_bytecode) {
|
|
381
|
+
try {
|
|
382
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
383
|
+
const ptr0 = passArray8ToWasm0(_bytecode, wasm.__wbindgen_export);
|
|
384
|
+
const len0 = WASM_VECTOR_LEN;
|
|
385
|
+
wasm.fivevmwasm_new(retptr, ptr0, len0);
|
|
386
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
387
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
388
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
389
|
+
if (r2) {
|
|
390
|
+
throw takeObject(r1);
|
|
391
|
+
}
|
|
392
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
393
|
+
FiveVMWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
394
|
+
return this;
|
|
395
|
+
} finally {
|
|
396
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Validate bytecode without execution
|
|
401
|
+
* @param {Uint8Array} bytecode
|
|
402
|
+
* @returns {boolean}
|
|
403
|
+
*/
|
|
404
|
+
static validate_bytecode(bytecode) {
|
|
405
|
+
try {
|
|
406
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
407
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
408
|
+
const len0 = WASM_VECTOR_LEN;
|
|
409
|
+
wasm.fivevmwasm_validate_bytecode(retptr, ptr0, len0);
|
|
410
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
411
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
412
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
413
|
+
if (r2) {
|
|
414
|
+
throw takeObject(r1);
|
|
415
|
+
}
|
|
416
|
+
return r0 !== 0;
|
|
417
|
+
} finally {
|
|
418
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (Symbol.dispose) FiveVMWasm.prototype[Symbol.dispose] = FiveVMWasm.prototype.free;
|
|
423
|
+
exports.FiveVMWasm = FiveVMWasm;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Parameter encoding utilities using fixed-size encoding and protocol types
|
|
427
|
+
*/
|
|
428
|
+
class ParameterEncoder {
|
|
429
|
+
__destroy_into_raw() {
|
|
430
|
+
const ptr = this.__wbg_ptr;
|
|
431
|
+
this.__wbg_ptr = 0;
|
|
432
|
+
ParameterEncoderFinalization.unregister(this);
|
|
433
|
+
return ptr;
|
|
434
|
+
}
|
|
435
|
+
free() {
|
|
436
|
+
const ptr = this.__destroy_into_raw();
|
|
437
|
+
wasm.__wbg_parameterencoder_free(ptr, 0);
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Encode function parameters using fixed size encoding
|
|
441
|
+
* Returns ONLY parameter data - SDK handles discriminator AND function index
|
|
442
|
+
* @param {number} _function_index
|
|
443
|
+
* @param {Array<any>} params
|
|
444
|
+
* @returns {Uint8Array}
|
|
445
|
+
*/
|
|
446
|
+
static encode_execute(_function_index, params) {
|
|
447
|
+
try {
|
|
448
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
449
|
+
wasm.parameterencoder_encode_execute(retptr, _function_index, addHeapObject(params));
|
|
450
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
451
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
452
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
453
|
+
if (r2) {
|
|
454
|
+
throw takeObject(r1);
|
|
455
|
+
}
|
|
456
|
+
return takeObject(r0);
|
|
457
|
+
} finally {
|
|
458
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (Symbol.dispose) ParameterEncoder.prototype[Symbol.dispose] = ParameterEncoder.prototype.free;
|
|
463
|
+
exports.ParameterEncoder = ParameterEncoder;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Detailed execution result.
|
|
467
|
+
*/
|
|
468
|
+
class TestResult {
|
|
469
|
+
static __wrap(ptr) {
|
|
470
|
+
ptr = ptr >>> 0;
|
|
471
|
+
const obj = Object.create(TestResult.prototype);
|
|
472
|
+
obj.__wbg_ptr = ptr;
|
|
473
|
+
TestResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
474
|
+
return obj;
|
|
475
|
+
}
|
|
476
|
+
__destroy_into_raw() {
|
|
477
|
+
const ptr = this.__wbg_ptr;
|
|
478
|
+
this.__wbg_ptr = 0;
|
|
479
|
+
TestResultFinalization.unregister(this);
|
|
480
|
+
return ptr;
|
|
481
|
+
}
|
|
482
|
+
free() {
|
|
483
|
+
const ptr = this.__destroy_into_raw();
|
|
484
|
+
wasm.__wbg_testresult_free(ptr, 0);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Compute units consumed.
|
|
488
|
+
* @returns {bigint}
|
|
489
|
+
*/
|
|
490
|
+
get compute_units_used() {
|
|
491
|
+
const ret = wasm.__wbg_get_testresult_compute_units_used(this.__wbg_ptr);
|
|
492
|
+
return BigInt.asUintN(64, ret);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Final instruction pointer.
|
|
496
|
+
* @returns {number}
|
|
497
|
+
*/
|
|
498
|
+
get instruction_pointer() {
|
|
499
|
+
const ret = wasm.__wbg_get_testresult_instruction_pointer(this.__wbg_ptr);
|
|
500
|
+
return ret >>> 0;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Which opcode caused the stop (if stopped at system call).
|
|
504
|
+
* @returns {number | undefined}
|
|
505
|
+
*/
|
|
506
|
+
get stopped_at_opcode() {
|
|
507
|
+
const ret = wasm.__wbg_get_testresult_stopped_at_opcode(this.__wbg_ptr);
|
|
508
|
+
return ret === 0xFFFFFF ? undefined : ret;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Compute units consumed.
|
|
512
|
+
* @param {bigint} arg0
|
|
513
|
+
*/
|
|
514
|
+
set compute_units_used(arg0) {
|
|
515
|
+
wasm.__wbg_set_testresult_compute_units_used(this.__wbg_ptr, arg0);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Final instruction pointer.
|
|
519
|
+
* @param {number} arg0
|
|
520
|
+
*/
|
|
521
|
+
set instruction_pointer(arg0) {
|
|
522
|
+
wasm.__wbg_set_testresult_instruction_pointer(this.__wbg_ptr, arg0);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Which opcode caused the stop (if stopped at system call).
|
|
526
|
+
* @param {number | null} [arg0]
|
|
527
|
+
*/
|
|
528
|
+
set stopped_at_opcode(arg0) {
|
|
529
|
+
wasm.__wbg_set_testresult_stopped_at_opcode(this.__wbg_ptr, isLikeNone(arg0) ? 0xFFFFFF : arg0);
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* @returns {string | undefined}
|
|
533
|
+
*/
|
|
534
|
+
get error_message() {
|
|
535
|
+
try {
|
|
536
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
537
|
+
wasm.testresult_error_message(retptr, this.__wbg_ptr);
|
|
538
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
539
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
540
|
+
let v1;
|
|
541
|
+
if (r0 !== 0) {
|
|
542
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
543
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
544
|
+
}
|
|
545
|
+
return v1;
|
|
546
|
+
} finally {
|
|
547
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* @returns {string | undefined}
|
|
552
|
+
*/
|
|
553
|
+
get execution_context() {
|
|
554
|
+
try {
|
|
555
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
556
|
+
wasm.testresult_execution_context(retptr, this.__wbg_ptr);
|
|
557
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
558
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
559
|
+
let v1;
|
|
560
|
+
if (r0 !== 0) {
|
|
561
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
562
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
563
|
+
}
|
|
564
|
+
return v1;
|
|
565
|
+
} finally {
|
|
566
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* @returns {Array<any>}
|
|
571
|
+
*/
|
|
572
|
+
get final_accounts() {
|
|
573
|
+
const ret = wasm.testresult_final_accounts(this.__wbg_ptr);
|
|
574
|
+
return takeObject(ret);
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* @returns {Uint8Array}
|
|
578
|
+
*/
|
|
579
|
+
get final_memory() {
|
|
580
|
+
const ret = wasm.testresult_final_memory(this.__wbg_ptr);
|
|
581
|
+
return takeObject(ret);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* @returns {Array<any>}
|
|
585
|
+
*/
|
|
586
|
+
get final_stack() {
|
|
587
|
+
const ret = wasm.testresult_final_stack(this.__wbg_ptr);
|
|
588
|
+
return takeObject(ret);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* @returns {any}
|
|
592
|
+
*/
|
|
593
|
+
get get_result_value() {
|
|
594
|
+
const ret = wasm.testresult_get_result_value(this.__wbg_ptr);
|
|
595
|
+
return takeObject(ret);
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* @returns {boolean}
|
|
599
|
+
*/
|
|
600
|
+
get has_result_value() {
|
|
601
|
+
const ret = wasm.testresult_has_result_value(this.__wbg_ptr);
|
|
602
|
+
return ret !== 0;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* @returns {string}
|
|
606
|
+
*/
|
|
607
|
+
get status() {
|
|
608
|
+
let deferred1_0;
|
|
609
|
+
let deferred1_1;
|
|
610
|
+
try {
|
|
611
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
612
|
+
wasm.testresult_status(retptr, this.__wbg_ptr);
|
|
613
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
614
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
615
|
+
deferred1_0 = r0;
|
|
616
|
+
deferred1_1 = r1;
|
|
617
|
+
return getStringFromWasm0(r0, r1);
|
|
618
|
+
} finally {
|
|
619
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
620
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* @returns {string | undefined}
|
|
625
|
+
*/
|
|
626
|
+
get stopped_at_opcode_name() {
|
|
627
|
+
try {
|
|
628
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
629
|
+
wasm.testresult_stopped_at_opcode_name(retptr, this.__wbg_ptr);
|
|
630
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
631
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
632
|
+
let v1;
|
|
633
|
+
if (r0 !== 0) {
|
|
634
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
635
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
636
|
+
}
|
|
637
|
+
return v1;
|
|
638
|
+
} finally {
|
|
639
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (Symbol.dispose) TestResult.prototype[Symbol.dispose] = TestResult.prototype.free;
|
|
644
|
+
exports.TestResult = TestResult;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* JavaScript-compatible account representation.
|
|
648
|
+
*/
|
|
649
|
+
class WasmAccount {
|
|
650
|
+
__destroy_into_raw() {
|
|
651
|
+
const ptr = this.__wbg_ptr;
|
|
652
|
+
this.__wbg_ptr = 0;
|
|
653
|
+
WasmAccountFinalization.unregister(this);
|
|
654
|
+
return ptr;
|
|
655
|
+
}
|
|
656
|
+
free() {
|
|
657
|
+
const ptr = this.__destroy_into_raw();
|
|
658
|
+
wasm.__wbg_wasmaccount_free(ptr, 0);
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* @returns {boolean}
|
|
662
|
+
*/
|
|
663
|
+
get is_signer() {
|
|
664
|
+
const ret = wasm.__wbg_get_wasmaccount_is_signer(this.__wbg_ptr);
|
|
665
|
+
return ret !== 0;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* @returns {boolean}
|
|
669
|
+
*/
|
|
670
|
+
get is_writable() {
|
|
671
|
+
const ret = wasm.__wbg_get_wasmaccount_is_writable(this.__wbg_ptr);
|
|
672
|
+
return ret !== 0;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* @returns {bigint}
|
|
676
|
+
*/
|
|
677
|
+
get lamports() {
|
|
678
|
+
const ret = wasm.__wbg_get_wasmaccount_lamports(this.__wbg_ptr);
|
|
679
|
+
return BigInt.asUintN(64, ret);
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* @param {boolean} arg0
|
|
683
|
+
*/
|
|
684
|
+
set is_signer(arg0) {
|
|
685
|
+
wasm.__wbg_set_wasmaccount_is_signer(this.__wbg_ptr, arg0);
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* @param {boolean} arg0
|
|
689
|
+
*/
|
|
690
|
+
set is_writable(arg0) {
|
|
691
|
+
wasm.__wbg_set_wasmaccount_is_writable(this.__wbg_ptr, arg0);
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* @param {bigint} arg0
|
|
695
|
+
*/
|
|
696
|
+
set lamports(arg0) {
|
|
697
|
+
wasm.__wbg_set_wasmaccount_lamports(this.__wbg_ptr, arg0);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* @returns {Uint8Array}
|
|
701
|
+
*/
|
|
702
|
+
get data() {
|
|
703
|
+
const ret = wasm.wasmaccount_data(this.__wbg_ptr);
|
|
704
|
+
return takeObject(ret);
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* @returns {Uint8Array}
|
|
708
|
+
*/
|
|
709
|
+
get key() {
|
|
710
|
+
const ret = wasm.wasmaccount_key(this.__wbg_ptr);
|
|
711
|
+
return takeObject(ret);
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* @param {Uint8Array} key
|
|
715
|
+
* @param {Uint8Array} data
|
|
716
|
+
* @param {bigint} lamports
|
|
717
|
+
* @param {boolean} is_writable
|
|
718
|
+
* @param {boolean} is_signer
|
|
719
|
+
* @param {Uint8Array} owner
|
|
720
|
+
*/
|
|
721
|
+
constructor(key, data, lamports, is_writable, is_signer, owner) {
|
|
722
|
+
try {
|
|
723
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
724
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_export);
|
|
725
|
+
const len0 = WASM_VECTOR_LEN;
|
|
726
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
727
|
+
const len1 = WASM_VECTOR_LEN;
|
|
728
|
+
const ptr2 = passArray8ToWasm0(owner, wasm.__wbindgen_export);
|
|
729
|
+
const len2 = WASM_VECTOR_LEN;
|
|
730
|
+
wasm.wasmaccount_new(retptr, ptr0, len0, ptr1, len1, lamports, is_writable, is_signer, ptr2, len2);
|
|
731
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
732
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
733
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
734
|
+
if (r2) {
|
|
735
|
+
throw takeObject(r1);
|
|
736
|
+
}
|
|
737
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
738
|
+
WasmAccountFinalization.register(this, this.__wbg_ptr, this);
|
|
739
|
+
return this;
|
|
740
|
+
} finally {
|
|
741
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* @returns {Uint8Array}
|
|
746
|
+
*/
|
|
747
|
+
get owner() {
|
|
748
|
+
const ret = wasm.wasmaccount_owner(this.__wbg_ptr);
|
|
749
|
+
return takeObject(ret);
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* @param {Uint8Array} data
|
|
753
|
+
*/
|
|
754
|
+
set data(data) {
|
|
755
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
756
|
+
const len0 = WASM_VECTOR_LEN;
|
|
757
|
+
wasm.wasmaccount_set_data(this.__wbg_ptr, ptr0, len0);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (Symbol.dispose) WasmAccount.prototype[Symbol.dispose] = WasmAccount.prototype.free;
|
|
761
|
+
exports.WasmAccount = WasmAccount;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* WASM source analysis result
|
|
765
|
+
*/
|
|
766
|
+
class WasmAnalysisResult {
|
|
767
|
+
static __wrap(ptr) {
|
|
768
|
+
ptr = ptr >>> 0;
|
|
769
|
+
const obj = Object.create(WasmAnalysisResult.prototype);
|
|
770
|
+
obj.__wbg_ptr = ptr;
|
|
771
|
+
WasmAnalysisResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
772
|
+
return obj;
|
|
773
|
+
}
|
|
774
|
+
__destroy_into_raw() {
|
|
775
|
+
const ptr = this.__wbg_ptr;
|
|
776
|
+
this.__wbg_ptr = 0;
|
|
777
|
+
WasmAnalysisResultFinalization.unregister(this);
|
|
778
|
+
return ptr;
|
|
779
|
+
}
|
|
780
|
+
free() {
|
|
781
|
+
const ptr = this.__destroy_into_raw();
|
|
782
|
+
wasm.__wbg_wasmanalysisresult_free(ptr, 0);
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Analysis time in milliseconds
|
|
786
|
+
* @returns {number}
|
|
787
|
+
*/
|
|
788
|
+
get analysis_time() {
|
|
789
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
790
|
+
return ret;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Whether analysis succeeded
|
|
794
|
+
* @returns {boolean}
|
|
795
|
+
*/
|
|
796
|
+
get success() {
|
|
797
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_success(this.__wbg_ptr);
|
|
798
|
+
return ret !== 0;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Analysis time in milliseconds
|
|
802
|
+
* @param {number} arg0
|
|
803
|
+
*/
|
|
804
|
+
set analysis_time(arg0) {
|
|
805
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Whether analysis succeeded
|
|
809
|
+
* @param {boolean} arg0
|
|
810
|
+
*/
|
|
811
|
+
set success(arg0) {
|
|
812
|
+
wasm.__wbg_set_wasmanalysisresult_success(this.__wbg_ptr, arg0);
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* @returns {Array<any>}
|
|
816
|
+
*/
|
|
817
|
+
get errors() {
|
|
818
|
+
const ret = wasm.wasmanalysisresult_errors(this.__wbg_ptr);
|
|
819
|
+
return takeObject(ret);
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Get parsed metrics as JavaScript object
|
|
823
|
+
* @returns {any}
|
|
824
|
+
*/
|
|
825
|
+
get_metrics_object() {
|
|
826
|
+
try {
|
|
827
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
828
|
+
wasm.wasmanalysisresult_get_metrics_object(retptr, this.__wbg_ptr);
|
|
829
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
830
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
831
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
832
|
+
if (r2) {
|
|
833
|
+
throw takeObject(r1);
|
|
834
|
+
}
|
|
835
|
+
return takeObject(r0);
|
|
836
|
+
} finally {
|
|
837
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* @returns {string}
|
|
842
|
+
*/
|
|
843
|
+
get metrics() {
|
|
844
|
+
let deferred1_0;
|
|
845
|
+
let deferred1_1;
|
|
846
|
+
try {
|
|
847
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
848
|
+
wasm.wasmanalysisresult_metrics(retptr, this.__wbg_ptr);
|
|
849
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
850
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
851
|
+
deferred1_0 = r0;
|
|
852
|
+
deferred1_1 = r1;
|
|
853
|
+
return getStringFromWasm0(r0, r1);
|
|
854
|
+
} finally {
|
|
855
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
856
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* @returns {string}
|
|
861
|
+
*/
|
|
862
|
+
get summary() {
|
|
863
|
+
let deferred1_0;
|
|
864
|
+
let deferred1_1;
|
|
865
|
+
try {
|
|
866
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
867
|
+
wasm.wasmanalysisresult_summary(retptr, this.__wbg_ptr);
|
|
868
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
869
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
870
|
+
deferred1_0 = r0;
|
|
871
|
+
deferred1_1 = r1;
|
|
872
|
+
return getStringFromWasm0(r0, r1);
|
|
873
|
+
} finally {
|
|
874
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
875
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
if (Symbol.dispose) WasmAnalysisResult.prototype[Symbol.dispose] = WasmAnalysisResult.prototype.free;
|
|
880
|
+
exports.WasmAnalysisResult = WasmAnalysisResult;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Compilation options for enhanced error reporting and formatting
|
|
884
|
+
*/
|
|
885
|
+
class WasmCompilationOptions {
|
|
886
|
+
static __wrap(ptr) {
|
|
887
|
+
ptr = ptr >>> 0;
|
|
888
|
+
const obj = Object.create(WasmCompilationOptions.prototype);
|
|
889
|
+
obj.__wbg_ptr = ptr;
|
|
890
|
+
WasmCompilationOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
891
|
+
return obj;
|
|
892
|
+
}
|
|
893
|
+
__destroy_into_raw() {
|
|
894
|
+
const ptr = this.__wbg_ptr;
|
|
895
|
+
this.__wbg_ptr = 0;
|
|
896
|
+
WasmCompilationOptionsFinalization.unregister(this);
|
|
897
|
+
return ptr;
|
|
898
|
+
}
|
|
899
|
+
free() {
|
|
900
|
+
const ptr = this.__destroy_into_raw();
|
|
901
|
+
wasm.__wbg_wasmcompilationoptions_free(ptr, 0);
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* Include complexity analysis
|
|
905
|
+
* @returns {boolean}
|
|
906
|
+
*/
|
|
907
|
+
get complexity_analysis() {
|
|
908
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_complexity_analysis(this.__wbg_ptr);
|
|
909
|
+
return ret !== 0;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Include comprehensive metrics collection
|
|
913
|
+
* @returns {boolean}
|
|
914
|
+
*/
|
|
915
|
+
get comprehensive_metrics() {
|
|
916
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_comprehensive_metrics(this.__wbg_ptr);
|
|
917
|
+
return ret !== 0;
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Enable bytecode compression
|
|
921
|
+
* @returns {boolean}
|
|
922
|
+
*/
|
|
923
|
+
get compress_output() {
|
|
924
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_compress_output(this.__wbg_ptr);
|
|
925
|
+
return ret !== 0;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Enable constraint caching optimization
|
|
929
|
+
* @returns {boolean}
|
|
930
|
+
*/
|
|
931
|
+
get enable_constraint_cache() {
|
|
932
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_enable_constraint_cache(this.__wbg_ptr);
|
|
933
|
+
return ret !== 0;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Enable module namespace qualification (module::function)
|
|
937
|
+
* @returns {boolean}
|
|
938
|
+
*/
|
|
939
|
+
get enable_module_namespaces() {
|
|
940
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_enable_module_namespaces(this.__wbg_ptr);
|
|
941
|
+
return ret !== 0;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Enable enhanced error reporting with suggestions
|
|
945
|
+
* @returns {boolean}
|
|
946
|
+
*/
|
|
947
|
+
get enhanced_errors() {
|
|
948
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_enhanced_errors(this.__wbg_ptr);
|
|
949
|
+
return ret !== 0;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Include debug information
|
|
953
|
+
* @returns {boolean}
|
|
954
|
+
*/
|
|
955
|
+
get include_debug_info() {
|
|
956
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_include_debug_info(this.__wbg_ptr);
|
|
957
|
+
return ret !== 0;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Include basic metrics
|
|
961
|
+
* @returns {boolean}
|
|
962
|
+
*/
|
|
963
|
+
get include_metrics() {
|
|
964
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_include_metrics(this.__wbg_ptr);
|
|
965
|
+
return ret !== 0;
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Include performance analysis
|
|
969
|
+
* @returns {boolean}
|
|
970
|
+
*/
|
|
971
|
+
get performance_analysis() {
|
|
972
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_performance_analysis(this.__wbg_ptr);
|
|
973
|
+
return ret !== 0;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Suppress non-essential output
|
|
977
|
+
* @returns {boolean}
|
|
978
|
+
*/
|
|
979
|
+
get quiet() {
|
|
980
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_quiet(this.__wbg_ptr);
|
|
981
|
+
return ret !== 0;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Show compilation summary
|
|
985
|
+
* @returns {boolean}
|
|
986
|
+
*/
|
|
987
|
+
get summary() {
|
|
988
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_summary(this.__wbg_ptr);
|
|
989
|
+
return ret !== 0;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
|
|
993
|
+
* @returns {boolean}
|
|
994
|
+
*/
|
|
995
|
+
get v2_preview() {
|
|
996
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_v2_preview(this.__wbg_ptr);
|
|
997
|
+
return ret !== 0;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Verbose output
|
|
1001
|
+
* @returns {boolean}
|
|
1002
|
+
*/
|
|
1003
|
+
get verbose() {
|
|
1004
|
+
const ret = wasm.__wbg_get_wasmcompilationoptions_verbose(this.__wbg_ptr);
|
|
1005
|
+
return ret !== 0;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Include complexity analysis
|
|
1009
|
+
* @param {boolean} arg0
|
|
1010
|
+
*/
|
|
1011
|
+
set complexity_analysis(arg0) {
|
|
1012
|
+
wasm.__wbg_set_wasmcompilationoptions_complexity_analysis(this.__wbg_ptr, arg0);
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Include comprehensive metrics collection
|
|
1016
|
+
* @param {boolean} arg0
|
|
1017
|
+
*/
|
|
1018
|
+
set comprehensive_metrics(arg0) {
|
|
1019
|
+
wasm.__wbg_set_wasmcompilationoptions_comprehensive_metrics(this.__wbg_ptr, arg0);
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Enable bytecode compression
|
|
1023
|
+
* @param {boolean} arg0
|
|
1024
|
+
*/
|
|
1025
|
+
set compress_output(arg0) {
|
|
1026
|
+
wasm.__wbg_set_wasmcompilationoptions_compress_output(this.__wbg_ptr, arg0);
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Enable constraint caching optimization
|
|
1030
|
+
* @param {boolean} arg0
|
|
1031
|
+
*/
|
|
1032
|
+
set enable_constraint_cache(arg0) {
|
|
1033
|
+
wasm.__wbg_set_wasmcompilationoptions_enable_constraint_cache(this.__wbg_ptr, arg0);
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Enable module namespace qualification (module::function)
|
|
1037
|
+
* @param {boolean} arg0
|
|
1038
|
+
*/
|
|
1039
|
+
set enable_module_namespaces(arg0) {
|
|
1040
|
+
wasm.__wbg_set_wasmcompilationoptions_enable_module_namespaces(this.__wbg_ptr, arg0);
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Enable enhanced error reporting with suggestions
|
|
1044
|
+
* @param {boolean} arg0
|
|
1045
|
+
*/
|
|
1046
|
+
set enhanced_errors(arg0) {
|
|
1047
|
+
wasm.__wbg_set_wasmcompilationoptions_enhanced_errors(this.__wbg_ptr, arg0);
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Include debug information
|
|
1051
|
+
* @param {boolean} arg0
|
|
1052
|
+
*/
|
|
1053
|
+
set include_debug_info(arg0) {
|
|
1054
|
+
wasm.__wbg_set_wasmcompilationoptions_include_debug_info(this.__wbg_ptr, arg0);
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* Include basic metrics
|
|
1058
|
+
* @param {boolean} arg0
|
|
1059
|
+
*/
|
|
1060
|
+
set include_metrics(arg0) {
|
|
1061
|
+
wasm.__wbg_set_wasmcompilationoptions_include_metrics(this.__wbg_ptr, arg0);
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Include performance analysis
|
|
1065
|
+
* @param {boolean} arg0
|
|
1066
|
+
*/
|
|
1067
|
+
set performance_analysis(arg0) {
|
|
1068
|
+
wasm.__wbg_set_wasmcompilationoptions_performance_analysis(this.__wbg_ptr, arg0);
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Suppress non-essential output
|
|
1072
|
+
* @param {boolean} arg0
|
|
1073
|
+
*/
|
|
1074
|
+
set quiet(arg0) {
|
|
1075
|
+
wasm.__wbg_set_wasmcompilationoptions_quiet(this.__wbg_ptr, arg0);
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Show compilation summary
|
|
1079
|
+
* @param {boolean} arg0
|
|
1080
|
+
*/
|
|
1081
|
+
set summary(arg0) {
|
|
1082
|
+
wasm.__wbg_set_wasmcompilationoptions_summary(this.__wbg_ptr, arg0);
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
|
|
1086
|
+
* @param {boolean} arg0
|
|
1087
|
+
*/
|
|
1088
|
+
set v2_preview(arg0) {
|
|
1089
|
+
wasm.__wbg_set_wasmcompilationoptions_v2_preview(this.__wbg_ptr, arg0);
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Verbose output
|
|
1093
|
+
* @param {boolean} arg0
|
|
1094
|
+
*/
|
|
1095
|
+
set verbose(arg0) {
|
|
1096
|
+
wasm.__wbg_set_wasmcompilationoptions_verbose(this.__wbg_ptr, arg0);
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* @returns {string}
|
|
1100
|
+
*/
|
|
1101
|
+
get analysis_depth() {
|
|
1102
|
+
let deferred1_0;
|
|
1103
|
+
let deferred1_1;
|
|
1104
|
+
try {
|
|
1105
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1106
|
+
wasm.wasmcompilationoptions_analysis_depth(retptr, this.__wbg_ptr);
|
|
1107
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1108
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1109
|
+
deferred1_0 = r0;
|
|
1110
|
+
deferred1_1 = r1;
|
|
1111
|
+
return getStringFromWasm0(r0, r1);
|
|
1112
|
+
} finally {
|
|
1113
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1114
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Create development-debug configuration
|
|
1119
|
+
* @returns {WasmCompilationOptions}
|
|
1120
|
+
*/
|
|
1121
|
+
static development_debug() {
|
|
1122
|
+
const ret = wasm.wasmcompilationoptions_development_debug();
|
|
1123
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* @returns {string}
|
|
1127
|
+
*/
|
|
1128
|
+
get error_format() {
|
|
1129
|
+
let deferred1_0;
|
|
1130
|
+
let deferred1_1;
|
|
1131
|
+
try {
|
|
1132
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1133
|
+
wasm.wasmcompilationoptions_error_format(retptr, this.__wbg_ptr);
|
|
1134
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1135
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1136
|
+
deferred1_0 = r0;
|
|
1137
|
+
deferred1_1 = r1;
|
|
1138
|
+
return getStringFromWasm0(r0, r1);
|
|
1139
|
+
} finally {
|
|
1140
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1141
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* @returns {string}
|
|
1146
|
+
*/
|
|
1147
|
+
get export_format() {
|
|
1148
|
+
let deferred1_0;
|
|
1149
|
+
let deferred1_1;
|
|
1150
|
+
try {
|
|
1151
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1152
|
+
wasm.wasmcompilationoptions_export_format(retptr, this.__wbg_ptr);
|
|
1153
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1154
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1155
|
+
deferred1_0 = r0;
|
|
1156
|
+
deferred1_1 = r1;
|
|
1157
|
+
return getStringFromWasm0(r0, r1);
|
|
1158
|
+
} finally {
|
|
1159
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1160
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* Create fast iteration configuration
|
|
1165
|
+
* @returns {WasmCompilationOptions}
|
|
1166
|
+
*/
|
|
1167
|
+
static fast_iteration() {
|
|
1168
|
+
const ret = wasm.wasmcompilationoptions_fast_iteration();
|
|
1169
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* @returns {string}
|
|
1173
|
+
*/
|
|
1174
|
+
get metrics_format() {
|
|
1175
|
+
let deferred1_0;
|
|
1176
|
+
let deferred1_1;
|
|
1177
|
+
try {
|
|
1178
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1179
|
+
wasm.wasmcompilationoptions_metrics_format(retptr, this.__wbg_ptr);
|
|
1180
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1181
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1182
|
+
deferred1_0 = r0;
|
|
1183
|
+
deferred1_1 = r1;
|
|
1184
|
+
return getStringFromWasm0(r0, r1);
|
|
1185
|
+
} finally {
|
|
1186
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1187
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* @returns {string}
|
|
1192
|
+
*/
|
|
1193
|
+
get mode() {
|
|
1194
|
+
let deferred1_0;
|
|
1195
|
+
let deferred1_1;
|
|
1196
|
+
try {
|
|
1197
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1198
|
+
wasm.wasmcompilationoptions_mode(retptr, this.__wbg_ptr);
|
|
1199
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1200
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1201
|
+
deferred1_0 = r0;
|
|
1202
|
+
deferred1_1 = r1;
|
|
1203
|
+
return getStringFromWasm0(r0, r1);
|
|
1204
|
+
} finally {
|
|
1205
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1206
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Create default compilation options
|
|
1211
|
+
*/
|
|
1212
|
+
constructor() {
|
|
1213
|
+
const ret = wasm.wasmcompilationoptions_new();
|
|
1214
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1215
|
+
WasmCompilationOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
1216
|
+
return this;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* @returns {string}
|
|
1220
|
+
*/
|
|
1221
|
+
get optimization_level() {
|
|
1222
|
+
let deferred1_0;
|
|
1223
|
+
let deferred1_1;
|
|
1224
|
+
try {
|
|
1225
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1226
|
+
wasm.wasmcompilationoptions_optimization_level(retptr, this.__wbg_ptr);
|
|
1227
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1228
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1229
|
+
deferred1_0 = r0;
|
|
1230
|
+
deferred1_1 = r1;
|
|
1231
|
+
return getStringFromWasm0(r0, r1);
|
|
1232
|
+
} finally {
|
|
1233
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1234
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Create production-optimized configuration
|
|
1239
|
+
* @returns {WasmCompilationOptions}
|
|
1240
|
+
*/
|
|
1241
|
+
static production_optimized() {
|
|
1242
|
+
const ret = wasm.wasmcompilationoptions_production_optimized();
|
|
1243
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* @returns {string | undefined}
|
|
1247
|
+
*/
|
|
1248
|
+
get source_file() {
|
|
1249
|
+
try {
|
|
1250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1251
|
+
wasm.wasmcompilationoptions_source_file(retptr, this.__wbg_ptr);
|
|
1252
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1253
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1254
|
+
let v1;
|
|
1255
|
+
if (r0 !== 0) {
|
|
1256
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1257
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1258
|
+
}
|
|
1259
|
+
return v1;
|
|
1260
|
+
} finally {
|
|
1261
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Set analysis depth level
|
|
1266
|
+
* @param {string} depth
|
|
1267
|
+
* @returns {WasmCompilationOptions}
|
|
1268
|
+
*/
|
|
1269
|
+
with_analysis_depth(depth) {
|
|
1270
|
+
const ptr = this.__destroy_into_raw();
|
|
1271
|
+
const ptr0 = passStringToWasm0(depth, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1272
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1273
|
+
const ret = wasm.wasmcompilationoptions_with_analysis_depth(ptr, ptr0, len0);
|
|
1274
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Enable or disable complexity analysis
|
|
1278
|
+
* @param {boolean} enabled
|
|
1279
|
+
* @returns {WasmCompilationOptions}
|
|
1280
|
+
*/
|
|
1281
|
+
with_complexity_analysis(enabled) {
|
|
1282
|
+
const ptr = this.__destroy_into_raw();
|
|
1283
|
+
const ret = wasm.wasmcompilationoptions_with_complexity_analysis(ptr, enabled);
|
|
1284
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Enable or disable comprehensive metrics collection
|
|
1288
|
+
* @param {boolean} enabled
|
|
1289
|
+
* @returns {WasmCompilationOptions}
|
|
1290
|
+
*/
|
|
1291
|
+
with_comprehensive_metrics(enabled) {
|
|
1292
|
+
const ptr = this.__destroy_into_raw();
|
|
1293
|
+
const ret = wasm.wasmcompilationoptions_with_comprehensive_metrics(ptr, enabled);
|
|
1294
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Enable or disable bytecode compression
|
|
1298
|
+
* @param {boolean} enabled
|
|
1299
|
+
* @returns {WasmCompilationOptions}
|
|
1300
|
+
*/
|
|
1301
|
+
with_compression(enabled) {
|
|
1302
|
+
const ptr = this.__destroy_into_raw();
|
|
1303
|
+
const ret = wasm.wasmcompilationoptions_with_compression(ptr, enabled);
|
|
1304
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Enable or disable constraint caching optimization
|
|
1308
|
+
* @param {boolean} enabled
|
|
1309
|
+
* @returns {WasmCompilationOptions}
|
|
1310
|
+
*/
|
|
1311
|
+
with_constraint_cache(enabled) {
|
|
1312
|
+
const ptr = this.__destroy_into_raw();
|
|
1313
|
+
const ret = wasm.wasmcompilationoptions_with_constraint_cache(ptr, enabled);
|
|
1314
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Enable or disable debug information
|
|
1318
|
+
* @param {boolean} enabled
|
|
1319
|
+
* @returns {WasmCompilationOptions}
|
|
1320
|
+
*/
|
|
1321
|
+
with_debug_info(enabled) {
|
|
1322
|
+
const ptr = this.__destroy_into_raw();
|
|
1323
|
+
const ret = wasm.wasmcompilationoptions_with_debug_info(ptr, enabled);
|
|
1324
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Enable or disable enhanced error reporting
|
|
1328
|
+
* @param {boolean} enabled
|
|
1329
|
+
* @returns {WasmCompilationOptions}
|
|
1330
|
+
*/
|
|
1331
|
+
with_enhanced_errors(enabled) {
|
|
1332
|
+
const ptr = this.__destroy_into_raw();
|
|
1333
|
+
const ret = wasm.wasmcompilationoptions_with_enhanced_errors(ptr, enabled);
|
|
1334
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Set error output format
|
|
1338
|
+
* @param {string} format
|
|
1339
|
+
* @returns {WasmCompilationOptions}
|
|
1340
|
+
*/
|
|
1341
|
+
with_error_format(format) {
|
|
1342
|
+
const ptr = this.__destroy_into_raw();
|
|
1343
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1344
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1345
|
+
const ret = wasm.wasmcompilationoptions_with_error_format(ptr, ptr0, len0);
|
|
1346
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Set export format
|
|
1350
|
+
* @param {string} format
|
|
1351
|
+
* @returns {WasmCompilationOptions}
|
|
1352
|
+
*/
|
|
1353
|
+
with_export_format(format) {
|
|
1354
|
+
const ptr = this.__destroy_into_raw();
|
|
1355
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1356
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1357
|
+
const ret = wasm.wasmcompilationoptions_with_export_format(ptr, ptr0, len0);
|
|
1358
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Enable or disable basic metrics collection
|
|
1362
|
+
* @param {boolean} enabled
|
|
1363
|
+
* @returns {WasmCompilationOptions}
|
|
1364
|
+
*/
|
|
1365
|
+
with_metrics(enabled) {
|
|
1366
|
+
const ptr = this.__destroy_into_raw();
|
|
1367
|
+
const ret = wasm.wasmcompilationoptions_with_metrics(ptr, enabled);
|
|
1368
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Set metrics export format
|
|
1372
|
+
* @param {string} format
|
|
1373
|
+
* @returns {WasmCompilationOptions}
|
|
1374
|
+
*/
|
|
1375
|
+
with_metrics_format(format) {
|
|
1376
|
+
const ptr = this.__destroy_into_raw();
|
|
1377
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1378
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1379
|
+
const ret = wasm.wasmcompilationoptions_with_metrics_format(ptr, ptr0, len0);
|
|
1380
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Set compilation mode
|
|
1384
|
+
* @param {string} mode
|
|
1385
|
+
* @returns {WasmCompilationOptions}
|
|
1386
|
+
*/
|
|
1387
|
+
with_mode(mode) {
|
|
1388
|
+
const ptr = this.__destroy_into_raw();
|
|
1389
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1390
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1391
|
+
const ret = wasm.wasmcompilationoptions_with_mode(ptr, ptr0, len0);
|
|
1392
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Enable or disable module namespace qualification
|
|
1396
|
+
* @param {boolean} enabled
|
|
1397
|
+
* @returns {WasmCompilationOptions}
|
|
1398
|
+
*/
|
|
1399
|
+
with_module_namespaces(enabled) {
|
|
1400
|
+
const ptr = this.__destroy_into_raw();
|
|
1401
|
+
const ret = wasm.wasmcompilationoptions_with_module_namespaces(ptr, enabled);
|
|
1402
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Set optimization level (production)
|
|
1406
|
+
* @param {string} level
|
|
1407
|
+
* @returns {WasmCompilationOptions}
|
|
1408
|
+
*/
|
|
1409
|
+
with_optimization_level(level) {
|
|
1410
|
+
const ptr = this.__destroy_into_raw();
|
|
1411
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1412
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1413
|
+
const ret = wasm.wasmcompilationoptions_with_optimization_level(ptr, ptr0, len0);
|
|
1414
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Enable or disable performance analysis
|
|
1418
|
+
* @param {boolean} enabled
|
|
1419
|
+
* @returns {WasmCompilationOptions}
|
|
1420
|
+
*/
|
|
1421
|
+
with_performance_analysis(enabled) {
|
|
1422
|
+
const ptr = this.__destroy_into_raw();
|
|
1423
|
+
const ret = wasm.wasmcompilationoptions_with_performance_analysis(ptr, enabled);
|
|
1424
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Enable or disable quiet mode
|
|
1428
|
+
* @param {boolean} enabled
|
|
1429
|
+
* @returns {WasmCompilationOptions}
|
|
1430
|
+
*/
|
|
1431
|
+
with_quiet(enabled) {
|
|
1432
|
+
const ptr = this.__destroy_into_raw();
|
|
1433
|
+
const ret = wasm.wasmcompilationoptions_with_quiet(ptr, enabled);
|
|
1434
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Set source file name for better error reporting
|
|
1438
|
+
* @param {string} filename
|
|
1439
|
+
* @returns {WasmCompilationOptions}
|
|
1440
|
+
*/
|
|
1441
|
+
with_source_file(filename) {
|
|
1442
|
+
const ptr = this.__destroy_into_raw();
|
|
1443
|
+
const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1444
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1445
|
+
const ret = wasm.wasmcompilationoptions_with_source_file(ptr, ptr0, len0);
|
|
1446
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* Enable or disable compilation summary
|
|
1450
|
+
* @param {boolean} enabled
|
|
1451
|
+
* @returns {WasmCompilationOptions}
|
|
1452
|
+
*/
|
|
1453
|
+
with_summary(enabled) {
|
|
1454
|
+
const ptr = this.__destroy_into_raw();
|
|
1455
|
+
const ret = wasm.wasmcompilationoptions_with_summary(ptr, enabled);
|
|
1456
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Enable or disable v2-preview features
|
|
1460
|
+
* @param {boolean} enabled
|
|
1461
|
+
* @returns {WasmCompilationOptions}
|
|
1462
|
+
*/
|
|
1463
|
+
with_v2_preview(enabled) {
|
|
1464
|
+
const ptr = this.__destroy_into_raw();
|
|
1465
|
+
const ret = wasm.wasmcompilationoptions_with_v2_preview(ptr, enabled);
|
|
1466
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Enable or disable verbose output
|
|
1470
|
+
* @param {boolean} enabled
|
|
1471
|
+
* @returns {WasmCompilationOptions}
|
|
1472
|
+
*/
|
|
1473
|
+
with_verbose(enabled) {
|
|
1474
|
+
const ptr = this.__destroy_into_raw();
|
|
1475
|
+
const ret = wasm.wasmcompilationoptions_with_verbose(ptr, enabled);
|
|
1476
|
+
return WasmCompilationOptions.__wrap(ret);
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
if (Symbol.dispose) WasmCompilationOptions.prototype[Symbol.dispose] = WasmCompilationOptions.prototype.free;
|
|
1480
|
+
exports.WasmCompilationOptions = WasmCompilationOptions;
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* WASM compilation result - unified with enhanced error support
|
|
1484
|
+
*/
|
|
1485
|
+
class WasmCompilationResult {
|
|
1486
|
+
static __wrap(ptr) {
|
|
1487
|
+
ptr = ptr >>> 0;
|
|
1488
|
+
const obj = Object.create(WasmCompilationResult.prototype);
|
|
1489
|
+
obj.__wbg_ptr = ptr;
|
|
1490
|
+
WasmCompilationResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1491
|
+
return obj;
|
|
1492
|
+
}
|
|
1493
|
+
__destroy_into_raw() {
|
|
1494
|
+
const ptr = this.__wbg_ptr;
|
|
1495
|
+
this.__wbg_ptr = 0;
|
|
1496
|
+
WasmCompilationResultFinalization.unregister(this);
|
|
1497
|
+
return ptr;
|
|
1498
|
+
}
|
|
1499
|
+
free() {
|
|
1500
|
+
const ptr = this.__destroy_into_raw();
|
|
1501
|
+
wasm.__wbg_wasmcompilationresult_free(ptr, 0);
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Size of generated bytecode
|
|
1505
|
+
* @returns {number}
|
|
1506
|
+
*/
|
|
1507
|
+
get bytecode_size() {
|
|
1508
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_bytecode_size(this.__wbg_ptr);
|
|
1509
|
+
return ret >>> 0;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Compilation time in milliseconds
|
|
1513
|
+
* @returns {number}
|
|
1514
|
+
*/
|
|
1515
|
+
get compilation_time() {
|
|
1516
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
1517
|
+
return ret;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Total error count
|
|
1521
|
+
* @returns {number}
|
|
1522
|
+
*/
|
|
1523
|
+
get error_count() {
|
|
1524
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_error_count(this.__wbg_ptr);
|
|
1525
|
+
return ret >>> 0;
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Whether compilation succeeded
|
|
1529
|
+
* @returns {boolean}
|
|
1530
|
+
*/
|
|
1531
|
+
get success() {
|
|
1532
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_success(this.__wbg_ptr);
|
|
1533
|
+
return ret !== 0;
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Total warning count
|
|
1537
|
+
* @returns {number}
|
|
1538
|
+
*/
|
|
1539
|
+
get warning_count() {
|
|
1540
|
+
const ret = wasm.__wbg_get_wasmcompilationresult_warning_count(this.__wbg_ptr);
|
|
1541
|
+
return ret >>> 0;
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Size of generated bytecode
|
|
1545
|
+
* @param {number} arg0
|
|
1546
|
+
*/
|
|
1547
|
+
set bytecode_size(arg0) {
|
|
1548
|
+
wasm.__wbg_set_wasmcompilationresult_bytecode_size(this.__wbg_ptr, arg0);
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Compilation time in milliseconds
|
|
1552
|
+
* @param {number} arg0
|
|
1553
|
+
*/
|
|
1554
|
+
set compilation_time(arg0) {
|
|
1555
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* Total error count
|
|
1559
|
+
* @param {number} arg0
|
|
1560
|
+
*/
|
|
1561
|
+
set error_count(arg0) {
|
|
1562
|
+
wasm.__wbg_set_wasmcompilationresult_error_count(this.__wbg_ptr, arg0);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Whether compilation succeeded
|
|
1566
|
+
* @param {boolean} arg0
|
|
1567
|
+
*/
|
|
1568
|
+
set success(arg0) {
|
|
1569
|
+
wasm.__wbg_set_wasmcompilationresult_success(this.__wbg_ptr, arg0);
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Total warning count
|
|
1573
|
+
* @param {number} arg0
|
|
1574
|
+
*/
|
|
1575
|
+
set warning_count(arg0) {
|
|
1576
|
+
wasm.__wbg_set_wasmcompilationresult_warning_count(this.__wbg_ptr, arg0);
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* @returns {any}
|
|
1580
|
+
*/
|
|
1581
|
+
get abi() {
|
|
1582
|
+
const ret = wasm.wasmcompilationresult_abi(this.__wbg_ptr);
|
|
1583
|
+
return takeObject(ret);
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* @returns {Uint8Array | undefined}
|
|
1587
|
+
*/
|
|
1588
|
+
get bytecode() {
|
|
1589
|
+
const ret = wasm.wasmcompilationresult_bytecode(this.__wbg_ptr);
|
|
1590
|
+
return takeObject(ret);
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* @returns {WasmCompilerError[]}
|
|
1594
|
+
*/
|
|
1595
|
+
get compiler_errors() {
|
|
1596
|
+
try {
|
|
1597
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1598
|
+
wasm.wasmcompilationresult_compiler_errors(retptr, this.__wbg_ptr);
|
|
1599
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1600
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1601
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1602
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1603
|
+
return v1;
|
|
1604
|
+
} finally {
|
|
1605
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* @returns {Array<any>}
|
|
1610
|
+
*/
|
|
1611
|
+
get disassembly() {
|
|
1612
|
+
const ret = wasm.wasmcompilationresult_disassembly(this.__wbg_ptr);
|
|
1613
|
+
return takeObject(ret);
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* @returns {Array<any>}
|
|
1617
|
+
*/
|
|
1618
|
+
get errors() {
|
|
1619
|
+
const ret = wasm.wasmcompilationresult_errors(this.__wbg_ptr);
|
|
1620
|
+
return takeObject(ret);
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Get all errors as JSON array
|
|
1624
|
+
* @returns {string}
|
|
1625
|
+
*/
|
|
1626
|
+
format_all_json() {
|
|
1627
|
+
let deferred1_0;
|
|
1628
|
+
let deferred1_1;
|
|
1629
|
+
try {
|
|
1630
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1631
|
+
wasm.wasmcompilationresult_format_all_json(retptr, this.__wbg_ptr);
|
|
1632
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1633
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1634
|
+
deferred1_0 = r0;
|
|
1635
|
+
deferred1_1 = r1;
|
|
1636
|
+
return getStringFromWasm0(r0, r1);
|
|
1637
|
+
} finally {
|
|
1638
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1639
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Get all errors formatted as terminal output
|
|
1644
|
+
* @returns {string}
|
|
1645
|
+
*/
|
|
1646
|
+
format_all_terminal() {
|
|
1647
|
+
let deferred1_0;
|
|
1648
|
+
let deferred1_1;
|
|
1649
|
+
try {
|
|
1650
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1651
|
+
wasm.wasmcompilationresult_format_all_terminal(retptr, this.__wbg_ptr);
|
|
1652
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1653
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1654
|
+
deferred1_0 = r0;
|
|
1655
|
+
deferred1_1 = r1;
|
|
1656
|
+
return getStringFromWasm0(r0, r1);
|
|
1657
|
+
} finally {
|
|
1658
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1659
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* @returns {string}
|
|
1664
|
+
*/
|
|
1665
|
+
get_formatted_errors_json() {
|
|
1666
|
+
let deferred1_0;
|
|
1667
|
+
let deferred1_1;
|
|
1668
|
+
try {
|
|
1669
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1670
|
+
wasm.wasmcompilationresult_get_formatted_errors_json(retptr, this.__wbg_ptr);
|
|
1671
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1672
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1673
|
+
deferred1_0 = r0;
|
|
1674
|
+
deferred1_1 = r1;
|
|
1675
|
+
return getStringFromWasm0(r0, r1);
|
|
1676
|
+
} finally {
|
|
1677
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1678
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* @returns {string}
|
|
1683
|
+
*/
|
|
1684
|
+
get_formatted_errors_terminal() {
|
|
1685
|
+
let deferred1_0;
|
|
1686
|
+
let deferred1_1;
|
|
1687
|
+
try {
|
|
1688
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1689
|
+
wasm.wasmcompilationresult_get_formatted_errors_terminal(retptr, this.__wbg_ptr);
|
|
1690
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1691
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1692
|
+
deferred1_0 = r0;
|
|
1693
|
+
deferred1_1 = r1;
|
|
1694
|
+
return getStringFromWasm0(r0, r1);
|
|
1695
|
+
} finally {
|
|
1696
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1697
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Get fully detailed metrics regardless of export format
|
|
1702
|
+
* @returns {any}
|
|
1703
|
+
*/
|
|
1704
|
+
get_metrics_detailed() {
|
|
1705
|
+
try {
|
|
1706
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1707
|
+
wasm.wasmcompilationresult_get_metrics_detailed(retptr, this.__wbg_ptr);
|
|
1708
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1709
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1710
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1711
|
+
if (r2) {
|
|
1712
|
+
throw takeObject(r1);
|
|
1713
|
+
}
|
|
1714
|
+
return takeObject(r0);
|
|
1715
|
+
} finally {
|
|
1716
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Get parsed metrics as JavaScript object
|
|
1721
|
+
* @returns {any}
|
|
1722
|
+
*/
|
|
1723
|
+
get_metrics_object() {
|
|
1724
|
+
const ret = wasm.wasmcompilationresult_get_metrics_object(this.__wbg_ptr);
|
|
1725
|
+
return takeObject(ret);
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* @returns {string}
|
|
1729
|
+
*/
|
|
1730
|
+
get metrics() {
|
|
1731
|
+
let deferred1_0;
|
|
1732
|
+
let deferred1_1;
|
|
1733
|
+
try {
|
|
1734
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1735
|
+
wasm.wasmcompilationresult_metrics(retptr, this.__wbg_ptr);
|
|
1736
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1737
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1738
|
+
deferred1_0 = r0;
|
|
1739
|
+
deferred1_1 = r1;
|
|
1740
|
+
return getStringFromWasm0(r0, r1);
|
|
1741
|
+
} finally {
|
|
1742
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1743
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* @returns {string}
|
|
1748
|
+
*/
|
|
1749
|
+
get metrics_format() {
|
|
1750
|
+
let deferred1_0;
|
|
1751
|
+
let deferred1_1;
|
|
1752
|
+
try {
|
|
1753
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1754
|
+
wasm.wasmcompilationresult_metrics_format(retptr, this.__wbg_ptr);
|
|
1755
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1756
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1757
|
+
deferred1_0 = r0;
|
|
1758
|
+
deferred1_1 = r1;
|
|
1759
|
+
return getStringFromWasm0(r0, r1);
|
|
1760
|
+
} finally {
|
|
1761
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1762
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* @returns {Array<any>}
|
|
1767
|
+
*/
|
|
1768
|
+
get warnings() {
|
|
1769
|
+
const ret = wasm.wasmcompilationresult_warnings(this.__wbg_ptr);
|
|
1770
|
+
return takeObject(ret);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
if (Symbol.dispose) WasmCompilationResult.prototype[Symbol.dispose] = WasmCompilationResult.prototype.free;
|
|
1774
|
+
exports.WasmCompilationResult = WasmCompilationResult;
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* WASM compilation result with comprehensive metrics
|
|
1778
|
+
*/
|
|
1779
|
+
class WasmCompilationWithMetrics {
|
|
1780
|
+
__destroy_into_raw() {
|
|
1781
|
+
const ptr = this.__wbg_ptr;
|
|
1782
|
+
this.__wbg_ptr = 0;
|
|
1783
|
+
WasmCompilationWithMetricsFinalization.unregister(this);
|
|
1784
|
+
return ptr;
|
|
1785
|
+
}
|
|
1786
|
+
free() {
|
|
1787
|
+
const ptr = this.__destroy_into_raw();
|
|
1788
|
+
wasm.__wbg_wasmcompilationwithmetrics_free(ptr, 0);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Size of generated bytecode
|
|
1792
|
+
* @returns {number}
|
|
1793
|
+
*/
|
|
1794
|
+
get bytecode_size() {
|
|
1795
|
+
const ret = wasm.__wbg_get_wasmcompilationwithmetrics_bytecode_size(this.__wbg_ptr);
|
|
1796
|
+
return ret >>> 0;
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Compilation time in milliseconds
|
|
1800
|
+
* @returns {number}
|
|
1801
|
+
*/
|
|
1802
|
+
get compilation_time() {
|
|
1803
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
1804
|
+
return ret;
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Whether compilation succeeded
|
|
1808
|
+
* @returns {boolean}
|
|
1809
|
+
*/
|
|
1810
|
+
get success() {
|
|
1811
|
+
const ret = wasm.__wbg_get_wasmcompilationwithmetrics_success(this.__wbg_ptr);
|
|
1812
|
+
return ret !== 0;
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Size of generated bytecode
|
|
1816
|
+
* @param {number} arg0
|
|
1817
|
+
*/
|
|
1818
|
+
set bytecode_size(arg0) {
|
|
1819
|
+
wasm.__wbg_set_wasmcompilationwithmetrics_bytecode_size(this.__wbg_ptr, arg0);
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Compilation time in milliseconds
|
|
1823
|
+
* @param {number} arg0
|
|
1824
|
+
*/
|
|
1825
|
+
set compilation_time(arg0) {
|
|
1826
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* Whether compilation succeeded
|
|
1830
|
+
* @param {boolean} arg0
|
|
1831
|
+
*/
|
|
1832
|
+
set success(arg0) {
|
|
1833
|
+
wasm.__wbg_set_wasmcompilationwithmetrics_success(this.__wbg_ptr, arg0);
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* @returns {Uint8Array | undefined}
|
|
1837
|
+
*/
|
|
1838
|
+
get bytecode() {
|
|
1839
|
+
const ret = wasm.wasmcompilationwithmetrics_bytecode(this.__wbg_ptr);
|
|
1840
|
+
return takeObject(ret);
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* @returns {Array<any>}
|
|
1844
|
+
*/
|
|
1845
|
+
get errors() {
|
|
1846
|
+
const ret = wasm.wasmcompilationwithmetrics_errors(this.__wbg_ptr);
|
|
1847
|
+
return takeObject(ret);
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Get parsed metrics as JavaScript object
|
|
1851
|
+
* @returns {any}
|
|
1852
|
+
*/
|
|
1853
|
+
get_metrics_object() {
|
|
1854
|
+
try {
|
|
1855
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1856
|
+
wasm.wasmcompilationwithmetrics_get_metrics_object(retptr, this.__wbg_ptr);
|
|
1857
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1858
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1859
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1860
|
+
if (r2) {
|
|
1861
|
+
throw takeObject(r1);
|
|
1862
|
+
}
|
|
1863
|
+
return takeObject(r0);
|
|
1864
|
+
} finally {
|
|
1865
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* @returns {string}
|
|
1870
|
+
*/
|
|
1871
|
+
get metrics() {
|
|
1872
|
+
let deferred1_0;
|
|
1873
|
+
let deferred1_1;
|
|
1874
|
+
try {
|
|
1875
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1876
|
+
wasm.wasmcompilationwithmetrics_metrics(retptr, this.__wbg_ptr);
|
|
1877
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1878
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1879
|
+
deferred1_0 = r0;
|
|
1880
|
+
deferred1_1 = r1;
|
|
1881
|
+
return getStringFromWasm0(r0, r1);
|
|
1882
|
+
} finally {
|
|
1883
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1884
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* @returns {Array<any>}
|
|
1889
|
+
*/
|
|
1890
|
+
get warnings() {
|
|
1891
|
+
const ret = wasm.wasmcompilationwithmetrics_warnings(this.__wbg_ptr);
|
|
1892
|
+
return takeObject(ret);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
if (Symbol.dispose) WasmCompilationWithMetrics.prototype[Symbol.dispose] = WasmCompilationWithMetrics.prototype.free;
|
|
1896
|
+
exports.WasmCompilationWithMetrics = WasmCompilationWithMetrics;
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* Enhanced compiler error for WASM
|
|
1900
|
+
*/
|
|
1901
|
+
class WasmCompilerError {
|
|
1902
|
+
static __wrap(ptr) {
|
|
1903
|
+
ptr = ptr >>> 0;
|
|
1904
|
+
const obj = Object.create(WasmCompilerError.prototype);
|
|
1905
|
+
obj.__wbg_ptr = ptr;
|
|
1906
|
+
WasmCompilerErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1907
|
+
return obj;
|
|
1908
|
+
}
|
|
1909
|
+
__destroy_into_raw() {
|
|
1910
|
+
const ptr = this.__wbg_ptr;
|
|
1911
|
+
this.__wbg_ptr = 0;
|
|
1912
|
+
WasmCompilerErrorFinalization.unregister(this);
|
|
1913
|
+
return ptr;
|
|
1914
|
+
}
|
|
1915
|
+
free() {
|
|
1916
|
+
const ptr = this.__destroy_into_raw();
|
|
1917
|
+
wasm.__wbg_wasmcompilererror_free(ptr, 0);
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* @returns {string}
|
|
1921
|
+
*/
|
|
1922
|
+
get category() {
|
|
1923
|
+
let deferred1_0;
|
|
1924
|
+
let deferred1_1;
|
|
1925
|
+
try {
|
|
1926
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1927
|
+
wasm.wasmcompilererror_category(retptr, this.__wbg_ptr);
|
|
1928
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1929
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1930
|
+
deferred1_0 = r0;
|
|
1931
|
+
deferred1_1 = r1;
|
|
1932
|
+
return getStringFromWasm0(r0, r1);
|
|
1933
|
+
} finally {
|
|
1934
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1935
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* @returns {string}
|
|
1940
|
+
*/
|
|
1941
|
+
get code() {
|
|
1942
|
+
let deferred1_0;
|
|
1943
|
+
let deferred1_1;
|
|
1944
|
+
try {
|
|
1945
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1946
|
+
wasm.wasmcompilererror_code(retptr, this.__wbg_ptr);
|
|
1947
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1948
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1949
|
+
deferred1_0 = r0;
|
|
1950
|
+
deferred1_1 = r1;
|
|
1951
|
+
return getStringFromWasm0(r0, r1);
|
|
1952
|
+
} finally {
|
|
1953
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1954
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* @returns {any}
|
|
1959
|
+
*/
|
|
1960
|
+
get column() {
|
|
1961
|
+
const ret = wasm.wasmcompilererror_column(this.__wbg_ptr);
|
|
1962
|
+
return takeObject(ret);
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* @returns {string | undefined}
|
|
1966
|
+
*/
|
|
1967
|
+
get description() {
|
|
1968
|
+
try {
|
|
1969
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1970
|
+
wasm.wasmcompilererror_description(retptr, this.__wbg_ptr);
|
|
1971
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1972
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1973
|
+
let v1;
|
|
1974
|
+
if (r0 !== 0) {
|
|
1975
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1976
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1977
|
+
}
|
|
1978
|
+
return v1;
|
|
1979
|
+
} finally {
|
|
1980
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
/**
|
|
1984
|
+
* Get error as JSON string
|
|
1985
|
+
* @returns {string}
|
|
1986
|
+
*/
|
|
1987
|
+
format_json() {
|
|
1988
|
+
let deferred1_0;
|
|
1989
|
+
let deferred1_1;
|
|
1990
|
+
try {
|
|
1991
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1992
|
+
wasm.wasmcompilererror_format_json(retptr, this.__wbg_ptr);
|
|
1993
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1994
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1995
|
+
deferred1_0 = r0;
|
|
1996
|
+
deferred1_1 = r1;
|
|
1997
|
+
return getStringFromWasm0(r0, r1);
|
|
1998
|
+
} finally {
|
|
1999
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2000
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Get formatted error message (terminal style)
|
|
2005
|
+
* Get formatted error message (terminal style)
|
|
2006
|
+
* @returns {string}
|
|
2007
|
+
*/
|
|
2008
|
+
format_terminal() {
|
|
2009
|
+
let deferred1_0;
|
|
2010
|
+
let deferred1_1;
|
|
2011
|
+
try {
|
|
2012
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2013
|
+
wasm.wasmcompilererror_format_terminal(retptr, this.__wbg_ptr);
|
|
2014
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2015
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2016
|
+
deferred1_0 = r0;
|
|
2017
|
+
deferred1_1 = r1;
|
|
2018
|
+
return getStringFromWasm0(r0, r1);
|
|
2019
|
+
} finally {
|
|
2020
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2021
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* @returns {any}
|
|
2026
|
+
*/
|
|
2027
|
+
get line() {
|
|
2028
|
+
const ret = wasm.wasmcompilererror_line(this.__wbg_ptr);
|
|
2029
|
+
return takeObject(ret);
|
|
2030
|
+
}
|
|
2031
|
+
/**
|
|
2032
|
+
* @returns {WasmSourceLocation | undefined}
|
|
2033
|
+
*/
|
|
2034
|
+
get location() {
|
|
2035
|
+
const ret = wasm.wasmcompilererror_location(this.__wbg_ptr);
|
|
2036
|
+
return ret === 0 ? undefined : WasmSourceLocation.__wrap(ret);
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* @returns {string}
|
|
2040
|
+
*/
|
|
2041
|
+
get message() {
|
|
2042
|
+
let deferred1_0;
|
|
2043
|
+
let deferred1_1;
|
|
2044
|
+
try {
|
|
2045
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2046
|
+
wasm.wasmcompilererror_message(retptr, this.__wbg_ptr);
|
|
2047
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2048
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2049
|
+
deferred1_0 = r0;
|
|
2050
|
+
deferred1_1 = r1;
|
|
2051
|
+
return getStringFromWasm0(r0, r1);
|
|
2052
|
+
} finally {
|
|
2053
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2054
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* @returns {string}
|
|
2059
|
+
*/
|
|
2060
|
+
get severity() {
|
|
2061
|
+
let deferred1_0;
|
|
2062
|
+
let deferred1_1;
|
|
2063
|
+
try {
|
|
2064
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2065
|
+
wasm.wasmcompilererror_severity(retptr, this.__wbg_ptr);
|
|
2066
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2067
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2068
|
+
deferred1_0 = r0;
|
|
2069
|
+
deferred1_1 = r1;
|
|
2070
|
+
return getStringFromWasm0(r0, r1);
|
|
2071
|
+
} finally {
|
|
2072
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2073
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* @returns {string | undefined}
|
|
2078
|
+
*/
|
|
2079
|
+
get source_line() {
|
|
2080
|
+
try {
|
|
2081
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2082
|
+
wasm.wasmcompilererror_source_line(retptr, this.__wbg_ptr);
|
|
2083
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2084
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2085
|
+
let v1;
|
|
2086
|
+
if (r0 !== 0) {
|
|
2087
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2088
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2089
|
+
}
|
|
2090
|
+
return v1;
|
|
2091
|
+
} finally {
|
|
2092
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* @returns {WasmSuggestion[]}
|
|
2097
|
+
*/
|
|
2098
|
+
get suggestions() {
|
|
2099
|
+
try {
|
|
2100
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2101
|
+
wasm.wasmcompilererror_suggestions(retptr, this.__wbg_ptr);
|
|
2102
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2103
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2104
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2105
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2106
|
+
return v1;
|
|
2107
|
+
} finally {
|
|
2108
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
if (Symbol.dispose) WasmCompilerError.prototype[Symbol.dispose] = WasmCompilerError.prototype.free;
|
|
2113
|
+
exports.WasmCompilerError = WasmCompilerError;
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* Enhanced compilation result with rich error information
|
|
2117
|
+
*/
|
|
2118
|
+
class WasmEnhancedCompilationResult {
|
|
2119
|
+
__destroy_into_raw() {
|
|
2120
|
+
const ptr = this.__wbg_ptr;
|
|
2121
|
+
this.__wbg_ptr = 0;
|
|
2122
|
+
WasmEnhancedCompilationResultFinalization.unregister(this);
|
|
2123
|
+
return ptr;
|
|
2124
|
+
}
|
|
2125
|
+
free() {
|
|
2126
|
+
const ptr = this.__destroy_into_raw();
|
|
2127
|
+
wasm.__wbg_wasmenhancedcompilationresult_free(ptr, 0);
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Size of generated bytecode
|
|
2131
|
+
* @returns {number}
|
|
2132
|
+
*/
|
|
2133
|
+
get bytecode_size() {
|
|
2134
|
+
const ret = wasm.__wbg_get_wasmenhancedcompilationresult_bytecode_size(this.__wbg_ptr);
|
|
2135
|
+
return ret >>> 0;
|
|
2136
|
+
}
|
|
2137
|
+
/**
|
|
2138
|
+
* Compilation time in milliseconds
|
|
2139
|
+
* @returns {number}
|
|
2140
|
+
*/
|
|
2141
|
+
get compilation_time() {
|
|
2142
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
2143
|
+
return ret;
|
|
2144
|
+
}
|
|
2145
|
+
/**
|
|
2146
|
+
* Total error count
|
|
2147
|
+
* @returns {number}
|
|
2148
|
+
*/
|
|
2149
|
+
get error_count() {
|
|
2150
|
+
const ret = wasm.__wbg_get_wasmenhancedcompilationresult_error_count(this.__wbg_ptr);
|
|
2151
|
+
return ret >>> 0;
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* Whether compilation succeeded
|
|
2155
|
+
* @returns {boolean}
|
|
2156
|
+
*/
|
|
2157
|
+
get success() {
|
|
2158
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_success(this.__wbg_ptr);
|
|
2159
|
+
return ret !== 0;
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* Total warning count
|
|
2163
|
+
* @returns {number}
|
|
2164
|
+
*/
|
|
2165
|
+
get warning_count() {
|
|
2166
|
+
const ret = wasm.__wbg_get_wasmenhancedcompilationresult_warning_count(this.__wbg_ptr);
|
|
2167
|
+
return ret >>> 0;
|
|
2168
|
+
}
|
|
2169
|
+
/**
|
|
2170
|
+
* Size of generated bytecode
|
|
2171
|
+
* @param {number} arg0
|
|
2172
|
+
*/
|
|
2173
|
+
set bytecode_size(arg0) {
|
|
2174
|
+
wasm.__wbg_set_wasmenhancedcompilationresult_bytecode_size(this.__wbg_ptr, arg0);
|
|
2175
|
+
}
|
|
2176
|
+
/**
|
|
2177
|
+
* Compilation time in milliseconds
|
|
2178
|
+
* @param {number} arg0
|
|
2179
|
+
*/
|
|
2180
|
+
set compilation_time(arg0) {
|
|
2181
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Total error count
|
|
2185
|
+
* @param {number} arg0
|
|
2186
|
+
*/
|
|
2187
|
+
set error_count(arg0) {
|
|
2188
|
+
wasm.__wbg_set_wasmenhancedcompilationresult_error_count(this.__wbg_ptr, arg0);
|
|
2189
|
+
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Whether compilation succeeded
|
|
2192
|
+
* @param {boolean} arg0
|
|
2193
|
+
*/
|
|
2194
|
+
set success(arg0) {
|
|
2195
|
+
wasm.__wbg_set_wasmanalysisresult_success(this.__wbg_ptr, arg0);
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Total warning count
|
|
2199
|
+
* @param {number} arg0
|
|
2200
|
+
*/
|
|
2201
|
+
set warning_count(arg0) {
|
|
2202
|
+
wasm.__wbg_set_wasmenhancedcompilationresult_warning_count(this.__wbg_ptr, arg0);
|
|
2203
|
+
}
|
|
2204
|
+
/**
|
|
2205
|
+
* @returns {WasmCompilerError[]}
|
|
2206
|
+
*/
|
|
2207
|
+
get compiler_errors() {
|
|
2208
|
+
try {
|
|
2209
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2210
|
+
wasm.wasmenhancedcompilationresult_compiler_errors(retptr, this.__wbg_ptr);
|
|
2211
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2212
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2213
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2214
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2215
|
+
return v1;
|
|
2216
|
+
} finally {
|
|
2217
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Get all errors as JSON array
|
|
2222
|
+
* @returns {string}
|
|
2223
|
+
*/
|
|
2224
|
+
format_all_json() {
|
|
2225
|
+
let deferred1_0;
|
|
2226
|
+
let deferred1_1;
|
|
2227
|
+
try {
|
|
2228
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2229
|
+
wasm.wasmenhancedcompilationresult_format_all_json(retptr, this.__wbg_ptr);
|
|
2230
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2231
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2232
|
+
deferred1_0 = r0;
|
|
2233
|
+
deferred1_1 = r1;
|
|
2234
|
+
return getStringFromWasm0(r0, r1);
|
|
2235
|
+
} finally {
|
|
2236
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2237
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
/**
|
|
2241
|
+
* Get all errors formatted as terminal output
|
|
2242
|
+
* @returns {string}
|
|
2243
|
+
*/
|
|
2244
|
+
format_all_terminal() {
|
|
2245
|
+
let deferred1_0;
|
|
2246
|
+
let deferred1_1;
|
|
2247
|
+
try {
|
|
2248
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2249
|
+
wasm.wasmenhancedcompilationresult_format_all_terminal(retptr, this.__wbg_ptr);
|
|
2250
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2251
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2252
|
+
deferred1_0 = r0;
|
|
2253
|
+
deferred1_1 = r1;
|
|
2254
|
+
return getStringFromWasm0(r0, r1);
|
|
2255
|
+
} finally {
|
|
2256
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2257
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
if (Symbol.dispose) WasmEnhancedCompilationResult.prototype[Symbol.dispose] = WasmEnhancedCompilationResult.prototype.free;
|
|
2262
|
+
exports.WasmEnhancedCompilationResult = WasmEnhancedCompilationResult;
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* WASM DSL Compiler for client-side compilation
|
|
2266
|
+
*/
|
|
2267
|
+
class WasmFiveCompiler {
|
|
2268
|
+
__destroy_into_raw() {
|
|
2269
|
+
const ptr = this.__wbg_ptr;
|
|
2270
|
+
this.__wbg_ptr = 0;
|
|
2271
|
+
WasmFiveCompilerFinalization.unregister(this);
|
|
2272
|
+
return ptr;
|
|
2273
|
+
}
|
|
2274
|
+
free() {
|
|
2275
|
+
const ptr = this.__destroy_into_raw();
|
|
2276
|
+
wasm.__wbg_wasmfivecompiler_free(ptr, 0);
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Get detailed analysis of source code
|
|
2280
|
+
* @param {string} source
|
|
2281
|
+
* @returns {WasmAnalysisResult}
|
|
2282
|
+
*/
|
|
2283
|
+
analyze_source(source) {
|
|
2284
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2285
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2286
|
+
const ret = wasm.wasmfivecompiler_analyze_source(this.__wbg_ptr, ptr0, len0);
|
|
2287
|
+
return WasmAnalysisResult.__wrap(ret);
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* Get detailed analysis of source code with compilation mode selection
|
|
2291
|
+
* @param {string} source
|
|
2292
|
+
* @param {string} mode
|
|
2293
|
+
* @returns {WasmAnalysisResult}
|
|
2294
|
+
*/
|
|
2295
|
+
analyze_source_mode(source, mode) {
|
|
2296
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2297
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2298
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2299
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2300
|
+
const ret = wasm.wasmfivecompiler_analyze_source_mode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2301
|
+
return WasmAnalysisResult.__wrap(ret);
|
|
2302
|
+
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Unified compilation method with enhanced error reporting and metrics
|
|
2305
|
+
* @param {string} source
|
|
2306
|
+
* @param {WasmCompilationOptions} options
|
|
2307
|
+
* @returns {WasmCompilationResult}
|
|
2308
|
+
*/
|
|
2309
|
+
compile(source, options) {
|
|
2310
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2311
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2312
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2313
|
+
const ret = wasm.wasmfivecompiler_compile(this.__wbg_ptr, ptr0, len0, options.__wbg_ptr);
|
|
2314
|
+
return WasmCompilationResult.__wrap(ret);
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Compile multi-file project with explicit module list
|
|
2318
|
+
* @param {any} module_files
|
|
2319
|
+
* @param {string} entry_point
|
|
2320
|
+
* @param {WasmCompilationOptions} options
|
|
2321
|
+
* @returns {WasmCompilationResult}
|
|
2322
|
+
*/
|
|
2323
|
+
compileModules(module_files, entry_point, options) {
|
|
2324
|
+
try {
|
|
2325
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2326
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2328
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2329
|
+
wasm.wasmfivecompiler_compileModules(retptr, this.__wbg_ptr, addHeapObject(module_files), ptr0, len0, options.__wbg_ptr);
|
|
2330
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2331
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2332
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2333
|
+
if (r2) {
|
|
2334
|
+
throw takeObject(r1);
|
|
2335
|
+
}
|
|
2336
|
+
return WasmCompilationResult.__wrap(r0);
|
|
2337
|
+
} finally {
|
|
2338
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Compile multi-file project with automatic discovery
|
|
2343
|
+
* @param {string} entry_point
|
|
2344
|
+
* @param {WasmCompilationOptions} options
|
|
2345
|
+
* @returns {WasmCompilationResult}
|
|
2346
|
+
*/
|
|
2347
|
+
compileMultiWithDiscovery(entry_point, options) {
|
|
2348
|
+
try {
|
|
2349
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2350
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2351
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2352
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2353
|
+
wasm.wasmfivecompiler_compileMultiWithDiscovery(retptr, this.__wbg_ptr, ptr0, len0, options.__wbg_ptr);
|
|
2354
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2355
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2356
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2357
|
+
if (r2) {
|
|
2358
|
+
throw takeObject(r1);
|
|
2359
|
+
}
|
|
2360
|
+
return WasmCompilationResult.__wrap(r0);
|
|
2361
|
+
} finally {
|
|
2362
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Multi-file compilation using module merger (main source + modules)
|
|
2367
|
+
* @param {string} main_source
|
|
2368
|
+
* @param {any} modules
|
|
2369
|
+
* @param {WasmCompilationOptions} options
|
|
2370
|
+
* @returns {WasmCompilationResult}
|
|
2371
|
+
*/
|
|
2372
|
+
compile_multi(main_source, modules, options) {
|
|
2373
|
+
try {
|
|
2374
|
+
const ptr0 = passStringToWasm0(main_source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2375
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2376
|
+
_assertClass(options, WasmCompilationOptions);
|
|
2377
|
+
const ret = wasm.wasmfivecompiler_compile_multi(this.__wbg_ptr, ptr0, len0, addBorrowedObject(modules), options.__wbg_ptr);
|
|
2378
|
+
return WasmCompilationResult.__wrap(ret);
|
|
2379
|
+
} finally {
|
|
2380
|
+
heap[stack_pointer++] = undefined;
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Compile DSL and generate both bytecode and ABI
|
|
2385
|
+
* @param {string} source
|
|
2386
|
+
* @returns {any}
|
|
2387
|
+
*/
|
|
2388
|
+
compile_with_abi(source) {
|
|
2389
|
+
try {
|
|
2390
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2391
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2392
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2393
|
+
wasm.wasmfivecompiler_compile_with_abi(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2394
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2395
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2396
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2397
|
+
if (r2) {
|
|
2398
|
+
throw takeObject(r1);
|
|
2399
|
+
}
|
|
2400
|
+
return takeObject(r0);
|
|
2401
|
+
} finally {
|
|
2402
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Discover modules starting from an entry point
|
|
2407
|
+
* @param {string} entry_point
|
|
2408
|
+
* @returns {any}
|
|
2409
|
+
*/
|
|
2410
|
+
discoverModules(entry_point) {
|
|
2411
|
+
try {
|
|
2412
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2413
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2414
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2415
|
+
wasm.wasmfivecompiler_discoverModules(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2416
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2417
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2418
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2419
|
+
if (r2) {
|
|
2420
|
+
throw takeObject(r1);
|
|
2421
|
+
}
|
|
2422
|
+
return takeObject(r0);
|
|
2423
|
+
} finally {
|
|
2424
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Extract function name metadata from compiled bytecode
|
|
2429
|
+
* Returns a list of discovered functions in the bytecode
|
|
2430
|
+
* @param {Uint8Array} bytecode
|
|
2431
|
+
* @returns {any}
|
|
2432
|
+
*/
|
|
2433
|
+
extractFunctionMetadata(bytecode) {
|
|
2434
|
+
try {
|
|
2435
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2436
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
2437
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2438
|
+
wasm.wasmfivecompiler_extractFunctionMetadata(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2439
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2440
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2441
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2442
|
+
if (r2) {
|
|
2443
|
+
throw takeObject(r1);
|
|
2444
|
+
}
|
|
2445
|
+
return takeObject(r0);
|
|
2446
|
+
} finally {
|
|
2447
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* Extract account definitions from DSL source code
|
|
2452
|
+
* @param {string} source
|
|
2453
|
+
* @returns {any}
|
|
2454
|
+
*/
|
|
2455
|
+
extract_account_definitions(source) {
|
|
2456
|
+
try {
|
|
2457
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2458
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2459
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2460
|
+
wasm.wasmfivecompiler_extract_account_definitions(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2461
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2462
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2463
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2464
|
+
if (r2) {
|
|
2465
|
+
throw takeObject(r1);
|
|
2466
|
+
}
|
|
2467
|
+
return takeObject(r0);
|
|
2468
|
+
} finally {
|
|
2469
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Extract function signatures with account parameters
|
|
2474
|
+
* @param {string} source
|
|
2475
|
+
* @returns {any}
|
|
2476
|
+
*/
|
|
2477
|
+
extract_function_signatures(source) {
|
|
2478
|
+
try {
|
|
2479
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2480
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2481
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2482
|
+
wasm.wasmfivecompiler_extract_function_signatures(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2483
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2484
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2485
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2486
|
+
if (r2) {
|
|
2487
|
+
throw takeObject(r1);
|
|
2488
|
+
}
|
|
2489
|
+
return takeObject(r0);
|
|
2490
|
+
} finally {
|
|
2491
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Format an error message using the native terminal formatter
|
|
2496
|
+
* This provides rich Rust-style error output with source context and colors
|
|
2497
|
+
* @param {string} message
|
|
2498
|
+
* @param {string} code
|
|
2499
|
+
* @param {string} severity
|
|
2500
|
+
* @param {number} line
|
|
2501
|
+
* @param {number} column
|
|
2502
|
+
* @param {string} _source
|
|
2503
|
+
* @returns {string}
|
|
2504
|
+
*/
|
|
2505
|
+
format_error_terminal(message, code, severity, line, column, _source) {
|
|
2506
|
+
let deferred5_0;
|
|
2507
|
+
let deferred5_1;
|
|
2508
|
+
try {
|
|
2509
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2510
|
+
const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2511
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2512
|
+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2513
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2514
|
+
const ptr2 = passStringToWasm0(severity, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2515
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2516
|
+
const ptr3 = passStringToWasm0(_source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2517
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2518
|
+
wasm.wasmfivecompiler_format_error_terminal(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, line, column, ptr3, len3);
|
|
2519
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2520
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2521
|
+
deferred5_0 = r0;
|
|
2522
|
+
deferred5_1 = r1;
|
|
2523
|
+
return getStringFromWasm0(r0, r1);
|
|
2524
|
+
} finally {
|
|
2525
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2526
|
+
wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Generate ABI from DSL source code for function calls
|
|
2531
|
+
* @param {string} source
|
|
2532
|
+
* @returns {any}
|
|
2533
|
+
*/
|
|
2534
|
+
generate_abi(source) {
|
|
2535
|
+
try {
|
|
2536
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2537
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2538
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2539
|
+
wasm.wasmfivecompiler_generate_abi(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2540
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2541
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2542
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2543
|
+
if (r2) {
|
|
2544
|
+
throw takeObject(r1);
|
|
2545
|
+
}
|
|
2546
|
+
return takeObject(r0);
|
|
2547
|
+
} finally {
|
|
2548
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Get compiler statistics
|
|
2553
|
+
* @returns {any}
|
|
2554
|
+
*/
|
|
2555
|
+
get_compiler_stats() {
|
|
2556
|
+
const ret = wasm.wasmfivecompiler_get_compiler_stats(this.__wbg_ptr);
|
|
2557
|
+
return takeObject(ret);
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Get comprehensive compiler statistics including which opcodes are used vs unused
|
|
2561
|
+
* @param {string} source
|
|
2562
|
+
* @returns {any}
|
|
2563
|
+
*/
|
|
2564
|
+
get_opcode_analysis(source) {
|
|
2565
|
+
try {
|
|
2566
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2567
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2568
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2569
|
+
wasm.wasmfivecompiler_get_opcode_analysis(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2570
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2571
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2572
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2573
|
+
if (r2) {
|
|
2574
|
+
throw takeObject(r1);
|
|
2575
|
+
}
|
|
2576
|
+
return takeObject(r0);
|
|
2577
|
+
} finally {
|
|
2578
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* Get opcode usage statistics from compilation
|
|
2583
|
+
* @param {string} source
|
|
2584
|
+
* @returns {any}
|
|
2585
|
+
*/
|
|
2586
|
+
get_opcode_usage(source) {
|
|
2587
|
+
try {
|
|
2588
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2589
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2590
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2591
|
+
wasm.wasmfivecompiler_get_opcode_usage(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2592
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2593
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2594
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2595
|
+
if (r2) {
|
|
2596
|
+
throw takeObject(r1);
|
|
2597
|
+
}
|
|
2598
|
+
return takeObject(r0);
|
|
2599
|
+
} finally {
|
|
2600
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Create a new WASM compiler instance
|
|
2605
|
+
*/
|
|
2606
|
+
constructor() {
|
|
2607
|
+
const ret = wasm.wasmfivecompiler_new();
|
|
2608
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2609
|
+
WasmFiveCompilerFinalization.register(this, this.__wbg_ptr, this);
|
|
2610
|
+
return this;
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2613
|
+
* Optimize bytecode
|
|
2614
|
+
* @param {Uint8Array} bytecode
|
|
2615
|
+
* @returns {Uint8Array}
|
|
2616
|
+
*/
|
|
2617
|
+
optimize_bytecode(bytecode) {
|
|
2618
|
+
try {
|
|
2619
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2620
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
2621
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2622
|
+
wasm.wasmfivecompiler_optimize_bytecode(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2623
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2624
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2625
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2626
|
+
if (r2) {
|
|
2627
|
+
throw takeObject(r1);
|
|
2628
|
+
}
|
|
2629
|
+
return takeObject(r0);
|
|
2630
|
+
} finally {
|
|
2631
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
/**
|
|
2635
|
+
* Parse DSL source code and return AST information
|
|
2636
|
+
* @param {string} source
|
|
2637
|
+
* @returns {any}
|
|
2638
|
+
*/
|
|
2639
|
+
parse_dsl(source) {
|
|
2640
|
+
try {
|
|
2641
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2642
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2643
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2644
|
+
wasm.wasmfivecompiler_parse_dsl(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2645
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2646
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2647
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2648
|
+
if (r2) {
|
|
2649
|
+
throw takeObject(r1);
|
|
2650
|
+
}
|
|
2651
|
+
return takeObject(r0);
|
|
2652
|
+
} finally {
|
|
2653
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
/**
|
|
2657
|
+
* Type-check parsed AST
|
|
2658
|
+
* @param {string} _ast_json
|
|
2659
|
+
* @returns {any}
|
|
2660
|
+
*/
|
|
2661
|
+
type_check(_ast_json) {
|
|
2662
|
+
try {
|
|
2663
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2664
|
+
const ptr0 = passStringToWasm0(_ast_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2665
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2666
|
+
wasm.wasmfivecompiler_type_check(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2667
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2668
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2669
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2670
|
+
if (r2) {
|
|
2671
|
+
throw takeObject(r1);
|
|
2672
|
+
}
|
|
2673
|
+
return takeObject(r0);
|
|
2674
|
+
} finally {
|
|
2675
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
/**
|
|
2679
|
+
* Validate account constraints against function parameters
|
|
2680
|
+
* @param {string} source
|
|
2681
|
+
* @param {string} function_name
|
|
2682
|
+
* @param {string} accounts_json
|
|
2683
|
+
* @returns {any}
|
|
2684
|
+
*/
|
|
2685
|
+
validate_account_constraints(source, function_name, accounts_json) {
|
|
2686
|
+
try {
|
|
2687
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2688
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2689
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2690
|
+
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2691
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2692
|
+
const ptr2 = passStringToWasm0(accounts_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2693
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2694
|
+
wasm.wasmfivecompiler_validate_account_constraints(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
2695
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2696
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2697
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2698
|
+
if (r2) {
|
|
2699
|
+
throw takeObject(r1);
|
|
2700
|
+
}
|
|
2701
|
+
return takeObject(r0);
|
|
2702
|
+
} finally {
|
|
2703
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Validate DSL syntax without full compilation
|
|
2708
|
+
* @param {string} source
|
|
2709
|
+
* @returns {any}
|
|
2710
|
+
*/
|
|
2711
|
+
validate_syntax(source) {
|
|
2712
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2713
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2714
|
+
const ret = wasm.wasmfivecompiler_validate_syntax(this.__wbg_ptr, ptr0, len0);
|
|
2715
|
+
return takeObject(ret);
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
if (Symbol.dispose) WasmFiveCompiler.prototype[Symbol.dispose] = WasmFiveCompiler.prototype.free;
|
|
2719
|
+
exports.WasmFiveCompiler = WasmFiveCompiler;
|
|
2720
|
+
|
|
2721
|
+
/**
|
|
2722
|
+
* WASM-exposed metrics collector wrapper
|
|
2723
|
+
*/
|
|
2724
|
+
class WasmMetricsCollector {
|
|
2725
|
+
__destroy_into_raw() {
|
|
2726
|
+
const ptr = this.__wbg_ptr;
|
|
2727
|
+
this.__wbg_ptr = 0;
|
|
2728
|
+
WasmMetricsCollectorFinalization.unregister(this);
|
|
2729
|
+
return ptr;
|
|
2730
|
+
}
|
|
2731
|
+
free() {
|
|
2732
|
+
const ptr = this.__destroy_into_raw();
|
|
2733
|
+
wasm.__wbg_wasmmetricscollector_free(ptr, 0);
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* End the current compilation phase
|
|
2737
|
+
*/
|
|
2738
|
+
end_phase() {
|
|
2739
|
+
wasm.wasmmetricscollector_end_phase(this.__wbg_ptr);
|
|
2740
|
+
}
|
|
2741
|
+
/**
|
|
2742
|
+
* Export metrics in the requested format
|
|
2743
|
+
* @param {string} format
|
|
2744
|
+
* @returns {string}
|
|
2745
|
+
*/
|
|
2746
|
+
export(format) {
|
|
2747
|
+
let deferred3_0;
|
|
2748
|
+
let deferred3_1;
|
|
2749
|
+
try {
|
|
2750
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2751
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2752
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2753
|
+
wasm.wasmmetricscollector_export(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2754
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2755
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2756
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2757
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2758
|
+
var ptr2 = r0;
|
|
2759
|
+
var len2 = r1;
|
|
2760
|
+
if (r3) {
|
|
2761
|
+
ptr2 = 0; len2 = 0;
|
|
2762
|
+
throw takeObject(r2);
|
|
2763
|
+
}
|
|
2764
|
+
deferred3_0 = ptr2;
|
|
2765
|
+
deferred3_1 = len2;
|
|
2766
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2767
|
+
} finally {
|
|
2768
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2769
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Finalize metrics collection
|
|
2774
|
+
*/
|
|
2775
|
+
finalize() {
|
|
2776
|
+
wasm.wasmmetricscollector_finalize(this.__wbg_ptr);
|
|
2777
|
+
}
|
|
2778
|
+
/**
|
|
2779
|
+
* Get metrics as a JS object for programmatic use
|
|
2780
|
+
* @returns {any}
|
|
2781
|
+
*/
|
|
2782
|
+
get_metrics_object() {
|
|
2783
|
+
try {
|
|
2784
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2785
|
+
wasm.wasmmetricscollector_get_metrics_object(retptr, this.__wbg_ptr);
|
|
2786
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2787
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2788
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2789
|
+
if (r2) {
|
|
2790
|
+
throw takeObject(r1);
|
|
2791
|
+
}
|
|
2792
|
+
return takeObject(r0);
|
|
2793
|
+
} finally {
|
|
2794
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
constructor() {
|
|
2798
|
+
const ret = wasm.wasmmetricscollector_new();
|
|
2799
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2800
|
+
WasmMetricsCollectorFinalization.register(this, this.__wbg_ptr, this);
|
|
2801
|
+
return this;
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* Reset the collector for a new compilation
|
|
2805
|
+
*/
|
|
2806
|
+
reset() {
|
|
2807
|
+
wasm.wasmmetricscollector_reset(this.__wbg_ptr);
|
|
2808
|
+
}
|
|
2809
|
+
/**
|
|
2810
|
+
* Start timing a compilation phase
|
|
2811
|
+
* @param {string} phase_name
|
|
2812
|
+
*/
|
|
2813
|
+
start_phase(phase_name) {
|
|
2814
|
+
const ptr0 = passStringToWasm0(phase_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2815
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2816
|
+
wasm.wasmmetricscollector_start_phase(this.__wbg_ptr, ptr0, len0);
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
if (Symbol.dispose) WasmMetricsCollector.prototype[Symbol.dispose] = WasmMetricsCollector.prototype.free;
|
|
2820
|
+
exports.WasmMetricsCollector = WasmMetricsCollector;
|
|
2821
|
+
|
|
2822
|
+
/**
|
|
2823
|
+
* Enhanced source location for WASM
|
|
2824
|
+
*/
|
|
2825
|
+
class WasmSourceLocation {
|
|
2826
|
+
static __wrap(ptr) {
|
|
2827
|
+
ptr = ptr >>> 0;
|
|
2828
|
+
const obj = Object.create(WasmSourceLocation.prototype);
|
|
2829
|
+
obj.__wbg_ptr = ptr;
|
|
2830
|
+
WasmSourceLocationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2831
|
+
return obj;
|
|
2832
|
+
}
|
|
2833
|
+
__destroy_into_raw() {
|
|
2834
|
+
const ptr = this.__wbg_ptr;
|
|
2835
|
+
this.__wbg_ptr = 0;
|
|
2836
|
+
WasmSourceLocationFinalization.unregister(this);
|
|
2837
|
+
return ptr;
|
|
2838
|
+
}
|
|
2839
|
+
free() {
|
|
2840
|
+
const ptr = this.__destroy_into_raw();
|
|
2841
|
+
wasm.__wbg_wasmsourcelocation_free(ptr, 0);
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* Column number (1-based)
|
|
2845
|
+
* @returns {number}
|
|
2846
|
+
*/
|
|
2847
|
+
get column() {
|
|
2848
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_column(this.__wbg_ptr);
|
|
2849
|
+
return ret >>> 0;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* Length of the relevant text
|
|
2853
|
+
* @returns {number}
|
|
2854
|
+
*/
|
|
2855
|
+
get length() {
|
|
2856
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_length(this.__wbg_ptr);
|
|
2857
|
+
return ret >>> 0;
|
|
2858
|
+
}
|
|
2859
|
+
/**
|
|
2860
|
+
* Line number (1-based)
|
|
2861
|
+
* @returns {number}
|
|
2862
|
+
*/
|
|
2863
|
+
get line() {
|
|
2864
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_line(this.__wbg_ptr);
|
|
2865
|
+
return ret >>> 0;
|
|
2866
|
+
}
|
|
2867
|
+
/**
|
|
2868
|
+
* Byte offset in source
|
|
2869
|
+
* @returns {number}
|
|
2870
|
+
*/
|
|
2871
|
+
get offset() {
|
|
2872
|
+
const ret = wasm.__wbg_get_wasmsourcelocation_offset(this.__wbg_ptr);
|
|
2873
|
+
return ret >>> 0;
|
|
2874
|
+
}
|
|
2875
|
+
/**
|
|
2876
|
+
* Column number (1-based)
|
|
2877
|
+
* @param {number} arg0
|
|
2878
|
+
*/
|
|
2879
|
+
set column(arg0) {
|
|
2880
|
+
wasm.__wbg_set_wasmsourcelocation_column(this.__wbg_ptr, arg0);
|
|
2881
|
+
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Length of the relevant text
|
|
2884
|
+
* @param {number} arg0
|
|
2885
|
+
*/
|
|
2886
|
+
set length(arg0) {
|
|
2887
|
+
wasm.__wbg_set_wasmsourcelocation_length(this.__wbg_ptr, arg0);
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* Line number (1-based)
|
|
2891
|
+
* @param {number} arg0
|
|
2892
|
+
*/
|
|
2893
|
+
set line(arg0) {
|
|
2894
|
+
wasm.__wbg_set_wasmsourcelocation_line(this.__wbg_ptr, arg0);
|
|
2895
|
+
}
|
|
2896
|
+
/**
|
|
2897
|
+
* Byte offset in source
|
|
2898
|
+
* @param {number} arg0
|
|
2899
|
+
*/
|
|
2900
|
+
set offset(arg0) {
|
|
2901
|
+
wasm.__wbg_set_wasmsourcelocation_offset(this.__wbg_ptr, arg0);
|
|
2902
|
+
}
|
|
2903
|
+
/**
|
|
2904
|
+
* @returns {string | undefined}
|
|
2905
|
+
*/
|
|
2906
|
+
get file() {
|
|
2907
|
+
try {
|
|
2908
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2909
|
+
wasm.wasmsourcelocation_file(retptr, this.__wbg_ptr);
|
|
2910
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2911
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2912
|
+
let v1;
|
|
2913
|
+
if (r0 !== 0) {
|
|
2914
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2915
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2916
|
+
}
|
|
2917
|
+
return v1;
|
|
2918
|
+
} finally {
|
|
2919
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
if (Symbol.dispose) WasmSourceLocation.prototype[Symbol.dispose] = WasmSourceLocation.prototype.free;
|
|
2924
|
+
exports.WasmSourceLocation = WasmSourceLocation;
|
|
2925
|
+
|
|
2926
|
+
/**
|
|
2927
|
+
* Enhanced error suggestion for WASM
|
|
2928
|
+
*/
|
|
2929
|
+
class WasmSuggestion {
|
|
2930
|
+
static __wrap(ptr) {
|
|
2931
|
+
ptr = ptr >>> 0;
|
|
2932
|
+
const obj = Object.create(WasmSuggestion.prototype);
|
|
2933
|
+
obj.__wbg_ptr = ptr;
|
|
2934
|
+
WasmSuggestionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2935
|
+
return obj;
|
|
2936
|
+
}
|
|
2937
|
+
__destroy_into_raw() {
|
|
2938
|
+
const ptr = this.__wbg_ptr;
|
|
2939
|
+
this.__wbg_ptr = 0;
|
|
2940
|
+
WasmSuggestionFinalization.unregister(this);
|
|
2941
|
+
return ptr;
|
|
2942
|
+
}
|
|
2943
|
+
free() {
|
|
2944
|
+
const ptr = this.__destroy_into_raw();
|
|
2945
|
+
wasm.__wbg_wasmsuggestion_free(ptr, 0);
|
|
2946
|
+
}
|
|
2947
|
+
/**
|
|
2948
|
+
* Confidence score (0.0 to 1.0)
|
|
2949
|
+
* @returns {number}
|
|
2950
|
+
*/
|
|
2951
|
+
get confidence() {
|
|
2952
|
+
const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
|
|
2953
|
+
return ret;
|
|
2954
|
+
}
|
|
2955
|
+
/**
|
|
2956
|
+
* Confidence score (0.0 to 1.0)
|
|
2957
|
+
* @param {number} arg0
|
|
2958
|
+
*/
|
|
2959
|
+
set confidence(arg0) {
|
|
2960
|
+
wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
|
|
2961
|
+
}
|
|
2962
|
+
/**
|
|
2963
|
+
* @returns {string | undefined}
|
|
2964
|
+
*/
|
|
2965
|
+
get code_suggestion() {
|
|
2966
|
+
try {
|
|
2967
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2968
|
+
wasm.wasmsuggestion_code_suggestion(retptr, this.__wbg_ptr);
|
|
2969
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2970
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2971
|
+
let v1;
|
|
2972
|
+
if (r0 !== 0) {
|
|
2973
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2974
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2975
|
+
}
|
|
2976
|
+
return v1;
|
|
2977
|
+
} finally {
|
|
2978
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
/**
|
|
2982
|
+
* @returns {string | undefined}
|
|
2983
|
+
*/
|
|
2984
|
+
get explanation() {
|
|
2985
|
+
try {
|
|
2986
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2987
|
+
wasm.wasmsuggestion_explanation(retptr, this.__wbg_ptr);
|
|
2988
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2989
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2990
|
+
let v1;
|
|
2991
|
+
if (r0 !== 0) {
|
|
2992
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2993
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2994
|
+
}
|
|
2995
|
+
return v1;
|
|
2996
|
+
} finally {
|
|
2997
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
/**
|
|
3001
|
+
* @returns {string}
|
|
3002
|
+
*/
|
|
3003
|
+
get message() {
|
|
3004
|
+
let deferred1_0;
|
|
3005
|
+
let deferred1_1;
|
|
3006
|
+
try {
|
|
3007
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3008
|
+
wasm.wasmsuggestion_message(retptr, this.__wbg_ptr);
|
|
3009
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3010
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3011
|
+
deferred1_0 = r0;
|
|
3012
|
+
deferred1_1 = r1;
|
|
3013
|
+
return getStringFromWasm0(r0, r1);
|
|
3014
|
+
} finally {
|
|
3015
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3016
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
if (Symbol.dispose) WasmSuggestion.prototype[Symbol.dispose] = WasmSuggestion.prototype.free;
|
|
3021
|
+
exports.WasmSuggestion = WasmSuggestion;
|
|
3022
|
+
|
|
3023
|
+
/**
|
|
3024
|
+
* Get function names from bytecode as a JS value (array of objects)
|
|
3025
|
+
*
|
|
3026
|
+
* This function avoids constructing `FunctionNameInfo` JS instances and instead
|
|
3027
|
+
* marshals the parsed metadata directly into a serde-friendly structure and
|
|
3028
|
+
* returns a `JsValue` via `JsValue::from_serde`.
|
|
3029
|
+
* @param {Uint8Array} bytecode
|
|
3030
|
+
* @returns {any}
|
|
3031
|
+
*/
|
|
3032
|
+
function get_function_names(bytecode) {
|
|
3033
|
+
try {
|
|
3034
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3035
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
3036
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3037
|
+
wasm.get_function_names(retptr, ptr0, len0);
|
|
3038
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3039
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3040
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3041
|
+
if (r2) {
|
|
3042
|
+
throw takeObject(r1);
|
|
3043
|
+
}
|
|
3044
|
+
return takeObject(r0);
|
|
3045
|
+
} finally {
|
|
3046
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
exports.get_function_names = get_function_names;
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* Get the count of public functions from bytecode header
|
|
3053
|
+
* @param {Uint8Array} bytecode
|
|
3054
|
+
* @returns {number}
|
|
3055
|
+
*/
|
|
3056
|
+
function get_public_function_count(bytecode) {
|
|
3057
|
+
try {
|
|
3058
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3059
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
3060
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3061
|
+
wasm.get_public_function_count(retptr, ptr0, len0);
|
|
3062
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3063
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3064
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3065
|
+
if (r2) {
|
|
3066
|
+
throw takeObject(r1);
|
|
3067
|
+
}
|
|
3068
|
+
return r0;
|
|
3069
|
+
} finally {
|
|
3070
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
exports.get_public_function_count = get_public_function_count;
|
|
3074
|
+
|
|
3075
|
+
/**
|
|
3076
|
+
* Get information about the WASM compiler capabilities
|
|
3077
|
+
* @returns {any}
|
|
3078
|
+
*/
|
|
3079
|
+
function get_wasm_compiler_info() {
|
|
3080
|
+
const ret = wasm.get_wasm_compiler_info();
|
|
3081
|
+
return takeObject(ret);
|
|
3082
|
+
}
|
|
3083
|
+
exports.get_wasm_compiler_info = get_wasm_compiler_info;
|
|
3084
|
+
|
|
3085
|
+
/**
|
|
3086
|
+
* Helper function to convert JS value to VM Value
|
|
3087
|
+
* @param {any} js_val
|
|
3088
|
+
* @param {number} value_type
|
|
3089
|
+
* @returns {any}
|
|
3090
|
+
*/
|
|
3091
|
+
function js_value_to_vm_value(js_val, value_type) {
|
|
3092
|
+
try {
|
|
3093
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3094
|
+
wasm.js_value_to_vm_value(retptr, addBorrowedObject(js_val), value_type);
|
|
3095
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3096
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3097
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3098
|
+
if (r2) {
|
|
3099
|
+
throw takeObject(r1);
|
|
3100
|
+
}
|
|
3101
|
+
return takeObject(r0);
|
|
3102
|
+
} finally {
|
|
3103
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3104
|
+
heap[stack_pointer++] = undefined;
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
exports.js_value_to_vm_value = js_value_to_vm_value;
|
|
3108
|
+
|
|
3109
|
+
/**
|
|
3110
|
+
* @param {string} message
|
|
3111
|
+
*/
|
|
3112
|
+
function log_to_console(message) {
|
|
3113
|
+
const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3114
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3115
|
+
wasm.log_to_console(ptr0, len0);
|
|
3116
|
+
}
|
|
3117
|
+
exports.log_to_console = log_to_console;
|
|
3118
|
+
|
|
3119
|
+
/**
|
|
3120
|
+
* Parse function names from bytecode metadata
|
|
3121
|
+
*
|
|
3122
|
+
* Returns a JS value which is a JSON string encoding an array of objects:
|
|
3123
|
+
* [ { "name": "...", "function_index": N }, ... ]
|
|
3124
|
+
* We serialize via serde_json and return the JSON string as a `JsValue` to
|
|
3125
|
+
* avoid complex JS object construction in Rust/WASM glue.
|
|
3126
|
+
* @param {Uint8Array} bytecode
|
|
3127
|
+
* @returns {any}
|
|
3128
|
+
*/
|
|
3129
|
+
function parse_function_names(bytecode) {
|
|
3130
|
+
try {
|
|
3131
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3132
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
3133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3134
|
+
wasm.parse_function_names(retptr, ptr0, len0);
|
|
3135
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3136
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3137
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3138
|
+
if (r2) {
|
|
3139
|
+
throw takeObject(r1);
|
|
3140
|
+
}
|
|
3141
|
+
return takeObject(r0);
|
|
3142
|
+
} finally {
|
|
3143
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
exports.parse_function_names = parse_function_names;
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* Utility: Validate optimized headers and mirror bytecode back to JS callers
|
|
3150
|
+
* @param {Uint8Array} bytecode
|
|
3151
|
+
* @returns {Uint8Array}
|
|
3152
|
+
*/
|
|
3153
|
+
function wrap_with_script_header(bytecode) {
|
|
3154
|
+
try {
|
|
3155
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3156
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
|
|
3157
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3158
|
+
wasm.wrap_with_script_header(retptr, ptr0, len0);
|
|
3159
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3160
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3161
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3162
|
+
if (r2) {
|
|
3163
|
+
throw takeObject(r1);
|
|
3164
|
+
}
|
|
3165
|
+
return takeObject(r0);
|
|
3166
|
+
} finally {
|
|
3167
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
exports.wrap_with_script_header = wrap_with_script_header;
|
|
3171
|
+
|
|
3172
|
+
function __wbg_get_imports() {
|
|
3173
|
+
const import0 = {
|
|
3174
|
+
__proto__: null,
|
|
3175
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
3176
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
3177
|
+
return addHeapObject(ret);
|
|
3178
|
+
},
|
|
3179
|
+
__wbg_String_fed4d24b68977888: function(arg0, arg1) {
|
|
3180
|
+
const ret = String(getObject(arg1));
|
|
3181
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3182
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3183
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3184
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3185
|
+
},
|
|
3186
|
+
__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(arg0, arg1) {
|
|
3187
|
+
const v = getObject(arg1);
|
|
3188
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
3189
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
3190
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3191
|
+
},
|
|
3192
|
+
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
|
|
3193
|
+
const v = getObject(arg0);
|
|
3194
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
3195
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
3196
|
+
},
|
|
3197
|
+
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
|
|
3198
|
+
const ret = debugString(getObject(arg1));
|
|
3199
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3200
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3201
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3202
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3203
|
+
},
|
|
3204
|
+
__wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
|
|
3205
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
3206
|
+
return ret;
|
|
3207
|
+
},
|
|
3208
|
+
__wbg___wbindgen_is_bigint_31b12575b56f32fc: function(arg0) {
|
|
3209
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
3210
|
+
return ret;
|
|
3211
|
+
},
|
|
3212
|
+
__wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
|
|
3213
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
3214
|
+
return ret;
|
|
3215
|
+
},
|
|
3216
|
+
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
3217
|
+
const val = getObject(arg0);
|
|
3218
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
3219
|
+
return ret;
|
|
3220
|
+
},
|
|
3221
|
+
__wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
|
|
3222
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
3223
|
+
return ret;
|
|
3224
|
+
},
|
|
3225
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
|
|
3226
|
+
const ret = getObject(arg0) === undefined;
|
|
3227
|
+
return ret;
|
|
3228
|
+
},
|
|
3229
|
+
__wbg___wbindgen_jsval_eq_11888390b0186270: function(arg0, arg1) {
|
|
3230
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
3231
|
+
return ret;
|
|
3232
|
+
},
|
|
3233
|
+
__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
|
|
3234
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
3235
|
+
return ret;
|
|
3236
|
+
},
|
|
3237
|
+
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
|
|
3238
|
+
const obj = getObject(arg1);
|
|
3239
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
3240
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
3241
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3242
|
+
},
|
|
3243
|
+
__wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
|
|
3244
|
+
const obj = getObject(arg1);
|
|
3245
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
3246
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3247
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3248
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3249
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3250
|
+
},
|
|
3251
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
3252
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3253
|
+
},
|
|
3254
|
+
__wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
|
|
3255
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
3256
|
+
return addHeapObject(ret);
|
|
3257
|
+
}, arguments); },
|
|
3258
|
+
__wbg_done_57b39ecd9addfe81: function(arg0) {
|
|
3259
|
+
const ret = getObject(arg0).done;
|
|
3260
|
+
return ret;
|
|
3261
|
+
},
|
|
3262
|
+
__wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
|
|
3263
|
+
let deferred0_0;
|
|
3264
|
+
let deferred0_1;
|
|
3265
|
+
try {
|
|
3266
|
+
deferred0_0 = arg0;
|
|
3267
|
+
deferred0_1 = arg1;
|
|
3268
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
3269
|
+
} finally {
|
|
3270
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
3271
|
+
}
|
|
3272
|
+
},
|
|
3273
|
+
__wbg_error_9a7fe3f932034cde: function(arg0) {
|
|
3274
|
+
console.error(getObject(arg0));
|
|
3275
|
+
},
|
|
3276
|
+
__wbg_getRandomValues_9c5c1b115e142bb8: function() { return handleError(function (arg0, arg1) {
|
|
3277
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
3278
|
+
}, arguments); },
|
|
3279
|
+
__wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
|
|
3280
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
3281
|
+
return addHeapObject(ret);
|
|
3282
|
+
},
|
|
3283
|
+
__wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
|
|
3284
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
3285
|
+
return addHeapObject(ret);
|
|
3286
|
+
}, arguments); },
|
|
3287
|
+
__wbg_get_with_ref_key_bb8f74a92cb2e784: function(arg0, arg1) {
|
|
3288
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
3289
|
+
return addHeapObject(ret);
|
|
3290
|
+
},
|
|
3291
|
+
__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
|
|
3292
|
+
let result;
|
|
3293
|
+
try {
|
|
3294
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
3295
|
+
} catch (_) {
|
|
3296
|
+
result = false;
|
|
3297
|
+
}
|
|
3298
|
+
const ret = result;
|
|
3299
|
+
return ret;
|
|
3300
|
+
},
|
|
3301
|
+
__wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
|
|
3302
|
+
let result;
|
|
3303
|
+
try {
|
|
3304
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
3305
|
+
} catch (_) {
|
|
3306
|
+
result = false;
|
|
3307
|
+
}
|
|
3308
|
+
const ret = result;
|
|
3309
|
+
return ret;
|
|
3310
|
+
},
|
|
3311
|
+
__wbg_isArray_d314bb98fcf08331: function(arg0) {
|
|
3312
|
+
const ret = Array.isArray(getObject(arg0));
|
|
3313
|
+
return ret;
|
|
3314
|
+
},
|
|
3315
|
+
__wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
|
|
3316
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
3317
|
+
return ret;
|
|
3318
|
+
},
|
|
3319
|
+
__wbg_iterator_6ff6560ca1568e55: function() {
|
|
3320
|
+
const ret = Symbol.iterator;
|
|
3321
|
+
return addHeapObject(ret);
|
|
3322
|
+
},
|
|
3323
|
+
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
3324
|
+
const ret = getObject(arg0).length;
|
|
3325
|
+
return ret;
|
|
3326
|
+
},
|
|
3327
|
+
__wbg_length_35a7bace40f36eac: function(arg0) {
|
|
3328
|
+
const ret = getObject(arg0).length;
|
|
3329
|
+
return ret;
|
|
3330
|
+
},
|
|
3331
|
+
__wbg_log_6b5ca2e6124b2808: function(arg0) {
|
|
3332
|
+
console.log(getObject(arg0));
|
|
3333
|
+
},
|
|
3334
|
+
__wbg_new_361308b2356cecd0: function() {
|
|
3335
|
+
const ret = new Object();
|
|
3336
|
+
return addHeapObject(ret);
|
|
3337
|
+
},
|
|
3338
|
+
__wbg_new_3eb36ae241fe6f44: function() {
|
|
3339
|
+
const ret = new Array();
|
|
3340
|
+
return addHeapObject(ret);
|
|
3341
|
+
},
|
|
3342
|
+
__wbg_new_8a6f238a6ece86ea: function() {
|
|
3343
|
+
const ret = new Error();
|
|
3344
|
+
return addHeapObject(ret);
|
|
3345
|
+
},
|
|
3346
|
+
__wbg_new_dca287b076112a51: function() {
|
|
3347
|
+
const ret = new Map();
|
|
3348
|
+
return addHeapObject(ret);
|
|
3349
|
+
},
|
|
3350
|
+
__wbg_new_dd2b680c8bf6ae29: function(arg0) {
|
|
3351
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
3352
|
+
return addHeapObject(ret);
|
|
3353
|
+
},
|
|
3354
|
+
__wbg_new_from_slice_a3d2629dc1826784: function(arg0, arg1) {
|
|
3355
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
3356
|
+
return addHeapObject(ret);
|
|
3357
|
+
},
|
|
3358
|
+
__wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
|
|
3359
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
3360
|
+
return addHeapObject(ret);
|
|
3361
|
+
},
|
|
3362
|
+
__wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
|
|
3363
|
+
const ret = getObject(arg0).next();
|
|
3364
|
+
return addHeapObject(ret);
|
|
3365
|
+
}, arguments); },
|
|
3366
|
+
__wbg_next_418f80d8f5303233: function(arg0) {
|
|
3367
|
+
const ret = getObject(arg0).next;
|
|
3368
|
+
return addHeapObject(ret);
|
|
3369
|
+
},
|
|
3370
|
+
__wbg_now_2c95c9de01293173: function(arg0) {
|
|
3371
|
+
const ret = getObject(arg0).now();
|
|
3372
|
+
return ret;
|
|
3373
|
+
},
|
|
3374
|
+
__wbg_now_a3af9a2f4bbaa4d1: function() {
|
|
3375
|
+
const ret = Date.now();
|
|
3376
|
+
return ret;
|
|
3377
|
+
},
|
|
3378
|
+
__wbg_parse_708461a1feddfb38: function() { return handleError(function (arg0, arg1) {
|
|
3379
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
3380
|
+
return addHeapObject(ret);
|
|
3381
|
+
}, arguments); },
|
|
3382
|
+
__wbg_performance_7a3ffd0b17f663ad: function(arg0) {
|
|
3383
|
+
const ret = getObject(arg0).performance;
|
|
3384
|
+
return addHeapObject(ret);
|
|
3385
|
+
},
|
|
3386
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
3387
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
3388
|
+
},
|
|
3389
|
+
__wbg_push_8ffdcb2063340ba5: function(arg0, arg1) {
|
|
3390
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
3391
|
+
return ret;
|
|
3392
|
+
},
|
|
3393
|
+
__wbg_set_1eb0999cf5d27fc8: function(arg0, arg1, arg2) {
|
|
3394
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
3395
|
+
return addHeapObject(ret);
|
|
3396
|
+
},
|
|
3397
|
+
__wbg_set_3fda3bac07393de4: function(arg0, arg1, arg2) {
|
|
3398
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
3399
|
+
},
|
|
3400
|
+
__wbg_set_6cb8631f80447a67: function() { return handleError(function (arg0, arg1, arg2) {
|
|
3401
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
3402
|
+
return ret;
|
|
3403
|
+
}, arguments); },
|
|
3404
|
+
__wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
|
|
3405
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
3406
|
+
},
|
|
3407
|
+
__wbg_stack_0ed75d68575b0f3c: function(arg0, arg1) {
|
|
3408
|
+
const ret = getObject(arg1).stack;
|
|
3409
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3410
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3411
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3412
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3413
|
+
},
|
|
3414
|
+
__wbg_static_accessor_GLOBAL_12837167ad935116: function() {
|
|
3415
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
3416
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3417
|
+
},
|
|
3418
|
+
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
|
|
3419
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
3420
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3421
|
+
},
|
|
3422
|
+
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
|
|
3423
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
3424
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3425
|
+
},
|
|
3426
|
+
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
|
|
3427
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
3428
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3429
|
+
},
|
|
3430
|
+
__wbg_value_0546255b415e96c1: function(arg0) {
|
|
3431
|
+
const ret = getObject(arg0).value;
|
|
3432
|
+
return addHeapObject(ret);
|
|
3433
|
+
},
|
|
3434
|
+
__wbg_warn_f7ae1b2e66ccb930: function(arg0) {
|
|
3435
|
+
console.warn(getObject(arg0));
|
|
3436
|
+
},
|
|
3437
|
+
__wbg_wasmcompilererror_new: function(arg0) {
|
|
3438
|
+
const ret = WasmCompilerError.__wrap(arg0);
|
|
3439
|
+
return addHeapObject(ret);
|
|
3440
|
+
},
|
|
3441
|
+
__wbg_wasmsuggestion_new: function(arg0) {
|
|
3442
|
+
const ret = WasmSuggestion.__wrap(arg0);
|
|
3443
|
+
return addHeapObject(ret);
|
|
3444
|
+
},
|
|
3445
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
3446
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
3447
|
+
const ret = arg0;
|
|
3448
|
+
return addHeapObject(ret);
|
|
3449
|
+
},
|
|
3450
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
3451
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
3452
|
+
const ret = arg0;
|
|
3453
|
+
return addHeapObject(ret);
|
|
3454
|
+
},
|
|
3455
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
3456
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
3457
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3458
|
+
return addHeapObject(ret);
|
|
3459
|
+
},
|
|
3460
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
3461
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
3462
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
3463
|
+
return addHeapObject(ret);
|
|
3464
|
+
},
|
|
3465
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
3466
|
+
const ret = getObject(arg0);
|
|
3467
|
+
return addHeapObject(ret);
|
|
3468
|
+
},
|
|
3469
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
3470
|
+
takeObject(arg0);
|
|
3471
|
+
},
|
|
3472
|
+
};
|
|
3473
|
+
return {
|
|
3474
|
+
__proto__: null,
|
|
3475
|
+
"./five_vm_wasm_bg.js": import0,
|
|
3476
|
+
};
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
const BytecodeAnalyzerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3480
|
+
? { register: () => {}, unregister: () => {} }
|
|
3481
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_bytecodeanalyzer_free(ptr >>> 0, 1));
|
|
3482
|
+
const BytecodeEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3483
|
+
? { register: () => {}, unregister: () => {} }
|
|
3484
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_bytecodeencoder_free(ptr >>> 0, 1));
|
|
3485
|
+
const FiveVMStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3486
|
+
? { register: () => {}, unregister: () => {} }
|
|
3487
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fivevmstate_free(ptr >>> 0, 1));
|
|
3488
|
+
const FiveVMWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3489
|
+
? { register: () => {}, unregister: () => {} }
|
|
3490
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fivevmwasm_free(ptr >>> 0, 1));
|
|
3491
|
+
const ParameterEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3492
|
+
? { register: () => {}, unregister: () => {} }
|
|
3493
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parameterencoder_free(ptr >>> 0, 1));
|
|
3494
|
+
const TestResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3495
|
+
? { register: () => {}, unregister: () => {} }
|
|
3496
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_testresult_free(ptr >>> 0, 1));
|
|
3497
|
+
const WasmAccountFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3498
|
+
? { register: () => {}, unregister: () => {} }
|
|
3499
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmaccount_free(ptr >>> 0, 1));
|
|
3500
|
+
const WasmAnalysisResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3501
|
+
? { register: () => {}, unregister: () => {} }
|
|
3502
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmanalysisresult_free(ptr >>> 0, 1));
|
|
3503
|
+
const WasmCompilationOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3504
|
+
? { register: () => {}, unregister: () => {} }
|
|
3505
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationoptions_free(ptr >>> 0, 1));
|
|
3506
|
+
const WasmCompilationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3507
|
+
? { register: () => {}, unregister: () => {} }
|
|
3508
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationresult_free(ptr >>> 0, 1));
|
|
3509
|
+
const WasmCompilationWithMetricsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3510
|
+
? { register: () => {}, unregister: () => {} }
|
|
3511
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationwithmetrics_free(ptr >>> 0, 1));
|
|
3512
|
+
const WasmCompilerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3513
|
+
? { register: () => {}, unregister: () => {} }
|
|
3514
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilererror_free(ptr >>> 0, 1));
|
|
3515
|
+
const WasmEnhancedCompilationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3516
|
+
? { register: () => {}, unregister: () => {} }
|
|
3517
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmenhancedcompilationresult_free(ptr >>> 0, 1));
|
|
3518
|
+
const WasmFiveCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3519
|
+
? { register: () => {}, unregister: () => {} }
|
|
3520
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmfivecompiler_free(ptr >>> 0, 1));
|
|
3521
|
+
const WasmMetricsCollectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3522
|
+
? { register: () => {}, unregister: () => {} }
|
|
3523
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetricscollector_free(ptr >>> 0, 1));
|
|
3524
|
+
const WasmSourceLocationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3525
|
+
? { register: () => {}, unregister: () => {} }
|
|
3526
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsourcelocation_free(ptr >>> 0, 1));
|
|
3527
|
+
const WasmSuggestionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3528
|
+
? { register: () => {}, unregister: () => {} }
|
|
3529
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsuggestion_free(ptr >>> 0, 1));
|
|
3530
|
+
|
|
3531
|
+
function addHeapObject(obj) {
|
|
3532
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
3533
|
+
const idx = heap_next;
|
|
3534
|
+
heap_next = heap[idx];
|
|
3535
|
+
|
|
3536
|
+
heap[idx] = obj;
|
|
3537
|
+
return idx;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
function _assertClass(instance, klass) {
|
|
3541
|
+
if (!(instance instanceof klass)) {
|
|
3542
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
function addBorrowedObject(obj) {
|
|
3547
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
3548
|
+
heap[--stack_pointer] = obj;
|
|
3549
|
+
return stack_pointer;
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
function debugString(val) {
|
|
3553
|
+
// primitive types
|
|
3554
|
+
const type = typeof val;
|
|
3555
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
3556
|
+
return `${val}`;
|
|
3557
|
+
}
|
|
3558
|
+
if (type == 'string') {
|
|
3559
|
+
return `"${val}"`;
|
|
3560
|
+
}
|
|
3561
|
+
if (type == 'symbol') {
|
|
3562
|
+
const description = val.description;
|
|
3563
|
+
if (description == null) {
|
|
3564
|
+
return 'Symbol';
|
|
3565
|
+
} else {
|
|
3566
|
+
return `Symbol(${description})`;
|
|
3567
|
+
}
|
|
3568
|
+
}
|
|
3569
|
+
if (type == 'function') {
|
|
3570
|
+
const name = val.name;
|
|
3571
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
3572
|
+
return `Function(${name})`;
|
|
3573
|
+
} else {
|
|
3574
|
+
return 'Function';
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
// objects
|
|
3578
|
+
if (Array.isArray(val)) {
|
|
3579
|
+
const length = val.length;
|
|
3580
|
+
let debug = '[';
|
|
3581
|
+
if (length > 0) {
|
|
3582
|
+
debug += debugString(val[0]);
|
|
3583
|
+
}
|
|
3584
|
+
for(let i = 1; i < length; i++) {
|
|
3585
|
+
debug += ', ' + debugString(val[i]);
|
|
3586
|
+
}
|
|
3587
|
+
debug += ']';
|
|
3588
|
+
return debug;
|
|
3589
|
+
}
|
|
3590
|
+
// Test for built-in
|
|
3591
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
3592
|
+
let className;
|
|
3593
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
3594
|
+
className = builtInMatches[1];
|
|
3595
|
+
} else {
|
|
3596
|
+
// Failed to match the standard '[object ClassName]'
|
|
3597
|
+
return toString.call(val);
|
|
3598
|
+
}
|
|
3599
|
+
if (className == 'Object') {
|
|
3600
|
+
// we're a user defined class or Object
|
|
3601
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
3602
|
+
// easier than looping through ownProperties of `val`.
|
|
3603
|
+
try {
|
|
3604
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
3605
|
+
} catch (_) {
|
|
3606
|
+
return 'Object';
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
// errors
|
|
3610
|
+
if (val instanceof Error) {
|
|
3611
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
3612
|
+
}
|
|
3613
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
3614
|
+
return className;
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
function dropObject(idx) {
|
|
3618
|
+
if (idx < 132) return;
|
|
3619
|
+
heap[idx] = heap_next;
|
|
3620
|
+
heap_next = idx;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
3624
|
+
ptr = ptr >>> 0;
|
|
3625
|
+
const mem = getDataViewMemory0();
|
|
3626
|
+
const result = [];
|
|
3627
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
3628
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
3629
|
+
}
|
|
3630
|
+
return result;
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
3634
|
+
ptr = ptr >>> 0;
|
|
3635
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
let cachedDataViewMemory0 = null;
|
|
3639
|
+
function getDataViewMemory0() {
|
|
3640
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
3641
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
3642
|
+
}
|
|
3643
|
+
return cachedDataViewMemory0;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
function getStringFromWasm0(ptr, len) {
|
|
3647
|
+
ptr = ptr >>> 0;
|
|
3648
|
+
return decodeText(ptr, len);
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
let cachedUint8ArrayMemory0 = null;
|
|
3652
|
+
function getUint8ArrayMemory0() {
|
|
3653
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
3654
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
3655
|
+
}
|
|
3656
|
+
return cachedUint8ArrayMemory0;
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3659
|
+
function getObject(idx) { return heap[idx]; }
|
|
3660
|
+
|
|
3661
|
+
function handleError(f, args) {
|
|
3662
|
+
try {
|
|
3663
|
+
return f.apply(this, args);
|
|
3664
|
+
} catch (e) {
|
|
3665
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
let heap = new Array(128).fill(undefined);
|
|
3670
|
+
heap.push(undefined, null, true, false);
|
|
3671
|
+
|
|
3672
|
+
let heap_next = heap.length;
|
|
3673
|
+
|
|
3674
|
+
function isLikeNone(x) {
|
|
3675
|
+
return x === undefined || x === null;
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
3679
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
3680
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
3681
|
+
WASM_VECTOR_LEN = arg.length;
|
|
3682
|
+
return ptr;
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
3686
|
+
if (realloc === undefined) {
|
|
3687
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
3688
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
3689
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
3690
|
+
WASM_VECTOR_LEN = buf.length;
|
|
3691
|
+
return ptr;
|
|
3692
|
+
}
|
|
3693
|
+
|
|
3694
|
+
let len = arg.length;
|
|
3695
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
3696
|
+
|
|
3697
|
+
const mem = getUint8ArrayMemory0();
|
|
3698
|
+
|
|
3699
|
+
let offset = 0;
|
|
3700
|
+
|
|
3701
|
+
for (; offset < len; offset++) {
|
|
3702
|
+
const code = arg.charCodeAt(offset);
|
|
3703
|
+
if (code > 0x7F) break;
|
|
3704
|
+
mem[ptr + offset] = code;
|
|
3705
|
+
}
|
|
3706
|
+
if (offset !== len) {
|
|
3707
|
+
if (offset !== 0) {
|
|
3708
|
+
arg = arg.slice(offset);
|
|
3709
|
+
}
|
|
3710
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
3711
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
3712
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
3713
|
+
|
|
3714
|
+
offset += ret.written;
|
|
3715
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3718
|
+
WASM_VECTOR_LEN = offset;
|
|
3719
|
+
return ptr;
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
let stack_pointer = 128;
|
|
3723
|
+
|
|
3724
|
+
function takeObject(idx) {
|
|
3725
|
+
const ret = getObject(idx);
|
|
3726
|
+
dropObject(idx);
|
|
3727
|
+
return ret;
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
3731
|
+
cachedTextDecoder.decode();
|
|
3732
|
+
function decodeText(ptr, len) {
|
|
3733
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
const cachedTextEncoder = new TextEncoder();
|
|
3737
|
+
|
|
3738
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
3739
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
3740
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
3741
|
+
view.set(buf);
|
|
3742
|
+
return {
|
|
3743
|
+
read: arg.length,
|
|
3744
|
+
written: buf.length
|
|
3745
|
+
};
|
|
3746
|
+
};
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
let WASM_VECTOR_LEN = 0;
|
|
3750
|
+
|
|
3751
|
+
const wasmPath = `${__dirname}/five_vm_wasm_bg.wasm`;
|
|
3752
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
3753
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
3754
|
+
const wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|