Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Simplify TempVector Offset from IR #4857
The idea behind this change: #indexInTempVectorFromIR: was always asking the method scope. This means that # tempVectorNamed: there was implemented to search the whole IR tree for the temp vector.
Now we instead get first the definition scope of the vector (using #tempVectorDefinitionScopeForTempStoringIt) and then ask that scope, There we can be 100% sure that a temp vector is defined in the IR sequence.
This in turn then allows us to radically simplify tempVectorNamed: to just call it on the sequence.
Lots of checking code can be removed (e.g. hasTempVector:, #blockHasTempVector: and so on).
The step after this is to simplify tempVectorDefinitionScopeForTempStoringIt, for that we have issue #4843
(instead of calling #tempVectorDefinitionScopeForTempStoringIt we then can just do "originalVar scope")