# This is the authoritative list of MoarVM instructions.
#
# Changes to this file need to be followed by a call to
# tools/update_ops.p6 to update various auto-generated files.
#
# IMPORTANT NOTE: MoarVM is meant to be able to read bytecode files
# from some number of versions back. This means that new ops should,
# in general, always be added *at the end* of this file, so they get
# new numbers. Similarly, do not remove an op; rename it DEPCRATED_n
# (where n is unique for each one). Otherwise the numbering of those
# after it will be broken. The alternative is writing a bunch of very
# boring mapping code and rendering old bytecode impossible to simply
# run from the mmap'd file.
#
# The exception to this rule is the spesh ops, which must come at the
# very end of the file, and since they are never emitted into bytecode
# files (the specializer inserts them) can be renumbered any time.
#
# Each entry specifies an opname, an optional annotation used by the
# bytecode validator as well as the op arguments:
#
#   [opname]  [annotation?]  [args...]
#
# A basic annotation is a single char prefixed by '.', eg '.r'
# for return ops.
#
# Using a ':' marks the beginning of an op sequence that is followed
# by several '.' annoted ops, eg ':j' for a jumplist that is followed
# by '.j' annotated goto ops.
#
# Using a '+' marks the beginning and '-' the end of a block that may
# only contain matching '*' annotated ops, eg '+a' for prepargs and
# '-a' for invoke_o with ops like arg_i or arg_o annotated as '*a'
# inbetween. Note that '*' ops must not appear outside such blocks.
#
# Some operations may have no side-effects, and so if their result is
# never used they can be tossed. Such operations may be marked with
# :pure.

