< prev index next >

src/hotspot/share/opto/memnode.cpp

Print this page

 833   return _type->ideal_reg();
 834 }
 835 
 836 #ifndef PRODUCT
 837 void LoadNode::dump_spec(outputStream *st) const {
 838   MemNode::dump_spec(st);
 839   if( !Verbose && !WizardMode ) {
 840     // standard dump does this in Verbose and WizardMode
 841     st->print(" #"); _type->dump_on(st);
 842   }
 843   if (!depends_only_on_test()) {
 844     st->print(" (does not depend only on test)");
 845   }
 846 }
 847 #endif
 848 
 849 #ifdef ASSERT
 850 //----------------------------is_immutable_value-------------------------------
 851 // Helper function to allow a raw load without control edge for some cases
 852 bool LoadNode::is_immutable_value(Node* adr) {
 853   return (adr->is_AddP() && adr->in(AddPNode::Base)->is_top() &&
 854           adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal &&
 855           (adr->in(AddPNode::Offset)->find_intptr_t_con(-1) ==
 856            in_bytes(JavaThread::osthread_offset()) ||
 857            adr->in(AddPNode::Offset)->find_intptr_t_con(-1) ==
 858            in_bytes(JavaThread::threadObj_offset())));












 859 }
 860 #endif
 861 
 862 //----------------------------LoadNode::make-----------------------------------
 863 // Polymorphic factory method:
 864 Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo,
 865                      ControlDependency control_dependency, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
 866   Compile* C = gvn.C;
 867 
 868   // sanity check the alias category against the created node type
 869   assert(!(adr_type->isa_oopptr() &&
 870            adr_type->offset() == oopDesc::klass_offset_in_bytes()),
 871          "use LoadKlassNode instead");
 872   assert(!(adr_type->isa_aryptr() &&
 873            adr_type->offset() == arrayOopDesc::length_offset_in_bytes()),
 874          "use LoadRangeNode instead");
 875   // Check control edge of raw loads
 876   assert( ctl != NULL || C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
 877           // oop will be recorded in oop map if load crosses safepoint
 878           rt->isa_oopptr() || is_immutable_value(adr),

 833   return _type->ideal_reg();
 834 }
 835 
 836 #ifndef PRODUCT
 837 void LoadNode::dump_spec(outputStream *st) const {
 838   MemNode::dump_spec(st);
 839   if( !Verbose && !WizardMode ) {
 840     // standard dump does this in Verbose and WizardMode
 841     st->print(" #"); _type->dump_on(st);
 842   }
 843   if (!depends_only_on_test()) {
 844     st->print(" (does not depend only on test)");
 845   }
 846 }
 847 #endif
 848 
 849 #ifdef ASSERT
 850 //----------------------------is_immutable_value-------------------------------
 851 // Helper function to allow a raw load without control edge for some cases
 852 bool LoadNode::is_immutable_value(Node* adr) {
 853   if (adr->is_AddP() && adr->in(AddPNode::Base)->is_top() &&
 854       adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal) {
 855 
 856     jlong offset = adr->in(AddPNode::Offset)->find_intptr_t_con(-1);
 857     int offsets[] = {
 858       in_bytes(JavaThread::osthread_offset()),
 859       in_bytes(JavaThread::threadObj_offset()),
 860       in_bytes(JavaThread::vthread_offset()),
 861       in_bytes(JavaThread::scopeLocalCache_offset()),
 862     };
 863 
 864     for (size_t i = 0; i < sizeof offsets / sizeof offsets[0]; i++) {
 865       if (offset == offsets[i])
 866         return true;
 867     }
 868   }
 869 
 870   return false;
 871 }
 872 #endif
 873 
 874 //----------------------------LoadNode::make-----------------------------------
 875 // Polymorphic factory method:
 876 Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo,
 877                      ControlDependency control_dependency, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
 878   Compile* C = gvn.C;
 879 
 880   // sanity check the alias category against the created node type
 881   assert(!(adr_type->isa_oopptr() &&
 882            adr_type->offset() == oopDesc::klass_offset_in_bytes()),
 883          "use LoadKlassNode instead");
 884   assert(!(adr_type->isa_aryptr() &&
 885            adr_type->offset() == arrayOopDesc::length_offset_in_bytes()),
 886          "use LoadRangeNode instead");
 887   // Check control edge of raw loads
 888   assert( ctl != NULL || C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
 889           // oop will be recorded in oop map if load crosses safepoint
 890           rt->isa_oopptr() || is_immutable_value(adr),
< prev index next >