RFR: 8004699 : Add type annotation storage to Constructor, Field and Method
Joel Borggrén-Franck
joel.franck at oracle.com
Tue Dec 18 09:47:03 UTC 2012
On 12/18/2012 02:58 AM, David Holmes wrote:
> On 18/12/2012 3:06 AM, Joel Borggrén-Franck wrote:
>>
>> On Dec 17, 2012, at 5:00 PM, Peter Levart<peter.levart at gmail.com> wrote:
>>
>>> Hi Joel,
>>>
>>> 82 // This is set by the vm at Method creation
>>> 83 private byte[] type_annotations;
>>>
>>>
>>> Wouldn't it be better to initialize this field in the constructor?
>>> You could create an overloaded constructor if you wanted to be
>>> compatible with previous versions of the VM.
>>>
>>
>> Fields aren't created using a constructor as far as I can see.
>
> Correct, all the reflection objects are allocated directly by the VM and
> initialized field by field as needed. No Java level constructor involved.
>
> This change is also fine with me, on the proviso that the follow up
> change to deal with efficiency and the field name is not too far away.
> Though really I don't think the change of name will be that big a deal
> anyway.
>
Thanks for the review David.
I expect to continue working on this (up to) and after M6 and fix issues
like the space overhead.
You are right in that just renaming the fields is a couple of lines in
HotSpot and a 3 lines in JDK. However I am not comfortable doing that
rename without running all the tests again and that takes close to 24
hours and involves a lot of manual steps (until vm and jdk changes sync
up and I can automate the testing). This close to M6 and with a rewrite
coming anyway I would rather spend that time on writing the parser for
these byte arrays :)
cheers
/Joel
More information about the core-libs-dev
mailing list