insn.op

Bytecode helpers. Fns for opcodes with an underscore in their name
(e.g., IF_ICMPEQ) use a dash instead (e.g., if-icmpeq).

aaload

(aaload v)
Single-byte opcode.

aastore

(aastore v)
Single-byte opcode.

aconst-null

(aconst-null v)
Single-byte opcode.

aload

(aload v idx)
Push or write local variable at index `idx`.

anew

(anew v)
Alias for new since new is a special form in clojure.

anewarray

(anewarray v stype)
Special type instruction.

areturn

(areturn v)
Single-byte opcode.

arraylength

(arraylength v)
Single-byte opcode.

astore

(astore v idx)
Push or write local variable at index `idx`.

athrow

(athrow v)
Single-byte opcode.

baload

(baload v)
Single-byte opcode.

bastore

(bastore v)
Single-byte opcode.

bipush

(bipush v n)
Push int value `n`.

caload

(caload v)
Single-byte opcode.

castore

(castore v)
Single-byte opcode.

checkcast

(checkcast v stype)
Special type instruction.

compile

(compile ops)
Compile a sequence of op seqs to a fn that accepts an ASM
MethodVisitor to emit method bytecode.

Nested bytecode sequences will be flattened, and nils removed.

d2f

(d2f v)
Single-byte opcode.

d2i

(d2i v)
Single-byte opcode.

d2l

(d2l v)
Single-byte opcode.

dadd

(dadd v)
Single-byte opcode.

daload

(daload v)
Single-byte opcode.

dastore

(dastore v)
Single-byte opcode.

dcmpg

(dcmpg v)
Single-byte opcode.

dcmpl

(dcmpl v)
Single-byte opcode.

dconst-0

(dconst-0 v)
Single-byte opcode.

dconst-1

(dconst-1 v)
Single-byte opcode.

ddiv

(ddiv v)
Single-byte opcode.

dload

(dload v idx)
Push or write local variable at index `idx`.

dmul

(dmul v)
Single-byte opcode.

dneg

(dneg v)
Single-byte opcode.

drem

(drem v)
Single-byte opcode.

dreturn

(dreturn v)
Single-byte opcode.

dstore

(dstore v idx)
Push or write local variable at index `idx`.

dsub

(dsub v)
Single-byte opcode.

dup

(dup v)
Single-byte opcode.

dup-x1

(dup-x1 v)
Single-byte opcode.

dup-x2

(dup-x2 v)
Single-byte opcode.

dup2

(dup2 v)
Single-byte opcode.

dup2-x1

(dup2-x1 v)
Single-byte opcode.

dup2-x2

(dup2-x2 v)
Single-byte opcode.

f2d

(f2d v)
Single-byte opcode.

f2i

(f2i v)
Single-byte opcode.

f2l

(f2l v)
Single-byte opcode.

fadd

(fadd v)
Single-byte opcode.

faload

(faload v)
Single-byte opcode.

fastore

(fastore v)
Single-byte opcode.

fcmpg

(fcmpg v)
Single-byte opcode.

fcmpl

(fcmpl v)
Single-byte opcode.

fconst-0

(fconst-0 v)
Single-byte opcode.

fconst-1

(fconst-1 v)
Single-byte opcode.

fconst-2

(fconst-2 v)
Single-byte opcode.

fdiv

(fdiv v)
Single-byte opcode.

fload

(fload v idx)
Push or write local variable at index `idx`.

fmul

(fmul v)
Single-byte opcode.

fneg

(fneg v)
Single-byte opcode.

frem

(frem v)
Single-byte opcode.

freturn

(freturn v)
Single-byte opcode.

fstore

(fstore v idx)
Push or write local variable at index `idx`.

fsub

(fsub v)
Single-byte opcode.

getfield

(getfield v cls fname)(getfield v cls fname ftype)
Read or write type `ftype` instance or static field named `fname` of
class `cls`.

If the type is not provided, it will be determined through reflection.
In this case, the class must be given as a string or Class object.

getstatic

(getstatic v cls fname)(getstatic v cls fname ftype)
Read or write type `ftype` instance or static field named `fname` of
class `cls`.

If the type is not provided, it will be determined through reflection.
In this case, the class must be given as a string or Class object.

goto

(goto v label)
Unconditionally jump to offset `label`.

i2b

(i2b v)
Single-byte opcode.

i2c

(i2c v)
Single-byte opcode.

i2d

(i2d v)
Single-byte opcode.

i2f

(i2f v)
Single-byte opcode.

i2l

(i2l v)
Single-byte opcode.

i2s

(i2s v)
Single-byte opcode.

iadd

(iadd v)
Single-byte opcode.

iaload

(iaload v)
Single-byte opcode.

