6802499: EA: assert(false,"unknown node on this path")

Thu, 19 Feb 2009 17:38:53 -0800

author
kvn
date
Thu, 19 Feb 2009 17:38:53 -0800
changeset 1019
49a36a80b0c7
parent 1018
5d75ab5f6698
child 1020
22e09c0f4b47

6802499: EA: assert(false,"unknown node on this path")
Summary: Add missing checks for SCMemProj node in Escape analysis code.
Reviewed-by: never

src/share/vm/opto/escape.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/macro.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/opto/escape.cpp	Wed Feb 18 13:53:42 2009 -0800
     1.2 +++ b/src/share/vm/opto/escape.cpp	Thu Feb 19 17:38:53 2009 -0800
     1.3 @@ -756,6 +756,16 @@
     1.4        } else {
     1.5          break;
     1.6        }
     1.7 +    } else if (result->Opcode() == Op_SCMemProj) {
     1.8 +      assert(result->in(0)->is_LoadStore(), "sanity");
     1.9 +      const Type *at = phase->type(result->in(0)->in(MemNode::Address));
    1.10 +      if (at != Type::TOP) {
    1.11 +        assert (at->isa_ptr() != NULL, "pointer type required.");
    1.12 +        int idx = C->get_alias_index(at->is_ptr());
    1.13 +        assert(idx != alias_idx, "Object is not scalar replaceable if a LoadStore node access its field");
    1.14 +        break;
    1.15 +      }
    1.16 +      result = result->in(0)->in(MemNode::Memory);
    1.17      }
    1.18    }
    1.19    if (result->is_Phi()) {
     2.1 --- a/src/share/vm/opto/macro.cpp	Wed Feb 18 13:53:42 2009 -0800
     2.2 +++ b/src/share/vm/opto/macro.cpp	Thu Feb 19 17:38:53 2009 -0800
     2.3 @@ -250,6 +250,15 @@
     2.4          assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw");
     2.5        }
     2.6        mem = mem->in(MemNode::Memory);
     2.7 +    } else if (mem->Opcode() == Op_SCMemProj) {
     2.8 +      assert(mem->in(0)->is_LoadStore(), "sanity");
     2.9 +      const TypePtr* atype = mem->in(0)->in(MemNode::Address)->bottom_type()->is_ptr();
    2.10 +      int adr_idx = Compile::current()->get_alias_index(atype);
    2.11 +      if (adr_idx == alias_idx) {
    2.12 +        assert(false, "Object is not scalar replaceable if a LoadStore node access its field");
    2.13 +        return NULL;
    2.14 +      }
    2.15 +      mem = mem->in(0)->in(MemNode::Memory);
    2.16      } else {
    2.17        return mem;
    2.18      }
    2.19 @@ -329,8 +338,15 @@
    2.20            return NULL;
    2.21          }
    2.22          values.at_put(j, val);
    2.23 +      } else if (val->Opcode() == Op_SCMemProj) {
    2.24 +        assert(val->in(0)->is_LoadStore(), "sanity");
    2.25 +        assert(false, "Object is not scalar replaceable if a LoadStore node access its field");
    2.26 +        return NULL;
    2.27        } else {
    2.28 +#ifdef ASSERT
    2.29 +        val->dump();
    2.30          assert(false, "unknown node on this path");
    2.31 +#endif
    2.32          return NULL;  // unknown node on this path
    2.33        }
    2.34      }

mercurial