Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.2211
Browse files Browse the repository at this point in the history
StackInterpreter:
Simplify and make robust display bitmap access for display update.  The old code
required platforms that needed to redraw at arbitrary times to have to access
the display bits through interpreterProxy->displayObject, decoding it each time.
There exists a small window during compaction, etc, during whiuch such access
will fail and cause a VM crash.  The new code provides four variables to
reference the display, displayBits, displayWidth, displayHeight and
displayDepth, which are assigned appropriately in the primitiveBeDisplay
primitive.  After a GC the interpreter checks if the displayBits have changed
location and if so calls ioNoteDisplayChanged:width:height:depth:
(ioNoteDisplayChangedwidthheightdepth) to inform the platform of the change
(currently all platforms implement this as a null function).

On Spur the primitiveBeDIsplay primitive also pins the display bits.

This scheme allows displayBitsOf:Left:Top:Right:Bottom: to be simplified to
updateDisplayLeft:Top:Right:Bottom:.

On Mac OS X and X11, replace access to the display Dits via displayObject with
direct access to displayBits, displayWidth, displayHeight and displayDepth vars.

Spur:
Fix cloneInOldSpaceForPinning: to handle failed allocations correctly.
Have pinObject: only clone an old space object that is 1Mb or less, simply
pinning larger objects (whioch would include the display bitmap) where it sits.

