jdk.internal.org.objectweb.asm.commons.Remapper Java Examples

The following examples show how to use jdk.internal.org.objectweb.asm.commons.Remapper. 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: JIMethodCallInliner.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitMethodInsn(int opcode, String owner, String name,
        String desc, boolean itf) {
    // Now we are looking at method call in the source method
    if (!shouldBeInlined(owner, name, desc)) {
        // If this method call should not be inlined, just keep it
        mv.visitMethodInsn(opcode, owner, name, desc, itf);
        return;
    }
    // If the call should be inlined, we create a MethodInliningAdapter
    // The MIA will walk the instructions in the inlineTarget and add them
    // to the current method, doing the necessary name remappings.
    Logger.log(LogTag.JFR_SYSTEM_BYTECODE, LogLevel.DEBUG, "Inlining call to " + name + desc);
    Remapper remapper = new SimpleRemapper(oldClass, newClass);
    Label end = new Label();
    inlining = true;
    inlineTarget.instructions.resetLabels();
    JIMethodInliningAdapter mia = new JIMethodInliningAdapter(this, end,
            opcode == Opcodes.INVOKESTATIC ? Opcodes.ACC_STATIC : 0, desc,
            remapper);
    inlineTarget.accept(mia);
    inlining = false;
    super.visitLabel(end);
}
 
Example #2
Source File: JIMethodCallInliner.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitMethodInsn(int opcode, String owner, String name,
        String desc, boolean itf) {
    // Now we are looking at method call in the source method
    if (!shouldBeInlined(owner, name, desc)) {
        // If this method call should not be inlined, just keep it
        mv.visitMethodInsn(opcode, owner, name, desc, itf);
        return;
    }
    // If the call should be inlined, we create a MethodInliningAdapter
    // The MIA will walk the instructions in the inlineTarget and add them
    // to the current method, doing the necessary name remappings.
    Logger.log(LogTag.JFR_SYSTEM_BYTECODE, LogLevel.DEBUG, "Inlining call to " + name + desc);
    Remapper remapper = new SimpleRemapper(oldClass, newClass);
    Label end = new Label();
    inlining = true;
    inlineTarget.instructions.resetLabels();
    JIMethodInliningAdapter mia = new JIMethodInliningAdapter(this, end,
            opcode == Opcodes.INVOKESTATIC ? Opcodes.ACC_STATIC : 0, desc,
            remapper);
    inlineTarget.accept(mia);
    inlining = false;
    super.visitLabel(end);
}
 
Example #3
Source File: JIMethodCallInliner.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitMethodInsn(int opcode, String owner, String name,
        String desc, boolean itf) {
    // Now we are looking at method call in the source method
    if (!shouldBeInlined(owner, name, desc)) {
        // If this method call should not be inlined, just keep it
        mv.visitMethodInsn(opcode, owner, name, desc, itf);
        return;
    }
    // If the call should be inlined, we create a MethodInliningAdapter
    // The MIA will walk the instructions in the inlineTarget and add them
    // to the current method, doing the necessary name remappings.
    Logger.log(LogTag.JFR_SYSTEM_BYTECODE, LogLevel.DEBUG, "Inlining call to " + name + desc);
    Remapper remapper = new SimpleRemapper(oldClass, newClass);
    Label end = new Label();
    inlining = true;
    inlineTarget.instructions.resetLabels();
    JIMethodInliningAdapter mia = new JIMethodInliningAdapter(this, end,
            opcode == Opcodes.INVOKESTATIC ? Opcodes.ACC_STATIC : 0, desc,
            remapper);
    inlineTarget.accept(mia);
    inlining = false;
    super.visitLabel(end);
}
 
Example #4
Source File: JIMethodInliningAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public JIMethodInliningAdapter(LocalVariablesSorter mv, Label end, int acc, String desc, Remapper remapper) {
    super(acc, desc, mv, remapper);
    this.lvs = mv;
    this.end = end;
    int offset = isStatic(acc) ? 0 : 1;
    Type[] args = Type.getArgumentTypes(desc);
    for (int i = args.length - 1; i >= 0; i--) {
        super.visitVarInsn(args[i].getOpcode(Opcodes.ISTORE), i + offset);
    }
    if (offset > 0) {
        super.visitVarInsn(Opcodes.ASTORE, 0);
    }
}
 
Example #5
Source File: JIMethodInliningAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public JIMethodInliningAdapter(LocalVariablesSorter mv, Label end, int acc, String desc, Remapper remapper) {
    super(acc, desc, mv, remapper);
    this.lvs = mv;
    this.end = end;
    int offset = isStatic(acc) ? 0 : 1;
    Type[] args = Type.getArgumentTypes(desc);
    for (int i = args.length - 1; i >= 0; i--) {
        super.visitVarInsn(args[i].getOpcode(Opcodes.ISTORE), i + offset);
    }
    if (offset > 0) {
        super.visitVarInsn(Opcodes.ASTORE, 0);
    }
}
 
Example #6
Source File: JIMethodInliningAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public JIMethodInliningAdapter(LocalVariablesSorter mv, Label end, int acc, String desc, Remapper remapper) {
    super(acc, desc, mv, remapper);
    this.lvs = mv;
    this.end = end;
    int offset = isStatic(acc) ? 0 : 1;
    Type[] args = Type.getArgumentTypes(desc);
    for (int i = args.length - 1; i >= 0; i--) {
        super.visitVarInsn(args[i].getOpcode(Opcodes.ISTORE), i + offset);
    }
    if (offset > 0) {
        super.visitVarInsn(Opcodes.ASTORE, 0);
    }
}