Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.2598
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eliotmiranda committed Nov 28, 2019
1 parent 9d2cdcb commit 4710c5a
Show file tree
Hide file tree
Showing 104 changed files with 11,068 additions and 6,755 deletions.
2 changes: 1 addition & 1 deletion build.macos64x64/gdbarm32/conf.COG
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
S=../../../processors/ARM/gdb-8.3.1
export CFLAGS="-g -Os -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
#export CFLAGS="-g3 -O0 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
export CFLAGS="-g3 -O0 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
CONFFLAGS='--target=arm-apple-darwin CC=clang CXX=clang++ --with-system-zlib=yes'
mkdir -p bfd libiberty opcodes sim/common sim/arm
for d in bfd libiberty opcodes; do
Expand Down
1 change: 1 addition & 0 deletions build.macos64x64/gdbarm64/conf.COG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
S=../../../processors/ARM/gdb-8.3.1
export CFLAGS="-g -O2 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
export CFLAGS="-g3 -O0 -m64 -DCOG=1 -DWORDS_BIGENDIAN=0"
CONFFLAGS='--target=aarch64-apple-darwin CC=clang CXX=clang++ --with-system-zlib=yes'
mkdir -p bfd gdb libiberty opcodes sim/common sim/aarch64
for d in bfd gdb libiberty opcodes; do
Expand Down
2 changes: 1 addition & 1 deletion image/BuildPharo6VMMakerImage.st
Original file line number Diff line number Diff line change
@@ -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
| 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
Expand Down
2 changes: 1 addition & 1 deletion image/BuildSqueakSpurTrunkVMMakerImage.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Scanner allowUnderscoreAsAssignment: false.

manifest := #( ('http://source.squeak.org/FFI' 1 ('FFI-Pools' 'FFI-Kernel'))
('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat'))
('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'CogPools-ISAs' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat'))
('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'))
Expand Down
2 changes: 1 addition & 1 deletion image/getGoodSpur64VM.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ else
while [ ! -d "/Volumes/$VOLUME/Squeak.app" ]; do sleep 1; done
rm -rf $VM
cp -Rp "/Volumes/$VOLUME/Squeak.app" $VM
eject "/Volumes/$VOLUME"
diskutil eject "/Volumes/$VOLUME"
fi
fi
VM=$VM/Contents/MacOS/Squeak;;
Expand Down
8 changes: 6 additions & 2 deletions nsspur64src/vm/cogit.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/* Automatically generated by
Cogit VMMaker.oscog-eem.2213 uuid: 91a750c2-5478-49d7-9c19-26ddc976ddb1
Cogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
*/

#if !SysV && !_WIN64
# define SysV 1
#endif

#if SysV && (defined(x86_64) || defined(__amd64) || defined(__x86_64) || defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
#if defined(__ARM_ARCH_8__) || defined(__arm__) || defined(__arm64__) || defined(ARM64)

# include "cogitARMv8.c"

#elif SysV && (defined(x86_64) || defined(__amd64) || defined(__x86_64) || defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))

# include "cogitX64SysV.c"

Expand Down
2 changes: 1 addition & 1 deletion nsspur64src/vm/cogit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2586 uuid: ae4e24e7-dc65-411b-9f81-53f66f183eaf
CCodeGenerator VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
*/


Expand Down
6 changes: 3 additions & 3 deletions nsspur64src/vm/cogitX64SysV.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
CCodeGenerator VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down
6 changes: 3 additions & 3 deletions nsspur64src/vm/cogitX64WIN64.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
CCodeGenerator VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2
StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2585 uuid: 5282e96d-1d2e-4039-a905-429834c37da2 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2597 uuid: 7a69be2e-f0d0-4d41-9854-65432d621fed " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down
Loading

0 comments on commit 4710c5a

Please sign in to comment.