diff --git a/src/OpalCompiler-Core/OCTempVariable.class.st b/src/OpalCompiler-Core/OCTempVariable.class.st index 5e7a49be2b7..155552a874d 100644 --- a/src/OpalCompiler-Core/OCTempVariable.class.st +++ b/src/OpalCompiler-Core/OCTempVariable.class.st @@ -1,5 +1,5 @@ " -I model temp variables. With Closures, there are two kinds: Copying and those that are stores in a so called temp vector, a heap allocated array that itself is stored in a copying temp variable. +I model temp variables. With Closures, there are two kinds: Copying and those that are stored in a so called temp vector, a heap allocated array that itself is stored in a copying temp variable. " Class { #name : #OCTempVariable, diff --git a/src/OpalCompiler-Core/OCVectorTempVariable.class.st b/src/OpalCompiler-Core/OCVectorTempVariable.class.st index 3094b6969b4..b4ed4483054 100644 --- a/src/OpalCompiler-Core/OCVectorTempVariable.class.st +++ b/src/OpalCompiler-Core/OCVectorTempVariable.class.st @@ -1,8 +1,7 @@ " I model a temp variable that is stored in a temp vector. -My index variable has the index where I am stored in the temp vector (filled in lazily if requested, the index -is determined by the bytecode backend and thus the result of the compilation) +My ""index"" variable has the index where I am stored in the temp vector (filled in lazily if requested, the index is determined by the bytecode backend and thus the result of the compilation) The temp vector itself is stored in a copied var (you can get it's name by sending #vectorName) @@ -10,7 +9,7 @@ reading and writing thus is a multi step process: 1) get the semamtic variable that stores the temp vector by name 2) get the offset in the temp vector from it (cached in ""index"") -3) the temp vector semantic var know how to read / write the vector (which is an array) +3) the temp vector semantic var knows how to read / write the vector (which is an array) 4) use the index to access this array " Class { @@ -57,10 +56,10 @@ OCVectorTempVariable >> readVectorFromContext: aContext scope: contextScope [ | tempVectorVar theVector | tempVectorVar := contextScope lookupVar: vectorName. theVector := tempVectorVar readFromLocalContext: aContext. - index := index ifNil: [ index := tempVectorVar indexInTempVectorFromIR: name ]. + index := index ifNil: [ tempVectorVar indexInTempVectorFromIR: name ]. "If we don't find the temp vector (because it was nilled or not created), we - lookup in the outer context with the corresponding outer scope" + lookup in the outer context with the corresponding outer scope" ^ theVector ifNil: [ self readVectorFromContext: aContext outerContext scope: contextScope outerScope ] ]