comparison agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @ 11054:38ea2efa32a7

8010278: SA: provide mechanism for using an alternative SA debugger back-end. Reviewed-by: sla, dsamersoff
author kevinw
date Wed, 26 Jun 2013 00:01:20 +0100
parents f82bcc429e8c
children 7944aba7ba41
comparison
equal deleted inserted replaced
11035:01e10b366055 11054:38ea2efa32a7
244 "using incompatible version of SA and you may see unexpected " + 244 "using incompatible version of SA and you may see unexpected " +
245 "results."); 245 "results.");
246 } 246 }
247 } 247 }
248 248
249 private static final boolean disableDerivedPrinterTableCheck; 249 private static final boolean disableDerivedPointerTableCheck;
250 private static final Properties saProps; 250 private static final Properties saProps;
251 251
252 static { 252 static {
253 saProps = new Properties(); 253 saProps = new Properties();
254 URL url = null; 254 URL url = null;
255 try { 255 try {
256 url = VM.class.getClassLoader().getResource("sa.properties"); 256 url = VM.class.getClassLoader().getResource("sa.properties");
257 saProps.load(new BufferedInputStream(url.openStream())); 257 saProps.load(new BufferedInputStream(url.openStream()));
258 } catch (Exception e) { 258 } catch (Exception e) {
259 throw new RuntimeException("Unable to load properties " + 259 System.err.println("Unable to load properties " +
260 (url == null ? "null" : url.toString()) + 260 (url == null ? "null" : url.toString()) +
261 ": " + e.getMessage()); 261 ": " + e.getMessage());
262 } 262 }
263 263
264 disableDerivedPrinterTableCheck = System.getProperty("sun.jvm.hotspot.runtime.VM.disableDerivedPointerTableCheck") != null; 264 disableDerivedPointerTableCheck = System.getProperty("sun.jvm.hotspot.runtime.VM.disableDerivedPointerTableCheck") != null;
265 } 265 }
266 266
267 private VM(TypeDataBase db, JVMDebugger debugger, boolean isBigEndian) { 267 private VM(TypeDataBase db, JVMDebugger debugger, boolean isBigEndian) {
268 this.db = db; 268 this.db = db;
269 this.debugger = debugger; 269 this.debugger = debugger;
369 } 369 }
370 370
371 /** This is used by the debugging system */ 371 /** This is used by the debugging system */
372 public static void initialize(TypeDataBase db, JVMDebugger debugger) { 372 public static void initialize(TypeDataBase db, JVMDebugger debugger) {
373 if (soleInstance != null) { 373 if (soleInstance != null) {
374 throw new RuntimeException("Attempt to initialize VM twice"); 374 // Using multiple SA Tool classes in the same process creates a call here.
375 return;
375 } 376 }
376 soleInstance = new VM(db, debugger, debugger.getMachineDescription().isBigEndian()); 377 soleInstance = new VM(db, debugger, debugger.getMachineDescription().isBigEndian());
377 378
378 for (Iterator iter = vmInitializedObservers.iterator(); iter.hasNext(); ) { 379 for (Iterator iter = vmInitializedObservers.iterator(); iter.hasNext(); ) {
379 ((Observer) iter.next()).update(null, null); 380 ((Observer) iter.next()).update(null, null);
681 return usingServerCompiler; 682 return usingServerCompiler;
682 } 683 }
683 684
684 /** Returns true if C2 derived pointer table should be used, false otherwise */ 685 /** Returns true if C2 derived pointer table should be used, false otherwise */
685 public boolean useDerivedPointerTable() { 686 public boolean useDerivedPointerTable() {
686 return !disableDerivedPrinterTableCheck; 687 return !disableDerivedPointerTableCheck;
687 } 688 }
688 689
689 /** Returns the code cache; should not be used if is core build */ 690 /** Returns the code cache; should not be used if is core build */
690 public CodeCache getCodeCache() { 691 public CodeCache getCodeCache() {
691 if (Assert.ASSERTS_ENABLED) { 692 if (Assert.ASSERTS_ENABLED) {