Reachability of an object when a thread is running one of its methods

Carlo de Wolf cdewolf at redhat.com
Tue Dec 4 10:35:54 PST 2012


On 12/04/2012 05:05 PM, Andrew Haley wrote:
> On 12/04/2012 12:12 PM, Carlo de Wolf wrote:
>> JLS 7 12.6.1:
>> Note that this sort of optimization is only allowed if references are on
>> the stack, not stored in
>> the heap.
>>
>> This hints to me that an object which is on the stack (of the previous
>> frame) is actually strong referenced.
> What is your reason for believing that references in previous frames
> are any stronger than references in the current frame?  I can't see
> anything that implies it.
>
> Andrew.
>
I don't believe that. But it's a reference on the stack of the previous 
frame, while a local variable reference on the current frame.

Carlo


More information about the java-se-8-spec-comments mailing list