[squeak-dev] The Trunk: System-eem.1321.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Mar 10 21:07:24 UTC 2022


Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1321.mcz

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

Name: System-eem.1321
Author: eem
Time: 10 March 2022, 1:07:12.137957 pm
UUID: fa27d2b5-fc11-4619-b94a-fff9d7efef50
Ancestors: System-mt.1320

Add SmalltalkImage>>#interpreterVMMakerVersion. Cache its value in a class variable because we're going to use it in the bytecode compiler for a while.

Refactor the snapshto startup code, pulling all the SmalltalkImage-specific initializxation into its own method, startUpPostSnapshot:, and in this method clear the interpreter version cache VMMakerVersion.

=============== Diff against System-mt.1320 ===============

Item was changed:
  Object subclass: #SmalltalkImage
  	instanceVariableNames: 'globals'
+ 	classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SourceFileVersionString StartUpList StartupStamp VMMakerVersion WordSize'
- 	classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SourceFileVersionString StartUpList StartupStamp WordSize'
  	poolDictionaries: ''
  	category: 'System-Support'!
  
  !SmalltalkImage commentStamp: 'dtl 3/6/2010 14:00' prior: 0!
  I represent the current image and runtime environment, including system organization, the virtual machine, object memory, plugins and source files. My instance variable #globals is a reference to the system dictionary of global variables and class names.
  
  My singleton instance is called Smalltalk.!

Item was added:
+ ----- Method: SmalltalkImage>>interpreterVMMakerVersion (in category 'vm') -----
+ interpreterVMMakerVersion
+ 	"Answer the VMMaker package Monticello commit version number as an Integer,
+ 	 or nil if not found in the interpreterClass string."
+ 	"Smalltalk interpreterVMMakerVersion"
+ 	| stream |
+ 	VMMakerVersion ifNotNil: [^VMMakerVersion].
+ 	stream := self interpreterClass readStream.
+ 	[stream skipTo: $.; atEnd] whileFalse:
+ 		[stream peek isDigit ifTrue:
+ 			[VMMakerVersion := Integer readFrom: stream.
+ 			 VMMakerVersion ~= 0 ifTrue:
+ 				[^VMMakerVersion].
+ 		 "The commit number should be first in the string; ignore any subsequent digit strings"
+ 		 stream setToEnd]].
+ 	^VMMakerVersion := nil!

Item was changed:
  ----- Method: SmalltalkImage>>snapshot:andQuit:withExitCode:embedded: (in category 'snapshot and quit') -----
  snapshot: save andQuit: quit withExitCode: exitCode embedded: embeddedFlag
  	"Mark the changes file and close all files as part of #processShutdownList.
  	If save is true, save the current state of this Smalltalk in the image file.
  	If quit is true, then exit to the outer OS shell.
  	If exitCode is not nil, then use it as exit code.
  	The latter part of this method runs when resuming a previously saved image. This resume logic checks for a document file to process when starting up."
  
  	| resuming msg |
  	Object flushDependents.
  	Object flushEvents.
  
  	(SourceFiles at: 2) ifNotNil:[
  		msg := String streamContents: [ :s |
  			s nextPutAll: '----';
  			nextPutAll: (save ifTrue: [ quit ifTrue: [ 'QUIT' ] ifFalse: [ 'SNAPSHOT' ] ]
  							ifFalse: [quit ifTrue: [ 'QUIT/NOSAVE' ] ifFalse: [ 'NOP' ]]);
  			nextPutAll: '----';
  			print: Date dateAndTimeNow; space;
  			nextPutAll: (FileDirectory default localNameFor: self imageName);
  			nextPutAll: ' priorSource: ';
  			print: LastQuitLogPosition ].
  		self assureStartupStampLogged.
  		save ifTrue: [ LastQuitLogPosition := (SourceFiles at: 2) setToEnd; position ].
  		self logChange: msg.
+ 		Transcript cr; show: msg].
- 		Transcript cr; show: msg
- 	].
  
+ 	self processShutDownList: quit.
- 	Smalltalk processShutDownList: quit.
  	Cursor write show.
  	save ifTrue: [resuming := embeddedFlag 
  					ifTrue: [self snapshotEmbeddedPrimitive] 
  					ifFalse: [self snapshotPrimitive]]  "<-- PC frozen here on image file"
  		ifFalse: [resuming := false].
+ 	(quit and: [resuming == false]) ifTrue:
+ 		[exitCode
- 	quit & (resuming == false) ifTrue: [
- 		exitCode
  			ifNil: [ self quitPrimitive ]
  			ifNotNil: [ self quitPrimitive: exitCode ] ].
  	Cursor normal show.
+ 	self startUpPostSnapshot: resuming == true.
- 	Smalltalk setGCParameters.
- 	resuming == true ifTrue: [Smalltalk clearExternalObjects].
- 	Smalltalk processStartUpList: resuming == true.
- 	resuming == true ifTrue:[
- 		self setPlatformPreferences.
- 		self recordStartupStamp].
  	Project current wakeUpTopWindow.
  	"Now it's time to raise an error"
  	resuming == nil ifTrue: [self error:'Failed to write image file (disk full?)'].
  	^ resuming!

Item was added:
+ ----- Method: SmalltalkImage>>startUpPostSnapshot: (in category 'snapshot and quit') -----
+ startUpPostSnapshot: resuming
+ 	resuming ifTrue:
+ 		[VMMakerVersion := nil.
+ 		 self setGCParameters.
+ 		 self clearExternalObjects].
+ 	self processStartUpList: resuming.
+ 	resuming ifTrue:
+ 		[self setPlatformPreferences.
+ 		 self recordStartupStamp]!



More information about the Squeak-dev mailing list