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

Andrew Haley aph at redhat.com
Tue Dec 4 11:41:53 PST 2012


On 12/04/2012 06:35 PM, Carlo de Wolf wrote:
> 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.
>>
> 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.

OK, but you said:

>>> This hints to me that an object which is on the stack (of the previous
>>> frame) is actually strong referenced.

which is what I don't understand.  Why do you think there is such a hint?
I can't see any such hint in what you quoted.

Andrew.



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