Example usage for org.objectweb.asm MethodVisitor visitInvokeDynamicInsn

List of usage examples for org.objectweb.asm MethodVisitor visitInvokeDynamicInsn

Introduction

In this page you can find the example usage for org.objectweb.asm MethodVisitor visitInvokeDynamicInsn.

Prototype

public void visitInvokeDynamicInsn(final String name, final String descriptor,
        final Handle bootstrapMethodHandle, final Object... bootstrapMethodArguments) 

Source Link

Document

Visits an invokedynamic instruction.

Usage

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.BooleanType.java

License:Open Source License

@Override
public Type add(final MethodVisitor method, final int programPoint) {
    // Adding booleans in JavaScript is perfectly valid, they add as if false=0 and true=1
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(IADD);/*from   w w w.  j a  v a 2  s .  c  om*/
    } else {
        method.visitInvokeDynamicInsn("iadd", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.IntType.java

License:Open Source License

@Override
public Type add(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(IADD);//from w ww.j  a  v a 2  s  .  c  o  m
    } else {
        method.visitInvokeDynamicInsn("iadd", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.IntType.java

License:Open Source License

@Override
public Type sub(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(ISUB);/*w ww  .  ja va 2s.  c om*/
    } else {
        method.visitInvokeDynamicInsn("isub", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.IntType.java

License:Open Source License

@Override
public Type mul(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(IMUL);/*from   w w w .  j a va 2 s  . co m*/
    } else {
        method.visitInvokeDynamicInsn("imul", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.IntType.java

License:Open Source License

@Override
public Type div(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        JSType.DIV_ZERO.invoke(method);/*from  ww w . j a  va  2s.  c o m*/
    } else {
        method.visitInvokeDynamicInsn("idiv", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.IntType.java

License:Open Source License

@Override
public Type rem(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        JSType.REM_ZERO.invoke(method);//from   w  ww.  j  a v  a 2s.  com
    } else {
        method.visitInvokeDynamicInsn("irem", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.IntType.java

License:Open Source License

@Override
public Type neg(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(INEG);/*from   w w  w  .  j a  va 2  s .c  om*/
    } else {
        method.visitInvokeDynamicInsn("ineg", "(I)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.LongType.java

License:Open Source License

@Override
public Type add(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(LADD);/*from  w  w  w  .j  a  v a 2 s  .c  o m*/
    } else {
        method.visitInvokeDynamicInsn("ladd", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.LongType.java

License:Open Source License

@Override
public Type sub(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(LSUB);//from w  ww. j a  v  a 2 s .  co  m
    } else {
        method.visitInvokeDynamicInsn("lsub", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}

From source file:com.gargoylesoftware.js.nashorn.internal.codegen.types.LongType.java

License:Open Source License

@Override
public Type mul(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(LMUL);//  ww  w  .ja v  a  2 s. co  m
    } else {
        method.visitInvokeDynamicInsn("lmul", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}