Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.401.mcz==================== Summary ====================
Name: Cog-eem.401
Author: eem
Time: 19 February 2020, 7:19:47.525313 pm
UUID: 512404f9-503e-4d75-bda6-cd8f517b7f4e
Ancestors: Cog-eem.400
Merge with Cog-bgs.374
Factor #createNewCPU into its own method.
This facilitates switching between simulator implementations.
Having monolithic #new had the following two problems: (1) even if implementationClass pointed to something different, it was still creating an actual C struct corresponding to the original class; (2) it insisted that the implementationClass implement #atAddress: which is internal business of the implementation class.
=============== Diff against Cog-eem.400 ===============
Item was added:
+ ----- Method: CogProcessorAlien class>>createNewCPU (in category 'instance creation') -----
+ createNewCPU
+ ^self atAddress: self primitiveNewCPU
+ "Factoring this to its own method is done to be able to switch
+ between different implementations of the simulator such as
+ Alien, Petrich-1 GEM5-over-RSP or Petrich-2 symbolic execution."!
Item was changed:
----- Method: CogProcessorAlien class>>new (in category 'instance creation') -----
new
| sim |
+ sim := self implementationClass createNewCPU.
- sim := self implementationClass atAddress: self primitiveNewCPU.
sim reset.
SavedState at: sim put: nil.
^sim!