Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @ 8065:f82bcc429e8c
8007901: SA: Don't read flag values as constants
Reviewed-by: dholmes, mikael
author | sla |
---|---|
date | Mon, 18 Feb 2013 10:43:07 +0100 |
parents | ec0c4951286c |
children | 38ea2efa32a7 |
comparison
equal
deleted
inserted
replaced
8064:dc1de5e78a85 | 8065:f82bcc429e8c |
---|---|
88 private Bytes bytes; | 88 private Bytes bytes; |
89 | 89 |
90 /** Flags indicating whether we are attached to a core, C1, or C2 build */ | 90 /** Flags indicating whether we are attached to a core, C1, or C2 build */ |
91 private boolean usingClientCompiler; | 91 private boolean usingClientCompiler; |
92 private boolean usingServerCompiler; | 92 private boolean usingServerCompiler; |
93 /** Flag indicating whether UseTLAB is turned on */ | |
94 private boolean useTLAB; | |
95 /** Flag indicating whether invokedynamic support is on */ | |
96 private boolean enableInvokeDynamic; | |
97 /** alignment constants */ | 93 /** alignment constants */ |
98 private boolean isLP64; | 94 private boolean isLP64; |
99 private int bytesPerLong; | 95 private int bytesPerLong; |
100 private int bytesPerWord; | 96 private int bytesPerWord; |
101 private int objectAlignmentInBytes; | 97 private int objectAlignmentInBytes; |
324 usingClientCompiler = true; | 320 usingClientCompiler = true; |
325 } | 321 } |
326 } | 322 } |
327 } | 323 } |
328 | 324 |
329 useTLAB = (db.lookupIntConstant("UseTLAB").intValue() != 0); | |
330 enableInvokeDynamic = (db.lookupIntConstant("EnableInvokeDynamic").intValue() != 0); | |
331 | |
332 if (debugger != null) { | 325 if (debugger != null) { |
333 isLP64 = debugger.getMachineDescription().isLP64(); | 326 isLP64 = debugger.getMachineDescription().isLP64(); |
334 } | 327 } |
335 bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue(); | 328 bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue(); |
336 bytesPerWord = db.lookupIntConstant("BytesPerWord").intValue(); | 329 bytesPerWord = db.lookupIntConstant("BytesPerWord").intValue(); |
577 } else{ | 570 } else{ |
578 return (((long) oneHalf) << 32) | (((long) otherHalf) & 0x00000000FFFFFFFFL); | 571 return (((long) oneHalf) << 32) | (((long) otherHalf) & 0x00000000FFFFFFFFL); |
579 } | 572 } |
580 } | 573 } |
581 | 574 |
582 /** Indicates whether Thread-Local Allocation Buffers are used */ | |
583 public boolean getUseTLAB() { | |
584 return useTLAB; | |
585 } | |
586 | |
587 public boolean getEnableInvokeDynamic() { | |
588 return enableInvokeDynamic; | |
589 } | |
590 | |
591 public TypeDataBase getTypeDataBase() { | 575 public TypeDataBase getTypeDataBase() { |
592 return db; | 576 return db; |
593 } | 577 } |
594 | 578 |
595 public Universe getUniverse() { | 579 public Universe getUniverse() { |
818 if (objectAlignmentInBytes == 0) { | 802 if (objectAlignmentInBytes == 0) { |
819 Flag flag = getCommandLineFlag("ObjectAlignmentInBytes"); | 803 Flag flag = getCommandLineFlag("ObjectAlignmentInBytes"); |
820 objectAlignmentInBytes = (flag == null) ? 8 : (int)flag.getIntx(); | 804 objectAlignmentInBytes = (flag == null) ? 8 : (int)flag.getIntx(); |
821 } | 805 } |
822 return objectAlignmentInBytes; | 806 return objectAlignmentInBytes; |
807 } | |
808 | |
809 /** Indicates whether Thread-Local Allocation Buffers are used */ | |
810 public boolean getUseTLAB() { | |
811 Flag flag = getCommandLineFlag("UseTLAB"); | |
812 return (flag == null) ? false: flag.getBool(); | |
823 } | 813 } |
824 | 814 |
825 // returns null, if not available. | 815 // returns null, if not available. |
826 public Flag[] getCommandLineFlags() { | 816 public Flag[] getCommandLineFlags() { |
827 if (commandLineFlags == null) { | 817 if (commandLineFlags == null) { |