diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-05-11 11:23:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-11 11:23:55 -0700 |
commit | 57bef0d2f9a38a2add940e07fc422fd532574013 (patch) | |
tree | 0e93c4aaa08985d631ea87bfbee452825d93c405 /src/passes/Print.cpp | |
parent | bad3f9e8f058cfdaefb3d7d76a93e842665f8435 (diff) | |
download | binaryen-57bef0d2f9a38a2add940e07fc422fd532574013.tar.gz binaryen-57bef0d2f9a38a2add940e07fc422fd532574013.tar.bz2 binaryen-57bef0d2f9a38a2add940e07fc422fd532574013.zip |
Add ref.cast_nop_static (#4656)
This unsafe experimental instruction is semantically equivalent to
ref.cast_static, but V8 will unsafely turn it into a nop. This is meant to help
us measure cast overhead more precisely than we can by globally turning all
casts into nops.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 9a4235cbf..ce70f50fd 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1984,7 +1984,11 @@ struct PrintExpressionContents if (curr->rtt) { printMedium(o, "ref.cast"); } else { - printMedium(o, "ref.cast_static "); + if (curr->safety == RefCast::Unsafe) { + printMedium(o, "ref.cast_nop_static "); + } else { + printMedium(o, "ref.cast_static "); + } printHeapType(o, curr->intendedType, wasm); } } |