< prev index next >

src/share/vm/opto/parse1.cpp

Print this page
rev 9067 : 8139040: Fix initializations before ShouldNotReachHere()


  91   if( PrintParseStatistics && BytecodeParseHistogram::initialized() ) {
  92     BytecodeParseHistogram::print();
  93   }
  94 }
  95 #endif
  96 
  97 //------------------------------ON STACK REPLACEMENT---------------------------
  98 
  99 // Construct a node which can be used to get incoming state for
 100 // on stack replacement.
 101 Node *Parse::fetch_interpreter_state(int index,
 102                                      BasicType bt,
 103                                      Node *local_addrs,
 104                                      Node *local_addrs_base) {
 105   Node *mem = memory(Compile::AliasIdxRaw);
 106   Node *adr = basic_plus_adr( local_addrs_base, local_addrs, -index*wordSize );
 107   Node *ctl = control();
 108 
 109   // Very similar to LoadNode::make, except we handle un-aligned longs and
 110   // doubles on Sparc.  Intel can handle them just fine directly.
 111   Node *l;
 112   switch (bt) {                // Signature is flattened
 113   case T_INT:     l = new LoadINode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInt::INT,        MemNode::unordered); break;
 114   case T_FLOAT:   l = new LoadFNode(ctl, mem, adr, TypeRawPtr::BOTTOM, Type::FLOAT,         MemNode::unordered); break;
 115   case T_ADDRESS: l = new LoadPNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM,  MemNode::unordered); break;
 116   case T_OBJECT:  l = new LoadPNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInstPtr::BOTTOM, MemNode::unordered); break;
 117   case T_LONG:
 118   case T_DOUBLE: {
 119     // Since arguments are in reverse order, the argument address 'adr'
 120     // refers to the back half of the long/double.  Recompute adr.
 121     adr = basic_plus_adr(local_addrs_base, local_addrs, -(index+1)*wordSize);
 122     if (Matcher::misaligned_doubles_ok) {
 123       l = (bt == T_DOUBLE)
 124         ? (Node*)new LoadDNode(ctl, mem, adr, TypeRawPtr::BOTTOM, Type::DOUBLE, MemNode::unordered)
 125         : (Node*)new LoadLNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeLong::LONG, MemNode::unordered);
 126     } else {
 127       l = (bt == T_DOUBLE)
 128         ? (Node*)new LoadD_unalignedNode(ctl, mem, adr, TypeRawPtr::BOTTOM, MemNode::unordered)
 129         : (Node*)new LoadL_unalignedNode(ctl, mem, adr, TypeRawPtr::BOTTOM, MemNode::unordered);
 130     }
 131     break;


