diff agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @ 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 a9fed06c01d2
children 5a98bf7d847b
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Fri Aug 31 16:39:35 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -97,6 +97,7 @@
   /** alignment constants */
   private boolean      isLP64;
   private int          bytesPerLong;
+  private int          bytesPerWord;
   private int          objectAlignmentInBytes;
   private int          minObjAlignmentInBytes;
   private int          logMinObjAlignmentInBytes;
@@ -128,6 +129,7 @@
   private static CIntegerType boolType;
   private Boolean sharingEnabled;
   private Boolean compressedOopsEnabled;
+  private Boolean compressedHeadersEnabled;
 
   // command line flags supplied to VM - see struct Flag in globals.hpp
   public static final class Flag {
@@ -303,7 +305,7 @@
     // We infer the presence of C1 or C2 from a couple of fields we
     // already have present in the type database
     {
-      Type type = db.lookupType("methodOopDesc");
+      Type type = db.lookupType("Method");
       if (type.getField("_from_compiled_entry", false, false) == null) {
         // Neither C1 nor C2 is present
         usingClientCompiler = false;
@@ -325,6 +327,7 @@
       isLP64 = debugger.getMachineDescription().isLP64();
     }
     bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue();
+    bytesPerWord = db.lookupIntConstant("BytesPerWord").intValue();
     heapWordSize = db.lookupIntConstant("HeapWordSize").intValue();
     oopSize  = db.lookupIntConstant("oopSize").intValue();
 
@@ -509,6 +512,10 @@
     return bytesPerLong;
   }
 
+  public int getBytesPerWord() {
+    return bytesPerWord;
+  }
+
   /** Get minimum object alignment in bytes. */
   public int getMinObjAlignmentInBytes() {
     return minObjAlignmentInBytes;
@@ -772,6 +779,15 @@
     return compressedOopsEnabled.booleanValue();
   }
 
+  public boolean isCompressedHeadersEnabled() {
+    if (compressedHeadersEnabled == null) {
+        Flag flag = getCommandLineFlag("UseCompressedHeaders");
+        compressedHeadersEnabled = (flag == null) ? Boolean.FALSE:
+             (flag.getBool()? Boolean.TRUE: Boolean.FALSE);
+    }
+    return compressedHeadersEnabled.booleanValue();
+  }
+
   public int getObjectAlignmentInBytes() {
     if (objectAlignmentInBytes == 0) {
         Flag flag = getCommandLineFlag("ObjectAlignmentInBytes");