@@ -51,84 +51,6 @@ static void copy_to(PARROT_INTERP, STable *st, void *src, void *dest) {
51
51
dest_body -> ptr = src_body -> ptr ;
52
52
}
53
53
54
- /* Helper to die because this type doesn't support attributes. */
55
- PARROT_DOES_NOT_RETURN
56
- static void die_no_attrs (PARROT_INTERP ) {
57
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
58
- "CPointer representation does not support attribute storage" );
59
- }
60
-
61
- /* Gets the current value for an attribute. */
62
- static PMC * get_attribute_boxed (PARROT_INTERP , STable * st , void * data , PMC * class_handle , STRING * name , INTVAL hint ) {
63
- die_no_attrs (interp );
64
- }
65
- static void * get_attribute_ref (PARROT_INTERP , STable * st , void * data , PMC * class_handle , STRING * name , INTVAL hint ) {
66
- die_no_attrs (interp );
67
- }
68
-
69
- /* Binds the given value to the specified attribute. */
70
- static void bind_attribute_boxed (PARROT_INTERP , STable * st , void * data , PMC * class_handle , STRING * name , INTVAL hint , PMC * value ) {
71
- die_no_attrs (interp );
72
- }
73
- static void bind_attribute_ref (PARROT_INTERP , STable * st , void * data , PMC * class_handle , STRING * name , INTVAL hint , void * value ) {
74
- die_no_attrs (interp );
75
- }
76
-
77
- /* Gets the hint for the given attribute ID. */
78
- static INTVAL hint_for (PARROT_INTERP , STable * st , PMC * class_handle , STRING * name ) {
79
- return NO_HINT ;
80
- }
81
-
82
- /* Used with boxing. Sets an integer value, for representations that can hold
83
- * one. */
84
- static void set_int (PARROT_INTERP , STable * st , void * data , INTVAL value ) {
85
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
86
- "CPointer cannot box a native int" );
87
- }
88
-
89
- /* Used with boxing. Gets an integer value, for representations that can
90
- * hold one. */
91
- static INTVAL get_int (PARROT_INTERP , STable * st , void * data ) {
92
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
93
- "CPointer cannot unbox to a native int" );
94
- }
95
-
96
- /* Used with boxing. Sets a floating point value, for representations that can
97
- * hold one. */
98
- static void set_num (PARROT_INTERP , STable * st , void * data , FLOATVAL value ) {
99
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
100
- "CPointer cannot box a native num" );
101
- }
102
-
103
- /* Used with boxing. Gets a floating point value, for representations that can
104
- * hold one. */
105
- static FLOATVAL get_num (PARROT_INTERP , STable * st , void * data ) {
106
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
107
- "CPointer cannot unbox to a native num" );
108
- }
109
-
110
- /* Used with boxing. Sets a string value, for representations that can hold
111
- * one. */
112
- static void set_str (PARROT_INTERP , STable * st , void * data , STRING * value ) {
113
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
114
- "CPointer cannot box a native string" );
115
- }
116
-
117
- /* Used with boxing. Gets a string value, for representations that can hold
118
- * one. */
119
- static STRING * get_str (PARROT_INTERP , STable * st , void * data ) {
120
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
121
- "CPointer cannot unbox to a native string" );
122
- }
123
-
124
- /* Some objects serve primarily as boxes of others, inlining them. This gets
125
- * gets the reference to such things, using the representation ID to distinguish
126
- * them. */
127
- static void * get_boxed_ref (PARROT_INTERP , STable * st , void * data , INTVAL repr_id ) {
128
- Parrot_ex_throw_from_c_args (interp , NULL , EXCEPTION_INVALID_OPERATION ,
129
- "CPointer cannot box other types" );
130
- }
131
-
132
54
/* This Parrot-specific addition to the API is used to free an object. */
133
55
static void gc_free (PARROT_INTERP , PMC * obj ) {
134
56
mem_sys_free (PMC_data (obj ));
@@ -144,11 +66,6 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
144
66
return spec ;
145
67
}
146
68
147
- /* Checks if an attribute has been initialized. */
148
- static INTVAL is_attribute_initialized (PARROT_INTERP , STable * st , void * data , PMC * ClassHandle , STRING * Name , INTVAL Hint ) {
149
- die_no_attrs (interp );
150
- }
151
-
152
69
/* Initializes the CPointer representation. */
153
70
REPROps * CPointer_initialize (PARROT_INTERP ,
154
71
PMC * (* wrap_object_func_ptr ) (PARROT_INTERP , void * obj ),
@@ -163,24 +80,13 @@ REPROps * CPointer_initialize(PARROT_INTERP,
163
80
this_repr -> allocate = allocate ;
164
81
this_repr -> initialize = initialize ;
165
82
this_repr -> copy_to = copy_to ;
166
- this_repr -> get_attribute_boxed = get_attribute_boxed ;
167
- this_repr -> get_attribute_boxed = get_attribute_boxed ;
168
- this_repr -> bind_attribute_boxed = bind_attribute_boxed ;
169
- this_repr -> bind_attribute_ref = bind_attribute_ref ;
170
- this_repr -> hint_for = hint_for ;
171
- this_repr -> set_int = set_int ;
172
- this_repr -> get_int = get_int ;
173
- this_repr -> set_num = set_num ;
174
- this_repr -> get_num = get_num ;
175
- this_repr -> set_str = set_str ;
176
- this_repr -> get_str = get_str ;
177
- this_repr -> get_boxed_ref = get_boxed_ref ;
83
+ this_repr -> attr_funcs = NULL ;
84
+ this_repr -> box_funcs = NULL ;
178
85
this_repr -> gc_mark = NULL ;
179
86
this_repr -> gc_free = gc_free ;
180
87
this_repr -> gc_cleanup = NULL ;
181
88
this_repr -> gc_mark_repr_data = NULL ;
182
89
this_repr -> gc_free_repr_data = NULL ;
183
90
this_repr -> get_storage_spec = get_storage_spec ;
184
- this_repr -> is_attribute_initialized = is_attribute_initialized ;
185
91
return this_repr ;
186
92
}
0 commit comments