[Vm-dev] VM Maker: CMakeVMMakerSqueak-tty.121.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 29 16:37:24 UTC 2016


Timothy M uploaded a new version of CMakeVMMakerSqueak to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMakerSqueak-tty.121.mcz

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

Name: CMakeVMMakerSqueak-tty.121
Author: tty
Time: 29 May 2016, 11:42:57.940314 am
UUID: e5307b7c-d390-4c55-bb6c-4e21acf240a1
Ancestors: CMakeVMMakerSqueak-tty.120

refactored platformSources to use the method redirect pattern.

Modified existing cog v3 and cog spur configurations to return a subset of source files based on build type.

generated a squeak.cog.spur configuration .

I am running that VM as I type this which is a really cool feeling.

Next up: continue work on Help for creating a new Configuration.  Fix/refactor tests

=============== Diff against CMakeVMMakerSqueak-tty.120 ===============

Item was changed:
  CPlatformConfig subclass: #CPlatformConfigForSqueak
+ 	instanceVariableNames: 'buildType cogDir generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages platformSources vmplugins'
- 	instanceVariableNames: 'buildType cogDir generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages vmplugins'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CMakeVMMakerSqueak'!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!
  
  !CPlatformConfigForSqueak commentStamp: 'tty 12/8/2014 11:28' prior: 0!
  A CPlatformConfigForSqueak acts as a compatability layer for Squeak and an Abstract Base Class for extended functionality required for the Squeak CMakeVMMaker use-case.
  
  I make (very) heavy use of a specific design pattern for configuring myself and remaining compatible with pharo's CMakeVMMaker.
  The entry point for that pattern is my method 'configureForBuildType: aSymbol' . Each method send in there detects my buildType and routes the send
  to the approriate method for that buildType.
  
  Subclasses of me 'must' configure themselves for each build type per that pattern. 
  However this can be very easy by just returning the base configuration.
  
  Tests are written to verify that this support infrastructure is in place.
  
  I have two important methods.
  
  excludeFromBuild and isAbstractBaseClass.
  
  excludeFromBuild 
  		is used to exclude a configuration from being built by a Builder.
  		is used to exclude a configuration from Testing.
  
  isAbstractBaseClass 
  		is used by configurations that exclude themselves from being built by a Builder BUT need to be included in 		Testing.
  
  										
  excludeFromBuild  | isAbstractBaseClass  | should build  | should test
  	T					    T                            NO                  YES
        T					    F                             NO                   NO
        F					    T                            YES                  YES
        F                                 F                            YES                  YES
  
  
  The use-case is as follows.
  
  An abstract base class contains a lot of functionality that must be implemented and tested for the system to work, but it is not meant to be compiled.
  
  concrete classes of that AbstractBase class can exclude themselves from being built by builders and by doing so are not tested.
  However, once a concrete configuration is enabled to be built, it must pass all tests.
  
  Linux32x86Config is an example of an AbstractBase class that must pass all testing, but is not buildable.
  Its subclass Linux32x86SqueakCogV3Config needs testing, but a developer can toggle 'exclude from build' to hide it from Builders or make it available to them.
  
  Tests make the decision on what configurations to test. Here are some examples.
  	(o excludeFromBuild not) & (configuration isAbstractBaseClass not)  this is a concrete [Lang][VM][MemoryManager][etc] configuration that will be built. No platform classes considered
  	(o excludeFromBuild) & (configuration isAbstractBaseClass not)         This is a concrete [Lang][VM][MemoryManager][etc] configuration that will be NOT built.
  	(o excludeFromBuild not) | (configuration isAbstractBaseClass)          concrete implementation may depend on its [OS][VMWordSize][Processor] AbstractBaseClass for platform level methods. 
  																		   example: Linux32x86Config ccBuild has the '-m32' compiler flag that is common to all builds on that platform
  	(o excludeFromBuild not) & (configuration isAbstractBaseClass)       Not allowed. [OS][VMWordSize][Processor] AbstractBaseClasses should not be built. This is a useful test in its own right.
  	(o excludeFromBuild) & (configuration isAbstractBaseClass)             These are the AbstractBaseClasses. An AbstractBaseClass should always be excluded from a build
  
  
  HelpBrowser openOn: CMakeVMMakerSqueakDeveloperHelp
  tty.!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!

Item was changed:
  ----- Method: CPlatformConfigForSqueak>>initialize (in category 'initialize-release') -----
  initialize
  	enabledebugmessages := false.
+ 	self 
+ 		initializePlatformSources;
+ 		initializeVMDrivers;
+ 		customizeVMPlugins.
+ 		!
- 	self initializeVMDrivers.
- 	self customizeVMPlugins!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>initializePlatformSources (in category 'initialize-release') -----
+ initializePlatformSources
+ 	self subclassResponsibility!

