1
/* Represents a Hash that is owned by a serialization context. If it gets
2
* modified, we need to trigger the SC write barrier. */
4
#include "../6model/sixmodelobject.h"
6
pmclass OwnedHash extends Hash provides hash auto_attrs dynpmc group nqp {
7
/* The object that owns this hash. */
10
VTABLE void set_integer_keyed(PMC* key, INTVAL value) {
12
GET_ATTR_owner(interp, SELF, owner);
13
if (!PMC_IS_NULL(owner))
14
OBJ_SC_WRITE_BARRIER(owner);
17
VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
19
GET_ATTR_owner(interp, SELF, owner);
20
if (!PMC_IS_NULL(owner))
21
OBJ_SC_WRITE_BARRIER(owner);
24
VTABLE void set_integer_keyed_str(STRING* key, INTVAL value) {
26
GET_ATTR_owner(interp, SELF, owner);
27
if (!PMC_IS_NULL(owner))
28
OBJ_SC_WRITE_BARRIER(owner);
32
VTABLE void set_number_keyed(PMC* key, FLOATVAL value) {
34
GET_ATTR_owner(interp, SELF, owner);
35
if (!PMC_IS_NULL(owner))
36
OBJ_SC_WRITE_BARRIER(owner);
39
VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
41
GET_ATTR_owner(interp, SELF, owner);
42
if (!PMC_IS_NULL(owner))
43
OBJ_SC_WRITE_BARRIER(owner);
46
VTABLE void set_number_keyed_str(STRING* key, FLOATVAL value) {
48
GET_ATTR_owner(interp, SELF, owner);
49
if (!PMC_IS_NULL(owner))
50
OBJ_SC_WRITE_BARRIER(owner);
54
VTABLE void set_string_keyed(PMC* key, STRING* value) {
56
GET_ATTR_owner(interp, SELF, owner);
57
if (!PMC_IS_NULL(owner))
58
OBJ_SC_WRITE_BARRIER(owner);
61
VTABLE void set_string_keyed_int(INTVAL key, STRING* value) {
63
GET_ATTR_owner(interp, SELF, owner);
64
if (!PMC_IS_NULL(owner))
65
OBJ_SC_WRITE_BARRIER(owner);
68
VTABLE void set_string_keyed_str(STRING* key, STRING* value) {
70
GET_ATTR_owner(interp, SELF, owner);
71
if (!PMC_IS_NULL(owner))
72
OBJ_SC_WRITE_BARRIER(owner);
76
VTABLE void set_pmc_keyed(PMC* key, PMC* value) {
78
GET_ATTR_owner(interp, SELF, owner);
79
if (!PMC_IS_NULL(owner))
80
OBJ_SC_WRITE_BARRIER(owner);
83
VTABLE void set_pmc_keyed_int(INTVAL key, PMC* value) {
85
GET_ATTR_owner(interp, SELF, owner);
86
if (!PMC_IS_NULL(owner))
87
OBJ_SC_WRITE_BARRIER(owner);
90
VTABLE void set_pmc_keyed_str(STRING* key, PMC* value) {
92
GET_ATTR_owner(interp, SELF, owner);
93
if (!PMC_IS_NULL(owner))
94
OBJ_SC_WRITE_BARRIER(owner);
100
GET_ATTR_owner(interp, SELF, owner);
101
Parrot_gc_mark_PMC_alive(INTERP, owner);