Debian Codegraph @

terps/tads/tads3/vmbift3.h

raw symbols SCIP
1 /* $Header: d:/cvsroot/tads/tads3/vmbiftad.h,v 1.2 1999/05/17 02:52:29 MJRoberts Exp $ */
2
3 /*
4 * Copyright (c) 1998, 2002 Michael J. Roberts. All Rights Reserved.
5 *
6 * Please see the accompanying license file, LICENSE.TXT, for information
7 * on using and copying this software.
8 */
9 /*
10 Name
11 vmbift3.h - function set definition - T3 VM system interface
12 Function
13
14 Notes
15
16 Modified
17 12/06/98 MJRoberts - Creation
18 */
19
20 #ifndef VMBIFTAD_H
21 #define VMBIFTAD_H
22
23 #include "vmbif.h"
24
25 #endif /* VMBIFTAD_H */
26
27 /* ------------------------------------------------------------------------ */
28 /*
29 * T3 VM function set intrinsics
30 */
31 class CVmBifT3: public CVmBif
32 {
33 public:
34 /* function vector */
35 static vm_bif_desc bif_table[];
36
37 /* run the garbage collector */
38 static void run_gc(VMG_ uint argc);
39
40 /* set the SAY instruction's handler function */
41 static void set_say(VMG_ uint argc);
42
43 /* get the VM version number */
44 static void get_vm_vsn(VMG_ uint argc);
45
46 /* get the VM identification string */
47 static void get_vm_id(VMG_ uint argc);
48
49 /* get the VM banner string */
50 static void get_vm_banner(VMG_ uint argc);
51
52 /* get the 'preinit' status - true if preinit, nil if normal */
53 static void get_vm_preinit_mode(VMG_ uint argc);
54
55 /* debug trace functions */
56 static void debug_trace(VMG_ uint argc);
57
58 /* get the global symbol table, if available */
59 static void get_global_symtab(VMG_ uint argc);
60
61 /* allocate a new property ID */
62 static void alloc_new_prop(VMG_ uint argc);
63
64 /* get a stack trace */
65 static void get_stack_trace(VMG_ uint argc);
66
67 /* look up a named argument */
68 static void get_named_arg(VMG_ uint argc);
69
70 /* get a named argument list */
71 static void get_named_arg_list(VMG_ uint argc);
72
73 protected:
74 /*
75 * service routine - retrieve source information for a given code
76 * location
77 */
78 static void get_source_info(VMG_ const uchar *entry_addr, ulong method_ofs,
79 vm_val_t *retval);
80
81 /* get the local variables for a stack level */
82 static void get_stack_locals(VMG_ vm_val_t *fp, const uchar *entry_addr,
83 ulong method_ofs,
84 vm_val_t *local_tab, vm_val_t *frameref_obj);
85 };
86
87 /*
88 * T3 VM Test function set - test and debug function set
89 */
90 class CVmBifT3Test: public CVmBif
91 {
92 public:
93 /* function vector */
94 static vm_bif_desc bif_table[];
95
96 /* get an instance's unique identifier number */
97 static void get_obj_id(VMG_ uint argc);
98
99 /* get an instance's garbage collection state */
100 static void get_obj_gc_state(VMG_ uint argc);
101
102 /* get the Unicode character code for the first character of a string */
103 static void get_charcode(VMG_ uint argc);
104 };
105
106
107 /* ------------------------------------------------------------------------ */
108 /*
109 * debug_trace mode flags
110 */
111
112 /* check to see if the debugger is present */
113 #define T3DBG_CHECK 1
114
115 /* break into the debugger */
116 #define T3DBG_BREAK 2
117
118 /* write a message to the debug log */
119 #define T3DBG_LOG 3
120
121
122
123 /* ------------------------------------------------------------------------ */
124 /*
125 * Function set vector. Define this only if VMBIF_DEFINE_VECTOR has
126 * been defined, so that this file can be included for the prototypes
127 * alone without defining the function vector.
128 */
129 #ifdef VMBIF_DEFINE_VECTOR
130
131 vm_bif_desc CVmBifT3::bif_table[] =
132 {
133 { &CVmBifT3::run_gc, 0, 0, FALSE },
134 { &CVmBifT3::set_say, 0, 0, FALSE },
135 { &CVmBifT3::get_vm_vsn, 0, 0, FALSE },
136 { &CVmBifT3::get_vm_id, 0, 0, FALSE },
137 { &CVmBifT3::get_vm_banner, 0, 0, FALSE },
138 { &CVmBifT3::get_vm_preinit_mode, 0, 0, FALSE },
139 { &CVmBifT3::debug_trace, 1, 0, TRUE },
140 { &CVmBifT3::get_global_symtab, 0, 0, FALSE },
141 { &CVmBifT3::alloc_new_prop, 0, 0, FALSE },
142 { &CVmBifT3::get_stack_trace, 0, 1, FALSE },
143 { &CVmBifT3::get_named_arg, 1, 1, FALSE },
144 { &CVmBifT3::get_named_arg_list, 0, 0, FALSE }
145 };
146
147 vm_bif_desc CVmBifT3Test::bif_table[] =
148 {
149 { &CVmBifT3Test::get_obj_id, 1, 0, FALSE },
150 { &CVmBifT3Test::get_obj_gc_state, 1, 0, FALSE },
151 { &CVmBifT3Test::get_charcode, 1, 0, FALSE }
152 };
153
154 #endif /* VMBIF_DEFINE_VECTOR */