VM Maker: VMMaker.oscog-eem.2027.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.2027.mcz

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

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

Name: VMMaker.oscog-eem.2027
Author: eem
Time: 6 December 2016, 1:44:30.689018 pm
UUID: e23772e4-15c7-4549-aab8-b4d28043c460
Ancestors: VMMaker.oscog-eem.2026

Add temp names to simStack printing during in-image compilation.

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

Item was changed:
  ----- Method: Cogit class>>cog:selectorOrNumCopied:options: (in category 'in-image compilation') -----
  cog: aCompiledMethod selectorOrNumCopied: selectorOrNumCopied options: optionsDictionaryOrArray
  "StackToRegisterMappingCogit cog: (Integer >> #benchFib) selector: #benchFib options: #(COGMTVM false)"
  | cogit coInterpreter |
  cogit := self instanceForTests: optionsDictionaryOrArray.
+ (aCompiledMethod respondsTo: #tempNames) ifTrue:
+ [initializationOptions at: #tempNames put: aCompiledMethod tempNames].
  coInterpreter := CurrentImageCoInterpreterFacade forCogit: cogit.
  [cogit
  setInterpreter: coInterpreter;
  singleStep: true;
  initializeCodeZoneFrom: 1024 upTo: coInterpreter memory size / 2. "leave space for rump C stack"
  cogit methodZone freeStart: (cogit methodZone freeStart roundUpTo: 1024)]
  on: Notification
  do: [:ex|
  (ex messageText beginsWith: 'cannot find receiver for') ifTrue:
  [ex resume: coInterpreter].
  ex pass].
  ^{ coInterpreter.
  cogit.
  selectorOrNumCopied isInteger
  ifTrue: [ cogit cogFullBlockMethod: (coInterpreter oopForObject: aCompiledMethod) numCopied: selectorOrNumCopied ]
  ifFalse: [ cogit cog: (coInterpreter oopForObject: aCompiledMethod) selector: (coInterpreter oopForObject: selectorOrNumCopied) ] }!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>printSimStack:toDepth:spillBase:on: (in category 'simulation only') -----
  printSimStack: aSimStack toDepth: limit spillBase: spillBase on: aStream
  <doNotGenerate>
+ | tempNamesOrNil width tabWidth |
  aStream ensureCr.
  limit < 0 ifTrue:
  [^aStream nextPutAll: 'simStackEmpty'; cr; flush].
+ inBlock ~~ true ifTrue:
+ [(tempNamesOrNil := self class initializationOptions at: #tempNames ifAbsent: [#()]) isEmpty ifFalse:
+ [| tab longest |
+ longest := tempNamesOrNil inject: '' into: [:m :t| m size >= t size ifTrue: [m] ifFalse: [t]].
+ tabWidth := self widthInDefaultFontOf: (tab := String with: Character tab).
+ width := self widthInDefaultFontOf: longest, tab.
+ width <= ((self widthInDefaultFontOf: longest, (String with: Character space)) + 4) ifTrue:
+ [width := width + tabWidth]]].
  0 to: limit do:
  [:i|
+ tempNamesOrNil ifNotNil:
+ [self put: (tempNamesOrNil at: i + 1 ifAbsent: ['']) paddedTo: width tabWidth: tabWidth on: aStream].
  aStream print: i.
  i = spillBase
  ifTrue: [aStream nextPutAll: ' sb'; tab]
  ifFalse: [aStream tab; tab].
  (aSimStack at: i) printStateOn: aStream.
  aStream cr; flush]!

Item was added:
+ ----- Method: StackToRegisterMappingCogit>>put:paddedTo:tabWidth:on: (in category 'simulation only') -----
+ put: aString paddedTo: compositionWidth tabWidth: tabWidth on: aStream
+ <doNotGenerate>
+ | fittedString size width |
+ fittedString := aString.
+ size := fittedString size.
+ [(width := self widthInDefaultFontOf: fittedString) > compositionWidth] whileTrue:
+ [size := size - 2.
+ fittedString := aString contractTo: size].
+ aStream
+ nextPutAll: fittedString;
+ tab: compositionWidth - width + (width \\ tabWidth) // tabWidth!

Item was added:
+ ----- Method: StackToRegisterMappingCogit>>widthInDefaultFontOf: (in category 'simulation only') -----
+ widthInDefaultFontOf: aString
+ <doNotGenerate>
+ ^(NewParagraph new
+ compose: aString asText
+ style: TextStyle default
+ from: 1
+ in: Display boundingBox;
+ adjustRightX)
+ extent x!