From 0b30dfc7d0b2debb9b6188522df901575d5a9457 Mon Sep 17 00:00:00 2001 From: Leo Arias Date: Mon, 10 Sep 2018 13:06:09 -0600 Subject: [PATCH] Clarify a little the function hoister optimization --- libjulia/optimiser/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libjulia/optimiser/README.md b/libjulia/optimiser/README.md index b26da0c78..877f82559 100644 --- a/libjulia/optimiser/README.md +++ b/libjulia/optimiser/README.md @@ -24,9 +24,9 @@ a new identifier needs to be introduced, a new unique name is generated. ## Function Hoister -The function hoister moves all function definitions to the topmost block. This is +The function hoister moves all function definitions to the end of the topmost block. This is a semantically equivalent transformation as long as it is performed after the -disambiguation stage. The reason is that moving a definition upwards cannot decrease +disambiguation stage. The reason is that moving a definition to a higher-level block cannot decrease its visibility and it is impossible to reference variables defined in a different function. The benefit of this stage is that function definitions can be looked up more easily.