no_op
const_i8            w(int8) int8 :pure
const_i16           w(int16) int16 :pure
const_i32           w(int32) int32 :pure
const_i64           w(int64) int64 :pure
const_n32           w(num32) num32 :pure
const_n64           w(num64) num64 :pure
const_s             w(str) str :pure
set                 w(`1) r(`1) :pure
extend_u8           w(uint64) r(uint8) :pure
extend_u16          w(uint64) r(uint16) :pure
extend_u32          w(uint64) r(uint32) :pure
extend_i8           w(int64) r(int8) :pure
extend_i16          w(int64) r(int16) :pure
extend_i32          w(int64) r(int32) :pure
trunc_u8            w(uint8) r(uint64) :pure
trunc_u16           w(uint16) r(uint64) :pure
trunc_u32           w(uint32) r(uint64) :pure
trunc_i8            w(int8) r(int64) :pure
trunc_i16           w(int16) r(int64) :pure
trunc_i32           w(int32) r(int64) :pure
extend_n32          w(num64) r(num32) :pure
trunc_n32           w(num32) r(num64) :pure
goto             .j ins
if_i                r(int64) ins
unless_i            r(int64) ins
if_n                r(num64) ins
unless_n            r(num64) ins
if_s                r(str) ins
unless_s            r(str) ins
if_s0               r(str) ins
unless_s0           r(str) ins
if_o                r(obj) ins
unless_o            r(obj) ins
jumplist         :j int64 r(int64)
getlex              w(`1) rl(`1) :pure :deoptonepoint
bindlex             wl(`1) r(`1)
getlex_ni           w(int64) str :pure :noinline
getlex_nn           w(num64) str :pure :noinline
getlex_ns           w(str) str :pure :noinline
getlex_no           w(obj) str :pure :deoptonepoint :noinline
bindlex_ni          str r(int64) :noinline
bindlex_nn          str r(num64) :noinline
bindlex_ns          str r(str) :noinline
bindlex_no          str r(obj) :noinline
getlex_ng           w(obj) r(str) :pure :noinline
bindlex_ng          r(str) r(obj) :noinline
getdynlex           w(obj) r(str) :pure :noinline
binddynlex          r(str) r(obj) :noinline
setlexvalue         r(obj) str r(obj) int16
lexprimspec         w(int64) r(obj) r(str) :pure
return_i         .r r(int64)
return_n         .r r(num64)
return_s         .r r(str)
return_o         .r r(obj)
return           .r
eq_i                w(int64) r(int64) r(int64) :pure
ne_i                w(int64) r(int64) r(int64) :pure
lt_i                w(int64) r(int64) r(int64) :pure
le_i                w(int64) r(int64) r(int64) :pure
gt_i                w(int64) r(int64) r(int64) :pure
ge_i                w(int64) r(int64) r(int64) :pure
cmp_i               w(int64) r(int64) r(int64) :pure
add_i               w(int64) r(int64) r(int64) :pure
sub_i               w(int64) r(int64) r(int64) :pure
mul_i               w(int64) r(int64) r(int64) :pure
div_i               w(int64) r(int64) r(int64) :pure
div_u               w(uint64) r(uint64) r(uint64) :pure
mod_i               w(int64) r(int64) r(int64) :pure
mod_u               w(uint64) r(uint64) r(uint64) :pure
neg_i               w(int64) r(int64) :pure
abs_i               w(int64) r(int64) :pure
inc_i               w(int64)
inc_u               w(uint64)
dec_i               w(int64)
dec_u               w(uint64)
band_i              w(int64) r(int64) r(int64) :pure
bor_i               w(int64) r(int64) r(int64) :pure
bxor_i              w(int64) r(int64) r(int64) :pure
bnot_i              w(int64) r(int64) :pure
blshift_i           w(int64) r(int64) r(int64) :pure
brshift_i           w(int64) r(int64) r(int64) :pure
pow_i               w(int64) r(int64) r(int64) :pure
not_i               w(int64) r(int64) :pure
gcd_i               w(int64) r(int64) r(int64) :pure
lcm_i               w(int64) r(int64) r(int64) :pure
eq_n                w(int64) r(num64) r(num64) :pure
ne_n                w(int64) r(num64) r(num64) :pure
lt_n                w(int64) r(num64) r(num64) :pure
le_n                w(int64) r(num64) r(num64) :pure
gt_n                w(int64) r(num64) r(num64) :pure
ge_n                w(int64) r(num64) r(num64) :pure
cmp_n               w(int64) r(num64) r(num64) :pure
add_n               w(num64) r(num64) r(num64) :pure
sub_n               w(num64) r(num64) r(num64) :pure
mul_n               w(num64) r(num64) r(num64) :pure
div_n               w(num64) r(num64) r(num64) :pure
mod_n               w(num64) r(num64) r(num64) :pure
neg_n               w(num64) r(num64) :pure
abs_n               w(num64) r(num64) :pure
pow_n               w(num64) r(num64) r(num64) :pure
ceil_n              w(num64) r(num64) :pure
floor_n             w(num64) r(num64) :pure
sin_n               w(num64) r(num64) :pure
asin_n              w(num64) r(num64) :pure
cos_n               w(num64) r(num64) :pure
acos_n              w(num64) r(num64) :pure
tan_n               w(num64) r(num64) :pure
atan_n              w(num64) r(num64) :pure
atan2_n             w(num64) r(num64) r(num64) :pure
sec_n               w(num64) r(num64) :pure
asec_n              w(num64) r(num64) :pure
sinh_n              w(num64) r(num64) :pure
cosh_n              w(num64) r(num64) :pure
tanh_n              w(num64) r(num64) :pure
sech_n              w(num64) r(num64) :pure
sqrt_n              w(num64) r(num64) :pure
log_n               w(num64) r(num64) :pure
exp_n               w(num64) r(num64) :pure
coerce_in           w(num64) r(int64) :pure
coerce_ni           w(int64) r(num64) :pure
coerce_is           w(str) r(int64) :pure
coerce_ns           w(str) r(num64) :pure
coerce_si           w(int64) r(str) :pure
coerce_sn           w(num64) r(str) :pure
smrt_numify         w(num64) r(obj) :pure :invokish
smrt_strify         w(str) r(obj) :pure :invokish
prepargs         +a callsite
arg_i            *a int16 r(int64)
arg_n            *a int16 r(num64)
arg_s            *a int16 r(str)
arg_o            *a int16 r(obj)
argconst_i       *a int16 int64
argconst_n       *a int16 num64
argconst_s       *a int16 str
invoke_v         -a r(obj) :deoptallpoint
invoke_i         -a w(int64) r(obj) :deoptallpoint
invoke_n         -a w(num64) r(obj) :deoptallpoint
invoke_s         -a w(str) r(obj) :deoptallpoint
invoke_o         -a w(obj) r(obj) :deoptallpoint :deoptonepoint
checkarity          int16 int16
param_rp_i          w(int64) int16 :pure :noinline
param_rp_n          w(num64) int16 :pure :noinline
param_rp_s          w(str) int16 :pure :noinline
param_rp_o          w(obj) int16 :pure :noinline
param_op_i          w(int64) int16 ins :pure :noinline
param_op_n          w(num64) int16 ins :pure :noinline
param_op_s          w(str) int16 ins :pure :noinline
param_op_o          w(obj) int16 ins :pure :noinline
param_rn_i          w(int64) str :noinline
param_rn_n          w(num64) str :noinline
param_rn_s          w(str) str :noinline
param_rn_o          w(obj) str :noinline
param_on_i          w(int64) str ins :noinline
param_on_n          w(num64) str ins :noinline
param_on_s          w(str) str ins :noinline
param_on_o          w(obj) str ins :noinline
param_sp            w(obj) int16 :pure :noinline
param_sn            w(obj) :noinline
getcode             w(obj) coderef :pure
caller              w(obj) r(int64) :pure :noinline
capturelex          r(obj) :noinline
takeclosure         w(obj) r(obj) :noinline
exception           w(obj)
bindexmessage       r(obj) r(str)
bindexpayload       r(obj) r(obj)
bindexcategory      r(obj) r(int64)
getexmessage        w(str) r(obj) :pure
getexpayload        w(obj) r(obj) :pure
getexcategory       w(int64) r(obj) :pure
throwdyn            w(obj) r(obj) :throwish
throwlex            w(obj) r(obj) :throwish
throwlexotic        w(obj) r(obj) :throwish
throwcatdyn         w(obj) int64 :throwish
throwcatlex         w(obj) int64 :throwish
throwcatlexotic     w(obj) int64 :throwish
die                 w(obj) r(str) :throwish
rethrow             r(obj) :throwish
resume              r(obj) :throwish
takehandlerresult   w(obj)
newlexotic          w(obj) ins
lexoticresult       w(obj) r(obj)
backtracestrings    w(obj) r(obj) :pure
usecapture          w(obj) :noinline
savecapture         w(obj) :noinline
captureposelems     w(int64) r(obj) :pure
captureposarg       w(obj) r(obj) r(int64) :pure
captureposarg_i     w(int64) r(obj) r(int64) :pure
captureposarg_n     w(num64) r(obj) r(int64) :pure
captureposarg_s     w(str) r(obj) r(int64) :pure
captureposprimspec  w(int64) r(obj) r(int64) :pure
captureexistsnamed  w(int64) r(obj) r(str) :pure
capturehasnameds    w(int64) r(obj) :pure
invokewithcapture   w(obj) r(obj) r(obj) :invokish
multicacheadd       w(obj) r(obj) r(obj) r(obj)
multicachefind      w(obj) r(obj) r(obj)
null_s              w(str) :pure
isnull_s            w(int64) r(str) :pure
eq_s                w(int64) r(str) r(str) :pure
ne_s                w(int64) r(str) r(str) :pure
gt_s                w(int64) r(str) r(str) :pure
ge_s                w(int64) r(str) r(str) :pure
lt_s                w(int64) r(str) r(str) :pure
le_s                w(int64) r(str) r(str) :pure
cmp_s               w(int64) r(str) r(str) :pure
eqat_s              w(int64) r(str) r(str) r(int64) :pure
eqatic_s            w(int64) r(str) r(str) r(int64) :pure
haveat_s            w(int64) r(str) r(int64) r(int64) r(str) r(int64) :pure
concat_s            w(str) r(str) r(str) :pure
repeat_s            w(str) r(str) r(int64) :pure
substr_s            w(str) r(str) r(int64) r(int64) :pure
index_s             w(int64) r(str) r(str) r(int64) :pure
# graphs_s will be DEPRECATED!
graphs_s            w(int64) r(str) :pure
codes_s             w(int64) r(str) :pure
getcp_s             w(int64) r(str) r(int64) :pure
indexcp_s           w(int64) r(str) r(int64) :pure
uc                  w(str) r(str) :pure
lc                  w(str) r(str) :pure
tc                  w(str) r(str) :pure
split               w(obj) r(str) r(str) :pure
join                w(str) r(str) r(obj) :pure
getcpbyname         w(int64) r(str) :pure
indexat             r(str) r(int64) str ins
indexnat            r(str) r(int64) str ins
unipropcode         w(int64) r(str) :pure
unipvalcode         w(int64) r(int64) r(str) :pure
hasuniprop          w(int64) r(str) r(int64) r(int64) r(int64) :pure
hasunipropc         w(int64) r(str) r(int64) int16 int16 :pure
chars               w(int64) r(str) :pure
chr                 w(str) r(int64) :pure
ordfirst            w(int64) r(str) :pure
ordat               w(int64) r(str) r(int64) :pure
rindexfrom          w(int64) r(str) r(str) r(int64) :pure
escape              w(str) r(str) :pure
flip                w(str) r(str) :pure
flattenropes        r(str)
iscclass            w(int64) r(int64) r(str) r(int64) :pure
findcclass          w(int64) r(int64) r(str) r(int64) r(int64) :pure
findnotcclass       w(int64) r(int64) r(str) r(int64) r(int64) :pure
nfafromstatelist    w(obj) r(obj) r(obj)
nfarunproto         w(obj) r(obj) r(str) r(int64)
nfarunalt           r(obj) r(str) r(int64) r(obj) r(obj) r(obj)
radix               w(obj) r(int64) r(str) r(int64) r(int64)
encode              w(obj) r(str) r(str) r(obj)
decode              w(str) r(obj) r(str)
istrue_s            w(int64) r(str) :pure
isfalse_s           w(int64) r(str) :pure
null                w(obj) :pure
isnull              w(int64) r(obj) :pure
ifnonnull           r(obj) ins
findmeth            w(obj) r(obj) str :pure :invokish
findmeth_s          w(obj) r(obj) r(str) :pure :invokish
can                 w(int64) r(obj) str :pure :invokish
can_s               w(int64) r(obj) r(str) :pure :invokish
create              w(obj) r(obj) :pure
clone               w(obj) r(obj) :pure
isconcrete          w(int64) r(obj) :pure
rebless             w(obj) r(obj) r(obj)
istype              w(int64) r(obj) r(obj) :pure :invokish
objprimspec         w(int64) r(obj) :pure
gethow              w(obj) r(obj) :pure
getwhat             w(obj) r(obj) :pure
getwho              w(obj) r(obj) :pure
setwho              w(obj) r(obj) r(obj)
reprname            w(str) r(obj) :pure
getwhere            w(int64) r(obj) :pure
eqaddr              w(int64) r(obj) r(obj) :pure
bindattr_i          r(obj) r(obj) str r(int64) int16
bindattr_n          r(obj) r(obj) str r(num64) int16
bindattr_s          r(obj) r(obj) str r(str) int16
bindattr_o          r(obj) r(obj) str r(obj) int16
bindattrs_i         r(obj) r(obj) r(str) r(int64)
bindattrs_n         r(obj) r(obj) r(str) r(num64)
bindattrs_s         r(obj) r(obj) r(str) r(str)
bindattrs_o         r(obj) r(obj) r(str) r(obj)
getattr_i           w(int64) r(obj) r(obj) str int16
getattr_n           w(num64) r(obj) r(obj) str int16
getattr_s           w(str) r(obj) r(obj) str int16
getattr_o           w(obj) r(obj) r(obj) str int16 :deoptonepoint
getattrs_i          w(int64) r(obj) r(obj) r(str)
getattrs_n          w(num64) r(obj) r(obj) r(str)
getattrs_s          w(str) r(obj) r(obj) r(str)
getattrs_o          w(obj) r(obj) r(obj) r(str) :deoptonepoint
attrinited          w(int64) r(obj) r(obj) r(str)
box_i               w(obj) r(int64) r(obj) :pure
box_n               w(obj) r(num64) r(obj) :pure
box_s               w(obj) r(str) r(obj) :pure
unbox_i             w(int64) r(obj) :pure
unbox_n             w(num64) r(obj) :pure
unbox_s             w(str) r(obj) :pure
atpos_i             w(int64) r(obj) r(int64)
atpos_n             w(num64) r(obj) r(int64)
atpos_s             w(str) r(obj) r(int64)
atpos_o             w(obj) r(obj) r(int64)
bindpos_i           r(obj) r(int64) r(int64)
bindpos_n           r(obj) r(int64) r(num64)
bindpos_s           r(obj) r(int64) r(str)
bindpos_o           r(obj) r(int64) r(obj)
push_i              r(obj) r(int64)
push_n              r(obj) r(num64)
push_s              r(obj) r(str)
push_o              r(obj) r(obj)
pop_i               w(int64) r(obj)
pop_n               w(num64) r(obj)
pop_s               w(str) r(obj)
pop_o               w(obj) r(obj)
shift_i             w(int64) r(obj)
shift_n             w(num64) r(obj)
shift_s             w(str) r(obj)
shift_o             w(obj) r(obj)
unshift_i           r(obj) r(int64)
unshift_n           r(obj) r(num64)
unshift_s           r(obj) r(str)
unshift_o           r(obj) r(obj)
splice              r(obj) r(obj) r(int64) r(int64)
setelemspos         r(obj) r(int64)
existspos           w(int64) r(obj) r(int64) :pure
atkey_i             w(int64) r(obj) r(str)
atkey_n             w(num64) r(obj) r(str)
atkey_s             w(str) r(obj) r(str)
atkey_o             w(obj) r(obj) r(str)
bindkey_i           r(obj) r(str) r(int64)
bindkey_n           r(obj) r(str) r(num64)
bindkey_s           r(obj) r(str) r(str)
bindkey_o           r(obj) r(str) r(obj)
existskey           w(int64) r(obj) r(str) :pure
deletekey           r(obj) r(str)
elems               w(int64) r(obj) :pure
knowhow             w(obj) :pure
knowhowattr         w(obj) :pure
newtype             w(obj) r(obj) r(str)
composetype         w(obj) r(obj) r(obj)
setmethcache        r(obj) r(obj)
setmethcacheauth    r(obj) r(int64)
settypecache        r(obj) r(obj)
settypecheckmode    r(obj) r(int64)
setboolspec         r(obj) r(int64) r(obj)
istrue              w(int64) r(obj) :invokish
isfalse             w(int64) r(obj) :invokish
bootint             w(obj) :pure
bootnum             w(obj) :pure
bootstr             w(obj) :pure
bootarray           w(obj) :pure
bootintarray        w(obj) :pure
bootnumarray        w(obj) :pure
bootstrarray        w(obj) :pure
boothash            w(obj) :pure
isint               w(int64) r(obj) :pure
isnum               w(int64) r(obj) :pure
isstr               w(int64) r(obj) :pure
islist              w(int64) r(obj) :pure
ishash              w(int64) r(obj) :pure
sethllconfig        r(str) r(obj)
hllboxtype_i        w(obj) :pure
hllboxtype_n        w(obj) :pure
hllboxtype_s        w(obj) :pure
hlllist             w(obj) :pure
hllhash             w(obj) :pure
getcomp             w(obj) r(str) :pure
bindcomp            w(obj) r(str) r(obj)
getcurhllsym        w(obj) r(str) :pure
bindcurhllsym       w(obj) r(str) r(obj)
gethllsym           w(obj) r(str) r(str) :pure
bindhllsym          r(str) r(str) r(obj)
settypehll          r(obj) r(str)
settypehllrole      r(obj) r(int64)
hllize              w(obj) r(obj) :pure :invokish
hllizefor           w(obj) r(obj) r(str) :pure :invokish
usecompileehllconfig
usecompilerhllconfig
iter                w(obj) r(obj) :pure
iterkey_s           w(str) r(obj) :pure
iterval             w(obj) r(obj) :pure
getcodename         w(str) r(obj) :pure
iscoderef           w(int64) r(obj) :pure
getcodeobj          w(obj) r(obj) :pure
setcodeobj          r(obj) r(obj)
setcodename         r(obj) r(str)
forceouterctx       r(obj) r(obj)
setinvokespec       r(obj) r(obj) r(str) r(obj)
isinvokable         w(int64) r(obj) :pure
freshcoderef        w(obj) r(obj)
markcodestatic      r(obj)
markcodestub        r(obj)
getstaticcode       w(obj) r(obj) :pure
getcodecuid         w(str) r(obj) :pure
setdispatcher       r(obj)
takedispatcher      w(obj)
assign              r(obj) r(obj) :invokish
assignunchecked     r(obj) r(obj) :invokish
iscont              w(int64) r(obj) :pure
decont              w(obj) r(obj) :pure :invokish
setcontspec         r(obj) r(str) r(obj)
sha1                w(str) r(str) :pure
createsc            w(obj) r(str)
scsetobj            r(obj) r(int64) r(obj)
scsetcode           r(obj) r(int64) r(obj)
scgetobj            w(obj) r(obj) r(int64)
scgethandle         w(str) r(obj)
scgetobjidx         w(int64) r(obj) r(obj)
scsetdesc           r(obj) r(str)
scobjcount          w(int64) r(obj)
setobjsc            r(obj) r(obj)
getobjsc            w(obj) r(obj)
serialize           w(str) r(obj) r(obj)
deserialize         r(str) r(obj) r(obj) r(obj) r(obj)
wval                w(obj) int16 int16 :pure
wval_wide           w(obj) int16 int64 :pure
scwbdisable         w(int64)
scwbenable          w(int64)
pushcompsc          r(obj)
popcompsc           w(obj)
scgetdesc           w(str) r(obj)
loadbytecode        w(str) r(str)
masttofile          r(obj) r(obj) r(str)
masttocu            w(obj) r(obj) r(obj)
iscompunit          w(int64) r(obj) :pure
compunitmainline    w(obj) r(obj)
compunitcodes       w(obj) r(obj)
ctx                 w(obj) :noinline
ctxouter            w(obj) r(obj)
ctxcaller           w(obj) r(obj)
ctxlexpad           w(obj) r(obj)
curcode             w(obj) :noinline
callercode          w(obj) :noinline
add_I               w(obj) r(obj) r(obj) r(obj) :pure
sub_I               w(obj) r(obj) r(obj) r(obj) :pure
mul_I               w(obj) r(obj) r(obj) r(obj) :pure
div_I               w(obj) r(obj) r(obj) r(obj) :pure
mod_I               w(obj) r(obj) r(obj) r(obj) :pure
neg_I               w(obj) r(obj) r(obj) :pure
abs_I               w(obj) r(obj) r(obj) :pure
cmp_I               w(int64) r(obj) r(obj) :pure
eq_I                w(int64) r(obj) r(obj) :pure
ne_I                w(int64) r(obj) r(obj) :pure
lt_I                w(int64) r(obj) r(obj) :pure
le_I                w(int64) r(obj) r(obj) :pure
gt_I                w(int64) r(obj) r(obj) :pure
ge_I                w(int64) r(obj) r(obj) :pure
bor_I               w(obj) r(obj) r(obj) r(obj) :pure
bxor_I              w(obj) r(obj) r(obj) r(obj) :pure
band_I              w(obj) r(obj) r(obj) r(obj) :pure
bnot_I              w(obj) r(obj) r(obj) :pure
blshift_I           w(obj) r(obj) r(int64) r(obj) :pure
brshift_I           w(obj) r(obj) r(int64) r(obj) :pure
pow_I               w(obj) r(obj) r(obj) r(obj) r(obj) :pure
gcd_I               w(obj) r(obj) r(obj) r(obj) :pure
lcm_I               w(obj) r(obj) r(obj) r(obj) :pure
expmod_I            w(obj) r(obj) r(obj) r(obj) r(obj) :pure
isprime_I           w(int64) r(obj) r(int64) :pure
rand_I              w(obj) r(obj) r(obj) :pure
coerce_In           w(num64) r(obj) :pure
coerce_Is           w(str) r(obj) :pure
coerce_nI           w(obj) r(num64) r(obj) :pure
coerce_sI           w(obj) r(str) r(obj) :pure
isbig_I             w(int64) r(obj) :pure
bool_I              w(int64) r(obj) :pure
base_I              w(str) r(obj) r(int64) :pure
radix_I             w(obj) r(int64) r(str) r(int64) r(int64) r(obj) :pure
div_In              w(num64) r(obj) r(obj) :pure
copy_f              r(str) r(str)
append_f            r(str) r(str)
rename_f            r(str) r(str)
delete_f            r(str)
chmod_f             r(str) r(int64)
exists_f            w(int64) r(str)
mkdir               r(str) r(int64)
rmdir               r(str)
open_dir            w(obj) r(str)
read_dir            w(str) r(obj)
close_dir           r(obj)
open_fh             w(obj) r(str) r(str)
close_fh            r(obj)
read_fhs            w(str) r(obj) r(int64)
slurp               w(str) r(str) r(str)
spew                r(str) r(str) r(str)
write_fhs           w(int64) r(obj) r(str)
seek_fh             r(obj) r(int64) r(int64)
lock_fh             w(int64) r(obj) r(int64)
unlock_fh           r(obj)
sync_fh             r(obj)
trunc_fh            r(obj) r(int64)
eof_fh              w(int64) r(obj)
getstdin            w(obj) :pure
getstdout           w(obj) :pure
getstderr           w(obj) :pure
connect_sk          r(obj) r(str) r(int64)
socket              w(obj) r(int64)
bind_sk             r(obj) r(str) r(int64) r(int64)
setinputlinesep_fh  r(obj) r(str)
accept_sk           w(obj) r(obj)
decodetocodes       r(obj) r(str) r(int64) r(obj)
encodefromcodes     r(obj) r(str) r(obj)
setencoding         r(obj) r(str)
print               r(str)
say                 r(str)
readall_fh          w(str) r(obj)
tell_fh             w(int64) r(obj)
stat                w(int64) r(str) r(int64)
readline_fh         w(str) r(obj)
readlineint_fh      w(str) r(obj) r(str)
chdir               r(str)
srand               r(int64)
rand_i              w(int64)
rand_n              w(num64)
time_i              w(int64)
sleep               r(num64)
newthread           w(obj) r(obj) r(int64)
threadjoin          r(obj)
time_n              w(num64)
exit                r(int64)
shell               w(int64) r(str) r(str) r(obj) r(obj) r(obj) r(obj) r(int64)
cwd                 w(str)
clargs              w(obj)
getenvhash          w(obj)
loadlib             r(str) r(str)
freelib             r(str)
findsym             w(obj) r(str) r(str)
dropsym             r(obj)
loadext             r(str) r(str)
backendconfig       w(obj)
getlexouter         w(obj) r(str) :pure :noinline
getlexrel           w(obj) r(obj) r(str) :pure
getlexreldyn        w(obj) r(obj) r(str) :pure
getlexrelcaller     w(obj) r(obj) r(str) :pure
getlexcaller        w(obj) r(str) :pure
bitand_s            w(str) r(str) r(str) :pure
bitor_s             w(str) r(str) r(str) :pure
bitxor_s            w(str) r(str) r(str) :pure
isnanorinf          w(int64) r(num64) :pure
inf                 w(num64) :pure
neginf              w(num64) :pure
nan                 w(num64) :pure
getpid              w(int64) :pure
spawn               w(int64) r(obj) r(str) r(obj) r(obj) r(obj) r(obj) r(int64)
filereadable        w(int64) r(str)
filewritable        w(int64) r(str)
fileexecutable      w(int64) r(str)
say_fhs             w(int64) r(obj) r(str)
capturenamedshash   w(obj) r(obj) :pure
read_fhb            r(obj) r(obj) r(int64)
write_fhb           r(obj) r(obj)
replace             w(str) r(str) r(int64) r(int64) r(str)
newexception        w(obj)
DEPRECATED_0        w(obj)
backtrace           w(obj) r(obj)
symlink             r(str) r(str)
link                r(str) r(str)
gethostname         w(str)
exreturnafterunwind r(obj)
continuationclone   w(obj) r(obj)
continuationreset   w(obj) r(obj) r(obj) :invokish
# this op isn't actually invokish, but it requires the cur_op to be set before doing its work
continuationcontrol w(obj) r(int64) r(obj) r(obj) :invokish
continuationinvoke  w(obj) r(obj) r(obj)
randscale_n         w(num64) r(num64) :pure
uniisblock          w(int64) r(str) r(int64) r(str) :pure
assertparamcheck    r(int64) :noinline :invokish
hintfor             w(int64) r(obj) r(str)
paramnamesused      :noinline
getuniname          w(str) r(int64)
getuniprop_int      w(int64) r(int64) r(int64)
getuniprop_bool     w(int64) r(int64) r(int64)
getuniprop_str      w(str) r(int64) r(int64)
matchuniprop        w(int64) r(int64) r(int64) r(int64)
nativecallbuild     r(obj) r(str) r(str) r(str) r(obj) r(obj)
nativecallinvoke    w(obj) r(obj) r(obj) r(obj)
nativecallrefresh   r(obj)
threadrun           r(obj)
threadid            w(int64) r(obj)
threadyield
currentthread       w(obj)
lock                r(obj)
unlock              r(obj)
semacquire          r(obj)
semtryacquire       w(int64) r(obj)
semrelease          r(obj)
getlockcondvar      w(obj) r(obj) r(obj)
condwait            r(obj)
condsignalone       r(obj)
condsignalall       r(obj)
queuepoll           w(obj) r(obj)
setmultispec        r(obj) r(obj) r(str) r(str)
ctxouterskipthunks  w(obj) r(obj) :noinline
ctxcallerskipthunks w(obj) r(obj) :noinline
timer               w(obj) r(obj) r(obj) r(int64) r(int64) r(obj)
cancel              r(obj)
signal              w(obj) r(obj) r(obj) r(int64) r(obj)
watchfile           w(obj) r(obj) r(obj) r(str) r(obj)
asyncconnect        w(obj) r(obj) r(obj) r(str) r(int64) r(obj)
asynclisten         w(obj) r(obj) r(obj) r(str) r(int64) r(int64) r(obj)
asyncwritestr       w(obj) r(obj) r(obj) r(obj) r(str) r(obj)
asyncwritebytes     w(obj) r(obj) r(obj) r(obj) r(obj) r(obj)
asyncreadchars      w(obj) r(obj) r(obj) r(obj) r(obj)
asyncreadbytes      w(obj) r(obj) r(obj) r(obj) r(obj) r(obj)
getlexstatic_o      w(obj) r(str) :pure :noinline
getlexperinvtype_o  w(obj) r(str) :pure :noinline
execname            w(str)
const_i64_16        w(int64) int16 :pure
const_i64_32        w(int64) int32 :pure
isnonnull           w(int64) r(obj) :pure
param_rn2_i         w(int64) str str :noinline
param_rn2_n         w(num64) str str :noinline
param_rn2_s         w(str) str str :noinline
param_rn2_o         w(obj) str str :noinline
param_on2_i         w(int64) str str ins :noinline
param_on2_n         w(num64) str str ins :noinline
param_on2_s         w(str) str str ins :noinline
param_on2_o         w(obj) str str ins :noinline
osrpoint            :osrpoint
nativecallcast      w(obj) r(obj) r(obj) r(obj)
spawnprocasync      w(obj) r(obj) r(obj) r(str) r(obj) r(obj)
killprocasync       r(obj) r(int64)
startprofile        r(obj)
endprofile          w(obj)
objectid            w(int64) r(obj)
settypefinalize     r(obj) r(int64)
force_gc
nativecallglobal    w(obj) r(str) r(str) r(obj) r(obj)
close_fhi           w(int64) r(obj)
setparameterizer    r(obj) r(obj)
parameterizetype    w(obj) r(obj) r(obj)
typeparameterized   w(obj) r(obj)
typeparameters      w(obj) r(obj)
typeparameterat     w(obj) r(obj) r(int64)
readlink            w(str) r(str)
lstat               w(int64) r(str) r(int64)
iscont_i            w(int64) r(obj) :pure
iscont_n            w(int64) r(obj) :pure
iscont_s            w(int64) r(obj) :pure
assign_i            r(obj) r(int64) :invokish
assign_n            r(obj) r(num64) :invokish
assign_s            r(obj) r(str) :invokish
decont_i            w(int64) r(obj) :pure :invokish
decont_n            w(num64) r(obj) :pure :invokish
decont_s            w(str) r(obj) :pure :invokish
getregref_i         w(obj) r(int64) :pure :noinline
getregref_n         w(obj) r(num64) :pure :noinline
getregref_s         w(obj) r(str) :pure :noinline
getlexref_i         w(obj) rl(int64) :pure :noinline
getlexref_n         w(obj) rl(num64) :pure :noinline
getlexref_s         w(obj) rl(str) :pure :noinline
getlexref_ni        w(obj) str :pure :noinline
getlexref_nn        w(obj) str :pure :noinline
getlexref_ns        w(obj) str :pure :noinline
atposref_i          w(obj) r(obj) r(int64) :pure
atposref_n          w(obj) r(obj) r(int64) :pure
atposref_s          w(obj) r(obj) r(int64) :pure
getattrref_i        w(obj) r(obj) r(obj) str int16 :pure
getattrref_n        w(obj) r(obj) r(obj) str int16 :pure
getattrref_s        w(obj) r(obj) r(obj) str int16 :pure
getattrsref_i       w(obj) r(obj) r(obj) r(str) :pure
getattrsref_n       w(obj) r(obj) r(obj) r(str) :pure
getattrsref_s       w(obj) r(obj) r(obj) r(str) :pure
nativecallsizeof    w(int64) r(obj)
encodenorm          r(str) r(str) r(int64) r(obj)
normalizecodes      r(obj) r(int64) r(obj)
strfromcodes        w(str) r(obj)
strtocodes          r(str) r(int64) r(obj)
getcodelocation     w(obj) r(obj) :pure
eqatim_s            w(int64) r(str) r(str) r(int64) :pure
ordbaseat           w(int64) r(str) r(int64) :pure
neverrepossess      r(obj)
scdisclaim          r(obj)
syncpipe            w(obj)
atpos2d_i           w(int64) r(obj) r(int64) r(int64) :pure
atpos2d_n           w(num64) r(obj) r(int64) r(int64) :pure
atpos2d_s           w(str) r(obj) r(int64) r(int64) :pure
atpos2d_o           w(obj) r(obj) r(int64) r(int64) :pure
atpos3d_i           w(int64) r(obj) r(int64) r(int64) r(int64) :pure
atpos3d_n           w(num64) r(obj) r(int64) r(int64) r(int64) :pure
atpos3d_s           w(str) r(obj) r(int64) r(int64) r(int64) :pure
atpos3d_o           w(obj) r(obj) r(int64) r(int64) r(int64) :pure
atposnd_i           w(int64) r(obj) r(obj) :pure
atposnd_n           w(num64) r(obj) r(obj) :pure
atposnd_s           w(str) r(obj) r(obj) :pure
atposnd_o           w(obj) r(obj) r(obj) :pure
bindpos2d_i         r(obj) r(int64) r(int64) r(int64)
bindpos2d_n         r(obj) r(int64) r(int64) r(num64)
bindpos2d_s         r(obj) r(int64) r(int64) r(str)
bindpos2d_o         r(obj) r(int64) r(int64) r(obj)
bindpos3d_i         r(obj) r(int64) r(int64) r(int64) r(int64)
bindpos3d_n         r(obj) r(int64) r(int64) r(int64) r(num64)
bindpos3d_s         r(obj) r(int64) r(int64) r(int64) r(str)
bindpos3d_o         r(obj) r(int64) r(int64) r(int64) r(obj)
bindposnd_i         r(obj) r(obj) r(int64)
bindposnd_n         r(obj) r(obj) r(num64)
bindposnd_s         r(obj) r(obj) r(str)
bindposnd_o         r(obj) r(obj) r(obj)
dimensions          w(obj) r(obj)
setdimensions       r(obj) r(obj)
numdimensions       w(int64) r(obj) :pure
ctxcode             w(obj) r(obj)
isrwcont            w(int64) r(obj) :pure
fc                  w(str) r(str) :pure
setinputlineseps_fh r(obj) r(obj)
readlinechomp_fh    w(str) r(obj)
encoderep           w(obj) r(str) r(str) r(str) r(obj)
istty_fh            w(int64) r(obj) :pure
multidimref_i       w(obj) r(obj) r(obj) :pure
multidimref_n       w(obj) r(obj) r(obj) :pure
multidimref_s       w(obj) r(obj) r(obj) :pure
fileno_fh           w(int64) r(obj) :pure
asyncudp            w(obj) r(obj) r(obj) r(str) r(int64) r(int64) r(obj)
asyncwritestrto     w(obj) r(obj) r(obj) r(obj) r(str) r(obj) r(str) r(int64)
asyncwritebytesto   w(obj) r(obj) r(obj) r(obj) r(obj) r(obj) r(str) r(int64)
objprimbits         w(int64) r(obj)
objprimunsigned     w(int64) r(obj)
getregref_i32       w(obj) r(int32) :pure :noinline
getregref_i16       w(obj) r(int16) :pure :noinline
getregref_i8        w(obj) r(int8) :pure :noinline
getregref_n32       w(obj) r(num32) :pure :noinline
getlexref_i32       w(obj) rl(int32) :pure :noinline
getlexref_i16       w(obj) rl(int16) :pure :noinline
getlexref_i8        w(obj) rl(int8) :pure :noinline
getlexref_n32       w(obj) rl(num32) :pure :noinline
box_u               w(obj) r(uint64) r(obj) :pure
unbox_u             w(uint64) r(obj) :pure
coerce_iu           w(uint64) r(int64) :pure
coerce_ui           w(int64) r(uint64) :pure
coerce_nu           w(uint64) r(num64) :pure
coerce_un           w(num64) r(uint64) :pure
decont_u            w(uint64) r(obj) :pure :invokish
getregref_u         w(obj) r(uint64) :pure :noinline
getregref_u32       w(obj) r(uint32) :pure :noinline
getregref_u16       w(obj) r(uint16) :pure :noinline
getregref_u8        w(obj) r(uint8) :pure :noinline
getlexref_u         w(obj) rl(uint64) :pure :noinline
getlexref_u32       w(obj) rl(uint32) :pure :noinline
getlexref_u16       w(obj) rl(uint16) :pure :noinline
getlexref_u8        w(obj) rl(uint8) :pure :noinline
param_rp_u          w(uint64) int16 :pure :noinline
param_op_u          w(uint64) int16 ins :pure :noinline
param_rn_u          w(uint64) str :noinline
param_on_u          w(uint64) str ins :noinline
param_rn2_u         w(uint64) str str :noinline
param_on2_u         w(uint64) str str ins :noinline
stat_time           w(num64) r(str) r(int64)
lstat_time          w(num64) r(str) r(int64)
setdebugtypename    r(obj) r(str)
loadbytecodebuffer  r(obj)
loadbytecodefh      r(obj) r(str)

