@@ -115,8 +115,106 @@ pmclass RakudoObject manual_attrs dynpmc group nqp {
115
115
Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
116
116
return VTABLE_get_bool(interp, VTABLE_get_pmc_keyed_int(interp, cappy, 0));
117
117
}
118
- else { printf("Found no get_bool\n");
118
+ else
119
119
return SUPER();
120
+ }
121
+
122
+ VTABLE PMC * get_pmc_keyed(PMC *key) {
123
+ PMC **vt = STABLE(SELF)->parrot_vtable_mapping;
124
+ PMC *meth;
125
+ if (vt && !PMC_IS_NULL(meth = vt[PARROT_VTABLE_SLOT_GET_PMC_KEYED])) {
126
+ PMC *old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
127
+ PMC *cappy = Parrot_pmc_new(interp, enum_class_CallContext);
128
+ VTABLE_push_pmc(interp, cappy, SELF);
129
+ VTABLE_push_pmc(interp, cappy, key);
130
+ Parrot_pcc_invoke_from_sig_object(interp, meth, cappy);
131
+ cappy = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
132
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
133
+ return VTABLE_get_pmc_keyed_int(interp, cappy, 0);
134
+ }
135
+ else
136
+ return SUPER(key);
137
+ }
138
+
139
+ VTABLE PMC * get_pmc_keyed_int(INTVAL key) {
140
+ PMC **vt = STABLE(SELF)->parrot_vtable_mapping;
141
+ PMC *meth;
142
+ if (vt && !PMC_IS_NULL(meth = vt[PARROT_VTABLE_SLOT_GET_PMC_KEYED_INT])) {
143
+ PMC *old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
144
+ PMC *cappy = Parrot_pmc_new(interp, enum_class_CallContext);
145
+ VTABLE_push_pmc(interp, cappy, SELF);
146
+ VTABLE_push_integer(interp, cappy, key);
147
+ Parrot_pcc_invoke_from_sig_object(interp, meth, cappy);
148
+ cappy = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
149
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
150
+ return VTABLE_get_pmc_keyed_int(interp, cappy, 0);
151
+ }
152
+ else
153
+ return SUPER(key);
154
+ }
155
+
156
+ VTABLE PMC * get_pmc_keyed_str(STRING *key) {
157
+ PMC **vt = STABLE(SELF)->parrot_vtable_mapping;
158
+ PMC *meth;
159
+ if (vt && !PMC_IS_NULL(meth = vt[PARROT_VTABLE_SLOT_GET_PMC_KEYED_STR])) {
160
+ PMC *old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
161
+ PMC *cappy = Parrot_pmc_new(interp, enum_class_CallContext);
162
+ VTABLE_push_pmc(interp, cappy, SELF);
163
+ VTABLE_push_string(interp, cappy, key);
164
+ Parrot_pcc_invoke_from_sig_object(interp, meth, cappy);
165
+ cappy = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
166
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
167
+ return VTABLE_get_pmc_keyed_int(interp, cappy, 0);
120
168
}
169
+ else
170
+ return SUPER(key);
171
+ }
172
+
173
+ VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
174
+ PMC **vt = STABLE(SELF)->parrot_vtable_mapping;
175
+ PMC *meth;
176
+ if (vt && !PMC_IS_NULL(meth = vt[PARROT_VTABLE_SLOT_SET_PMC_KEYED])) {
177
+ PMC *old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
178
+ PMC *cappy = Parrot_pmc_new(interp, enum_class_CallContext);
179
+ VTABLE_push_pmc(interp, cappy, SELF);
180
+ VTABLE_push_pmc(interp, cappy, key);
181
+ VTABLE_push_pmc(interp, cappy, value);
182
+ Parrot_pcc_invoke_from_sig_object(interp, meth, cappy);
183
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
184
+ }
185
+ else
186
+ SUPER(key, value);
187
+ }
188
+
189
+ VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) {
190
+ PMC **vt = STABLE(SELF)->parrot_vtable_mapping;
191
+ PMC *meth;
192
+ if (vt && !PMC_IS_NULL(meth = vt[PARROT_VTABLE_SLOT_SET_PMC_KEYED_INT])) {
193
+ PMC *old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
194
+ PMC *cappy = Parrot_pmc_new(interp, enum_class_CallContext);
195
+ VTABLE_push_pmc(interp, cappy, SELF);
196
+ VTABLE_push_integer(interp, cappy, key);
197
+ VTABLE_push_pmc(interp, cappy, value);
198
+ Parrot_pcc_invoke_from_sig_object(interp, meth, cappy);
199
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
200
+ }
201
+ else
202
+ SUPER(key, value);
203
+ }
204
+
205
+ VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
206
+ PMC **vt = STABLE(SELF)->parrot_vtable_mapping;
207
+ PMC *meth;
208
+ if (vt && !PMC_IS_NULL(meth = vt[PARROT_VTABLE_SLOT_SET_PMC_KEYED_STR])) {
209
+ PMC *old_ctx = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
210
+ PMC *cappy = Parrot_pmc_new(interp, enum_class_CallContext);
211
+ VTABLE_push_pmc(interp, cappy, SELF);
212
+ VTABLE_push_string(interp, cappy, key);
213
+ VTABLE_push_pmc(interp, cappy, value);
214
+ Parrot_pcc_invoke_from_sig_object(interp, meth, cappy);
215
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_ctx);
216
+ }
217
+ else
218
+ SUPER(key, value);
121
219
}
122
220
}
0 commit comments