[Vm-dev] [commit][3671] Make the relevant workspaces in the VMMaker image syntax highlighted.

commits at squeakvm.org commits at squeakvm.org
Sat Apr 9 00:17:19 UTC 2016


Revision: 3671
Author:   eliot
Date:     2016-04-08 17:17:14 -0700 (Fri, 08 Apr 2016)
Log Message:
-----------
Make the relevant workspaces in the VMMaker image syntax highlighted.
Nuke an obsolete workspace.
Add a script to create an image containing FullBlockCLosure and MethodMassage
for working on Sista block support.

Modified Paths:
--------------
    branches/Cog/image/BuildSqueakSpurTrunkVMMakerImage.st
    branches/Cog/image/In-image Compilation Workspace.text
    branches/Cog/image/Slang Test Workspace.text
    branches/Cog/image/VM Simulation Workspace.text

Added Paths:
-----------
    branches/Cog/image/LoadSistaSupport.st
    branches/Cog/image/buildsistareaderimage.sh

Removed Paths:
-------------
    branches/Cog/image/Workspace2.text

Modified: branches/Cog/image/BuildSqueakSpurTrunkVMMakerImage.st
===================================================================
--- branches/Cog/image/BuildSqueakSpurTrunkVMMakerImage.st	2016-04-08 17:20:32 UTC (rev 3670)
+++ branches/Cog/image/BuildSqueakSpurTrunkVMMakerImage.st	2016-04-09 00:17:14 UTC (rev 3671)
@@ -1,80 +1,86 @@
-| manifest load |
-manifest := #(	('http://source.squeak.org/FFI'					1	('FFI-Pools' 'FFI-Kernel'))
-				('http://source.squeak.org/VMMaker'				6	('Balloon-Engine-Pools' 'BytecodeSets.spur' 'VMMaker.oscog' 'CogCompatibility' 'Cog' 'CogTools' 'ImageFormat'))
-				('http://ss3.gemstone.com/ss/MethodMassage'		3	('MethodMassage' 'MethodMassageCompatibility'))
-				('http://www.squeaksource.com/AioPlugin'		7	('VMConstruction-Plugins-AioPlugin'))
-				('http://www.squeaksource.com/Alien'			0	('Alien'))
-				"('http://www.squeaksource.com/FreeTypePlus'	5	('FreeType')) can't load this.  it is toxic to Squeak 4.5"
-				('http://www.squeaksource.com/FreetypePlugin'	8	('Freetype-Plugin'))
-				('http://www.squeaksource.com/OSProcess'		4	('OSProcess'))
-				('http://www.squeaksource.com/OSProcessPlugin'	9	('VMConstruction-Plugins-OSProcessPlugin.oscog'))
-				('http://www.squeaksource.com/rb'				5	('AST-Core' 'AST-Semantic' 'AST-Tests-Core' 'AST-Tests-Semantic' 'Refactoring-Changes' 'Refactoring-Core' 'Refactoring-Environment' 'Refactoring-Tests-Changes' 'Refactoring-Tests-Core' 'Refactoring-Tests-Environment'))
-				('http://www.squeaksource.com/Speech'			2	('SharedPool-Speech' ))
-				('http://www.squeaksource.com/XDCP'				9	('VMConstruction-Plugins-XDisplayControlPlugin' ))
-				('http://www.squeaksource.com/Balloon3D'		9	('Balloon3D-Plugins'  ))
-				('http://www.squeaksource.com/Cryptography'		9	('CryptographyPlugins'  ))
-				).
+| manifest load |
+manifest := #(	('http://source.squeak.org/FFI'					1	('FFI-Pools' 'FFI-Kernel'))
+				('http://source.squeak.org/VMMaker'				6	('Balloon-Engine-Pools' 'BytecodeSets.spur' 'VMMaker.oscog' 'CogCompatibility' 'Cog' 'CogTools' 'ImageFormat'))
+				('http://ss3.gemstone.com/ss/MethodMassage'		3	('MethodMassage' 'MethodMassageCompatibility'))
+				('http://www.squeaksource.com/AioPlugin'		7	('VMConstruction-Plugins-AioPlugin'))
+				('http://www.squeaksource.com/Alien'			0	('Alien'))
+				"('http://www.squeaksource.com/FreeTypePlus'	5	('FreeType')) can't load this.  it is toxic to Squeak 4.5"
+				('http://www.squeaksource.com/FreetypePlugin'	8	('Freetype-Plugin'))
+				('http://www.squeaksource.com/OSProcess'		4	('OSProcess'))
+				('http://www.squeaksource.com/OSProcessPlugin'	9	('VMConstruction-Plugins-OSProcessPlugin.oscog'))
+				('http://www.squeaksource.com/rb'				5	('AST-Core' 'AST-Semantic' 'AST-Tests-Core' 'AST-Tests-Semantic' 'Refactoring-Changes' 'Refactoring-Core' 'Refactoring-Environment' 'Refactoring-Tests-Changes' 'Refactoring-Tests-Core' 'Refactoring-Tests-Environment'))
+				('http://www.squeaksource.com/Speech'			2	('SharedPool-Speech' ))
+				('http://www.squeaksource.com/XDCP'				9	('VMConstruction-Plugins-XDisplayControlPlugin' ))
+				('http://www.squeaksource.com/Balloon3D'		9	('Balloon3D-Plugins'  ))
+				('http://www.squeaksource.com/Cryptography'		9	('CryptographyPlugins'  ))
+				).
+
+load := (manifest collect:
+				[:tuple|
+				[:path :order :packages| | repository |
+				repository := MCHttpRepository
+								location: path
+								user: 'squeak'
+								password: 'squeak'.
+				MCRepositoryGroup default addRepository: repository.
+				{repository. order. packages}] valueWithArguments: tuple])
+			sort: [:a :b| a second <= b second].
+
+#(	"'FT2Constants.st'"
+	'Object-performwithwithwithwithwith.st' ) do:
+	[:fileName| (FileDirectory default fileNamed: fileName) fileIn].
+
+load do:
+	[:tuple|
+	 [:repository :order :packages|
+	  packages do:
+		[:package| | latestVersion |
+		"We need to filter-out branches of unbranched packages."
+		latestVersion := (repository versionNamesForPackageNamed: package) detect:
+							[:versionName| (versionName at: package size + 1) = $-].
+		[| version |
+		version := ((MCCacheRepository default includesVersionNamed: latestVersion)
+					ifTrue: [MCCacheRepository default]
+					ifFalse: [repository]) versionNamed: latestVersion.
+		 version load.
+		 version workingCopy repositoryGroup addRepository: repository]
+			on: Warning
+			do: [:ex|
+				((ex messageText beginsWith: 'This package depends on the following classes')
+				 or: [ex messageText beginsWith: 'About to serialize an empty diffy version.']) ifFalse:
+					[ex pass].
+				ex resume]]]
+		valueWithArguments: tuple].
+
+World findATranscript: nil.
 