# Spesh ops. Naming convention: start with sp_. Must all be marked .s, which
# is how the validator knows to exclude them.

# Used for logging what objects we saw during execution, which is used to do
# speculative optimizations.
sp_log           .s r(obj) int16

# If we're doing OSR, the logging phase replaces the osrpoint with this op, to
# trigger the finalization of the optimization process once we do enough loops
# to gather logging information.
sp_osrfinalize   .s

# Guard operations. Trigger de-optimization if the guard is violated.
#   guardconc = guard on concrete type; index is spesh slot with type
#   guardtype = guard on type object; index is spesh slot with type
#   guardcontconc = guard on container holding concrete type; indexes are
#                   spesh slots with container type and then value type
#   guardconttype = guard on container holding type object; indexes are
#                   spesh slots with container type and then value type
#   guardrwconc   = guard on rw container holding concrete type; indexes are
#                   spesh slots with container type and then value type
#   guardrwtype   = guard on rw container holding type object; indexes are
#                   spesh slots with container type and then value type
sp_guardconc     .s r(obj) sslot
sp_guardtype     .s r(obj) sslot
sp_guardcontconc .s r(obj) sslot sslot
sp_guardconttype .s r(obj) sslot sslot
sp_guardrwconc   .s r(obj) sslot sslot
sp_guardrwtype   .s r(obj) sslot sslot

