Skip to content
Newer
Older
100644 242 lines (218 sloc) 7.05 KB
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 25, 2008
1 #ifndef RBX_GLOBALS_HPP
2 #define RBX_GLOBALS_HPP
3
d69cfff Document GC roots in globals.hpp
Evan Phoenix authored Sep 22, 2008
4 /** Rubinius Root objects
5 *
6 * This is the set of root objects that the system tracks.
7 * When performing garbage collection, it is these objects
8 * that are considered the root of the tree and walked
9 * to find all live objects.
10 *
11 * Typically, these are builtin class that the VM needs to
12 * reference directly. This is usually the case for things like
13 * String::create that need to have a reference to the ruby String
14 * class object to properly create a String instance.
15 *
16 * The rule of thumb for adding classes/modules to this list
17 * is whether or not the VM needs to directly reference the
18 * class/module. Again, this is typically only because the VM
19 * itself needs to create an instance of that class.
20 *
6437a5e @rue Removed Task and fixed remaining problems.
rue authored Feb 19, 2009
21 * There are a few non-class roots in here for runtime data.
d69cfff Document GC roots in globals.hpp
Evan Phoenix authored Sep 22, 2008
22 */
23
24
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
25 #define SPECIAL_CLASS_MASK 0x1f
26 #define SPECIAL_CLASS_SIZE 32
27
86e4f3f Move GC code under gc/
Evan Phoenix authored Mar 11, 2009
28 #include "gc/root.hpp"
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
29
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
30 namespace rubinius {
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
31
99cd4a7 Removed includes and all lazy forward decls from prelude.hpp
Ryan Davis authored Aug 1, 2008
32 class LookupTable;
33 class Tuple;
34 class Module;
35 class Thread;
36 class Class;
1fdd151 @rue Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.
rue authored Oct 19, 2008
37 class Symbol;
38100a0 Add simple recursion protection
Evan Phoenix authored Feb 18, 2009
38 class Exception;
99cd4a7 Removed includes and all lazy forward decls from prelude.hpp
Ryan Davis authored Aug 1, 2008
39
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
40 struct Globals {
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
41
42 Roots roots;
43
44 /* This requires some manual work when adding a root, but thats ok.
45 * First, add the root to the END of this list. Then add it to
9488e4a Initial outline of Dir class.
Brian Ford authored Jul 25, 2008
46 * the constructor for Globals, again, at the END of the list. */
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
47
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
48 /* classes for the core 'types' */
c12764c Experimental support for BasicObject.
Brian Ford authored Oct 11, 2010
49 TypedRoot<Class*> blokctx, cmethod, tuple, module, basicobject, object, array;
087ce50 @brixen Introduce CharArray for encoding-aware String storage.
brixen authored Jan 29, 2011
50 TypedRoot<Class*> klass, methtbl, bytearray, chararray, methctx, blank;
0f65234 Remove RegexpData, add String::c_str()
Evan Phoenix authored Aug 24, 2008
51 TypedRoot<Class*> blokenv, bignum, regexp, matchdata;
ab073c4 Fix the MOP. Fixes #37. Passes MOP horror test.
Evan Phoenix authored Dec 15, 2009
52 TypedRoot<Class*> string, symbol, io;
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
53 TypedRoot<Class*> nil_class, true_class, false_class, fixnum_class, undef_class;
47565fe @drbrain Add Data class
drbrain authored Nov 3, 2008
54 TypedRoot<Class*> floatpoint, fastctx, nmc, task, list, list_node;
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
55 TypedRoot<Class*> channel, thread, staticscope, send_site, selector, lookuptable;
d607688 @drbrain Move NativeFunction's init into nativefunction.cpp, undup MemoryPoint…
drbrain authored Aug 26, 2008
56 TypedRoot<Class*> iseq, executable, native_function, iobuffer;
6f02fb8 @drbrain Give IncludedModule an IncludedModuleType
drbrain authored Oct 3, 2008
57 TypedRoot<Class*> cmethod_vis, included_module;
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
58
59 /* the primary symbol table */
1fdd151 @rue Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.
rue authored Oct 18, 2008
60 TypedRoot<Symbol*> sym_method_missing;
1decd96 Cleanup opening a metaclass, remove some cruft
Evan Phoenix authored Dec 31, 2009
61 TypedRoot<Symbol*> sym_inherited;
1fdd151 @rue Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.
rue authored Oct 18, 2008
62 TypedRoot<Symbol*> sym_from_literal, sym_method_added, sym_s_method_added, sym_init_copy;
63 TypedRoot<Symbol*> sym_plus, sym_minus, sym_equal, sym_nequal, sym_tequal, sym_lt, sym_gt;
64 TypedRoot<Symbol*> sym_initialize;
c9502b9 @libc Call to_ary on splats
libc authored Mar 29, 2009
65 TypedRoot<Symbol*> sym_coerce_into_array;
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
66
67 TypedRoot<Class*> exception;
68 TypedRoot<Class*> exc_arg, exc_segfault;
69 TypedRoot<Class*> exc_loe, exc_type, exc_rex;
70 TypedRoot<Class*> exc_stack_explosion;
71 TypedRoot<Class*> exc_primitive_failure;
72
73 TypedRoot<LookupTable*> external_ivars;
74 TypedRoot<LookupTable*> errno_mapping;
75 TypedRoot<LookupTable*> selectors;
1fdd151 @rue Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.
rue authored Oct 18, 2008
76 TypedRoot<Object*> config;
77 TypedRoot<Symbol*> sym_send;
78 TypedRoot<Symbol*> sym_public, sym_private, sym_protected, sym_const_missing;
01a15c7 Rework MethodTable to be independent
Evan Phoenix authored Jun 25, 2009
79 TypedRoot<Symbol*> sym_object_id, sym_call, sym_undef;
1fdd151 @rue Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.
rue authored Oct 18, 2008
80 TypedRoot<Object*> top_scope, on_gc_channel;
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
81
52c078b Fleshing out Instruction tests, more type safety
Evan Phoenix authored Apr 30, 2008
82 TypedRoot<Module*> vm;
83 TypedRoot<Thread*> current_thread;
ff082ab Change Undefined to undefined.
Evan Phoenix authored Dec 16, 2009
84 TypedRoot<Object*> main, undefined;
9488e4a Initial outline of Dir class.
Brian Ford authored Jul 26, 2008
85 TypedRoot<Class*> dir;
464bdfd Added CompactLookupTable.
Brian Ford authored Aug 7, 2008
86 TypedRoot<Class*> compactlookuptable;
c7e8d07 @dgtized convert LookupTable entries from Tuple's into LookupTable::Bucket's
dgtized authored Dec 9, 2008
87 TypedRoot<Class*> lookuptablebucket;
01a15c7 Rework MethodTable to be independent
Evan Phoenix authored Jun 25, 2009
88 TypedRoot<Class*> methtblbucket;
f5f8879 Fix attr_*, adding VM ability to read ivars
Evan Phoenix authored Aug 21, 2008
89 TypedRoot<Class*> access_variable;
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
90 TypedRoot<Module*> rubinius;
44d61f8 Added Time C++ class and primitives.
Brian Ford authored Aug 21, 2008
91 TypedRoot<Class*> time_class;
f5cf833 Reorganize ontology and class initialization
Evan Phoenix authored Aug 23, 2008
92 TypedRoot<Class*> integer;
93 TypedRoot<Class*> numeric;
cd7d572 @drbrain Wire up MemoryPointer
drbrain authored Aug 25, 2008
94 TypedRoot<Class*> memory_pointer;
71fdc75 FFI API revamp, take 1.
Evan Phoenix authored May 28, 2010
95 TypedRoot<Class*> ffi_pointer;
6d2f889 Made TaskProbe proper Ruby class shadow under Rubinius module.
Brian Ford authored Sep 6, 2008
96 TypedRoot<Class*> taskprobe;
4ad4fca @matthewd C++ Kernel.{rand,srand} implementation
matthewd authored Apr 15, 2010
97 TypedRoot<Class*> randomizer;
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
98
edfb49b @rue Added NativeMethod(Context) to globals and roots.
rue authored Sep 15, 2008
99 TypedRoot<Class*> nmethod; /**< NativeMethod */
100
47565fe @drbrain Add Data class
drbrain authored Nov 3, 2008
101 TypedRoot<Class*> data;
edfb49b @rue Added NativeMethod(Context) to globals and roots.
rue authored Sep 15, 2008
102
1a2ea43 Fix Autoload in VM
Evan Phoenix authored Nov 30, 2008
103 TypedRoot<Class*> autoload; /**< Autoload class */
e512828 @libc Rename BlockWrapper to Proc, and fix calling Method#to_proc
libc authored Mar 25, 2009
104 TypedRoot<Class*> proc; /**< Proc class */
77c68c4 Checkout. Add CallFrame
Evan Phoenix authored Feb 2, 2009
105 TypedRoot<Class*> variable_scope;
d5bcc5b Long returns and backtraces!
Evan Phoenix authored Feb 4, 2009
106 TypedRoot<Class*> location;
38100a0 Add simple recursion protection
Evan Phoenix authored Feb 18, 2009
107 TypedRoot<Exception*> stack_error;
8e69436 Unify Proc and fix lambda style procs
Evan Phoenix authored Mar 16, 2009
108 TypedRoot<Class*> jump_error;
ccb5a11 Properly handle long returns that are interrupted
Evan Phoenix authored Apr 28, 2009
109 TypedRoot<Class*> exc_vm_internal;
b1f0998 Add a VM level bytecode verifier
Evan Phoenix authored Dec 3, 2010
110 TypedRoot<Class*> exc_vm_bad_bytecode;
025b132 Remove LookupTableAssociation, add GlobalCacheEntry
Evan Phoenix authored Apr 29, 2009
111 TypedRoot<Class*> global_cache_entry;
90c657e Clean up GC by making WeakRef first class
Evan Phoenix authored Aug 23, 2009
112 TypedRoot<Class*> cls_weakref;
a227ba1 Add experimental Fiber support
Evan Phoenix authored Feb 2, 2010
113 TypedRoot<Class*> fiber;
7e7fcdd Fix the super/alias interaction problem
Evan Phoenix authored Feb 3, 2010
114 TypedRoot<Class*> alias;
e66b819 Begin adding Encoding support.
Brian Ford authored May 8, 2011
115 TypedRoot<Class*> encoding;
1a2ea43 Fix Autoload in VM
Evan Phoenix authored Dec 1, 2008
116
7060708 Add some docs about architecture
Evan Phoenix authored Jul 29, 2008
117 /* Add new globals above this line. */
118
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
119 /* Leave this as the last data member always */
120 TypedRoot<Class*> special_classes[SPECIAL_CLASS_SIZE];
121
122 Globals() :
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
123 blokctx(&roots),
124 cmethod(&roots),
125 tuple(&roots),
126 module(&roots),
c12764c Experimental support for BasicObject.
Brian Ford authored Oct 11, 2010
127 basicobject(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
128 object(&roots),
129 array(&roots),
130 klass(&roots),
131 methtbl(&roots),
132 bytearray(&roots),
087ce50 @brixen Introduce CharArray for encoding-aware String storage.
brixen authored Jan 30, 2011
133 chararray(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
134 methctx(&roots),
135 blank(&roots),
136 blokenv(&roots),
137 bignum(&roots),
138 regexp(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
139 matchdata(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
140 string(&roots),
141 symbol(&roots),
142 io(&roots),
143 nil_class(&roots),
144 true_class(&roots),
145 false_class(&roots),
146 fixnum_class(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
147 undef_class(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
148 floatpoint(&roots),
149 fastctx(&roots),
150 nmc(&roots),
151 list(&roots),
152 list_node(&roots),
153 channel(&roots),
154 thread(&roots),
155 staticscope(&roots),
156 send_site(&roots),
157 selector(&roots),
158 lookuptable(&roots),
159 iseq(&roots),
160 executable(&roots),
d607688 @drbrain Move NativeFunction's init into nativefunction.cpp, undup MemoryPoint…
drbrain authored Aug 26, 2008
161 native_function(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
162 iobuffer(&roots),
163 cmethod_vis(&roots),
6f02fb8 @drbrain Give IncludedModule an IncludedModuleType
drbrain authored Oct 3, 2008
164 included_module(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
165 sym_method_missing(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
166 sym_inherited(&roots),
167 sym_from_literal(&roots),
168 sym_method_added(&roots),
169 sym_s_method_added(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
170 sym_init_copy(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
171 sym_plus(&roots),
172 sym_minus(&roots),
173 sym_equal(&roots),
174 sym_nequal(&roots),
175 sym_tequal(&roots),
176 sym_lt(&roots),
177 sym_gt(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
178 sym_initialize(&roots),
c9502b9 @libc Call to_ary on splats
libc authored Mar 29, 2009
179 sym_coerce_into_array(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
180 exception(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
181 exc_arg(&roots),
182 exc_segfault(&roots),
183 exc_loe(&roots),
184 exc_type(&roots),
185 exc_rex(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
186 exc_stack_explosion(&roots),
187 exc_primitive_failure(&roots),
188 external_ivars(&roots),
189 errno_mapping(&roots),
190 selectors(&roots),
191 config(&roots),
192 sym_send(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
193 sym_public(&roots),
194 sym_private(&roots),
195 sym_protected(&roots),
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
196 sym_const_missing(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
197 sym_object_id(&roots),
198 sym_call(&roots),
01a15c7 Rework MethodTable to be independent
Evan Phoenix authored Jun 25, 2009
199 sym_undef(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
200 top_scope(&roots),
201 on_gc_channel(&roots),
52c078b Fleshing out Instruction tests, more type safety
Evan Phoenix authored Apr 30, 2008
202 vm(&roots),
203 current_thread(&roots),
9488e4a Initial outline of Dir class.
Brian Ford authored Jul 26, 2008
204 main(&roots),
ff082ab Change Undefined to undefined.
Evan Phoenix authored Dec 16, 2009
205 undefined(&roots),
464bdfd Added CompactLookupTable.
Brian Ford authored Aug 8, 2008
206 dir(&roots),
f5f8879 Fix attr_*, adding VM ability to read ivars
Evan Phoenix authored Aug 21, 2008
207 compactlookuptable(&roots),
c7e8d07 @dgtized convert LookupTable entries from Tuple's into LookupTable::Bucket's
dgtized authored Dec 9, 2008
208 lookuptablebucket(&roots),
01a15c7 Rework MethodTable to be independent
Evan Phoenix authored Jun 25, 2009
209 methtblbucket(&roots),
9c34450 @drbrain Hook up Rubinius constants for Object
drbrain authored Aug 21, 2008
210 access_variable(&roots),
44d61f8 Added Time C++ class and primitives.
Brian Ford authored Aug 22, 2008
211 rubinius(&roots),
f5cf833 Reorganize ontology and class initialization
Evan Phoenix authored Aug 23, 2008
212 time_class(&roots),
213 integer(&roots),
cd7d572 @drbrain Wire up MemoryPointer
drbrain authored Aug 26, 2008
214 numeric(&roots),
6d2f889 Made TaskProbe proper Ruby class shadow under Rubinius module.
Brian Ford authored Sep 6, 2008
215 memory_pointer(&roots),
71fdc75 FFI API revamp, take 1.
Evan Phoenix authored May 29, 2010
216 ffi_pointer(&roots),
edfb49b @rue Added NativeMethod(Context) to globals and roots.
rue authored Sep 15, 2008
217 taskprobe(&roots),
4ad4fca @matthewd C++ Kernel.{rand,srand} implementation
matthewd authored Apr 15, 2010
218 randomizer(&roots),
edfb49b @rue Added NativeMethod(Context) to globals and roots.
rue authored Sep 15, 2008
219
220 nmethod(&roots),
1a2ea43 Fix Autoload in VM
Evan Phoenix authored Dec 1, 2008
221 data(&roots),
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored Dec 12, 2008
222 autoload(&roots),
e512828 @libc Rename BlockWrapper to Proc, and fix calling Method#to_proc
libc authored Mar 24, 2009
223 proc(&roots),
d5bcc5b Long returns and backtraces!
Evan Phoenix authored Feb 4, 2009
224 variable_scope(&roots),
38100a0 Add simple recursion protection
Evan Phoenix authored Feb 18, 2009
225 location(&roots),
8e69436 Unify Proc and fix lambda style procs
Evan Phoenix authored Mar 16, 2009
226 stack_error(&roots),
ccb5a11 Properly handle long returns that are interrupted
Evan Phoenix authored Apr 28, 2009
227 jump_error(&roots),
025b132 Remove LookupTableAssociation, add GlobalCacheEntry
Evan Phoenix authored Apr 29, 2009
228 exc_vm_internal(&roots),
b1f0998 Add a VM level bytecode verifier
Evan Phoenix authored Dec 4, 2010
229 exc_vm_bad_bytecode(&roots),
0b9ab14 Added Array::Iterator and specs.
Brian Ford authored Jul 2, 2009
230 global_cache_entry(&roots),
a227ba1 Add experimental Fiber support
Evan Phoenix authored Feb 2, 2010
231 cls_weakref(&roots),
7e7fcdd Fix the super/alias interaction problem
Evan Phoenix authored Feb 4, 2010
232 fiber(&roots),
e66b819 Begin adding Encoding support.
Brian Ford authored May 9, 2011
233 alias(&roots),
234 encoding(&roots)
7060708 Add some docs about architecture
Evan Phoenix authored Jul 30, 2008
235
236 /* Add initialize of globals above this line. */
72b1f02 GC root work in progress
Evan Phoenix authored Apr 22, 2008
237 { }
238 };
d769c94 Initial work on new C++ VM
Evan Phoenix authored Mar 26, 2008
239 };
240
241 #endif
Something went wrong with that request. Please try again.