src/share/vm/opto/macro.cpp

changeset 1063
7bb995fbd3c0
parent 1014
0fbdb4381b99
parent 1040
98cb887364d3
child 1143
f2049ae95c3d
     1.1 --- a/src/share/vm/opto/macro.cpp	Mon Mar 09 13:34:00 2009 -0700
     1.2 +++ b/src/share/vm/opto/macro.cpp	Thu Mar 12 18:16:36 2009 -0700
     1.3 @@ -64,6 +64,7 @@
     1.4        uint old_unique = C->unique();
     1.5        Node* new_in = old_sosn->clone(jvms_adj, sosn_map);
     1.6        if (old_unique != C->unique()) {
     1.7 +        new_in->set_req(0, newcall->in(0)); // reset control edge
     1.8          new_in = transform_later(new_in); // Register new node.
     1.9        }
    1.10        old_in = new_in;
    1.11 @@ -215,7 +216,7 @@
    1.12    const TypeOopPtr *tinst = phase->C->get_adr_type(alias_idx)->isa_oopptr();
    1.13    while (true) {
    1.14      if (mem == alloc_mem || mem == start_mem ) {
    1.15 -      return mem;  // hit one of our sentinals
    1.16 +      return mem;  // hit one of our sentinels
    1.17      } else if (mem->is_MergeMem()) {
    1.18        mem = mem->as_MergeMem()->memory_at(alias_idx);
    1.19      } else if (mem->is_Proj() && mem->as_Proj()->_con == TypeFunc::Memory) {
    1.20 @@ -250,6 +251,15 @@
    1.21          assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw");
    1.22        }
    1.23        mem = mem->in(MemNode::Memory);
    1.24 +    } else if (mem->Opcode() == Op_SCMemProj) {
    1.25 +      assert(mem->in(0)->is_LoadStore(), "sanity");
    1.26 +      const TypePtr* atype = mem->in(0)->in(MemNode::Address)->bottom_type()->is_ptr();
    1.27 +      int adr_idx = Compile::current()->get_alias_index(atype);
    1.28 +      if (adr_idx == alias_idx) {
    1.29 +        assert(false, "Object is not scalar replaceable if a LoadStore node access its field");
    1.30 +        return NULL;
    1.31 +      }
    1.32 +      mem = mem->in(0)->in(MemNode::Memory);
    1.33      } else {
    1.34        return mem;
    1.35      }
    1.36 @@ -329,8 +339,15 @@
    1.37            return NULL;
    1.38          }
    1.39          values.at_put(j, val);
    1.40 +      } else if (val->Opcode() == Op_SCMemProj) {
    1.41 +        assert(val->in(0)->is_LoadStore(), "sanity");
    1.42 +        assert(false, "Object is not scalar replaceable if a LoadStore node access its field");
    1.43 +        return NULL;
    1.44        } else {
    1.45 +#ifdef ASSERT
    1.46 +        val->dump();
    1.47          assert(false, "unknown node on this path");
    1.48 +#endif
    1.49          return NULL;  // unknown node on this path
    1.50        }
    1.51      }
    1.52 @@ -1651,7 +1668,7 @@
    1.53  
    1.54    if (UseOptoBiasInlining) {
    1.55      /*
    1.56 -     *  See the full descrition in MacroAssembler::biased_locking_enter().
    1.57 +     *  See the full description in MacroAssembler::biased_locking_enter().
    1.58       *
    1.59       *  if( (mark_word & biased_lock_mask) == biased_lock_pattern ) {
    1.60       *    // The object is biased.
    1.61 @@ -1887,7 +1904,7 @@
    1.62  
    1.63    if (UseOptoBiasInlining) {
    1.64      // Check for biased locking unlock case, which is a no-op.
    1.65 -    // See the full descrition in MacroAssembler::biased_locking_exit().
    1.66 +    // See the full description in MacroAssembler::biased_locking_exit().
    1.67      region  = new (C, 4) RegionNode(4);
    1.68      // create a Phi for the memory state
    1.69      mem_phi = new (C, 4) PhiNode( region, Type::MEMORY, TypeRawPtr::BOTTOM);

mercurial