Skip to content

Commit 4710c5a

Browse files
committed
CogVM source as per VMMaker.oscog-eem.2598
Spur: VMMaker.oscog-cb.2595 Fixed a fascinating bug in Planning compactor. Sometimes Planning decides to go for a multi-pass compaction, but in one compaction it compacts it all, so that firstFreeObject is the last object on heap, on the object after firstFreeObject is outside of the heap. Planning gets confused in this case, while everything is compacted. So I changed to abort compaction in that case, since everything is already compacted. Avoid inlining endCompaction to prevent duplication in compact. Make a minor refactoring to reinitializeScanFrom: to make it more readable (move assignment to firstMobileObject into scanForFirstFreeAndFirstMobileObjectFrom:). Improve the ImageLeakChecker to bounds check objects while swizzling, and hence detect the damaged images produced by the issue 444 planning compactor bug as corrupted. Refactor swizzleObj: to swizzleObj:in: so that ImageLeakChecker/ SpurLeakCheckingSegmentManager can produce more informative diagnostics. Improve the leak checker to first bounds check oops against the heap extent before probing the heap map. This prevents ImageLeakChecker from crashing on issue 444 corrupted images.
1 parent 9d2cdcb commit 4710c5a

File tree

104 files changed

+11068
-6755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+11068
-6755
lines changed

build.macos64x64/gdbarm32/conf.COG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
S=../../../processors/ARM/gdb-8.3.1
33
export CFLAGS="-g -Os -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
4-
#export CFLAGS="-g3 -O0 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
4+
export CFLAGS="-g3 -O0 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
55
CONFFLAGS='--target=arm-apple-darwin CC=clang CXX=clang++ --with-system-zlib=yes'
66
mkdir -p bfd libiberty opcodes sim/common sim/arm
77
for d in bfd libiberty opcodes; do

build.macos64x64/gdbarm64/conf.COG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22
S=../../../processors/ARM/gdb-8.3.1
33
export CFLAGS="-g -O2 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
4+
export CFLAGS="-g3 -O0 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
45
CONFFLAGS='--target=aarch64-apple-darwin CC=clang CXX=clang++ --with-system-zlib=yes'
56
mkdir -p bfd gdb libiberty opcodes sim/common sim/aarch64
67
for d in bfd gdb libiberty opcodes; do

image/BuildPharo6VMMakerImage.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| manifest load |manifest := #( "('http://source.squeak.org/FFI' 1 ('FFI-Pools' 'FFI-Kernel')) already in Pharo" ('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat')) ('http://source.squeak.org/VMMaker' 0 ('VMMakerCompatibilityForPharo6')) ('http://ss3.gemstone.com/ss/MethodMassage' 3 ('MethodMassage' 'MethodMassageCompatibility')) ('http://www.squeaksource.com/AioPlugin' 7 ('VMConstruction-Plugins-AioPlugin.oscog')) "('http://www.squeaksource.com/Alien' 0 ('Alien-Core' 'Alien-Tests-Core' 'Alien-Win32')) already in Pharo" "('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')) hence we can do without this" "('http://www.squeaksource.com/OSProcess' 4 ('OSProcess')) appears to conflict with OSSVMProcess" ('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' 'Refactoring-Squeak-Platform')) already in Pharo" "This for the Klatt speech synthesiser, but seems to be AWOL" ('http://www.squeaksource.com/Speech' 2 ('SharedPool-Speech' )) ('http://www.squeaksource.com/XDCP' 9 ('VMConstruction-Plugins-XDisplayControlPlugin.oscog' )) ('http://www.squeaksource.com/Balloon3D' 9 ('Balloon3D-Constants' 'Balloon3D-Plugins' )) ('http://www.squeaksource.com/Cryptography' 9 ('CryptographyPlugins' )) ('http://smalltalkhub.com/mc/Alistair/FileAttributesPlugin/main' 9 ('FileAttributesPlugin.oscog' )) ('http://ss3.gemstone.com/ss/AndreasSystemProfiler' 9 ('AndreasProfiler')) ('http://www.squeaksource.com/Printf' 5 ('Printf')) ).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'" ) do: [:fileName| (FileLocator cwd / fileName) fileIn].load do: [:tuple| [:repository :order :packages| packages do: [:package | | packageVersions latestVersion | "We need to filter-out branches of unbranched packages, but can't assume the package list is (reverse) ordered." packageVersions := ((repository retrieveVersionsWithPackageNames: Set new) "e.g. Set with: #('Alien-Core' 'IgorStasenko' 71 'Alien-Core-IgorStasenko.71.mcz')" select: [ :v | v first = package and: [(v last at: package size + 1) = $-]]) asSortedCollection: [ :a :b | a third < b third ]. latestVersion := packageVersions last fourth. [| version | version := ((MCCacheRepository default includesVersionNamed: latestVersion) ifTrue: [MCCacheRepository default] ifFalse: [repository]) loadVersionFromFileNamed: 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]. UIManager default edit: 'PharoWorkspace.text' asFileReference contents label: 'Overview'. #('VM Simulation' 'Source Generation' 'Slang Test' 'In-image Compilation') reverseDo: [ :nickname | GTPlayground openContents: (nickname , ' Workspace.text') asFileReference contents label: nickname, ' Playground'].#('Cog' 'CogTools' 'VMMaker') do: [ :pkg | (RPackageSet named: pkg) definedClasses do: [ :c | c organization sortCategories. c class organization sortCategories]]."Alas not. (Smalltalk classNamed: #StackInterpreter) withAllSubclasses do: [:sic| sic reorganizeAsISeeFit]."Smalltalk snapshot: true andQuit: true
1+
| manifest load |manifest := #( "('http://source.squeak.org/FFI' 1 ('FFI-Pools' 'FFI-Kernel')) already in Pharo" ('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'CogPools-ISAs' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat')) ('http://source.squeak.org/VMMaker' 0 ('VMMakerCompatibilityForPharo6')) ('http://ss3.gemstone.com/ss/MethodMassage' 3 ('MethodMassage' 'MethodMassageCompatibility')) ('http://www.squeaksource.com/AioPlugin' 7 ('VMConstruction-Plugins-AioPlugin.oscog')) "('http://www.squeaksource.com/Alien' 0 ('Alien-Core' 'Alien-Tests-Core' 'Alien-Win32')) already in Pharo" "('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')) hence we can do without this" "('http://www.squeaksource.com/OSProcess' 4 ('OSProcess')) appears to conflict with OSSVMProcess" ('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' 'Refactoring-Squeak-Platform')) already in Pharo" "This for the Klatt speech synthesiser, but seems to be AWOL" ('http://www.squeaksource.com/Speech' 2 ('SharedPool-Speech' )) ('http://www.squeaksource.com/XDCP' 9 ('VMConstruction-Plugins-XDisplayControlPlugin.oscog' )) ('http://www.squeaksource.com/Balloon3D' 9 ('Balloon3D-Constants' 'Balloon3D-Plugins' )) ('http://www.squeaksource.com/Cryptography' 9 ('CryptographyPlugins' )) ('http://smalltalkhub.com/mc/Alistair/FileAttributesPlugin/main' 9 ('FileAttributesPlugin.oscog' )) ('http://ss3.gemstone.com/ss/AndreasSystemProfiler' 9 ('AndreasProfiler')) ('http://www.squeaksource.com/Printf' 5 ('Printf')) ).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'" ) do: [:fileName| (FileLocator cwd / fileName) fileIn].load do: [:tuple| [:repository :order :packages| packages do: [:package | | packageVersions latestVersion | "We need to filter-out branches of unbranched packages, but can't assume the package list is (reverse) ordered." packageVersions := ((repository retrieveVersionsWithPackageNames: Set new) "e.g. Set with: #('Alien-Core' 'IgorStasenko' 71 'Alien-Core-IgorStasenko.71.mcz')" select: [ :v | v first = package and: [(v last at: package size + 1) = $-]]) asSortedCollection: [ :a :b | a third < b third ]. latestVersion := packageVersions last fourth. [| version | version := ((MCCacheRepository default includesVersionNamed: latestVersion) ifTrue: [MCCacheRepository default] ifFalse: [repository]) loadVersionFromFileNamed: 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]. UIManager default edit: 'PharoWorkspace.text' asFileReference contents label: 'Overview'. #('VM Simulation' 'Source Generation' 'Slang Test' 'In-image Compilation') reverseDo: [ :nickname | GTPlayground openContents: (nickname , ' Workspace.text') asFileReference contents label: nickname, ' Playground'].#('Cog' 'CogTools' 'VMMaker') do: [ :pkg | (RPackageSet named: pkg) definedClasses do: [ :c | c organization sortCategories. c class organization sortCategories]]."Alas not. (Smalltalk classNamed: #StackInterpreter) withAllSubclasses do: [:sic| sic reorganizeAsISeeFit]."Smalltalk snapshot: true andQuit: true