-load := (manifest collect:
-				[:tuple|
-				[:path :order :packages| | repository |
-				repository := MCHttpRepository
-								location: path
-								user: 'squeak'
-								password: 'squeak'.
-				MCRepositoryGroup default addRepository: repository.
-				{repository. order. packages}] valueWithArguments: tuple])
-			sort: [:a :b| a second <= b second].
-
-#(	"'FT2Constants.st'"
-	'Object-performwithwithwithwithwith.st' ) do:
-	[:fileName| (FileDirectory default fileNamed: fileName) fileIn].
-
-load do:
-	[:tuple|
-	 [:repository :order :packages|
-	  packages do:
-		[:package| | latestVersion |
-		"We need to filter-out branches of unbranched packages."
-		latestVersion := (repository versionNamesForPackageNamed: package) detect:
-							[:versionName| (versionName at: package size + 1) = $-].
-		[| version |
-		version := ((MCCacheRepository default includesVersionNamed: latestVersion)
-					ifTrue: [MCCacheRepository default]
-					ifFalse: [repository]) versionNamed: latestVersion.
-		 version load.
-		 version workingCopy repositoryGroup addRepository: repository]
-			on: Warning
-			do: [:ex|
-				((ex messageText beginsWith: 'This package depends on the following classes')
-				 or: [ex messageText beginsWith: 'About to serialize an empty diffy version.']) ifFalse:
-					[ex pass].
-				ex resume]]]
-		valueWithArguments: tuple].
-
-World findATranscript: nil.
-
-#( 'Workspace'
-   'VM Simulation Workspace'
-   'Slang Test Workspace'
-   'In-image Compilation Workspace.text' ) reverse do:
-	[:textFileName|
-	(StringHolder new contents: (FileDirectory default fileNamed: textFileName, '.text') contentsOfEntireFile)
-		openLabel: textFileName].
-
-(Utilities classPool at: #CommonRequestStrings) ifNotNil:
-	[:crs|
-	crs contents: crs contents, '\-\VMMaker generateConfiguration\VMMaker generateAllConfigurationsUnderVersionControl\VMClass openCogMultiWindowBrowser\VMClass openObjectMemoriesInterpretersBrowser\VMClass openSpurMultiWindowBrowser' withCRs].
-
-CodeHolder useMultiWindowBrowsers: true.
-
-#('Cog' 'CogTools' 'VMMaker') do:
-	[:pkg|
-	(PackageInfo named: pkg) classes do:
-		[:c|
-		c organization sortCategories.
-		c class organization sortCategories]].
-StackInterpreter withAllSubclasses do:
-	[:sic| sic reorganizeAsISeeFit].
-
-Smalltalk snapshot: true andQuit: true
+UIManager default
+	edit: (FileDirectory default fileNamed: 'Workspace.text') contentsOfEntireFile
+	label: 'Overview'.
+
+#( 'VM Simulation Workspace'
+   'Slang Test Workspace'
+   'In-image Compilation Workspace' ) reverse do:
+	[:textFileName| | workspace |
+	workspace := (UIManager default
+					edit: (FileDirectory default fileNamed: textFileName, '.text') contentsOfEntireFile
+					label: textFileName) model.
+	workspace shouldStyle ifFalse:
+		[workspace toggleStyling]].
+
+(Utilities classPool at: #CommonRequestStrings) ifNotNil:
+	[:crs|
+	crs contents: crs contents, '\-\VMMaker generateConfiguration\VMMaker generateAllConfigurationsUnderVersionControl\VMClass openCogMultiWindowBrowser\VMClass openObjectMemoriesInterpretersBrowser\VMClass openSpurMultiWindowBrowser' withCRs].
+
+CodeHolder useMultiWindowBrowsers: true.
+
+#('Cog' 'CogTools' 'VMMaker') do:
+	[:pkg|
+	(PackageInfo named: pkg) classes do:
+		[:c|
+		c organization sortCategories.
+		c class organization sortCategories]].
+StackInterpreter withAllSubclasses do:
+	[:sic| sic reorganizeAsISeeFit].
+
+Smalltalk snapshot: true andQuit: true

Modified: branches/Cog/image/In-image Compilation Workspace.text
===================================================================
--- branches/Cog/image/In-image Compilation Workspace.text	2016-04-08 17:20:32 UTC (rev 3670)
+++ branches/Cog/image/In-image Compilation Workspace.text	2016-04-09 00:17:14 UTC (rev 3671)
@@ -1,16 +1,19 @@
+"See what code the JIT generates for as method in the current image. Disassembly to transcript."
+
 StackToRegisterMappingCogit
 	genAndDis: Object>>#at:put:
-	options: #(ObjectMemory Spur32BitCoMemoryManager)
+	options: #(ObjectMemory Spur32BitCoMemoryManager).
 
 StackToRegisterMappingCogit
 	genAndDis: Object>>#perform:with:with:with:
-	options: #(ObjectMemory Spur32BitCoMemoryManager)
+	options: #(ObjectMemory Spur32BitCoMemoryManager).
 
-StackToRegisterMappingCogit
-	genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:
-	options: #(ObjectMemory Spur32BitCoMemoryManager
-				ISA ARMv5)
+SimpleStackBasedCogit genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:.
 
