@fluffylabs/anan-as 1.1.6-38dddc8 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/compiler-inline.js +1 -1
- package/dist/build/compiler.wasm +0 -0
- package/dist/build/debug-inline.js +1 -1
- package/dist/build/debug-raw-inline.js +1 -1
- package/dist/build/debug-raw.d.ts +20 -11
- package/dist/build/debug-raw.js +33 -19
- package/dist/build/debug-raw.wasm +0 -0
- package/dist/build/debug.d.ts +20 -11
- package/dist/build/debug.js +33 -19
- package/dist/build/debug.wasm +0 -0
- package/dist/build/release-inline.js +1 -1
- package/dist/build/release-mini-inline.js +1 -1
- package/dist/build/release-mini.d.ts +20 -11
- package/dist/build/release-mini.js +33 -19
- package/dist/build/release-mini.wasm +0 -0
- package/dist/build/release-stub-inline.js +1 -1
- package/dist/build/release-stub.d.ts +20 -11
- package/dist/build/release-stub.js +33 -19
- package/dist/build/release-stub.wasm +0 -0
- package/dist/build/release.d.ts +20 -11
- package/dist/build/release.js +33 -19
- package/dist/build/release.wasm +0 -0
- package/dist/test/test-w3f.js +1 -1
- package/package.json +2 -2
|
@@ -123,11 +123,10 @@ declare namespace __AdaptedExports {
|
|
|
123
123
|
/**
|
|
124
124
|
* assembly/api-internal/vmRunOnce
|
|
125
125
|
* @param input `assembly/api-types/VmInput`
|
|
126
|
-
* @param
|
|
127
|
-
* @param useSbrkGas `bool`
|
|
126
|
+
* @param options `assembly/api-types/VmRunOptions`
|
|
128
127
|
* @returns `assembly/api-types/VmOutput`
|
|
129
128
|
*/
|
|
130
|
-
export function vmRunOnce(input: __Internref49,
|
|
129
|
+
export function vmRunOnce(input: __Internref49, options: __Record50<undefined>): __Record51<never>;
|
|
131
130
|
/**
|
|
132
131
|
* assembly/api-internal/vmExecute
|
|
133
132
|
* @param int `assembly/interpreter/Interpreter`
|
|
@@ -140,7 +139,7 @@ declare namespace __AdaptedExports {
|
|
|
140
139
|
* @param dumpMemory `bool`
|
|
141
140
|
* @returns `assembly/api-types/VmOutput`
|
|
142
141
|
*/
|
|
143
|
-
export function vmDestroy(int: __Internref25, dumpMemory?: boolean):
|
|
142
|
+
export function vmDestroy(int: __Internref25, dumpMemory?: boolean): __Record51<never>;
|
|
144
143
|
/** assembly/api-utils/InputKind */
|
|
145
144
|
export enum InputKind {
|
|
146
145
|
/** @type `i32` */
|
|
@@ -162,7 +161,7 @@ declare namespace __AdaptedExports {
|
|
|
162
161
|
* @param withMetadata `i32`
|
|
163
162
|
* @returns `~lib/array/Array<assembly/gas-costs/BlockGasCost>`
|
|
164
163
|
*/
|
|
165
|
-
export function getGasCosts(input: Array<number>, kind: number, withMetadata: number): Array<
|
|
164
|
+
export function getGasCosts(input: Array<number>, kind: number, withMetadata: number): Array<__Record56<never>>;
|
|
166
165
|
/**
|
|
167
166
|
* assembly/api-utils/disassemble
|
|
168
167
|
* @param input `~lib/array/Array<u8>`
|
|
@@ -191,9 +190,10 @@ declare namespace __AdaptedExports {
|
|
|
191
190
|
* @param programCounter `u32`
|
|
192
191
|
* @param logs `bool`
|
|
193
192
|
* @param useSbrkGas `bool`
|
|
193
|
+
* @param dumpMemory `bool`
|
|
194
194
|
* @returns `assembly/api-types/VmOutput`
|
|
195
195
|
*/
|
|
196
|
-
export function runProgram(program: __Internref40, initialGas?: bigint, programCounter?: number, logs?: boolean, useSbrkGas?: boolean):
|
|
196
|
+
export function runProgram(program: __Internref40, initialGas?: bigint, programCounter?: number, logs?: boolean, useSbrkGas?: boolean, dumpMemory?: boolean): __Record51<never>;
|
|
197
197
|
/**
|
|
198
198
|
* assembly/api-utils/pvmStart
|
|
199
199
|
* @param program `assembly/spi/StandardProgram`
|
|
@@ -206,7 +206,7 @@ declare namespace __AdaptedExports {
|
|
|
206
206
|
* @param pvmId `u32`
|
|
207
207
|
* @returns `assembly/api-types/VmOutput | null`
|
|
208
208
|
*/
|
|
209
|
-
export function pvmDestroy(pvmId: number):
|
|
209
|
+
export function pvmDestroy(pvmId: number): __Record51<never> | null;
|
|
210
210
|
/**
|
|
211
211
|
* assembly/api-utils/pvmSetRegisters
|
|
212
212
|
* @param pvmId `u32`
|
|
@@ -237,7 +237,7 @@ declare namespace __AdaptedExports {
|
|
|
237
237
|
* @param logs `bool`
|
|
238
238
|
* @returns `assembly/api-types/VmPause | null`
|
|
239
239
|
*/
|
|
240
|
-
export function pvmResume(pvmId: number, gas: bigint, pc: number, logs?: boolean):
|
|
240
|
+
export function pvmResume(pvmId: number, gas: bigint, pc: number, logs?: boolean): __Record60<never> | null;
|
|
241
241
|
/**
|
|
242
242
|
* assembly/program-build/wrapAsProgram
|
|
243
243
|
* @param bytecode `~lib/typedarray/Uint8Array`
|
|
@@ -286,8 +286,17 @@ declare class __Internref25 extends Number {
|
|
|
286
286
|
private __nominal25: symbol;
|
|
287
287
|
private __nominal0: symbol;
|
|
288
288
|
}
|
|
289
|
-
/** assembly/api-types/
|
|
289
|
+
/** assembly/api-types/VmRunOptions */
|
|
290
290
|
declare interface __Record50<TOmittable> {
|
|
291
|
+
/** @type `bool` */
|
|
292
|
+
useSbrkGas: boolean | TOmittable;
|
|
293
|
+
/** @type `bool` */
|
|
294
|
+
logs: boolean | TOmittable;
|
|
295
|
+
/** @type `bool` */
|
|
296
|
+
dumpMemory: boolean | TOmittable;
|
|
297
|
+
}
|
|
298
|
+
/** assembly/api-types/VmOutput */
|
|
299
|
+
declare interface __Record51<TOmittable> {
|
|
291
300
|
/** @type `i32` */
|
|
292
301
|
status: number | TOmittable;
|
|
293
302
|
/** @type `u32` */
|
|
@@ -304,7 +313,7 @@ declare interface __Record50<TOmittable> {
|
|
|
304
313
|
memory: Array<__Record46<never>>;
|
|
305
314
|
}
|
|
306
315
|
/** assembly/gas-costs/BlockGasCost */
|
|
307
|
-
declare interface
|
|
316
|
+
declare interface __Record56<TOmittable> {
|
|
308
317
|
/** @type `u32` */
|
|
309
318
|
pc: number | TOmittable;
|
|
310
319
|
/** @type `u64` */
|
|
@@ -316,7 +325,7 @@ declare class __Internref40 extends Number {
|
|
|
316
325
|
private __nominal0: symbol;
|
|
317
326
|
}
|
|
318
327
|
/** assembly/api-types/VmPause */
|
|
319
|
-
declare interface
|
|
328
|
+
declare interface __Record60<TOmittable> {
|
|
320
329
|
/** @type `i32` */
|
|
321
330
|
status: number | TOmittable;
|
|
322
331
|
/** @type `u32` */
|
package/dist/build/debug-raw.js
CHANGED
|
@@ -132,13 +132,15 @@ export async function instantiate(module, imports = {}) {
|
|
|
132
132
|
exports.__setArgumentsLength(arguments.length);
|
|
133
133
|
return __liftInternref(exports.vmInit(input, useSbrkGas) >>> 0);
|
|
134
134
|
},
|
|
135
|
-
vmRunOnce(input,
|
|
136
|
-
// assembly/api-internal/vmRunOnce(assembly/api-types/VmInput,
|
|
137
|
-
input = __lowerInternref(input) || __notnull();
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
vmRunOnce(input, options) {
|
|
136
|
+
// assembly/api-internal/vmRunOnce(assembly/api-types/VmInput, assembly/api-types/VmRunOptions) => assembly/api-types/VmOutput
|
|
137
|
+
input = __retain(__lowerInternref(input) || __notnull());
|
|
138
|
+
options = __lowerRecord50(options) || __notnull();
|
|
139
|
+
try {
|
|
140
|
+
return __liftRecord51(exports.vmRunOnce(input, options) >>> 0);
|
|
141
|
+
} finally {
|
|
142
|
+
__release(input);
|
|
143
|
+
}
|
|
142
144
|
},
|
|
143
145
|
vmExecute(int, logs) {
|
|
144
146
|
// assembly/api-internal/vmExecute(assembly/interpreter/Interpreter, bool?) => void
|
|
@@ -152,7 +154,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
152
154
|
int = __lowerInternref(int) || __notnull();
|
|
153
155
|
dumpMemory = dumpMemory ? 1 : 0;
|
|
154
156
|
exports.__setArgumentsLength(arguments.length);
|
|
155
|
-
return
|
|
157
|
+
return __liftRecord51(exports.vmDestroy(int, dumpMemory) >>> 0);
|
|
156
158
|
},
|
|
157
159
|
InputKind: (values => (
|
|
158
160
|
// assembly/api-utils/InputKind
|
|
@@ -169,7 +171,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
169
171
|
getGasCosts(input, kind, withMetadata) {
|
|
170
172
|
// assembly/api-utils/getGasCosts(~lib/array/Array<u8>, i32, i32) => ~lib/array/Array<assembly/gas-costs/BlockGasCost>
|
|
171
173
|
input = __lowerArray(__setU8, 6, 0, input) || __notnull();
|
|
172
|
-
return __liftArray(pointer =>
|
|
174
|
+
return __liftArray(pointer => __liftRecord56(__getU32(pointer)), 2, exports.getGasCosts(input, kind, withMetadata) >>> 0);
|
|
173
175
|
},
|
|
174
176
|
disassemble(input, kind, withMetadata) {
|
|
175
177
|
// assembly/api-utils/disassemble(~lib/array/Array<u8>, i32, i32) => ~lib/string/String
|
|
@@ -179,7 +181,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
179
181
|
prepareProgram(kind, hasMetadata, program, initialRegisters, initialPageMap, initialMemory, args, preallocateMemoryPages) {
|
|
180
182
|
// assembly/api-utils/prepareProgram(i32, i32, ~lib/array/Array<u8>, ~lib/array/Array<u64>, ~lib/array/Array<assembly/api-types/InitialPage>, ~lib/array/Array<assembly/api-types/InitialChunk>, ~lib/array/Array<u8>, u32) => assembly/spi/StandardProgram
|
|
181
183
|
program = __retain(__lowerArray(__setU8, 6, 0, program) || __notnull());
|
|
182
|
-
initialRegisters = __retain(__lowerArray(__setU64,
|
|
184
|
+
initialRegisters = __retain(__lowerArray(__setU64, 52, 3, initialRegisters) || __notnull());
|
|
183
185
|
initialPageMap = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord44(value) || __notnull()); }, 45, 2, initialPageMap) || __notnull());
|
|
184
186
|
initialMemory = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord46(value) || __notnull()); }, 47, 2, initialMemory) || __notnull());
|
|
185
187
|
args = __lowerArray(__setU8, 6, 0, args) || __notnull();
|
|
@@ -192,14 +194,15 @@ export async function instantiate(module, imports = {}) {
|
|
|
192
194
|
__release(initialMemory);
|
|
193
195
|
}
|
|
194
196
|
},
|
|
195
|
-
runProgram(program, initialGas, programCounter, logs, useSbrkGas) {
|
|
196
|
-
// assembly/api-utils/runProgram(assembly/spi/StandardProgram, i64?, u32?, bool?, bool?) => assembly/api-types/VmOutput
|
|
197
|
+
runProgram(program, initialGas, programCounter, logs, useSbrkGas, dumpMemory) {
|
|
198
|
+
// assembly/api-utils/runProgram(assembly/spi/StandardProgram, i64?, u32?, bool?, bool?, bool?) => assembly/api-types/VmOutput
|
|
197
199
|
program = __lowerInternref(program) || __notnull();
|
|
198
200
|
initialGas = initialGas || 0n;
|
|
199
201
|
logs = logs ? 1 : 0;
|
|
200
202
|
useSbrkGas = useSbrkGas ? 1 : 0;
|
|
203
|
+
dumpMemory = dumpMemory ? 1 : 0;
|
|
201
204
|
exports.__setArgumentsLength(arguments.length);
|
|
202
|
-
return
|
|
205
|
+
return __liftRecord51(exports.runProgram(program, initialGas, programCounter, logs, useSbrkGas, dumpMemory) >>> 0);
|
|
203
206
|
},
|
|
204
207
|
pvmStart(program, useSbrkGas) {
|
|
205
208
|
// assembly/api-utils/pvmStart(assembly/spi/StandardProgram, bool?) => u32
|
|
@@ -210,11 +213,11 @@ export async function instantiate(module, imports = {}) {
|
|
|
210
213
|
},
|
|
211
214
|
pvmDestroy(pvmId) {
|
|
212
215
|
// assembly/api-utils/pvmDestroy(u32) => assembly/api-types/VmOutput | null
|
|
213
|
-
return
|
|
216
|
+
return __liftRecord51(exports.pvmDestroy(pvmId) >>> 0);
|
|
214
217
|
},
|
|
215
218
|
pvmSetRegisters(pvmId, registers) {
|
|
216
219
|
// assembly/api-utils/pvmSetRegisters(u32, ~lib/array/Array<u64>) => void
|
|
217
|
-
registers = __lowerArray(__setU64,
|
|
220
|
+
registers = __lowerArray(__setU64, 52, 3, registers) || __notnull();
|
|
218
221
|
exports.pvmSetRegisters(pvmId, registers);
|
|
219
222
|
},
|
|
220
223
|
pvmReadMemory(pvmId, address, length) {
|
|
@@ -231,7 +234,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
231
234
|
gas = gas || 0n;
|
|
232
235
|
logs = logs ? 1 : 0;
|
|
233
236
|
exports.__setArgumentsLength(arguments.length);
|
|
234
|
-
return
|
|
237
|
+
return __liftRecord60(exports.pvmResume(pvmId, gas, pc, logs) >>> 0);
|
|
235
238
|
},
|
|
236
239
|
wrapAsProgram(bytecode) {
|
|
237
240
|
// assembly/program-build/wrapAsProgram(~lib/typedarray/Uint8Array) => ~lib/typedarray/Uint8Array
|
|
@@ -260,6 +263,17 @@ export async function instantiate(module, imports = {}) {
|
|
|
260
263
|
exports.__unpin(pointer);
|
|
261
264
|
return pointer;
|
|
262
265
|
}
|
|
266
|
+
function __lowerRecord50(value) {
|
|
267
|
+
// assembly/api-types/VmRunOptions
|
|
268
|
+
// Hint: Opt-out from lowering as a record by providing an empty constructor
|
|
269
|
+
if (value == null) return 0;
|
|
270
|
+
const pointer = exports.__pin(exports.__new(3, 50));
|
|
271
|
+
__setU8(pointer + 0, value.useSbrkGas ? 1 : 0);
|
|
272
|
+
__setU8(pointer + 1, value.logs ? 1 : 0);
|
|
273
|
+
__setU8(pointer + 2, value.dumpMemory ? 1 : 0);
|
|
274
|
+
exports.__unpin(pointer);
|
|
275
|
+
return pointer;
|
|
276
|
+
}
|
|
263
277
|
function __liftRecord46(pointer) {
|
|
264
278
|
// assembly/api-types/InitialChunk
|
|
265
279
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
@@ -269,7 +283,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
269
283
|
data: __liftArray(__getU8, 0, __getU32(pointer + 4)),
|
|
270
284
|
};
|
|
271
285
|
}
|
|
272
|
-
function
|
|
286
|
+
function __liftRecord51(pointer) {
|
|
273
287
|
// assembly/api-types/VmOutput
|
|
274
288
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
275
289
|
if (!pointer) return null;
|
|
@@ -283,7 +297,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
283
297
|
memory: __liftArray(pointer => __liftRecord46(__getU32(pointer)), 2, __getU32(pointer + 32)),
|
|
284
298
|
};
|
|
285
299
|
}
|
|
286
|
-
function
|
|
300
|
+
function __liftRecord56(pointer) {
|
|
287
301
|
// assembly/gas-costs/BlockGasCost
|
|
288
302
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
289
303
|
if (!pointer) return null;
|
|
@@ -292,7 +306,7 @@ export async function instantiate(module, imports = {}) {
|
|
|
292
306
|
gas: __getU64(pointer + 8),
|
|
293
307
|
};
|
|
294
308
|
}
|
|
295
|
-
function
|
|
309
|
+
function __liftRecord60(pointer) {
|
|
296
310
|
// assembly/api-types/VmPause
|
|
297
311
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
298
312
|
if (!pointer) return null;
|
|
Binary file
|
package/dist/build/debug.d.ts
CHANGED
|
@@ -122,11 +122,10 @@ export declare function vmInit(input: __Internref49, useSbrkGas?: boolean): __In
|
|
|
122
122
|
/**
|
|
123
123
|
* assembly/api-internal/vmRunOnce
|
|
124
124
|
* @param input `assembly/api-types/VmInput`
|
|
125
|
-
* @param
|
|
126
|
-
* @param useSbrkGas `bool`
|
|
125
|
+
* @param options `assembly/api-types/VmRunOptions`
|
|
127
126
|
* @returns `assembly/api-types/VmOutput`
|
|
128
127
|
*/
|
|
129
|
-
export declare function vmRunOnce(input: __Internref49,
|
|
128
|
+
export declare function vmRunOnce(input: __Internref49, options: __Record50<undefined>): __Record51<never>;
|
|
130
129
|
/**
|
|
131
130
|
* assembly/api-internal/vmExecute
|
|
132
131
|
* @param int `assembly/interpreter/Interpreter`
|
|
@@ -139,7 +138,7 @@ export declare function vmExecute(int: __Internref25, logs?: boolean): void;
|
|
|
139
138
|
* @param dumpMemory `bool`
|
|
140
139
|
* @returns `assembly/api-types/VmOutput`
|
|
141
140
|
*/
|
|
142
|
-
export declare function vmDestroy(int: __Internref25, dumpMemory?: boolean):
|
|
141
|
+
export declare function vmDestroy(int: __Internref25, dumpMemory?: boolean): __Record51<never>;
|
|
143
142
|
/** assembly/api-utils/InputKind */
|
|
144
143
|
export declare enum InputKind {
|
|
145
144
|
/** @type `i32` */
|
|
@@ -161,7 +160,7 @@ export declare enum HasMetadata {
|
|
|
161
160
|
* @param withMetadata `i32`
|
|
162
161
|
* @returns `~lib/array/Array<assembly/gas-costs/BlockGasCost>`
|
|
163
162
|
*/
|
|
164
|
-
export declare function getGasCosts(input: Array<number>, kind: number, withMetadata: number): Array<
|
|
163
|
+
export declare function getGasCosts(input: Array<number>, kind: number, withMetadata: number): Array<__Record56<never>>;
|
|
165
164
|
/**
|
|
166
165
|
* assembly/api-utils/disassemble
|
|
167
166
|
* @param input `~lib/array/Array<u8>`
|
|
@@ -190,9 +189,10 @@ export declare function prepareProgram(kind: number, hasMetadata: number, progra
|
|
|
190
189
|
* @param programCounter `u32`
|
|
191
190
|
* @param logs `bool`
|
|
192
191
|
* @param useSbrkGas `bool`
|
|
192
|
+
* @param dumpMemory `bool`
|
|
193
193
|
* @returns `assembly/api-types/VmOutput`
|
|
194
194
|
*/
|
|
195
|
-
export declare function runProgram(program: __Internref40, initialGas?: bigint, programCounter?: number, logs?: boolean, useSbrkGas?: boolean):
|
|
195
|
+
export declare function runProgram(program: __Internref40, initialGas?: bigint, programCounter?: number, logs?: boolean, useSbrkGas?: boolean, dumpMemory?: boolean): __Record51<never>;
|
|
196
196
|
/**
|
|
197
197
|
* assembly/api-utils/pvmStart
|
|
198
198
|
* @param program `assembly/spi/StandardProgram`
|
|
@@ -205,7 +205,7 @@ export declare function pvmStart(program: __Internref40, useSbrkGas?: boolean):
|
|
|
205
205
|
* @param pvmId `u32`
|
|
206
206
|
* @returns `assembly/api-types/VmOutput | null`
|
|
207
207
|
*/
|
|
208
|
-
export declare function pvmDestroy(pvmId: number):
|
|
208
|
+
export declare function pvmDestroy(pvmId: number): __Record51<never> | null;
|
|
209
209
|
/**
|
|
210
210
|
* assembly/api-utils/pvmSetRegisters
|
|
211
211
|
* @param pvmId `u32`
|
|
@@ -236,7 +236,7 @@ export declare function pvmWriteMemory(pvmId: number, address: number, data: Uin
|
|
|
236
236
|
* @param logs `bool`
|
|
237
237
|
* @returns `assembly/api-types/VmPause | null`
|
|
238
238
|
*/
|
|
239
|
-
export declare function pvmResume(pvmId: number, gas: bigint, pc: number, logs?: boolean):
|
|
239
|
+
export declare function pvmResume(pvmId: number, gas: bigint, pc: number, logs?: boolean): __Record60<never> | null;
|
|
240
240
|
/**
|
|
241
241
|
* assembly/program-build/wrapAsProgram
|
|
242
242
|
* @param bytecode `~lib/typedarray/Uint8Array`
|
|
@@ -284,8 +284,17 @@ declare class __Internref25 extends Number {
|
|
|
284
284
|
private __nominal25: symbol;
|
|
285
285
|
private __nominal0: symbol;
|
|
286
286
|
}
|
|
287
|
-
/** assembly/api-types/
|
|
287
|
+
/** assembly/api-types/VmRunOptions */
|
|
288
288
|
declare interface __Record50<TOmittable> {
|
|
289
|
+
/** @type `bool` */
|
|
290
|
+
useSbrkGas: boolean | TOmittable;
|
|
291
|
+
/** @type `bool` */
|
|
292
|
+
logs: boolean | TOmittable;
|
|
293
|
+
/** @type `bool` */
|
|
294
|
+
dumpMemory: boolean | TOmittable;
|
|
295
|
+
}
|
|
296
|
+
/** assembly/api-types/VmOutput */
|
|
297
|
+
declare interface __Record51<TOmittable> {
|
|
289
298
|
/** @type `i32` */
|
|
290
299
|
status: number | TOmittable;
|
|
291
300
|
/** @type `u32` */
|
|
@@ -302,7 +311,7 @@ declare interface __Record50<TOmittable> {
|
|
|
302
311
|
memory: Array<__Record46<never>>;
|
|
303
312
|
}
|
|
304
313
|
/** assembly/gas-costs/BlockGasCost */
|
|
305
|
-
declare interface
|
|
314
|
+
declare interface __Record56<TOmittable> {
|
|
306
315
|
/** @type `u32` */
|
|
307
316
|
pc: number | TOmittable;
|
|
308
317
|
/** @type `u64` */
|
|
@@ -314,7 +323,7 @@ declare class __Internref40 extends Number {
|
|
|
314
323
|
private __nominal0: symbol;
|
|
315
324
|
}
|
|
316
325
|
/** assembly/api-types/VmPause */
|
|
317
|
-
declare interface
|
|
326
|
+
declare interface __Record60<TOmittable> {
|
|
318
327
|
/** @type `i32` */
|
|
319
328
|
status: number | TOmittable;
|
|
320
329
|
/** @type `u32` */
|
package/dist/build/debug.js
CHANGED
|
@@ -132,13 +132,15 @@ async function instantiate(module, imports = {}) {
|
|
|
132
132
|
exports.__setArgumentsLength(arguments.length);
|
|
133
133
|
return __liftInternref(exports.vmInit(input, useSbrkGas) >>> 0);
|
|
134
134
|
},
|
|
135
|
-
vmRunOnce(input,
|
|
136
|
-
// assembly/api-internal/vmRunOnce(assembly/api-types/VmInput,
|
|
137
|
-
input = __lowerInternref(input) || __notnull();
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
vmRunOnce(input, options) {
|
|
136
|
+
// assembly/api-internal/vmRunOnce(assembly/api-types/VmInput, assembly/api-types/VmRunOptions) => assembly/api-types/VmOutput
|
|
137
|
+
input = __retain(__lowerInternref(input) || __notnull());
|
|
138
|
+
options = __lowerRecord50(options) || __notnull();
|
|
139
|
+
try {
|
|
140
|
+
return __liftRecord51(exports.vmRunOnce(input, options) >>> 0);
|
|
141
|
+
} finally {
|
|
142
|
+
__release(input);
|
|
143
|
+
}
|
|
142
144
|
},
|
|
143
145
|
vmExecute(int, logs) {
|
|
144
146
|
// assembly/api-internal/vmExecute(assembly/interpreter/Interpreter, bool?) => void
|
|
@@ -152,7 +154,7 @@ async function instantiate(module, imports = {}) {
|
|
|
152
154
|
int = __lowerInternref(int) || __notnull();
|
|
153
155
|
dumpMemory = dumpMemory ? 1 : 0;
|
|
154
156
|
exports.__setArgumentsLength(arguments.length);
|
|
155
|
-
return
|
|
157
|
+
return __liftRecord51(exports.vmDestroy(int, dumpMemory) >>> 0);
|
|
156
158
|
},
|
|
157
159
|
InputKind: (values => (
|
|
158
160
|
// assembly/api-utils/InputKind
|
|
@@ -169,7 +171,7 @@ async function instantiate(module, imports = {}) {
|
|
|
169
171
|
getGasCosts(input, kind, withMetadata) {
|
|
170
172
|
// assembly/api-utils/getGasCosts(~lib/array/Array<u8>, i32, i32) => ~lib/array/Array<assembly/gas-costs/BlockGasCost>
|
|
171
173
|
input = __lowerArray(__setU8, 6, 0, input) || __notnull();
|
|
172
|
-
return __liftArray(pointer =>
|
|
174
|
+
return __liftArray(pointer => __liftRecord56(__getU32(pointer)), 2, exports.getGasCosts(input, kind, withMetadata) >>> 0);
|
|
173
175
|
},
|
|
174
176
|
disassemble(input, kind, withMetadata) {
|
|
175
177
|
// assembly/api-utils/disassemble(~lib/array/Array<u8>, i32, i32) => ~lib/string/String
|
|
@@ -179,7 +181,7 @@ async function instantiate(module, imports = {}) {
|
|
|
179
181
|
prepareProgram(kind, hasMetadata, program, initialRegisters, initialPageMap, initialMemory, args, preallocateMemoryPages) {
|
|
180
182
|
// assembly/api-utils/prepareProgram(i32, i32, ~lib/array/Array<u8>, ~lib/array/Array<u64>, ~lib/array/Array<assembly/api-types/InitialPage>, ~lib/array/Array<assembly/api-types/InitialChunk>, ~lib/array/Array<u8>, u32) => assembly/spi/StandardProgram
|
|
181
183
|
program = __retain(__lowerArray(__setU8, 6, 0, program) || __notnull());
|
|
182
|
-
initialRegisters = __retain(__lowerArray(__setU64,
|
|
184
|
+
initialRegisters = __retain(__lowerArray(__setU64, 52, 3, initialRegisters) || __notnull());
|
|
183
185
|
initialPageMap = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord44(value) || __notnull()); }, 45, 2, initialPageMap) || __notnull());
|
|
184
186
|
initialMemory = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord46(value) || __notnull()); }, 47, 2, initialMemory) || __notnull());
|
|
185
187
|
args = __lowerArray(__setU8, 6, 0, args) || __notnull();
|
|
@@ -192,14 +194,15 @@ async function instantiate(module, imports = {}) {
|
|
|
192
194
|
__release(initialMemory);
|
|
193
195
|
}
|
|
194
196
|
},
|
|
195
|
-
runProgram(program, initialGas, programCounter, logs, useSbrkGas) {
|
|
196
|
-
// assembly/api-utils/runProgram(assembly/spi/StandardProgram, i64?, u32?, bool?, bool?) => assembly/api-types/VmOutput
|
|
197
|
+
runProgram(program, initialGas, programCounter, logs, useSbrkGas, dumpMemory) {
|
|
198
|
+
// assembly/api-utils/runProgram(assembly/spi/StandardProgram, i64?, u32?, bool?, bool?, bool?) => assembly/api-types/VmOutput
|
|
197
199
|
program = __lowerInternref(program) || __notnull();
|
|
198
200
|
initialGas = initialGas || 0n;
|
|
199
201
|
logs = logs ? 1 : 0;
|
|
200
202
|
useSbrkGas = useSbrkGas ? 1 : 0;
|
|
203
|
+
dumpMemory = dumpMemory ? 1 : 0;
|
|
201
204
|
exports.__setArgumentsLength(arguments.length);
|
|
202
|
-
return
|
|
205
|
+
return __liftRecord51(exports.runProgram(program, initialGas, programCounter, logs, useSbrkGas, dumpMemory) >>> 0);
|
|
203
206
|
},
|
|
204
207
|
pvmStart(program, useSbrkGas) {
|
|
205
208
|
// assembly/api-utils/pvmStart(assembly/spi/StandardProgram, bool?) => u32
|
|
@@ -210,11 +213,11 @@ async function instantiate(module, imports = {}) {
|
|
|
210
213
|
},
|
|
211
214
|
pvmDestroy(pvmId) {
|
|
212
215
|
// assembly/api-utils/pvmDestroy(u32) => assembly/api-types/VmOutput | null
|
|
213
|
-
return
|
|
216
|
+
return __liftRecord51(exports.pvmDestroy(pvmId) >>> 0);
|
|
214
217
|
},
|
|
215
218
|
pvmSetRegisters(pvmId, registers) {
|
|
216
219
|
// assembly/api-utils/pvmSetRegisters(u32, ~lib/array/Array<u64>) => void
|
|
217
|
-
registers = __lowerArray(__setU64,
|
|
220
|
+
registers = __lowerArray(__setU64, 52, 3, registers) || __notnull();
|
|
218
221
|
exports.pvmSetRegisters(pvmId, registers);
|
|
219
222
|
},
|
|
220
223
|
pvmReadMemory(pvmId, address, length) {
|
|
@@ -231,7 +234,7 @@ async function instantiate(module, imports = {}) {
|
|
|
231
234
|
gas = gas || 0n;
|
|
232
235
|
logs = logs ? 1 : 0;
|
|
233
236
|
exports.__setArgumentsLength(arguments.length);
|
|
234
|
-
return
|
|
237
|
+
return __liftRecord60(exports.pvmResume(pvmId, gas, pc, logs) >>> 0);
|
|
235
238
|
},
|
|
236
239
|
wrapAsProgram(bytecode) {
|
|
237
240
|
// assembly/program-build/wrapAsProgram(~lib/typedarray/Uint8Array) => ~lib/typedarray/Uint8Array
|
|
@@ -260,6 +263,17 @@ async function instantiate(module, imports = {}) {
|
|
|
260
263
|
exports.__unpin(pointer);
|
|
261
264
|
return pointer;
|
|
262
265
|
}
|
|
266
|
+
function __lowerRecord50(value) {
|
|
267
|
+
// assembly/api-types/VmRunOptions
|
|
268
|
+
// Hint: Opt-out from lowering as a record by providing an empty constructor
|
|
269
|
+
if (value == null) return 0;
|
|
270
|
+
const pointer = exports.__pin(exports.__new(3, 50));
|
|
271
|
+
__setU8(pointer + 0, value.useSbrkGas ? 1 : 0);
|
|
272
|
+
__setU8(pointer + 1, value.logs ? 1 : 0);
|
|
273
|
+
__setU8(pointer + 2, value.dumpMemory ? 1 : 0);
|
|
274
|
+
exports.__unpin(pointer);
|
|
275
|
+
return pointer;
|
|
276
|
+
}
|
|
263
277
|
function __liftRecord46(pointer) {
|
|
264
278
|
// assembly/api-types/InitialChunk
|
|
265
279
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
@@ -269,7 +283,7 @@ async function instantiate(module, imports = {}) {
|
|
|
269
283
|
data: __liftArray(__getU8, 0, __getU32(pointer + 4)),
|
|
270
284
|
};
|
|
271
285
|
}
|
|
272
|
-
function
|
|
286
|
+
function __liftRecord51(pointer) {
|
|
273
287
|
// assembly/api-types/VmOutput
|
|
274
288
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
275
289
|
if (!pointer) return null;
|
|
@@ -283,7 +297,7 @@ async function instantiate(module, imports = {}) {
|
|
|
283
297
|
memory: __liftArray(pointer => __liftRecord46(__getU32(pointer)), 2, __getU32(pointer + 32)),
|
|
284
298
|
};
|
|
285
299
|
}
|
|
286
|
-
function
|
|
300
|
+
function __liftRecord56(pointer) {
|
|
287
301
|
// assembly/gas-costs/BlockGasCost
|
|
288
302
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
289
303
|
if (!pointer) return null;
|
|
@@ -292,7 +306,7 @@ async function instantiate(module, imports = {}) {
|
|
|
292
306
|
gas: __getU64(pointer + 8),
|
|
293
307
|
};
|
|
294
308
|
}
|
|
295
|
-
function
|
|
309
|
+
function __liftRecord60(pointer) {
|
|
296
310
|
// assembly/api-types/VmPause
|
|
297
311
|
// Hint: Opt-out from lifting as a record by providing an empty constructor
|
|
298
312
|
if (!pointer) return null;
|
package/dist/build/debug.wasm
CHANGED
|
Binary file
|