jdk.internal.org.objectweb.asm.tree.LabelNode Java Examples

The following examples show how to use jdk.internal.org.objectweb.asm.tree.LabelNode. 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: JSRInlinerAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #2
Source File: JSRInlinerAdapter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #3
Source File: JSRInlinerAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #4
Source File: JSRInlinerAdapter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #5
Source File: JSRInlinerAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #6
Source File: JSRInlinerAdapter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #7
Source File: JSRInlinerAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #8
Source File: JSRInlinerAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Walks the method and determines which internal subroutine(s), if any,
 * each instruction is a method of.
 */
private void markSubroutines() {
    BitSet anyvisited = new BitSet();

    // First walk the main subroutine and find all those instructions which
    // can be reached without invoking any JSR at all
    markSubroutineWalk(mainSubroutine, 0, anyvisited);

    // Go through the head of each subroutine and find any nodes reachable
    // to that subroutine without following any JSR links.
    for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
            .entrySet().iterator(); it.hasNext();) {
        Map.Entry<LabelNode, BitSet> entry = it.next();
        LabelNode lab = entry.getKey();
        BitSet sub = entry.getValue();
        int index = instructions.indexOf(lab);
        markSubroutineWalk(sub, index, anyvisited);
    }
}
 
Example #9
Source File: JSRInlinerAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #10
Source File: JSRInlinerAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #11
Source File: JSRInlinerAdapter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #12
Source File: Subroutine.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #13
Source File: JSRInlinerAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #14
Source File: Subroutine.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #15
Source File: Subroutine.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #16
Source File: Subroutine.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #17
Source File: JSRInlinerAdapter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #18
Source File: Subroutine.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #19
Source File: JSRInlinerAdapter.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #20
Source File: JSRInlinerAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #21
Source File: JSRInlinerAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #22
Source File: JSRInlinerAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #23
Source File: Subroutine.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #24
Source File: JSRInlinerAdapter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #25
Source File: Subroutine.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #26
Source File: Subroutine.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}
 
Example #27
Source File: JSRInlinerAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Detects a JSR instruction and sets a flag to indicate we will need to do
 * inlining.
 */
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
    super.visitJumpInsn(opcode, lbl);
    LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
        subroutineHeads.put(ln, new BitSet());
    }
}
 
Example #28
Source File: JSRInlinerAdapter.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/** Determines, for each instruction, to which subroutine(s) it belongs. */
private void findSubroutinesInsns() {
    // Find the instructions that belong to main subroutine.
    BitSet visitedInsns = new BitSet();
    findSubroutineInsns(0, mainSubroutineInsns, visitedInsns);
    // For each subroutine, find the instructions that belong to this subroutine.
    for (Map.Entry<LabelNode, BitSet> entry : subroutinesInsns.entrySet()) {
        LabelNode jsrLabelNode = entry.getKey();
        BitSet subroutineInsns = entry.getValue();
        findSubroutineInsns(instructions.indexOf(jsrLabelNode), subroutineInsns, visitedInsns);
    }
}
 
Example #29
Source File: JSRInlinerAdapter.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@Override
public void visitJumpInsn(final int opcode, final Label label) {
    super.visitJumpInsn(opcode, label);
    LabelNode labelNode = ((JumpInsnNode) instructions.getLast()).label;
    if (opcode == JSR && !subroutinesInsns.containsKey(labelNode)) {
        subroutinesInsns.put(labelNode, new BitSet());
    }
}
 
Example #30
Source File: Subroutine.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
Subroutine(final LabelNode start, final int maxLocals,
        final JumpInsnNode caller) {
    this.start = start;
    this.access = new boolean[maxLocals];
    this.callers = new ArrayList<JumpInsnNode>();
    callers.add(caller);
}