Bytecode helpers. Fns for opcodes with an underscore in their name (e.g., IF_ICMPEQ) use a dash instead (e.g., if-icmpeq).
Bytecode helpers. Fns for opcodes with an underscore in their name (e.g., IF_ICMPEQ) use a dash instead (e.g., if-icmpeq).
(aload v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(anew v)
Alias for new since new is a special form in clojure.
Alias for new since new is a special form in clojure.
(anewarray v stype)
Special type instruction.
Special type instruction.
(astore v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(checkcast v stype)
Special type instruction.
Special type instruction.
(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.
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.
(dload v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(dstore v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(fload v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(fstore v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(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.
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 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.
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 v label)
Unconditionally jump to offset label
.
Unconditionally jump to offset `label`.
(if-acmpeq v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-acmpne v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-icmpeq v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-icmpge v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-icmpgt v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-icmple v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-icmplt v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(if-icmpne v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifeq v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifge v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifgt v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifle v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(iflt v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifne v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifnonnull v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(ifnull v label)
Conditionally jump to offset label
.
Conditionally jump to offset `label`.
(iinc v idx n)
Increment int local variable index idx
by amount n
.
Increment int local variable index `idx` by amount `n`.
(iload v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(instanceof v stype)
Special type instruction.
Special type instruction.
(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.
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 v cls mname)
(invokeinterface v cls mname desc-or-arity)
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.
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.
(invokespecial v cls mname)
(invokespecial v cls mname desc-or-arity)
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.
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.
(invokestatic v cls mname)
(invokestatic v cls mname desc-or-arity)
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.
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.
(invokevirtual v cls mname)
(invokevirtual v cls mname desc-or-arity)
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.
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.
(istore v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(jsr v label)
Unconditionally jump to offset label
.
Unconditionally jump to offset `label`.
(ldc v x)
Load constant null, int, float, String, Type, Handle, or
ConstantDynamic value x
.
Load constant null, int, float, String, Type, Handle, or ConstantDynamic value `x`.
(ldc2 v x)
Load constant long or double value x
.
Load constant long or double value `x`.
(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.
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 v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(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.
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 v default m)
Like lookupswitch*
with the keys and labels given as a map.
Like `lookupswitch*` with the keys and labels given as a map.
(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.
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.
(lstore v idx)
Push or write local variable at index idx
.
Push or write local variable at index `idx`.
(multianewarray v atype dims)
Make a new array of type atype
with dims
dimensions.
Make a new array of type `atype` with `dims` dimensions.
(newarray v atype)
Make a new primitive array of operand type atype
.
Make a new primitive array of operand type `atype`.
(op-seq xs)
Return a flattened sequence of ops.
Return a flattened sequence of ops.
(pop1 v)
Alias for pop since clojure.core also defines pop.
Alias for pop since clojure.core also defines pop.
(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.
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 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.
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 v idx)
Continue from address given by local variable at index idx
.
Continue from address given by local variable at index `idx`.
(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))
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 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.
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! v label)
Set label offset to current visitor position.
Set label offset to current visitor position.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close