[Vm-dev] [commit][3564] CogVM source as per VMMaker.oscog-eem.1661
commits at squeakvm.org
commits at squeakvm.org
Fri Jan 22 01:28:24 UTC 2016
Revision: 3564
Author: eliot
Date: 2016-01-21 17:28:22 -0800 (Thu, 21 Jan 2016)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1661
Release Clement's IMMUTABILITY work.
Make IMMUTABILITY something that is defined on the C compiler command line.
Cogit IMMUTABILITY cleanups:
Remove the need to map the primitive error code store bytecode by having
mapFor:bcpc:performUntil:arg: skip the CallPrimitive & StoreTemp bytecoedes if
present. Also avoid the set-up overhead when mapping the first bytecode by
moving the first invocation early.
Make the married context inst var assign methods deny immutability for their
contexts.
Plugins:
Fix the FilePlugin's unnecessary fullGC on Spur.
Modified Paths:
--------------
branches/Cog/nsspur64src/vm/cogit.h
branches/Cog/nsspur64src/vm/cogitX64.c
branches/Cog/nsspur64src/vm/cointerp.c
branches/Cog/nsspur64src/vm/cointerp.h
branches/Cog/nsspur64src/vm/gcc3x-cointerp.c
branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c
branches/Cog/nsspursrc/plugins/IA32ABI/IA32ABI.c
branches/Cog/nsspursrc/vm/cogit.h
branches/Cog/nsspursrc/vm/cogitARMv5.c
branches/Cog/nsspursrc/vm/cogitIA32.c
branches/Cog/nsspursrc/vm/cogitMIPSEL.c
branches/Cog/nsspursrc/vm/cointerp.c
branches/Cog/nsspursrc/vm/cointerp.h
branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
branches/Cog/nsspurstack64src/vm/interp.c
branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
branches/Cog/nsspurstacksrc/vm/interp.c
branches/Cog/spur64src/vm/cogit.h
branches/Cog/spur64src/vm/cogitX64.c
branches/Cog/spur64src/vm/cointerp.c
branches/Cog/spur64src/vm/cointerp.h
branches/Cog/spur64src/vm/gcc3x-cointerp.c
branches/Cog/spursistasrc/vm/cogit.h
branches/Cog/spursistasrc/vm/cogitARMv5.c
branches/Cog/spursistasrc/vm/cogitIA32.c
branches/Cog/spursistasrc/vm/cogitMIPSEL.c
branches/Cog/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cogitARMv5.c
branches/Cog/spursrc/vm/cogitIA32.c
branches/Cog/spursrc/vm/cogitMIPSEL.c
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spurstack64src/vm/gcc3x-interp.c
branches/Cog/spurstack64src/vm/interp.c
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/src/plugins/B2DPlugin/B2DPlugin.c
branches/Cog/src/plugins/FilePlugin/FilePlugin.c
branches/Cog/src/plugins/IA32ABI/IA32ABI.c
branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c
branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c
branches/Cog/src/vm/cogit.h
branches/Cog/src/vm/cogitARMv5.c
branches/Cog/src/vm/cogitIA32.c
branches/Cog/src/vm/cogitMIPSEL.c
branches/Cog/src/vm/cointerp.c
branches/Cog/src/vm/cointerp.h
branches/Cog/src/vm/cointerpmt.c
branches/Cog/src/vm/cointerpmt.h
branches/Cog/src/vm/gcc3x-cointerp.c
branches/Cog/src/vm/gcc3x-cointerpmt.c
branches/Cog/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
Added Paths:
-----------
branches/Cog/build.linux32x86/nsnac.cog.spur/
branches/Cog/build.linux32x86/nsnac.cog.spur/build/
branches/Cog/build.linux32x86/nsnac.cog.spur/build/mvm
branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert/
branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert/mvm
branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/
branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/mvm
branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug/
branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug/mvm
branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/
branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/mvm
branches/Cog/build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/
branches/Cog/build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/mvm
branches/Cog/build.linux32x86/nsnac.cog.spur/makeallclean
branches/Cog/build.linux32x86/nsnac.cog.spur/makealldirty
branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.ext
branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.int
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/build/mvm
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/build/mvm (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/build/mvm 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,39 @@
+#!/bin/bash
+# VM with VM profiler and threaded heartbeat
+INSTALLDIR=nscogspurlinuxht
+# Some gcc versions create a broken VM using -O2
+case `gcc -v 2>&1 | grep version | sed 's/gcc version *//'` in
+3.4.*) OPT="-g -O1 -fwrapv -DNDEBUG -DDEBUGVM=0";;
+*) OPT="-g -O2 -DNDEBUG -DDEBUGVM=0";;
+esac
+
+if [ $# -ge 1 ]; then
+ case "$1" in
+ -*) ;;
+ *) INSTALLDIR="$1"; shift
+ esac
+fi
+
+echo -n "clean? "
+read a
+case $a in
+n|no|N|NO) echo "ok but this isn't safe!!";;
+*) rm config.h; test -f Makefile && make reallyclean
+esac
+test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
+test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
+test -f config.h || ../../../platforms/unix/config/configure \
+ --with-vmversion=5.0 \
+ --with-src=nsspursrc --with-plugins=nsspursrc/plugins \
+ --without-vm-display-fbdev --without-npsqueak \
+ CC="gcc -m32" \
+ CXX="g++ -m32" \
+ CFLAGS="$OPT -DEnforceAccessControl=0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \
+ LIBS="-lpthread -luuid" \
+ LDFLAGS=-Wl,-z,now
+rm -f vm/sqUnixMain.o # nuke version info
+rm -rf ../../../products/$INSTALLDIR
+# prefer make install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
+../../editnewspeakinstall.sh ../../../products/$INSTALLDIR "$@"
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/build/mvm
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert/mvm
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert/mvm (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert/mvm 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,35 @@
+#!/bin/bash
+# assert Spur VM with VM profiler and threaded heartbeat
+INSTALLDIR=assert/nscogspurlinuxht
+OPT="-g3 -O1 -fwrapv -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DDEBUGVM=0"
+
+if [ $# -ge 1 ]; then
+ case "$1" in
+ -*) ;;
+ *) INSTALLDIR="$1"; shift
+ esac
+fi
+
+echo -n "clean? "
+read a
+case $a in
+n|no|N|NO) echo "ok but this isn't safe!!";;
+*) rm config.h; test -f Makefile && make reallyclean
+esac
+test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
+test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
+test -f config.h || ../../../platforms/unix/config/configure \
+ --with-vmversion=5.0 \
+ --with-src=nsspursrc --with-plugins=nsspursrc/plugins \
+ --without-vm-display-fbdev --without-npsqueak \
+ CC="gcc -m32" \
+ CXX="g++ -m32" \
+ CFLAGS="$OPT -DEnforceAccessControl=0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \
+ LIBS="-lpthread -luuid" \
+ LDFLAGS=-Wl,-z,now
+rm -f vm/sqUnixMain.o # nuke version info
+rm -rf ../../../products/$INSTALLDIR
+# prefer make install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
+../../editnewspeakinstall.sh ../../../products/$INSTALLDIR "$@"
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert/mvm
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/mvm
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/mvm (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/mvm 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,33 @@
+#!/bin/bash
+# assert Spur VM with VM profiler and itimer heartbeat
+INSTALLDIR=assert/nscogspurlinux
+OPT="-g3 -O1 -fwrapv -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DDEBUGVM=0"
+
+if [ $# -ge 1 ]; then
+ case "$1" in
+ -*) ;;
+ *) INSTALLDIR="$1"; shift
+ esac
+fi
+
+echo -n "clean? "
+read a
+case $a in
+n|no|N|NO) echo "ok but this isn't safe!!";;
+*) rm config.h; test -f Makefile && make reallyclean
+esac
+test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
+test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
+test -f config.h || ../../../platforms/unix/config/configure \
+ --with-vmversion=5.0 \
+ --with-src=nsspursrc --with-plugins=nsspursrc/plugins \
+ --without-vm-display-fbdev --without-npsqueak \
+ CC="gcc -m32" \
+ CXX="g++ -m32" \
+ CFLAGS="$OPT -DEnforceAccessControl=0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1" \
+ LIBS="-lpthread -luuid" \
+ LDFLAGS=-Wl,-z,now
+rm -f vm/sqUnixMain.o # nuke version info
+rm -rf ../../../products/$INSTALLDIR
+make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
+../../editnewspeakinstall.sh ../../../products/$INSTALLDIR "$@"
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/build.assert.itimerheartbeat/mvm
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug/mvm
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug/mvm (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug/mvm 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,35 @@
+#!/bin/bash
+# debug Spur VM with VM profiler and threaded heartbeat
+INSTALLDIR=debug/nscogspurlinuxht
+OPT="-g3 -O0 -fwrapv -DDEBUGVM=1"
+
+if [ $# -ge 1 ]; then
+ case "$1" in
+ -*) ;;
+ *) INSTALLDIR="$1"; shift
+ esac
+fi
+
+echo -n "clean? "
+read a
+case $a in
+n|no|N|NO) echo "ok but this isn't safe!!";;
+*) rm config.h; test -f Makefile && make reallyclean
+esac
+test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
+test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
+test -f config.h || ../../../platforms/unix/config/configure \
+ --with-vmversion=5.0 \
+ --with-src=nsspursrc --with-plugins=nsspursrc/plugins \
+ --without-vm-display-fbdev --without-npsqueak \
+ CC="gcc -m32" \
+ CXX="g++ -m32" \
+ CFLAGS="$OPT -DEnforceAccessControl=0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \
+ LIBS="-lpthread -luuid" \
+ LDFLAGS=-Wl,-z,now
+rm -f vm/sqUnixMain.o # nuke version info
+rm -rf ../../../products/$INSTALLDIR
+# prefer make install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
+../../editnewspeakinstall.sh ../../../products/$INSTALLDIR "$@"
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug/mvm
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/mvm
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/mvm (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/mvm 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,33 @@
+#!/bin/bash
+# debug Spur VM with VM profiler and itimer heartbeat
+INSTALLDIR=debug/nscogspurlinux
+OPT="-g3 -O0 -fwrapv -DDEBUGVM=1"
+
+if [ $# -ge 1 ]; then
+ case "$1" in
+ -*) ;;
+ *) INSTALLDIR="$1"; shift
+ esac
+fi
+
+echo -n "clean? "
+read a
+case $a in
+n|no|N|NO) echo "ok but this isn't safe!!";;
+*) rm config.h; test -f Makefile && make reallyclean
+esac
+test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
+test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
+test -f config.h || ../../../platforms/unix/config/configure \
+ --with-vmversion=5.0 \
+ --with-src=nsspursrc --with-plugins=nsspursrc/plugins \
+ --without-vm-display-fbdev --without-npsqueak \
+ CC="gcc -m32" \
+ CXX="g++ -m32" \
+ CFLAGS="$OPT -DEnforceAccessControl=0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1" \
+ LIBS="-lpthread -luuid" \
+ LDFLAGS=-Wl,-z,now
+rm -f vm/sqUnixMain.o # nuke version info
+rm -rf ../../../products/$INSTALLDIR
+make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
+../../editnewspeakinstall.sh ../../../products/$INSTALLDIR "$@"
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/build.debug.itimerheartbeat/mvm
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/mvm
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/mvm (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/mvm 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Spur VM with VM profiler and itimer heartbeat
+INSTALLDIR=nscogspurlinux
+# Some gcc versions create a broken VM using -O2
+case `gcc -v 2>&1 | grep version | sed 's/gcc version *//'` in
+3.4.*) OPT="-g -O1 -fwrapv -DNDEBUG -DDEBUGVM=0";;
+*) OPT="-g -O2 -DNDEBUG -DDEBUGVM=0";;
+esac
+
+if [ $# -ge 1 ]; then
+ case "$1" in
+ -*) ;;
+ *) INSTALLDIR="$1"; shift
+ esac
+fi
+
+echo -n "clean? "
+read a
+case $a in
+n|no|N|NO) echo "ok but this isn't safe!!";;
+*) rm config.h; test -f Makefile && make reallyclean
+esac
+test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
+test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
+test -f config.h || ../../../platforms/unix/config/configure \
+ --with-vmversion=5.0 \
+ --with-src=nsspursrc --with-plugins=nsspursrc/plugins \
+ --without-vm-display-fbdev --without-npsqueak \
+ CC="gcc -m32" \
+ CXX="g++ -m32" \
+ CFLAGS="$OPT -DEnforceAccessControl=0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1" \
+ LIBS="-lpthread -luuid" \
+ LDFLAGS=-Wl,-z,now
+rm -f vm/sqUnixMain.o # nuke version info
+rm -rf ../../../products/$INSTALLDIR
+make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
+../../editnewspeakinstall.sh ../../../products/$INSTALLDIR "$@"
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/build.itimerheartbeat/mvm
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/makeallclean
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/makeallclean (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/makeallclean 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,15 @@
+#!/bin/sh
+trap 'exit 2' HUP INT PIPE TERM
+if [ "$1" = -fork ]; then
+ shift
+ for d in `dirname $0`/build*; do
+ (cd ./$d
+ echo y | ./mvm "$@") &
+ done
+ wait
+else
+ for d in `dirname $0`/build*; do
+ (cd ./$d
+ echo y | ./mvm "$@")
+ done
+fi
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/makeallclean
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/makealldirty
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/makealldirty (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/makealldirty 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,15 @@
+#!/bin/sh
+trap 'exit 2' HUP INT PIPE TERM
+if [ "$1" = -fork ]; then
+ shift
+ for d in `dirname $0`/build*; do
+ (cd ./$d
+ echo n | ./mvm "$@") &
+ done
+ wait
+else
+ for d in `dirname $0`/build*; do
+ (cd ./$d
+ echo n | ./mvm "$@")
+ done
+fi
Property changes on: branches/Cog/build.linux32x86/nsnac.cog.spur/makealldirty
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.ext
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.ext (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.ext 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL
Added: branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.int
===================================================================
--- branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.int (rev 0)
+++ branches/Cog/build.linux32x86/nsnac.cog.spur/plugins.int 2016-01-22 01:28:22 UTC (rev 3564)
@@ -0,0 +1,27 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AioPlugin \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin
Modified: branches/Cog/nsspur64src/vm/cogit.h
===================================================================
--- branches/Cog/nsspur64src/vm/cogit.h 2016-01-20 02:33:22 UTC (rev 3563)
+++ branches/Cog/nsspur64src/vm/cogit.h 2016-01-22 01:28:22 UTC (rev 3564)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748
+ CCodeGenerator VMMaker.oscog-eem.1661 uuid: a34e0ec2-d251-4618-bd67-cef5b3eddcf5
*/
Modified: branches/Cog/nsspur64src/vm/cogitX64.c
===================================================================
--- branches/Cog/nsspur64src/vm/cogitX64.c 2016-01-20 02:33:22 UTC (rev 3563)
+++ branches/Cog/nsspur64src/vm/cogitX64.c 2016-01-22 01:28:22 UTC (rev 3564)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748
+ CCodeGenerator VMMaker.oscog-eem.1661 uuid: a34e0ec2-d251-4618-bd67-cef5b3eddcf5
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1661 uuid: a34e0ec2-d251-4618-bd67-cef5b3eddcf5
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1661 uuid: a34e0ec2-d251-4618-bd67-cef5b3eddcf5 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -184,7 +184,9 @@
#define HasBytecodePC 4
#define HeaderIndex 0
#define IDIVR 117
+#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */
#define IMMUTABILITY 0
+#endif
#define IMULRR 118
#define InstanceSpecificationIndex 2
#define InstructionPointerIndex 1
@@ -499,6 +501,7 @@
static sqInt NoDbgRegParms cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod);
static AbstractInstruction * NoDbgRegParms gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder);
extern sqInt defaultCogCodeSize(void);
+static sqInt NoDbgRegParms deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader);
static sqInt NoDbgRegParms endPCOf(sqInt aMethod);
extern void enterCogCodePopReceiver(void);
static sqInt NoDbgRegParms expectedClosedPICPrototype(CogMethod *cPIC);
@@ -959,8 +962,9 @@
static sqInt genLongUnconditionalBackwardJump(void);
static sqInt genLongUnconditionalForwardJump(void);
static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
+static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
static AbstractInstruction * NoDbgRegParms genMoveFalseR(sqInt reg);
-static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg);
+static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
static sqInt genPushClosureTempsBytecode(void);
@@ -1000,7 +1004,6 @@
static sqInt genStoreAndPopTemporaryVariableBytecode(void);
static sqInt genStoreRemoteTempLongBytecode(void);
static void maybeCompileAllocFillerCheck(void);
-static sqInt methodUsesPrimitiveErrorCode(void);
static sqInt numSpecialSelectors(void);
static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
extern void recordCallOffsetIn(CogMethod *cogMethod);
@@ -1167,7 +1170,6 @@
void (*ceCallCogCodePopReceiverArg0Regs)(void);
void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void);
void (*ceCallCogCodePopReceiverReg)(void);
-static sqInt ceCannotAssignToWithIndexTrampoline;
sqInt ceCannotResumeTrampoline;
void (*ceCaptureCStackPointers)(void);
static unsigned long (*ceCheckFeaturesFunction)(void);
@@ -2804,6 +2806,18 @@
latestContinuation = 0;
/* begin mapFor:bcpc:performUntil:arg: */
assert(((cogMethod->stackCheckOffset)) > 0);
+
+ /* The stack check maps to the start of the first bytecode,
+ the first bytecode being effectively after frame build. */
+ mcpc1 = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
+ result = findIsBackwardBranchMcpcBcpcMatchingMcpc(null, 0, (((char *) mcpc1)), startbcpc, (((void *)mcpc)));
+ if (result != 0) {
+ return result;
+ }
+
+ /* In both CMMethod and CMBlock cases find the start of the map and
+ skip forward to the bytecode pc map entry for the stack check. */
+ bcpc = startbcpc;
if (((cogMethod->cmType)) == CMMethod) {
isInBlock = 0;
homeMethod = ((CogMethod *) cogMethod);
@@ -2821,9 +2835,11 @@
bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader)
? 256
: 0);
+ bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader));
}
else {
isInBlock = 1;
+ assert(bcpc == ((cogMethod->startpc)));
homeMethod = cmHomeMethod(cogMethod);
map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod);
assert(map != 0);
@@ -2847,17 +2863,11 @@
endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation)
? ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)
: 0));
+ bcpc = startbcpc;
}
- bcpc = startbcpc;
- mcpc1 = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
- /* The stack check maps to the start of the first bytecode,
- the first bytecode being effectively after frame build. */
+ /* Now skip up through the bytecode pc map entry for the stack check. */
nExts = 0;
- result = findIsBackwardBranchMcpcBcpcMatchingMcpc(null, 0, (((char *) mcpc1)), startbcpc, (((void *)mcpc)));
- if (result != 0) {
- return result;
- }
while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) {
map -= 1;
}
@@ -4548,15 +4558,10 @@
static sqInt
compileMethodBody(void)
{
- sqInt deltaForPrimErrorCode;
-
if (endPC < initialPC) {
return 0;
}
- deltaForPrimErrorCode = (methodUsesPrimitiveErrorCode()
- ? (sizeOfCallPrimitiveBytecode(methodHeader)) + (sizeOfLongStoreTempBytecode(methodHeader))
- : 0);
- return compileAbstractInstructionsFromthrough(initialPC + deltaForPrimErrorCode, endPC);
+ return compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC);
}
@@ -4920,6 +4925,20 @@
return 1024 * 1400;
}
+
+/* Answer the number of bytecodes to skip to get to the first bytecode
+ past the primitive call and any store of the error code. */
+
+ /* Cogit>>#deltaToSkipPrimAndErrorStoreIn:header: */
+static sqInt NoDbgRegParms
+deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader)
+{
+ return (((primitiveIndexOfMethodheader(aMethodObj, aMethodHeader)) > 0)
+ && ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj)))
+ ? (sizeOfCallPrimitiveBytecode(aMethodHeader)) + (sizeOfLongStoreTempBytecode(aMethodHeader))
+ : 0);
+}
+
/* Cogit>>#endPCOf: */
static sqInt NoDbgRegParms
endPCOf(sqInt aMethod)
@@ -8177,6 +8196,18 @@
latestContinuation = 0;
/* begin mapFor:bcpc:performUntil:arg: */
assert(((cogMethod->stackCheckOffset)) > 0);
+
+ /* The stack check maps to the start of the first bytecode,
+ the first bytecode being effectively after frame build. */
+ mcpc = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
+ result = 0;
+ if (result != 0) {
+ return result;
+ }
+
+ /* In both CMMethod and CMBlock cases find the start of the map and
+ skip forward to the bytecode pc map entry for the stack check. */
+ bcpc1 = startbcpc;
if (((cogMethod->cmType)) == CMMethod) {
isInBlock = 0;
homeMethod = ((CogMethod *) cogMethod);
@@ -8194,9 +8225,11 @@
bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader)
? 256
: 0);
+ bcpc1 += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader));
}
else {
isInBlock = 1;
+ assert(bcpc1 == ((cogMethod->startpc)));
homeMethod = cmHomeMethod(cogMethod);
map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod);
assert(map != 0);
@@ -8220,17 +8253,11 @@
endbcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation)
? ((descriptor->spanFunction))(descriptor, bcpc1, -1, aMethodObj)
: 0));
+ bcpc1 = startbcpc;
}
- bcpc1 = startbcpc;
- mcpc = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
- /* The stack check maps to the start of the first bytecode,
- the first bytecode being effectively after frame build. */
+ /* Now skip up through the bytecode pc map entry for the stack check. */
nExts = 0;
- result = 0;
- if (result != 0) {
- return result;
- }
while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) {
map -= 1;
}
@@ -11418,6 +11445,7 @@
jumpNotSI = genJumpNotSmallIntegerscratchReg(Arg0Reg, TempReg);
genShiftAwaySmallIntegerTagsInScratchReg(ClassReg);
genRemoveSmallIntegerTagsInScratchReg(Arg1Reg);
+ /* begin MulR:R: */
genMulRR(backEnd, Arg1Reg, ClassReg);
/* begin JumpOverflow: */
jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0));
@@ -11661,7 +11689,7 @@
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg));
+ jmpTarget(jumpTrue, genMoveConstantR(trueObject(), ReceiverResultReg));
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
@@ -11729,7 +11757,7 @@
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg));
+ jmpTarget(jumpCond, genMoveConstantR(trueObject(), ReceiverResultReg));
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
@@ -12105,7 +12133,7 @@
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg));
+ jmpTarget(jumpCond, genMoveConstantR(trueObject(), ReceiverResultReg));
/* begin genPrimReturn */
assert(methodOrBlockNumArgs <= (numRegArgs()));
/* begin RetN: */
@@ -12720,6 +12748,7 @@
AbstractInstruction * jumpFixedFieldsOutOfBounds;
AbstractInstruction *jumpHasFixedFields;
AbstractInstruction *jumpImmediate;
+ sqInt jumpImmutable;
AbstractInstruction *jumpIsBytes;
AbstractInstruction * jumpIsCompiledMethod;
AbstractInstruction *jumpIsContext;
@@ -12739,6 +12768,7 @@
sqInt quickConstant4;
sqInt quickConstant5;
+ jumpImmutable = 0;
/* begin genLoadArgAtDepth:into: */
assert(1 < (numRegArgs()));
/* begin genLoadArgAtDepth:into: */
@@ -12748,8 +12778,16 @@
genConvertSmallIntegerToIntegerInReg(Arg0Reg);
/* begin SubCq:R: */
anInstruction16 = genoperandoperand(SubCqR, 1, Arg0Reg);
+
+# if IMMUTABILITY
+ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg);
+ jumpImmutable = genJumpBaseHeaderImmutable(TempReg);
+
+# else /* IMMUTABILITY */
genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg);
+# endif /* IMMUTABILITY */
+
genGetNumSlotsOfinto(ReceiverResultReg, ClassReg);
/* begin CmpCq:R: */
quickConstant = weakArrayFormat();
@@ -12913,6 +12951,12 @@
/* begin RetN: */
genoperand(RetN, 0);
jmpTarget(jumpIsContext, jmpTarget(jumpNotIndexableBits, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexablePointers, jmpTarget(jumpNonSmallIntegerValue, jmpTarget(jumpFixedFieldsOutOfBounds, gLabel())))))))))))));
+
+# if IMMUTABILITY
+ jmpTarget(jumpImmutable, getJmpTarget(jumpIsContext));
+
+# endif /* IMMUTABILITY */
+
/* begin AddCq:R: */
anInstruction15 = genoperandoperand(AddCqR, 1, Arg0Reg);
genConvertIntegerToSmallIntegerInReg(Arg0Reg);
@@ -13995,6 +14039,7 @@
AbstractInstruction *jumpBadIndex;
AbstractInstruction *jumpBytesOutOfBounds;
AbstractInstruction *jumpBytesOutOfRange;
+ sqInt jumpImmutable;
AbstractInstruction *jumpIsBytes;
AbstractInstruction * jumpIsCompiledMethod;
AbstractInstruction *jumpIsShorts;
@@ -14009,6 +14054,7 @@
sqInt quickConstant3;
sqInt quickConstant4;
+ jumpImmutable = 0;
/* begin genLoadArgAtDepth:into: */
assert(1 < (numRegArgs()));
/* begin genLoadArgAtDepth:into: */
@@ -14018,8 +14064,16 @@
genConvertSmallIntegerToIntegerInReg(Arg0Reg);
/* begin SubCq:R: */
anInstruction11 = genoperandoperand(SubCqR, 1, Arg0Reg);
+
+# if IMMUTABILITY
+ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg);
+ jumpImmutable = genJumpBaseHeaderImmutable(TempReg);
+
+# else /* IMMUTABILITY */
genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg);
+# endif /* IMMUTABILITY */
+
genGetNumSlotsOfinto(ReceiverResultReg, ClassReg);
/* begin CmpCq:R: */
quickConstant = firstLongFormat();
@@ -14127,6 +14181,12 @@
/* begin RetN: */
genoperand(RetN, 0);
jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel()))))))));
+
+# if IMMUTABILITY
+ jmpTarget(jumpImmutable, getJmpTarget(jumpNotString));
+
+# endif /* IMMUTABILITY */
+
/* begin AddCq:R: */
anInstruction10 = genoperandoperand(AddCqR, 1, Arg0Reg);
genConvertIntegerToSmallIntegerInReg(Arg0Reg);
@@ -14588,6 +14648,16 @@
static void
generateObjectRepresentationTrampolines(void)
{
+ sqInt ceCannotAssignToWithIndexTrampoline;
+
+
+# if IMMUTABILITY
+
+ /* c.f. genImmutableCheck:slotIndex:sourceReg:scratchReg:popBoolean:needRestoreRcvr: */
+ ceCannotAssignToWithIndexTrampoline = genTrampolineForcalledargargarg(ceCannotAssignTowithIndexvalueToAssign, "ceCannotAssignToWithIndexTrampoline", ReceiverResultReg, TempReg, ClassReg);
+
+# endif /* IMMUTABILITY */
+
ceStoreCheckTrampoline = genTrampolineForcalledargresult(remember, "ceStoreCheckTrampoline", ReceiverResultReg, returnRegForStoreCheck());
ceStoreCheckContextReceiverTrampoline = genStoreCheckContextReceiverTrampoline();
ceScheduleScavengeTrampoline = genSafeTrampolineForcalled(ceScheduleScavenge, "ceScheduleScavengeTrampoline");
@@ -15377,7 +15447,7 @@
/* begin JumpNonZero: */
jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0));
}
- /* begin genMoveTrueR: */
+ /* begin genMoveConstant:R: */
constant = trueObject();
if (shouldAnnotateObjectReference(constant)) {
annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -21140,7 +21210,8 @@
return 0;
}
if ((code == CompletePrimitive)
- && (!(methodUsesPrimitiveErrorCode()))) {
+ && (!(((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
+ && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) {
return 0;
}
if (code == UnimplementedPrimitive) {
@@ -21179,6 +21250,7 @@
static sqInt
extendedStoreAndPopBytecode(void)
{
+ AbstractInstruction *abstractInstruction;
sqInt variableIndex;
sqInt variableType;
@@ -21189,6 +21261,14 @@
}
if (variableType == 1) {
genStorePopTemporaryVariable(1, variableIndex);
+
+# if IMMUTABILITY
+ /* begin annotateBytecode: */
+ abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ (abstractInstruction->annotation = HasBytecodePC);
+
+# endif /* IMMUTABILITY */
+
return 0;
}
if (variableType == 3) {
@@ -21201,6 +21281,7 @@
static sqInt
extendedStoreBytecode(void)
{
+ AbstractInstruction *abstractInstruction;
sqInt variableIndex;
sqInt variableType;
@@ -21211,6 +21292,14 @@
}
if (variableType == 1) {
genStorePopTemporaryVariable(0, variableIndex);
+
+# if IMMUTABILITY
+ /* begin annotateBytecode: */
+ abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ (abstractInstruction->annotation = HasBytecodePC);
+
+# endif /* IMMUTABILITY */
+
return 0;
}
if (variableType == 3) {
@@ -21886,6 +21975,19 @@
return 0;
}
+ /* SimpleStackBasedCogit>>#genMoveConstant:R: */
+static AbstractInstruction * NoDbgRegParms
+genMoveConstantR(sqInt constant, sqInt reg)
+{
+ AbstractInstruction *anInstruction;
+
+ return (shouldAnnotateObjectReference(constant)
+ ? annotateobjRef(gMoveCwR(constant, reg), constant)
+ : (/* begin MoveCq:R: */
+ (anInstruction = genoperandoperand(MoveCqR, constant, reg)),
+ anInstruction));
+}
+
/* SimpleStackBasedCogit>>#genMoveFalseR: */
static AbstractInstruction * NoDbgRegParms
genMoveFalseR(sqInt reg)
@@ -21903,7 +22005,7 @@
}
/* SimpleStackBasedCogit>>#genMoveTrueR: */
-static AbstractInstruction * NoDbgRegParms
+static sqInt NoDbgRegParms
genMoveTrueR(sqInt reg)
{
AbstractInstruction *anInstruction;
@@ -22467,19 +22569,6 @@
}
}
-
-/* Answer if methodObj contains a primitive and uses the primitive error
- code.
- */
-
- /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode */
-static sqInt
-methodUsesPrimitiveErrorCode(void)
-{
- return ((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
- && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)));
-}
-
/* SimpleStackBasedCogit>>#numSpecialSelectors */
static sqInt
numSpecialSelectors(void)
@@ -24009,7 +24098,8 @@
/* begin PushR: */
genoperand(PushR, SendNumArgsReg);
}
- if (methodUsesPrimitiveErrorCode()) {
+ if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
+ && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
compileGetErrorCode();
}
/* begin MoveAw:R: */
@@ -24099,7 +24189,15 @@
break;
case 7:
genStorePopLiteralVariable(0, byte2);
- break;
+
+# if IMMUTABILITY
+
+ /* genStorePop:LiteralVariable: annotates; don't annotate twice */
+ return 0;
+
+# endif /* IMMUTABILITY */
+
+ break;
default:
/* 5 & 6 */
@@ -24110,6 +24208,14 @@
genStorePopReceiverVariable(opType == 6, byte2);
}
+# if IMMUTABILITY
+
+ /* genStorePop:LiteralVariable: annotates; don't annotate twice */
+ return 0;
+
+# endif /* IMMUTABILITY */
+
+;
}
assert(needsFrame);
assert(!(prevInstIsPCAnnotated()));
@@ -25128,6 +25234,7 @@
return ssPushRegister(SendNumArgsReg);
}
genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg);
+ /* begin genJumpNotSmallIntegerInScratchReg: */
jmpSingle = genJumpNotSmallIntegerscratchReg(TempReg, TempReg);
/* begin MoveCq:R: */
anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg);
@@ -25359,6 +25466,8 @@
AbstractInstruction *instToAnnotate;
AbstractInstruction *jumpContinue;
AbstractInstruction *jumpNotSmallInts;
+ sqInt literal;
+ sqInt literal1;
BytecodeDescriptor *primDescriptor;
sqInt rcvrInt;
sqInt rcvrIsConst;
@@ -25427,6 +25536,7 @@
}
if (argIsInt
|| (rcvrIsInt)) {
+ /* begin genJumpNotSmallIntegerInScratchReg: */
jumpNotSmallInts = genJumpNotSmallIntegerscratchReg(TempReg, TempReg);
}
else {
@@ -25437,6 +25547,7 @@
case AddRR:
if (argIsInt) {
/* begin AddCq:R: */
+ literal = argInt - ConstZero;
anInstruction = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg);
instToAnnotate = anInstruction;
/* begin JumpNoOverflow: */
@@ -25469,6 +25580,7 @@
/* begin JumpNoOverflow: */
jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0));
/* begin AddCq:R: */
+ literal1 = argInt - ConstZero;
anInstruction4 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg);
}
else {
@@ -25642,6 +25754,7 @@
}
if (argIsInt
|| (rcvrIsInt)) {
+ /* begin genJumpNotSmallIntegerInScratchReg: */
jumpNotSmallInts = genJumpNotSmallIntegerscratchReg(TempReg, TempReg);
}
else {
@@ -25650,13 +25763,13 @@
if (argIsInt) {
if (annotateInst) {
/* begin annotateBytecode: */
- anInstruction2 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg);
- abstractInstruction = anInstruction2;
+ anInstruction = genoperandoperand(CmpCqR, argInt, ReceiverResultReg);
+ abstractInstruction = anInstruction;
(abstractInstruction->annotation = HasBytecodePC);
}
else {
/* begin CmpCq:R: */
- anInstruction = genoperandoperand(CmpCqR, argInt, ReceiverResultReg);
+ anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg);
}
}
else {
@@ -25672,7 +25785,7 @@
jmpTarget(jumpNotSmallInts, gLabel());
if (argIsInt) {
/* begin MoveCq:R: */
- anInstruction1 = genoperandoperand(MoveCqR, argInt, Arg0Reg);
+ anInstruction2 = genoperandoperand(MoveCqR, argInt, Arg0Reg);
}
index = byte0 - ((bytecodeSetOffset == 256
? AltFirstSpecialSelector + 256
@@ -26026,10 +26139,18 @@
AbstractInstruction *abstractInstruction;
AbstractInstruction *anInstruction;
sqInt association;
+ sqInt immutabilityFailure;
sqInt needStoreCheck;
sqInt topReg;
+ immutabilityFailure = 0;
assert(needsFrame);
+
+# if IMMUTABILITY
+ ssFlushTo(simStackPtr - 1);
+
+# endif /* IMMUTABILITY */
+
needStoreCheck = !(isUnannotatableConstant(ssTop()));
association = getLiteral(litVarIndex);
(optStatus.isReceiverResultRegLive = 0);
@@ -26043,9 +26164,20 @@
anInstruction = genoperandoperand(MoveCqR, association, ReceiverResultReg);
}
genEnsureObjInRegNotForwardedscratchReg(ReceiverResultReg, TempReg);
+
+# if IMMUTABILITY
+ ssAllocateRequiredReg(ClassReg);
+ topReg = ClassReg;
+ ssStoreAndReplacePoptoReg(popBoolean, ClassReg);
+ ssFlushTo(simStackPtr);
+ immutabilityFailure = genImmutableCheckslotIndexsourceRegscratchRegneedRestoreRcvr(ReceiverResultReg, ValueIndex, ClassReg, TempReg, 0);
+
+# else /* IMMUTABILITY */
topReg = allocateRegForStackEntryAtnotConflictingWith(0, registerMaskFor(ReceiverResultReg));
ssStorePoptoReg(popBoolean, topReg);
+# endif /* IMMUTABILITY */
+
if (traceStores > 0) {
/* begin MoveR:R: */
genoperandoperand(MoveRR, topReg, TempReg);
@@ -26054,6 +26186,12 @@
(abstractInstruction->annotation = IsRelativeCall);
}
genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, ValueIndex, ReceiverResultReg, TempReg, needsFrame, needStoreCheck);
+
+# if IMMUTABILITY
+ jmpTarget(immutabilityFailure, gLabel());
+
+# endif /* IMMUTABILITY */
+
return 0;
}
@@ -26064,6 +26202,7 @@
AbstractInstruction *abstractInstruction;
AbstractInstruction *abstractInstruction1;
AbstractInstruction *anInstruction;
+ sqInt immutabilityFailure;
AbstractInstruction *jmpDone;
AbstractInstruction *jmpSingle;
sqInt needStoreCheck;
@@ -26072,7 +26211,14 @@
/* The reason we need a frame here is that assigning to an inst var of a context may
involve wholesale reorganization of stack pages, and the only way to preserve the
execution state of an activation in that case is if it has a frame. */
+ immutabilityFailure = 0;
assert(needsFrame);
+
+# if IMMUTABILITY
+ ssFlushTo(simStackPtr - 1);
+
+# endif /* IMMUTABILITY */
+
ssFlushUpThroughReceiverVariable(slotIndex);
/* Note that ReceiverResultReg remains live after both
@@ -26083,8 +26229,17 @@
ssAllocateCallRegand(ClassReg, SendNumArgsReg);
ssPush(1);
genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg);
+
+# if IMMUTABILITY
+ ssStoreAndReplacePoptoReg(popBoolean, ClassReg);
+ ssFlushTo(simStackPtr);
+
+# else /* IMMUTABILITY */
ssStorePoptoReg(popBoolean, ClassReg);
+# endif /* IMMUTABILITY */
+
+ /* begin genJumpNotSmallIntegerInScratchReg: */
jmpSingle = genJumpNotSmallIntegerscratchReg(TempReg, TempReg);
/* begin MoveCq:R: */
anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg);
@@ -26101,8 +26256,20 @@
abstractInstruction = genoperand(Call, ceTraceStoreTrampoline);
(abstractInstruction->annotation = IsRelativeCall);
}
+
+# if IMMUTABILITY
+ immutabilityFailure = genImmutableCheckslotIndexsourceRegscratchRegneedRestoreRcvr(ReceiverResultReg, ValueIndex, ClassReg, TempReg, 1);
+
+# endif /* IMMUTABILITY */
+
genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(ClassReg, slotIndex, ReceiverResultReg, TempReg, 1, needStoreCheck);
jmpTarget(jmpDone, gLabel());
+
+# if IMMUTABILITY
+ jmpTarget(immutabilityFailure, gLabel());
+
+# endif /* IMMUTABILITY */
+
return 0;
}
@@ -26112,17 +26279,37 @@
{
AbstractInstruction *abstractInstruction;
AbstractInstruction *abstractInstruction1;
+ sqInt immutabilityFailure;
sqInt needStoreCheck;
sqInt topReg;
+ immutabilityFailure = 0;
+
+# if IMMUTABILITY
+ assert(needsFrame);
+ ssFlushTo(simStackPtr - 1);
+
+# endif /* IMMUTABILITY */
+
ssFlushUpThroughReceiverVariable(slotIndex);
/* Note that ReceiverResultReg remains live after ceStoreCheckTrampoline. */
needStoreCheck = !(isUnannotatableConstant(ssTop()));
ensureReceiverResultRegContainsSelf();
+
+# if IMMUTABILITY
+ ssAllocateRequiredReg(ClassReg);
+ topReg = ClassReg;
+ ssStoreAndReplacePoptoReg(popBoolean, ClassReg);
+ ssFlushTo(simStackPtr);
+ immutabilityFailure = genImmutableCheckslotIndexsourceRegscratchRegneedRestoreRcvr(ReceiverResultReg, slotIndex, ClassReg, TempReg, 1);
+
+# else /* IMMUTABILITY */
topReg = allocateRegForStackEntryAtnotConflictingWith(0, registerMaskFor(ReceiverResultReg));
ssStorePoptoReg(popBoolean, topReg);
+# endif /* IMMUTABILITY */
+
if (traceStores > 0) {
/* begin MoveR:R: */
genoperandoperand(MoveRR, topReg, TempReg);
@@ -26142,6 +26329,12 @@
}
}
genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needStoreCheck);
+
+# if IMMUTABILITY
+ jmpTarget(immutabilityFailure, gLabel());
+
+# endif /* IMMUTABILITY */
+
return 0;
}
@@ -26427,14 +26620,13 @@
AbstractInstruction *anInstruction1;
AbstractInstruction *anInstruction2;
AbstractInstruction *anInstruction3;
- AbstractInstruction *anInstruction4;
sqInt index;
sqInt numSpilled;
assert(needsFrame);
ssAllocateCallReg(ReceiverResultReg);
- /* begin MoveMw:r:R: */
- anInstruction4 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, ReceiverResultReg);
+ /* begin putSelfInReceiverResultReg */
+ storeToReg((&simSelf), ReceiverResultReg);
ssFlushTo(simStackPtr - numArgs);
if (numArgs > 2) {
Modified: branches/Cog/nsspur64src/vm/cointerp.c
===================================================================
--- branches/Cog/nsspur64src/vm/cointerp.c 2016-01-20 02:33:22 UTC (rev 3563)
+++ branches/Cog/nsspur64src/vm/cointerp.c 2016-01-22 01:28:22 UTC (rev 3564)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1660 uuid: 372f5635-366a-462d-8979-ae86dee05577
from
- CoInterpreter VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748
+ CoInterpreter VMMaker.oscog-eem.1660 uuid: 372f5635-366a-462d-8979-ae86dee05577
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1656 uuid: 02086cbf-8db3-4035-9f0d-f2671db50748 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1660 uuid: 372f5635-366a-462d-8979-ae86dee05577 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -226,8 +226,8 @@
#define EnclosingObjectIndex 4
#define EncounteredUnknownBytecode -6
#define EndOfRun 0x101
-#if !defined(EnforceAccessControl) /* Allow EnforceAccessControl to be overridden on the compiler command line */
-# define EnforceAccessControl 1
+#if !defined(EnforceAccessControl) /* Allow this to be overridden on the compiler command line */
+#define EnforceAccessControl 1
#endif
#define ExcessSignalsIndex 2
#define ExternalObjectsArray 38
@@ -252,7 +252,9 @@
#define HasBeenReturnedFromMCPCOop 0xFFFFFFFFFFFFFFF9ULL
#define HeaderIndex 0
#define IFrameSlots 7
+#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */
#define IMMUTABILITY 0
+#endif
#define InstanceSpecificationIndex 2
#define InstructionPointerIndex 1
#define KeyIndex 0
@@ -407,6 +409,9 @@
#define TrueObject 2
#define V3PrimitiveBitsMask 0x80000FF8ULL
#define ValueIndex 1
+#if !defined(VMBIGENDIAN) /* Allow this to be overridden on the compiler command line */
+#define VMBIGENDIAN 0
+#endif
#define WeaklingStackRootIndex 0x1001
#define XIndex 0
#define YIndex 1
@@ -870,7 +875,7 @@
extern void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
extern usqInt freeStartAddress(void);
extern usqInt getScavengeThreshold(void);
-static sqLong NoDbgRegParms headerWhileForwardingOf(sqInt aCompiledMethodObjOop);
+static sqInt NoDbgRegParms headerWhileForwardingOf(sqInt aCompiledMethodObjOop);
extern sqInt isForwardedClassIndex(sqInt maybeClassIndex);
extern sqInt isImmediateClass(sqInt classObj);
extern sqInt isReallyYoungObject(sqInt objOop);
@@ -1100,6 +1105,7 @@
extern sqInt isInOldSpace(sqInt address);
static sqInt NoDbgRegParms isInPastSpace(sqInt address);
extern sqInt isNonImmediate(sqInt oop);
+static sqInt NoDbgRegParms isObjImmutable(sqInt anOop);
extern sqInt isOldObject(sqInt objOop);
extern sqInt isOopCompiledMethod(sqInt oop);
extern sqInt isOopForwarded(sqInt oop);
@@ -2430,7 +2436,7 @@
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1656";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1660";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -4766,6 +4772,16 @@
/* begin internalPop: */
localSP += 1 * BytesPerOop;
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(rcvr))));
+ if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(top, rcvr, instVarIndex);
+ goto l1;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(rcvr)));
if (isOldObject(rcvr)) {
@@ -5744,6 +5760,16 @@
if (variableType == 0) {
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
objOop = longAt(localFP + FoxIFReceiver);
+
+# if IMMUTABILITY
+ assert(!((isImmediate(objOop))));
+ if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(value, objOop, variableIndex);
+ goto l4;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(objOop)));
if (isOldObject(objOop)) {
@@ -5791,6 +5817,16 @@
litVar = referent;
}
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(litVar))));
+ if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(value, litVar, ValueIndex);
+ goto l5;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(litVar)));
if (isOldObject(litVar)) {
@@ -5839,6 +5875,16 @@
if (variableType == 0) {
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
objOop = longAt(localFP + FoxIFReceiver);
+
+# if IMMUTABILITY
+ assert(!((isImmediate(objOop))));
+ if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(value, objOop, variableIndex);
+ goto l7;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(objOop)));
if (isOldObject(objOop)) {
@@ -5886,6 +5932,16 @@
litVar = referent;
}
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(litVar))));
+ if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(value, litVar, ValueIndex);
+ goto l8;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(litVar)));
if (isOldObject(litVar)) {
@@ -6530,6 +6586,16 @@
litVar = referent;
}
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(litVar))));
+ if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(top, litVar, ValueIndex);
+ goto l14;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(litVar)));
if (isOldObject(litVar)) {
@@ -6561,6 +6627,7 @@
&& (((((longAt((rcvr1 + BaseHeaderSize) + (((long)SenderIndex) << (shiftForWord()))))) & 7) == 1)))) {
/* begin instVar:ofContext:put: */
assert(isMarriedOrWidowedContext(rcvr1));
+ assert(!((isObjImmutable(rcvr1))));
/* begin writeBackHeadFramePointers */
assert(GIV(stackPage) == (mostRecentlyUsedPage()));
/* begin setHeadFP:andSP:inPage: */
@@ -6649,6 +6716,16 @@
}
else {
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(rcvr1))));
+ if (((((usqInt) (longAt(rcvr1))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(top, rcvr1, byte3);
+ goto l11;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(rcvr1)));
if (isOldObject(rcvr1)) {
@@ -9388,8 +9465,16 @@
value = longAtPointer(localSP);
index = longAtPointer(localSP + (1 * BytesPerOop));
rcvr = longAtPointer(localSP + (2 * BytesPerOop));
+
+# if IMMUTABILITY
+ correctRcvr = ((rcvr & (tagMask())) == 0)
+ && (!(((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0));
+
+# else /* IMMUTABILITY */
correctRcvr = (rcvr & (tagMask())) == 0;
+# endif /* IMMUTABILITY */
+
if (correctRcvr
&& ((((index) & 7) == 1))) {
@@ -12205,8 +12290,16 @@
value = longAtPointer(localSP);
index = longAtPointer(localSP + (1 * BytesPerOop));
rcvr = longAtPointer(localSP + (2 * BytesPerOop));
+
+# if IMMUTABILITY
+ correctRcvr = ((rcvr & (tagMask())) == 0)
+ && (!(((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0));
+
+# else /* IMMUTABILITY */
correctRcvr = (rcvr & (tagMask())) == 0;
+# endif /* IMMUTABILITY */
+
if (correctRcvr
&& ((((index) & 7) == 1))) {
@@ -12815,6 +12908,16 @@
/* begin internalPop: */
localSP += 1 * BytesPerOop;
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(rcvr))));
+ if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(top, rcvr, instVarIndex);
+ goto l165;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(rcvr)));
if (isOldObject(rcvr)) {
@@ -13297,6 +13400,7 @@
&& (((((longAt((rcvr + BaseHeaderSize) + (((long)SenderIndex) << (shiftForWord()))))) & 7) == 1)))) {
/* begin instVar:ofContext:put: */
assert(isMarriedOrWidowedContext(rcvr));
+ assert(!((isObjImmutable(rcvr))));
/* begin writeBackHeadFramePointers */
assert(GIV(stackPage) == (mostRecentlyUsedPage()));
/* begin setHeadFP:andSP:inPage: */
@@ -13385,6 +13489,16 @@
}
else {
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(rcvr))));
+ if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(anObject, rcvr, variableIndex);
+ goto l172;
+ }
+
+# endif /* IMMUTABILITY */
+
/* begin storePointer:ofObject:withValue: */
assert(!(isForwarded(rcvr)));
if (isOldObject(rcvr)) {
@@ -13430,6 +13544,16 @@
litVar = referent;
}
/* begin storePointerImmutabilityCheck:ofObject:withValue: */
+
+# if IMMUTABILITY
+ assert(!((isImmediate(litVar))));
+ if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) {
+ cannotAssigntowithIndex(longAtPointer(localSP), litVar, ValueIndex);
+ goto l174;
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list