diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts new file mode 100644 index 00000000..c6bd75e9 --- /dev/null +++ b/std/assembly/bindings/wasi.ts @@ -0,0 +1 @@ +export * from "./wasi_unstable"; diff --git a/std/assembly/bindings/wasi_unstable.ts b/std/assembly/bindings/wasi_unstable.ts new file mode 100644 index 00000000..d5c8e799 --- /dev/null +++ b/std/assembly/bindings/wasi_unstable.ts @@ -0,0 +1,1449 @@ +// see: https://wasi.dev + +/* tslint:disable:max-line-length */ + +// helper types to be more explicit +type char = u8; +type ptr = usize; // all pointers are usize'd +type struct = T; // structs are references already in AS + +/** Read command-line argument data. */ +export declare function args_get( + /** Input: Pointer to a buffer to write the argument pointers. */ + argv: ptr>, + /** Input: Pointer to a buffer to write the argument string data. */ + argv_buf: ptr +): errno; + +/** Return command-line argument data sizes. */ +export declare function args_sizes_get( + /** Output: Number of arguments. */ + argc: ptr, + /** Output: Size of the argument string data. */ + argv_buf_size: ptr +): errno; + +/** Return the resolution of a clock. */ +export declare function clock_res_get( + /** Input: The clock for which to return the resolution. */ + clock: clockid, + /** Output: The resolution of the clock. */ + resolution: ptr +): errno; + +/** Return the time value of a clock. */ +export declare function clock_time_get( + /** Input: Cock for which to return the time. */ + clock: clockid, + /** Input: Maximum lag (exclusive) that the returned time value may have, compared to its actual value. */ + precision: timestamp, + /** Output: Time value of the clock. */ + time: ptr +): errno; + +/** Read environment variable data. */ +export declare function environ_get( + /** Input: Pointer to a buffer to write the environment variable pointers. */ + environ: ptr, + /** Input: Pointer to a buffer to write the environment variable string data. */ + environ_buf: usize +): errno; + +/** Return command-line argument data sizes. */ +export declare function environ_sizes_get( + /** Output: The number of environment variables. */ + environ_count: ptr, + /** Output: The size of the environment variable string data. */ + environ_buf_size: ptr +): errno; + +/** Provide file advisory information on a file descriptor. */ +export declare function fd_advise( + /** Input: The file descriptor for the file for which to provide file advisory information. */ + fd: fd, + /** Input: The offset within the file to which the advisory applies. */ + offset: filesize, + /** Input: The length of the region to which the advisory applies. */ + len: filesize, + /** Input: The advice. */ + advice: advice +): errno; + +/** Provide file advisory information on a file descriptor. */ +export declare function fd_allocate( + /** Input: The file descriptor for the file in which to allocate space. */ + fd: fd, + /** Input: The offset at which to start the allocation. */ + offset: filesize, + /** Input: The length of the area that is allocated. */ + len: filesize +): errno; + +/** Close a file descriptor. */ +export declare function fd_close( + /** Input: The file descriptor to close. */ + fd: fd +): errno; + +/** Synchronize the data of a file to disk. */ +export declare function fd_datasync( + /** Input: The file descriptor of the file to synchronize to disk. */ + fd: fd +): errno; + +/** Get the attributes of a file descriptor. */ +export declare function fd_fdstat_get( + /** Input: The file descriptor to inspect. */ + fd: fd, + /** Input: The buffer where the file descriptor's attributes are stored. */ + buf: struct +): errno; + +/** Adjust the flags associated with a file descriptor. */ +export declare function fd_fdstat_set_flags( + /** Input: The file descriptor to operate on. */ + fd: fd, + /** Input: The desired values of the file descriptor flags. */ + flags: fdflags +): errno; + +/** Adjust the rights associated with a file descriptor. */ +export declare function fd_fdstat_set_rights( + /** Input: The file descriptor to operate on. */ + fd: fd, + /** Input: The desired rights of the file descriptor. */ + fs_rights_base: rights, + /** Input: The desired rights of the file descriptor. */ + fs_rights_inheriting: rights +): errno; + +/** Return the attributes of an open file. */ +export declare function fd_filestat_get( + /** Input: The file descriptor to inspect. */ + fd: fd, + /** Input: The buffer where the file's attributes are stored. */ + buf: struct +): errno; + +/** Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros. */ +export declare function fd_filestat_set_size( + /** Input: A file descriptor for the file to adjust. */ + fd: fd, + /** Input: The desired file size. */ + size: filesize +): errno; + +/** Adjust the timestamps of an open file or directory. */ +export declare function fd_filestat_set_times( + /** Input: The file descriptor to operate on. */ + fd: fd, + /** Input: The desired values of the data access timestamp. */ + st_atim: timestamp, + /** Input: The desired values of the data modification timestamp. */ + st_mtim: timestamp, + /** Input: A bitmask indicating which timestamps to adjust. */ + fstflags: fstflags +): errno; + +/** Read from a file descriptor, without using and updating the file descriptor's offset. */ +export declare function fd_pread( + /** Input: The file descriptor from which to read data. */ + fd: fd, + /** Input: List of scatter/gather vectors in which to store data. */ + iovs: ptr>, + /** Input: Length of the list of scatter/gather vectors in which to store data. */ + iovs_len: usize, + /** Input: The offset within the file at which to read. */ + offset: filesize, + /** Output: The number of bytes read. */ + nread: ptr +): errno; + +/** Return a description of the given preopened file descriptor. */ +export declare function fd_prestat_get( + /** Input: The file descriptor about which to retrieve information. */ + fd: fd, + /** Input: The buffer where the description is stored. */ + buf: struct +): errno; + +/** Return a description of the given preopened file descriptor. */ +export declare function fd_prestat_dir_name( + /** Input: The file descriptor about which to retrieve information. */ + fd: fd, + /** Input: Buffer into which to write the preopened directory name. */ + path: ptr, + /** Input: Length of the buffer into which to write the preopened directory name. */ + path_len: usize +): errno; + +/** Write to a file descriptor, without using and updating the file descriptor's offset. */ +export declare function fd_pwrite( + /** Input: The file descriptor to which to write data. */ + fd: fd, + /** Input: List of scatter/gather vectors from which to retrieve data. */ + iovs: ptr>, + /** Input: Length of the list of scatter/gather vectors from which to retrieve data. */ + iovs_len: usize, + /** Input: The offset within the file at which to write. */ + offset: filesize, + /** Output: The number of bytes written. */ + nwritten: ptr +): errno; + +/** Read from a file descriptor. */ +export declare function fd_read( + /** Input: The file descriptor from which to read data. */ + fd: fd, + /** Input: List of scatter/gather vectors to which to store data. */ + iovs: ptr>, + /** Input: Length of the list of scatter/gather vectors to which to store data. */ + iovs_len: usize, + /** Output: The number of bytes read. */ + nread: ptr +): errno; + +/** Read directory entries from a directory. */ +export declare function fd_readdir( + /** Input: Directory from which to read the directory entries. */ + fd: fd, + /** Input: Buffer where directory entries are stored. */ + buf: ptr>, + /** Input: Length of the buffer where directory entries are stored. */ + buf_len: usize, + /** Input: Location within the directory to start reading. */ + cookie: dircookie, + /** Output: Number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached. */ + buf_used: ptr +): errno; + +/** Atomically replace a file descriptor by renumbering another file descriptor. */ +export declare function fd_renumber( + /** Input: The file descriptor to renumber. */ + from: fd, + /** Input: The file descriptor to overwrite. */ + to: fd +): errno; + +/** Move the offset of a file descriptor. */ +export declare function fd_seek( + /** Input: The file descriptor to operate on. */ + fd: fd, + /** Input: The number of bytes to move. */ + offset: filedelta, + /** Input: The base from which the offset is relative. */ + whence: whence, + /** Output: The new offset of the file descriptor, relative to the start of the file. */ + newoffset: ptr +): errno; + +/** Synchronize the data and metadata of a file to disk. */ +export declare function fd_sync( + /** Input: The file descriptor of the file containing the data and metadata to synchronize to disk. */ + fd: fd +): errno; + +/** Return the current offset of a file descriptor. */ +export declare function fd_tell( + /** Input: The file descriptor to inspect. */ + fd: fd, + /** Output: The current offset of the file descriptor, relative to the start of the file. */ + newoffset: ptr +): errno; + +/** Write to a file descriptor. */ +export declare function fd_write( + /** Input: The file descriptor to which to write data. */ + fd: fd, + /** Input: List of scatter/gather vectors from which to retrieve data. */ + iovs: ptr>, + /** Input: List of scatter/gather vectors from which to retrieve data. */ + iovs_len: usize, + /** Output: The number of bytes written. */ + nwritten: ptr +): errno; + +/* Create a directory. */ +export declare function path_create_directory( + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: The path at which to create the directory. */ + path: ptr, + /** Input: The path at which to create the directory. */ + path_len: usize +): errno; + +/** Return the attributes of a file or directory. */ +export declare function path_filestat_get( + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: Flags determining the method of how the path is resolved. */ + flags: lookupflags, + /** Input: The path of the file or directory to inspect. */ + path: ptr, + /** Input: The path of the file or directory to inspect. */ + path_len: usize, + /** Input: The buffer where the file's attributes are stored. */ + buf: struct +): errno; + +/** Adjust the timestamps of a file or directory. */ +export declare function path_filestat_set_times( + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: Flags determining the method of how the path is resolved. */ + flags: lookupflags, + /** Input: The path of the file or directory to operate on. */ + path: ptr, + /** Input: The path of the file or directory to operate on. */ + path_len: usize, + /** Input: The desired values of the data access timestamp. */ + st_atim: timestamp, + /** Input: The desired values of the data modification timestamp. */ + st_mtim: timestamp, + /** Input: A bitmask indicating which timestamps to adjust. */ + fstflags: fstflags +): errno; + +/** Create a hard link. */ +export declare function path_link( + /** Input: The working directory at which the resolution of the old path starts. */ + old_fd: fd, + /** Input: Flags determining the method of how the path is resolved. */ + old_flags: lookupflags, + /** Input: The source path from which to link. */ + old_path: ptr, + /** Input: The source path from which to link. */ + old_path_len: usize, + /** Input: The working directory at which the resolution of the new path starts. */ + new_fd: fd, + /** Input: The destination path at which to create the hard link. */ + new_path: ptr, + /** Input: The length of the destination path at which to create the hard link. */ + new_path_len: usize +): errno; + +/** Open a file or directory. */ +export declare function path_open( + /** Input: The working directory at which the resolution of the path starts. */ + dirfd: fd, + /** Input: Flags determining the method of how the path is resolved. */ + dirflags: lookupflags, + /** Input: The path of the file or directory to open. */ + path: ptr, + /** Input: The length of the path of the file or directory to open. */ + path_len: usize, + /** Input: The method by which to open the file. */ + oflags: oflags, + /** Input: The initial base rights that apply to operations using the file descriptor itself. */ + fs_rights_base: rights, + /** Input: The initial inheriting rights that apply to file descriptors derived from it. */ + fs_rights_inheriting: rights, + /** Input: The initial flags of the file descriptor. */ + fs_flags: fdflags, + /** Output: The file descriptor of the file that has been opened. */ + fd: ptr +): errno; + +/** Read the contents of a symbolic link. */ +export declare function path_readlink( + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: The path of the symbolic link from which to read. */ + path: ptr, + /** Input: The length of the path of the symbolic link from which to read. */ + path_len: usize, + /** Input: The buffer to which to write the contents of the symbolic link. */ + buf: ptr, + /** Input: The length of the buffer to which to write the contents of the symbolic link. */ + buf_len: usize, + /** Output: The number of bytes placed in the buffer. */ + buf_used: ptr +): errno; + +/** Remove a directory. */ +export declare function path_remove_directory( + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: The path to a directory to remove. */ + path: ptr, + /** Input: The length of the path to a directory to remove. */ + path_len: usize +): errno; + +/** Rename a file or directory. */ +export declare function path_rename( + /** Input: The working directory at which the resolution of the old path starts. */ + old_fd: fd, + /** Input: The source path of the file or directory to rename. */ + old_path: ptr, + /** Input: The length of the source path of the file or directory to rename. */ + old_path_len: usize, + /** Input: The working directory at which the resolution of the new path starts. */ + new_fd: fd, + /** Input: The destination path to which to rename the file or directory. */ + new_path: ptr, + /** Input: The length of the destination path to which to rename the file or directory. */ + new_path_len: usize +): errno; + +/** Create a symbolic link. */ +export declare function path_symlink( + /** Input: The contents of the symbolic link. */ + old_path: ptr, + /** Input: The length of the contents of the symbolic link. */ + old_path_len: usize, + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: The destination path at which to create the symbolic link. */ + new_path: ptr, + /** Input: The length of the destination path at which to create the symbolic link. */ + new_path_len: usize +): errno; + +/** Unlink a file. */ +export declare function path_unlink_file( + /** Input: The working directory at which the resolution of the path starts. */ + fd: fd, + /** Input: The path to a file to unlink. */ + path: ptr, + /** Input: The length of the path to a file to unlink. */ + path_len: usize +): errno; + +/** Concurrently poll for the occurrence of a set of events. */ +export declare function poll_oneoff( + /** Input: The events to which to subscribe. */ + in_: ptr>, + /** Input: The events that have occurred. */ + out: ptr>, + /** Input: Both the number of subscriptions and events. */ + nsubscriptions: usize, + /** Output: The number of events stored. */ + nevents: ptr +): errno; + +/** Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment. */ +export declare function proc_exit( + /** Input: The exit code returned by the process. */ + rval: u32 +): void; + +/** Send a signal to the process of the calling thread. */ +export declare function proc_raise( + /** Input: The signal condition to trigger. */ + sig: signal +): errno; + +/** Write high-quality random data into a buffer. */ +export declare function random_get( + /** Input: The buffer to fill with random data. */ + buf: usize, + /** Input: The length of the buffer to fill with random data. */ + buf_len: usize +): errno; + +/** Temporarily yield execution of the calling thread. */ +export declare function sched_yield(): errno; + +/** Receive a message from a socket. */ +export declare function sock_recv( + /** Input: The socket on which to receive data. */ + sock: fd, + /** Input: List of scatter/gather vectors to which to store data. */ + ri_data: ptr>, + /** Input: The length of the list of scatter/gather vectors to which to store data. */ + ri_data_len: usize, + /** Input: Message flags. */ + ri_flags: riflags, + /** Output: Number of bytes stored in `ri_data`. */ + ro_datalen: ptr, + /** Output: Message flags. */ + ro_flags: ptr +): errno; + +/** Send a message on a socket. */ +export declare function sock_send( + /** Input: The socket on which to send data. */ + sock: fd, + /** Input: List of scatter/gather vectors to which to retrieve data */ + si_data: ptr>, + /** Input: The length of the list of scatter/gather vectors to which to retrieve data */ + si_data_len: usize, + /** Input: Message flags. */ + si_flags: siflags, + /** Output: Number of bytes transmitted. */ + so_datalen: ptr +): errno; + +/** Shut down socket send and receive channels. */ +export declare function sock_shutdown( + /** Input: The socket on which to shutdown channels. */ + sock: fd, + /** Input: Which channels on the socket to shut down. */ + how: sdflags +): errno; + +// === Types ====================================================================================== + +/** File or memory access pattern advisory information. */ +export namespace advice { + /** The application has no advice to give on its behavior with respect to the specified data. */ + // @ts-ignore: decorator + @inline + export const NORMAL: advice = 0; + /** The application expects to access the specified data sequentially from lower offsets to higher offsets. */ + // @ts-ignore: decorator + @inline + export const SEQUENTIAL : advice = 1; + /** The application expects to access the specified data in a random order. */ + // @ts-ignore: decorator + @inline + export const RANDOM: advice = 2; + /** The application expects to access the specified data in the near future. */ + // @ts-ignore: decorator + @inline + export const WILLNEED: advice = 3; + /** The application expects that it will not access the specified data in the near future. */ + // @ts-ignore: decorator + @inline + export const DONTNEED: advice = 4; + /** The application expects to access the specified data once and then not reuse it thereafter. */ + // @ts-ignore: decorator + @inline + export const NOREUSE: advice = 5; +} +export type advice = u8; + +/** Identifiers for clocks. */ +export namespace clockid { + /** The clock measuring real time. Time value zero corresponds with 1970-01-01T00:00:00Z. */ + // @ts-ignore: decorator + @inline + export const REALTIME: clockid = 0; + /** The store-wide monotonic clock. Absolute value has no meaning. */ + // @ts-ignore: decorator + @inline + export const MONOTONIC: clockid = 1; + /** The CPU-time clock associated with the current process. */ + // @ts-ignore: decorator + @inline + export const PROCESS_CPUTIME_ID: clockid = 2; + /** The CPU-time clock associated with the current thread. */ + // @ts-ignore: decorator + @inline + export const THREAD_CPUTIME_ID: clockid = 3; +} +export type clockid = u32; + +/** Identifier for a device containing a file system. Can be used in combination with `inode` to uniquely identify a file or directory in the filesystem. */ +export type device = u64; + +/** A reference to the offset of a directory entry. */ +export type dircookie = u64; + +/** A directory entry. */ +@unmanaged export class dirent { + /** The offset of the next directory entry stored in this directory. */ + next: dircookie; + /** The serial number of the file referred to by this directory entry. */ + ino: inode; + /** The length of the name of the directory entry. */ + namlen: u32; + /** The type of the file referred to by this directory entry. */ + type: filetype; + private __padding0: u16; +} + +/** Error codes returned by functions. */ +export namespace errno { + /** No error occurred. System call completed successfully. */ + // @ts-ignore: decorator + @inline + export const SUCCESS: errno = 0; + /** Argument list too long. */ + // @ts-ignore: decorator + @inline + export const TOOBIG: errno = 1; + /** Permission denied. */ + // @ts-ignore: decorator + @inline + export const ACCES: errno = 2; + /** Address in use. */ + // @ts-ignore: decorator + @inline + export const ADDRINUSE: errno = 3; + /** Address not available. */ + // @ts-ignore: decorator + @inline + export const ADDRNOTAVAIL: errno = 4; + /** Address family not supported. */ + // @ts-ignore: decorator + @inline + export const AFNOSUPPORT: errno = 5; + /** Resource unavailable, or operation would block. */ + // @ts-ignore: decorator + @inline + export const AGAIN: errno = 6; + /** Connection already in progress. */ + // @ts-ignore: decorator + @inline + export const ALREADY: errno = 7; + /** Bad file descriptor. */ + // @ts-ignore: decorator + @inline + export const BADF: errno = 8; + /** Bad message. */ + // @ts-ignore: decorator + @inline + export const BADMSG: errno = 9; + /** Device or resource busy. */ + // @ts-ignore: decorator + @inline + export const BUSY: errno = 10; + /** Operation canceled. */ + // @ts-ignore: decorator + @inline + export const CANCELED: errno = 11; + /** No child processes. */ + // @ts-ignore: decorator + @inline + export const CHILD: errno = 12; + /** Connection aborted. */ + // @ts-ignore: decorator + @inline + export const CONNABORTED: errno = 13; + /** Connection refused. */ + // @ts-ignore: decorator + @inline + export const CONNREFUSED: errno = 14; + /** Connection reset. */ + // @ts-ignore: decorator + @inline + export const CONNRESET: errno = 15; + /** Resource deadlock would occur. */ + // @ts-ignore: decorator + @inline + export const DEADLK: errno = 16; + /** Destination address required. */ + // @ts-ignore: decorator + @inline + export const DESTADDRREQ: errno = 17; + /** Mathematics argument out of domain of function. */ + // @ts-ignore: decorator + @inline + export const DOM: errno = 18; + /** Reserved. */ + // @ts-ignore: decorator + @inline + export const DQUOT: errno = 19; + /** File exists. */ + // @ts-ignore: decorator + @inline + export const EXIST: errno = 20; + /** Bad address. */ + // @ts-ignore: decorator + @inline + export const FAULT: errno = 21; + /** File too large. */ + // @ts-ignore: decorator + @inline + export const FBIG: errno = 22; + /** Host is unreachable. */ + // @ts-ignore: decorator + @inline + export const HOSTUNREACH: errno = 23; + /** Identifier removed. */ + // @ts-ignore: decorator + @inline + export const IDRM: errno = 24; + /** Illegal byte sequence. */ + // @ts-ignore: decorator + @inline + export const ILSEQ: errno = 25; + /** Operation in progress. */ + // @ts-ignore: decorator + @inline + export const INPROGRESS: errno = 26; + /** Interrupted function. */ + // @ts-ignore: decorator + @inline + export const INTR: errno = 27; + /** Invalid argument. */ + // @ts-ignore: decorator + @inline + export const INVAL: errno = 28; + /** I/O error. */ + // @ts-ignore: decorator + @inline + export const IO: errno = 29; + /** Socket is connected. */ + // @ts-ignore: decorator + @inline + export const ISCONN: errno = 30; + /** Is a directory. */ + // @ts-ignore: decorator + @inline + export const ISDIR: errno = 31; + /** Too many levels of symbolic links. */ + // @ts-ignore: decorator + @inline + export const LOOP: errno = 32; + /** File descriptor value too large. */ + // @ts-ignore: decorator + @inline + export const MFILE: errno = 33; + /** Too many links. */ + // @ts-ignore: decorator + @inline + export const MLINK: errno = 34; + /** Message too large. */ + // @ts-ignore: decorator + @inline + export const MSGSIZE: errno = 35; + /** Reserved. */ + // @ts-ignore: decorator + @inline + export const MULTIHOP: errno = 36; + /** Filename too long. */ + // @ts-ignore: decorator + @inline + export const NAMETOOLONG: errno = 37; + /** Network is down. */ + // @ts-ignore: decorator + @inline + export const NETDOWN: errno = 38; + /** Connection aborted by network. */ + // @ts-ignore: decorator + @inline + export const NETRESET: errno = 39; + /** Network unreachable. */ + // @ts-ignore: decorator + @inline + export const NETUNREACH: errno = 40; + /** Too many files open in system. */ + // @ts-ignore: decorator + @inline + export const NFILE: errno = 41; + /** No buffer space available. */ + // @ts-ignore: decorator + @inline + export const NOBUFS: errno = 42; + /** No such device. */ + // @ts-ignore: decorator + @inline + export const NODEV: errno = 43; + /** No such file or directory. */ + // @ts-ignore: decorator + @inline + export const NOENT: errno = 44; + /** Executable file format error. */ + // @ts-ignore: decorator + @inline + export const NOEXEC: errno = 45; + /** No locks available. */ + // @ts-ignore: decorator + @inline + export const NOLCK: errno = 46; + /** Reserved. */ + // @ts-ignore: decorator + @inline + export const NOLINK: errno = 47; + /** Not enough space. */ + // @ts-ignore: decorator + @inline + export const NOMEM: errno = 48; + /** No message of the desired type. */ + // @ts-ignore: decorator + @inline + export const NOMSG: errno = 49; + /** Protocol not available. */ + // @ts-ignore: decorator + @inline + export const NOPROTOOPT: errno = 50; + /** No space left on device. */ + // @ts-ignore: decorator + @inline + export const NOSPC: errno = 51; + /** Function not supported. */ + // @ts-ignore: decorator + @inline + export const NOSYS: errno = 52; + /** The socket is not connected. */ + // @ts-ignore: decorator + @inline + export const NOTCONN: errno = 53; + /** Not a directory or a symbolic link to a directory. */ + // @ts-ignore: decorator + @inline + export const NOTDIR: errno = 54; + /** Directory not empty. */ + // @ts-ignore: decorator + @inline + export const NOTEMPTY: errno = 55; + /** State not recoverable. */ + // @ts-ignore: decorator + @inline + export const NOTRECOVERABLE: errno = 56; + /** Not a socket. */ + // @ts-ignore: decorator + @inline + export const NOTSOCK: errno = 57; + /** Not supported, or operation not supported on socket. */ + // @ts-ignore: decorator + @inline + export const NOTSUP: errno = 58; + /** Inappropriate I/O control operation. */ + // @ts-ignore: decorator + @inline + export const NOTTY: errno = 59; + /** No such device or address. */ + // @ts-ignore: decorator + @inline + export const NXIO: errno = 60; + /** Value too large to be stored in data type. */ + // @ts-ignore: decorator + @inline + export const OVERFLOW: errno = 61; + /** Previous owner died. */ + // @ts-ignore: decorator + @inline + export const OWNERDEAD: errno = 62; + /** Operation not permitted. */ + // @ts-ignore: decorator + @inline + export const PERM: errno = 63; + /** Broken pipe. */ + // @ts-ignore: decorator + @inline + export const PIPE: errno = 64; + /** Protocol error. */ + // @ts-ignore: decorator + @inline + export const PROTO: errno = 65; + /** Protocol not supported. */ + // @ts-ignore: decorator + @inline + export const PROTONOSUPPORT: errno = 66; + /** Protocol wrong type for socket. */ + // @ts-ignore: decorator + @inline + export const PROTOTYPE: errno = 67; + /** Result too large. */ + // @ts-ignore: decorator + @inline + export const RANGE: errno = 68; + /** Read-only file system. */ + // @ts-ignore: decorator + @inline + export const ROFS: errno = 69; + /** Invalid seek. */ + // @ts-ignore: decorator + @inline + export const SPIPE: errno = 70; + /** No such process. */ + // @ts-ignore: decorator + @inline + export const SRCH: errno = 71; + /** Reserved. */ + // @ts-ignore: decorator + @inline + export const STALE: errno = 72; + /** Connection timed out. */ + // @ts-ignore: decorator + @inline + export const TIMEDOUT: errno = 73; + /** Text file busy. */ + // @ts-ignore: decorator + @inline + export const TXTBSY: errno = 74; + /** Cross-device link. */ + // @ts-ignore: decorator + @inline + export const XDEV: errno = 75; + /** Extension: Capabilities insufficient. */ + // @ts-ignore: decorator + @inline + export const NOTCAPABLE: errno = 76; +} +export type errno = u16; + +/** An event that occurred. */ +@unmanaged export abstract class event { + /** User-provided value that got attached to `subscription#userdata`. */ + userdata: userdata; + /** If non-zero, an error that occurred while processing the subscription request. */ + error: errno; + /* The type of the event that occurred. */ + type: eventtype; + private __padding0: u16; +} + +/** An event that occurred when type is `eventtype.FD_READ` or `eventtype.FD_WRITE`. */ +@unmanaged export class rwevent extends event { + /* The number of bytes available for reading or writing. */ + nbytes: filesize; + /* The state of the file descriptor. */ + flags: eventrwflags; + private __padding1: u32; +} + +/** The state of the file descriptor subscribed to with `eventtype.FD_READ` or `eventtype.FD_WRITE`. */ +export namespace eventrwflags { + /** The peer of this socket has closed or disconnected. */ + // @ts-ignore: decorator + @inline + export const HANGUP: eventrwflags = 1; +} +export type eventrwflags = u16; + +/** Type of a subscription to an event or its occurrence. */ +export namespace eventtype { + /** The time value of clock has reached the timestamp. */ + // @ts-ignore: decorator + @inline + export const CLOCK: eventtype = 0; + /** File descriptor has data available for reading. */ + // @ts-ignore: decorator + @inline + export const FD_READ: eventtype = 1; + /** File descriptor has capacity available for writing */ + // @ts-ignore: decorator + @inline + export const FD_WRITE: eventtype = 2; +} +export type eventtype = u8; + +/** Exit code generated by a process when exiting. */ +export type exitcode = u32; + +/** A file descriptor number. */ +export type fd = u32; + +/** File descriptor flags. */ +export namespace fdflags { + /** Append mode: Data written to the file is always appended to the file's end. */ + // @ts-ignore: decorator + @inline + export const APPEND: fdflags = 1; + /** Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized. */ + // @ts-ignore: decorator + @inline + export const DSYNC: fdflags = 2; + /** Non-blocking mode. */ + // @ts-ignore: decorator + @inline + export const NONBLOCK: fdflags = 4; + /** Synchronized read I/O operations. */ + // @ts-ignore: decorator + @inline + export const RSYNC: fdflags = 8; + /** Write according to synchronized I/O file integrity completion. */ + // @ts-ignore: decorator + @inline + export const SYNC: fdflags = 16; +} +export type fdflags = u16; + +/** File descriptor attributes. */ +@unmanaged export class fdstat { + /** File type. */ + filetype: filetype; + /** File descriptor flags. */ + flags: fdflags; + /** Rights that apply to this file descriptor. */ + rights_base: rights; + /** Maximum set of rights that may be installed on new file descriptors that are created through this file descriptor, e.g., through `path_open`. */ + rights_inheriting: rights; +} + +/** Relative offset within a file. */ +export type filedelta = i64; + +/** Non-negative file size or length of a region within a file. */ +export type filesize = u64; + +/** File attributes. */ +@unmanaged export class filestat { + /** Device ID of device containing the file. */ + dev: device; + /** File serial number. */ + ino: inode; + /** File type. */ + filetype: filetype; + /** Number of hard links to the file. */ + nlink: linkcount; + /** For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link. */ + size: filesize; + /** Last data access timestamp. */ + atim: timestamp; + /** Last data modification timestamp. */ + mtim: timestamp; + /** Last file status change timestamp. */ + ctim: timestamp; +} + +/** The type of a file descriptor or file. */ +export namespace filetype { + /** The type of the file descriptor or file is unknown or is different from any of the other types specified. */ + // @ts-ignore: decorator + @inline + export const UNKNOWN: filetype = 0; + /** The file descriptor or file refers to a block device inode. */ + // @ts-ignore: decorator + @inline + export const BLOCK_DEVICE: filetype = 1; + /** The file descriptor or file refers to a character device inode. */ + // @ts-ignore: decorator + @inline + export const CHARACTER_DEVICE: filetype = 2; + /** The file descriptor or file refers to a directory inode. */ + // @ts-ignore: decorator + @inline + export const DIRECTORY: filetype = 3; + /** The file descriptor or file refers to a regular file inode. */ + // @ts-ignore: decorator + @inline + export const REGULAR_FILE: filetype = 4; + /** The file descriptor or file refers to a datagram socket. */ + // @ts-ignore: decorator + @inline + export const SOCKET_DGRAM: filetype = 5; + /** The file descriptor or file refers to a byte-stream socket. */ + // @ts-ignore: decorator + @inline + export const SOCKET_STREAM: filetype = 6; + /** The file refers to a symbolic link inode. */ + // @ts-ignore: decorator + @inline + export const SYMBOLIC_LINK: filetype = 7; +} +export type filetype = u8; + +/** Which file time attributes to adjust. */ +export namespace fstflags { + /** Adjust the last data access timestamp to the value stored in `filestat#st_atim`. */ + // @ts-ignore: decorator + @inline + export const SET_ATIM: fstflags = 1; + /** Adjust the last data access timestamp to the time of clock `clockid.REALTIME`. */ + // @ts-ignore: decorator + @inline + export const SET_ATIM_NOW: fstflags = 2; + /** Adjust the last data modification timestamp to the value stored in `filestat#st_mtim`. */ + // @ts-ignore: decorator + @inline + export const SET_MTIM: fstflags = 4; + /** Adjust the last data modification timestamp to the time of clock `clockid.REALTIME`. */ + // @ts-ignore: decorator + @inline + export const SET_MTIM_NOW: fstflags = 8; +} +export type fstflags = u16; + +/** File serial number that is unique within its file system. */ +export type inode = u64; + +/** A region of memory for scatter/gather reads. */ +@unmanaged export class iovec { + /** The address of the buffer to be filled. */ + buf: usize; + /** The length of the buffer to be filled. */ + buf_len: usize; +} + +/** Number of hard links to an inode. */ +export type linkcount = u32; + +/** Flags determining the method of how paths are resolved. */ +export namespace lookupflags { + /** As long as the resolved path corresponds to a symbolic link, it is expanded. */ + // @ts-ignore: decorator + @inline + export const SYMLINK_FOLLOW: lookupflags = 1; +} +export type lookupflags = u32; + +/** Open flags. */ +export namespace oflags { + /** Create file if it does not exist. */ + // @ts-ignore: decorator + @inline + export const CREAT: oflags = 1; + /** Fail if not a directory. */ + // @ts-ignore: decorator + @inline + export const DIRECTORY: oflags = 2; + /** Fail if file already exists. */ + // @ts-ignore: decorator + @inline + export const EXCL: oflags = 4; + /** Truncate file to size 0. */ + // @ts-ignore: decorator + @inline + export const TRUNC: oflags = 8; +} +export type oflags = u16; + +// TODO: undocumented +export namespace preopentype { + // @ts-ignore: decorator + @inline + export const DIR: preopentype = 0; +} +export type preopentype = u8; + +// TODO: undocumented +export abstract class prestat { + type: preopentype; +} + +// TODO: undocumented +export class dirprestat extends prestat { + name_len: usize; +} + +/** Flags provided to `sock_recv`. */ +export namespace riflags { + /** Returns the message without removing it from the socket's receive queue. */ + // @ts-ignore: decorator + @inline + export const PEEK: riflags = 1; + /** On byte-stream sockets, block until the full amount of data can be returned. */ + // @ts-ignore: decorator + @inline + export const WAITALL: riflags = 2; +} +export type riflags = u16; + +/** File descriptor rights, determining which actions may be performed. */ +export namespace rights { + /** The right to invoke `fd_datasync`. */ + // @ts-ignore: decorator + @inline + export const FD_DATASYNC: rights = 1; + /** The right to invoke `fd_read` and `sock_recv`. */ + // @ts-ignore: decorator + @inline + export const FD_READ: rights = 2; + /** The right to invoke `fd_seek`. This flag implies `rights.FD_TELL`. */ + // @ts-ignore: decorator + @inline + export const FD_SEEK: rights = 4; + /** The right to invoke `fd_fdstat_set_flags`. */ + // @ts-ignore: decorator + @inline + export const FD_FDSTAT_SET_FLAGS: rights = 8; + /** The right to invoke `fd_sync`. */ + // @ts-ignore: decorator + @inline + export const FD_SYNC: rights = 16; + /** The right to invoke `fd_seek` in such a way that the file offset remains unaltered (i.e., `whence.CUR` with offset zero), or to invoke `fd_tell`). */ + // @ts-ignore: decorator + @inline + export const FD_TELL: rights = 32; + /** The right to invoke `fd_write` and `sock_send`. If `rights.FD_SEEK` is set, includes the right to invoke `fd_pwrite`. */ + // @ts-ignore: decorator + @inline + export const FD_WRITE: rights = 64; + /** The right to invoke `fd_advise`. */ + // @ts-ignore: decorator + @inline + export const FD_ADVISE: rights = 128; + /** The right to invoke `fd_allocate`. */ + // @ts-ignore: decorator + @inline + export const FD_ALLOCATE: rights = 256; + /** The right to invoke `path_create_directory`. */ + // @ts-ignore: decorator + @inline + export const PATH_CREATE_DIRECTORY: rights = 512; + /** If `rights.PATH_OPEN` is set, the right to invoke `path_open` with `oflags.CREAT`. */ + // @ts-ignore: decorator + @inline + export const PATH_CREATE_FILE: rights = 1024; + /** The right to invoke `path_link` with the file descriptor as the source directory. */ + // @ts-ignore: decorator + @inline + export const PATH_LINK_SOURCE: rights = 2048; + /** The right to invoke `path_link` with the file descriptor as the target directory. */ + // @ts-ignore: decorator + @inline + export const PATH_LINK_TARGET: rights = 4096; + /** The right to invoke `path_open`. */ + // @ts-ignore: decorator + @inline + export const PATH_OPEN: rights = 8192; + /** The right to invoke `fd_readdir`. */ + // @ts-ignore: decorator + @inline + export const FD_READDIR: rights = 16384; + /** The right to invoke `path_readlink`. */ + // @ts-ignore: decorator + @inline + export const PATH_READLINK: rights = 32768; + /** The right to invoke `path_rename` with the file descriptor as the source directory. */ + // @ts-ignore: decorator + @inline + export const PATH_RENAME_SOURCE: rights = 65536; + /** The right to invoke `path_rename` with the file descriptor as the target directory. */ + // @ts-ignore: decorator + @inline + export const PATH_RENAME_TARGET: rights = 131072; + /** The right to invoke `path_filestat_get`. */ + // @ts-ignore: decorator + @inline + export const PATH_FILESTAT_GET: rights = 262144; + /** The right to change a file's size (there is no `path_filestat_set_size`). If `rights.PATH_OPEN` is set, includes the right to invoke `path_open` with `oflags.TRUNC`. */ + // @ts-ignore: decorator + @inline + export const PATH_FILESTAT_SET_SIZE: rights = 524288; + /** The right to invoke `path_filestat_set_times`. */ + // @ts-ignore: decorator + @inline + export const PATH_FILESTAT_SET_TIMES: rights = 1048576; + /** The right to invoke `fd_filestat_get`. */ + // @ts-ignore: decorator + @inline + export const FD_FILESTAT_GET: rights = 2097152; + /** The right to invoke `fd_filestat_set_size`. */ + // @ts-ignore: decorator + @inline + export const FD_FILESTAT_SET_SIZE: rights = 4194304; + /** The right to invoke `fd_filestat_set_times`. */ + // @ts-ignore: decorator + @inline + export const FD_FILESTAT_SET_TIMES: rights = 8388608; + /** The right to invoke `path_symlink`. */ + // @ts-ignore: decorator + @inline + export const RIGHT_PATH_SYMLINK: rights = 16777216; + /** The right to invoke `path_remove_directory`. */ + // @ts-ignore: decorator + @inline + export const PATH_REMOVE_DIRECTORY: rights = 33554432; + /** The right to invoke `path_unlink_file`. */ + // @ts-ignore: decorator + @inline + export const PATH_UNLINK_FILE: rights = 67108864; + /** If `rights.FD_READ` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_READ`. If `rights.FD_WRITE` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_WRITE`. */ + // @ts-ignore: decorator + @inline + export const POLL_FD_READWRITE: rights = 134217728; + /** The right to invoke `sock_shutdown`. */ + // @ts-ignore: decorator + @inline + export const SOCK_SHUTDOWN: rights = 268435456; +} +export type rights = u64; + +/** Flags returned by `sock_recv`. */ +export namespace roflags { + /** Message data has been truncated. */ + // @ts-ignore: decorator + @inline + export const DATA_TRUNCATED: roflags = 1; +} +export type roflags = u16; + +/** Which channels on a socket to shut down. */ +export namespace sdflags { + /** Disables further receive operations. */ + // @ts-ignore: decorator + @inline + export const RD: sdflags = 1; + /** Disables further send operations. */ + // @ts-ignore: decorator + @inline + export const WR: sdflags = 2; +} +export type sdflags = u8; + +/** Flags provided to `sock_send`. */ +export namespace siflags { + // As there are currently no flags defined, it must be set to zero. +} +export type siflags = u16; + +/** Signal condition. */ +export namespace signal { + /** Hangup. */ + // @ts-ignore: decorator + @inline + export const HUP: signal = 1; + /** Terminate interrupt signal. */ + // @ts-ignore: decorator + @inline + export const INT: signal = 2; + /** Terminal quit signal. */ + // @ts-ignore: decorator + @inline + export const QUIT: signal = 3; + /** Illegal instruction. */ + // @ts-ignore: decorator + @inline + export const ILL: signal = 4; + /** Trace/breakpoint trap. */ + // @ts-ignore: decorator + @inline + export const TRAP: signal = 5; + /** Process abort signal. */ + // @ts-ignore: decorator + @inline + export const ABRT: signal = 6; + /** Access to an undefined portion of a memory object. */ + // @ts-ignore: decorator + @inline + export const BUS: signal = 7; + /** Erroneous arithmetic operation. */ + // @ts-ignore: decorator + @inline + export const FPE: signal = 8; + /** Kill. */ + // @ts-ignore: decorator + @inline + export const KILL: signal = 9; + /** User-defined signal 1. */ + // @ts-ignore: decorator + @inline + export const USR1: signal = 10; + /** Invalid memory reference. */ + // @ts-ignore: decorator + @inline + export const SEGV: signal = 11; + /** User-defined signal 2. */ + // @ts-ignore: decorator + @inline + export const USR2: signal = 12; + /** Write on a pipe with no one to read it. */ + // @ts-ignore: decorator + @inline + export const PIPE: signal = 13; + /** Alarm clock. */ + // @ts-ignore: decorator + @inline + export const ALRM: signal = 14; + /** Termination signal. */ + // @ts-ignore: decorator + @inline + export const TERM: signal = 15; + /** Child process terminated, stopped, or continued. */ + // @ts-ignore: decorator + @inline + export const CHLD: signal = 16; + /** Continue executing, if stopped. */ + // @ts-ignore: decorator + @inline + export const CONT: signal = 17; + /** Stop executing. */ + // @ts-ignore: decorator + @inline + export const STOP: signal = 18; + /** Terminal stop signal. */ + // @ts-ignore: decorator + @inline + export const TSTP: signal = 19; + /** Background process attempting read. */ + // @ts-ignore: decorator + @inline + export const TTIN: signal = 20; + /** Background process attempting write. */ + // @ts-ignore: decorator + @inline + export const TTOU: signal = 21; + /** High bandwidth data is available at a socket. */ + // @ts-ignore: decorator + @inline + export const URG: signal = 22; + /** CPU time limit exceeded. */ + // @ts-ignore: decorator + @inline + export const XCPU: signal = 23; + /** File size limit exceeded. */ + // @ts-ignore: decorator + @inline + export const XFSZ: signal = 24; + /** Virtual timer expired. */ + // @ts-ignore: decorator + @inline + export const VTALRM: signal = 25; + // @ts-ignore: decorator + @inline + export const PROF: signal = 26; + // @ts-ignore: decorator + @inline + export const WINCH: signal = 27; + // @ts-ignore: decorator + @inline + export const POLL: signal = 28; + // @ts-ignore: decorator + @inline + export const PWR: signal = 29; + /** Bad system call. */ + // @ts-ignore: decorator + @inline + export const SYS: signal = 30; +} +export type signal = u8; + +/** Flags determining how to interpret the timestamp provided in `subscription_t::u.clock.timeout. */ +export namespace subclockflags { + /** If set, treat the timestamp provided in `clocksubscription` as an absolute timestamp. */ + // @ts-ignore: decorator + @inline + export const ABSTIME: subclockflags = 1; +} +export type subclockflags = u16; + +/** Subscription to an event. */ +@unmanaged export abstract class subscription { + /** User-provided value that is attached to the subscription. */ + userdata: userdata; + /** The type of the event to which to subscribe. */ + type: eventtype; + private __padding0: u32; +} + +/* Subscription to an event of type `eventtype.CLOCK`.**/ +@unmanaged export class clocksubscription extends subscription { + /** The user-defined unique identifier of the clock. */ + identifier: userdata; + /** The clock against which to compare the timestamp. */ + clock_id: clockid; + /** The absolute or relative timestamp. */ + timeout: timestamp; + /** The amount of time that the implementation may wait additionally to coalesce with other events. */ + precision: timestamp; + /** Flags specifying whether the timeout is absolute or relative. */ + flags: subclockflags; + private __padding1: u32; +} + +/* Subscription to an event of type `eventtype.FD_READ` or `eventtype.FD_WRITE`.**/ +@unmanaged export class fdsubscription extends subscription { + /** The file descriptor on which to wait for it to become ready for reading or writing. */ + fd: fd; +} + +/** Timestamp in nanoseconds. */ +export type timestamp = u64; + +/** User-provided value that may be attached to objects that is retained when extracted from the implementation. */ +export type userdata = u64; + +/** The position relative to which to set the offset of the file descriptor. */ +export namespace whence { + /** Seek relative to current position. */ + // @ts-ignore: decorator + @inline + export const CUR: whence = 0; + /** Seek relative to end-of-file. */ + // @ts-ignore: decorator + @inline + export const END: whence = 1; + /** Seek relative to start-of-file. */ + // @ts-ignore: decorator + @inline + export const SET: whence = 2; +} +export type whence = u8; diff --git a/std/assembly/string.ts b/std/assembly/string.ts index 8218cae4..6d02e9cb 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -30,7 +30,7 @@ import { ArrayBufferView } from "./arraybuffer"; store(out, code); } else { code -= 0x10000; - let hi: u32 = (code >>> 10) + 0xD800; + let hi: u32 = (code >>> 10) + 0xD800; let lo: u32 = (code & 0x3FF) + 0xDC00; store(out, (hi << 16) | lo); } @@ -95,7 +95,13 @@ import { ArrayBufferView } from "./arraybuffer"; return !compareImpl(left, 0, right, 0, leftLength); } - @operator("!=") private static __ne(left: String | null, right: String | null): bool { + @operator.prefix("!") + private static __not(str: String): bool { + return str === null || !str.length; + } + + @operator("!=") + private static __ne(left: String, right: String): bool { return !this.__eq(left, right); } @@ -338,9 +344,9 @@ import { ArrayBufferView } from "./arraybuffer"; } slice(beginIndex: i32, endIndex: i32 = i32.MAX_VALUE): String { - var len = this.length; + var len = this.length; var begin = beginIndex < 0 ? max(beginIndex + len, 0) : min(beginIndex, len); - var end = endIndex < 0 ? max(endIndex + len, 0) : min(endIndex, len); + var end = endIndex < 0 ? max(endIndex + len, 0) : min(endIndex, len); len = end - begin; if (len <= 0) return changetype(""); var out = runtime.allocate(len << 1); @@ -454,7 +460,7 @@ import { ArrayBufferView } from "./arraybuffer"; cp = ( (cp & 7) << 18 | (load(ptr + ptrPos++) & 63) << 12 | - (load(ptr + ptrPos++) & 63) << 6 | + (load(ptr + ptrPos++) & 63) << 6 | load(ptr + ptrPos++) & 63 ) - 0x10000; store(buf + bufPos, 0xD800 + (cp >> 10)); @@ -465,7 +471,7 @@ import { ArrayBufferView } from "./arraybuffer"; assert(ptrPos + 2 <= len); store(buf + bufPos, (cp & 15) << 12 | - (load(ptr + ptrPos++) & 63) << 6 | + (load(ptr + ptrPos++) & 63) << 6 | load(ptr + ptrPos++) & 63 ); bufPos += 2; @@ -490,8 +496,8 @@ import { ArrayBufferView } from "./arraybuffer"; ++off; ++pos; } else if (c1 < 2048) { let ptr = buf + off; - store(ptr, c1 >> 6 | 192); - store(ptr, c1 & 63 | 128, 1); + store(ptr, c1 >> 6 | 192); + store(ptr, c1 & 63 | 128, 1); off += 2; ++pos; } else { let ptr = buf + off; @@ -501,15 +507,15 @@ import { ArrayBufferView } from "./arraybuffer"; c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); store(ptr, c1 >> 18 | 240); store(ptr, c1 >> 12 & 63 | 128, 1); - store(ptr, c1 >> 6 & 63 | 128, 2); + store(ptr, c1 >> 6 & 63 | 128, 2); store(ptr, c1 & 63 | 128, 3); off += 4; pos += 2; continue; } } - store(ptr, c1 >> 12 | 224); - store(ptr, c1 >> 6 & 63 | 128, 1); - store(ptr, c1 & 63 | 128, 2); + store(ptr, c1 >> 12 | 224); + store(ptr, c1 >> 6 & 63 | 128, 1); + store(ptr, c1 & 63 | 128, 2); off += 3; ++pos; } } diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index bef00ff3..2bae3b10 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -2358,7 +2358,7 @@ if i32.const 0 i32.const 1648 - i32.const 191 + i32.const 197 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 7db944f4..07505064 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -3416,7 +3416,7 @@ if i32.const 0 i32.const 1648 - i32.const 191 + i32.const 197 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index c2d8d100..191b024f 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -142,7 +142,7 @@ if i32.const 0 i32.const 64 - i32.const 166 + i32.const 172 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index 91f9859a..90a4ecc6 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -218,7 +218,7 @@ if i32.const 0 i32.const 64 - i32.const 166 + i32.const 172 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index a0913776..6a118b84 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -6294,7 +6294,7 @@ if i32.const 0 i32.const 4376 - i32.const 191 + i32.const 197 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 7eb738c1..47efea75 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -9713,7 +9713,7 @@ if i32.const 0 i32.const 4376 - i32.const 191 + i32.const 197 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index b9a764de..a09df18d 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -1551,7 +1551,7 @@ if i32.const 0 i32.const 96 - i32.const 449 + i32.const 455 i32.const 8 call $~lib/env/abort unreachable @@ -1598,7 +1598,7 @@ if i32.const 0 i32.const 96 - i32.const 453 + i32.const 459 i32.const 8 call $~lib/env/abort unreachable @@ -1677,7 +1677,7 @@ if i32.const 0 i32.const 96 - i32.const 465 + i32.const 471 i32.const 8 call $~lib/env/abort unreachable @@ -1732,7 +1732,7 @@ if i32.const 0 i32.const 96 - i32.const 474 + i32.const 480 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string-utf8.untouched.wat b/tests/compiler/std/string-utf8.untouched.wat index de0b0327..0797cdd4 100644 --- a/tests/compiler/std/string-utf8.untouched.wat +++ b/tests/compiler/std/string-utf8.untouched.wat @@ -2033,7 +2033,7 @@ if i32.const 0 i32.const 96 - i32.const 449 + i32.const 455 i32.const 8 call $~lib/env/abort unreachable @@ -2087,7 +2087,7 @@ if i32.const 0 i32.const 96 - i32.const 453 + i32.const 459 i32.const 8 call $~lib/env/abort unreachable @@ -2182,7 +2182,7 @@ if i32.const 0 i32.const 96 - i32.const 465 + i32.const 471 i32.const 8 call $~lib/env/abort unreachable @@ -2245,7 +2245,7 @@ if i32.const 0 i32.const 96 - i32.const 474 + i32.const 480 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 94219996..7a484a37 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -21,30 +21,30 @@ (data (i32.const 24) "h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g") (data (i32.const 56) "\01\00\00\00\1a") (data (i32.const 72) "s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 104) "\01\00\00\00\1e") - (data (i32.const 120) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 152) "\01\00\00\00\02") - (data (i32.const 176) "\01\00\00\00\02") - (data (i32.const 192) "6") - (data (i32.const 200) "\01\00\00\00\1c") - (data (i32.const 216) "~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 248) "\01\00\00\00\04") - (data (i32.const 264) "4\d8\06\df") - (data (i32.const 272) "\01\00\00\00\04") - (data (i32.const 288) "h\00i") - (data (i32.const 296) "\01\00\00\00\08") - (data (i32.const 312) "n\00u\00l\00l") - (data (i32.const 320) "\01\00\00\00\0c") - (data (i32.const 336) "s\00t\00r\00i\00n\00g") - (data (i32.const 352) "\01\00\00\00\06") - (data (i32.const 368) "I\00\'\00m") - (data (i32.const 376) "\01\00\00\00\02") - (data (i32.const 392) " ") - (data (i32.const 400) "\01") - (data (i32.const 416) "\01\00\00\00\06") - (data (i32.const 432) " \00 \00 ") - (data (i32.const 440) "\01\00\00\00\02") - (data (i32.const 456) "a") + (data (i32.const 104) "\01") + (data (i32.const 120) "\01\00\00\00\02") + (data (i32.const 144) "\01\00\00\00\02") + (data (i32.const 160) "a") + (data (i32.const 168) "\01\00\00\00\1e") + (data (i32.const 184) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") + (data (i32.const 216) "\01\00\00\00\02") + (data (i32.const 232) "6") + (data (i32.const 240) "\01\00\00\00\1c") + (data (i32.const 256) "~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") + (data (i32.const 288) "\01\00\00\00\04") + (data (i32.const 304) "4\d8\06\df") + (data (i32.const 312) "\01\00\00\00\04") + (data (i32.const 328) "h\00i") + (data (i32.const 336) "\01\00\00\00\08") + (data (i32.const 352) "n\00u\00l\00l") + (data (i32.const 360) "\01\00\00\00\0c") + (data (i32.const 376) "s\00t\00r\00i\00n\00g") + (data (i32.const 392) "\01\00\00\00\06") + (data (i32.const 408) "I\00\'\00m") + (data (i32.const 416) "\01\00\00\00\02") + (data (i32.const 432) " ") + (data (i32.const 440) "\01\00\00\00\06") + (data (i32.const 456) " \00 \00 ") (data (i32.const 464) "\01\00\00\00\06") (data (i32.const 480) "a\00b\00c") (data (i32.const 488) "\01\00\00\00\n") @@ -446,7 +446,7 @@ i32.le_u if i32.const 0 - i32.const 120 + i32.const 184 i32.const 102 i32.const 6 call $~lib/env/abort @@ -461,7 +461,7 @@ i32.ne if i32.const 0 - i32.const 120 + i32.const 184 i32.const 104 i32.const 6 call $~lib/env/abort @@ -577,7 +577,7 @@ i32.gt_u if i32.const 0 - i32.const 216 + i32.const 256 i32.const 26 i32.const 4 call $~lib/env/abort @@ -632,13 +632,13 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 166 + i32.const 256 + i32.const 172 i32.const 4 call $~lib/env/abort unreachable end - i32.const 276 + i32.const 316 i32.load i32.const 1 i32.shr_u @@ -667,7 +667,7 @@ end local.get $0 local.get $3 - i32.const 288 + i32.const 328 local.get $2 call $~lib/util/string/compareImpl i32.eqz @@ -680,13 +680,13 @@ i32.eqz if i32.const 0 - i32.const 216 + i32.const 256 i32.const 79 i32.const 4 call $~lib/env/abort unreachable end - i32.const 324 + i32.const 364 i32.load i32.const 1 i32.shr_u @@ -715,7 +715,7 @@ end local.get $0 local.get $1 - i32.const 336 + i32.const 376 local.get $2 call $~lib/util/string/compareImpl i32.eqz @@ -728,14 +728,14 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 135 + i32.const 256 + i32.const 141 i32.const 4 call $~lib/env/abort unreachable end local.get $1 - i32.const 312 + i32.const 352 local.get $1 select local.tee $4 @@ -1879,8 +1879,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 283 + i32.const 256 + i32.const 289 i32.const 4 call $~lib/env/abort unreachable @@ -1974,8 +1974,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 304 + i32.const 256 + i32.const 310 i32.const 4 call $~lib/env/abort unreachable @@ -2070,8 +2070,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 151 + i32.const 256 + i32.const 157 i32.const 4 call $~lib/env/abort unreachable @@ -2084,7 +2084,7 @@ i32.shr_u local.set $3 local.get $1 - i32.const 312 + i32.const 352 local.get $1 select local.tee $4 @@ -2492,8 +2492,8 @@ end if i32.const 0 - i32.const 216 - i32.const 571 + i32.const 256 + i32.const 577 i32.const 10 call $~lib/env/abort unreachable @@ -2557,7 +2557,7 @@ (local $3 i32) (local $4 i32) local.get $1 - i32.const 312 + i32.const 352 local.get $1 select local.tee $3 @@ -2582,7 +2582,7 @@ local.tee $2 i32.eqz if - i32.const 416 + i32.const 120 return end local.get $2 @@ -2603,7 +2603,7 @@ ) (func $~lib/string/String.__concat (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 312 + i32.const 352 local.get $0 select local.get $1 @@ -2752,7 +2752,7 @@ i32.eqz ) (func $~lib/string/String.__lte (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 416 + i32.const 120 local.get $0 call $~lib/string/String.__gt i32.eqz @@ -2764,8 +2764,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 325 + i32.const 256 + i32.const 331 i32.const 4 call $~lib/env/abort unreachable @@ -2794,8 +2794,8 @@ end if i32.const 0 - i32.const 216 - i32.const 330 + i32.const 256 + i32.const 336 i32.const 6 call $~lib/env/abort unreachable @@ -2810,7 +2810,7 @@ i32.eqz end if - i32.const 416 + i32.const 120 return end local.get $1 @@ -2895,7 +2895,7 @@ i32.const 0 i32.le_s if - i32.const 416 + i32.const 120 return end local.get $2 @@ -3265,7 +3265,7 @@ i32.le_u if i32.const 0 - i32.const 120 + i32.const 184 i32.const 64 i32.const 10 call $~lib/env/abort @@ -3383,8 +3383,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 352 + i32.const 256 + i32.const 358 i32.const 4 call $~lib/env/abort unreachable @@ -3440,7 +3440,7 @@ call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 - i32.const 416 + i32.const 120 i32.store local.get $0 return @@ -3549,7 +3549,7 @@ call $~lib/array/Array<~lib/string/String>#push else local.get $2 - i32.const 416 + i32.const 120 call $~lib/array/Array<~lib/string/String>#push end local.get $5 @@ -3616,7 +3616,7 @@ call $~lib/array/Array<~lib/string/String>#push else local.get $2 - i32.const 416 + i32.const 120 call $~lib/array/Array<~lib/string/String>#push end local.get $2 @@ -5118,8 +5118,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 191 + i32.const 256 + i32.const 197 i32.const 4 call $~lib/env/abort unreachable @@ -5170,7 +5170,7 @@ local.tee $3 i32.eqz if - i32.const 416 + i32.const 120 return end local.get $2 @@ -5212,7 +5212,7 @@ i32.le_u if i32.const 0 - i32.const 120 + i32.const 184 i32.const 89 i32.const 6 call $~lib/env/abort @@ -5226,7 +5226,7 @@ i32.ne if i32.const 0 - i32.const 120 + i32.const 184 i32.const 91 i32.const 6 call $~lib/env/abort @@ -5333,15 +5333,10 @@ call $~lib/env/abort unreachable end - i32.const 6736 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 0 - call $~lib/string/String.fromCharCode - i32.const 168 - call $~lib/string/String.__eq - i32.eqz + i32.const 108 + i32.load + i32.const 1 + i32.shr_u if i32.const 0 i32.const 72 @@ -5350,11 +5345,14 @@ call $~lib/env/abort unreachable end - i32.const 54 - call $~lib/string/String.fromCharCode - i32.const 192 - call $~lib/string/String.__eq + i32.const 124 + i32.load + i32.const 1 + i32.shr_u i32.eqz + i32.eqz + i32.const 1 + i32.ne if i32.const 0 i32.const 72 @@ -5363,11 +5361,14 @@ call $~lib/env/abort unreachable end - i32.const 65590 - call $~lib/string/String.fromCharCode - i32.const 192 - call $~lib/string/String.__eq + i32.const 148 + i32.load + i32.const 1 + i32.shr_u i32.eqz + i32.eqz + i32.const 1 + i32.ne if i32.const 0 i32.const 72 @@ -5376,9 +5377,13 @@ call $~lib/env/abort unreachable end + i32.const 6736 + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 - call $~lib/string/String.fromCodePoint - i32.const 168 + call $~lib/string/String.fromCharCode + i32.const 136 call $~lib/string/String.__eq i32.eqz if @@ -5390,8 +5395,8 @@ unreachable end i32.const 54 - call $~lib/string/String.fromCodePoint - i32.const 192 + call $~lib/string/String.fromCharCode + i32.const 232 call $~lib/string/String.__eq i32.eqz if @@ -5402,13 +5407,52 @@ call $~lib/env/abort unreachable end + i32.const 65590 + call $~lib/string/String.fromCharCode + i32.const 232 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 28 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + call $~lib/string/String.fromCodePoint + i32.const 136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 30 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 54 + call $~lib/string/String.fromCodePoint + i32.const 232 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 31 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 119558 call $~lib/string/String.fromCodePoint i32.eqz if - i32.const 264 + i32.const 304 i32.const 72 - i32.const 28 + i32.const 32 i32.const 0 call $~lib/env/abort unreachable @@ -5419,7 +5463,7 @@ if i32.const 0 i32.const 72 - i32.const 30 + i32.const 34 i32.const 0 call $~lib/env/abort unreachable @@ -5427,50 +5471,6 @@ global.get $std/string/str call $~lib/string/String#endsWith i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 31 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 368 - i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 - i32.eq - if - i32.const 0 - i32.const 72 - i32.const 32 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 0 - i32.const 392 - call $~lib/string/String#padStart - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 34 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 15 - i32.const 392 - call $~lib/string/String#padStart - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz if i32.const 0 i32.const 72 @@ -5479,13 +5479,12 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 3 - i32.const 392 - call $~lib/string/String#padStart - i32.const 432 - call $~lib/string/String.__eq - i32.eqz + global.get $std/string/str + i32.const 408 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq if i32.const 0 i32.const 72 @@ -5494,26 +5493,11 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 10 - i32.const 416 + global.get $std/string/str + i32.const 0 + i32.const 432 call $~lib/string/String#padStart - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 37 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 100 - i32.const 416 - call $~lib/string/String#padStart - i32.const 456 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5524,9 +5508,69 @@ call $~lib/env/abort unreachable end + global.get $std/string/str + i32.const 15 + i32.const 432 + call $~lib/string/String#padStart + global.get $std/string/str + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 39 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 3 + i32.const 432 + call $~lib/string/String#padStart + i32.const 456 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 40 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padStart + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 41 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 100 + i32.const 120 + call $~lib/string/String#padStart + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 42 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 480 i32.const 5 - i32.const 392 + i32.const 432 call $~lib/string/String#padStart i32.const 504 call $~lib/string/String.__eq @@ -5534,7 +5578,7 @@ if i32.const 0 i32.const 72 - i32.const 39 + i32.const 43 i32.const 0 call $~lib/env/abort unreachable @@ -5549,7 +5593,7 @@ if i32.const 0 i32.const 72 - i32.const 40 + i32.const 44 i32.const 0 call $~lib/env/abort unreachable @@ -5564,76 +5608,16 @@ if i32.const 0 i32.const 72 - i32.const 41 + i32.const 45 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str i32.const 0 - i32.const 392 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 43 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 15 - i32.const 392 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 44 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 3 - i32.const 392 - call $~lib/string/String#padEnd i32.const 432 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 45 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 10 - i32.const 416 call $~lib/string/String#padEnd - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 46 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 100 - i32.const 416 - call $~lib/string/String#padEnd - i32.const 456 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5644,9 +5628,69 @@ call $~lib/env/abort unreachable end + global.get $std/string/str + i32.const 15 + i32.const 432 + call $~lib/string/String#padEnd + global.get $std/string/str + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 48 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 3 + i32.const 432 + call $~lib/string/String#padEnd + i32.const 456 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 49 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padEnd + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 50 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 100 + i32.const 120 + call $~lib/string/String#padEnd + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 51 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 480 i32.const 5 - i32.const 392 + i32.const 432 call $~lib/string/String#padEnd i32.const 624 call $~lib/string/String.__eq @@ -5654,7 +5698,7 @@ if i32.const 0 i32.const 72 - i32.const 48 + i32.const 52 i32.const 0 call $~lib/env/abort unreachable @@ -5669,7 +5713,7 @@ if i32.const 0 i32.const 72 - i32.const 49 + i32.const 53 i32.const 0 call $~lib/env/abort unreachable @@ -5684,25 +5728,25 @@ if i32.const 0 i32.const 72 - i32.const 50 + i32.const 54 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 + i32.const 120 + i32.const 120 i32.const 0 call $~lib/string/String#indexOf if i32.const 0 i32.const 72 - i32.const 52 + i32.const 56 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 288 + i32.const 120 + i32.const 328 i32.const 0 call $~lib/string/String#indexOf i32.const -1 @@ -5710,19 +5754,19 @@ if i32.const 0 i32.const 72 - i32.const 53 + i32.const 57 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 - i32.const 456 + i32.const 160 + i32.const 160 i32.const 0 call $~lib/string/String#indexOf if i32.const 0 i32.const 72 - i32.const 54 + i32.const 58 i32.const 0 call $~lib/env/abort unreachable @@ -5735,19 +5779,19 @@ if i32.const 0 i32.const 72 - i32.const 55 + i32.const 59 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str - i32.const 416 + i32.const 120 i32.const 0 call $~lib/string/String#indexOf if i32.const 0 i32.const 72 - i32.const 56 + i32.const 60 i32.const 0 call $~lib/env/abort unreachable @@ -5761,7 +5805,7 @@ if i32.const 0 i32.const 72 - i32.const 57 + i32.const 61 i32.const 0 call $~lib/env/abort unreachable @@ -5775,7 +5819,7 @@ if i32.const 0 i32.const 72 - i32.const 58 + i32.const 62 i32.const 0 call $~lib/env/abort unreachable @@ -5789,7 +5833,7 @@ if i32.const 0 i32.const 72 - i32.const 59 + i32.const 63 i32.const 0 call $~lib/env/abort unreachable @@ -5803,7 +5847,7 @@ if i32.const 0 i32.const 72 - i32.const 60 + i32.const 64 i32.const 0 call $~lib/env/abort unreachable @@ -5817,25 +5861,25 @@ if i32.const 0 i32.const 72 - i32.const 61 + i32.const 65 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 + i32.const 120 + i32.const 120 i32.const 2147483647 call $~lib/string/String#lastIndexOf if i32.const 0 i32.const 72 - i32.const 63 + i32.const 67 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 288 + i32.const 120 + i32.const 328 i32.const 2147483647 call $~lib/string/String#lastIndexOf i32.const -1 @@ -5843,13 +5887,13 @@ if i32.const 0 i32.const 72 - i32.const 64 + i32.const 68 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str - i32.const 416 + i32.const 120 i32.const 2147483647 call $~lib/string/String#lastIndexOf global.get $std/string/str @@ -5862,7 +5906,7 @@ if i32.const 0 i32.const 72 - i32.const 65 + i32.const 69 i32.const 0 call $~lib/env/abort unreachable @@ -5876,7 +5920,7 @@ if i32.const 0 i32.const 72 - i32.const 66 + i32.const 70 i32.const 0 call $~lib/env/abort unreachable @@ -5890,7 +5934,7 @@ if i32.const 0 i32.const 72 - i32.const 67 + i32.const 71 i32.const 0 call $~lib/env/abort unreachable @@ -5904,7 +5948,7 @@ if i32.const 0 i32.const 72 - i32.const 68 + i32.const 72 i32.const 0 call $~lib/env/abort unreachable @@ -5918,7 +5962,7 @@ if i32.const 0 i32.const 72 - i32.const 69 + i32.const 73 i32.const 0 call $~lib/env/abort unreachable @@ -5932,7 +5976,7 @@ if i32.const 0 i32.const 72 - i32.const 70 + i32.const 74 i32.const 0 call $~lib/env/abort unreachable @@ -5946,7 +5990,7 @@ if i32.const 0 i32.const 72 - i32.const 71 + i32.const 75 i32.const 0 call $~lib/env/abort unreachable @@ -5960,19 +6004,19 @@ if i32.const 0 i32.const 72 - i32.const 72 + i32.const 76 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str - i32.const 288 + i32.const 328 i32.const 0 call $~lib/string/String#lastIndexOf if i32.const 0 i32.const 72 - i32.const 73 + i32.const 77 i32.const 0 call $~lib/env/abort unreachable @@ -5984,7 +6028,7 @@ if i32.const 0 i32.const 72 - i32.const 79 + i32.const 83 i32.const 0 call $~lib/env/abort unreachable @@ -5996,7 +6040,7 @@ if i32.const 0 i32.const 72 - i32.const 80 + i32.const 84 i32.const 0 call $~lib/env/abort unreachable @@ -6008,7 +6052,7 @@ if i32.const 0 i32.const 72 - i32.const 81 + i32.const 85 i32.const 0 call $~lib/env/abort unreachable @@ -6020,7 +6064,7 @@ if i32.const 0 i32.const 72 - i32.const 82 + i32.const 86 i32.const 0 call $~lib/env/abort unreachable @@ -6032,7 +6076,7 @@ if i32.const 0 i32.const 72 - i32.const 83 + i32.const 87 i32.const 0 call $~lib/env/abort unreachable @@ -6044,7 +6088,7 @@ if i32.const 0 i32.const 72 - i32.const 84 + i32.const 88 i32.const 0 call $~lib/env/abort unreachable @@ -6056,7 +6100,7 @@ if i32.const 0 i32.const 72 - i32.const 85 + i32.const 89 i32.const 0 call $~lib/env/abort unreachable @@ -6068,7 +6112,7 @@ if i32.const 0 i32.const 72 - i32.const 86 + i32.const 90 i32.const 0 call $~lib/env/abort unreachable @@ -6080,7 +6124,7 @@ if i32.const 0 i32.const 72 - i32.const 88 + i32.const 92 i32.const 0 call $~lib/env/abort unreachable @@ -6092,7 +6136,7 @@ if i32.const 0 i32.const 72 - i32.const 89 + i32.const 93 i32.const 0 call $~lib/env/abort unreachable @@ -6104,7 +6148,7 @@ if i32.const 0 i32.const 72 - i32.const 90 + i32.const 94 i32.const 0 call $~lib/env/abort unreachable @@ -6116,7 +6160,7 @@ if i32.const 0 i32.const 72 - i32.const 91 + i32.const 95 i32.const 0 call $~lib/env/abort unreachable @@ -6128,12 +6172,12 @@ if i32.const 0 i32.const 72 - i32.const 92 + i32.const 96 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 1144 call $~lib/string/String.__concat global.set $std/string/c @@ -6141,54 +6185,6 @@ i32.const 1168 call $~lib/string/String.__eq i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 95 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/c - i32.const 456 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 96 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 97 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - global.get $std/string/nullStr - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 98 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/nullStr - i32.const 416 - call $~lib/string/String.__ne - i32.eqz if i32.const 0 i32.const 72 @@ -6197,8 +6193,8 @@ call $~lib/env/abort unreachable end - i32.const 456 - i32.const 1144 + global.get $std/string/c + i32.const 160 call $~lib/string/String.__ne i32.eqz if @@ -6209,8 +6205,8 @@ call $~lib/env/abort unreachable end - i32.const 456 - i32.const 456 + i32.const 120 + i32.const 120 call $~lib/string/String.__eq i32.eqz if @@ -6221,6 +6217,54 @@ call $~lib/env/abort unreachable end + i32.const 120 + global.get $std/string/nullStr + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 102 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/string/nullStr + i32.const 120 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 103 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 1144 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 104 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 105 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 1192 i32.const 1216 call $~lib/string/String.__ne @@ -6228,7 +6272,7 @@ if i32.const 0 i32.const 72 - i32.const 102 + i32.const 106 i32.const 0 call $~lib/env/abort unreachable @@ -6240,7 +6284,7 @@ if i32.const 0 i32.const 72 - i32.const 103 + i32.const 107 i32.const 0 call $~lib/env/abort unreachable @@ -6252,7 +6296,7 @@ if i32.const 0 i32.const 72 - i32.const 104 + i32.const 108 i32.const 0 call $~lib/env/abort unreachable @@ -6264,7 +6308,7 @@ if i32.const 0 i32.const 72 - i32.const 105 + i32.const 109 i32.const 0 call $~lib/env/abort unreachable @@ -6276,7 +6320,7 @@ if i32.const 0 i32.const 72 - i32.const 106 + i32.const 110 i32.const 0 call $~lib/env/abort unreachable @@ -6288,7 +6332,7 @@ if i32.const 0 i32.const 72 - i32.const 107 + i32.const 111 i32.const 0 call $~lib/env/abort unreachable @@ -6300,31 +6344,31 @@ if i32.const 0 i32.const 72 - i32.const 108 + i32.const 112 i32.const 0 call $~lib/env/abort unreachable end i32.const 1144 - i32.const 456 + i32.const 160 call $~lib/string/String.__gt i32.eqz if i32.const 0 i32.const 72 - i32.const 110 + i32.const 114 i32.const 0 call $~lib/env/abort unreachable end i32.const 1496 - i32.const 456 + i32.const 160 call $~lib/string/String.__gt i32.eqz if i32.const 0 i32.const 72 - i32.const 111 + i32.const 115 i32.const 0 call $~lib/env/abort unreachable @@ -6336,7 +6380,7 @@ if i32.const 0 i32.const 72 - i32.const 112 + i32.const 116 i32.const 0 call $~lib/env/abort unreachable @@ -6345,39 +6389,6 @@ i32.const 1168 call $~lib/string/String.__gt i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 113 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1496 - i32.const 1168 - call $~lib/string/String.__lt - if - i32.const 0 - i32.const 72 - i32.const 114 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1144 - global.get $std/string/nullStr - call $~lib/string/String.__lt - if - i32.const 0 - i32.const 72 - i32.const 116 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/nullStr - i32.const 1144 - call $~lib/string/String.__lt if i32.const 0 i32.const 72 @@ -6386,22 +6397,20 @@ call $~lib/env/abort unreachable end - i32.const 480 - i32.const 416 - call $~lib/string/String.__gt - i32.eqz + i32.const 1496 + i32.const 1168 + call $~lib/string/String.__lt if i32.const 0 i32.const 72 - i32.const 119 + i32.const 118 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 480 + i32.const 1144 + global.get $std/string/nullStr call $~lib/string/String.__lt - i32.eqz if i32.const 0 i32.const 72 @@ -6410,10 +6419,9 @@ call $~lib/env/abort unreachable end - i32.const 480 - i32.const 416 - call $~lib/string/String.__gte - i32.eqz + global.get $std/string/nullStr + i32.const 1144 + call $~lib/string/String.__lt if i32.const 0 i32.const 72 @@ -6423,19 +6431,9 @@ unreachable end i32.const 480 - call $~lib/string/String.__lte + i32.const 120 + call $~lib/string/String.__gt i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 122 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - i32.const 416 - call $~lib/string/String.__lt if i32.const 0 i32.const 72 @@ -6444,9 +6442,10 @@ call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 i32.const 480 - call $~lib/string/String.__gt + call $~lib/string/String.__lt + i32.eqz if i32.const 0 i32.const 72 @@ -6455,9 +6454,10 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__lt + i32.const 480 + i32.const 120 + call $~lib/string/String.__gte + i32.eqz if i32.const 0 i32.const 72 @@ -6466,9 +6466,9 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__gt + i32.const 480 + call $~lib/string/String.__lte + i32.eqz if i32.const 0 i32.const 72 @@ -6477,10 +6477,9 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__gte - i32.eqz + i32.const 480 + i32.const 120 + call $~lib/string/String.__lt if i32.const 0 i32.const 72 @@ -6489,13 +6488,58 @@ call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 + i32.const 480 + call $~lib/string/String.__gt + if + i32.const 0 + i32.const 72 + i32.const 128 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__lt + if + i32.const 0 + i32.const 72 + i32.const 129 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__gt + if + i32.const 0 + i32.const 72 + i32.const 130 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__gte + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 131 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 call $~lib/string/String.__lte i32.eqz if i32.const 0 i32.const 72 - i32.const 128 + i32.const 132 i32.const 0 call $~lib/env/abort unreachable @@ -6516,7 +6560,7 @@ if i32.const 0 i32.const 72 - i32.const 132 + i32.const 136 i32.const 0 call $~lib/env/abort unreachable @@ -6527,48 +6571,6 @@ i32.shr_u i32.const 3 i32.ne - if - i32.const 0 - i32.const 72 - i32.const 134 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 100 - call $~lib/string/String#repeat - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 136 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 0 - call $~lib/string/String#repeat - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 137 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 1 - call $~lib/string/String#repeat - i32.const 456 - call $~lib/string/String.__eq - i32.eqz if i32.const 0 i32.const 72 @@ -6577,7 +6579,49 @@ call $~lib/env/abort unreachable end - i32.const 456 + i32.const 120 + i32.const 100 + call $~lib/string/String#repeat + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 140 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 0 + call $~lib/string/String#repeat + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 141 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 1 + call $~lib/string/String#repeat + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 142 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 i32.const 2 call $~lib/string/String#repeat i32.const 1520 @@ -6586,12 +6630,12 @@ if i32.const 0 i32.const 72 - i32.const 139 + i32.const 143 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 3 call $~lib/string/String#repeat i32.const 1544 @@ -6600,7 +6644,7 @@ if i32.const 0 i32.const 72 - i32.const 140 + i32.const 144 i32.const 0 call $~lib/env/abort unreachable @@ -6614,12 +6658,12 @@ if i32.const 0 i32.const 72 - i32.const 141 + i32.const 145 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 5 call $~lib/string/String#repeat i32.const 1600 @@ -6628,12 +6672,12 @@ if i32.const 0 i32.const 72 - i32.const 142 + i32.const 146 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 6 call $~lib/string/String#repeat i32.const 1632 @@ -6642,12 +6686,12 @@ if i32.const 0 i32.const 72 - i32.const 143 + i32.const 147 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 7 call $~lib/string/String#repeat i32.const 1664 @@ -6656,7 +6700,7 @@ if i32.const 0 i32.const 72 - i32.const 144 + i32.const 148 i32.const 0 call $~lib/env/abort unreachable @@ -6673,7 +6717,7 @@ if i32.const 0 i32.const 72 - i32.const 148 + i32.const 152 i32.const 0 call $~lib/env/abort unreachable @@ -6688,7 +6732,7 @@ if i32.const 0 i32.const 72 - i32.const 149 + i32.const 153 i32.const 0 call $~lib/env/abort unreachable @@ -6703,7 +6747,7 @@ if i32.const 0 i32.const 72 - i32.const 150 + i32.const 154 i32.const 0 call $~lib/env/abort unreachable @@ -6718,7 +6762,7 @@ if i32.const 0 i32.const 72 - i32.const 151 + i32.const 155 i32.const 0 call $~lib/env/abort unreachable @@ -6733,7 +6777,7 @@ if i32.const 0 i32.const 72 - i32.const 152 + i32.const 156 i32.const 0 call $~lib/env/abort unreachable @@ -6742,13 +6786,13 @@ i32.const 4 i32.const 3 call $~lib/string/String#slice - i32.const 416 + i32.const 120 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 153 + i32.const 157 i32.const 0 call $~lib/env/abort unreachable @@ -6763,12 +6807,12 @@ if i32.const 0 i32.const 72 - i32.const 154 + i32.const 158 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 i32.const 0 i32.const 2147483647 call $~lib/string/String#split @@ -6782,7 +6826,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq local.set $0 end @@ -6791,13 +6835,13 @@ if i32.const 0 i32.const 72 - i32.const 159 + i32.const 163 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 + i32.const 120 + i32.const 120 i32.const 2147483647 call $~lib/string/String#split global.set $std/string/sa @@ -6806,12 +6850,12 @@ if i32.const 0 i32.const 72 - i32.const 161 + i32.const 165 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 i32.const 720 i32.const 2147483647 call $~lib/string/String#split @@ -6825,7 +6869,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq local.set $0 end @@ -6834,7 +6878,7 @@ if i32.const 0 i32.const 72 - i32.const 163 + i32.const 167 i32.const 0 call $~lib/env/abort unreachable @@ -6862,7 +6906,7 @@ if i32.const 0 i32.const 72 - i32.const 165 + i32.const 169 i32.const 0 call $~lib/env/abort unreachable @@ -6883,7 +6927,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -6912,7 +6956,7 @@ if i32.const 0 i32.const 72 - i32.const 167 + i32.const 171 i32.const 0 call $~lib/env/abort unreachable @@ -6933,7 +6977,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -6962,7 +7006,7 @@ if i32.const 0 i32.const 72 - i32.const 169 + i32.const 173 i32.const 0 call $~lib/env/abort unreachable @@ -6984,7 +7028,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7004,7 +7048,7 @@ global.get $std/string/sa i32.const 2 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq local.set $0 end @@ -7023,7 +7067,7 @@ if i32.const 0 i32.const 72 - i32.const 171 + i32.const 175 i32.const 0 call $~lib/env/abort unreachable @@ -7045,7 +7089,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq local.set $0 end @@ -7055,7 +7099,7 @@ global.get $std/string/sa i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7084,7 +7128,7 @@ if i32.const 0 i32.const 72 - i32.const 173 + i32.const 177 i32.const 0 call $~lib/env/abort unreachable @@ -7106,7 +7150,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7136,7 +7180,7 @@ global.get $std/string/sa i32.const 3 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq local.set $0 end @@ -7145,13 +7189,13 @@ if i32.const 0 i32.const 72 - i32.const 175 + i32.const 179 i32.const 0 call $~lib/env/abort unreachable end i32.const 480 - i32.const 416 + i32.const 120 i32.const 2147483647 call $~lib/string/String#split global.set $std/string/sa @@ -7166,7 +7210,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7195,13 +7239,13 @@ if i32.const 0 i32.const 72 - i32.const 177 + i32.const 181 i32.const 0 call $~lib/env/abort unreachable end i32.const 480 - i32.const 416 + i32.const 120 i32.const 0 call $~lib/string/String#split global.set $std/string/sa @@ -7210,13 +7254,13 @@ if i32.const 0 i32.const 72 - i32.const 179 + i32.const 183 i32.const 0 call $~lib/env/abort unreachable end i32.const 480 - i32.const 416 + i32.const 120 i32.const 1 call $~lib/string/String#split global.set $std/string/sa @@ -7229,7 +7273,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7238,7 +7282,7 @@ if i32.const 0 i32.const 72 - i32.const 181 + i32.const 185 i32.const 0 call $~lib/env/abort unreachable @@ -7257,7 +7301,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7266,13 +7310,13 @@ if i32.const 0 i32.const 72 - i32.const 183 + i32.const 187 i32.const 0 call $~lib/env/abort unreachable end i32.const 480 - i32.const 416 + i32.const 120 i32.const 4 call $~lib/string/String#split global.set $std/string/sa @@ -7287,107 +7331,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1144 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2016 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 185 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - i32.const 416 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - local.tee $0 - if - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1144 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2016 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 187 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1960 - i32.const 720 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - local.tee $0 - if - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq local.set $0 end @@ -7421,6 +7365,106 @@ call $~lib/env/abort unreachable end + i32.const 480 + i32.const 120 + i32.const -1 + call $~lib/string/String#split + global.set $std/string/sa + block (result i32) + block (result i32) + global.get $std/string/sa + i32.load offset=12 + i32.const 3 + i32.eq + local.tee $0 + if + global.get $std/string/sa + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 160 + call $~lib/string/String.__eq + local.set $0 + end + local.get $0 + end + if + global.get $std/string/sa + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 1144 + call $~lib/string/String.__eq + local.set $0 + end + local.get $0 + end + if + global.get $std/string/sa + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 2016 + call $~lib/string/String.__eq + local.set $0 + end + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 191 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 1960 + i32.const 720 + i32.const -1 + call $~lib/string/String#split + global.set $std/string/sa + block (result i32) + block (result i32) + global.get $std/string/sa + i32.load offset=12 + i32.const 3 + i32.eq + local.tee $0 + if + global.get $std/string/sa + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 160 + call $~lib/string/String.__eq + local.set $0 + end + local.get $0 + end + if + global.get $std/string/sa + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 1144 + call $~lib/string/String.__eq + local.set $0 + end + local.get $0 + end + if + global.get $std/string/sa + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 2016 + call $~lib/string/String.__eq + local.set $0 + end + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 193 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 0 call $~lib/util/number/itoa32 i32.const 840 @@ -7429,7 +7473,7 @@ if i32.const 0 i32.const 72 - i32.const 191 + i32.const 195 i32.const 0 call $~lib/env/abort unreachable @@ -7442,7 +7486,7 @@ if i32.const 0 i32.const 72 - i32.const 192 + i32.const 196 i32.const 0 call $~lib/env/abort unreachable @@ -7455,7 +7499,7 @@ if i32.const 0 i32.const 72 - i32.const 193 + i32.const 197 i32.const 0 call $~lib/env/abort unreachable @@ -7468,7 +7512,7 @@ if i32.const 0 i32.const 72 - i32.const 194 + i32.const 198 i32.const 0 call $~lib/env/abort unreachable @@ -7481,7 +7525,7 @@ if i32.const 0 i32.const 72 - i32.const 195 + i32.const 199 i32.const 0 call $~lib/env/abort unreachable @@ -7494,7 +7538,7 @@ if i32.const 0 i32.const 72 - i32.const 196 + i32.const 200 i32.const 0 call $~lib/env/abort unreachable @@ -7507,7 +7551,7 @@ if i32.const 0 i32.const 72 - i32.const 197 + i32.const 201 i32.const 0 call $~lib/env/abort unreachable @@ -7520,7 +7564,7 @@ if i32.const 0 i32.const 72 - i32.const 198 + i32.const 202 i32.const 0 call $~lib/env/abort unreachable @@ -7533,7 +7577,7 @@ if i32.const 0 i32.const 72 - i32.const 199 + i32.const 203 i32.const 0 call $~lib/env/abort unreachable @@ -7546,7 +7590,7 @@ if i32.const 0 i32.const 72 - i32.const 200 + i32.const 204 i32.const 0 call $~lib/env/abort unreachable @@ -7559,7 +7603,7 @@ if i32.const 0 i32.const 72 - i32.const 201 + i32.const 205 i32.const 0 call $~lib/env/abort unreachable @@ -7572,7 +7616,7 @@ if i32.const 0 i32.const 72 - i32.const 202 + i32.const 206 i32.const 0 call $~lib/env/abort unreachable @@ -7585,7 +7629,7 @@ if i32.const 0 i32.const 72 - i32.const 203 + i32.const 207 i32.const 0 call $~lib/env/abort unreachable @@ -7598,7 +7642,7 @@ if i32.const 0 i32.const 72 - i32.const 204 + i32.const 208 i32.const 0 call $~lib/env/abort unreachable @@ -7611,7 +7655,7 @@ if i32.const 0 i32.const 72 - i32.const 206 + i32.const 210 i32.const 0 call $~lib/env/abort unreachable @@ -7624,7 +7668,7 @@ if i32.const 0 i32.const 72 - i32.const 207 + i32.const 211 i32.const 0 call $~lib/env/abort unreachable @@ -7637,7 +7681,7 @@ if i32.const 0 i32.const 72 - i32.const 208 + i32.const 212 i32.const 0 call $~lib/env/abort unreachable @@ -7650,7 +7694,7 @@ if i32.const 0 i32.const 72 - i32.const 209 + i32.const 213 i32.const 0 call $~lib/env/abort unreachable @@ -7663,7 +7707,7 @@ if i32.const 0 i32.const 72 - i32.const 210 + i32.const 214 i32.const 0 call $~lib/env/abort unreachable @@ -7676,7 +7720,7 @@ if i32.const 0 i32.const 72 - i32.const 212 + i32.const 216 i32.const 0 call $~lib/env/abort unreachable @@ -7689,7 +7733,7 @@ if i32.const 0 i32.const 72 - i32.const 213 + i32.const 217 i32.const 0 call $~lib/env/abort unreachable @@ -7702,7 +7746,7 @@ if i32.const 0 i32.const 72 - i32.const 214 + i32.const 218 i32.const 0 call $~lib/env/abort unreachable @@ -7715,7 +7759,7 @@ if i32.const 0 i32.const 72 - i32.const 215 + i32.const 219 i32.const 0 call $~lib/env/abort unreachable @@ -7728,7 +7772,7 @@ if i32.const 0 i32.const 72 - i32.const 216 + i32.const 220 i32.const 0 call $~lib/env/abort unreachable @@ -7741,7 +7785,7 @@ if i32.const 0 i32.const 72 - i32.const 217 + i32.const 221 i32.const 0 call $~lib/env/abort unreachable @@ -7754,7 +7798,7 @@ if i32.const 0 i32.const 72 - i32.const 218 + i32.const 222 i32.const 0 call $~lib/env/abort unreachable @@ -7767,7 +7811,7 @@ if i32.const 0 i32.const 72 - i32.const 219 + i32.const 223 i32.const 0 call $~lib/env/abort unreachable @@ -7780,7 +7824,7 @@ if i32.const 0 i32.const 72 - i32.const 220 + i32.const 224 i32.const 0 call $~lib/env/abort unreachable @@ -7793,7 +7837,7 @@ if i32.const 0 i32.const 72 - i32.const 221 + i32.const 225 i32.const 0 call $~lib/env/abort unreachable @@ -7806,7 +7850,7 @@ if i32.const 0 i32.const 72 - i32.const 222 + i32.const 226 i32.const 0 call $~lib/env/abort unreachable @@ -7819,7 +7863,7 @@ if i32.const 0 i32.const 72 - i32.const 224 + i32.const 228 i32.const 0 call $~lib/env/abort unreachable @@ -7832,7 +7876,7 @@ if i32.const 0 i32.const 72 - i32.const 225 + i32.const 229 i32.const 0 call $~lib/env/abort unreachable @@ -7845,7 +7889,7 @@ if i32.const 0 i32.const 72 - i32.const 226 + i32.const 230 i32.const 0 call $~lib/env/abort unreachable @@ -7858,7 +7902,7 @@ if i32.const 0 i32.const 72 - i32.const 227 + i32.const 231 i32.const 0 call $~lib/env/abort unreachable @@ -7871,7 +7915,7 @@ if i32.const 0 i32.const 72 - i32.const 228 + i32.const 232 i32.const 0 call $~lib/env/abort unreachable @@ -7884,7 +7928,7 @@ if i32.const 0 i32.const 72 - i32.const 229 + i32.const 233 i32.const 0 call $~lib/env/abort unreachable @@ -7897,7 +7941,7 @@ if i32.const 0 i32.const 72 - i32.const 230 + i32.const 234 i32.const 0 call $~lib/env/abort unreachable @@ -7910,7 +7954,7 @@ if i32.const 0 i32.const 72 - i32.const 231 + i32.const 235 i32.const 0 call $~lib/env/abort unreachable @@ -7923,7 +7967,7 @@ if i32.const 0 i32.const 72 - i32.const 232 + i32.const 236 i32.const 0 call $~lib/env/abort unreachable @@ -7936,7 +7980,7 @@ if i32.const 0 i32.const 72 - i32.const 233 + i32.const 237 i32.const 0 call $~lib/env/abort unreachable @@ -7949,7 +7993,7 @@ if i32.const 0 i32.const 72 - i32.const 234 + i32.const 238 i32.const 0 call $~lib/env/abort unreachable @@ -7962,7 +8006,7 @@ if i32.const 0 i32.const 72 - i32.const 237 + i32.const 241 i32.const 0 call $~lib/env/abort unreachable @@ -7975,7 +8019,7 @@ if i32.const 0 i32.const 72 - i32.const 238 + i32.const 242 i32.const 0 call $~lib/env/abort unreachable @@ -7988,7 +8032,7 @@ if i32.const 0 i32.const 72 - i32.const 239 + i32.const 243 i32.const 0 call $~lib/env/abort unreachable @@ -8001,7 +8045,7 @@ if i32.const 0 i32.const 72 - i32.const 240 + i32.const 244 i32.const 0 call $~lib/env/abort unreachable @@ -8014,7 +8058,7 @@ if i32.const 0 i32.const 72 - i32.const 241 + i32.const 245 i32.const 0 call $~lib/env/abort unreachable @@ -8027,7 +8071,7 @@ if i32.const 0 i32.const 72 - i32.const 242 + i32.const 246 i32.const 0 call $~lib/env/abort unreachable @@ -8040,7 +8084,7 @@ if i32.const 0 i32.const 72 - i32.const 243 + i32.const 247 i32.const 0 call $~lib/env/abort unreachable @@ -8053,7 +8097,7 @@ if i32.const 0 i32.const 72 - i32.const 244 + i32.const 248 i32.const 0 call $~lib/env/abort unreachable @@ -8066,7 +8110,7 @@ if i32.const 0 i32.const 72 - i32.const 245 + i32.const 249 i32.const 0 call $~lib/env/abort unreachable @@ -8079,7 +8123,7 @@ if i32.const 0 i32.const 72 - i32.const 246 + i32.const 250 i32.const 0 call $~lib/env/abort unreachable @@ -8092,7 +8136,7 @@ if i32.const 0 i32.const 72 - i32.const 247 + i32.const 251 i32.const 0 call $~lib/env/abort unreachable @@ -8105,7 +8149,7 @@ if i32.const 0 i32.const 72 - i32.const 250 + i32.const 254 i32.const 0 call $~lib/env/abort unreachable @@ -8118,7 +8162,7 @@ if i32.const 0 i32.const 72 - i32.const 251 + i32.const 255 i32.const 0 call $~lib/env/abort unreachable @@ -8131,7 +8175,7 @@ if i32.const 0 i32.const 72 - i32.const 252 + i32.const 256 i32.const 0 call $~lib/env/abort unreachable @@ -8144,7 +8188,7 @@ if i32.const 0 i32.const 72 - i32.const 253 + i32.const 257 i32.const 0 call $~lib/env/abort unreachable @@ -8157,7 +8201,7 @@ if i32.const 0 i32.const 72 - i32.const 254 + i32.const 258 i32.const 0 call $~lib/env/abort unreachable @@ -8170,7 +8214,7 @@ if i32.const 0 i32.const 72 - i32.const 260 + i32.const 264 i32.const 0 call $~lib/env/abort unreachable @@ -8183,7 +8227,7 @@ if i32.const 0 i32.const 72 - i32.const 261 + i32.const 265 i32.const 0 call $~lib/env/abort unreachable @@ -8196,7 +8240,7 @@ if i32.const 0 i32.const 72 - i32.const 262 + i32.const 266 i32.const 0 call $~lib/env/abort unreachable @@ -8209,7 +8253,7 @@ if i32.const 0 i32.const 72 - i32.const 263 + i32.const 267 i32.const 0 call $~lib/env/abort unreachable @@ -8222,7 +8266,7 @@ if i32.const 0 i32.const 72 - i32.const 265 + i32.const 269 i32.const 0 call $~lib/env/abort unreachable @@ -8235,7 +8279,7 @@ if i32.const 0 i32.const 72 - i32.const 266 + i32.const 270 i32.const 0 call $~lib/env/abort unreachable @@ -8248,7 +8292,7 @@ if i32.const 0 i32.const 72 - i32.const 267 + i32.const 271 i32.const 0 call $~lib/env/abort unreachable @@ -8261,7 +8305,7 @@ if i32.const 0 i32.const 72 - i32.const 268 + i32.const 272 i32.const 0 call $~lib/env/abort unreachable @@ -8274,7 +8318,7 @@ if i32.const 0 i32.const 72 - i32.const 269 + i32.const 273 i32.const 0 call $~lib/env/abort unreachable @@ -8287,7 +8331,7 @@ if i32.const 0 i32.const 72 - i32.const 270 + i32.const 274 i32.const 0 call $~lib/env/abort unreachable @@ -8300,7 +8344,7 @@ if i32.const 0 i32.const 72 - i32.const 272 + i32.const 276 i32.const 0 call $~lib/env/abort unreachable @@ -8313,7 +8357,7 @@ if i32.const 0 i32.const 72 - i32.const 273 + i32.const 277 i32.const 0 call $~lib/env/abort unreachable @@ -8326,7 +8370,7 @@ if i32.const 0 i32.const 72 - i32.const 274 + i32.const 278 i32.const 0 call $~lib/env/abort unreachable @@ -8339,7 +8383,7 @@ if i32.const 0 i32.const 72 - i32.const 275 + i32.const 279 i32.const 0 call $~lib/env/abort unreachable @@ -8352,7 +8396,7 @@ if i32.const 0 i32.const 72 - i32.const 276 + i32.const 280 i32.const 0 call $~lib/env/abort unreachable @@ -8365,7 +8409,7 @@ if i32.const 0 i32.const 72 - i32.const 277 + i32.const 281 i32.const 0 call $~lib/env/abort unreachable @@ -8378,7 +8422,7 @@ if i32.const 0 i32.const 72 - i32.const 278 + i32.const 282 i32.const 0 call $~lib/env/abort unreachable @@ -8391,7 +8435,7 @@ if i32.const 0 i32.const 72 - i32.const 279 + i32.const 283 i32.const 0 call $~lib/env/abort unreachable @@ -8404,7 +8448,7 @@ if i32.const 0 i32.const 72 - i32.const 280 + i32.const 284 i32.const 0 call $~lib/env/abort unreachable @@ -8417,7 +8461,7 @@ if i32.const 0 i32.const 72 - i32.const 282 + i32.const 286 i32.const 0 call $~lib/env/abort unreachable @@ -8430,7 +8474,7 @@ if i32.const 0 i32.const 72 - i32.const 283 + i32.const 287 i32.const 0 call $~lib/env/abort unreachable @@ -8443,7 +8487,7 @@ if i32.const 0 i32.const 72 - i32.const 285 + i32.const 289 i32.const 0 call $~lib/env/abort unreachable @@ -8456,7 +8500,7 @@ if i32.const 0 i32.const 72 - i32.const 286 + i32.const 290 i32.const 0 call $~lib/env/abort unreachable @@ -8469,7 +8513,7 @@ if i32.const 0 i32.const 72 - i32.const 287 + i32.const 291 i32.const 0 call $~lib/env/abort unreachable @@ -8482,7 +8526,7 @@ if i32.const 0 i32.const 72 - i32.const 288 + i32.const 292 i32.const 0 call $~lib/env/abort unreachable @@ -8495,7 +8539,7 @@ if i32.const 0 i32.const 72 - i32.const 290 + i32.const 294 i32.const 0 call $~lib/env/abort unreachable @@ -8508,7 +8552,7 @@ if i32.const 0 i32.const 72 - i32.const 291 + i32.const 295 i32.const 0 call $~lib/env/abort unreachable @@ -8521,7 +8565,7 @@ if i32.const 0 i32.const 72 - i32.const 292 + i32.const 296 i32.const 0 call $~lib/env/abort unreachable @@ -8534,7 +8578,7 @@ if i32.const 0 i32.const 72 - i32.const 293 + i32.const 297 i32.const 0 call $~lib/env/abort unreachable @@ -8547,7 +8591,7 @@ if i32.const 0 i32.const 72 - i32.const 294 + i32.const 298 i32.const 0 call $~lib/env/abort unreachable @@ -8560,7 +8604,7 @@ if i32.const 0 i32.const 72 - i32.const 295 + i32.const 299 i32.const 0 call $~lib/env/abort unreachable @@ -8573,7 +8617,7 @@ if i32.const 0 i32.const 72 - i32.const 296 + i32.const 300 i32.const 0 call $~lib/env/abort unreachable @@ -8586,7 +8630,7 @@ if i32.const 0 i32.const 72 - i32.const 297 + i32.const 301 i32.const 0 call $~lib/env/abort unreachable @@ -8599,7 +8643,7 @@ if i32.const 0 i32.const 72 - i32.const 298 + i32.const 302 i32.const 0 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string.ts b/tests/compiler/std/string.ts index 777dcce1..70c17600 100644 --- a/tests/compiler/std/string.ts +++ b/tests/compiler/std/string.ts @@ -19,6 +19,10 @@ assert(changetype(str) == changetype("hi, I'm a string")); assert(str.length == 16); assert(str.charCodeAt(0) == 0x68); +assert(!!"" == false); +assert(!!"\0" == true); +assert(!!"a" == true); + assert(String.fromCharCode(0) == "\0"); assert(String.fromCharCode(54) == "6"); assert(String.fromCharCode(0x10000 + 54) == "6"); @@ -223,8 +227,8 @@ assert(utoa64(u64.MAX_VALUE) == "18446744073709551615"); assert(itoa64(0) == "0"); assert(itoa64(-1234) == "-1234"); -assert(itoa64(0xffffffff) == "4294967295"); -assert(itoa64(-0xffffffff) == "-4294967295"); +assert(itoa64(0xffffffff) == "4294967295"); +assert(itoa64(-0xffffffff) == "-4294967295"); assert(itoa64(68719476735) == "68719476735"); assert(itoa64(-68719476735) == "-68719476735"); assert(itoa64(-868719476735) == "-868719476735"); @@ -234,13 +238,13 @@ assert(itoa64(i64.MAX_VALUE) == "9223372036854775807"); assert(itoa64(i64.MIN_VALUE) == "-9223372036854775808"); // special cases -assert(dtoa(0.0) == "0.0"); +assert(dtoa(0.0) == "0.0"); assert(dtoa(-0.0) == "0.0"); -assert(dtoa(NaN) == "NaN"); +assert(dtoa(NaN) == "NaN"); assert(dtoa(+Infinity) == "Infinity"); assert(dtoa(-Infinity) == "-Infinity"); -assert(dtoa(+f64.EPSILON) == "2.220446049250313e-16"); -assert(dtoa(-f64.EPSILON) == "-2.220446049250313e-16"); +assert(dtoa(+f64.EPSILON) == "2.220446049250313e-16"); +assert(dtoa(-f64.EPSILON) == "-2.220446049250313e-16"); assert(dtoa(+f64.MAX_VALUE) == "1.7976931348623157e+308"); assert(dtoa(-f64.MAX_VALUE) == "-1.7976931348623157e+308"); assert(dtoa(4.185580496821357e+298) == "4.185580496821357e+298"); @@ -257,44 +261,44 @@ assert(dtoa(5e-324) == "5e-324"); // Actual: 1.2344999999999999e+21 // assert(dtoa(1.2345e+21) == "1.2345e+21"); -assert(dtoa(1.0) == "1.0"); -assert(dtoa(0.1) == "0.1"); +assert(dtoa(1.0) == "1.0"); +assert(dtoa(0.1) == "0.1"); assert(dtoa(-1.0) == "-1.0"); assert(dtoa(-0.1) == "-0.1"); -assert(dtoa(1e+6) == "1000000.0"); -assert(dtoa(1e-6) == "0.000001"); +assert(dtoa(1e+6) == "1000000.0"); +assert(dtoa(1e-6) == "0.000001"); assert(dtoa(-1e+6) == "-1000000.0"); assert(dtoa(-1e-6) == "-0.000001"); -assert(dtoa(1e+7) == "10000000.0"); -assert(dtoa(1e-7) == "1e-7"); +assert(dtoa(1e+7) == "10000000.0"); +assert(dtoa(1e-7) == "1e-7"); -assert(dtoa(1e+308) == "1e+308"); +assert(dtoa(1e+308) == "1e+308"); assert(dtoa(-1e+308) == "-1e+308"); -assert(dtoa(1e+309) == "Infinity"); +assert(dtoa(1e+309) == "Infinity"); assert(dtoa(-1e+309) == "-Infinity"); -assert(dtoa(1e-308) == "1e-308"); +assert(dtoa(1e-308) == "1e-308"); assert(dtoa(-1e-308) == "-1e-308"); -assert(dtoa(1e-323) == "1e-323"); +assert(dtoa(1e-323) == "1e-323"); assert(dtoa(-1e-323) == "-1e-323"); -assert(dtoa(1e-324) == "0.0"); +assert(dtoa(1e-324) == "0.0"); assert(dtoa(4294967272) == "4294967272.0"); assert(dtoa(1.23121456734562345678e-8) == "1.2312145673456234e-8"); // assert(dtoa(-0.0000010471975511965976) == "-0.0000010471975511965976"); // FIXME -assert(dtoa(555555555.55555555) == "555555555.5555556"); -assert(dtoa(0.9999999999999999) == "0.9999999999999999"); +assert(dtoa(555555555.55555555) == "555555555.5555556"); +assert(dtoa(0.9999999999999999) == "0.9999999999999999"); assert(dtoa(0.99999999999999995) == "1.0"); -assert(dtoa(1234e-2) == "12.34"); +assert(dtoa(1234e-2) == "12.34"); // assert(dtoa(0.1 + 0.2) == "0.30000000000000004"); // FIXME -assert(dtoa(1.0 / 3.0) == "0.3333333333333333"); -assert(dtoa(1.234e+20) == "123400000000000000000.0"); -assert(dtoa(1.234e+21) == "1.234e+21"); -assert(dtoa(2.71828) == "2.71828"); -assert(dtoa(2.71828e-2) == "0.0271828"); -assert(dtoa(2.71828e+2) == "271.828"); -assert(dtoa(1.1e+128) == "1.1e+128"); -assert(dtoa(1.1e-64) == "1.1e-64"); +assert(dtoa(1.0 / 3.0) == "0.3333333333333333"); +assert(dtoa(1.234e+20) == "123400000000000000000.0"); +assert(dtoa(1.234e+21) == "1.234e+21"); +assert(dtoa(2.71828) == "2.71828"); +assert(dtoa(2.71828e-2) == "0.0271828"); +assert(dtoa(2.71828e+2) == "271.828"); +assert(dtoa(1.1e+128) == "1.1e+128"); +assert(dtoa(1.1e-64) == "1.1e-64"); assert(dtoa(0.000035689) == "0.000035689"); // assert(dtoa(f32.MAX_VALUE) == "3.4028234663852886e+38"); // FIXME diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 34a1007a..1767dd72 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -22,19 +22,19 @@ (memory $0 1) (data (i32.const 8) "\01\00\00\00 \00\00\00\00\00\00\00\00\00\00\00h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g\00") (data (i32.const 56) "\01\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 104) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 152) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 176) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\006\00") - (data (i32.const 200) "\01\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 248) "\01\00\00\00\04\00\00\00\00\00\00\00\00\00\00\004\d8\06\df") - (data (i32.const 272) "\01\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00h\00i\00") - (data (i32.const 296) "\01\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00n\00u\00l\00l\00") - (data (i32.const 320) "\01\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00s\00t\00r\00i\00n\00g\00") - (data (i32.const 352) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00I\00\'\00m\00") - (data (i32.const 376) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00 \00") - (data (i32.const 400) "\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 416) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00 \00 \00 \00") - (data (i32.const 440) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00a\00") + (data (i32.const 104) "\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 120) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 144) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00a\00") + (data (i32.const 168) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") + (data (i32.const 216) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\006\00") + (data (i32.const 240) "\01\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 288) "\01\00\00\00\04\00\00\00\00\00\00\00\00\00\00\004\d8\06\df") + (data (i32.const 312) "\01\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00h\00i\00") + (data (i32.const 336) "\01\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00n\00u\00l\00l\00") + (data (i32.const 360) "\01\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00s\00t\00r\00i\00n\00g\00") + (data (i32.const 392) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00I\00\'\00m\00") + (data (i32.const 416) "\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00 \00") + (data (i32.const 440) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00 \00 \00 \00") (data (i32.const 464) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00") (data (i32.const 488) "\01\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00 \00 \00a\00b\00c\00") (data (i32.const 520) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\001\002\003\00") @@ -238,7 +238,21 @@ i32.add i32.load16_u ) - (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String.__not (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 0 + i32.eq + local.tee $1 + if (result i32) + local.get $1 + else + local.get $0 + call $~lib/string/String#get:length + i32.eqz + end + ) + (func $~lib/runtime/runtime.adjust (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -250,7 +264,7 @@ i32.sub i32.shl ) - (func $~lib/allocator/arena/__mem_allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/allocator/arena/__mem_allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -329,12 +343,12 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/memory/memory.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/memory/memory.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/runtime/runtime.adjust @@ -356,10 +370,10 @@ global.get $~lib/util/runtime/HEADER_SIZE i32.add ) - (func $~lib/collector/dummy/__ref_register (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/collector/dummy/__ref_register (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -367,7 +381,7 @@ i32.eqz if i32.const 0 - i32.const 120 + i32.const 184 i32.const 102 i32.const 6 call $~lib/env/abort @@ -384,7 +398,7 @@ i32.eqz if i32.const 0 - i32.const 120 + i32.const 184 i32.const 104 i32.const 6 call $~lib/env/abort @@ -397,7 +411,7 @@ call $~lib/collector/dummy/__ref_register local.get $0 ) - (func $~lib/string/String.fromCharCode (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String.fromCharCode (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 2 call $~lib/runtime/runtime.allocate @@ -409,7 +423,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/util/string/compareImpl (; 11 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 12 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) @@ -462,7 +476,7 @@ end local.get $5 ) - (func $~lib/string/String.__eq (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -506,7 +520,7 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $~lib/string/String.fromCodePoint (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String.fromCodePoint (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -517,7 +531,7 @@ i32.eqz if i32.const 0 - i32.const 216 + i32.const 256 i32.const 26 i32.const 4 call $~lib/env/abort @@ -569,7 +583,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/string/String#startsWith (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#startsWith (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -582,8 +596,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 166 + i32.const 256 + i32.const 172 i32.const 4 call $~lib/env/abort unreachable @@ -592,7 +606,7 @@ i32.const 0 i32.eq if - i32.const 312 + i32.const 352 local.set $1 end local.get $2 @@ -636,7 +650,7 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $~lib/string/String#endsWith (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#endsWith (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -648,7 +662,7 @@ i32.eqz if i32.const 0 - i32.const 216 + i32.const 256 i32.const 79 i32.const 4 call $~lib/env/abort @@ -700,7 +714,7 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $~lib/string/String#indexOf (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#indexOf (; 17 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -712,8 +726,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 135 + i32.const 256 + i32.const 141 i32.const 4 call $~lib/env/abort unreachable @@ -722,7 +736,7 @@ i32.const 0 i32.eq if - i32.const 312 + i32.const 352 local.set $1 end local.get $1 @@ -794,7 +808,7 @@ end i32.const -1 ) - (func $~lib/util/memory/memcpy (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1995,7 +2009,7 @@ i32.store8 end ) - (func $~lib/memory/memory.copy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2226,7 +2240,7 @@ end end ) - (func $~lib/memory/memory.repeat (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/memory/memory.repeat (; 20 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) i32.const 0 @@ -2258,7 +2272,7 @@ end end ) - (func $~lib/string/String#padStart (; 20 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#padStart (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2273,8 +2287,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 283 + i32.const 256 + i32.const 289 i32.const 4 call $~lib/env/abort unreachable @@ -2359,7 +2373,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/string/String#padEnd (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#padEnd (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2374,8 +2388,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 304 + i32.const 256 + i32.const 310 i32.const 4 call $~lib/env/abort unreachable @@ -2464,7 +2478,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/string/String#lastIndexOf (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#lastIndexOf (; 23 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2476,8 +2490,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 151 + i32.const 256 + i32.const 157 i32.const 4 call $~lib/env/abort unreachable @@ -2486,7 +2500,7 @@ i32.const 0 i32.eq if - i32.const 312 + i32.const 352 local.set $1 end local.get $0 @@ -2556,7 +2570,7 @@ end i32.const -1 ) - (func $~lib/util/string/parse (; 23 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/util/string/parse (; 24 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2857,12 +2871,12 @@ local.get $7 f64.mul ) - (func $~lib/string/parseInt (; 24 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/string/parseInt (; 25 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $0 local.get $1 call $~lib/util/string/parse ) - (func $~lib/string/parseFloat (; 25 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/string/parseFloat (; 26 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2990,8 +3004,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 571 + i32.const 256 + i32.const 577 i32.const 10 call $~lib/env/abort unreachable @@ -3059,7 +3073,7 @@ local.get $5 f64.mul ) - (func $~lib/string/String#concat (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3068,7 +3082,7 @@ i32.const 0 i32.eq if - i32.const 312 + i32.const 352 local.set $1 end local.get $0 @@ -3089,7 +3103,7 @@ i32.const 0 i32.eq if - i32.const 416 + i32.const 120 return end local.get $4 @@ -3109,9 +3123,9 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/string/String.__concat (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 312 + i32.const 352 local.get $0 i32.const 0 i32.ne @@ -3119,13 +3133,13 @@ local.get $1 call $~lib/string/String#concat ) - (func $~lib/string/String.__ne (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 call $~lib/string/String.__eq i32.eqz ) - (func $~lib/string/String.__gt (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3187,7 +3201,7 @@ i32.const 0 i32.gt_s ) - (func $~lib/string/String.__lt (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3249,19 +3263,19 @@ i32.const 0 i32.lt_s ) - (func $~lib/string/String.__gte (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gte (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 call $~lib/string/String.__lt i32.eqz ) - (func $~lib/string/String.__lte (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lte (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 call $~lib/string/String.__gt i32.eqz ) - (func $~lib/string/String#repeat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#repeat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3271,8 +3285,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 325 + i32.const 256 + i32.const 331 i32.const 4 call $~lib/env/abort unreachable @@ -3299,8 +3313,8 @@ end if i32.const 0 - i32.const 216 - i32.const 330 + i32.const 256 + i32.const 336 i32.const 6 call $~lib/env/abort unreachable @@ -3316,7 +3330,7 @@ i32.eqz end if - i32.const 416 + i32.const 120 return end local.get $1 @@ -3344,7 +3358,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/string/String#slice (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#slice (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3412,7 +3426,7 @@ i32.const 0 i32.le_s if - i32.const 416 + i32.const 120 return end local.get $3 @@ -3434,10 +3448,10 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/collector/dummy/__ref_mark (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/collector/dummy/__ref_mark (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/array/Array<~lib/string/String>~traverse (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array<~lib/string/String>~traverse (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3476,16 +3490,16 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer~traverse (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/arraybuffer/ArrayBuffer~traverse (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) ) - (func $~lib/collector/dummy/__ref_link (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/collector/dummy/__ref_link (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/collector/dummy/__ref_unlink (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/collector/dummy/__ref_unlink (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/runtime.makeArray (; 40 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 41 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3549,7 +3563,7 @@ end local.get $4 ) - (func $~lib/memory/memory.fill (; 41 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.fill (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3806,14 +3820,14 @@ end end ) - (func $~lib/allocator/arena/__mem_free (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/allocator/arena/__mem_free (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/memory/memory.free (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/memory/memory.free (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 call $~lib/allocator/arena/__mem_free ) - (func $~lib/runtime/runtime.reallocate (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3883,7 +3897,7 @@ i32.eqz if i32.const 0 - i32.const 120 + i32.const 184 i32.const 64 i32.const 10 call $~lib/env/abort @@ -3917,7 +3931,7 @@ i32.store offset=4 local.get $0 ) - (func $~lib/array/ensureCapacity (; 45 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/ensureCapacity (; 46 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3991,7 +4005,7 @@ i32.store offset=8 end ) - (func $~lib/array/Array<~lib/string/String>#push (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#push (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4041,7 +4055,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 47 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $0 @@ -4074,7 +4088,7 @@ call $~lib/collector/dummy/__ref_link end ) - (func $~lib/string/String#split (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#split (; 49 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4092,8 +4106,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 352 + i32.const 256 + i32.const 358 i32.const 4 call $~lib/env/abort unreachable @@ -4239,7 +4253,7 @@ local.set $3 local.get $3 i32.load offset=4 - i32.const 416 + i32.const 120 i32.store local.get $3 return @@ -4305,7 +4319,7 @@ drop else local.get $9 - i32.const 416 + i32.const 120 call $~lib/array/Array<~lib/string/String>#push drop end @@ -4375,17 +4389,17 @@ drop else local.get $9 - i32.const 416 + i32.const 120 call $~lib/array/Array<~lib/string/String>#push drop end local.get $9 ) - (func $~lib/array/Array<~lib/string/String>#get:length (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#get:length (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -4394,7 +4408,7 @@ i32.add i32.load ) - (func $~lib/array/Array<~lib/string/String>#__get (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__get (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -4425,7 +4439,7 @@ local.get $1 call $~lib/array/Array<~lib/string/String>#__unchecked_get ) - (func $~lib/util/number/decimalCount32 (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 53 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 100000 @@ -4494,12 +4508,12 @@ unreachable unreachable ) - (func $~lib/array/Array~traverse (; 53 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array~traverse (; 54 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.load call $~lib/collector/dummy/__ref_mark ) - (func $~lib/util/number/utoa32_lut (; 54 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa32_lut (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4642,7 +4656,7 @@ i32.store16 end ) - (func $~lib/util/number/itoa32 (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4698,7 +4712,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/util/number/utoa32 (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 57 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4734,7 +4748,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/util/number/decimalCount64 (; 57 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 58 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i64.const 1000000000000000 @@ -4803,7 +4817,7 @@ unreachable unreachable ) - (func $~lib/util/number/utoa64_lut (; 58 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa64_lut (; 59 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) (local $4 i64) (local $5 i32) @@ -4931,7 +4945,7 @@ local.get $2 call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 59 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 60 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4999,7 +5013,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/util/number/itoa64 (; 60 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 61 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5089,24 +5103,24 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/builtins/isFinite (; 61 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isFinite (; 62 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 f64.eq ) - (func $~lib/builtins/isNaN (; 62 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isNaN (; 63 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.ne ) - (func $~lib/array/Array~traverse (; 63 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array~traverse (; 64 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.load call $~lib/collector/dummy/__ref_mark ) - (func $~lib/array/Array#__unchecked_get (; 64 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/array/Array#__unchecked_get (; 65 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) local.get $0 i32.load offset=4 local.get $1 @@ -5115,12 +5129,12 @@ i32.add i64.load ) - (func $~lib/array/Array~traverse (; 65 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array~traverse (; 66 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.load call $~lib/collector/dummy/__ref_mark ) - (func $~lib/array/Array#__unchecked_get (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -5129,7 +5143,7 @@ i32.add i32.load16_s ) - (func $~lib/util/number/genDigits (; 67 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 68 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i64) (local $9 i64) @@ -5700,7 +5714,7 @@ end local.get $15 ) - (func $~lib/util/number/prettify (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 69 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6033,7 +6047,7 @@ unreachable unreachable ) - (func $~lib/util/number/dtoa_core (; 69 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 70 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 f64) (local $4 i32) @@ -6471,7 +6485,7 @@ local.get $2 i32.add ) - (func $~lib/string/String#substring (; 70 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#substring (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6486,8 +6500,8 @@ i32.eqz if i32.const 0 - i32.const 216 - i32.const 191 + i32.const 256 + i32.const 197 i32.const 4 call $~lib/env/abort unreachable @@ -6556,7 +6570,7 @@ local.get $3 i32.eqz if - i32.const 416 + i32.const 120 return end local.get $8 @@ -6589,7 +6603,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/runtime/runtime.discard (; 71 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 72 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -6597,7 +6611,7 @@ i32.eqz if i32.const 0 - i32.const 120 + i32.const 184 i32.const 89 i32.const 6 call $~lib/env/abort @@ -6614,7 +6628,7 @@ i32.eqz if i32.const 0 - i32.const 120 + i32.const 184 i32.const 91 i32.const 6 call $~lib/env/abort @@ -6623,7 +6637,7 @@ local.get $1 call $~lib/memory/memory.free ) - (func $~lib/util/number/dtoa (; 72 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 73 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6670,7 +6684,7 @@ call $~lib/runtime/runtime.discard local.get $3 ) - (func $start:std/string (; 73 ;) (type $FUNCSIG$v) + (func $start:std/string (; 74 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6713,6 +6727,48 @@ call $~lib/env/abort unreachable end + i32.const 120 + call $~lib/string/String.__not + i32.eqz + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 22 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 136 + call $~lib/string/String.__not + i32.eqz + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 23 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + call $~lib/string/String.__not + i32.eqz + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 24 + i32.const 0 + call $~lib/env/abort + unreachable + end global.get $~lib/memory/HEAP_BASE i32.const 7 i32.add @@ -6725,48 +6781,7 @@ global.set $~lib/allocator/arena/offset i32.const 0 call $~lib/string/String.fromCharCode - i32.const 168 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 22 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 54 - call $~lib/string/String.fromCharCode - i32.const 192 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 23 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 65536 - i32.const 54 - i32.add - call $~lib/string/String.fromCharCode - i32.const 192 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 24 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - call $~lib/string/String.fromCodePoint - i32.const 168 + i32.const 136 call $~lib/string/String.__eq i32.eqz if @@ -6778,8 +6793,8 @@ unreachable end i32.const 54 - call $~lib/string/String.fromCodePoint - i32.const 192 + call $~lib/string/String.fromCharCode + i32.const 232 call $~lib/string/String.__eq i32.eqz if @@ -6790,21 +6805,25 @@ call $~lib/env/abort unreachable end - i32.const 119558 - call $~lib/string/String.fromCodePoint + i32.const 65536 + i32.const 54 + i32.add + call $~lib/string/String.fromCharCode + i32.const 232 + call $~lib/string/String.__eq i32.eqz if - i32.const 264 + i32.const 0 i32.const 72 i32.const 28 i32.const 0 call $~lib/env/abort unreachable end - global.get $std/string/str - i32.const 288 i32.const 0 - call $~lib/string/String#startsWith + call $~lib/string/String.fromCodePoint + i32.const 136 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6814,10 +6833,10 @@ call $~lib/env/abort unreachable end - global.get $std/string/str - i32.const 336 - global.get $~lib/string/String.MAX_LENGTH - call $~lib/string/String#endsWith + i32.const 54 + call $~lib/string/String.fromCodePoint + i32.const 232 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6827,10 +6846,47 @@ call $~lib/env/abort unreachable end + i32.const 119558 + call $~lib/string/String.fromCodePoint + i32.eqz + if + i32.const 304 + i32.const 72 + i32.const 32 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/string/str + i32.const 328 + i32.const 0 + call $~lib/string/String#startsWith + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 34 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/string/str + i32.const 376 + global.get $~lib/string/String.MAX_LENGTH + call $~lib/string/String#endsWith + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 35 + i32.const 0 + call $~lib/env/abort + unreachable + end block $~lib/string/String#includes|inlined.0 (result i32) global.get $std/string/str local.set $2 - i32.const 368 + i32.const 408 local.set $1 i32.const 0 local.set $0 @@ -6847,76 +6903,16 @@ if i32.const 0 i32.const 72 - i32.const 32 + i32.const 36 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str i32.const 0 - i32.const 392 - call $~lib/string/String#padStart - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 34 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 15 - i32.const 392 - call $~lib/string/String#padStart - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 35 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 3 - i32.const 392 - call $~lib/string/String#padStart i32.const 432 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 36 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 10 - i32.const 416 call $~lib/string/String#padStart - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 37 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 100 - i32.const 416 - call $~lib/string/String#padStart - i32.const 456 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -6927,9 +6923,69 @@ call $~lib/env/abort unreachable end + global.get $std/string/str + i32.const 15 + i32.const 432 + call $~lib/string/String#padStart + global.get $std/string/str + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 39 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 3 + i32.const 432 + call $~lib/string/String#padStart + i32.const 456 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 40 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padStart + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 41 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 100 + i32.const 120 + call $~lib/string/String#padStart + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 42 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 480 i32.const 5 - i32.const 392 + i32.const 432 call $~lib/string/String#padStart i32.const 504 call $~lib/string/String.__eq @@ -6937,7 +6993,7 @@ if i32.const 0 i32.const 72 - i32.const 39 + i32.const 43 i32.const 0 call $~lib/env/abort unreachable @@ -6952,7 +7008,7 @@ if i32.const 0 i32.const 72 - i32.const 40 + i32.const 44 i32.const 0 call $~lib/env/abort unreachable @@ -6967,76 +7023,16 @@ if i32.const 0 i32.const 72 - i32.const 41 + i32.const 45 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str i32.const 0 - i32.const 392 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 43 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 15 - i32.const 392 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 44 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 3 - i32.const 392 - call $~lib/string/String#padEnd i32.const 432 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 45 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 10 - i32.const 416 call $~lib/string/String#padEnd - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 46 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 100 - i32.const 416 - call $~lib/string/String#padEnd - i32.const 456 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -7047,9 +7043,69 @@ call $~lib/env/abort unreachable end + global.get $std/string/str + i32.const 15 + i32.const 432 + call $~lib/string/String#padEnd + global.get $std/string/str + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 48 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 3 + i32.const 432 + call $~lib/string/String#padEnd + i32.const 456 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 49 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padEnd + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 50 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 100 + i32.const 120 + call $~lib/string/String#padEnd + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 51 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 480 i32.const 5 - i32.const 392 + i32.const 432 call $~lib/string/String#padEnd i32.const 624 call $~lib/string/String.__eq @@ -7057,7 +7113,7 @@ if i32.const 0 i32.const 72 - i32.const 48 + i32.const 52 i32.const 0 call $~lib/env/abort unreachable @@ -7072,7 +7128,7 @@ if i32.const 0 i32.const 72 - i32.const 49 + i32.const 53 i32.const 0 call $~lib/env/abort unreachable @@ -7084,51 +7140,6 @@ i32.const 688 call $~lib/string/String.__eq i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 50 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 416 - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 52 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 288 - i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 53 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 456 - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 - i32.eq - i32.eqz if i32.const 0 i32.const 72 @@ -7137,23 +7148,8 @@ call $~lib/env/abort unreachable end - global.get $std/string/str - global.get $std/string/str - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 55 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 416 + i32.const 120 + i32.const 120 i32.const 0 call $~lib/string/String#indexOf i32.const 0 @@ -7167,6 +7163,66 @@ call $~lib/env/abort unreachable end + i32.const 120 + i32.const 328 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 57 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 160 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 58 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/string/str + global.get $std/string/str + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 59 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/string/str + i32.const 120 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 60 + i32.const 0 + call $~lib/env/abort + unreachable + end global.get $std/string/str i32.const 720 i32.const 0 @@ -7177,7 +7233,7 @@ if i32.const 0 i32.const 72 - i32.const 57 + i32.const 61 i32.const 0 call $~lib/env/abort unreachable @@ -7192,7 +7248,7 @@ if i32.const 0 i32.const 72 - i32.const 58 + i32.const 62 i32.const 0 call $~lib/env/abort unreachable @@ -7207,7 +7263,7 @@ if i32.const 0 i32.const 72 - i32.const 59 + i32.const 63 i32.const 0 call $~lib/env/abort unreachable @@ -7222,7 +7278,7 @@ if i32.const 0 i32.const 72 - i32.const 60 + i32.const 64 i32.const 0 call $~lib/env/abort unreachable @@ -7237,13 +7293,13 @@ if i32.const 0 i32.const 72 - i32.const 61 + i32.const 65 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 + i32.const 120 + i32.const 120 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#lastIndexOf i32.const 0 @@ -7252,13 +7308,13 @@ if i32.const 0 i32.const 72 - i32.const 63 + i32.const 67 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 288 + i32.const 120 + i32.const 328 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#lastIndexOf i32.const -1 @@ -7267,13 +7323,13 @@ if i32.const 0 i32.const 72 - i32.const 64 + i32.const 68 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str - i32.const 416 + i32.const 120 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#lastIndexOf global.get $std/string/str @@ -7283,7 +7339,7 @@ if i32.const 0 i32.const 72 - i32.const 65 + i32.const 69 i32.const 0 call $~lib/env/abort unreachable @@ -7298,7 +7354,7 @@ if i32.const 0 i32.const 72 - i32.const 66 + i32.const 70 i32.const 0 call $~lib/env/abort unreachable @@ -7313,7 +7369,7 @@ if i32.const 0 i32.const 72 - i32.const 67 + i32.const 71 i32.const 0 call $~lib/env/abort unreachable @@ -7328,7 +7384,7 @@ if i32.const 0 i32.const 72 - i32.const 68 + i32.const 72 i32.const 0 call $~lib/env/abort unreachable @@ -7343,7 +7399,7 @@ if i32.const 0 i32.const 72 - i32.const 69 + i32.const 73 i32.const 0 call $~lib/env/abort unreachable @@ -7358,7 +7414,7 @@ if i32.const 0 i32.const 72 - i32.const 70 + i32.const 74 i32.const 0 call $~lib/env/abort unreachable @@ -7373,7 +7429,7 @@ if i32.const 0 i32.const 72 - i32.const 71 + i32.const 75 i32.const 0 call $~lib/env/abort unreachable @@ -7388,13 +7444,13 @@ if i32.const 0 i32.const 72 - i32.const 72 + i32.const 76 i32.const 0 call $~lib/env/abort unreachable end global.get $std/string/str - i32.const 288 + i32.const 328 i32.const 0 call $~lib/string/String#lastIndexOf i32.const 0 @@ -7403,7 +7459,7 @@ if i32.const 0 i32.const 72 - i32.const 73 + i32.const 77 i32.const 0 call $~lib/env/abort unreachable @@ -7417,7 +7473,7 @@ if i32.const 0 i32.const 72 - i32.const 79 + i32.const 83 i32.const 0 call $~lib/env/abort unreachable @@ -7431,7 +7487,7 @@ if i32.const 0 i32.const 72 - i32.const 80 + i32.const 84 i32.const 0 call $~lib/env/abort unreachable @@ -7445,7 +7501,7 @@ if i32.const 0 i32.const 72 - i32.const 81 + i32.const 85 i32.const 0 call $~lib/env/abort unreachable @@ -7459,7 +7515,7 @@ if i32.const 0 i32.const 72 - i32.const 82 + i32.const 86 i32.const 0 call $~lib/env/abort unreachable @@ -7473,7 +7529,7 @@ if i32.const 0 i32.const 72 - i32.const 83 + i32.const 87 i32.const 0 call $~lib/env/abort unreachable @@ -7487,7 +7543,7 @@ if i32.const 0 i32.const 72 - i32.const 84 + i32.const 88 i32.const 0 call $~lib/env/abort unreachable @@ -7501,7 +7557,7 @@ if i32.const 0 i32.const 72 - i32.const 85 + i32.const 89 i32.const 0 call $~lib/env/abort unreachable @@ -7515,7 +7571,7 @@ if i32.const 0 i32.const 72 - i32.const 86 + i32.const 90 i32.const 0 call $~lib/env/abort unreachable @@ -7528,7 +7584,7 @@ if i32.const 0 i32.const 72 - i32.const 88 + i32.const 92 i32.const 0 call $~lib/env/abort unreachable @@ -7541,7 +7597,7 @@ if i32.const 0 i32.const 72 - i32.const 89 + i32.const 93 i32.const 0 call $~lib/env/abort unreachable @@ -7554,7 +7610,7 @@ if i32.const 0 i32.const 72 - i32.const 90 + i32.const 94 i32.const 0 call $~lib/env/abort unreachable @@ -7567,7 +7623,7 @@ if i32.const 0 i32.const 72 - i32.const 91 + i32.const 95 i32.const 0 call $~lib/env/abort unreachable @@ -7580,12 +7636,12 @@ if i32.const 0 i32.const 72 - i32.const 92 + i32.const 96 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 1144 call $~lib/string/String.__concat global.set $std/string/c @@ -7593,54 +7649,6 @@ i32.const 1168 call $~lib/string/String.__eq i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 95 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/c - i32.const 456 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 96 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 97 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - global.get $std/string/nullStr - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 98 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/nullStr - i32.const 416 - call $~lib/string/String.__ne - i32.eqz if i32.const 0 i32.const 72 @@ -7649,8 +7657,8 @@ call $~lib/env/abort unreachable end - i32.const 456 - i32.const 1144 + global.get $std/string/c + i32.const 160 call $~lib/string/String.__ne i32.eqz if @@ -7661,8 +7669,8 @@ call $~lib/env/abort unreachable end - i32.const 456 - i32.const 456 + i32.const 120 + i32.const 120 call $~lib/string/String.__eq i32.eqz if @@ -7673,6 +7681,54 @@ call $~lib/env/abort unreachable end + i32.const 120 + global.get $std/string/nullStr + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 102 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/string/nullStr + i32.const 120 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 103 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 1144 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 104 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 105 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 1192 i32.const 1216 call $~lib/string/String.__ne @@ -7680,7 +7736,7 @@ if i32.const 0 i32.const 72 - i32.const 102 + i32.const 106 i32.const 0 call $~lib/env/abort unreachable @@ -7692,7 +7748,7 @@ if i32.const 0 i32.const 72 - i32.const 103 + i32.const 107 i32.const 0 call $~lib/env/abort unreachable @@ -7704,7 +7760,7 @@ if i32.const 0 i32.const 72 - i32.const 104 + i32.const 108 i32.const 0 call $~lib/env/abort unreachable @@ -7716,7 +7772,7 @@ if i32.const 0 i32.const 72 - i32.const 105 + i32.const 109 i32.const 0 call $~lib/env/abort unreachable @@ -7728,7 +7784,7 @@ if i32.const 0 i32.const 72 - i32.const 106 + i32.const 110 i32.const 0 call $~lib/env/abort unreachable @@ -7740,7 +7796,7 @@ if i32.const 0 i32.const 72 - i32.const 107 + i32.const 111 i32.const 0 call $~lib/env/abort unreachable @@ -7752,31 +7808,31 @@ if i32.const 0 i32.const 72 - i32.const 108 + i32.const 112 i32.const 0 call $~lib/env/abort unreachable end i32.const 1144 - i32.const 456 + i32.const 160 call $~lib/string/String.__gt i32.eqz if i32.const 0 i32.const 72 - i32.const 110 + i32.const 114 i32.const 0 call $~lib/env/abort unreachable end i32.const 1496 - i32.const 456 + i32.const 160 call $~lib/string/String.__gt i32.eqz if i32.const 0 i32.const 72 - i32.const 111 + i32.const 115 i32.const 0 call $~lib/env/abort unreachable @@ -7788,7 +7844,7 @@ if i32.const 0 i32.const 72 - i32.const 112 + i32.const 116 i32.const 0 call $~lib/env/abort unreachable @@ -7797,45 +7853,6 @@ i32.const 1168 call $~lib/string/String.__gt i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 113 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1496 - i32.const 1168 - call $~lib/string/String.__lt - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 114 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1144 - global.get $std/string/nullStr - call $~lib/string/String.__lt - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 116 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/nullStr - i32.const 1144 - call $~lib/string/String.__lt - i32.eqz - i32.eqz if i32.const 0 i32.const 72 @@ -7844,22 +7861,24 @@ call $~lib/env/abort unreachable end - i32.const 480 - i32.const 416 - call $~lib/string/String.__gt + i32.const 1496 + i32.const 1168 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 i32.const 72 - i32.const 119 + i32.const 118 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 480 + i32.const 1144 + global.get $std/string/nullStr call $~lib/string/String.__lt i32.eqz + i32.eqz if i32.const 0 i32.const 72 @@ -7868,9 +7887,10 @@ call $~lib/env/abort unreachable end - i32.const 480 - i32.const 416 - call $~lib/string/String.__gte + global.get $std/string/nullStr + i32.const 1144 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 @@ -7880,22 +7900,9 @@ call $~lib/env/abort unreachable end - i32.const 416 i32.const 480 - call $~lib/string/String.__lte - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 122 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - i32.const 416 - call $~lib/string/String.__lt - i32.eqz + i32.const 120 + call $~lib/string/String.__gt i32.eqz if i32.const 0 @@ -7905,10 +7912,9 @@ call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 i32.const 480 - call $~lib/string/String.__gt - i32.eqz + call $~lib/string/String.__lt i32.eqz if i32.const 0 @@ -7918,10 +7924,9 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__lt - i32.eqz + i32.const 480 + i32.const 120 + call $~lib/string/String.__gte i32.eqz if i32.const 0 @@ -7931,10 +7936,9 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__gt - i32.eqz + i32.const 120 + i32.const 480 + call $~lib/string/String.__lte i32.eqz if i32.const 0 @@ -7944,9 +7948,10 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__gte + i32.const 480 + i32.const 120 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 @@ -7956,9 +7961,10 @@ call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 - call $~lib/string/String.__lte + i32.const 120 + i32.const 480 + call $~lib/string/String.__gt + i32.eqz i32.eqz if i32.const 0 @@ -7968,6 +7974,56 @@ call $~lib/env/abort unreachable end + i32.const 120 + i32.const 120 + call $~lib/string/String.__lt + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 129 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__gt + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 130 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__gte + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 131 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__lte + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 132 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 65377 call $~lib/string/String.fromCodePoint global.set $std/string/a @@ -7984,7 +8040,7 @@ if i32.const 0 i32.const 72 - i32.const 132 + i32.const 136 i32.const 0 call $~lib/env/abort unreachable @@ -7994,48 +8050,6 @@ i32.const 3 i32.eq i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 134 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 416 - i32.const 100 - call $~lib/string/String#repeat - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 136 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 0 - call $~lib/string/String#repeat - i32.const 416 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 137 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 456 - i32.const 1 - call $~lib/string/String#repeat - i32.const 456 - call $~lib/string/String.__eq - i32.eqz if i32.const 0 i32.const 72 @@ -8044,7 +8058,49 @@ call $~lib/env/abort unreachable end - i32.const 456 + i32.const 120 + i32.const 100 + call $~lib/string/String#repeat + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 140 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 0 + call $~lib/string/String#repeat + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 141 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 + i32.const 1 + call $~lib/string/String#repeat + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 142 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 160 i32.const 2 call $~lib/string/String#repeat i32.const 1520 @@ -8053,12 +8109,12 @@ if i32.const 0 i32.const 72 - i32.const 139 + i32.const 143 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 3 call $~lib/string/String#repeat i32.const 1544 @@ -8067,7 +8123,7 @@ if i32.const 0 i32.const 72 - i32.const 140 + i32.const 144 i32.const 0 call $~lib/env/abort unreachable @@ -8081,12 +8137,12 @@ if i32.const 0 i32.const 72 - i32.const 141 + i32.const 145 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 5 call $~lib/string/String#repeat i32.const 1600 @@ -8095,12 +8151,12 @@ if i32.const 0 i32.const 72 - i32.const 142 + i32.const 146 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 6 call $~lib/string/String#repeat i32.const 1632 @@ -8109,12 +8165,12 @@ if i32.const 0 i32.const 72 - i32.const 143 + i32.const 147 i32.const 0 call $~lib/env/abort unreachable end - i32.const 456 + i32.const 160 i32.const 7 call $~lib/string/String#repeat i32.const 1664 @@ -8123,7 +8179,7 @@ if i32.const 0 i32.const 72 - i32.const 144 + i32.const 148 i32.const 0 call $~lib/env/abort unreachable @@ -8140,7 +8196,7 @@ if i32.const 0 i32.const 72 - i32.const 148 + i32.const 152 i32.const 0 call $~lib/env/abort unreachable @@ -8155,7 +8211,7 @@ if i32.const 0 i32.const 72 - i32.const 149 + i32.const 153 i32.const 0 call $~lib/env/abort unreachable @@ -8170,7 +8226,7 @@ if i32.const 0 i32.const 72 - i32.const 150 + i32.const 154 i32.const 0 call $~lib/env/abort unreachable @@ -8185,7 +8241,7 @@ if i32.const 0 i32.const 72 - i32.const 151 + i32.const 155 i32.const 0 call $~lib/env/abort unreachable @@ -8200,7 +8256,7 @@ if i32.const 0 i32.const 72 - i32.const 152 + i32.const 156 i32.const 0 call $~lib/env/abort unreachable @@ -8209,13 +8265,13 @@ i32.const 4 i32.const 3 call $~lib/string/String#slice - i32.const 416 + i32.const 120 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 153 + i32.const 157 i32.const 0 call $~lib/env/abort unreachable @@ -8230,12 +8286,12 @@ if i32.const 0 i32.const 72 - i32.const 154 + i32.const 158 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 i32.const 0 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#split @@ -8249,7 +8305,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq else local.get $0 @@ -8258,13 +8314,13 @@ if i32.const 0 i32.const 72 - i32.const 159 + i32.const 163 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 - i32.const 416 + i32.const 120 + i32.const 120 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#split global.set $std/string/sa @@ -8276,12 +8332,12 @@ if i32.const 0 i32.const 72 - i32.const 161 + i32.const 165 i32.const 0 call $~lib/env/abort unreachable end - i32.const 416 + i32.const 120 i32.const 720 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#split @@ -8295,7 +8351,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq else local.get $0 @@ -8304,7 +8360,7 @@ if i32.const 0 i32.const 72 - i32.const 163 + i32.const 167 i32.const 0 call $~lib/env/abort unreachable @@ -8332,7 +8388,7 @@ if i32.const 0 i32.const 72 - i32.const 165 + i32.const 169 i32.const 0 call $~lib/env/abort unreachable @@ -8351,7 +8407,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8380,7 +8436,7 @@ if i32.const 0 i32.const 72 - i32.const 167 + i32.const 171 i32.const 0 call $~lib/env/abort unreachable @@ -8399,7 +8455,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8428,7 +8484,7 @@ if i32.const 0 i32.const 72 - i32.const 169 + i32.const 173 i32.const 0 call $~lib/env/abort unreachable @@ -8447,7 +8503,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8467,7 +8523,7 @@ global.get $std/string/sa i32.const 2 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq else local.get $0 @@ -8486,7 +8542,7 @@ if i32.const 0 i32.const 72 - i32.const 171 + i32.const 175 i32.const 0 call $~lib/env/abort unreachable @@ -8505,7 +8561,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq else local.get $0 @@ -8515,7 +8571,7 @@ global.get $std/string/sa i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8544,7 +8600,7 @@ if i32.const 0 i32.const 72 - i32.const 173 + i32.const 177 i32.const 0 call $~lib/env/abort unreachable @@ -8563,7 +8619,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8593,7 +8649,7 @@ global.get $std/string/sa i32.const 3 call $~lib/array/Array<~lib/string/String>#__get - i32.const 416 + i32.const 120 call $~lib/string/String.__eq else local.get $0 @@ -8602,13 +8658,13 @@ if i32.const 0 i32.const 72 - i32.const 175 + i32.const 179 i32.const 0 call $~lib/env/abort unreachable end i32.const 480 - i32.const 416 + i32.const 120 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/string/String#split global.set $std/string/sa @@ -8621,7 +8677,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8647,52 +8703,6 @@ local.get $0 end i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 177 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - i32.const 416 - i32.const 0 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 179 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - i32.const 416 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 - i32.eq - local.tee $0 - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 - call $~lib/string/String.__eq - else - local.get $0 - end - i32.eqz if i32.const 0 i32.const 72 @@ -8701,25 +8711,15 @@ call $~lib/env/abort unreachable end - i32.const 1960 - i32.const 720 - i32.const 1 + i32.const 480 + i32.const 120 + i32.const 0 call $~lib/string/String#split global.set $std/string/sa global.get $std/string/sa call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 + i32.const 0 i32.eq - local.tee $0 - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 - call $~lib/string/String.__eq - else - local.get $0 - end i32.eqz if i32.const 0 @@ -8730,40 +8730,20 @@ unreachable end i32.const 480 - i32.const 416 - i32.const 4 + i32.const 120 + i32.const 1 call $~lib/string/String#split global.set $std/string/sa global.get $std/string/sa call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 + i32.const 1 i32.eq local.tee $0 if (result i32) global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 - call $~lib/string/String.__eq - else - local.get $0 - end - local.tee $0 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1144 - call $~lib/string/String.__eq - else - local.get $0 - end - local.tee $0 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2016 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8777,41 +8757,21 @@ call $~lib/env/abort unreachable end - i32.const 480 - i32.const 416 - i32.const -1 + i32.const 1960 + i32.const 720 + i32.const 1 call $~lib/string/String#split global.set $std/string/sa global.get $std/string/sa call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 + i32.const 1 i32.eq local.tee $0 if (result i32) global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 - call $~lib/string/String.__eq - else - local.get $0 - end - local.tee $0 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1144 - call $~lib/string/String.__eq - else - local.get $0 - end - local.tee $0 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2016 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8825,9 +8785,9 @@ call $~lib/env/abort unreachable end - i32.const 1960 - i32.const 720 - i32.const -1 + i32.const 480 + i32.const 120 + i32.const 4 call $~lib/string/String#split global.set $std/string/sa global.get $std/string/sa @@ -8839,7 +8799,7 @@ global.get $std/string/sa i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 456 + i32.const 160 call $~lib/string/String.__eq else local.get $0 @@ -8873,6 +8833,102 @@ call $~lib/env/abort unreachable end + i32.const 480 + i32.const 120 + i32.const -1 + call $~lib/string/String#split + global.set $std/string/sa + global.get $std/string/sa + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 3 + i32.eq + local.tee $0 + if (result i32) + global.get $std/string/sa + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 160 + call $~lib/string/String.__eq + else + local.get $0 + end + local.tee $0 + if (result i32) + global.get $std/string/sa + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 1144 + call $~lib/string/String.__eq + else + local.get $0 + end + local.tee $0 + if (result i32) + global.get $std/string/sa + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 2016 + call $~lib/string/String.__eq + else + local.get $0 + end + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 191 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 1960 + i32.const 720 + i32.const -1 + call $~lib/string/String#split + global.set $std/string/sa + global.get $std/string/sa + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 3 + i32.eq + local.tee $0 + if (result i32) + global.get $std/string/sa + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 160 + call $~lib/string/String.__eq + else + local.get $0 + end + local.tee $0 + if (result i32) + global.get $std/string/sa + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 1144 + call $~lib/string/String.__eq + else + local.get $0 + end + local.tee $0 + if (result i32) + global.get $std/string/sa + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + i32.const 2016 + call $~lib/string/String.__eq + else + local.get $0 + end + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 193 + i32.const 0 + call $~lib/env/abort + unreachable + end i32.const 0 call $~lib/util/number/itoa32 i32.const 840 @@ -8881,7 +8937,7 @@ if i32.const 0 i32.const 72 - i32.const 191 + i32.const 195 i32.const 0 call $~lib/env/abort unreachable @@ -8894,7 +8950,7 @@ if i32.const 0 i32.const 72 - i32.const 192 + i32.const 196 i32.const 0 call $~lib/env/abort unreachable @@ -8907,7 +8963,7 @@ if i32.const 0 i32.const 72 - i32.const 193 + i32.const 197 i32.const 0 call $~lib/env/abort unreachable @@ -8920,7 +8976,7 @@ if i32.const 0 i32.const 72 - i32.const 194 + i32.const 198 i32.const 0 call $~lib/env/abort unreachable @@ -8933,7 +8989,7 @@ if i32.const 0 i32.const 72 - i32.const 195 + i32.const 199 i32.const 0 call $~lib/env/abort unreachable @@ -8946,7 +9002,7 @@ if i32.const 0 i32.const 72 - i32.const 196 + i32.const 200 i32.const 0 call $~lib/env/abort unreachable @@ -8959,7 +9015,7 @@ if i32.const 0 i32.const 72 - i32.const 197 + i32.const 201 i32.const 0 call $~lib/env/abort unreachable @@ -8972,7 +9028,7 @@ if i32.const 0 i32.const 72 - i32.const 198 + i32.const 202 i32.const 0 call $~lib/env/abort unreachable @@ -8985,7 +9041,7 @@ if i32.const 0 i32.const 72 - i32.const 199 + i32.const 203 i32.const 0 call $~lib/env/abort unreachable @@ -8998,7 +9054,7 @@ if i32.const 0 i32.const 72 - i32.const 200 + i32.const 204 i32.const 0 call $~lib/env/abort unreachable @@ -9011,7 +9067,7 @@ if i32.const 0 i32.const 72 - i32.const 201 + i32.const 205 i32.const 0 call $~lib/env/abort unreachable @@ -9024,7 +9080,7 @@ if i32.const 0 i32.const 72 - i32.const 202 + i32.const 206 i32.const 0 call $~lib/env/abort unreachable @@ -9037,7 +9093,7 @@ if i32.const 0 i32.const 72 - i32.const 203 + i32.const 207 i32.const 0 call $~lib/env/abort unreachable @@ -9050,7 +9106,7 @@ if i32.const 0 i32.const 72 - i32.const 204 + i32.const 208 i32.const 0 call $~lib/env/abort unreachable @@ -9063,7 +9119,7 @@ if i32.const 0 i32.const 72 - i32.const 206 + i32.const 210 i32.const 0 call $~lib/env/abort unreachable @@ -9076,7 +9132,7 @@ if i32.const 0 i32.const 72 - i32.const 207 + i32.const 211 i32.const 0 call $~lib/env/abort unreachable @@ -9089,7 +9145,7 @@ if i32.const 0 i32.const 72 - i32.const 208 + i32.const 212 i32.const 0 call $~lib/env/abort unreachable @@ -9102,7 +9158,7 @@ if i32.const 0 i32.const 72 - i32.const 209 + i32.const 213 i32.const 0 call $~lib/env/abort unreachable @@ -9115,7 +9171,7 @@ if i32.const 0 i32.const 72 - i32.const 210 + i32.const 214 i32.const 0 call $~lib/env/abort unreachable @@ -9128,7 +9184,7 @@ if i32.const 0 i32.const 72 - i32.const 212 + i32.const 216 i32.const 0 call $~lib/env/abort unreachable @@ -9141,7 +9197,7 @@ if i32.const 0 i32.const 72 - i32.const 213 + i32.const 217 i32.const 0 call $~lib/env/abort unreachable @@ -9154,7 +9210,7 @@ if i32.const 0 i32.const 72 - i32.const 214 + i32.const 218 i32.const 0 call $~lib/env/abort unreachable @@ -9167,7 +9223,7 @@ if i32.const 0 i32.const 72 - i32.const 215 + i32.const 219 i32.const 0 call $~lib/env/abort unreachable @@ -9180,7 +9236,7 @@ if i32.const 0 i32.const 72 - i32.const 216 + i32.const 220 i32.const 0 call $~lib/env/abort unreachable @@ -9193,7 +9249,7 @@ if i32.const 0 i32.const 72 - i32.const 217 + i32.const 221 i32.const 0 call $~lib/env/abort unreachable @@ -9206,7 +9262,7 @@ if i32.const 0 i32.const 72 - i32.const 218 + i32.const 222 i32.const 0 call $~lib/env/abort unreachable @@ -9219,7 +9275,7 @@ if i32.const 0 i32.const 72 - i32.const 219 + i32.const 223 i32.const 0 call $~lib/env/abort unreachable @@ -9232,7 +9288,7 @@ if i32.const 0 i32.const 72 - i32.const 220 + i32.const 224 i32.const 0 call $~lib/env/abort unreachable @@ -9245,7 +9301,7 @@ if i32.const 0 i32.const 72 - i32.const 221 + i32.const 225 i32.const 0 call $~lib/env/abort unreachable @@ -9258,7 +9314,7 @@ if i32.const 0 i32.const 72 - i32.const 222 + i32.const 226 i32.const 0 call $~lib/env/abort unreachable @@ -9271,7 +9327,7 @@ if i32.const 0 i32.const 72 - i32.const 224 + i32.const 228 i32.const 0 call $~lib/env/abort unreachable @@ -9284,7 +9340,7 @@ if i32.const 0 i32.const 72 - i32.const 225 + i32.const 229 i32.const 0 call $~lib/env/abort unreachable @@ -9297,7 +9353,7 @@ if i32.const 0 i32.const 72 - i32.const 226 + i32.const 230 i32.const 0 call $~lib/env/abort unreachable @@ -9310,7 +9366,7 @@ if i32.const 0 i32.const 72 - i32.const 227 + i32.const 231 i32.const 0 call $~lib/env/abort unreachable @@ -9323,7 +9379,7 @@ if i32.const 0 i32.const 72 - i32.const 228 + i32.const 232 i32.const 0 call $~lib/env/abort unreachable @@ -9336,7 +9392,7 @@ if i32.const 0 i32.const 72 - i32.const 229 + i32.const 233 i32.const 0 call $~lib/env/abort unreachable @@ -9349,7 +9405,7 @@ if i32.const 0 i32.const 72 - i32.const 230 + i32.const 234 i32.const 0 call $~lib/env/abort unreachable @@ -9362,7 +9418,7 @@ if i32.const 0 i32.const 72 - i32.const 231 + i32.const 235 i32.const 0 call $~lib/env/abort unreachable @@ -9375,7 +9431,7 @@ if i32.const 0 i32.const 72 - i32.const 232 + i32.const 236 i32.const 0 call $~lib/env/abort unreachable @@ -9388,7 +9444,7 @@ if i32.const 0 i32.const 72 - i32.const 233 + i32.const 237 i32.const 0 call $~lib/env/abort unreachable @@ -9401,7 +9457,7 @@ if i32.const 0 i32.const 72 - i32.const 234 + i32.const 238 i32.const 0 call $~lib/env/abort unreachable @@ -9414,7 +9470,7 @@ if i32.const 0 i32.const 72 - i32.const 237 + i32.const 241 i32.const 0 call $~lib/env/abort unreachable @@ -9427,7 +9483,7 @@ if i32.const 0 i32.const 72 - i32.const 238 + i32.const 242 i32.const 0 call $~lib/env/abort unreachable @@ -9440,7 +9496,7 @@ if i32.const 0 i32.const 72 - i32.const 239 + i32.const 243 i32.const 0 call $~lib/env/abort unreachable @@ -9453,7 +9509,7 @@ if i32.const 0 i32.const 72 - i32.const 240 + i32.const 244 i32.const 0 call $~lib/env/abort unreachable @@ -9467,7 +9523,7 @@ if i32.const 0 i32.const 72 - i32.const 241 + i32.const 245 i32.const 0 call $~lib/env/abort unreachable @@ -9480,7 +9536,7 @@ if i32.const 0 i32.const 72 - i32.const 242 + i32.const 246 i32.const 0 call $~lib/env/abort unreachable @@ -9494,7 +9550,7 @@ if i32.const 0 i32.const 72 - i32.const 243 + i32.const 247 i32.const 0 call $~lib/env/abort unreachable @@ -9507,7 +9563,7 @@ if i32.const 0 i32.const 72 - i32.const 244 + i32.const 248 i32.const 0 call $~lib/env/abort unreachable @@ -9521,7 +9577,7 @@ if i32.const 0 i32.const 72 - i32.const 245 + i32.const 249 i32.const 0 call $~lib/env/abort unreachable @@ -9534,7 +9590,7 @@ if i32.const 0 i32.const 72 - i32.const 246 + i32.const 250 i32.const 0 call $~lib/env/abort unreachable @@ -9547,7 +9603,7 @@ if i32.const 0 i32.const 72 - i32.const 247 + i32.const 251 i32.const 0 call $~lib/env/abort unreachable @@ -9560,7 +9616,7 @@ if i32.const 0 i32.const 72 - i32.const 250 + i32.const 254 i32.const 0 call $~lib/env/abort unreachable @@ -9573,7 +9629,7 @@ if i32.const 0 i32.const 72 - i32.const 251 + i32.const 255 i32.const 0 call $~lib/env/abort unreachable @@ -9586,7 +9642,7 @@ if i32.const 0 i32.const 72 - i32.const 252 + i32.const 256 i32.const 0 call $~lib/env/abort unreachable @@ -9599,7 +9655,7 @@ if i32.const 0 i32.const 72 - i32.const 253 + i32.const 257 i32.const 0 call $~lib/env/abort unreachable @@ -9612,7 +9668,7 @@ if i32.const 0 i32.const 72 - i32.const 254 + i32.const 258 i32.const 0 call $~lib/env/abort unreachable @@ -9625,7 +9681,7 @@ if i32.const 0 i32.const 72 - i32.const 260 + i32.const 264 i32.const 0 call $~lib/env/abort unreachable @@ -9638,7 +9694,7 @@ if i32.const 0 i32.const 72 - i32.const 261 + i32.const 265 i32.const 0 call $~lib/env/abort unreachable @@ -9651,7 +9707,7 @@ if i32.const 0 i32.const 72 - i32.const 262 + i32.const 266 i32.const 0 call $~lib/env/abort unreachable @@ -9664,7 +9720,7 @@ if i32.const 0 i32.const 72 - i32.const 263 + i32.const 267 i32.const 0 call $~lib/env/abort unreachable @@ -9677,7 +9733,7 @@ if i32.const 0 i32.const 72 - i32.const 265 + i32.const 269 i32.const 0 call $~lib/env/abort unreachable @@ -9690,7 +9746,7 @@ if i32.const 0 i32.const 72 - i32.const 266 + i32.const 270 i32.const 0 call $~lib/env/abort unreachable @@ -9703,7 +9759,7 @@ if i32.const 0 i32.const 72 - i32.const 267 + i32.const 271 i32.const 0 call $~lib/env/abort unreachable @@ -9716,7 +9772,7 @@ if i32.const 0 i32.const 72 - i32.const 268 + i32.const 272 i32.const 0 call $~lib/env/abort unreachable @@ -9729,7 +9785,7 @@ if i32.const 0 i32.const 72 - i32.const 269 + i32.const 273 i32.const 0 call $~lib/env/abort unreachable @@ -9742,7 +9798,7 @@ if i32.const 0 i32.const 72 - i32.const 270 + i32.const 274 i32.const 0 call $~lib/env/abort unreachable @@ -9755,7 +9811,7 @@ if i32.const 0 i32.const 72 - i32.const 272 + i32.const 276 i32.const 0 call $~lib/env/abort unreachable @@ -9768,7 +9824,7 @@ if i32.const 0 i32.const 72 - i32.const 273 + i32.const 277 i32.const 0 call $~lib/env/abort unreachable @@ -9781,7 +9837,7 @@ if i32.const 0 i32.const 72 - i32.const 274 + i32.const 278 i32.const 0 call $~lib/env/abort unreachable @@ -9794,7 +9850,7 @@ if i32.const 0 i32.const 72 - i32.const 275 + i32.const 279 i32.const 0 call $~lib/env/abort unreachable @@ -9807,7 +9863,7 @@ if i32.const 0 i32.const 72 - i32.const 276 + i32.const 280 i32.const 0 call $~lib/env/abort unreachable @@ -9820,7 +9876,7 @@ if i32.const 0 i32.const 72 - i32.const 277 + i32.const 281 i32.const 0 call $~lib/env/abort unreachable @@ -9833,7 +9889,7 @@ if i32.const 0 i32.const 72 - i32.const 278 + i32.const 282 i32.const 0 call $~lib/env/abort unreachable @@ -9846,7 +9902,7 @@ if i32.const 0 i32.const 72 - i32.const 279 + i32.const 283 i32.const 0 call $~lib/env/abort unreachable @@ -9859,7 +9915,7 @@ if i32.const 0 i32.const 72 - i32.const 280 + i32.const 284 i32.const 0 call $~lib/env/abort unreachable @@ -9872,7 +9928,7 @@ if i32.const 0 i32.const 72 - i32.const 282 + i32.const 286 i32.const 0 call $~lib/env/abort unreachable @@ -9885,7 +9941,7 @@ if i32.const 0 i32.const 72 - i32.const 283 + i32.const 287 i32.const 0 call $~lib/env/abort unreachable @@ -9898,7 +9954,7 @@ if i32.const 0 i32.const 72 - i32.const 285 + i32.const 289 i32.const 0 call $~lib/env/abort unreachable @@ -9911,7 +9967,7 @@ if i32.const 0 i32.const 72 - i32.const 286 + i32.const 290 i32.const 0 call $~lib/env/abort unreachable @@ -9924,7 +9980,7 @@ if i32.const 0 i32.const 72 - i32.const 287 + i32.const 291 i32.const 0 call $~lib/env/abort unreachable @@ -9937,7 +9993,7 @@ if i32.const 0 i32.const 72 - i32.const 288 + i32.const 292 i32.const 0 call $~lib/env/abort unreachable @@ -9952,7 +10008,7 @@ if i32.const 0 i32.const 72 - i32.const 290 + i32.const 294 i32.const 0 call $~lib/env/abort unreachable @@ -9965,7 +10021,7 @@ if i32.const 0 i32.const 72 - i32.const 291 + i32.const 295 i32.const 0 call $~lib/env/abort unreachable @@ -9978,7 +10034,7 @@ if i32.const 0 i32.const 72 - i32.const 292 + i32.const 296 i32.const 0 call $~lib/env/abort unreachable @@ -9991,7 +10047,7 @@ if i32.const 0 i32.const 72 - i32.const 293 + i32.const 297 i32.const 0 call $~lib/env/abort unreachable @@ -10004,7 +10060,7 @@ if i32.const 0 i32.const 72 - i32.const 294 + i32.const 298 i32.const 0 call $~lib/env/abort unreachable @@ -10017,7 +10073,7 @@ if i32.const 0 i32.const 72 - i32.const 295 + i32.const 299 i32.const 0 call $~lib/env/abort unreachable @@ -10030,7 +10086,7 @@ if i32.const 0 i32.const 72 - i32.const 296 + i32.const 300 i32.const 0 call $~lib/env/abort unreachable @@ -10043,7 +10099,7 @@ if i32.const 0 i32.const 72 - i32.const 297 + i32.const 301 i32.const 0 call $~lib/env/abort unreachable @@ -10056,18 +10112,18 @@ if i32.const 0 i32.const 72 - i32.const 298 + i32.const 302 i32.const 0 call $~lib/env/abort unreachable end ) - (func $std/string/getString (; 74 ;) (type $FUNCSIG$i) (result i32) + (func $std/string/getString (; 75 ;) (type $FUNCSIG$i) (result i32) global.get $std/string/str ) - (func $start (; 75 ;) (type $FUNCSIG$v) + (func $start (; 76 ;) (type $FUNCSIG$v) call $start:std/string ) - (func $null (; 76 ;) (type $FUNCSIG$v) + (func $null (; 77 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/wasi.optimized.wat b/tests/compiler/wasi.optimized.wat new file mode 100644 index 00000000..78bc92ce --- /dev/null +++ b/tests/compiler/wasi.optimized.wat @@ -0,0 +1,25 @@ +(module + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) + (memory $0 1) + (data (i32.const 8) "\01\00\00\00\0e") + (data (i32.const 24) "w\00a\00s\00i\00.\00t\00s") + (table $0 2 funcref) + (elem (i32.const 0) $null $~lib/string/String~traverse) + (global $wasi/sig (mut i32) (i32.const 1)) + (global $~lib/capabilities i32 (i32.const 2)) + (export "memory" (memory $0)) + (export "table" (table $0)) + (export ".capabilities" (global $~lib/capabilities)) + (start $start) + (func $~lib/string/String~traverse (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $start (; 1 ;) (type $FUNCSIG$v) + i32.const 9 + global.set $wasi/sig + ) + (func $null (; 2 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/wasi.ts b/tests/compiler/wasi.ts new file mode 100644 index 00000000..cd42168f --- /dev/null +++ b/tests/compiler/wasi.ts @@ -0,0 +1,73 @@ +import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription, signal, dirprestat } from "bindings/wasi"; + +const WASM32 = 1; +const WASM64 = 2; + +assert(offsetof("next") == 0); +assert(offsetof("ino") == 8); +assert(offsetof("namlen") == 16); +assert(offsetof("type") == 20); +assert(offsetof() == 24); + +assert(offsetof("userdata") == 0); +assert(offsetof("error") == 8); +assert(offsetof("type") == 10); +assert(offsetof("nbytes") == 16); +assert(offsetof("flags") == 24); +assert(offsetof() == 32); + +assert(offsetof("filetype") == 0); +assert(offsetof("flags") == 2); +assert(offsetof("rights_base") == 8); +assert(offsetof("rights_inheriting") == 16); +assert(offsetof() == 24); + +assert(offsetof("dev") == 0); +assert(offsetof("ino") == 8); +assert(offsetof("filetype") == 16); +assert(offsetof("nlink") == 20); +assert(offsetof("size") == 24); +assert(offsetof("atim") == 32); +assert(offsetof("mtim") == 40); +assert(offsetof("ctim") == 48); +assert(offsetof() == 56); + +assert(offsetof("buf") == 0); +if (ASC_TARGET == WASM32) { + assert(offsetof("buf_len") == 4); + assert(offsetof() == 8); +} else if (ASC_TARGET == WASM64) { + assert(offsetof("buf_len") == 8); + assert(offsetof() == 16); +} else { + assert(false); +} + +assert(offsetof("userdata") == 0); +assert(offsetof("type") == 8); +assert(offsetof("identifier") == 16); +assert(offsetof("clock_id") == 24); +assert(offsetof("timeout") == 32); +assert(offsetof("precision") == 40); +assert(offsetof("flags") == 48); +assert(offsetof() == 56); + +assert(offsetof("userdata") == 0); +assert(offsetof("type") == 8); +assert(offsetof("fd") == 16); +assert(offsetof() == 20); + +assert(offsetof("type") == 0); +if (ASC_TARGET == WASM32) { + assert(offsetof("name_len") == 4); + assert(offsetof() == 8); +} else if (ASC_TARGET == WASM64) { + assert(offsetof("name_len") == 8); + assert(offsetof() == 16); +} else { + assert(false); +} + +// check assignability of mimicked typed enums +var sig: signal = signal.HUP; +sig = signal.KILL; diff --git a/tests/compiler/wasi.untouched.wat b/tests/compiler/wasi.untouched.wat new file mode 100644 index 00000000..9abbcdea --- /dev/null +++ b/tests/compiler/wasi.untouched.wat @@ -0,0 +1,552 @@ +(module + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\01\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00w\00a\00s\00i\00.\00t\00s\00") + (table $0 2 funcref) + (elem (i32.const 0) $null $~lib/string/String~traverse) + (global $wasi/WASM32 i32 (i32.const 1)) + (global $wasi/WASM64 i32 (i32.const 2)) + (global $~lib/ASC_TARGET i32 (i32.const 0)) + (global $wasi/sig (mut i32) (i32.const 1)) + (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) + (global $~lib/capabilities i32 (i32.const 2)) + (export "memory" (memory $0)) + (export "table" (table $0)) + (export ".capabilities" (global $~lib/capabilities)) + (start $start) + (func $~lib/string/String~traverse (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + ) + (func $start:wasi (; 2 ;) (type $FUNCSIG$v) + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 6 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 7 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 8 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 20 + i32.const 20 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 9 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 10 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 12 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 13 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 10 + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 14 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 15 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 16 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 32 + i32.const 32 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 17 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 19 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 2 + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 20 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 21 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 22 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 23 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 25 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 26 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 27 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 20 + i32.const 20 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 28 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 29 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 32 + i32.const 32 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 30 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 40 + i32.const 40 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 31 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 48 + i32.const 48 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 32 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 56 + i32.const 56 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 33 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 35 + i32.const 0 + call $~lib/env/abort + unreachable + end + block + i32.const 4 + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 37 + i32.const 2 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 38 + i32.const 2 + call $~lib/env/abort + unreachable + end + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 46 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 47 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 48 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 49 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 32 + i32.const 32 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 50 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 40 + i32.const 40 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 48 + i32.const 48 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 52 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 56 + i32.const 56 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 53 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 55 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 56 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 57 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 20 + i32.const 20 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 58 + i32.const 0 + call $~lib/env/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 60 + i32.const 0 + call $~lib/env/abort + unreachable + end + block + i32.const 4 + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 62 + i32.const 2 + call $~lib/env/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 63 + i32.const 2 + call $~lib/env/abort + unreachable + end + end + i32.const 9 + global.set $wasi/sig + ) + (func $start (; 3 ;) (type $FUNCSIG$v) + call $start:wasi + ) + (func $null (; 4 ;) (type $FUNCSIG$v) + ) +)