hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
changeset 13728 882756847a04
parent 13529 dc25e69fd16d
child 13873 7b72e3873785
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Fri Aug 31 16:39:35 2012 -0700
+++ b/hotspot/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");