1886 
1887 //------------------------------ensure_phi-------------------------------------
1888 // Turn the idx'th entry of the current map into a Phi
1889 PhiNode *Parse::ensure_phi(int idx, bool nocreate) {
1890   SafePointNode* map = this->map();
1891   Node* region = map->control();
1892   assert(region->is_Region(), "");
1893 
1894   Node* o = map->in(idx);
1895   assert(o != NULL, "");
1896 
1897   if (o == top())  return NULL; // TOP always merges into TOP
1898 
1899   if (o->is_Phi() && o->as_Phi()->region() == region) {
1900     return o->as_Phi();
1901   }
1902 
1903   // Now use a Phi here for merging
1904   assert(!nocreate, "Cannot build a phi for a block already parsed.");
1905   const JVMState* jvms = map->jvms();
1906   const Type* t;
1907   if (jvms->is_loc(idx)) {
1908     t = block()->local_type_at(idx - jvms->locoff());
1909   } else if (jvms->is_stk(idx)) {
1910     t = block()->stack_type_at(idx - jvms->stkoff());
1911   } else if (jvms->is_mon(idx)) {
1912     assert(!jvms->is_monitor_box(idx), "no phis for boxes");
1913     t = TypeInstPtr::BOTTOM; // this is sufficient for a lock object
1914   } else if ((uint)idx < TypeFunc::Parms) {
1915     t = o->bottom_type();  // Type::RETURN_ADDRESS or such-like.
1916   } else {
1917     assert(false, "no type information for this phi");
1918   }
1919 
1920   // If the type falls to bottom, then this must be a local that
1921   // is mixing ints and oops or some such.  Forcing it to top
1922   // makes it go dead.
1923   if (t == Type::BOTTOM) {
1924     map->set_req(idx, top());
1925     return NULL;
1926   }




  91   if( PrintParseStatistics && BytecodeParseHistogram::initialized() ) {
  92     BytecodeParseHistogram::print();
  93   }
  94 }
  95 #endif
  96 
  97 //------------------------------ON STACK REPLACEMENT---------------------------
  98 
  99 // Construct a node which can be used to get incoming state for
 100 // on stack replacement.
 101 Node *Parse::fetch_interpreter_state(int index,
 102                                      BasicType bt,
 103                                      Node *local_addrs,
 104                                      Node *local_addrs_base) {
 105   Node *mem = memory(Compile::AliasIdxRaw);
 106   Node *adr = basic_plus_adr( local_addrs_base, local_addrs, -index*wordSize );
 107   Node *ctl = control();
 108 
 109   // Very similar to LoadNode::make, except we handle un-aligned longs and
 110   // doubles on Sparc.  Intel can handle them just fine directly.
 111   Node *l = NULL;
 112   switch (bt) {                // Signature is flattened
 113   case T_INT:     l = new LoadINode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInt::INT,        MemNode::unordered); break;
 114   case T_FLOAT:   l = new LoadFNode(ctl, mem, adr, TypeRawPtr::BOTTOM, Type::FLOAT,         MemNode::unordered); break;
 115   case T_ADDRESS: l = new LoadPNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM,  MemNode::unordered); break;
 116   case T_OBJECT:  l = new LoadPNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInstPtr::BOTTOM, MemNode::unordered); break;
 117   case T_LONG:
 118   case T_DOUBLE: {
 119     // Since arguments are in reverse order, the argument address 'adr'
 120     // refers to the back half of the long/double.  Recompute adr.
 121     adr = basic_plus_adr(local_addrs_base, local_addrs, -(index+1)*wordSize);
 122     if (Matcher::misaligned_doubles_ok) {
 123       l = (bt == T_DOUBLE)
 124         ? (Node*)new LoadDNode(ctl, mem, adr, TypeRawPtr::BOTTOM, Type::DOUBLE, MemNode::unordered)
 125         : (Node*)new LoadLNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeLong::LONG, MemNode::unordered);
 126     } else {
 127       l = (bt == T_DOUBLE)
 128         ? (Node*)new LoadD_unalignedNode(ctl, mem, adr, TypeRawPtr::BOTTOM, MemNode::unordered)
 129         : (Node*)new LoadL_unalignedNode(ctl, mem, adr, TypeRawPtr::BOTTOM, MemNode::unordered);
 130     }
 131     break;


1886 
1887 //------------------------------ensure_phi-------------------------------------
1888 // Turn the idx'th entry of the current map into a Phi
1889 PhiNode *Parse::ensure_phi(int idx, bool nocreate) {
1890   SafePointNode* map = this->map();
1891   Node* region = map->control();
1892   assert(region->is_Region(), "");
1893 
1894   Node* o = map->in(idx);
1895   assert(o != NULL, "");
1896 
1897   if (o == top())  return NULL; // TOP always merges into TOP
1898 
1899   if (o->is_Phi() && o->as_Phi()->region() == region) {
1900     return o->as_Phi();
1901   }
1902 
1903   // Now use a Phi here for merging
1904   assert(!nocreate, "Cannot build a phi for a block already parsed.");
1905   const JVMState* jvms = map->jvms();
1906   const Type* t = NULL;
1907   if (jvms->is_loc(idx)) {
1908     t = block()->local_type_at(idx - jvms->locoff());
1909   } else if (jvms->is_stk(idx)) {
1910     t = block()->stack_type_at(idx - jvms->stkoff());
1911   } else if (jvms->is_mon(idx)) {
1912     assert(!jvms->is_monitor_box(idx), "no phis for boxes");
1913     t = TypeInstPtr::BOTTOM; // this is sufficient for a lock object
1914   } else if ((uint)idx < TypeFunc::Parms) {
1915     t = o->bottom_type();  // Type::RETURN_ADDRESS or such-like.
1916   } else {
1917     assert(false, "no type information for this phi");
1918   }
1919 
1920   // If the type falls to bottom, then this must be a local that
1921   // is mixing ints and oops or some such.  Forcing it to top
1922   // makes it go dead.
1923   if (t == Type::BOTTOM) {
1924     map->set_req(idx, top());
1925     return NULL;
1926   }


< prev index next >