image/BuildSqueakSpurTrunkVMMakerImage.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Scanner allowUnderscoreAsAssignment: false.
55

66
manifest := #( ('http://source.squeak.org/FFI' 1 ('FFI-Pools' 'FFI-Kernel'))
7-
('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat'))
7+
('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'CogPools-ISAs' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat'))
88
('http://ss3.gemstone.com/ss/MethodMassage' 3 ('MethodMassage' 'MethodMassageCompatibility'))
99
('http://www.squeaksource.com/AioPlugin' 7 ('VMConstruction-Plugins-AioPlugin.oscog'))
1010
('http://www.squeaksource.com/Alien' 0 ('Alien-Core' 'Alien-Tests-Core' 'Alien-Win32'))

image/getGoodSpur64VM.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ else
3232
while [ ! -d "/Volumes/$VOLUME/Squeak.app" ]; do sleep 1; done
3333
rm -rf $VM
3434
cp -Rp "/Volumes/$VOLUME/Squeak.app" $VM
35-
eject "/Volumes/$VOLUME"
35+
diskutil eject "/Volumes/$VOLUME"
3636
fi
3737
fi
3838
VM=$VM/Contents/MacOS/Squeak;;

nsspur64src/vm/cogit.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/* Automatically generated by
2-
Cogit VMMaker.oscog-eem.2213 uuid: 91a750c2-5478-49d7-9c19-26ddc976ddb1
2+
Cogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
33
*/
44

55
#if !SysV && !_WIN64
66
# define SysV 1
77
#endif
88

9-
#if SysV && (defined(x86_64) || defined(__amd64) || defined(__x86_64) || defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
9+
#if defined(__ARM_ARCH_8__) || defined(__arm__) || defined(__arm64__) || defined(ARM64)
10+
11+
# include "cogitARMv8.c"
12+
13+
#elif SysV && (defined(x86_64) || defined(__amd64) || defined(__x86_64) || defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
1014

1115
# include "cogitX64SysV.c"
1216

nsspur64src/vm/cogit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2586 uuid: ae4e24e7-dc65-411b-9f81-53f66f183eaf
2+
CCodeGenerator VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
33
*/
44

55

nsspur64src/vm/cogitX64SysV.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
2+
CCodeGenerator VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

nsspur64src/vm/cogitX64WIN64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
2+
CCodeGenerator VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

0 commit comments

Comments
 (0)