< prev index next >

src/hotspot/share/opto/phaseX.cpp

Print this page




 706 ConNode* PhaseValues::uncached_makecon(const Type *t) {
 707   assert(t->singleton(), "must be a constant");
 708   ConNode* x = ConNode::make(t);
 709   ConNode* k = (ConNode*)hash_find_insert(x); // Value numbering
 710   if (k == NULL) {
 711     set_type(x, t);             // Missed, provide type mapping
 712     GrowableArray<Node_Notes*>* nna = C->node_note_array();
 713     if (nna != NULL) {
 714       Node_Notes* loc = C->locate_node_notes(nna, x->_idx, true);
 715       loc->clear(); // do not put debug info on constants
 716     }
 717   } else {
 718     x->destruct();              // Hit, destroy duplicate constant
 719     x = k;                      // use existing constant
 720   }
 721   return x;
 722 }
 723 
 724 //------------------------------intcon-----------------------------------------
 725 // Fast integer constant.  Same as "transform(new ConINode(TypeInt::make(i)))"
 726 ConINode* PhaseTransform::intcon(int i) {
 727   // Small integer?  Check cache! Check that cached node is not dead
 728   if (i >= _icon_min && i <= _icon_max) {
 729     ConINode* icon = _icons[i-_icon_min];
 730     if (icon != NULL && icon->in(TypeFunc::Control) != NULL)
 731       return icon;
 732   }
 733   ConINode* icon = (ConINode*) uncached_makecon(TypeInt::make(i));
 734   assert(icon->is_Con(), "");
 735   if (i >= _icon_min && i <= _icon_max)
 736     _icons[i-_icon_min] = icon;   // Cache small integers
 737   return icon;
 738 }
 739 
 740 //------------------------------longcon----------------------------------------
 741 // Fast long constant.
 742 ConLNode* PhaseTransform::longcon(jlong l) {
 743   // Small integer?  Check cache! Check that cached node is not dead
 744   if (l >= _lcon_min && l <= _lcon_max) {
 745     ConLNode* lcon = _lcons[l-_lcon_min];
 746     if (lcon != NULL && lcon->in(TypeFunc::Control) != NULL)




 706 ConNode* PhaseValues::uncached_makecon(const Type *t) {
 707   assert(t->singleton(), "must be a constant");
 708   ConNode* x = ConNode::make(t);
 709   ConNode* k = (ConNode*)hash_find_insert(x); // Value numbering
 710   if (k == NULL) {
 711     set_type(x, t);             // Missed, provide type mapping
 712     GrowableArray<Node_Notes*>* nna = C->node_note_array();
 713     if (nna != NULL) {
 714       Node_Notes* loc = C->locate_node_notes(nna, x->_idx, true);
 715       loc->clear(); // do not put debug info on constants
 716     }
 717   } else {
 718     x->destruct();              // Hit, destroy duplicate constant
 719     x = k;                      // use existing constant
 720   }
 721   return x;
 722 }
 723 
 724 //------------------------------intcon-----------------------------------------
 725 // Fast integer constant.  Same as "transform(new ConINode(TypeInt::make(i)))"
 726 ConINode* PhaseTransform::intcon(jint i) {
 727   // Small integer?  Check cache! Check that cached node is not dead
 728   if (i >= _icon_min && i <= _icon_max) {
 729     ConINode* icon = _icons[i-_icon_min];
 730     if (icon != NULL && icon->in(TypeFunc::Control) != NULL)
 731       return icon;
 732   }
 733   ConINode* icon = (ConINode*) uncached_makecon(TypeInt::make(i));
 734   assert(icon->is_Con(), "");
 735   if (i >= _icon_min && i <= _icon_max)
 736     _icons[i-_icon_min] = icon;   // Cache small integers
 737   return icon;
 738 }
 739 
 740 //------------------------------longcon----------------------------------------
 741 // Fast long constant.
 742 ConLNode* PhaseTransform::longcon(jlong l) {
 743   // Small integer?  Check cache! Check that cached node is not dead
 744   if (l >= _lcon_min && l <= _lcon_max) {
 745     ConLNode* lcon = _lcons[l-_lcon_min];
 746     if (lcon != NULL && lcon->in(TypeFunc::Control) != NULL)


< prev index next >