Review request: update javac to properly output mandated parameters in MethodParameters attributes
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Tue Feb 12 04:03:56 PST 2013
Looks almost good to go - few comments:
*) I think you forgot to remove the old outerThisDef on Lower (i.e.
there are two of them, slightly different - the logic should somehow be
merged)
*) I would initialize the extraParams field in Symbol itself to
List.nil() - note that List.nil points to a shared instance so you will
not end up creating unnecessary instances. And you would automatically
guarantee that the list is always set to something.
*) Tests?
Maurizio
On 11/02/13 23:15, Eric McCorkle wrote:
> I have revised the approach as I describe below, to make the extra
> parameters visible from MethodSymbols, and to make sure the proper flags
> are set at creation time. Please look at the latest webrev and review.
>
> Thanks to everyone who helped!
>
> On 02/11/13 12:30, Eric McCorkle wrote:
>> The problem with this patch as it stands is that it decides what flags
>> to set in the generated parameters in output, which isn't the right way
>> to do it.
>>
>> However, since there are no VarSymbols stored for the extra parameters,
>> at present there's no choice but to do it that way.
>>
>> An alternative would be to add a List for the extra parameters, then we
>> could set the flags properly when the parameters are created.
>>
>> If I can get some pointers from more experienced javac developers about
>> where the parameter lists are created and initialized, I might be able
>> to get this done by Wednesday.
>>
>> On 02/08/13 16:20, Eric McCorkle wrote:
>>> I've updated the webrev.
>>>
>>> The extra parameters are now generated with SYNTHETIC flags set by
>>> default, except when they match the three cases in the spec ("name"
>>> parameter of an Enum's valueOf, the first parameter of an anonymous
>>> constructor, or the first parameter of a non-private inner member class).
>>>
>>> I've tested these using the examples from Peter Jensen's test suite.
>>>
>>> Please look over the new webrev and comment.
>>>
>>> Thanks,
>>> Eric
>>>
>>> On 02/06/13 12:23, Eric McCorkle wrote:
>>>> Hello,
>>>>
>>>> Please review the following patch, which updates javac to output
>>>> mandated parameters in MethodParameters attributes. It also updates
>>>> javac to reflect spec changes, namely the definition of the ACC_MANDATED
>>>> flag.
>>>>
>>>> The webrev is here:
>>>> http://cr.openjdk.java.net/~emc/8006345/
>>>>
>>>> This patch addresses the following issues:
>>>> http://bugs.sun.com/view_bug.do?bug_id=8006345
>>>> http://bugs.sun.com/view_bug.do?bug_id=8006896
>>>> http://bugs.sun.com/view_bug.do?bug_id=8006345
>>>>
>>>> The latest version of the spec for parameter reflection can be found here:
>>>>
>>>> http://cr.openjdk.java.net/~abuckley/8misc.pdf
>>>>
>>>> Thanks,
>>>> Eric
More information about the compiler-dev
mailing list