United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7193318 C2: remove number of inputs requirement from Node's new operator
JDK-7193318 : C2: remove number of inputs requirement from Node's new operator

Details
Type:
Enhancement
Submit Date:
2012-08-22
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2012-09-27
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs25 (b03)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
Right now it is required to pass the number of inputs to the new operator when a new Node is allocated, e.g.:

  new (C, 4) AddPNode(base, ptr, offset);

This is verbose, very unobvious (why pass 4 when the constructor only takes 3 inputs?) and error prone.

Currently it is done this way because the new operator allocates memory for the Node and the inputs array in one chunk.

We should investigate if it is possible to allocate the inputs array separately in the Node's constructors:

  // Create a new Node.  Required is the number is of inputs required for
  // semantic correctness.
  Node( uint required );

  // Create a new Node with given input edges.
  // This version requires use of the "edge-count" new.
  // E.g.  new (C,3) FooNode( C, NULL, left, right );
  Node( Node *n0 );
  Node( Node *n0, Node *n1 );
  Node( Node *n0, Node *n1, Node *n2 );
  Node( Node *n0, Node *n1, Node *n2, Node *n3 );
  Node( Node *n0, Node *n1, Node *n2, Node *n3, Node *n4 );
  Node( Node *n0, Node *n1, Node *n2, Node *n3, Node *n4, Node *n5 );
  Node( Node *n0, Node *n1, Node *n2, Node *n3,
            Node *n4, Node *n5, Node *n6 );

These constructors know what the size of the inputs array should be.

                                    

Comments
URL:   http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e626685e9f6c
User:  kvn
Date:  2012-09-27 19:01:27 +0000

                                     
2012-09-27
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/e626685e9f6c
User:  amurillo
Date:  2012-09-28 22:30:08 +0000

                                     
2012-09-28



Hardware and Software, Engineered to Work Together