Version 4 (modified by whiteknight, 13 years ago) |
---|
Intro
The PMC Union is being deprecated, which means that any instances of PMC_int_val, etc need to disappear. This is a big job with several gotchas.
What Needs to Happen
Allison explained in depth how to convert code.
Many uses of PMC_x_val are outside of the core PMC code. These should be converted to VTABLE functions wherever possible, since VTABLE functions make no assumptions about PMC internals.
Inheritance
Because the PMC union struct is part of a PMC's internals, its use is affected by PMC inheritance. The following image shows the dependencies between all *core* PMCs. This does not include PMCs from HLLs. Because of these dependencies, all PMCs in a given dependency tree will have to be updated simultaneously. This only means that all instances of e.g. PMC_struct_val will have to be updated, not all instances of all PMC_x_val.
Notes
*Array PMCs need to have their mark VTABLE methods updated to actually mark the elements inside them. src/gc/mark_sweep.c:Parrot_gc_trace_pmc_data() attempts to do this by mucking around with PMC_data_typed(). Once the mark VTABLE methods are updated to do The Right Thing, Parrot_gc_trace_pmc_data() can be deprecated along with the PObj_data_is_PMC_array_FLAG. All arrays should instead be marked with PObj_custom_mark_FLAG to call the proper mark VTABLE methods.
Attachments
- pmc_deps.png (184.7 KB) - added by jimmy 13 years ago.
-
pobj_h_unionval_tracking.diff
(2.3 KB) - added by cotto
13 years ago.
patch to parrot used to generate attached files
-
pmc_unionval_file.log
(76.4 KB) - added by cotto
13 years ago.
PMC_x_val uses, sorted by source file
-
pmc_unionval_pmc.log
(76.4 KB) - added by cotto
13 years ago.
PMC_x_val uses, sorted by PMC
-
pmc_unionval_pmc.2.log
(68.4 KB) - added by cotto
13 years ago.
list of PMC_x_val instances, sorted by PMC and grouped by interdepenence