Lift the limits on Spur image segments.  There is now no limit on the number of
objects in a segment, but the classes in the segment must occupy no more than
2 ^ 21 bytes (maxIdentityHash / 2 * 8 - which allows for about 1.4 million
11 slot classes), and the segment can have no more than 2 ^ 21 out pointers
(again maxIdentityHash / 2.  Tested for simple examples. Manages to export a
project but not load it yet.

Fail if the segment store args that are mutated are either immutable or pinned.

Fix bad bug in shorten:toIndexableSize: (which could affect Scorch/Sista).
The old code for addressAfter: would be fooled by an object with overflow
slows but fewer slots than numSlotsMask.  So fix addressAfter: so it will
still add the overflow header if there is one.

Rewrite objectBytesForSlots: to follow the fixed addressAfter:.  The code
should be cleaner.

Fix checkInterpreterIntegrity in the case of the primitiveDoPrimtiive code
setting newMethod to an integer.

Fix some translation-timer warnings by tweaking storeLiteralVariable:withValue:,
storePointerImmutabilityCheck:ofObject:withValue: & primitiveGetenv.
  • Loading branch information
eliotmiranda committed May 13, 2017
1 parent c8c28de commit 78c402e
Show file tree
Hide file tree
Showing 63 changed files with 92,081 additions and 132,931 deletions.
16 changes: 14 additions & 2 deletions build.macos32x86/bochsx64/conf.COG
Expand Up @@ -8,14 +8,26 @@
# $ ./conf.COG
# $ ../../processors/IA32/bochs/makeem

# Find the oldest appropriate SDK...
XCODE=/Applications/Xcode.app/Contents/Developer
SDKsDIR=$XCODE/Platforms/MacOSX.platform/Developer/SDKs
SDK=
for d in MacOSX10.9.sdk MacOSX10.10.sdk MacOSX10.11.sdk MacOSX10.12.sdk; do
if [ -z "$SDK" -a -d "$SDKsDIR/$d" ]; then
SDK="$SDKsDIR/$d"
fi
done

set echo
# CFLAGS="-pipe -O3 -fomit-frame-pointer -finline-functions -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 -fprefetch-loop-arrays $CFLAGS"
CFLAGS="-m32 $CFLAGS"
CFLAGS="-Dlongjmp=_longjmp -Dsetjmp=_setjmp $CFLAGS"
CFLAGS="-pipe -O3 -fomit-frame-pointer -finline-functions $CFLAGS"
CFLAGS="-pipe -O3 -fomit-frame-pointer $CFLAGS"
CFLAGS="-g $CFLAGS"
CFLAGS="$CFLAGS -isysroot $SDK"
CPPFLAGS=""
CXXFLAGS="$CFLAGS"
LDFLAGS="-isysroot $SDK"

export CFLAGS
export CPATH
Expand Down Expand Up @@ -51,4 +63,4 @@ export LDFLAGS
echo cp config.h bochsconfig.h
cp config.h bochsconfig.h

echo "and don't forget to run ../../processors/IA32/bochs/makeem"
echo "and don't forget to run ./makeem"
16 changes: 14 additions & 2 deletions build.macos32x86/bochsx86/conf.COG
Expand Up @@ -8,14 +8,26 @@
# $ ./conf.COG
# $ ../../processors/IA32/bochs/makeem

# Find the oldest appropriate SDK...
XCODE=/Applications/Xcode.app/Contents/Developer
SDKsDIR=$XCODE/Platforms/MacOSX.platform/Developer/SDKs
SDK=
for d in MacOSX10.9.sdk MacOSX10.10.sdk MacOSX10.11.sdk MacOSX10.12.sdk; do
if [ -z "$SDK" -a -d "$SDKsDIR/$d" ]; then
SDK="$SDKsDIR/$d"
fi
done

set echo
# CFLAGS="-pipe -O3 -fomit-frame-pointer -finline-functions -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 -fprefetch-loop-arrays $CFLAGS"
CFLAGS="-m32 $CFLAGS"
CFLAGS="-Dlongjmp=_longjmp -Dsetjmp=_setjmp $CFLAGS"
CFLAGS="-pipe -O3 -fomit-frame-pointer -finline-functions $CFLAGS"
CFLAGS="-pipe -O3 -fomit-frame-pointer $CFLAGS"
CFLAGS="-g $CFLAGS"
CFLAGS="$CFLAGS -isysroot $SDK"
CPPFLAGS=""
CXXFLAGS="$CFLAGS"
LDFLAGS="-isysroot $SDK"

export CFLAGS
export CPATH
Expand Down Expand Up @@ -53,4 +65,4 @@ export LDFLAGS
echo cp config.h bochsconfig.h
cp config.h bochsconfig.h

echo "and don't forget to run ../../processors/IA32/bochs/makeem"
echo "and don't forget to run ./makeem"
26 changes: 21 additions & 5 deletions build.macos32x86/gdbarm32/conf.COG
@@ -1,19 +1,35 @@
#!/bin/sh
CFLAGS="-g -O2 -m32"
# Find the oldest appropriate SDK...
XCODE=/Applications/Xcode.app/Contents/Developer
SDKsDIR=$XCODE/Platforms/MacOSX.platform/Developer/SDKs
SDK=
for d in MacOSX10.9.sdk MacOSX10.10.sdk MacOSX10.11.sdk MacOSX10.12.sdk; do
if [ -z "$SDK" -a -d "$SDKsDIR/$d" ]; then
SDK="$SDKsDIR/$d"
fi
done

CFLAGS="-g -O2 -m32 -isysroot $SDK"
LDFLAGS="-isysroot $SDK"

mkdir -p zlib bfd libiberty opcodes sim/common sim/arm
for d in zlib; do
(cd $d; ../../../processors/ARM/gdb-7.10/$d/configure COG=1 CFLAGS="$CFLAGS")
(cd $d; ../../../processors/ARM/gdb-7.10/$d/configure \
COG=1 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS")
done
for d in bfd; do
(cd $d; ../../../processors/ARM/gdb-7.10/$d/configure COG=1 CFLAGS="$CFLAGS"\
(cd $d; ../../../processors/ARM/gdb-7.10/$d/configure \
COG=1 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"\
--target=arm-linux --with-system-zlib=no)
done
for d in libiberty opcodes; do
(cd $d; ../../../processors/ARM/gdb-7.10/$d/configure COG=1 CFLAGS="$CFLAGS"\
(cd $d; ../../../processors/ARM/gdb-7.10/$d/configure \
COG=1 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"\
--target=arm-linux)
done
for d in sim/common sim/arm; do
(cd $d;
../../../../processors/ARM/gdb-7.10/$d/configure COG=1 CFLAGS="$CFLAGS"\
../../../../processors/ARM/gdb-7.10/$d/configure \
COG=1 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"\
--target=arm-linux)
done
1 change: 1 addition & 0 deletions image/BuildSqueakSpurTrunkVMMakerImage.st
Expand Up @@ -9,6 +9,7 @@ manifest := #( ('http://source.squeak.org/FFI' 1 ('FFI-Pools' 'FFI-Kernel'))
('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' 'Refactoring-Squeak-Platform'))
"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' ))
('http://www.squeaksource.com/Balloon3D' 9 ('Balloon3D-Constants' 'Balloon3D-Plugins' ))
Expand Down
2 changes: 1 addition & 1 deletion nsspur64src/vm/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2208 uuid: 4877be7d-941d-4e15-b6df-4f1b8c7072a8
CCodeGenerator VMMaker.oscog-eem.2211 uuid: 5a69567a-b158-4d95-99ca-80995331fe69
*/


Expand Down

0 comments on commit 78c402e

Please sign in to comment.