Item was changed:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSources: (in category 'cmake buildType redirects') -----
- ----- Method: CPlatformConfigForSqueak>>setPlatformSources: (in category 'cmake') -----
  setPlatformSources: aMaker
- 	|platform |
- 	(enabledebugmessages)
- 		ifTrue:[	templates 
- 		addLast:((CMakeMessage new) message: (self class name) , 'setPlatformSources: aMaker')
- 	].
- 	platform := aMaker append: '${targetPlatform}/vm/' toAll: (self platformSources).
- 	templates
- 		addLast:((CMakeSet new) variable:'platformVMSources' value: platform)
  
+ 	"Route this message send to the message appropriate for my buildType "
+ 	|d |
+ 	d:= SqueakCMakeVMMakerAbstractBuilder default buildTypeAndDirectoryInfo copy.
+ 	d 
+ 		at: #build put: [self setPlatformSourcesBuild: aMaker];
+ 		at: #buildAssert  put: [self setPlatformSourcesBuildAssert: aMaker];
+ 		at: #buildAssertITimerHeartbeat  put: [self setPlatformSourcesBuildAssertITimerHeartbeat: aMaker];
+             at:#buildDebug  put: [self setPlatformSourcesBuildDebug: aMaker];   
+ 		at: #buildDebugITimerHeartbeat  put: [self setPlatformSourcesBuildDebugITimerHeartbeat: aMaker ];
+ 		at: #buildITimerHeartbeat  put: [self setPlatformSourcesBuildITimerHeartbeat: aMaker];
+ 		at: #buildMultiThreaded  put: [self setPlatformSourcesBuildMultiThreaded: aMaker ];
+ 		at: #buildMultiThreadedAssert  put: [self setPlatformSourcesBuildMultiThreadedAssert: aMaker];
+ 		at: #buildMultiThreadedDebug   put: [self setPlatformSourcesBuildMultiThreadedDebug: aMaker ];
+ 		at: #buildNone put:[self setPlatformSourcesNoBuildType: aMaker].
+ 	^(d at: buildType) value
+ !
- 	!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuild: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuild: aMaker
+ 	|sourcefiles |
+ 	"a subclass of mine has presumably set my platformSources instance variable and invoked super"
+ 	(enabledebugmessages)
+ 		ifTrue:[	templates 
+ 		addLast:((CMakeMessage new) message: (self class name) , 'setPlatformSources: aMaker')
+ 	].
+ 
+ 	sourcefiles := aMaker append: '${targetPlatform}/vm/' toAll: (platformSources). 
+ 	templates
+ 		addLast:((CMakeSet new) variable:'platformVMSources' value: sourcefiles)
+ 
+ !

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildAssert: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildAssert: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources:'"
+ 
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildAssertITimerHeartbeat: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildAssertITimerHeartbeat: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources:'"
+ 
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildDebug: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildDebug: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources'"
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildDebugITimerHeartbeat: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildDebugITimerHeartbeat: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources'"
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildITimerHeartbeat: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildITimerHeartbeat: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources'"
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildMultiThreaded: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildMultiThreaded: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources'"
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildMultiThreadedAssert: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildMultiThreadedAssert: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources'"
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesBuildMultiThreadedDebug: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildMultiThreadedDebug: aMaker
+ 	"SystemNavigation default browseMethodsWhoseNamesContain: 'setPlatformSources'"
+ 	^self setPlatformSourcesBuild: aMaker!

Item was added:
+ ----- Method: CPlatformConfigForSqueak>>setPlatformSourcesNoBuildType: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesNoBuildType: aMaker
+ 	"SHOULD NOT GET HERE"
+ 	self shouldNotImplement.!

Item was changed:
  ----- Method: Linux64x86w32BitConfigUsrLib>>coreSourcesBuild (in category 'cmake buildType redirects') -----
  coreSourcesBuild
  	"files to include from src/vm dir"
+ 	self flag:'tty revisit this. This should return a subset of the available files there'.
  	^ #(
  		'cogit.c'
  		'gcc3x-cointerp.c'
  		)!

Item was removed:
- ----- Method: Linux64x86w32BitSqueakCogSpurConfig>>defaultInternalPlugins (in category 'plugins') -----
- defaultInternalPlugins
- 	""
- 	^#()!

