393 if (*p != NULL) (*p)->del_out((Node *)this);
394 (*p) = n;
395 if (n != NULL) n->add_out((Node *)this);
396 }
397 // Light version of set_req() to init inputs after node creation.
398 void init_req( uint i, Node *n ) {
399 assert( i == 0 && this == n ||
400 is_not_dead(n), "can not use dead node");
401 assert( i < _cnt, "oob");
402 assert( !VerifyHashTableKeys || _hash_lock == 0,
403 "remove node from hash table before modifying it");
404 assert( _in[i] == NULL, "sanity");
405 _in[i] = n;
406 if (n != NULL) n->add_out((Node *)this);
407 }
408 // Find first occurrence of n among my edges:
409 int find_edge(Node* n);
410 int replace_edge(Node* old, Node* neww);
411 // NULL out all inputs to eliminate incoming Def-Use edges.
412 // Return the number of edges between 'n' and 'this'
413 int disconnect_inputs(Node *n);
414
415 // Quickly, return true if and only if I am Compile::current()->top().
416 bool is_top() const {
417 assert((this == (Node*) Compile::current()->top()) == (_out == NULL), "");
418 return (_out == NULL);
419 }
420 // Reaffirm invariants for is_top. (Only from Compile::set_cached_top_node.)
421 void setup_is_top();
422
423 // Strip away casting. (It is depth-limited.)
424 Node* uncast() const;
425 // Return whether two Nodes are equivalent, after stripping casting.
426 bool eqv_uncast(const Node* n) const {
427 return (this->uncast() == n->uncast());
428 }
429
430 private:
431 static Node* uncast_helper(const Node* n);
432
433 // Add an output edge to the end of the list
441 if (is_top()) return;
442 Node** outp = &_out[_outcnt];
443 // Find and remove n
444 do {
445 assert(outp > _out, "Missing Def-Use edge");
446 } while (*--outp != n);
447 *outp = _out[--_outcnt];
448 // Smash the old edge so it can't be used accidentally.
449 debug_only(_out[_outcnt] = (Node *)(uintptr_t)0xdeadbeef);
450 // Record that a change happened here.
451 #if OPTO_DU_ITERATOR_ASSERT
452 debug_only(_last_del = n; ++_del_tick);
453 #endif
454 }
455
456 public:
457 // Globally replace this node by a given new node, updating all uses.
458 void replace_by(Node* new_node);
459 // Globally replace this node by a given new node, updating all uses
460 // and cutting input edges of old node.
461 void subsume_by(Node* new_node) {
462 replace_by(new_node);
463 disconnect_inputs(NULL);
464 }
465 void set_req_X( uint i, Node *n, PhaseIterGVN *igvn );
466 // Find the one non-null required input. RegionNode only
467 Node *nonnull_req() const;
468 // Add or remove precedence edges
469 void add_prec( Node *n );
470 void rm_prec( uint i );
471 void set_prec( uint i, Node *n ) {
472 assert( is_not_dead(n), "can not use dead node");
473 assert( i >= _cnt, "not a precedence edge");
474 if (_in[i] != NULL) _in[i]->del_out((Node *)this);
475 _in[i] = n;
476 if (n != NULL) n->add_out((Node *)this);
477 }
478 // Set this node's index, used by cisc_version to replace current node
479 void set_idx(uint new_idx) {
480 const node_idx_t* ref = &_idx;
481 *(node_idx_t*)ref = new_idx;
482 }
483 // Swap input edge order. (Edge indexes i1 and i2 are usually 1 and 2.)
|
393 if (*p != NULL) (*p)->del_out((Node *)this);
394 (*p) = n;
395 if (n != NULL) n->add_out((Node *)this);
396 }
397 // Light version of set_req() to init inputs after node creation.
398 void init_req( uint i, Node *n ) {
399 assert( i == 0 && this == n ||
400 is_not_dead(n), "can not use dead node");
401 assert( i < _cnt, "oob");
402 assert( !VerifyHashTableKeys || _hash_lock == 0,
403 "remove node from hash table before modifying it");
404 assert( _in[i] == NULL, "sanity");
405 _in[i] = n;
406 if (n != NULL) n->add_out((Node *)this);
407 }
408 // Find first occurrence of n among my edges:
409 int find_edge(Node* n);
410 int replace_edge(Node* old, Node* neww);
411 // NULL out all inputs to eliminate incoming Def-Use edges.
412 // Return the number of edges between 'n' and 'this'
413 int disconnect_inputs(Node *n, Compile *c);
414
415 // Quickly, return true if and only if I am Compile::current()->top().
416 bool is_top() const {
417 assert((this == (Node*) Compile::current()->top()) == (_out == NULL), "");
418 return (_out == NULL);
419 }
420 // Reaffirm invariants for is_top. (Only from Compile::set_cached_top_node.)
421 void setup_is_top();
422
423 // Strip away casting. (It is depth-limited.)
424 Node* uncast() const;
425 // Return whether two Nodes are equivalent, after stripping casting.
426 bool eqv_uncast(const Node* n) const {
427 return (this->uncast() == n->uncast());
428 }
429
430 private:
431 static Node* uncast_helper(const Node* n);
432
433 // Add an output edge to the end of the list
441 if (is_top()) return;
442 Node** outp = &_out[_outcnt];
443 // Find and remove n
444 do {
445 assert(outp > _out, "Missing Def-Use edge");
446 } while (*--outp != n);
447 *outp = _out[--_outcnt];
448 // Smash the old edge so it can't be used accidentally.
449 debug_only(_out[_outcnt] = (Node *)(uintptr_t)0xdeadbeef);
450 // Record that a change happened here.
451 #if OPTO_DU_ITERATOR_ASSERT
452 debug_only(_last_del = n; ++_del_tick);
453 #endif
454 }
455
456 public:
457 // Globally replace this node by a given new node, updating all uses.
458 void replace_by(Node* new_node);
459 // Globally replace this node by a given new node, updating all uses
460 // and cutting input edges of old node.
461 void subsume_by(Node* new_node, Compile* c) {
462 replace_by(new_node);
463 disconnect_inputs(NULL, c);
464 }
465 void set_req_X( uint i, Node *n, PhaseIterGVN *igvn );
466 // Find the one non-null required input. RegionNode only
467 Node *nonnull_req() const;
468 // Add or remove precedence edges
469 void add_prec( Node *n );
470 void rm_prec( uint i );
471 void set_prec( uint i, Node *n ) {
472 assert( is_not_dead(n), "can not use dead node");
473 assert( i >= _cnt, "not a precedence edge");
474 if (_in[i] != NULL) _in[i]->del_out((Node *)this);
475 _in[i] = n;
476 if (n != NULL) n->add_out((Node *)this);
477 }
478 // Set this node's index, used by cisc_version to replace current node
479 void set_idx(uint new_idx) {
480 const node_idx_t* ref = &_idx;
481 *(node_idx_t*)ref = new_idx;
482 }
483 // Swap input edge order. (Edge indexes i1 and i2 are usually 1 and 2.)
|