[Vm-dev] VM Maker: VMMaker.oscog-eem.2429.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Aug 13 23:14:20 UTC 2018


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

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

Name: VMMaker.oscog-eem.2429
Author: eem
Time: 13 August 2018, 4:13:58.493394 pm
UUID: ca51a594-525f-41d4-aee6-b30e8009415b
Ancestors: VMMaker.oscog-eem.2428

Oops; there were two...

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

Item was changed:
  ----- Method: InterpreterSimulator>>openOn:extraMemory: (in category 'initialization') -----
  openOn: fileName extraMemory: extraBytes
  	"InterpreterSimulator new openOn: 'clone.im' extraMemory: 100000"
  
  	| f version headerSize count oldBaseAddr bytesToShift swapBytes |
  	"open image file and read the header"
  
  	["begin ensure block..."
  	f := FileStream readOnlyFileNamed: fileName.
  	imageName := f fullName.
  	f binary.
  	version := self nextLongFrom: f.  "current version: 16r1968 (=6504) vive la revolucion!!"
  	(self readableFormat: version)
  		ifTrue: [swapBytes := false]
  		ifFalse: [(version := self byteSwapped: version) = self imageFormatVersion
  					ifTrue: [swapBytes := true]
  					ifFalse: [self error: 'incomaptible image format']].
  	headerSize := self nextLongFrom: f swap: swapBytes.
  	self setEndOfMemory: (self nextLongFrom: f swap: swapBytes).  "first unused location in heap"
  	oldBaseAddr := self nextLongFrom: f swap: swapBytes.  "object memory base address of image"
  	specialObjectsOop := self nextLongFrom: f swap: swapBytes.
  	lastHash := self nextLongFrom: f swap: swapBytes.  "Should be loaded from, and saved to the image header"
  	lastHash = 0 ifTrue: [lastHash := 999].
  
  	savedWindowSize	:= self nextLongFrom: f swap: swapBytes.
  	fullScreenFlag		:= self nextLongFrom: f swap: swapBytes.
  	extraVMMemory		:= self nextLongFrom: f swap: swapBytes.
  
  	"allocate interpreter memory"
  	self setMemoryLimit: endOfMemory + extraBytes.
  
  	"read in the image in bulk, then swap the bytes if necessary"
  	f position: headerSize.
  	memory := Bitmap new: memoryLimit // 4.
  	count := f readInto: memory startingAt: 1 count: endOfMemory // 4.
  	count ~= (endOfMemory // 4) ifTrue: [self halt].
  	]
  		ensure: [f close].
  
  	swapBytes ifTrue:
  		[UIManager default
  			informUser: 'Swapping bytes of foreign image...'
  			during: [self reverseBytesInImage]].
  
  	self initialize.
  	bytesToShift := self startOfMemory - oldBaseAddr.  "adjust pointers for zero base address"
+ 	UIManager default
+ 		informUser: 'Relocating object pointers...'
+ 		during: [self initializeInterpreter: bytesToShift]!
- 	Utilities informUser: 'Relocating object pointers...'
- 				during: [self initializeInterpreter: bytesToShift].
- !



More information about the Vm-dev mailing list