Changes between Version 9 and Version 10 of PIRCDevelopment

Show
Ignore:
Timestamp:
08/05/09 18:50:39 (5 years ago)
Author:
kjs
Comment:

some comments on PIRC vs IMCC

Legend:

Unmodified
Added
Removed
Modified
  • PIRCDevelopment

    v9 v10  
    1414}}} 
    1515 
    16 $S12 and $I44 will be mapped to the registers S0 and I0 respectively (yes, you guessed it, it starts allocating from 0). As you would expect, the vanilla register allocator is pretty stupid, but the generated bytecode is not too bad, really. If you want to optimize the register usage (which saves runtime memory), you can activate the register optimizer. The register optimizer is based on a Linear Scan Register allocator. The original algorithm, as described in [http://www.google.ie/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.cs.ucla.edu%2F~palsberg%2Fcourse%2Fcs132%2Flinearscan.pdf&ei=w9F5SvzVDpOqsAa_7tyeBQ&usg=AFQjCNETIxGGy87F9GzLawd4euXEaldcnQ&sig2=Hd7nnjdQrgnOqix-8sx92g this paper], assumes a fixed number of available registers. Since Parrot has a variable number of registers available per subroutine, the algorithm has been changed here and there. 
     16$S12 and $I44 will be mapped to the registers S0 and I0 respectively (yes, you guessed it, it starts allocating from 0). As you would expect, the vanilla register allocator is pretty stupid, but the generated bytecode is not too bad, really. If you want to optimize the register usage (which saves runtime memory), you can activate the register optimizer. The register optimizer is based on a Linear Scan Register allocator. The original algorithm, as described in [http://www.google.ie/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.cs.ucla.edu%2F~palsberg%2Fcourse%2Fcs132%2Flinearscan.pdf&ei=w9F5SvzVDpOqsAa_7tyeBQ&usg=AFQjCNETIxGGy87F9GzLawd4euXEaldcnQ&sig2=Hd7nnjdQrgnOqix-8sx92g this paper], assumes a fixed number of available registers. Since Parrot has a variable number of registers available per subroutine, the algorithm has been changed here and there. See the file compilers/pirc/src/pirregalloc.c for the implementation. 
     17 
     18= PIRC vs IMCC = 
     19 
     20While PIRC is an implementation of the PIR language which is specified in PDD19, there are some subtle differences with the current implementation, IMCC.  
     21 
     22 * "nested" heredocs, can be handled by PIRC, not by IMCC. Yes, it was very painful to implement which is why IMCC doesn't. 
     23 
     24 * comments or whitespace in the parameter lists are accepted by PIRC, but not by IMCC. It sounds like an easy fix, but it isn't. Hence, PIRC! 
     25 
     26 * reentrant: PIRC is, IMCC is not.  
     27 
     28 * checks for improper use syntactic sugar with OUT arguments, such as "$S0 = print". PIRC checks for this, IMCC doesn't. Again, it sounds (and looks) like an easy fix, but it isn't. 
    1729  
    1830= Building and running PIRC =