# Following are for fast, unchecked grabbing of args from the arg buffer.
sp_getarg_o      .s w(obj) int16 :pure
sp_getarg_i      .s w(obj) int16 :pure
sp_getarg_n      .s w(obj) int16 :pure
sp_getarg_s      .s w(obj) int16 :pure

# Fast invocation.
sp_fastinvoke_v  .s r(obj) int16
sp_fastinvoke_i  .s w(int64) r(obj) int16
sp_fastinvoke_n  .s w(num64) r(obj) int16
sp_fastinvoke_s  .s w(str) r(obj) int16
sp_fastinvoke_o  .s w(obj) r(obj) int16

# Marking named params used.
sp_namedarg_used .s int16

# Look up a spesh slot.
sp_getspeshslot  .s w(obj) sslot :pure

# Find method, using spesh slot and the one after it as a cache.
# Isn't marked invokish, since the check is implemented directly
sp_findmeth      .s w(obj) r(obj) str sslot :pure

# Create an object with the first int16's number of bytes size and then
# set its STable to the STable in the spesh slot.
sp_fastcreate    .s w(obj) int16 sslot :pure

# Retrieve or store a value by pointer offset.
sp_get_o         .s w(obj) r(obj) int16 :pure
sp_get_i64       .s w(int64) r(obj) int16 :pure
sp_get_i32       .s w(int64) r(obj) int16 :pure
sp_get_i16       .s w(int64) r(obj) int16 :pure
sp_get_i8        .s w(int64) r(obj) int16 :pure
sp_get_n         .s w(num64) r(obj) int16 :pure
sp_get_s         .s w(str) r(obj) int16 :pure
sp_bind_o        .s r(obj) int16 r(obj)
sp_bind_i64      .s r(obj) int16 r(int64)
sp_bind_i32      .s r(obj) int16 r(int64)
sp_bind_i16      .s r(obj) int16 r(int64)
sp_bind_i8       .s r(obj) int16 r(int64)
sp_bind_n        .s r(obj) int16 r(num64)
sp_bind_s        .s r(obj) int16 r(str)

