ocaml/bytecomp/instruct.ml

60 lines
1.6 KiB
OCaml
Raw Normal View History

open Lambda
type label = int (* Symbolic code labels *)
type instruction =
Klabel of label
| Kacc of int
| Kenvacc of int
| Kpush
| Kpop of int
| Kassign of int
| Kpush_retaddr of label
| Kapply of int (* number of arguments *)
| Kappterm of int * int (* number of arguments, slot size *)
| Kreturn of int (* slot size *)
| Krestart
| Kgrab of int (* number of arguments *)
| Kclosure of label * int
| Kclosurerec of label * int
| Kgetglobal of Ident.t
| Ksetglobal of Ident.t
| Kconst of structured_constant
| Kmakeblock of int * int (* size, tag *)
| Kgetfield of int
| Ksetfield of int
| Ktagof
| Kdummy of int
| Kupdate
| Kvectlength
| Kgetvectitem
| Ksetvectitem
| Kgetstringchar
| Ksetstringchar
| Kbranch of label
| Kbranchif of label
| Kbranchifnot of label
| Kstrictbranchif of label
| Kstrictbranchifnot of label
| Kswitch of label array
| Ktranslate of (int * int * int) array
| Kboolnot
| Kpushtrap of label
| Kpoptrap
| Kraise
| Kcheck_signals
| Kccall of string * int
| Knegint | Kaddint | Ksubint | Kmulint | Kdivint | Kmodint
| Kandint | Korint | Kxorint | Klslint | Klsrint | Kasrint
| Kintcomp of comparison
| Koffsetint of int
| Koffsetref of int
| Kstop
let immed_min = -0x40000000
and immed_max = 0x3FFFFFFF
(* Actually the abstract machine accomodates -0x80000000 to 0x7FFFFFFF,
but these numbers overflow the Caml type int if the compiler runs on
a 32-bit processor. *)