LVT issue related to JDK-8047719
Liam Miller-Cushon
cushon at google.com
Thu Jan 22 22:45:04 UTC 2015
I discovered this because some code was doing bytecode introspection to
find all of the types referenced in a method declaration, and this change
causes types that were previously only referenced in the LVT to be
invisible.
I agree that the spec doesn't allow this variable to be represented in the
LVT, and it doesn't seem like the information would be useful to debuggers
anyways. I'll update the code that was relying on the old behaviour.
Thanks for the explanation,
Liam
On Thu, Jan 22, 2015 at 10:21 AM, Vicente-Arturo Romero-Zaldivar <
vicente.romero at oracle.com> wrote:
> Hi Liam,
>
> Question: why is this difference important for you? or in other words, why
> is it important to have an LVT entry for a variable with length 0? The spec
> doesn't say that it should be represented in the LVT and actually a reading
> of the spec could imply that they shouldn't be represented. The spec says
> that, I'm not quoting it:
>
> LVT represents ranges from [start, end) where the right extreme is not
> included in the range.
>
> From this lecture a variable with length 0, is not that it shouldn't be
> represented but is that it can't be represented as the range [start, start)
> is empty.
>
> Thanks,
> Vicente
>
>
> On 01/16/2015 05:16 PM, Liam Miller-Cushon wrote:
>
> I think this issue is separate, the fix [1] for JDK-8064857 doesn't seem
> to help.
>
> Here's the repro again:
>
> class Test {
> {
> String foo = null;
> }
> }
>
> Testing with javac9 at head [2], the LVT is still:
>
> LocalVariableTable:
> Start Length Slot Name Signature
> 0 7 0 this LTest;
>
> [1] http://hg.openjdk.java.net/jdk9/dev/langtools/rev/3bdbc3b8aa14
> [2] http://hg.openjdk.java.net/jdk9/dev/langtools/rev/230c13955250
>
> On Tue, Nov 25, 2014 at 5:59 PM, Liam Miller-Cushon <cushon at google.com>
> wrote:
>
>> Thanks Vicente, I'll try out the patch once it lands.
>>
>> On Tue, Nov 25, 2014 at 5:19 PM, Vicente-Arturo Romero-Zaldivar <
>> vicente.romero at oracle.com> wrote:
>>
>>> The patch for https://bugs.openjdk.java.net/browse/JDK-8064857, still
>>> under review, should fix this issue too.
>>>
>>> Thanks,
>>> Vicente
>>>
>>>
>>> On 11/25/2014 04:54 PM, Liam Miller-Cushon wrote:
>>>
>>>> An LVT entry is no longer emitted for 'foo' in the following code. The
>>>> behaviour changed after the fix for JDK-8047719 [1]. Is this a bug?
>>>>
>>>> class Test {
>>>> {
>>>> String foo = null;
>>>> }
>>>> }
>>>>
>>>> Before:
>>>> LocalVariableTable:
>>>> Start Length Slot Name Signature
>>>> 6 0 1 foo Ljava/lang/String;
>>>> 0 7 0 this LTest;
>>>>
>>>> After:
>>>> LocalVariableTable:
>>>> Start Length Slot Name Signature
>>>> 0 7 0 this LTest;
>>>>
>>>> [1] http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/855f8c7337eb
>>>>
>>>
>>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20150122/b6dd67a5/attachment.html>
More information about the compiler-dev
mailing list