Merge: nitvm: Basic blocks generation and SSA-algorithm
authorJean Privat <jean@pryen.org>
Wed, 10 Jun 2015 01:46:34 +0000 (21:46 -0400)
committerJean Privat <jean@pryen.org>
Wed, 10 Jun 2015 01:46:34 +0000 (21:46 -0400)
commitbc11b95d9ae150f1ffa4a41b8ef6c91d6e2f73bb
tree77f9c2b950a448114b20aeea5d9365b13306d9a8
parente923941572d448841a26f4438c21253466657477
parent916661a0518bd852ee4f56e998973ffdb1b53312
Merge: nitvm: Basic blocks generation and SSA-algorithm

This PR introduces a SSA-algorithm implementation in the nitvm.

First, basic blocks are generated. A basic block is a sequence of instructions without a jump inside.
In this version, basic blocks are generated from the AST and so they contain only the first instruction and the last one.

Then, SSA-algorithm (Single-Static Assignment) is implemented. In SSA algorithm, variables are renamed to have only one assignment per variable.
Each time an assignment is made, a new version of a variable is made.

Some variables (phi-functions) have several assignment and so, several dependances.

The basic block generation and SSA are computed for each method in a lazy way in the nitvm.
The main objective of SSA is to give the dependances for each variable (this will be used in further PR).
This module also collect all object-mechanisms sites during the visit of methods.

Pull-Request: #1425
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
src/semantize/scope.nit
src/semantize/typing.nit