Ticket #487: replace-vtable-method-stage1.patch

File replace-vtable-method-stage1.patch, 6.5 KB (added by Aninhumer, 5 years ago)

Changed patch to be from parrot/ root, added some other fixes I'd missed

  • docs/book/draft/ch07_dynpmcs.pod

     
    195195=head3 VTABLE Functions Parameters 
    196196 
    197197VTABLE functions are defined just like ordinary C functions, almost. Here's 
    198 a normal definition for a VTABLE method: 
     198a normal definition for a VTABLE function: 
    199199 
    200200  VTABLE VTABLENAME (PARAMETERS) { 
    201201    /* ordinary C here, almost */ 
  • docs/book/draft/chXX_hlls.pod

     
    211211 
    212212=over 4 
    213213 
    214 =item * VTable methods 
     214=item * VTable functions 
    215215 
    216 VTable methods are the standard interface for PMC data types, and all PMCs 
     216VTable functions are the standard interface for PMC data types, and all PMCs 
    217217have them. If the PMCs were written properly to satisfy this interface 
    218218all the necessary information from those PMCs. Operate on the PMCs at the 
    219219VTable level, and we can safely ignore the implementation details of them. 
  • docs/pmc/documentation.pod

     
    3636 F<docs/pdds/pdd21_namespaces.pod>. 
    3737 
    3838 Exporter is not derived from any other PMC, and does not provide any 
    39  standard interface--its interface consists solely of non-vtable methods. 
     39 standard interface--its interface consists solely of methods. 
    4040 
    4141The B<DESCRIPTION> section is further broken down as follows: 
    4242 
  • src/pmc/exporter.pmc

     
    4949F<docs/pdds/pdd21_namespaces.pod>. 
    5050 
    5151Exporter is not derived from any other PMC, and does not provide any 
    52 vtable interface--its interface consists solely of non-vtable methods. 
     52vtable interface--its interface consists solely of methods. 
    5353 
    5454=head2 Structure 
    5555 
  • docs/pdds/draft/pdd06_pasm.pod

     
    172172where register_type is 0x100, 0x200, 0x400, or 0x800 for PMC, string, integer, 
    173173or number respectively. So N19 would be 0x413. 
    174174 
    175 B<Note>: Instructions tagged with a * will call a vtable method to handle the 
    176 instruction if used on PMC registers. 
     175B<Note>: Instructions tagged with a * will call a vtable function to handle 
     176the instruction if used on PMC registers. 
    177177 
    178178In all cases, the letters x, y, and z refer to register numbers. The letter t 
    179179refers to a generic register (P, S, I, or N). A lowercase p, s, i, or n means 
     
    244244 
    245245    $foo = $bar; 
    246246 
    247 X's assign vtable method is invoked and it does whatever is appropriate. 
     247X's assign vtable function is invoked and it does whatever is appropriate. 
    248248 
    249249=item clone Px, Py 
    250250 
  • docs/pdds/draft/pdd10_embedding.pod

     
    7474 
    7575=back 
    7676 
    77 =item * probably includes vtable methods on PMCs 
     77=item * probably includes vtable functions on PMCs 
    7878 
    7979=back 
    8080 
  • docs/pdds/pdd09_gc.pod

     
    421421=item C<void (*finalize_gc_system) (Interp *)> 
    422422 
    423423Called during interpreter destruction. Free used resources and memory pools. 
    424 All PMCs must be swept, and PMCs with custom destroy VTABLE methods must have 
    425 those called. 
     424All PMCs must be swept, and PMCs with custom destroy VTABLE functions must 
     425have those called. 
    426426 
    427427=item C<void (*init_pool) (Interp *, Fixed_Size_Pool *)> 
    428428 
     
    563563The C<mark> vtable slot will be called during the GC mark phase. The mark 
    564564function must call C<Parrot_gc_mark_PObj_alive> for all non-NULL objects 
    565565(Buffers and PMCs) that PMC refers to. This flag is typically tested and the 
    566 custom mark VTABLE method called from C<src/gc/api.c:mark_special>. 
     566custom mark VTABLE function called from C<src/gc/api.c:mark_special>. 
    567567 
    568568=item PObj_external_FLAG 
    569569 
  • docs/dev/infant.pod

     
    142142 + Fast mark phase (GC already manipulates the flags) 
    143143 - Generation count must be maintained 
    144144 - Disallows recursive opcode calls (necessary for eg implementing 
    145    vtable methods in pasm) 
     145   vtable functions in pasm) 
    146146 - Can temporarily use more memory (dead objects accumulate during the 
    147147   current generation) 
    148148 
    149149In order to allow recursive opcode calls, we could increment the generation 
    150150count in more places and make sure nothing is left unanchored at those points, 
    151151but that would gradually remove all advantages of this scheme and make it more 
    152 difficult to call existing vtable methods (since you never know when they might 
    153 start running pasm code.) 
     152difficult to call existing vtable functions (since you never know when they 
     153might start running pasm code.) 
    154154 
    155155=head2 Variant 5: generation stack 
    156156 
  • docs/pdds/pdd17_pmc.pod

     
    16361636 
    16371637Note that assigning to the reference PMC will be equivalent to a keyed set on 
    16381638the referenced aggregate PMC - that is, it modifies the element rather than 
    1639 doing a v-table call on the element itself. It is important to be aware of 
     1639doing a vtable call on the element itself. It is important to be aware of 
    16401640this when assigning a PMC through this reference; it is not the same behaviour 
    16411641as the Ref PMC. 
    16421642 
     
    16491649A weak register reference can only be created by the C<register_ref> opcode. 
    16501650Any assignment to the register will behave like a set instruction. That is, 
    16511651when assigning a PMC using a WeakRegisterRef PMC, the register will be updated 
    1652 to reference that PMC rather than calling the assign v-table call on the PMC 
     1652to reference that PMC rather than calling the assign vtable call on the PMC 
    16531653in that register. This is not the same behaviour as the Ref PMC. 
    16541654 
    16551655=item Exception