Value array flattening in L-world

David Simms david.simms at oracle.com
Thu Feb 22 18:16:34 UTC 2018


So without changing legacy code, modify:

* aastore: accept null TOS (top of stack) as default - checks out, 
bytecode understands receiveras flat value array
* ifnonnull: accept "default" as null, i.e.: What ever TOS is 
conditional upon...wait what, interpreter is a little too simple for 
"source was value array"
** Need to tag TOS as vt in interpreter runtime ? Could work.


   boolean isEmpty(int);
     descriptor: (I)Z
     flags: (0x0000)
     Code:
       stack=2, locals=2, args_size=2
          0: aload_0
          1: getfield      #2                  // Field 
elemData:[Ljava/lang/Object;
          4: iload_1
          5: aaload
          6: ifnonnull     13                  // Feels not quite right, 
that memcmp(defaultvalue, ) return
          9: iconst_1
         10: goto          14
         13: iconst_0
         14: ireturn


This idea is interesting, TOS type problem for ifnonnull is "fun", but 
doable.

What else have we missed ?


On 22/02/18 18:29, Remi Forax wrote:
> One solution is to consider that doesn't mean literally null like 
> Object doesn't mean ref anymore.
>
> In that case, null means default value and remove() and isEmpty() works.
>
> If we go with this semantics, we may also have to revisit the 
> semantics of putfield with null.
>
> Remi
> (in vacation this week :)

In that case, excuse my judging, but: "Vacation fail", but I feel 
honoured by your reply...take it easy Remi !

/D




More information about the valhalla-dev mailing list