Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
95 /** Flag indicating whether invokedynamic support is on */ | 95 /** Flag indicating whether invokedynamic support is on */ |
96 private boolean enableInvokeDynamic; | 96 private boolean enableInvokeDynamic; |
97 /** alignment constants */ | 97 /** alignment constants */ |
98 private boolean isLP64; | 98 private boolean isLP64; |
99 private int bytesPerLong; | 99 private int bytesPerLong; |
100 private int bytesPerWord; | |
100 private int objectAlignmentInBytes; | 101 private int objectAlignmentInBytes; |
101 private int minObjAlignmentInBytes; | 102 private int minObjAlignmentInBytes; |
102 private int logMinObjAlignmentInBytes; | 103 private int logMinObjAlignmentInBytes; |
103 private int heapWordSize; | 104 private int heapWordSize; |
104 private int heapOopSize; | 105 private int heapOopSize; |
126 private static Type intxType; | 127 private static Type intxType; |
127 private static Type uintxType; | 128 private static Type uintxType; |
128 private static CIntegerType boolType; | 129 private static CIntegerType boolType; |
129 private Boolean sharingEnabled; | 130 private Boolean sharingEnabled; |
130 private Boolean compressedOopsEnabled; | 131 private Boolean compressedOopsEnabled; |
132 private Boolean compressedHeadersEnabled; | |
131 | 133 |
132 // command line flags supplied to VM - see struct Flag in globals.hpp | 134 // command line flags supplied to VM - see struct Flag in globals.hpp |
133 public static final class Flag { | 135 public static final class Flag { |
134 private String type; | 136 private String type; |
135 private String name; | 137 private String name; |
301 invalidOSREntryBCI = db.lookupIntConstant("InvalidOSREntryBci").intValue(); | 303 invalidOSREntryBCI = db.lookupIntConstant("InvalidOSREntryBci").intValue(); |
302 | 304 |
303 // We infer the presence of C1 or C2 from a couple of fields we | 305 // We infer the presence of C1 or C2 from a couple of fields we |
304 // already have present in the type database | 306 // already have present in the type database |
305 { | 307 { |
306 Type type = db.lookupType("methodOopDesc"); | 308 Type type = db.lookupType("Method"); |
307 if (type.getField("_from_compiled_entry", false, false) == null) { | 309 if (type.getField("_from_compiled_entry", false, false) == null) { |
308 // Neither C1 nor C2 is present | 310 // Neither C1 nor C2 is present |
309 usingClientCompiler = false; | 311 usingClientCompiler = false; |
310 usingServerCompiler = false; | 312 usingServerCompiler = false; |
311 } else { | 313 } else { |
323 | 325 |
324 if (debugger != null) { | 326 if (debugger != null) { |
325 isLP64 = debugger.getMachineDescription().isLP64(); | 327 isLP64 = debugger.getMachineDescription().isLP64(); |
326 } | 328 } |
327 bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue(); | 329 bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue(); |
330 bytesPerWord = db.lookupIntConstant("BytesPerWord").intValue(); | |
328 heapWordSize = db.lookupIntConstant("HeapWordSize").intValue(); | 331 heapWordSize = db.lookupIntConstant("HeapWordSize").intValue(); |
329 oopSize = db.lookupIntConstant("oopSize").intValue(); | 332 oopSize = db.lookupIntConstant("oopSize").intValue(); |
330 | 333 |
331 intxType = db.lookupType("intx"); | 334 intxType = db.lookupType("intx"); |
332 uintxType = db.lookupType("uintx"); | 335 uintxType = db.lookupType("uintx"); |
507 /** Get bytes-per-long == long/double natural alignment. */ | 510 /** Get bytes-per-long == long/double natural alignment. */ |
508 public int getBytesPerLong() { | 511 public int getBytesPerLong() { |
509 return bytesPerLong; | 512 return bytesPerLong; |
510 } | 513 } |
511 | 514 |
515 public int getBytesPerWord() { | |
516 return bytesPerWord; | |
517 } | |
518 | |
512 /** Get minimum object alignment in bytes. */ | 519 /** Get minimum object alignment in bytes. */ |
513 public int getMinObjAlignmentInBytes() { | 520 public int getMinObjAlignmentInBytes() { |
514 return minObjAlignmentInBytes; | 521 return minObjAlignmentInBytes; |
515 } | 522 } |
516 public int getLogMinObjAlignmentInBytes() { | 523 public int getLogMinObjAlignmentInBytes() { |
768 Flag flag = getCommandLineFlag("UseCompressedOops"); | 775 Flag flag = getCommandLineFlag("UseCompressedOops"); |
769 compressedOopsEnabled = (flag == null) ? Boolean.FALSE: | 776 compressedOopsEnabled = (flag == null) ? Boolean.FALSE: |
770 (flag.getBool()? Boolean.TRUE: Boolean.FALSE); | 777 (flag.getBool()? Boolean.TRUE: Boolean.FALSE); |
771 } | 778 } |
772 return compressedOopsEnabled.booleanValue(); | 779 return compressedOopsEnabled.booleanValue(); |
780 } | |
781 | |
782 public boolean isCompressedHeadersEnabled() { | |
783 if (compressedHeadersEnabled == null) { | |
784 Flag flag = getCommandLineFlag("UseCompressedHeaders"); | |
785 compressedHeadersEnabled = (flag == null) ? Boolean.FALSE: | |
786 (flag.getBool()? Boolean.TRUE: Boolean.FALSE); | |
787 } | |
788 return compressedHeadersEnabled.booleanValue(); | |
773 } | 789 } |
774 | 790 |
775 public int getObjectAlignmentInBytes() { | 791 public int getObjectAlignmentInBytes() { |
776 if (objectAlignmentInBytes == 0) { | 792 if (objectAlignmentInBytes == 0) { |
777 Flag flag = getCommandLineFlag("ObjectAlignmentInBytes"); | 793 Flag flag = getCommandLineFlag("ObjectAlignmentInBytes"); |