From: Jean Privat Date: Wed, 10 Jun 2015 01:46:34 +0000 (-0400) Subject: Merge: nitvm: Basic blocks generation and SSA-algorithm X-Git-Tag: v0.7.6~55 X-Git-Url: http://nitlanguage.org 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 Reviewed-by: Jean Privat Reviewed-by: Alexandre Terrasa --- bc11b95d9ae150f1ffa4a41b8ef6c91d6e2f73bb diff --cc src/semantize/scope.nit index a69c57a,34fa640..4106660 --- a/src/semantize/scope.nit +++ b/src/semantize/scope.nit @@@ -429,17 -429,9 +429,17 @@@ redef class AWithExp end end +redef class AAssertExpr + redef fun accept_scope_visitor(v) + do + v.enter_visit(n_expr) + v.enter_visit_block(n_else, null) + end +end + redef class AVarFormExpr # The associated variable - var variable: nullable Variable + var variable: nullable Variable is writable end redef class ACallFormExpr