+StackToRegisterMappingCogit genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:.
+
+StackToRegisterMappingCogit genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:.
+
 StackToRegisterMappingCogit
 	genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:
-	options: #(ObjectMemory NewCoObjectMemory)
+	options: #(ObjectMemory Spur32BitCoMemoryManager ISA ARMv5).
\ No newline at end of file

Copied: branches/Cog/image/LoadSistaSupport.st (from rev 3669, branches/Cog/image/LoadReader.st)
===================================================================
--- branches/Cog/image/LoadSistaSupport.st	                        (rev 0)
+++ branches/Cog/image/LoadSistaSupport.st	2016-04-09 00:17:14 UTC (rev 3671)
@@ -0,0 +1,38 @@
+| manifest load |
+manifest := #(	('http://source.squeak.org/VMMaker'				6	('BytecodeSets.spur' ))
+				('http://ss3.gemstone.com/ss/MethodMassage'		3	('MethodMassage' 'MethodMassageCompatibility'))
+				).
+
+load := (manifest collect:
+				[:tuple|
+				[:path :order :packages| | repository |
+				repository := MCHttpRepository
+								location: path
+								user: 'squeak'
+								password: 'squeak'.
+				MCRepositoryGroup default addRepository: repository.
+				{repository. order. packages}] valueWithArguments: tuple])
+			sort: [:a :b| a second <= b second].
+
+load do:
+	[:tuple|
+	 [:repository :order :packages|
+	  packages do:
+		[:package| | latestVersion |
+		"We need to filter-out branches of unbranched packages."
+		latestVersion := (repository versionNamesForPackageNamed: package) detect:
+							[:versionName| (versionName at: package size + 1) = $-].
+		[| version |
+		version := ((MCCacheRepository default includesVersionNamed: latestVersion)
+					ifTrue: [MCCacheRepository default]
+					ifFalse: [repository]) versionNamed: latestVersion.
+		 version load.
+		 version workingCopy repositoryGroup addRepository: repository]
+			on: Warning
+			do: [:ex|
+				(ex messageText beginsWith: 'This package depends on the following classes') ifFalse:
+					[ex pass].
+				ex resume]]]
+		valueWithArguments: tuple].
+
+Smalltalk snapshot: true andQuit: true
Modified: branches/Cog/image/Slang Test Workspace.text
===================================================================
--- branches/Cog/image/Slang Test Workspace.text	2016-04-08 17:20:32 UTC (rev 3670)
+++ branches/Cog/image/Slang Test Workspace.text	2016-04-09 00:17:14 UTC (rev 3671)
@@ -1,6 +1,6 @@
-Here are some doits to get Slang to generate a single method to the transcript
+"Here are some doits to get Slang to generate a single method to the transcript"
 					
