scala-wasm
scala-wasm copied to clipboard
Efficient type inclusion test
Current .isInstanceOf[<interface>] implementation walk through the itables, which requires O(N), it would be nice if we can test it with O(1) with small space requirements.
https://github.com/tanishiking/scala-wasm/blob/0b446827bfe04181413443b235dcfcb4398073cc/wasm/src/main/scala/ir2wasm/HelperFunctions.scala#L700-L707
You can find the related paper here https://github.com/tanishiking/scala-wasm/issues/27#issuecomment-2008252049