Skip to content

Update binaryen #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/asc.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ exports.main = function main(argv, options, callback) {
const filename = argv[i];

let sourcePath = String(filename).replace(/\\/g, "/").replace(extension.re, "").replace(/[\\/]$/, "");

// Setting the path to relative path
sourcePath = path.isAbsolute(sourcePath) ? path.relative(baseDir, sourcePath) : sourcePath;

Expand Down
494 changes: 124 additions & 370 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
"url": "https://github.com/AssemblyScript/assemblyscript/issues"
},
"dependencies": {
"binaryen": "93.0.0-nightly.20200609",
"binaryen": "94.0.0-nightly.20200709",
"long": "^4.0.0",
"source-map-support": "^0.5.19",
"ts-node": "^6.2.0"
},
"devDependencies": {
"@types/node": "^14.0.13",
"@typescript-eslint/eslint-plugin": "^3.2.0",
"@typescript-eslint/parser": "^3.2.0",
"@types/node": "^14.0.19",
"@typescript-eslint/eslint-plugin": "^3.6.0",
"@typescript-eslint/parser": "^3.6.0",
"browser-process-hrtime": "^1.0.0",
"diff": "^4.0.2",
"eslint": "^7.2.0",
"eslint": "^7.4.0",
"glob": "^7.1.6",
"physical-cpu-count": "^2.0.0",
"semantic-release": "github:dcodeIO/semantic-release",
"source-map-support": "^0.5.19",
"ts-loader": "^7.0.5",
"ts-node": "^6.2.0",
"typescript": "^3.9.5",
"typescript": "^3.9.6",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
"webpack-cli": "^3.3.12"
},
"main": "index.js",
"types": "index.d.ts",
Expand Down
86 changes: 19 additions & 67 deletions tests/compiler/binary.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,6 @@
f64.mul
)
(func $start:binary
global.get $binary/i
i32.const 1
i32.rem_s
drop
global.get $binary/i
call $~lib/math/ipow32
drop
Expand All @@ -353,11 +349,9 @@
i32.const 1
i32.sub
global.set $binary/i
global.get $binary/i
i32.const 1
i32.rem_s
i32.const 0
global.set $binary/i
global.get $binary/i
i32.const 0
call $~lib/math/ipow32
global.set $binary/i
global.get $binary/i
Expand Down Expand Up @@ -392,65 +386,37 @@
i32.const 1
i32.sub
global.set $binary/i
global.get $binary/i
i32.const 1
i32.rem_s
i32.const 0
global.set $binary/i
global.get $binary/i
i32.const 1
i32.shl
i32.const 0
global.set $binary/i
global.get $binary/i
i32.const 1
i32.shr_s
i32.const 0
global.set $binary/i
global.get $binary/i
i32.const 1
i32.shr_u
i32.const 0
global.set $binary/i
global.get $binary/i
i32.const 1
i32.and
i32.const 0
global.set $binary/i
global.get $binary/i
i32.const 1
i32.or
global.set $binary/i
global.get $binary/i
i32.const 1
i32.xor
i32.const 0
global.set $binary/i
global.get $binary/I
i64.const 1
i64.rem_s
drop
global.get $binary/I
i64.const 1
i64.add
global.set $binary/I
global.get $binary/I
i64.const 1
i64.sub
global.set $binary/I
global.get $binary/I
i64.const 1
i64.rem_s
i64.const 0
global.set $binary/I
global.get $binary/I
f64.convert_i64_s
i64.trunc_f64_s
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.shl
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.shr_s
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.shr_u
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
Expand All @@ -472,33 +438,19 @@
i64.const 1
i64.sub
global.set $binary/I
global.get $binary/I
i64.const 1
i64.rem_s
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.shl
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.shr_s
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.shr_u
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.and
i64.const 0
global.set $binary/I
global.get $binary/I
i64.const 1
i64.or
global.set $binary/I
global.get $binary/I
i64.const 1
i64.xor
i64.const 0
global.set $binary/I
global.get $binary/f
call $~lib/math/NativeMathf.mod
Expand Down
24 changes: 12 additions & 12 deletions tests/compiler/features/reference-types.optimized.wat
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
(module
(type $anyref_=>_anyref (func (param anyref) (result anyref)))
(type $externref_=>_externref (func (param externref) (result externref)))
(type $none_=>_none (func))
(type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
(type $anyref_=>_none (func (param anyref)))
(type $anyref_anyref_=>_i32 (func (param anyref anyref) (result i32)))
(type $anyref_anyref_=>_anyref (func (param anyref anyref) (result anyref)))
(import "reference-types" "someObject" (global $features/reference-types/someObject anyref))
(import "reference-types" "someKey" (global $features/reference-types/someKey anyref))
(import "Reflect" "has" (func $~lib/bindings/Reflect/has (param anyref anyref) (result i32)))
(type $externref_=>_none (func (param externref)))
(type $externref_externref_=>_i32 (func (param externref externref) (result i32)))
(type $externref_externref_=>_externref (func (param externref externref) (result externref)))
(import "reference-types" "someObject" (global $features/reference-types/someObject externref))
(import "reference-types" "someKey" (global $features/reference-types/someKey externref))
(import "Reflect" "has" (func $~lib/bindings/Reflect/has (param externref externref) (result i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "console" "log" (func $~lib/bindings/console/log (param anyref)))
(import "Reflect" "get" (func $~lib/bindings/Reflect/get (param anyref anyref) (result anyref)))
(import "reference-types" "external" (func $features/reference-types/external (param anyref) (result anyref)))
(import "console" "log" (func $~lib/bindings/console/log (param externref)))
(import "Reflect" "get" (func $~lib/bindings/Reflect/get (param externref externref) (result externref)))
(import "reference-types" "external" (func $features/reference-types/external (param externref) (result externref)))
(memory $0 1)
(data (i32.const 1024) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00r\00e\00f\00e\00r\00e\00n\00c\00e\00-\00t\00y\00p\00e\00s\00.\00t\00s")
(global $features/reference-types/nullGlobal (mut anyref) (ref.null))
(global $features/reference-types/nullGlobal (mut externref) (ref.null))
(export "memory" (memory $0))
(export "external" (func $features/reference-types/external))
(export "internal" (func $features/reference-types/internal))
(start $~start)
(func $features/reference-types/internal (param $0 anyref) (result anyref)
(func $features/reference-types/internal (param $0 externref) (result externref)
local.get $0
call $features/reference-types/external
call $features/reference-types/external
Expand Down
38 changes: 19 additions & 19 deletions tests/compiler/features/reference-types.untouched.wat
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
(module
(type $none_=>_none (func))
(type $anyref_=>_anyref (func (param anyref) (result anyref)))
(type $externref_=>_externref (func (param externref) (result externref)))
(type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
(type $anyref_=>_none (func (param anyref)))
(type $anyref_anyref_=>_i32 (func (param anyref anyref) (result i32)))
(type $anyref_anyref_=>_anyref (func (param anyref anyref) (result anyref)))
(import "reference-types" "someObject" (global $features/reference-types/someObject anyref))
(import "reference-types" "someKey" (global $features/reference-types/someKey anyref))
(import "Reflect" "has" (func $~lib/bindings/Reflect/has (param anyref anyref) (result i32)))
(type $externref_=>_none (func (param externref)))
(type $externref_externref_=>_i32 (func (param externref externref) (result i32)))
(type $externref_externref_=>_externref (func (param externref externref) (result externref)))
(import "reference-types" "someObject" (global $features/reference-types/someObject externref))
(import "reference-types" "someKey" (global $features/reference-types/someKey externref))
(import "Reflect" "has" (func $~lib/bindings/Reflect/has (param externref externref) (result i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "console" "log" (func $~lib/bindings/console/log (param anyref)))
(import "Reflect" "get" (func $~lib/bindings/Reflect/get (param anyref anyref) (result anyref)))
(import "reference-types" "external" (func $features/reference-types/external (param anyref) (result anyref)))
(import "console" "log" (func $~lib/bindings/console/log (param externref)))
(import "Reflect" "get" (func $~lib/bindings/Reflect/get (param externref externref) (result externref)))
(import "reference-types" "external" (func $features/reference-types/external (param externref) (result externref)))
(memory $0 1)
(data (i32.const 16) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00r\00e\00f\00e\00r\00e\00n\00c\00e\00-\00t\00y\00p\00e\00s\00.\00t\00s\00")
(table $0 1 funcref)
(global $features/reference-types/nullGlobal (mut anyref) (ref.null))
(global $features/reference-types/nullGlobalInit (mut anyref) (ref.null))
(global $features/reference-types/funcGlobal (mut anyref) (ref.null))
(global $features/reference-types/nullGlobal (mut externref) (ref.null))
(global $features/reference-types/nullGlobalInit (mut externref) (ref.null))
(global $features/reference-types/funcGlobal (mut externref) (ref.null))
(export "memory" (memory $0))
(export "external" (func $features/reference-types/external))
(export "internal" (func $features/reference-types/internal))
Expand All @@ -26,8 +26,8 @@
nop
)
(func $start:features/reference-types
(local $0 anyref)
(local $1 anyref)
(local $0 externref)
(local $1 externref)
global.get $features/reference-types/someObject
global.get $features/reference-types/someKey
call $~lib/bindings/Reflect/has
Expand Down Expand Up @@ -141,10 +141,10 @@
ref.func $features/reference-types/someFunc
local.set $1
)
(func $features/reference-types/internal (param $0 anyref) (result anyref)
(local $1 anyref)
(local $2 anyref)
(local $3 anyref)
(func $features/reference-types/internal (param $0 externref) (result externref)
(local $1 externref)
(local $2 externref)
(local $3 externref)
local.get $0
call $features/reference-types/external
local.set $1
Expand Down
26 changes: 13 additions & 13 deletions tests/compiler/number.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -1173,14 +1173,14 @@
i64.const 32
i64.shr_u
local.tee $3
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
local.get $2
i64.const 4294967295
i64.and
local.tee $2
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
i64.const 0
i64.add
local.tee $1
Expand All @@ -1202,27 +1202,27 @@
i32.const 2
i32.add
local.get $3
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
local.get $2
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
local.get $2
i64.const 1024
i64.mul
i64.const 10
i64.shl
i64.const 32
i64.shr_u
i64.add
local.tee $1
i64.const 32
i64.shr_u
i64.add
local.get $3
i64.const 1024
i64.mul
local.get $1
i64.const 4294967295
i64.and
local.get $3
i64.const 10
i64.shl
i64.add
i64.const 2147483647
i64.add
Expand Down
26 changes: 13 additions & 13 deletions tests/compiler/resolve-binary.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -1187,14 +1187,14 @@
i64.const 32
i64.shr_u
local.tee $3
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
local.get $2
i64.const 4294967295
i64.and
local.tee $2
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
i64.const 0
i64.add
local.tee $1
Expand All @@ -1216,27 +1216,27 @@
i32.const 3
i32.add
local.get $3
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
local.get $2
i64.const 2147483648
i64.mul
i64.const 31
i64.shl
local.get $2
i64.const 1024
i64.mul
i64.const 10
i64.shl
i64.const 32
i64.shr_u
i64.add
local.tee $1
i64.const 32
i64.shr_u
i64.add
local.get $3
i64.const 1024
i64.mul
local.get $1
i64.const 4294967295
i64.and
local.get $3
i64.const 10
i64.shl
i64.add
i64.const 2147483647
i64.add
Expand Down
Loading