Continuation.yield limitations

Andrew Haley aph at redhat.com
Tue Sep 10 08:46:18 UTC 2019


On 9/9/19 4:43 PM, Alan Bateman wrote:
> On 09/09/2019 09:10, Andrew Haley wrote:
>> :
>> I think there is [a way to know if a value on a C stack is a stack
>> address or not]'. It would take work and co-operation with C
>> compiler people. The main reason we can't touch the native layer
>> from Java is that we tell ourselves that it's something we must not
>> touch: it's a black box. But these days it's all either free
>> software or it's from people (like Microsoft) we can talk to. The
>> old days of dozens of C compilers have gone.
>
> One other thing to say about this limitation is that it's unlikely to 
> arise too often. When we started out the two native frames that caused 
> issues were AccessController.doPrivileged, and during warm up, 
> Method.invoke. The former is no longer an issue as it has been 
> re-implemented in Java so the code in the VM to setup the privileged 
> stack has gone away. For the latter, the temporary workaround is to 
> generate the method accessors to avoid core reflection calling methods 
> (or constructors) through the VM when initially used. We expect this 
> will eventually be replaced to use method handles. So for for now at 
> least, I don't think the limitation is a major concern.

Yes, I agree. The other possibile issue is callbacks, but that's a
complex [probably] asynchronous scenario that's rather different from
what we're thinking of anyway.

It's that when someone says "we don't know how to do X", my instinct
is to say "Well, you may not." :-) Yeah, I know, I should sometimes
suppress that instinct.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the loom-dev mailing list