groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Milles (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to
Date Fri, 03 Aug 2018 15:58:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568388#comment-16568388
] 

Eric Milles edited comment on GROOVY-8726 at 8/3/18 3:57 PM:
-------------------------------------------------------------

The reason I cite other AST nodes as a precedent is all the back references that do exist
in Groovy make navigating a heap dump incredibly difficult.  Starting from a ModuleNode, it
is very hard to see who holds the reference that is preventing GC because the module referes
to SourceUnit and ResolveVisitor, etc. and many of them end up with references back to ModuleNode.

Any {{AnnotatedNode}} can produce its declaring class.  From there, you can use a CodeVisitor
to discover any ancestor or sibling relationship you may need.

Also, having all these back references makes creation of nodes a real chore.  You need to
have Parameter objects to create a MethodNode.  You need to set the MethodNode reference on
each Parameter.  There are code visitors that create extra methods when a Parameter has a
default value expression; currently I think the Parameter is reused.  Which MethodNode should
be the back reference in that case or should we require a clone for the new method?


was (Author: emilles):
The reason I cite other AST nodes as a precedent is all the back references that do exist
in Groovy make navigating a heap dump incredibly difficult.  Starting from a ModuleNode, it
is very hard to see who holds the reference that is preventing GC because the module referes
to SourceUnit and ResolveVisitor, etc. and many of them end up with references back to ModuleNode.

Any {{AnnotatedNode}} can produce its declaring class.  From there, you can use a CodeVisitor
to discover any ancestor or sibling relationship you may need.

> Parameter lacks a reference to the MethodNode it belongs to
> -----------------------------------------------------------
>
>                 Key: GROOVY-8726
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8726
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Compiler
>    Affects Versions: 2.5.1
>            Reporter: James Kleeh
>            Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important to find
arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message