Deprecations for 3.0
Andrew Whitworth
wknight8111 at gmail.com
Fri Sep 17 21:14:06 UTC 2010
Those macros, SET_PMC_REF and SET_STRING_REF work well for me. We need
to think carefully about how we want to add these things, however,
considering that our GC systems are (in theory anyway) selectable. If
every single one of these becomes an indirect function call, we could
end up eating a lot of performance.
--Andrew Whitworth
On Fri, Sep 17, 2010 at 3:55 PM, Nick Wellnhofer <wellnhofer at aevum.de> wrote:
> On 17/09/10 19:34, Peter Lobsinger wrote:
>>
>> I think we need both a deprecation notice and stub implementations of
>> these macros by 2.9. Being able to assign simply by using 'x = y' is
>> pretty much taken for granted, and we'll be braking that assumption.
>
> Yes, we should start with a stub implementation as soon as possible. Even if
> we don't get the interface right in the first try, we could at least begin
> to mark the relevant places in the code.
>
> Generally, we will start with code like this:
>
> PMC *self;
> PMC *pmc_ref, *pmc_new;
> STRING *string_ref, *string_new;
>
> pmc_ref = pmc_new;
> string_ref = string_new;
>
> pmc_ref is a PMC pointer that belongs to PMC "self". pmc_new is the new
> value that is assigned to that pointer. For instance, in parrot_hash_put,
> pmc_ref can be the value pointer of a hash bucket, and pmc_new the new value
> that is assigned.
>
> The same for strings. Then we have to replace the assignment with a macro
> like:
>
> SET_PMC_REF(interp, self, pmc_ref, pmc_new);
> SET_STRING_REF(interp, self, string_ref, string_new);
>
> The naming is just a suggestion.
>
> Implementing this with stubs should also allow us to find out if we need
> further adjustments. (Thinking more about the hash example, it turns out
> that we also have to pass the "self" PMC to parrot_hash_put. Or let the
> caller of parrot_hash_put do the final assignment.)
>
> For the curious, a final implementation of SET_PMC_REF with a card marking
> scheme might look like this:
>
> #define SET_PMC_REF(interp, self, pmc_ref, pmc_new) \
> do { \
> pmc_ref = pmc_new; \
> if (PObj_young_generation_TEST(pmc_new)) \
> interp->card_table[(size_t)self >> SHIFT] = 1; \
> } while(0)
>
> Nick
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev
>
More information about the parrot-dev
mailing list