Item was added:
+ ----- Method: Linux64x86w32BitSqueakCogSpurConfig>>setPlatformSourcesBuild: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuild:aMaker
+ 	|mysubset iwantonly|
+ 
+ 	"trim the platformSources collection .c files I want.  for  this OS/platform"
+ 	self flag:'tty. go through the Cog svn tree and see exactly what files should be included here. debug.c feels wrong'.
+ 	iwantonly := #(		
+ 	'aio.c'
+ 	'debug.c'	
+ 	'osExports.c'
+ 	'sqUnixCharConv.c'
+ 	'sqUnixExternalPrims.c'
+ 	'sqUnixHeartbeat.c'
+ 	'sqUnixMain.c'
+ 	'sqUnixMemory.c'
+ 	'sqUnixSpurMemory.c'	
+ 	'sqUnixThreads.c'
+ 	'sqUnixVMProfile.c'
+ 	).		
+ 	mysubset := platformSources select: [:c | 0 < (iwantonly occurrencesOf: c)]. 
+ 	platformSources := mysubset.
+ 	super setPlatformSourcesBuild:aMaker!

Item was added:
+ ----- Method: Linux64x86w32BitSqueakCogV3Config>>setPlatformSourcesBuild: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuild:aMaker
+ 	|mysubset iwantonly|
+ 
+ 	"trim the platformSources collection .c files I want.  for  this OS/platform"
+ 	self flag:'tty. go through the Cog svn tree and see exactly what files should be included here.'.
+ 	iwantonly := #(		
+ 	'aio.c'
+ 	'debug.c'	
+ 	'osExports.c'
+ 	'sqUnixCharConv.c'
+ 	'sqUnixExternalPrims.c'
+ 	'sqUnixHeartbeat.c'
+ 	'sqUnixMain.c'
+ 	'sqUnixMemory.c'
+ 	'sqUnixThreads.c'
+ 	'sqUnixVMProfile.c'
+ 	).		
+ 	mysubset := platformSources select: [:c | 0 < (iwantonly occurrencesOf: c)]. 
+ 	platformSources := mysubset.
+ 	super setPlatformSourcesBuild:aMaker!

Item was added:
+ ----- Method: Linux64x86w32BitSqueakCogV3Config>>setPlatformSourcesBuildAssert: (in category 'cmake buildType redirects') -----
+ setPlatformSourcesBuildAssert:aMaker
+ 	|mysubset iwantonly|
+ 
+ 	"trim the platformSources collection .c files I want.  for  this OS/platform"
+ 	self flag:'tty. go through the Cog svn tree and see exactly what files should be included here.'.	
+ 	iwantonly := #(		
+ 	'aio.c'
+ 	'debug.c'	
+ 	'osExports.c'
+ 	'sqUnixCharConv.c'
+ 	'sqUnixExternalPrims.c'
+ 	'sqUnixHeartbeat.c'
+ 	'sqUnixMain.c'
+ 	'sqUnixMemory.c'
+ 	'sqUnixThreads.c'
+ 	'sqUnixVMProfile.c'
+ 	).		
+ 	mysubset := platformSources select: [:c | 0 < (iwantonly occurrencesOf: c)]. 
+ 	platformSources := mysubset.
+ 	super setPlatformSourcesBuild:aMaker!

Item was added:
+ ----- Method: SqueakMacintoshConfig>>initializePlatformSources (in category 'source files') -----
+ initializePlatformSources
+ 	"files added from platform/Mac OS/vm dir 	Your configuration will need a subset of these based on buildType
+ 	SystemNavigation browseAllImplementorsOf: #setPlatformSourcesBuild:
+ 	"
+ 		
+ 	platformSources :=#(
+ 	'NSCursorWrappers.m'
+ 	'nsPoolManagement.m'
+ 	'osExports.c'
+ 	'sqMacEncoding.c'
+ 	'sqMacImageIO.c'
+ 	'sqMacMain.c'
+ 	'sqMacMemory.c'
+ 	'sqMacNSPluginUILogic2.c'
+ 	'sqMacTime.c'
+ 	'sqMacUIAppleEvents.c'
+ 	'sqMacUIClipBoard.c'
+ 	'sqMacUIEventsUniversal.c'  " instead of: sqMacUIEvents.c "
+ 	'sqMacUIMenuBarUniversal.c'
+ 	'sqMacUnixCommandLineInterface.c'
+ 	'sqMacUnixExternalPrims.c'
+ 	'sqMacWindowUniversal.c'
+ 	'version.c'	
+ 	)!

Item was removed:
- ----- Method: SqueakMacintoshConfig>>platformSources (in category 'source files') -----
- platformSources
- 	"files added from platform/Mac OS/vm dir "
- 	^ #(
- 	'NSCursorWrappers.m'
- 	'nsPoolManagement.m'
- 	'osExports.c'
- 	'sqMacEncoding.c'
- 	'sqMacImageIO.c'
- 	'sqMacMain.c'
- 	'sqMacMemory.c'
- 	'sqMacNSPluginUILogic2.c'
- 	'sqMacTime.c'
- 	'sqMacUIAppleEvents.c'
- 	'sqMacUIClipBoard.c'
- 	'sqMacUIEventsUniversal.c'  " instead of: sqMacUIEvents.c "
- 	'sqMacUIMenuBarUniversal.c'
- 	'sqMacUnixCommandLineInterface.c'
- 	'sqMacUnixExternalPrims.c'
- 	'sqMacWindowUniversal.c'
- 	'version.c'	
- 	)!

