sun.jvm.hotspot.code.CodeBlob Java Examples

The following examples show how to use sun.jvm.hotspot.code.CodeBlob. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommandProcessor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #2
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #3
Source File: CommandProcessor.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #4
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #5
Source File: CommandProcessor.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #6
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #7
Source File: CommandProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #8
Source File: CommandProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #9
Source File: Disassembler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #10
Source File: Disassembler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #11
Source File: Disassembler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #12
Source File: Disassembler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #13
Source File: Disassembler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #14
Source File: Disassembler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #15
Source File: Disassembler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: Disassembler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #17
Source File: Disassembler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
 
Example #18
Source File: CommandProcessor.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #19
Source File: Disassembler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
 
Example #20
Source File: Disassembler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
 
Example #21
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #22
Source File: Disassembler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
 
Example #23
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #24
Source File: CommandProcessor.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #25
Source File: Disassembler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
 
Example #26
Source File: CommandProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #27
Source File: CommandProcessor.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #28
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address a = null;
    try {
        a = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) { }
    if (a != null) {
        // only nmethod, Method, MethodData and InstanceKlass needed to
        // dump replay data

        CodeBlob cb = VM.getVM().getCodeCache().findBlob(a);
        if (cb != null && (cb instanceof NMethod)) {
            ((NMethod)cb).dumpReplayData(out);
            return;
        }
        // assume it is Metadata
        Metadata meta = Metadata.instantiateWrapperFor(a);
        if (meta != null) {
            meta.dumpReplayData(out);
        } else {
            usage();
            return;
        }
    }
    // Not an address
    boolean all = name.equals("-a");
    Threads threads = VM.getVM().getThreads();
    for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        thread.printThreadIDOn(new PrintStream(bos));
        if (all || bos.toString().equals(name)) {
            if (thread instanceof CompilerThread) {
                CompilerThread ct = (CompilerThread)thread;
                ciEnv env = ct.env();
                if (env != null) {
                   env.dumpReplayData(out);
                }
            }
        }
    }
}
 
Example #29
Source File: Disassembler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
 
Example #30
Source File: Disassembler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
   decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}