mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 07:02:13 +00:00
General cleanup (#525)
* Cleans up and trims the overly large builtins file by ~1600 lines * Properly propagate inline assembler-like argument types * Use https in examples * Reformat README
This commit is contained in:
parent
5f547131ab
commit
252b843c4b
@ -26,5 +26,6 @@ jobs:
|
||||
script:
|
||||
- npm run clean && npm run test:compiler
|
||||
env:
|
||||
- ASC_FEATURES="simd"
|
||||
- Runs experimental tests on node.js v8-canary using
|
||||
- ASC_FEATURES="simd,threads"
|
||||
- NVM_NODEJS_ORG_MIRROR="https://nodejs.org/download/v8-canary/"
|
||||
|
73
README.md
73
README.md
@ -2,17 +2,40 @@
|
||||
=================
|
||||
|
||||
[](https://travis-ci.org/AssemblyScript/assemblyscript)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
**AssemblyScript** compiles strictly typed [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away.
|
||||
|
||||
Try it out in [WebAssembly Studio](https://webassembly.studio)!
|
||||
|
||||
---
|
||||
|
||||
<h3 align="center">Our Sponsors</h2>
|
||||
<p align="center">
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/0/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/1/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/2/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/3/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/4/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/5/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/6/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/7/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/8/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/9/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/9/avatar.svg"></a>
|
||||
</p>
|
||||
<br />
|
||||
<h3 align="center">Our Backers</h2>
|
||||
<p align="center">
|
||||
<a href="https://opencollective.com/assemblyscript#backers" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/backer.svg?avatarHeight=44" /></a>
|
||||
</p>
|
||||
|
||||
The core team members and most contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, [please donate to our OpenCollective](https://opencollective.com/assemblyscript). By sponsoring this project, your logo will show up above. Thank you so much for your support!
|
||||
|
||||
---
|
||||
|
||||
Motivation
|
||||
----------
|
||||
|
||||
> Being able to write C-performance code in TypeScript feels so good – Ari on [Slack](https://assemblyscript.slack.com) (Apr 19, 2018)
|
||||
> AssemblyScript was frictionless. Not only does it allow you to use TypeScript to write WebAssembly, [...] it also produces glue-free WebAssembly modules that are very small with decent performance. – Surma, [Replacing a hot path in your app's JavaScript with WebAssembly](https://developers.google.com/web/updates/2019/02/hotpath-with-wasm) (Feb 16, 2019)
|
||||
|
||||
> Perhaps the fundamental issue [to get a small .wasm file] is that JavaScript is the only language for which the Web runtime is a perfect fit. Close relatives that were designed to compile to it, like TypeScript, can be very efficient as well. But languages like C, C++, Rust, and so forth were not originally designed for that purpose. – Alon Zakai, [Small WebAssembly Binaries with Rust + Emscripten](https://kripken.github.io/blog/binaryen/2018/04/18/rust-emscripten.html) (Apr 18, 2018)
|
||||
|
||||
@ -20,8 +43,6 @@ Motivation
|
||||
|
||||
> I do think [compiling TypeScript into WASM] is tremendously useful. It allows JavaScript developers to create WASM modules without having to learn C. – Colin Eberhardt, [Exploring different approaches to building WebAssembly modules](http://blog.scottlogic.com/2017/10/17/wasm-mandelbrot.html) (Oct 17, 2017)
|
||||
|
||||
> AssemblyScript was frictionless. Not only does it allow you to use TypeScript to write WebAssembly, [...] it also produces glue-free WebAssembly modules that are very small with decent performance. – Surma, [Replacing a hot path in your app's JavaScript with WebAssembly](https://developers.google.com/web/updates/2019/02/hotpath-with-wasm) (Feb 16, 2019)
|
||||
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
@ -109,45 +130,3 @@ Running everything in order (lint, clean, test, build, test):
|
||||
```
|
||||
$> npm run all
|
||||
```
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
This project exists thanks to all the people who [contribute](CONTRIBUTING.md).
|
||||
|
||||
<a href="https://github.com/AssemblyScript/assemblyscript/graphs/contributors"><img src="https://opencollective.com/assemblyscript/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
Sponsoring
|
||||
----------
|
||||
|
||||
The core team members and most contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, [please donate](https://opencollective.com/assemblyscript).
|
||||
|
||||
This is how we use the donations:
|
||||
|
||||
* Allow the core team to work on AssemblyScript
|
||||
* Thank contributors if they invested a large amount of time in contributing
|
||||
* Support projects in the ecosystem that are of great value for us or users
|
||||
* Fees for money handling
|
||||
|
||||
### Sponsors
|
||||
|
||||
[Become a sponsor](https://opencollective.com/assemblyscript#sponsor) and get your logo on our README on Github with a link to your site.
|
||||
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/0/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/1/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/2/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/3/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/4/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/5/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/6/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/7/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/8/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/assemblyscript/tiers/sponsor/9/website" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/sponsor/9/avatar.svg"></a>
|
||||
|
||||
### Backers
|
||||
|
||||
[Become a backer](https://opencollective.com/assemblyscript#backer) and get your image on our README on Github with a link to your site.
|
||||
|
||||
<a href="https://opencollective.com/assemblyscript#backers" target="_blank"><img src="https://opencollective.com/assemblyscript/tiers/backer.svg?width=890"></a>
|
||||
|
||||
Thank you for your support!
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Conway's Game of Life - AssemblyScript</title>
|
||||
<link rel="icon" href="http://assemblyscript.org/favicon.ico" type="image/x-icon" />
|
||||
<link rel="icon" href="https://assemblyscript.org/favicon.ico" type="image/x-icon" />
|
||||
<meta name="viewport" content="user-scalable=0" />
|
||||
<style>
|
||||
html, body { height: 100%; margin: 0; overflow: hidden; color: #111; background: #fff; font-family: sans-serif; }
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Mandelbrot set - AssemblyScript</title>
|
||||
<link rel="icon" href="http://assemblyscript.org/favicon.ico" type="image/x-icon" />
|
||||
<link rel="icon" href="https://assemblyscript.org/favicon.ico" type="image/x-icon" />
|
||||
<style>
|
||||
html, body { height: 100%; margin: 0; overflow: hidden; color: #111; background: #fff; font-family: sans-serif; }
|
||||
h1 { padding: 20px; font-size: 12pt; margin: 0; }
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>N-body system - AssemblyScript</title>
|
||||
<link rel="icon" href="http://assemblyscript.org/favicon.ico" type="image/x-icon" />
|
||||
<link rel="icon" href="https://assemblyscript.org/favicon.ico" type="image/x-icon" />
|
||||
<meta name="viewport" content="user-scalable=0" />
|
||||
<style>
|
||||
html, body { height: 100%; margin: 0; overflow: hidden; color: #111; background: #fff; font-family: sans-serif; }
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -3055,6 +3055,11 @@
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"opencollective-postinstall": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz",
|
||||
"integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw=="
|
||||
},
|
||||
"optimist": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
|
||||
|
12
package.json
12
package.json
@ -15,7 +15,8 @@
|
||||
"binaryen": "69.0.0-nightly.20190228",
|
||||
"glob": "^7.1.3",
|
||||
"long": "^4.0.0",
|
||||
"source-map-support": "^0.5.10"
|
||||
"source-map-support": "^0.5.10",
|
||||
"opencollective-postinstall": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^11.9.5",
|
||||
@ -51,7 +52,8 @@
|
||||
"test:compiler": "node tests/compiler",
|
||||
"make": "npm run clean && npm test && npm run build && npm test",
|
||||
"all": "npm run check && npm run make",
|
||||
"docs": "typedoc --tsconfig tsconfig-docs.json --mode modules --name \"AssemblyScript Compiler API\" --out ./docs/api --ignoreCompilerErrors --excludeNotExported --excludePrivate --excludeExternals --exclude **/std/** --includeDeclarations --readme src/README.md"
|
||||
"docs": "typedoc --tsconfig tsconfig-docs.json --mode modules --name \"AssemblyScript Compiler API\" --out ./docs/api --ignoreCompilerErrors --excludeNotExported --excludePrivate --excludeExternals --exclude **/std/** --includeDeclarations --readme src/README.md",
|
||||
"postinstall": "opencollective-postinstall"
|
||||
},
|
||||
"files": [
|
||||
"lib/loader/index.d.ts",
|
||||
@ -70,5 +72,9 @@
|
||||
"src/",
|
||||
"std/",
|
||||
"tsconfig-base.json"
|
||||
]
|
||||
],
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/assemblyscript"
|
||||
}
|
||||
}
|
||||
|
6309
src/builtins.ts
6309
src/builtins.ts
File diff suppressed because it is too large
Load Diff
@ -330,10 +330,6 @@ export enum BinaryOp {
|
||||
export enum HostOp {
|
||||
CurrentMemory = _BinaryenCurrentMemory(),
|
||||
GrowMemory = _BinaryenGrowMemory(),
|
||||
|
||||
// see: https://github.com/WebAssembly/bulk-memory-operations
|
||||
// MoveMemory
|
||||
// SetMemory
|
||||
}
|
||||
|
||||
export enum AtomicRMWOp {
|
||||
@ -365,19 +361,19 @@ export enum SIMDReplaceOp {
|
||||
ReplaceLaneVecF64x2 = _BinaryenReplaceLaneVecF64x2()
|
||||
}
|
||||
|
||||
export enum SIMDShiftOp { // FIXME: seems to be missing in binaryen-c.h
|
||||
ShlVecI8x16,
|
||||
ShrSVecI8x16,
|
||||
ShrUVecI8x16,
|
||||
ShlVecI16x8,
|
||||
ShrSVecI16x8,
|
||||
ShrUVecI16x8,
|
||||
ShlVecI32x4,
|
||||
ShrSVecI32x4,
|
||||
ShrUVecI32x4,
|
||||
ShlVecI64x2,
|
||||
ShrSVecI64x2,
|
||||
ShrUVecI64x2
|
||||
export enum SIMDShiftOp {
|
||||
ShlVecI8x16 = _BinaryenShlVecI8x16(),
|
||||
ShrSVecI8x16 = _BinaryenShrSVecI8x16(),
|
||||
ShrUVecI8x16 = _BinaryenShrUVecI8x16(),
|
||||
ShlVecI16x8 = _BinaryenShlVecI16x8(),
|
||||
ShrSVecI16x8 = _BinaryenShrSVecI16x8(),
|
||||
ShrUVecI16x8 = _BinaryenShrUVecI16x8(),
|
||||
ShlVecI32x4 = _BinaryenShlVecI32x4(),
|
||||
ShrSVecI32x4 = _BinaryenShrSVecI32x4(),
|
||||
ShrUVecI32x4 = _BinaryenShrUVecI32x4(),
|
||||
ShlVecI64x2 = _BinaryenShlVecI64x2(),
|
||||
ShrSVecI64x2 = _BinaryenShrSVecI64x2(),
|
||||
ShrUVecI64x2 = _BinaryenShrUVecI64x2()
|
||||
}
|
||||
|
||||
export class MemorySegment {
|
||||
@ -482,7 +478,6 @@ export class Module {
|
||||
createV128(bytes: Uint8Array): ExpressionRef {
|
||||
assert(bytes.length == 16);
|
||||
var out = this.lit;
|
||||
// FIXME: does this work or do we need to malloc?
|
||||
for (let i = 0; i < 16; ++i) store<u8>(out + i, bytes[i]);
|
||||
_BinaryenLiteralVec128(out, out);
|
||||
return _BinaryenConst(this.ref, out);
|
||||
@ -1196,6 +1191,10 @@ export class Module {
|
||||
case NativeType.F64: {
|
||||
return this.createF64(_BinaryenConstGetValueF64(expr));
|
||||
}
|
||||
case NativeType.V128: {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
default: {
|
||||
throw new Error("concrete type expected");
|
||||
}
|
||||
@ -1751,7 +1750,8 @@ export function needsExplicitUnreachable(expr: ExpressionRef): bool {
|
||||
case NativeType.I32:
|
||||
case NativeType.I64:
|
||||
case NativeType.F32:
|
||||
case NativeType.F64: return false;
|
||||
case NativeType.F64:
|
||||
case NativeType.V128: return false;
|
||||
}
|
||||
switch (_BinaryenExpressionGetId(expr)) {
|
||||
case ExpressionId.Unreachable:
|
||||
|
@ -57,7 +57,7 @@ export namespace atomic {
|
||||
@builtin export declare function xchg<T>(ptr: usize, value: T, immOffset?: usize): T;
|
||||
@builtin export declare function cmpxchg<T>(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;
|
||||
@builtin export declare function wait<T>(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;
|
||||
@builtin export declare function notify<T>(ptr: usize, count: u32): u32;
|
||||
@builtin export declare function notify<T>(ptr: usize, count: i32): i32;
|
||||
}
|
||||
|
||||
@lazy export const enum AtomicWaitResult {
|
||||
|
2
std/assembly/index.d.ts
vendored
2
std/assembly/index.d.ts
vendored
@ -186,7 +186,7 @@ declare namespace atomic {
|
||||
/** Performs a wait operation on an integer value in memory suspending this agent if the condition is met. */
|
||||
export function wait<T>(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;
|
||||
/** Performs a notify operation on an integer value in memory waking up suspended agents. */
|
||||
export function notify<T>(ptr: usize, count: u32): i32;
|
||||
export function notify<T>(ptr: usize, count: i32): i32;
|
||||
}
|
||||
|
||||
/** Describes the result of an atomic wait operation. */
|
||||
|
@ -426,14 +426,14 @@
|
||||
i32.const 1
|
||||
i32.store
|
||||
i32.const 8
|
||||
i32.const 1
|
||||
i32.store8
|
||||
i64.const 1
|
||||
i64.store8
|
||||
i32.const 8
|
||||
i32.const 1
|
||||
i32.store16
|
||||
i64.const 1
|
||||
i64.store16
|
||||
i32.const 8
|
||||
i32.const 1
|
||||
i32.store
|
||||
i64.const 1
|
||||
i64.store32
|
||||
i32.const 8
|
||||
i64.const 1
|
||||
i64.store
|
||||
|
@ -274,6 +274,12 @@ sizeof<isize>();
|
||||
assert(sizeof<f32>() == 4);
|
||||
assert(sizeof<f64>() == 8);
|
||||
|
||||
assert(alignof<u8>() == 0);
|
||||
assert(alignof<u16>() == 1);
|
||||
assert(alignof<u32>() == 2);
|
||||
assert(alignof<u64>() == 3);
|
||||
assert(alignof<bool>() == 0);
|
||||
|
||||
class Foo<T> { a: T; b: T; }
|
||||
assert(offsetof<Foo<i32>>("a") == 0);
|
||||
assert(offsetof<Foo<i32>>("b") == 4);
|
||||
|
@ -1513,6 +1513,18 @@
|
||||
i32.const 0
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 277
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -1521,8 +1533,8 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 4
|
||||
i32.const 4
|
||||
i32.const 2
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
@ -1533,8 +1545,8 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
i32.const 3
|
||||
i32.const 3
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
@ -1545,8 +1557,8 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
i32.const 2
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
@ -1564,7 +1576,55 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 283
|
||||
i32.const 284
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 4
|
||||
i32.const 4
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 285
|
||||
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 8
|
||||
i32.const 286
|
||||
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 8
|
||||
i32.const 287
|
||||
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 8
|
||||
i32.const 289
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1576,7 +1636,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 284
|
||||
i32.const 290
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1588,7 +1648,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 286
|
||||
i32.const 292
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1606,7 +1666,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 287
|
||||
i32.const 293
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1624,7 +1684,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 288
|
||||
i32.const 294
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1645,7 +1705,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 289
|
||||
i32.const 295
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1666,7 +1726,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 290
|
||||
i32.const 296
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1687,7 +1747,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 291
|
||||
i32.const 297
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1708,7 +1768,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 292
|
||||
i32.const 298
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1728,7 +1788,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 293
|
||||
i32.const 299
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1748,7 +1808,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 294
|
||||
i32.const 300
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1764,7 +1824,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 307
|
||||
i32.const 313
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1776,7 +1836,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 308
|
||||
i32.const 314
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1792,7 +1852,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 309
|
||||
i32.const 315
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1804,7 +1864,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 310
|
||||
i32.const 316
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1816,7 +1876,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 311
|
||||
i32.const 317
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1828,7 +1888,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 312
|
||||
i32.const 318
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1840,7 +1900,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 313
|
||||
i32.const 319
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1852,7 +1912,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 314
|
||||
i32.const 320
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1864,7 +1924,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 316
|
||||
i32.const 322
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1876,7 +1936,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 317
|
||||
i32.const 323
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1888,7 +1948,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 318
|
||||
i32.const 324
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1900,7 +1960,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 319
|
||||
i32.const 325
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1912,7 +1972,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 320
|
||||
i32.const 326
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1924,7 +1984,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 321
|
||||
i32.const 327
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1936,7 +1996,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 322
|
||||
i32.const 328
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1948,7 +2008,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 323
|
||||
i32.const 329
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1960,7 +2020,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 324
|
||||
i32.const 330
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1972,7 +2032,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 324
|
||||
i32.const 330
|
||||
i32.const 29
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1984,7 +2044,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 325
|
||||
i32.const 331
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1996,7 +2056,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 325
|
||||
i32.const 331
|
||||
i32.const 29
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2008,7 +2068,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 327
|
||||
i32.const 333
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2020,7 +2080,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 328
|
||||
i32.const 334
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2032,7 +2092,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 329
|
||||
i32.const 335
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2044,7 +2104,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 330
|
||||
i32.const 336
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2056,7 +2116,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 331
|
||||
i32.const 337
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2068,7 +2128,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 332
|
||||
i32.const 338
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2080,7 +2140,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 334
|
||||
i32.const 340
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2092,7 +2152,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 335
|
||||
i32.const 341
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2104,7 +2164,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 336
|
||||
i32.const 342
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2116,7 +2176,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 337
|
||||
i32.const 343
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2128,7 +2188,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 338
|
||||
i32.const 344
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2140,7 +2200,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 339
|
||||
i32.const 345
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2297,14 +2357,14 @@
|
||||
i32.const 1
|
||||
i32.store
|
||||
i32.const 8
|
||||
i32.const 1
|
||||
i32.store8
|
||||
i64.const 1
|
||||
i64.store8
|
||||
i32.const 8
|
||||
i32.const 1
|
||||
i32.store16
|
||||
i64.const 1
|
||||
i64.store16
|
||||
i32.const 8
|
||||
i32.const 1
|
||||
i32.store
|
||||
i64.const 1
|
||||
i64.store32
|
||||
i32.const 8
|
||||
i64.const 1
|
||||
i64.store
|
||||
|
@ -99,65 +99,65 @@ function testAtomicAsm(): void {
|
||||
i32.atomic.store8(0, 1);
|
||||
i32.atomic.store16(0, 1);
|
||||
i32.atomic.store(0, 1);
|
||||
i64.atomic.store8(0, <i64>1);
|
||||
i64.atomic.store16(0, <i64>1);
|
||||
i64.atomic.store32(0, <i64>1);
|
||||
i64.atomic.store8(0, 1);
|
||||
i64.atomic.store16(0, 1);
|
||||
i64.atomic.store32(0, 1);
|
||||
i64.atomic.store(0, 1);
|
||||
|
||||
i32.atomic.rmw8.add_u(0, 1);
|
||||
i32.atomic.rmw16.add_u(0, 1);
|
||||
i32.atomic.rmw.add(0, 1);
|
||||
i64.atomic.rmw8.add_u(0, <i64>1);
|
||||
i64.atomic.rmw16.add_u(0, <i64>1);
|
||||
i64.atomic.rmw32.add_u(0, <i64>1);
|
||||
i64.atomic.rmw8.add_u(0, 1);
|
||||
i64.atomic.rmw16.add_u(0, 1);
|
||||
i64.atomic.rmw32.add_u(0, 1);
|
||||
i64.atomic.rmw.add(0, 1);
|
||||
|
||||
i32.atomic.rmw8.sub_u(0, 1);
|
||||
i32.atomic.rmw16.sub_u(0, 1);
|
||||
i32.atomic.rmw.sub(0, 1);
|
||||
i64.atomic.rmw8.sub_u(0, <i64>1);
|
||||
i64.atomic.rmw16.sub_u(0, <i64>1);
|
||||
i64.atomic.rmw32.sub_u(0, <i64>1);
|
||||
i64.atomic.rmw8.sub_u(0, 1);
|
||||
i64.atomic.rmw16.sub_u(0, 1);
|
||||
i64.atomic.rmw32.sub_u(0, 1);
|
||||
i64.atomic.rmw.sub(0, 1);
|
||||
|
||||
i32.atomic.rmw8.and_u(0, 1);
|
||||
i32.atomic.rmw16.and_u(0, 1);
|
||||
i32.atomic.rmw.and(0, 1);
|
||||
i64.atomic.rmw8.and_u(0, <i64>1);
|
||||
i64.atomic.rmw16.and_u(0, <i64>1);
|
||||
i64.atomic.rmw32.and_u(0, <i64>1);
|
||||
i64.atomic.rmw8.and_u(0, 1);
|
||||
i64.atomic.rmw16.and_u(0, 1);
|
||||
i64.atomic.rmw32.and_u(0, 1);
|
||||
i64.atomic.rmw.and(0, 1);
|
||||
|
||||
i32.atomic.rmw8.or_u(0, 1);
|
||||
i32.atomic.rmw16.or_u(0, 1);
|
||||
i32.atomic.rmw.or(0, 1);
|
||||
i64.atomic.rmw8.or_u(0, <i64>1);
|
||||
i64.atomic.rmw16.or_u(0, <i64>1);
|
||||
i64.atomic.rmw32.or_u(0, <i64>1);
|
||||
i64.atomic.rmw8.or_u(0, 1);
|
||||
i64.atomic.rmw16.or_u(0, 1);
|
||||
i64.atomic.rmw32.or_u(0, 1);
|
||||
i64.atomic.rmw.or(0, 1);
|
||||
|
||||
i32.atomic.rmw8.xor_u(0, 1);
|
||||
i32.atomic.rmw16.xor_u(0, 1);
|
||||
i32.atomic.rmw.xor(0, 1);
|
||||
i64.atomic.rmw8.xor_u(0, <i64>1);
|
||||
i64.atomic.rmw16.xor_u(0, <i64>1);
|
||||
i64.atomic.rmw32.xor_u(0, <i64>1);
|
||||
i64.atomic.rmw8.xor_u(0, 1);
|
||||
i64.atomic.rmw16.xor_u(0, 1);
|
||||
i64.atomic.rmw32.xor_u(0, 1);
|
||||
i64.atomic.rmw.xor(0, 1);
|
||||
|
||||
i32.atomic.rmw8.xchg_u(0, 1);
|
||||
i32.atomic.rmw16.xchg_u(0, 1);
|
||||
i32.atomic.rmw.xchg(0, 1);
|
||||
i64.atomic.rmw8.xchg_u(0, <i64>1);
|
||||
i64.atomic.rmw16.xchg_u(0, <i64>1);
|
||||
i64.atomic.rmw32.xchg_u(0, <i64>1);
|
||||
i64.atomic.rmw8.xchg_u(0, 1);
|
||||
i64.atomic.rmw16.xchg_u(0, 1);
|
||||
i64.atomic.rmw32.xchg_u(0, 1);
|
||||
i64.atomic.rmw.xchg(0, 1);
|
||||
|
||||
i32.atomic.rmw8.cmpxchg_u(0, 1, 2);
|
||||
i32.atomic.rmw16.cmpxchg_u(0, 1, 2);
|
||||
i32.atomic.rmw.cmpxchg(0, 1, 2);
|
||||
i64.atomic.rmw8.cmpxchg_u(0, <i64>1, 2);
|
||||
i64.atomic.rmw16.cmpxchg_u(0, <i64>1, 2);
|
||||
i64.atomic.rmw32.cmpxchg_u(0, <i64>1, 2);
|
||||
i64.atomic.rmw8.cmpxchg_u(0, 1, 2);
|
||||
i64.atomic.rmw16.cmpxchg_u(0, 1, 2);
|
||||
i64.atomic.rmw32.cmpxchg_u(0, 1, 2);
|
||||
i64.atomic.rmw.cmpxchg(0, 1, 2);
|
||||
|
||||
// i32.atomic.wait(0, 0, -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user