3 ms·
The double float tagging using NaN sounds like LuaJIT's approach quoting http://article.gmane.org/gmane.comp.lang.lua.general/58908 http://article.gmane.org/gm
by malkia 16y ago
The double float tagging using NaN sounds like LuaJIT's approach
quoting http://article.gmane.org/gmane.comp.lang.lua.general/58908 http://article.gmane.org/gmane.comp.lang.lua.general/58908
- NaN-tagging: 64 bit tagged values are used for stack slots and
table slots. Unboxed floating-point numbers (doubles) are
overlayed with tagged object references. The latter can be
distinguished from numbers via the use of special NaNs as tags.
It's a remote descendant of pointer-tagging.
[The idea dates back to 2006, but I haven't disclosed it before
2008. Special NaNs have been used to overlay pointers before.
Others have used it for tagging later on. The specific layout is
of my own devising.]
- andhow 16y agoIt is also used in WebKit's JSC. Using the NaN space goes back much further than LuaJIT. E.g., you can see it mention in this 1993 survey paper: http://lambda-the-ultimate.org/node/3912 http://lambda-the-ultimate.org/node/3912.
- malkia 16y agoThanks for the paper! Quite interesting and easy read.
- deleted 16y ago[deleted]