52
53 //-------------------------- construct_node------------------------------------
54 // Set a breakpoint here to identify where a particular node index is built.
55 void Node::verify_construction() {
56 _debug_orig = NULL;
57 int old_debug_idx = Compile::debug_idx();
58 int new_debug_idx = old_debug_idx+1;
59 if (new_debug_idx > 0) {
60 // Arrange that the lowest five decimal digits of _debug_idx
61 // will repeat those of _idx. In case this is somehow pathological,
62 // we continue to assign negative numbers (!) consecutively.
63 const int mod = 100000;
64 int bump = (int)(_idx - new_debug_idx) % mod;
65 if (bump < 0) bump += mod;
66 assert(bump >= 0 && bump < mod, "");
67 new_debug_idx += bump;
68 }
69 Compile::set_debug_idx(new_debug_idx);
70 set_debug_idx( new_debug_idx );
71 assert(Compile::current()->unique() < (INT_MAX - 1), "Node limit exceeded INT_MAX");
72 assert(Compile::current()->live_nodes() < (uint)MaxNodeLimit, "Live Node limit exceeded limit");
73 if (BreakAtNode != 0 && (_debug_idx == BreakAtNode || (int)_idx == BreakAtNode)) {
74 tty->print_cr("BreakAtNode: _idx=%d _debug_idx=%d", _idx, _debug_idx);
75 BREAKPOINT;
76 }
77 #if OPTO_DU_ITERATOR_ASSERT
78 _last_del = NULL;
79 _del_tick = 0;
80 #endif
81 _hash_lock = 0;
82 }
83
84
85 // #ifdef ASSERT ...
86
87 #if OPTO_DU_ITERATOR_ASSERT
88 void DUIterator_Common::sample(const Node* node) {
89 _vdui = VerifyDUIterators;
90 _node = node;
91 _outcnt = node->_outcnt;
92 _del_tick = node->_del_tick;
309 // If there are default notes floating around, capture them:
310 Node_Notes* nn = C->default_node_notes();
311 if (nn != NULL) init_node_notes(C, idx, nn);
312
313 // Note: At this point, C is dead,
314 // and we begin to initialize the new Node.
315
316 _cnt = _max = req;
317 _outcnt = _outmax = 0;
318 _class_id = Class_Node;
319 _flags = 0;
320 _out = NO_OUT_ARRAY;
321 return idx;
322 }
323
324 //------------------------------Node-------------------------------------------
325 // Create a Node, with a given number of required edges.
326 Node::Node(uint req)
327 : _idx(IDX_INIT(req))
328 {
329 assert( req < (uint)(MaxNodeLimit - NodeLimitFudgeFactor), "Input limit exceeded" );
330 debug_only( verify_construction() );
331 NOT_PRODUCT(nodes_created++);
332 if (req == 0) {
333 assert( _in == (Node**)this, "Must not pass arg count to 'new'" );
334 _in = NULL;
335 } else {
336 assert( _in[req-1] == this, "Must pass arg count to 'new'" );
337 Node** to = _in;
338 for(uint i = 0; i < req; i++) {
339 to[i] = NULL;
340 }
341 }
342 }
343
344 //------------------------------Node-------------------------------------------
345 Node::Node(Node *n0)
346 : _idx(IDX_INIT(1))
347 {
348 debug_only( verify_construction() );
349 NOT_PRODUCT(nodes_created++);
|
52
53 //-------------------------- construct_node------------------------------------
54 // Set a breakpoint here to identify where a particular node index is built.
55 void Node::verify_construction() {
56 _debug_orig = NULL;
57 int old_debug_idx = Compile::debug_idx();
58 int new_debug_idx = old_debug_idx+1;
59 if (new_debug_idx > 0) {
60 // Arrange that the lowest five decimal digits of _debug_idx
61 // will repeat those of _idx. In case this is somehow pathological,
62 // we continue to assign negative numbers (!) consecutively.
63 const int mod = 100000;
64 int bump = (int)(_idx - new_debug_idx) % mod;
65 if (bump < 0) bump += mod;
66 assert(bump >= 0 && bump < mod, "");
67 new_debug_idx += bump;
68 }
69 Compile::set_debug_idx(new_debug_idx);
70 set_debug_idx( new_debug_idx );
71 assert(Compile::current()->unique() < (INT_MAX - 1), "Node limit exceeded INT_MAX");
72 assert(Compile::current()->live_nodes() < Compile::current()->max_node_limit(), "Live Node limit exceeded limit");
73 if (BreakAtNode != 0 && (_debug_idx == BreakAtNode || (int)_idx == BreakAtNode)) {
74 tty->print_cr("BreakAtNode: _idx=%d _debug_idx=%d", _idx, _debug_idx);
75 BREAKPOINT;
76 }
77 #if OPTO_DU_ITERATOR_ASSERT
78 _last_del = NULL;
79 _del_tick = 0;
80 #endif
81 _hash_lock = 0;
82 }
83
84
85 // #ifdef ASSERT ...
86
87 #if OPTO_DU_ITERATOR_ASSERT
88 void DUIterator_Common::sample(const Node* node) {
89 _vdui = VerifyDUIterators;
90 _node = node;
91 _outcnt = node->_outcnt;
92 _del_tick = node->_del_tick;
309 // If there are default notes floating around, capture them:
310 Node_Notes* nn = C->default_node_notes();
311 if (nn != NULL) init_node_notes(C, idx, nn);
312
313 // Note: At this point, C is dead,
314 // and we begin to initialize the new Node.
315
316 _cnt = _max = req;
317 _outcnt = _outmax = 0;
318 _class_id = Class_Node;
319 _flags = 0;
320 _out = NO_OUT_ARRAY;
321 return idx;
322 }
323
324 //------------------------------Node-------------------------------------------
325 // Create a Node, with a given number of required edges.
326 Node::Node(uint req)
327 : _idx(IDX_INIT(req))
328 {
329 assert( req < Compile::current()->max_node_limit() - NodeLimitFudgeFactor, "Input limit exceeded" );
330 debug_only( verify_construction() );
331 NOT_PRODUCT(nodes_created++);
332 if (req == 0) {
333 assert( _in == (Node**)this, "Must not pass arg count to 'new'" );
334 _in = NULL;
335 } else {
336 assert( _in[req-1] == this, "Must pass arg count to 'new'" );
337 Node** to = _in;
338 for(uint i = 0; i < req; i++) {
339 to[i] = NULL;
340 }
341 }
342 }
343
344 //------------------------------Node-------------------------------------------
345 Node::Node(Node *n0)
346 : _idx(IDX_INIT(1))
347 {
348 debug_only( verify_construction() );
349 NOT_PRODUCT(nodes_created++);
|