diff src/share/vm/c1/c1_Instruction.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 7a302948f5a4
children 37c18711a0df
line wrap: on
line diff
--- a/src/share/vm/c1/c1_Instruction.cpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/src/share/vm/c1/c1_Instruction.cpp	Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -396,6 +396,8 @@
     switch (type()->tag()) {
     case intTag:
       return HASH2(name(), type()->as_IntConstant()->value());
+    case addressTag:
+      return HASH2(name(), type()->as_AddressConstant()->value());
     case longTag:
       {
         jlong temp = type()->as_LongConstant()->value();
@@ -411,6 +413,11 @@
     case objectTag:
       assert(type()->as_ObjectType()->is_loaded(), "can't handle unloaded values");
       return HASH2(name(), type()->as_ObjectType()->constant_value());
+    case metaDataTag:
+      assert(type()->as_MetadataType()->is_loaded(), "can't handle unloaded values");
+      return HASH2(name(), type()->as_MetadataType()->constant_value());
+    default:
+      ShouldNotReachHere();
     }
   }
   return 0;
@@ -456,6 +463,14 @@
                 t1->is_loaded() && t2->is_loaded() &&
                 t1->constant_value() == t2->constant_value());
       }
+    case metaDataTag:
+      {
+        MetadataType* t1 =    type()->as_MetadataType();
+        MetadataType* t2 = v->type()->as_MetadataType();
+        return (t1 != NULL && t2 != NULL &&
+                t1->is_loaded() && t2->is_loaded() &&
+                t1->constant_value() == t2->constant_value());
+      }
   }
   return false;
 }
@@ -508,6 +523,18 @@
     }
     break;
   }
+  case metaDataTag: {
+    ciMetadata* xvalue = lt->as_MetadataType()->constant_value();
+    ciMetadata* yvalue = rt->as_MetadataType()->constant_value();
+    assert(xvalue != NULL && yvalue != NULL, "not constants");
+    if (xvalue->is_loaded() && yvalue->is_loaded()) {
+      switch (cond) {
+      case If::eql: return xvalue == yvalue ? cond_true : cond_false;
+      case If::neq: return xvalue != yvalue ? cond_true : cond_false;
+      }
+    }
+    break;
+  }
   }
   return not_comparable;
 }