The Trunk: Compiler-eem.366.mcz

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

The Trunk: Compiler-eem.366.mcz

Eliot Miranda uploaded a new version of Compiler to project The Trunk:

==================== Summary ====================

Name: Compiler-eem.366
Author: eem
Time: 5 January 2018, 9:08:19.867232 pm
UUID: d8b9de6b-6688-4293-b66e-e5e1ec50e4fb
Ancestors: Compiler-eem.365

reindexingLiteralsDo: doesn't need to key by the same keys used in the literal sets; they can simply use the nodes themselves.  This fixes the ambiguity between symbols used as selectors and symbols used as literal symbols, and fixes the missing literal problem addressed by Compiler-eem.365.

=============== Diff against Compiler-eem.365 ===============

Item was changed:
  ----- Method: BytecodeEncoder>>reindexingLiteralsDo: (in category 'code generation') -----
  reindexingLiteralsDo: aBlock
+ | savedNodes saveBlock |
+ savedNodes := IdentityDictionary new.
+ saveBlock := [:node| savedNodes at: node put: node shallowCopy].
+ litSet do: saveBlock.
+ litIndSet do: saveBlock.
+ selectorSet do: saveBlock.
- | savedLiterals saveBlock |
- savedLiterals := PluggableDictionary new equalBlock: litSet equalBlock.
- saveBlock := [:assoc| savedLiterals at: assoc key put: assoc value shallowCopy].
- litSet associationsDo: saveBlock.
- litIndSet associationsDo: saveBlock.
- selectorSet associationsDo: saveBlock.
  ^aBlock ensure:
  [| restoreBlock |
+ restoreBlock := [:node| node resetFromCopy: (savedNodes at: node)].
+ litSet do: restoreBlock.
+ litIndSet do: restoreBlock.
+ selectorSet do: restoreBlock]!
- restoreBlock := [:assoc| assoc value resetFromCopy: (savedLiterals at: assoc key ifAbsent: [assoc value])].
- litSet associationsDo: restoreBlock.
- litIndSet associationsDo: restoreBlock.
- selectorSet associationsDo: restoreBlock]!