-(Transcript show: [| sel vmm s cg |
+[Transcript show: [| sel vmm s cg |
 	sel := #primitiveVoidVMStateForMethod.
 	vmm := (VMMaker forPlatform: 'Cross')
 				interpreterClass: CoInterpreter"MT";
@@ -24,9 +24,9 @@
 	(cg methodNamed: sel)
 		halt;
 		emitCCodeOn: s generator: cg.
-	s contents] value)
+	s contents] value].
 
-(Transcript show: [| sel s vmm cg |
+[Transcript show: [| sel s vmm cg |
 	sel := #compileEntry.
 	vmm := VMMaker forPlatform: 'Cross'.
 	cg := [vmm
@@ -48,9 +48,9 @@
 	(cg methodNamed: sel)
 		halt;
 		emitCCodeOn: s generator: cg.
-	s contents] value)
+	s contents] value].
 
-(Transcript show: [| tm s vmm cg |
+[Transcript show: [| tm s vmm cg |
 	vmm := VMMaker forPlatform: 'Cross'.
 	cg := [vmm
 				interpreterClass: StackInterpreter;
@@ -72,4 +72,4 @@
 	(cg methodNamed: #foo)
 		halt;
 		emitCCodeOn: s generator: cg.
-	s contents] value)
\ No newline at end of file
+	s contents] value].
Modified: branches/Cog/image/VM Simulation Workspace.text
===================================================================
--- branches/Cog/image/VM Simulation Workspace.text	2016-04-08 17:20:32 UTC (rev 3670)
+++ branches/Cog/image/VM Simulation Workspace.text	2016-04-09 00:17:14 UTC (rev 3671)
@@ -1,3 +1,10 @@
+"To build the spurreader or spurreader-64 images used in the examples below run one of
+	buildspurtrunkreaderimage.sh
+	buildspurtrunkreader64image.sh
+The reader images include a simple REPL loop that reads a chunk-format expression from stdin, evaluates it and writes the printString of the result to stdout.  In the simulator you are prompted for input via an input widget and writes output to the Transcript.  e.g. try 3+4!.  On the Transcript you should see
+squeak> 7
+squeak> "
+	
 "Run the Cog VM simulator on a Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
 [| cos |
 cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit"
@@ -39,14 +46,19 @@
 	selector: 16r31F280 + cos startOfMemory." "e.g. jit a specific method without simulating"
 cos openAsMorph; run].
 
-"See what code the JIT generates for as method in the current image. Disassembly to transcript."
+"Run the Stack VM simulator on a 64-bit Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
+[| cos |
+cos := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur64BitMemoryManager).
+cos desiredNumStackPages: 8.
+cos openOn: 'spurreader-64.image'.
+cos openAsMorph; run].
 
-[SimpleStackBasedCogit genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:].
-
-[StackToRegisterMappingCogit genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:].
-
-[SistaStackToRegisterMappingCogit genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:].
-
-[StackToRegisterMappingCogit
-	genAndDis: SequenceableCollection>>#indexOf:startingAt:ifAbsent:
-	options: #(ObjectMemory Spur32BitCoMemoryManager ISA ARMv5)].
\ No newline at end of file
+"Run the Cog VM simulator on a 64-bit Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
+[| cos |
+cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit"
+										ObjectMemory Spur64BitCoMemoryManager
+										"ISA ARMv5" "ISA IA32").
+"cos initializeThreadSupport."
+cos desiredNumStackPages: 8.
+cos openOn: 'spurreader-64.image'.
+cos openAsMorph; run]
\ No newline at end of file

Deleted: branches/Cog/image/Workspace2.text
===================================================================
--- branches/Cog/image/Workspace2.text	2016-04-08 17:20:32 UTC (rev 3670)
+++ branches/Cog/image/Workspace2.text	2016-04-09 00:17:14 UTC (rev 3671)
@@ -1,68 +0,0 @@
-Remember, set to _your_ initials, then save as VMMaker.oscog-initials.N
-(| user pw |
-Utilities setAuthorInitials.
-user := UIManager default request: 'Repository user name'.
-pw := UIManager default requestPassword: 'Monticello password'.
-MCHttpRepository allSubInstancesDo: [ : rep |
-	rep user: user;
-	password: pw ].
-user = 'anon' ifTrue: [MCFileBasedRepository flushAllCaches].
-self halt: 'close me')
-
-Smalltalk condenseChanges.
-MCFileBasedRepository flushAllCaches
-
-(MCRepositoryGroup default instVarNamed: 'repositories') asArray do:
-	[:repo|
-	repo isValid ifFalse:
-		[MCRepositoryGroup default removeRepository: repo.
-		 Transcript cr; print: repo; flush]]
-
-Because Monticello doesn't handle shared pools well you may have to use the following to bind variables in shared pools correctly until Cog settles down: (doit below finds classes needing recompilation)
-Smalltalk allClasses do:
-	[:c| (c category includesSubString: 'VMMaker') ifTrue:
-			[Transcript cr; print: c; flush.
-			 c recompileAll. c class recompileAll]]
-
-This to force regeneration of all plugins
-(InterpreterPlugin withAllSubclassesDo:[:pl| pl touch])
-
-(Smalltalk allClasses select:
-	[:c| c sharedPools anySatisfy:
-		[:sp| (sp isBehavior ifTrue: [sp classPool] ifFalse: [sp]) keys anySatisfy: [:k| c classPool includesKey: k]]])
-
-("Selectively recompile methods, e.g. after a compiler change."
-| recompiled |
-recompiled := OrderedCollection new.
-(Smalltalk allClasses select: [:c| c category beginsWith: 'VMMaker']) do:
-	[:c|
-	{ c. c class } do:
-		[:b|
-		 b selectorsAndMethodsDo:
-			[:s :m| | nm |
-			"Restore the method association that Monticello loads can leave invalid.
-			 Needed to avoid false positives in the code comparison below."
-			(b isMeta not
-			 and: [m methodClassAssociation ~~ (Smalltalk bindingOf: c name)]) ifTrue:
-				[m methodClass: c].
-			nm := ((b compilerClass new
-						compile: (m getSourceFor: s in: b)
-						in: b
-						notifying: nil
-						ifFail: [self error: 'compilation error']) generate: CompiledMethodTrailer empty).
-			m ~= nm ifTrue:
-				[recompiled add: { b. s }.
-				b recompile: s from: b]]]].
-Transcript clear; flush.
-recompiled do:
-	[:pair|
-	Transcript cr; print: pair first; nextPut: $>; nextPutAll: pair last].
-Transcript flush)
-
-"Purge irrelevant history from Cog VMMaker"
-(| vmmwc strings |
-strings := #(681 684 687 689 693 694 695 698 707 710 711 719 735 737 739 738) collect: [:n| '.', n].
-vmmwc := MCWorkingCopy allManagers detect: [:p| p package name = 'VMMaker'].
-vmmwc instVarNamed: 'ancestry'
-	put: (vmmwc ancestry copyReject: [:a| strings anySatisfy: [:ver| a name endsWith: ver]]).
-	self halt: 'close me')
\ No newline at end of file

Added: branches/Cog/image/buildsistareaderimage.sh
===================================================================
--- branches/Cog/image/buildsistareaderimage.sh	                        (rev 0)
+++ branches/Cog/image/buildsistareaderimage.sh	2016-04-09 00:17:14 UTC (rev 3671)
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Build a Spur image that starts up in a simple REPL, which is
+# really useful for VMMaker simulation testing.
+. ./envvars.sh
+
+./updatespurimage.sh
+
+./ensureSqueakV50sources.sh
+
+cp -p trunk50.image sistareader.image
+cp -p trunk50.changes sistareader.changes
+
+. ./getGoodSpurVM.sh
+
+echo $VM sistareader.image LoadSistaSupport.st
+$VM sistareader.image LoadSistaSupport.st
+
+echo $VM sistareader.image LoadReader.st
+$VM sistareader.image LoadReader.st
+
+echo $VM sistareader.image StartReader.st
+$VM sistareader.image StartReader.st


Property changes on: branches/Cog/image/buildsistareaderimage.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the Vm-dev mailing list