src/share/vm/opto/node.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8034812 Cdiff src/share/vm/opto/node.cpp

src/share/vm/opto/node.cpp

Print this page

        

*** 272,307 **** // This constant used to initialize _out may be any non-null value. // The value NULL is reserved for the top node only. #define NO_OUT_ARRAY ((Node**)-1) - // This funny expression handshakes with Node::operator new - // to pull Compile::current out of the new node's _out field, - // and then calls a subroutine which manages most field - // initializations. The only one which is tricky is the - // _idx field, which is const, and so must be initialized - // by a return value, not an assignment. - // - // (Aren't you thankful that Java finals don't require so many tricks?) - #define IDX_INIT(req) this->Init((req), (Compile*) this->_out) - #ifdef _MSC_VER // the IDX_INIT hack falls foul of warning C4355 - #pragma warning( disable:4355 ) // 'this' : used in base member initializer list - #endif - #ifdef __clang__ - #pragma clang diagnostic push - #pragma GCC diagnostic ignored "-Wuninitialized" - #endif - // Out-of-line code from node constructors. // Executed only when extra debug info. is being passed around. static void init_node_notes(Compile* C, int idx, Node_Notes* nn) { C->set_node_notes_at(idx, nn); } // Shared initialization code. ! inline int Node::Init(int req, Compile* C) { ! assert(Compile::current() == C, "must use operator new(Compile*)"); int idx = C->next_unique(); // Allocate memory for the necessary number of edges. if (req > 0) { // Allocate space for _in array to have double alignment. --- 272,290 ---- // This constant used to initialize _out may be any non-null value. // The value NULL is reserved for the top node only. #define NO_OUT_ARRAY ((Node**)-1) // Out-of-line code from node constructors. // Executed only when extra debug info. is being passed around. static void init_node_notes(Compile* C, int idx, Node_Notes* nn) { C->set_node_notes_at(idx, nn); } // Shared initialization code. ! inline int Node::Init(int req) { ! Compile* C = Compile::current(); int idx = C->next_unique(); // Allocate memory for the necessary number of edges. if (req > 0) { // Allocate space for _in array to have double alignment.
*** 326,336 **** } //------------------------------Node------------------------------------------- // Create a Node, with a given number of required edges. Node::Node(uint req) ! : _idx(IDX_INIT(req)) { assert( req < (uint)(MaxNodeLimit - NodeLimitFudgeFactor), "Input limit exceeded" ); debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); if (req == 0) { --- 309,319 ---- } //------------------------------Node------------------------------------------- // Create a Node, with a given number of required edges. Node::Node(uint req) ! : _idx(Init(req)) { assert( req < (uint)(MaxNodeLimit - NodeLimitFudgeFactor), "Input limit exceeded" ); debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); if (req == 0) {
*** 345,355 **** } } //------------------------------Node------------------------------------------- Node::Node(Node *n0) ! : _idx(IDX_INIT(1)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[0] == this, "Must pass arg count to 'new'" ); --- 328,338 ---- } } //------------------------------Node------------------------------------------- Node::Node(Node *n0) ! : _idx(Init(1)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[0] == this, "Must pass arg count to 'new'" );
*** 357,367 **** _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1) ! : _idx(IDX_INIT(2)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[1] == this, "Must pass arg count to 'new'" ); --- 340,350 ---- _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1) ! : _idx(Init(2)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[1] == this, "Must pass arg count to 'new'" );
*** 371,381 **** _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2) ! : _idx(IDX_INIT(3)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[2] == this, "Must pass arg count to 'new'" ); --- 354,364 ---- _in[1] = n1; if (n1 != NULL) n1->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2) ! : _idx(Init(3)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[2] == this, "Must pass arg count to 'new'" );
*** 387,397 **** _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3) ! : _idx(IDX_INIT(4)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[3] == this, "Must pass arg count to 'new'" ); --- 370,380 ---- _in[2] = n2; if (n2 != NULL) n2->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3) ! : _idx(Init(4)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[3] == this, "Must pass arg count to 'new'" );
*** 405,415 **** _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4) ! : _idx(IDX_INIT(5)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[4] == this, "Must pass arg count to 'new'" ); --- 388,398 ---- _in[3] = n3; if (n3 != NULL) n3->add_out((Node *)this); } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4) ! : _idx(Init(5)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[4] == this, "Must pass arg count to 'new'" );
*** 426,436 **** } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4, Node *n5) ! : _idx(IDX_INIT(6)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[5] == this, "Must pass arg count to 'new'" ); --- 409,419 ---- } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4, Node *n5) ! : _idx(Init(6)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[5] == this, "Must pass arg count to 'new'" );
*** 449,459 **** } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4, Node *n5, Node *n6) ! : _idx(IDX_INIT(7)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[6] == this, "Must pass arg count to 'new'" ); --- 432,442 ---- } //------------------------------Node------------------------------------------- Node::Node(Node *n0, Node *n1, Node *n2, Node *n3, Node *n4, Node *n5, Node *n6) ! : _idx(Init(7)) { debug_only( verify_construction() ); NOT_PRODUCT(nodes_created++); // Assert we allocated space for input array already assert( _in[6] == this, "Must pass arg count to 'new'" );
*** 1064,1082 **** // Example: reshape "(X+3)+4" into "X+7": // set_req(1, in(1)->in(1)); // set_req(2, phase->intcon(7)); // return this; // Example: reshape "X*4" into "X<<2" ! // return new (C) LShiftINode(in(1), phase->intcon(2)); // // You must call 'phase->transform(X)' on any new Nodes X you make, except // for the returned root node. Example: reshape "X*31" with "(X<<5)-X". ! // Node *shift=phase->transform(new(C)LShiftINode(in(1),phase->intcon(5))); ! // return new (C) AddINode(shift, in(1)); // // When making a Node for a constant use 'phase->makecon' or 'phase->intcon'. ! // These forms are faster than 'phase->transform(new (C) ConNode())' and Do // The Right Thing with def-use info. // // You cannot bury the 'this' Node inside of a graph reshape. If the reshaped // graph uses the 'this' Node it must be the root. If you want a Node with // the same Opcode as the 'this' pointer use 'clone'. --- 1047,1065 ---- // Example: reshape "(X+3)+4" into "X+7": // set_req(1, in(1)->in(1)); // set_req(2, phase->intcon(7)); // return this; // Example: reshape "X*4" into "X<<2" ! // return new LShiftINode(in(1), phase->intcon(2)); // // You must call 'phase->transform(X)' on any new Nodes X you make, except // for the returned root node. Example: reshape "X*31" with "(X<<5)-X". ! // Node *shift=phase->transform(new LShiftINode(in(1),phase->intcon(5))); ! // return new AddINode(shift, in(1)); // // When making a Node for a constant use 'phase->makecon' or 'phase->intcon'. ! // These forms are faster than 'phase->transform(new ConNode())' and Do // The Right Thing with def-use info. // // You cannot bury the 'this' Node inside of a graph reshape. If the reshaped // graph uses the 'this' Node it must be the root. If you want a Node with // the same Opcode as the 'this' pointer use 'clone'.
src/share/vm/opto/node.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File