src/share/vm/opto/memnode.cpp

changeset 1964
4311f23817fd
parent 1907
c18cbe5936b8
child 2121
02f0a9b6f654
     1.1 --- a/src/share/vm/opto/memnode.cpp	Tue Jun 15 15:57:36 2010 -0700
     1.2 +++ b/src/share/vm/opto/memnode.cpp	Tue Jun 15 18:07:27 2010 -0700
     1.3 @@ -815,6 +815,16 @@
     1.4  }
     1.5  #endif
     1.6  
     1.7 +#ifdef ASSERT
     1.8 +//----------------------------is_immutable_value-------------------------------
     1.9 +// Helper function to allow a raw load without control edge for some cases
    1.10 +bool LoadNode::is_immutable_value(Node* adr) {
    1.11 +  return (adr->is_AddP() && adr->in(AddPNode::Base)->is_top() &&
    1.12 +          adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal &&
    1.13 +          (adr->in(AddPNode::Offset)->find_intptr_t_con(-1) ==
    1.14 +           in_bytes(JavaThread::osthread_offset())));
    1.15 +}
    1.16 +#endif
    1.17  
    1.18  //----------------------------LoadNode::make-----------------------------------
    1.19  // Polymorphic factory method:
    1.20 @@ -828,6 +838,11 @@
    1.21    assert(!(adr_type->isa_aryptr() &&
    1.22             adr_type->offset() == arrayOopDesc::length_offset_in_bytes()),
    1.23           "use LoadRangeNode instead");
    1.24 +  // Check control edge of raw loads
    1.25 +  assert( ctl != NULL || C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
    1.26 +          // oop will be recorded in oop map if load crosses safepoint
    1.27 +          rt->isa_oopptr() || is_immutable_value(adr),
    1.28 +          "raw memory operations should have control edge");
    1.29    switch (bt) {
    1.30    case T_BOOLEAN: return new (C, 3) LoadUBNode(ctl, mem, adr, adr_type, rt->is_int()    );
    1.31    case T_BYTE:    return new (C, 3) LoadBNode (ctl, mem, adr, adr_type, rt->is_int()    );
    1.32 @@ -2064,6 +2079,8 @@
    1.33  // Polymorphic factory method:
    1.34  StoreNode* StoreNode::make( PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, BasicType bt ) {
    1.35    Compile* C = gvn.C;
    1.36 +  assert( C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
    1.37 +          ctl != NULL, "raw memory operations should have control edge");
    1.38  
    1.39    switch (bt) {
    1.40    case T_BOOLEAN:

mercurial