Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7193318

C2: remove number of inputs requirement from Node's new operator

    Details

    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic
    • OS:
      generic

      Backports

        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.

          Issue Links

            Activity

            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e626685e9f6c
            User: kvn
            Date: 2012-09-27 19:01:27 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e626685e9f6c User: kvn Date: 2012-09-27 19:01:27 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/e626685e9f6c
            User: amurillo
            Date: 2012-09-28 22:30:08 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/e626685e9f6c User: amurillo Date: 2012-09-28 22:30:08 +0000

              People

              • Assignee:
                twisti Christian Thalinger
                Reporter:
                twisti Christian Thalinger
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: