Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (32 sloc) 1.015 kb
bbe450f Code purge and reorganization.
Evan Phoenix authored
1 #ifndef RBX_TYPE_INFO_HPP
2 #define RBX_TYPE_INFO_HPP
3
4 #include "prelude.hpp"
5 #include "object.hpp"
6
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
7 #include <map>
8 #include <stdexcept>
9
879a046 A whole slew. Enhanced type-info, debugged GC.
Evan Phoenix authored
10 #include "gc.hpp"
11
bbe450f Code purge and reorganization.
Evan Phoenix authored
12 namespace rubinius {
13 class VM;
14 class Class;
15
16 /* TypeInfo contains varies operations that are registered by types */
17 class TypeInfo {
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
18 public:
19
20 typedef std::map<native_int, long> Slots;
21
bbe450f Code purge and reorganization.
Evan Phoenix authored
22 VM* state;
23 object_type type;
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
24 Slots slots;
bbe450f Code purge and reorganization.
Evan Phoenix authored
25
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
26 static void init(STATE);
27 TypeInfo(object_type type);
879a046 A whole slew. Enhanced type-info, debugged GC.
Evan Phoenix authored
28 virtual ~TypeInfo();
29 virtual void cleanup(OBJECT obj);
30 virtual void mark(OBJECT obj, ObjectMark& mark);
feb91b4 Tons of stuff (too much probably)
Evan Phoenix authored
31 virtual void set_field(STATE, OBJECT target, size_t index, OBJECT val);
32 virtual OBJECT get_field(STATE, OBJECT target, size_t index);
bbe450f Code purge and reorganization.
Evan Phoenix authored
33 };
879a046 A whole slew. Enhanced type-info, debugged GC.
Evan Phoenix authored
34
35 #define BASIC_TYPEINFO(super) \
36 Info(object_type type) : super(type) { } \
37 virtual void set_field(STATE, OBJECT target, size_t index, OBJECT val); \
38 virtual OBJECT get_field(STATE, OBJECT target, size_t index); \
39 virtual void mark(OBJECT obj, ObjectMark& mark);
40
bbe450f Code purge and reorganization.
Evan Phoenix authored
41 }
42
43 #endif
Something went wrong with that request. Please try again.