Mercurial > hg > graal-jvmci-8
comparison agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java @ 2177:3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
Summary: move symbols from permgen into C heap and reference count them
Reviewed-by: never, acorn, jmasa, stefank
author | coleenp |
---|---|
date | Thu, 27 Jan 2011 16:11:27 -0800 |
parents | 3e8fbc61cee8 |
children | 1d1603768966 |
comparison
equal
deleted
inserted
replaced
2176:27e4ea99855d | 2177:3582bf76420e |
---|---|
426 PointerLocation loc = PointerFinder.find(a); | 426 PointerLocation loc = PointerFinder.find(a); |
427 loc.printOn(out); | 427 loc.printOn(out); |
428 } | 428 } |
429 } | 429 } |
430 }, | 430 }, |
431 new Command("symbol", "symbol address", false) { | |
432 public void doit(Tokens t) { | |
433 if (t.countTokens() != 1) { | |
434 usage(); | |
435 } else { | |
436 Address a = VM.getVM().getDebugger().parseAddress(t.nextToken()); | |
437 Symbol.create(a).printValueOn(out); | |
438 out.println(); | |
439 } | |
440 } | |
441 }, | |
442 new Command("symboltable", "symboltable name", false) { | |
443 public void doit(Tokens t) { | |
444 if (t.countTokens() != 1) { | |
445 usage(); | |
446 } else { | |
447 out.println(SymbolTable.getTheTable().probe(t.nextToken())); | |
448 } | |
449 } | |
450 }, | |
451 new Command("symboldump", "symboldump", false) { | |
452 public void doit(Tokens t) { | |
453 SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() { | |
454 public void visit(Symbol sym) { | |
455 sym.printValueOn(out); | |
456 out.println(); | |
457 } | |
458 }); | |
459 } | |
460 }, | |
431 new Command("flags", "flags [ flag ]", false) { | 461 new Command("flags", "flags [ flag ]", false) { |
432 public void doit(Tokens t) { | 462 public void doit(Tokens t) { |
433 int tokens = t.countTokens(); | 463 int tokens = t.countTokens(); |
434 if (tokens != 0 && tokens != 1) { | 464 if (tokens != 0 && tokens != 1) { |
435 usage(); | 465 usage(); |
624 CTypeTreeNodeAdapter node = new CTypeTreeNodeAdapter(a, type, null); | 654 CTypeTreeNodeAdapter node = new CTypeTreeNodeAdapter(a, type, null); |
625 | 655 |
626 out.println("pointer to " + type + " @ " + a + | 656 out.println("pointer to " + type + " @ " + a + |
627 " (size = " + type.getSize() + ")"); | 657 " (size = " + type.getSize() + ")"); |
628 printNode(node); | 658 printNode(node); |
629 } | |
630 } | |
631 }, | |
632 new Command("symbol", "symbol name", false) { | |
633 public void doit(Tokens t) { | |
634 if (t.countTokens() != 1) { | |
635 usage(); | |
636 } else { | |
637 String symbol = t.nextToken(); | |
638 Address a = lookup(symbol); | |
639 out.println(symbol + " = " + a); | |
640 } | 659 } |
641 } | 660 } |
642 }, | 661 }, |
643 new Command("printstatics", "printstatics [ type ]", false) { | 662 new Command("printstatics", "printstatics [ type ]", false) { |
644 public void doit(Tokens t) { | 663 public void doit(Tokens t) { |
1260 this.in = in; | 1279 this.in = in; |
1261 this.out = out; | 1280 this.out = out; |
1262 this.err = err; | 1281 this.err = err; |
1263 for (int i = 0; i < commandList.length; i++) { | 1282 for (int i = 0; i < commandList.length; i++) { |
1264 Command c = commandList[i]; | 1283 Command c = commandList[i]; |
1284 if (commands.get(c.name) != null) { | |
1285 throw new InternalError(c.name + " has multiple definitions"); | |
1286 } | |
1265 commands.put(c.name, c); | 1287 commands.put(c.name, c); |
1266 } | 1288 } |
1267 if (debugger.isAttached()) { | 1289 if (debugger.isAttached()) { |
1268 postAttach(); | 1290 postAttach(); |
1269 } | 1291 } |