VM Maker: VMMaker.oscog-eem.2838.mcz

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

VM Maker: VMMaker.oscog-eem.2838.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2838.mcz

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

Name: VMMaker.oscog-eem.2838
Author: eem
Time: 8 October 2020, 5:52:53.321836 pm
UUID: 0289dd2b-8f24-49bc-9361-4a38d4993acd
Ancestors: VMMaker.oscog-eem.2837

Make in-ime compilation smart enough to choose the bytecode set for the chosen VM when given a string to compile.  Also make it robust enough to deal with omissions in the clusteredVariableNames in facades that don't implement certain selevtors (specialObjectsArrayAddress in other than Spur64).

=============== Diff against VMMaker.oscog-eem.2837 ===============

Item was added:
+ ----- Method: Cogit class>>compileMethodSource:options: (in category 'in-image compilation support') -----
+ compileMethodSource: source options: optionsArray
+ "The key thing here is to work out what bytecode set to use for the options..."
+ | encoderClass encoderClassName methodNode |
+ StackInterpreter initializeWithOptions: (self asOptionsDictionary: optionsArray).
+ encoderClassName := StackInterpreter classPool at: #BytecodeEncoderClassName.
+ (encoderClass := Smalltalk classNamed: encoderClassName) ifNil:
+ [self error: 'no available compiler backend for this bytecode set'].
+ methodNode := Parser new
+ encoderClass: encoderClass;
+ parse: '| temp | temp class' class: nil class noPattern: true notifying: nil ifFail: [self error: 'bad doit'].
+ ^methodNode generate!

Item was changed:
  ----- Method: Cogit class>>genAndDis:options: (in category 'in-image compilation') -----
  genAndDis: methodOrDoitString options: optionsDictionaryOrArray
  | tuple |
  methodOrDoitString isCompiledCode ifFalse:
  [^self
+ genAndDis: (self compileMethodSource: methodOrDoitString options: optionsDictionaryOrArray)
- genAndDis: (Compiler new
- compiledMethodFor: methodOrDoitString
- in: nil
- to: nil
- notifying: nil
- ifFail: nil
- logged: false)
  options: optionsDictionaryOrArray].
  tuple := self cog: methodOrDoitString
  selectorOrNumCopied: (methodOrDoitString isCompiledBlock
  ifTrue: [methodOrDoitString numCopiedValues]
  ifFalse: [methodOrDoitString selector])
  options: optionsDictionaryOrArray.
  tuple second disassembleMethod: tuple last.
  ^tuple!

Item was changed:
  ----- Method: CurrentImageCoInterpreterFacade>>cogit: (in category 'initialize-release') -----
  cogit: aCogit
  | accessors |
  cogit := aCogit.
  cogit objectMemory ifNil:
  [cogit instVarNamed: 'objectMemory' put: objectMemory].
  coInterpreter cogit: aCogit.
  (objectMemory respondsTo: #cogit:) ifTrue:
  [objectMemory cogit: aCogit].
  (objectMemory respondsTo: #coInterpreter:) ifTrue:
  [objectMemory coInterpreter: coInterpreter].
  coInterpreter setUpForUseByFacade: self.
  objectMemory setUpForUseByFacade: self.
  accessors := CurrentImageCoInterpreterFacade organization listAtCategoryNamed: #accessing.
  coInterpreter class clusteredVariableNames do:
  [:var|
  (Symbol lookup: (var first = $C ifTrue: ['c', var allButFirst] ifFalse: [var]), 'Address') ifNotNil:
  [:accessor|
  (accessors includes: accessor) ifTrue:
+ [[self perform: accessor]
+ on: SubclassResponsibility
+ do: [:ex| ex return]]]].
- [self perform: accessor]]].
  self initializeObjectMap!