iand

(iand v)
Single-byte opcode.

iastore

(iastore v)
Single-byte opcode.

iconst-0

(iconst-0 v)
Single-byte opcode.

iconst-1

(iconst-1 v)
Single-byte opcode.

iconst-2

(iconst-2 v)
Single-byte opcode.

iconst-3

(iconst-3 v)
Single-byte opcode.

iconst-4

(iconst-4 v)
Single-byte opcode.

iconst-5

(iconst-5 v)
Single-byte opcode.

iconst-m1

(iconst-m1 v)
Single-byte opcode.

idiv

(idiv v)
Single-byte opcode.

if-acmpeq

(if-acmpeq v label)
Conditionally jump to offset `label`.

if-acmpne

(if-acmpne v label)
Conditionally jump to offset `label`.

if-icmpeq

(if-icmpeq v label)
Conditionally jump to offset `label`.

if-icmpge

(if-icmpge v label)
Conditionally jump to offset `label`.

if-icmpgt

(if-icmpgt v label)
Conditionally jump to offset `label`.

if-icmple

(if-icmple v label)
Conditionally jump to offset `label`.

if-icmplt

(if-icmplt v label)
Conditionally jump to offset `label`.

if-icmpne

(if-icmpne v label)
Conditionally jump to offset `label`.

ifeq

(ifeq v label)
Conditionally jump to offset `label`.

ifge

(ifge v label)
Conditionally jump to offset `label`.

ifgt

(ifgt v label)
Conditionally jump to offset `label`.

ifle

(ifle v label)
Conditionally jump to offset `label`.

iflt

(iflt v label)
Conditionally jump to offset `label`.

ifne

(ifne v label)
Conditionally jump to offset `label`.

ifnonnull

(ifnonnull v label)
Conditionally jump to offset `label`.

ifnull

(ifnull v label)
Conditionally jump to offset `label`.

iinc

(iinc v idx n)
Increment int local variable index `idx` by amount `n`.

iload

(iload v idx)
Push or write local variable at index `idx`.

imul

(imul v)
Single-byte opcode.

ineg

(ineg v)
Single-byte opcode.

instanceof

(instanceof v stype)
Special type instruction.

invokedynamic

(invokedynamic v mname desc boot)(invokedynamic v mname desc boot args)
Call bootstrap method `boot` to return callsite for method `mname`
with arguments and return type given by `desc`. Note that this
instruction requires version 7 bytecode and above.

The bootstrap method can be a ASM Handle (see `insn.util`) or an op
sequence of the form specified by the invokeX instructions.

An optional seq of constant arguments `args` may be given and each
must be either an Integer, Float, Long, Double, String, ASM Type, ASM
Handle, or ASM ConstantDynamic object. These are passed to the
bootstrap method.

invokeinterface

(invokeinterface v cls mname)(invokeinterface v cls mname desc-or-arity)(invokeinterface v cls mname desc-or-arity iface)
Call method named `mname` of class `cls` with the method arguments
and return type given by `desc`.

If the type descriptor is not provided or is a numeric arity, it will
be determined through reflection. In this case, the class must be
given as a string or Class object.

The last argument `iface` can be used to specify the method's owner
class is an interface (e.g., a default implementation).

invokespecial

(invokespecial v cls mname)(invokespecial v cls mname desc-or-arity)(invokespecial v cls mname desc-or-arity iface)
Call method named `mname` of class `cls` with the method arguments
and return type given by `desc`.

If the type descriptor is not provided or is a numeric arity, it will
be determined through reflection. In this case, the class must be
given as a string or Class object.

The last argument `iface` can be used to specify the method's owner
class is an interface (e.g., a default implementation).

invokestatic

(invokestatic v cls mname)(invokestatic v cls mname desc-or-arity)(invokestatic v cls mname desc-or-arity iface)
Call method named `mname` of class `cls` with the method arguments
and return type given by `desc`.

If the type descriptor is not provided or is a numeric arity, it will
be determined through reflection. In this case, the class must be
given as a string or Class object.

The last argument `iface` can be used to specify the method's owner
class is an interface (e.g., a default implementation).

invokevirtual

(invokevirtual v cls mname)(invokevirtual v cls mname desc-or-arity)(invokevirtual v cls mname desc-or-arity iface)
Call method named `mname` of class `cls` with the method arguments
and return type given by `desc`.

If the type descriptor is not provided or is a numeric arity, it will
be determined through reflection. In this case, the class must be
given as a string or Class object.

The last argument `iface` can be used to specify the method's owner
class is an interface (e.g., a default implementation).

ior

(ior v)
Single-byte opcode.

irem

(irem v)
Single-byte opcode.

ireturn

