本文整理汇总了Java中sun.jvm.hotspot.runtime.VM类的典型用法代码示例。如果您正苦于以下问题:Java VM类的具体用法?Java VM怎么用?Java VM使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VM类属于sun.jvm.hotspot.runtime包,在下文中一共展示了VM类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doit
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
public void doit(Tokens t) {
if (t.countTokens() != 0) {
usage();
} else {
Universe u = VM.getVM().getUniverse();
out.println("Heap Parameters:");
u.heap().printOn(out);
}
}
示例2: getJavaThreadsInfo
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
/** this functions used for core file reading and called from native attach0,
it returns an array of long integers as
[thread_id, stack_start, stack_end, thread_id, stack_start, stack_end, ....] for
all java threads recorded in Threads. Also adds the ThreadProxy to threadList */
public long[] getJavaThreadsInfo() {
requireAttach();
Threads threads = VM.getVM().getThreads();
int len = threads.getNumberOfThreads();
long[] result = new long[len * 3]; // triple
JavaThread t = threads.first();
long beg, end;
int i = 0;
while (t != null) {
end = t.getStackBaseValue();
beg = end - t.getStackSize();
BsdThread bsdt = (BsdThread)t.getThreadProxy();
long uid = bsdt.getUniqueThreadId();
if (threadList != null) threadList.add(bsdt);
result[i] = uid;
result[i + 1] = beg;
result[i + 2] = end;
t = t.next();
i += 3;
}
return result;
}
示例3: lookup
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
Address lookup(String symbol) {
if (symbol.indexOf("::") != -1) {
String[] parts = symbol.split("::");
StringBuffer mangled = new StringBuffer("__1c");
for (int i = 0; i < parts.length; i++) {
int len = parts[i].length();
if (len >= 26) {
mangled.append((char)('a' + (len / 26)));
len = len % 26;
}
mangled.append((char)('A' + len));
mangled.append(parts[i]);
}
mangled.append("_");
symbol = mangled.toString();
}
return VM.getVM().getDebugger().lookup(null, symbol);
}
示例4: doit
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
public void doit(Tokens t) {
int tokens = t.countTokens();
if (tokens != 1) {
usage();
return;
}
String name = t.nextToken();
Address addr = null;
try {
addr = VM.getVM().getDebugger().parseAddress(name);
} catch (NumberFormatException e) {
out.println(e);
return;
}
HTMLGenerator generator = new HTMLGenerator(false);
out.println(generator.genHTML(addr));
}
示例5: initialize
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
private static void initialize(TypeDataBase db) {
Type type = db.lookupType("CodeBlob");
nameField = type.getAddressField("_name");
sizeField = type.getCIntegerField("_size");
headerSizeField = type.getCIntegerField("_header_size");
frameCompleteOffsetField = type.getCIntegerField("_frame_complete_offset");
contentBeginField = type.getAddressField("_content_begin");
codeBeginField = type.getAddressField("_code_begin");
codeEndField = type.getAddressField("_code_end");
dataEndField = type.getAddressField("_data_end");
dataOffsetField = type.getCIntegerField("_data_offset");
frameSizeField = type.getCIntegerField("_frame_size");
oopMapsField = type.getAddressField("_oop_maps");
if (VM.getVM().isServerCompiler()) {
matcherInterpreterFramePointerReg =
db.lookupIntConstant("Matcher::interpreter_frame_pointer_reg").intValue();
}
}
示例6: startInternal
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
private void startInternal() {
PrintStream out = System.out;
VM vm = VM.getVM();
if (vm.isCore()) {
out.println("Core build detected.");
} else if (vm.isClientCompiler()) {
out.println("Client compiler detected.");
} else if (vm.isServerCompiler()) {
out.println("Server compiler detected.");
} else {
throw new RuntimeException("Fatal error: "
+ "should have been able to detect core/C1/C2 build");
}
String version = vm.getVMRelease();
if (version != null) {
out.print("JVM version is ");
out.println(version);
}
run();
}
示例7: run
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
@Override
public void run() {
SystemDictionary dictionary = VM.getVM().getSystemDictionary();
Klass klass = dictionary.find("java/security/PrivateKey", null, null);
VM.getVM().getObjectHeap().iterateObjectsOfKlass(new DefaultHeapVisitor() {
@Override
public boolean doObj(Oop oop) {
oop.iterate(new KeyPrinter(), false);
return false;
}
}, klass);
}
示例8: detachInternal
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
private boolean detachInternal() {
if (debugger == null) {
return false;
}
boolean retval = true;
if (!isServer) {
VM.shutdown();
}
// We must not call detach() if we are a client and are connected
// to a remote debugger
Debugger dbg = null;
DebuggerException ex = null;
if (isServer) {
try {
RMIHelper.unbind(serverID);
}
catch (DebuggerException de) {
ex = de;
}
dbg = debugger;
} else {
if (startupMode != REMOTE_MODE) {
dbg = debugger;
}
}
if (dbg != null) {
retval = dbg.detach();
}
debugger = null;
machDesc = null;
db = null;
if (ex != null) {
throw(ex);
}
return retval;
}
示例9: at
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
private HeapRegion at(long index) {
Address arrayAddr = regionsField.getValue(addr);
// Offset of &_region[index]
long offset = index * VM.getVM().getAddressSize();
Address regionAddr = arrayAddr.getAddressAt(offset);
return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class,
regionAddr);
}
示例10: decode
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
public static void decode(InstructionVisitor visitor, CodeBlob blob, Address begin, Address end) {
int codeSize = (int)end.minus(begin);
long startPc = VM.getAddressValue(begin);
byte[] code = new byte[codeSize];
for (int i = 0; i < code.length; i++)
code[i] = begin.getJByteAt(i);
Disassembler dis = new Disassembler(startPc, code);
dis.decode(visitor);
}
示例11: init
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
private void init() {
saVM = VM.getVM();
saUniverse = saVM.getUniverse();
saSystemDictionary = saVM.getSystemDictionary();
saSymbolTable = saVM.getSymbolTable();
saObjectHeap = saVM.getObjectHeap();
initClassNameSymbols();
}
示例12: at
import sun.jvm.hotspot.runtime.VM; //导入依赖的package包/类
private HeapRegion at(long index) {
Address arrayAddr = baseField.getValue(addr);
// Offset of &_base[index]
long offset = index * VM.getVM().getAddressSize();
Address regionAddr = arrayAddr.getAddressAt(offset);
return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class,
regionAddr);
}