+"To build the spurreader or spurreader-64 images used in the examples below run one of buildspurtrunkreaderimage.sh buildspurtrunkreader64image.shThe reader images include a simple REPL loop that reads a chunk-format expression from stdin, evaluates it and writes the printString of the result to stdout. In the simulator you are prompted for input via an input widget and writes output to the Transcript. e.g. try 3+4!. On the Transcript you should seesqueak> 7squeak> " "Run the Cog VM simulator on a Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"[| cos |cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit" ObjectMemory Spur32BitCoMemoryManager "ISA ARMv5" "ISA IA32")."cos initializeThreadSupport."cos desiredNumStackPages: 8. "Speeds up scavenging when simulating. Set to e.g. 64 for something like the real VM."cos openOn: 'spurreader.image'.cos openAsMorph; run]."Run the Stack VM simulator on a Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"[| sis |sis := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur32BitMemoryManager).sis desiredNumStackPages: 8. "Speeds up scavenging when simulating. Set to e.g. 64 for something like the real VM."sis assertValidExecutionPointersAtEachStep: false. "Set this to true to turn on an expensive assert that checks for valid stack, frame pointers etc on each bytecode. Useful when you're adding new bytecodes or exotic execution primitives."sis openOn: 'spurreader.image'.sis openAsMorph; run]."Run the Cog VM simulator on a Cog image (by default the Squeak 4.5 image:). Note the plethora of optional debug features in comments."[| cos proc opts |cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit")."cos initializeThreadSupport."cos desiredNumStackPages: 8.cos openOn: 'Squeak-4.5-All-in-One.app/Contents/Resources/Squeak4.5-13680.image'.false ifTrue: [cos systemAttributes at: 2 put: '-doit'; at: 3 put: 'ShootoutTests runAllToTranscript. Smalltalk quitPrimitive']."cos cogit breakPC: 16r2697.""cos cogit traceStores: true.""cos cogit sendTrace: 6." "trace prims & print""cos cogit singleStep: true.""cos cogit printInstructions: true.""cos linkSends: false.""cos enableCog: false.""cos setBreakSelector: 'standardIOStreamNamed:forWrite:'.""cos cogit setBreakMethod: 16rCE1630.""cos cogit cog: 16rAB0B28 + cos startOfMemory selector: 16r31F280 + cos startOfMemory." "e.g. jit a specific method without simulating"cos openAsMorph; run]."Run the Stack VM simulator on a 64-bit Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"[| sis |sis := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur64BitMemoryManager).sis desiredNumStackPages: 8.sis assertValidExecutionPointersAtEachStep: false. "Set this to true to turn on an expensive assert that checks for valid stack, frame pointers etc on each bytecode. Useful when you're adding new bytecodes or exotic execution primitives."sis openOn: 'spurreader-64.image'.sis openAsMorph; run]."Run the Cog VM simulator on a 64-bit Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"[| cos |cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit" ObjectMemory Spur64BitCoMemoryManager "ISA ARMv5" "ISA IA32")."cos initializeThreadSupport."cos desiredNumStackPages: 8.cos openOn: 'spurreader-64.image'.cos openAsMorph; run]
0 commit comments