Patch for misleading comment in src/share/vm/opto/node.cpp
Tom Rodriguez
Thomas.Rodriguez at Sun.COM
Tue Feb 24 10:53:25 PST 2009
On Feb 24, 2009, at 10:46 AM, Christian Thalinger wrote:
> On Tue, 2009-02-24 at 10:43 -0800, Tom Rodriguez wrote:
>> On Feb 24, 2009, at 12:32 AM, Christian Thalinger wrote:
>>
>>> On Mon, 2009-02-23 at 11:15 -0800, Peter B. Kessler wrote:
>>>> Peter B. Kessler wrote:
>>>>> This comment is so wrong as almost to qualify as malicious.
>>>>> Here's a
>>>>> patch that might help.
>>>>>
>>>>> src/share/vm/opto/node.cpp
>>>>>
>>>>> 971 // If you modify the 'this' pointer's inputs, you must use
>>>>> 'set_req' with
>>>>> 972 // def-use info. If you are making a new Node (either as
>>>>> the new root or
>>>>> 973 // some new internal piece) you must NOT use set_req with
>>>>> def-use info.
>>>>> 974 // You can make a new Node with either 'new' or 'clone'.
>>>>> In either case,
>>>>> 975 // def-use info is (correctly) not generated.
>>
>> This piece isn't valid either. There's no separate du argument to
>> any
>> of the set functions anymore.
>
> Remove all 5 lines?
Maybe this?
tom
diff --git a/src/share/vm/opto/node.cpp b/src/share/vm/opto/node.cpp
--- a/src/share/vm/opto/node.cpp
+++ b/src/share/vm/opto/node.cpp
@@ -968,14 +968,15 @@ const Type *Node::Value( PhaseTransform
// Example: when reshape "(X+3)+4" into "X+7" you must leave the
Node for
// "X+3" unchanged in case it is shared.
//
-// If you modify the 'this' pointer's inputs, you must use 'set_req'
with
-// def-use info. If you are making a new Node (either as the new
root or
-// some new internal piece) you must NOT use set_req with def-use info.
-// You can make a new Node with either 'new' or 'clone'. In either
case,
-// def-use info is (correctly) not generated.
+// If you modify the 'this' pointer's inputs, you should use
+// 'set_req'. If you are making a new Node (either as the new root or
+// some new internal piece) you may use 'init_req' to set the initial
+// value. You can make a new Node with either 'new' or 'clone'. In
+// either case, def-use info is correctly maintained.
+//
// Example: reshape "(X+3)+4" into "X+7":
-// set_req(1,in(1)->in(1) /* grab X */, du /* must use DU on
'this' */);
-// set_req(2,phase->intcon(7),du);
+// set_req(1,in(1)->in(1));
+// set_req(2,phase->intcon(7));
// return this;
// Example: reshape "X*4" into "X<<1"
// return new (C,3) LShiftINode( in(1), phase->intcon(1) );
>
>
> -- Christian
>
More information about the hotspot-compiler-dev
mailing list