mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 13:57:58 +00:00
8b1aa1860f
wasm-opt doesn't optimize `0 < x || x > y` when y is known to be positive (e.g. a positive integer constant), so we do it manually. We also do it in a few places where `y` is not known to be positive in the Wasm code, but we know it's always positive, for example when it's a length. Example improvement in the wasm-opt output: ``` (func $_newArrayLengthCheck (;426;) (param $var0 i64) (result i64) local.get $var0 i64.const 2147483647 - i64.le_s - local.get $var0 - i64.const 0 - i64.ge_s - i32.and - i32.eqz + i64.gt_u if i32.const 46 i32.const 0 @@ -19190,13 +19172,8 @@ i64.const 97 i64.sub local.tee $var3 - i64.const 0 - i64.ge_s - local.get $var3 i64.const 5 - i64.le_s - i32.and - i32.eqz + i64.gt_u if local.get $var0 local.get $var6 @@ -19810,10 +19787,10 @@ global.get $global4 array.new_fixed $Array<_Type> 2 ) ``` Closes #56083. Change-Id: Idb1dd0d0809b26be8aec3d082aa341c59e1a353d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373663 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Ömer Ağacan <omersa@google.com> |
||
---|---|---|
.. | ||
_http | ||
_internal | ||
_wasm | ||
async | ||
cli | ||
collection | ||
convert | ||
core | ||
developer | ||
ffi | ||
html | ||
indexed_db | ||
internal | ||
io | ||
isolate | ||
js | ||
js_interop | ||
js_interop_unsafe | ||
js_util | ||
math | ||
mirrors | ||
svg | ||
typed_data | ||
vmservice | ||
web_audio | ||
web_gl | ||
web_sql | ||
libraries.json | ||
libraries.yaml | ||
PRESUBMIT.py | ||
vmservice_libraries.json | ||
vmservice_libraries.yaml |