# Same as above, but for p6opaques, handling the NULL sentinel and the
# real_data thing for mixins. The vt variant vivifies a NULL with a
# type object; the vc does it with a clone.
sp_p6oget_o      .s w(obj) r(obj) int16 :pure
sp_p6ogetvt_o    .s w(obj) r(obj) int16 sslot
sp_p6ogetvc_o    .s w(obj) r(obj) int16 sslot
sp_p6oget_i      .s w(int64) r(obj) int16 :pure
sp_p6oget_n      .s w(num64) r(obj) int16 :pure
sp_p6oget_s      .s w(str) r(obj) int16 :pure
sp_p6obind_o     .s r(obj) int16 r(obj)
sp_p6obind_i     .s r(obj) int16 r(int64)
sp_p6obind_n     .s r(obj) int16 r(num64)
sp_p6obind_s     .s r(obj) int16 r(str)

# Follow a pointer at an offset to an object and get/store a value there.
sp_deref_get_i64      .s w(int64) r(obj) int16 :pure
sp_deref_get_n        .s w(num64) r(obj) int16 :pure
sp_deref_bind_i64     .s r(obj) r(int64) int16
sp_deref_bind_n       .s r(obj) r(num64) int16

# Enter the JIT
sp_jit_enter     .s w(obj)

# we boolify iter objects all the time, but we have no op for it. until now!
sp_boolify_iter       .s w(int64) r(obj) :pure
sp_boolify_iter_arr   .s w(int64) r(obj) :pure
sp_boolify_iter_hash  .s w(int64) r(obj) :pure

# Profiler recording ops. Naming convention: start with prof_. Must all be
# marked .s, which is how the validator knows to exclude them. (For that
# purpose, we treat them as a kind of spesh op).

# Entry of various forms. The inline one passes along the static frame of the
# inlinee.
prof_enter       .s
prof_enterspesh  .s
prof_enterinline .s sslot
prof_enternative .s r(obj)

# Normal exit (exception throw and unwind is handled separately). Will always
# be what we last entered, so no need for separate versions like above.
prof_exit

# Recording of allocated types (may not give full picture of allocations, but
# is at least enough to get a picture).
prof_allocated   .s r(obj)

# Cross-thread write analysis logging instruction.
ctw_check        .s r(obj) int16
