wabt icon indicating copy to clipboard operation
wabt copied to clipboard

Add Type::RefT to represent (ref $T)

Open binji opened this issue 5 years ago • 1 comments

This adds support for handling types of the form (ref $T), where $T is an index into the type section. Rather than storing an additional field in the Type struct, it's more efficient to use the extra bits in the enum to encode the index. For example, RefT is encoded as -0x13 (0xffffffff6d):

   1111 1111 1111 1111 1111 1111 0110 1101
      f    f    f    f    f    f    6    d

We can store the index in the top bits (making sure to keep the MSB set so the number remains negative), giving us 23 bits to use for the type index.

   1nnn nnnn nnnn nnnn nnnn nnnn 0110 1101

binji avatar Mar 26 '20 20:03 binji

@jgravelle-google ping

binji avatar Apr 06 '20 21:04 binji

Closing as stale. :-(

keithw avatar Aug 16 '22 18:08 keithw