Aggressive unboxing of values: status update

Vlad Ureche vlad.ureche at gmail.com
Tue Nov 11 02:08:28 UTC 2014


2014-11-04 21:35 GMT+01:00 John Rose <john.r.rose at oracle.com>:

>
> The second classic approach is to declare that object identity (for some
> objects) is indeterminate, and allow the system to make local, decoupled
> decisions about boxing and unboxing.  (See my blog post "value types in the
> VM"[2], and the JDK 8 concept of "value-based classes"[3].)  That is the
> approach Albert is exploring.  This approach is used in Common Lisp (and
> probably Smalltalk for all I know) to represent numeric value types,
> instead of giving guarantees about fixnums or interning.  The Common Lisp
> spec has this interesting glimpse into our possible future[4]:


Would it make sense to supplement this assumption with a vm warning when
boxed value identity is exposed? Like printing a message on VM exit: "The
program you executed uses reference comparisons on boxed values, which are
known to be non-deterministic. See http://... for more information and use
-XX:+ErrorOnValueReferenceEquality to trigger an error when such a
comparison occurs."?

Vlad Ureche
scala-miniboxing.org



More information about the valhalla-dev mailing list