Item was added:
+ ----- Method: SqueakUnixConfig>>initializePlatformSources (in category 'source files') -----
+ initializePlatformSources
+ "	Your configuration will need a subset of these based on buildType
+ 	SystemNavigation browseAllImplementorsOf: #setPlatformSourcesBuild:
+ 	"
+ 
+ 	platformSources:= #(
+ 	'aio.c'
+ 	'debug.c'
+ 	'dlfcn-dyld.c'
+ 	'mac-alias.c' 
+ 	'osExports.c'
+ 	'sqUnixCharConv.c'
+ 	'sqUnixEvent.c' 
+ 	'sqUnixExternalPrims.c'
+ 	'sqUnixITimerHeartbeat.c'
+ 	'sqUnixITimerTickerHeartbeat.c'
+ 	'sqUnixHeartbeat.c'
+ 	'sqUnixMain.c'
+ 	'sqUnixMemory.c'
+ 	'sqUnixSpurMemory.c'	
+ 	'sqUnixThreads.c'
+ 	'sqUnixVMProfile.c'
+ 	)
+ 
+ 
+ 
+ !

Item was removed:
- ----- Method: SqueakUnixConfig>>platformSources (in category 'source files') -----
- platformSources
- 	"files added from platform/unix/vm dir "
- 	^ #(
- 	'aio.c'
- 	'debug.c'
- 	'osExports.c'
- 	'sqUnixCharConv.c'
- 
- 	'sqUnixExternalPrims.c'
- 	'sqUnixHeartbeat.c'
- 	'sqUnixMain.c'
- 	'sqUnixMemory.c'
- 	'sqUnixSpurMemory.c'	
- 	'sqUnixThreads.c'
- 	'sqUnixVMProfile.c'
- 	)
- 	
- 	"
- 	'dlfcn-dyld.c'
- 	'mac-alias.c' 
- 	'sqUnixEvent.c' 
- 
- 	'sqUnixITimerHeartbeat.c'
- 	'sqUnixITimerTickerHeartbeat.c'
- 
- 	"
- !

Item was added:
+ ----- Method: SqueakWindowsConfig>>initializePlatformSources (in category 'source files') -----
+ initializePlatformSources
+ 	"files from platform/win32/vm dir 
+ 	Your configuration will need a subset of these based on buildType
+ 	SystemNavigation browseAllImplementorsOf: #setPlatformSourcesBuild:
+ 	"
+ 	platformSources:= #(
+ 		'sqWin32Alloc.c'
+ 		'sqWin32Directory.c'
+ 		'sqWin32Heartbeat.c'
+ 		'sqWin32Service.c'
+ 		'sqWin32VMProfile.c'
+ 		'sqWin32Args.c'
+ 		'sqWin32Exports.c'
+ 		'sqWin32Intel.c'
+ 		'sqWin32Stubs.c'
+ 		'sqWin32Window.c'
+ 		'sqWin32Backtrace.c'
+ 		'sqWin32ExternalPrims.c'
+ 		'sqWin32PluginSupport.c'
+ 		'sqWin32Threads.c'
+ 		'version.c'
+ 		'sqWin32DirectInput.c'
+ 		'sqWin32GUID.c'
+ 		'sqWin32Prefs.c'
+ 		'sqWin32Utils.c'
+ 	)!

Item was removed:
- ----- Method: SqueakWindowsConfig>>platformSources (in category 'source files') -----
- platformSources
- 	"files added from platform/win32/vm dir "
- 	^ #(
- 		'sqWin32Alloc.c'
- 		'sqWin32Directory.c'
- 		'sqWin32Heartbeat.c'
- 		'sqWin32Service.c'
- 		'sqWin32VMProfile.c'
- 		'sqWin32Args.c'
- 		'sqWin32Exports.c'
- 		'sqWin32Intel.c'
- 		'sqWin32Stubs.c'
- 		'sqWin32Window.c'
- 		'sqWin32Backtrace.c'
- 		'sqWin32ExternalPrims.c'
- 		'sqWin32PluginSupport.c'
- 		'sqWin32Threads.c'
- 		'version.c'
- 		'sqWin32DirectInput.c'
- 		'sqWin32GUID.c'
- 		'sqWin32Prefs.c'
- 		'sqWin32Utils.c'
- 	)!



More information about the Vm-dev mailing list