Skip to content

Commit

Permalink
remove unecessary isNullable checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jtenner committed May 11, 2020
1 parent 3d43fe2 commit 84f2a4e
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 126 deletions.
52 changes: 31 additions & 21 deletions packages/assembly/assembly/__tests__/greaterThan.spec.wat
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
(data (i32.const 3296) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g\00")
(data (i32.const 3328) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00y\00")
(data (i32.const 3360) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00z\00")
(data (i32.const 3392) "@\00\00\00\01\00\00\00\01\00\00\00@\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00_\00_\00t\00e\00s\00t\00s\00_\00_\00/\00s\00e\00t\00u\00p\00/\00V\00e\00c\003\00.\00t\00s\00")
(data (i32.const 3472) "P\00\00\00\01\00\00\00\01\00\00\00P\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 3568) "\00\00\00\00\01\00\00\00\08\00\00\00\00\00\00\00")
(data (i32.const 3584) "d\00\00\00\01\00\00\00\01\00\00\00d\00\00\00N\00u\00l\00l\00a\00b\00l\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3712) "`\00\00\00\01\00\00\00\01\00\00\00`\00\00\00N\00u\00l\00l\00a\00b\00l\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3824) "\8c\00\00\00\01\00\00\00\01\00\00\00\8c\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3984) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 4096) "\90\00\00\00\01\00\00\00\01\00\00\00\90\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 4256) "\0b\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\98\04\01\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\00\00\00\02\00\00\00")
(data (i32.const 3392) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00V\00a\00l\00u\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3504) "Z\00\00\00\01\00\00\00\01\00\00\00Z\00\00\00V\00a\00l\00u\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3616) "@\00\00\00\01\00\00\00\01\00\00\00@\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00_\00_\00t\00e\00s\00t\00s\00_\00_\00/\00s\00e\00t\00u\00p\00/\00V\00e\00c\003\00.\00t\00s\00")
(data (i32.const 3696) "P\00\00\00\01\00\00\00\01\00\00\00P\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 3792) "\00\00\00\00\01\00\00\00\08\00\00\00\00\00\00\00")
(data (i32.const 3808) "\8c\00\00\00\01\00\00\00\01\00\00\00\8c\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3968) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 4080) "\90\00\00\00\01\00\00\00\01\00\00\00\90\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 4240) "\0b\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\98\04\01\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\00\00\00\02\00\00\00")
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32)))
(import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32)))
Expand Down Expand Up @@ -99,8 +99,8 @@
(global $assembly/internal/noOp/noOp i32 (i32.const 13))
(global $assembly/internal/log/ignoreLogs (mut i32) (i32.const 0))
(global $~started (mut i32) (i32.const 0))
(global $~lib/rt/__rtti_base i32 (i32.const 4256))
(global $~lib/heap/__heap_base i32 (i32.const 4348))
(global $~lib/rt/__rtti_base i32 (i32.const 4240))
(global $~lib/heap/__heap_base i32 (i32.const 4332))
(export "__setArgumentsLength" (func $~setArgumentsLength))
(export "_start" (func $~start))
(export "memory" (memory $0))
Expand Down Expand Up @@ -4482,7 +4482,7 @@
i32.eqz
if
i32.const 0
i32.const 3408
i32.const 3632
i32.const 13
i32.const 4
call $~lib/builtins/abort
Expand All @@ -4492,7 +4492,7 @@
i32.eqz
if
i32.const 0
i32.const 3408
i32.const 3632
i32.const 14
i32.const 4
call $~lib/builtins/abort
Expand All @@ -4507,7 +4507,7 @@
local.get $3
else
i32.const 0
i32.const 3408
i32.const 3632
i32.const 16
i32.const 23
call $~lib/builtins/abort
Expand Down Expand Up @@ -4544,6 +4544,16 @@
local.get $1
local.get $4
call $assembly/internal/Expected/Expected.report<assembly/__tests__/setup/Vec3/Vec3>
local.get $1
i32.const 0
i32.ne
i32.const 3408
call $assembly/internal/assert/assert
local.get $3
i32.const 0
i32.ne
i32.const 3520
call $assembly/internal/assert/assert
local.get $4
local.get $3
local.get $1
Expand Down Expand Up @@ -4704,7 +4714,7 @@
local.get $1
i32.const 0
i32.const 8
i32.const 3584
i32.const 3808
call $~lib/rt/__allocBuffer
call $~lib/rt/pure/__retain
local.tee $3
Expand Down Expand Up @@ -4807,12 +4817,12 @@
local.get $1
i32.const 0
i32.ne
i32.const 3600
i32.const 3408
call $assembly/internal/assert/assert
local.get $3
i32.const 0
i32.ne
i32.const 3728
i32.const 3520
call $assembly/internal/assert/assert
local.get $4
local.get $3
Expand Down Expand Up @@ -4885,13 +4895,13 @@
i32.const 2768
i32.const 9
call $assembly/internal/Test/it
i32.const 3488
i32.const 3712
i32.const 10
i32.const 3840
i32.const 3824
call $assembly/internal/Test/throws
i32.const 4000
i32.const 3984
i32.const 11
i32.const 4112
i32.const 4096
call $assembly/internal/Test/throws
)
(func $start:assembly/__tests__/greaterThan.spec (; 99 ;)
Expand Down
52 changes: 31 additions & 21 deletions packages/assembly/assembly/__tests__/greaterThanOrEqualTo.spec.wat
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
(data (i32.const 3424) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g\00")
(data (i32.const 3456) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00y\00")
(data (i32.const 3488) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00z\00")
(data (i32.const 3520) "@\00\00\00\01\00\00\00\01\00\00\00@\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00_\00_\00t\00e\00s\00t\00s\00_\00_\00/\00s\00e\00t\00u\00p\00/\00V\00e\00c\003\00.\00t\00s\00")
(data (i32.const 3600) "P\00\00\00\01\00\00\00\01\00\00\00P\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 3696) "\00\00\00\00\01\00\00\00\08\00\00\00\00\00\00\00")
(data (i32.const 3712) "d\00\00\00\01\00\00\00\01\00\00\00d\00\00\00N\00u\00l\00l\00a\00b\00l\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3840) "`\00\00\00\01\00\00\00\01\00\00\00`\00\00\00N\00u\00l\00l\00a\00b\00l\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3952) "\9e\00\00\00\01\00\00\00\01\00\00\00\9e\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00O\00r\00E\00q\00u\00a\00l\00T\00o\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 4128) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 4240) "\a2\00\00\00\01\00\00\00\01\00\00\00\a2\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00O\00r\00E\00q\00u\00a\00l\00T\00o\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 4432) "\0b\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\98\04\01\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\00\00\00\02\00\00\00")
(data (i32.const 3520) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00V\00a\00l\00u\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3632) "Z\00\00\00\01\00\00\00\01\00\00\00Z\00\00\00V\00a\00l\00u\00e\00 \00c\00o\00m\00p\00a\00r\00i\00s\00o\00n\00 \00f\00a\00i\00l\00s\00,\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 3744) "@\00\00\00\01\00\00\00\01\00\00\00@\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00_\00_\00t\00e\00s\00t\00s\00_\00_\00/\00s\00e\00t\00u\00p\00/\00V\00e\00c\003\00.\00t\00s\00")
(data (i32.const 3824) "P\00\00\00\01\00\00\00\01\00\00\00P\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 3920) "\00\00\00\00\01\00\00\00\08\00\00\00\00\00\00\00")
(data (i32.const 3936) "\9e\00\00\00\01\00\00\00\01\00\00\00\9e\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00O\00r\00E\00q\00u\00a\00l\00T\00o\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00a\00c\00t\00u\00a\00l\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 4112) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00")
(data (i32.const 4224) "\a2\00\00\00\01\00\00\00\01\00\00\00\a2\00\00\00T\00h\00e\00 \00t\00o\00B\00e\00G\00r\00e\00a\00t\00e\00r\00T\00h\00a\00n\00O\00r\00E\00q\00u\00a\00l\00T\00o\00 \00f\00u\00n\00c\00t\00i\00o\00n\00 \00s\00h\00o\00u\00l\00d\00 \00t\00h\00r\00o\00w\00 \00i\00f\00 \00t\00h\00e\00 \00e\00x\00p\00e\00c\00t\00e\00d\00 \00v\00a\00l\00u\00e\00 \00i\00s\00 \00n\00u\00l\00l\00.\00")
(data (i32.const 4416) "\0b\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\98\04\01\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\00\00\00\02\00\00\00")
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32)))
(import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32)))
Expand Down Expand Up @@ -99,8 +99,8 @@
(global $assembly/internal/noOp/noOp i32 (i32.const 13))
(global $assembly/internal/log/ignoreLogs (mut i32) (i32.const 0))
(global $~started (mut i32) (i32.const 0))
(global $~lib/rt/__rtti_base i32 (i32.const 4432))
(global $~lib/heap/__heap_base i32 (i32.const 4524))
(global $~lib/rt/__rtti_base i32 (i32.const 4416))
(global $~lib/heap/__heap_base i32 (i32.const 4508))
(export "__setArgumentsLength" (func $~setArgumentsLength))
(export "_start" (func $~start))
(export "memory" (memory $0))
Expand Down Expand Up @@ -4482,7 +4482,7 @@
i32.eqz
if
i32.const 0
i32.const 3536
i32.const 3760
i32.const 22
i32.const 4
call $~lib/builtins/abort
Expand All @@ -4492,7 +4492,7 @@
i32.eqz
if
i32.const 0
i32.const 3536
i32.const 3760
i32.const 23
i32.const 4
call $~lib/builtins/abort
Expand All @@ -4507,7 +4507,7 @@
local.get $3
else
i32.const 0
i32.const 3536
i32.const 3760
i32.const 25
i32.const 23
call $~lib/builtins/abort
Expand Down Expand Up @@ -4544,6 +4544,16 @@
local.get $1
local.get $4
call $assembly/internal/Expected/Expected.report<assembly/__tests__/setup/Vec3/Vec3>
local.get $1
i32.const 0
i32.ne
i32.const 3536
call $assembly/internal/assert/assert
local.get $3
i32.const 0
i32.ne
i32.const 3648
call $assembly/internal/assert/assert
local.get $4
local.get $3
local.get $1
Expand Down Expand Up @@ -4704,7 +4714,7 @@
local.get $1
i32.const 0
i32.const 8
i32.const 3712
i32.const 3936
call $~lib/rt/__allocBuffer
call $~lib/rt/pure/__retain
local.tee $3
Expand Down Expand Up @@ -4807,12 +4817,12 @@
local.get $1
i32.const 0
i32.ne
i32.const 3728
i32.const 3536
call $assembly/internal/assert/assert
local.get $3
i32.const 0
i32.ne
i32.const 3856
i32.const 3648
call $assembly/internal/assert/assert
local.get $4
local.get $3
Expand Down Expand Up @@ -4885,13 +4895,13 @@
i32.const 2896
i32.const 9
call $assembly/internal/Test/it
i32.const 3616
i32.const 3840
i32.const 10
i32.const 3968
i32.const 3952
call $assembly/internal/Test/throws
i32.const 4144
i32.const 4128
i32.const 11
i32.const 4256
i32.const 4240
call $assembly/internal/Test/throws
)
(func $start:assembly/__tests__/greaterThanOrEqualTo.spec (; 99 ;)
Expand Down

0 comments on commit 84f2a4e

Please sign in to comment.