(ireturn v)
Single-byte opcode.

ishl

(ishl v)
Single-byte opcode.

ishr

(ishr v)
Single-byte opcode.

istore

(istore v idx)
Push or write local variable at index `idx`.

isub

(isub v)
Single-byte opcode.

iushr

(iushr v)
Single-byte opcode.

ixor

(ixor v)
Single-byte opcode.

jsr

(jsr v label)
Unconditionally jump to offset `label`.

l2d

(l2d v)
Single-byte opcode.

l2f

(l2f v)
Single-byte opcode.

l2i

(l2i v)
Single-byte opcode.

ladd

(ladd v)
Single-byte opcode.

laload

(laload v)
Single-byte opcode.

land

(land v)
Single-byte opcode.

lastore

(lastore v)
Single-byte opcode.

lcmp

(lcmp v)
Single-byte opcode.

lconst-0

(lconst-0 v)
Single-byte opcode.

lconst-1

(lconst-1 v)
Single-byte opcode.

ldc

(ldc v x)
Load constant null, int, float, String, Type, Handle, or
ConstantDynamic value `x`.

ldc2

(ldc2 v x)
Load constant long or double value `x`.

ldiv

(ldiv v)
Single-byte opcode.

line-number

(line-number v n label)
Add a reference to source line `n` starting at `label`. If the label
has not yet been visited (marked), an error will be thrown.

lload

(lload v idx)
Push or write local variable at index `idx`.

lmul

(lmul v)
Single-byte opcode.

lneg

(lneg v)
Single-byte opcode.

local-variable

(local-variable v vname vtype start end idx)
Add a reference to a local variable `vname` of type `vtype` with
index number `idx`. The variable scope is demarcated by labels `start`
and `end`. If either label has not yet been visited (marked), an
error will be thrown.

lookupswitch

(lookupswitch v default m)
Like `lookupswitch*` with the keys and labels given as a map.

lookupswitch*

(lookupswitch* v default tkeys tlabels)
Jump to a corresponding label given in `tlabels` by an int table
lookup of the pre-sorted `tkeys` (as per `zipmap`.) If no mapping is
found, jump to the `default` label.

lor

(lor v)
Single-byte opcode.

lrem

(lrem v)
Single-byte opcode.

lreturn

(lreturn v)
Single-byte opcode.

lshl

(lshl v)
Single-byte opcode.

lshr

(lshr v)
Single-byte opcode.

lstore

(lstore v idx)
Push or write local variable at index `idx`.

lsub

(lsub v)
Single-byte opcode.

lushr

(lushr v)
Single-byte opcode.

lxor

(lxor v)
Single-byte opcode.

mark

(mark v label)
Alias for visit-label!.

monitorenter

(monitorenter v)
Single-byte opcode.

monitorexit

(monitorexit v)
Single-byte opcode.

multianewarray

(multianewarray v atype dims)
Make a new array of type `atype` with `dims` dimensions.

new

(new v stype)
Special type instruction.

newarray

(newarray v atype)
Make a new primitive array of operand type `atype`.

nop

(nop v)
Single-byte opcode.

op-seq

(op-seq xs)
Return a flattened sequence of ops.

pop

(pop v)
Single-byte opcode.

pop1

(pop1 v)
Alias for pop since clojure.core also defines pop.

pop2

(pop2 v)
Single-byte opcode.

putfield

(putfield v cls fname)(putfield v cls fname ftype)
Read or write type `ftype` instance or static field named `fname` of
class `cls`.

If the type is not provided, it will be determined through reflection.
In this case, the class must be given as a string or Class object.

putstatic

(putstatic v cls fname)(putstatic v cls fname ftype)
Read or write type `ftype` instance or static field named `fname` of
class `cls`.

If the type is not provided, it will be determined through reflection.
In this case, the class must be given as a string or Class object.

ret

(ret v idx)
Continue from address given by local variable at index `idx`.

return

(return v)
Single-byte opcode.

saload

(saload v)
Single-byte opcode.

sastore

(sastore v)
Single-byte opcode.

sipush

(sipush v n)
Push int value `n`.

swap

(swap v)
Single-byte opcode.

tableswitch

(tableswitch v imin imax default labels)
Constant-time index of int table between `imin` and `imax` inclusive,
jumping to corresponding label in `labels`. If the value 'off' is not
within range, jump to the `default` label. Otherwise, jump to the
label index given by: (- (- imax imin) (- imax off))

trycatch

(trycatch v start end handler etype)
Mark region between `start` and `end` labels as protected by label
`handler` against throwable `etype`. To handle all exceptions, pass
nil as the throwable type.

visit-label!

(visit-label! v label)
Set label offset to current visitor position.