Skip to content

Commit 20ee4fa

Browse files
committed
Bitfield for imemo (broken)
1 parent 361fe3c commit 20ee4fa

1 file changed

Lines changed: 45 additions & 2 deletions

File tree

internal/imemo.h

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,51 @@ struct rb_imemo_tmpbuf_struct {
104104
* @see imemo_type
105105
* */
106106
struct MEMO {
107-
VALUE flags;
108-
VALUE reserved;
107+
union {
108+
struct {
109+
VALUE flags;
110+
VALUE reserved;
111+
};
112+
struct {
113+
union {
114+
VALUE flags;
115+
struct {
116+
unsigned basic_flags:12;
117+
enum imemo_type imemo_type:4;
118+
union {
119+
struct {
120+
bool ivar:1;
121+
bool bf:1;
122+
enum {
123+
vm_cc_type_normal, // chained from ccs
124+
vm_cc_type_super,
125+
vm_cc_type_refinement,
126+
} type:2;
127+
bool unmarkable:1;
128+
bool on_stack:1;
129+
} callcache;
130+
struct {
131+
enum {
132+
VISI_UNDEF = 0x00,
133+
VISI_PUBLIC = 0x01,
134+
VISI_PRIVATE = 0x02,
135+
VISI_PROTECTED = 0x03,
136+
} visibility:2;
137+
bool basic:1;
138+
bool complemented:1;
139+
bool cached:1;
140+
bool invalidated:1;
141+
} ment;
142+
};
143+
};
144+
} flag;
145+
union {
146+
struct {
147+
enum ruby_value_type rbasic_type:5;
148+
};
149+
} rbasic;
150+
};
151+
};
109152
const VALUE v1;
110153
const VALUE v2;
111154
union {

0 commit comments

Comments
 (0)