On Oct 17, 2013, at 7:49 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Now have a look at Opal and help us making better because there are still edge corners and little bugs.
The most important thing to understand is that Opal is not perfect⦠it's just a little bit better than the old compiler. The idea is not perfection (because is does not exist), but to just have some infrastructure that allows us to build on top. (e.g. reviving the old Reflectivity stuff, as one example). For bugs, we have - temps defined in ifTrue: are compiled with the wrong offset in some case (I think when there are other blocks defining a temp with the same name) - Christoph saw some case with problems in to:do: but I have not yet been able to even find an example to re-create the problem - when stepping in the debugger, temp vars are sometimes looked up in the wrong scope. I think this has to do with #stepToSendOrReturn when you are entering a block will run until the first send of the new block, which is too far. For improvements: -> IR instruction should store *range* of the bc offset they generate, as they can generate more than one (this would simplify finding an IR instruction for a pc offset when doing bc->text mapping for the debugger) -> IRIntepreter should be an IRVisitor, clean up the dual visiting/interpreting interface -> Semantic analysis: TempVars should not have index (it is left over from pre-closure times and only used for sorting the variables at the end), Sub=case: Decide which implementation of a sorted dictionary to integrate in Pharo3 Big picture (unlikely to happen) --------------- -> move all optimzations to the IR level (Controll Flow Graph) -> same for some of the analysis related to blocks (e.g. detecting escaping writes in loops should much more beautiful of a CFG than the AST). But then, it works even if is a bit convoluted now. After getting rid of old Compiler ------------------------------------------ -> remove #failBlock: -> compiler should not care about #category, it only compiles. -> all users of RBScanner and RBParser should use the OpalCompiler facade or APIs on CompiledMethod (#ast). (this will allow us to replace the RBParser as we like, e.g. to experiment with PetitParser)