[project @ 2002-11-20 14:09:42 by simonmar]
[ghc-hetmet.git] / ghc / includes / Bytecodes.h
1
2 /* -----------------------------------------------------------------------------
3  * $Id: Bytecodes.h,v 1.8 2001/08/09 11:19:16 sewardj Exp $
4  *
5  * (c) The GHC Team, 1998-2000
6  *
7  * Bytecode definitions.
8  *
9  * ---------------------------------------------------------------------------*/
10
11 /* --------------------------------------------------------------------------
12  * Instructions
13  *
14  * Notes:
15  * o CASEFAIL is generated by the compiler whenever it tests an "irrefutable"
16  *   pattern which fails.  If we don't see too many of these, we could
17  *   optimise out the redundant test.
18  * ------------------------------------------------------------------------*/
19
20 /* NOTE:
21
22    THIS FILE IS INCLUDED IN HASKELL SOURCES (ghc/compiler/ghci/ByteCodeGen.lhs).
23    DO NOT PUT C-SPECIFIC STUFF IN HERE!
24
25    I hope that's clear :-)
26 */
27
28 #define bci_ARGCHECK  1
29 #define bci_PUSH_L    2
30 #define bci_PUSH_LL   3
31 #define bci_PUSH_LLL  4
32 #define bci_PUSH_G    5
33 #define bci_PUSH_AS   6
34 #define bci_PUSH_UBX  7
35 #define bci_PUSH_TAG  8
36 #define bci_SLIDE     9
37 #define bci_ALLOC     10
38 #define bci_MKAP      11
39 #define bci_UNPACK    12
40 #define bci_UPK_TAG   13
41 #define bci_PACK      14
42 #define bci_TESTLT_I  15 
43 #define bci_TESTEQ_I  16
44 #define bci_TESTLT_F  17
45 #define bci_TESTEQ_F  18
46 #define bci_TESTLT_D  19
47 #define bci_TESTEQ_D  20
48 #define bci_TESTLT_P  21
49 #define bci_TESTEQ_P  22
50 #define bci_CASEFAIL  23
51 #define bci_ENTER     24
52 #define bci_RETURN    25
53 #define bci_STKCHECK  26
54 #define bci_JMP       27
55 #define bci_CCALL     28
56 #define bci_SWIZZLE   29
57
58 /* If a BCO definitely requires less than this many words of stack,
59    don't include an explicit STKCHECK insn in it.  The interpreter
60    will check for this many words of stack before running each BCO,
61    rendering an explicit check unnecessary in the majority of
62    cases. */
63 #define INTERP_STACK_CHECK_THRESH  50
64
65 /*-------------------------------------------------------------------------*/