6679854: assert in escape.cpp:397
authorkvn
Thu, 27 Mar 2008 09:12:54 -0700
changeset 250 8f3acb20ed88
parent 249 8a8601fb5571
child 251 cb2e73f71205
6679854: assert in escape.cpp:397 Summary: The assert misses the case CastX2P 'base' for an unsafe field reference Reviewed-by: never, jrose
hotspot/src/share/vm/opto/escape.cpp
--- a/hotspot/src/share/vm/opto/escape.cpp	Fri Mar 21 08:32:17 2008 -0700
+++ b/hotspot/src/share/vm/opto/escape.cpp	Thu Mar 27 09:12:54 2008 -0700
@@ -51,21 +51,21 @@
 }
 
 #ifndef PRODUCT
-static char *node_type_names[] = {
+static const char *node_type_names[] = {
   "UnknownType",
   "JavaObject",
   "LocalVar",
   "Field"
 };
 
-static char *esc_names[] = {
+static const char *esc_names[] = {
   "UnknownEscape",
   "NoEscape",
   "ArgEscape",
   "GlobalEscape"
 };
 
-static char *edge_type_suffix[] = {
+static const char *edge_type_suffix[] = {
  "?", // UnknownEdge
  "P", // PointsToEdge
  "D", // DeferredEdge
@@ -383,18 +383,25 @@
   //       | |
   //       AddP  ( base == address )
   //
-  // case #6. Constant Pool or ThreadLocal or Raw object's field reference:
-  //      ConP # Object from Constant Pool.
+  // case #6. Constant Pool, ThreadLocal, CastX2P or
+  //          Raw object's field reference:
+  //      {ConP, ThreadLocal, CastX2P, raw Load}
   //  top   |
   //     \  |
   //     AddP  ( base == top )
   //
+  // case #7. Klass's field reference.
+  //      LoadKlass
+  //       | |
+  //       AddP  ( base == address )
+  //
   Node *base = addp->in(AddPNode::Base)->uncast();
   if (base->is_top()) { // The AddP case #3 and #6.
     base = addp->in(AddPNode::Address)->uncast();
     assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal ||
-           base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL ||
-           base->is_Proj() && base->in(0)->is_Allocate(), "sanity");
+           base->Opcode() == Op_CastX2P ||
+           (base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL) ||
+           (base->is_Proj() && base->in(0)->is_Allocate()), "sanity");
   }
   return base;
 }