[Vm-dev] [commit][2805] Spur Stack VM src and OSPlugin src as per VMMaker.oscog-eem. 510.

commits at squeakvm.org commits at squeakvm.org
Wed Nov 13 22:27:22 UTC 2013


Revision: 2805
Author:   eliot
Date:     2013-11-13 14:27:21 -0800 (Wed, 13 Nov 2013)
Log Message:
-----------
Spur Stack VM src and OSPlugin src as per VMMaker.oscog-eem.510.

See VMMaker.oscog-eem.510 history for Spur VM changes (this is not ready for
any kind of use).

Add spur stack unix build.
Add win32 alloc for Spur memory segments.
Fix the Spur cygwinbuild.

Modified Paths:
--------------
    branches/Cog/platforms/Mac OS/vm/sqMacMain.c
    branches/Cog/platforms/win32/vm/sqWin32Alloc.c
    branches/Cog/platforms/win32/vm/sqWin32Alloc.h
    branches/Cog/platforms/win32/vm/sqWin32Intel.c
    branches/Cog/spurstackbuild/cygwinbuild/Makefile
    branches/Cog/spurstackbuild/cygwinbuild/mvm
    branches/Cog/spurstackbuild/macbuild/mvm
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/spurstacksrc/vm/interp.h
    branches/Cog/spurstacksrc/vm/vmCallback.h
    branches/Cog/src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c
    branches/Cog/src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c

Added Paths:
-----------
    branches/Cog/spurstackbuild/unixbuild/
    branches/Cog/spurstackbuild/unixbuild/HowToBuild
    branches/Cog/spurstackbuild/unixbuild/astbld/
    branches/Cog/spurstackbuild/unixbuild/astbld/mvm
    branches/Cog/spurstackbuild/unixbuild/astbld/plugins.ext
    branches/Cog/spurstackbuild/unixbuild/astbld/plugins.int
    branches/Cog/spurstackbuild/unixbuild/astbldt/
    branches/Cog/spurstackbuild/unixbuild/astbldt/mvm
    branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.ext
    branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.int
    branches/Cog/spurstackbuild/unixbuild/bld/
    branches/Cog/spurstackbuild/unixbuild/bld/mvm
    branches/Cog/spurstackbuild/unixbuild/bld/plugins.ext
    branches/Cog/spurstackbuild/unixbuild/bld/plugins.int
    branches/Cog/spurstackbuild/unixbuild/bldt/
    branches/Cog/spurstackbuild/unixbuild/bldt/mvm
    branches/Cog/spurstackbuild/unixbuild/bldt/plugins.ext
    branches/Cog/spurstackbuild/unixbuild/bldt/plugins.int
    branches/Cog/spurstackbuild/unixbuild/dbgbld/
    branches/Cog/spurstackbuild/unixbuild/dbgbld/mvm
    branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.ext
    branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.int
    branches/Cog/spurstackbuild/unixbuild/dbgbldt/
    branches/Cog/spurstackbuild/unixbuild/dbgbldt/mvm
    branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.ext
    branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.int
    branches/Cog/spurstackbuild/unixbuild/mkNamedPrims.sh

Property Changed:
----------------
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Sat Nov  2 14:13:36 PDT 2013
   + Wed Nov 13 14:25:08 PST 2013

Modified: branches/Cog/platforms/Mac OS/vm/sqMacMain.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacMain.c	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/platforms/Mac OS/vm/sqMacMain.c	2013-11-13 22:27:21 UTC (rev 2805)
@@ -1046,12 +1046,17 @@
   char *info= (char *)malloc(4096);
   info[0]= '\0';
 
+#if SPURVM
+# define ObjectMemory " Spur"
+#else
+# define ObjectMemory
+#endif
 #if defined(NDEBUG)
-# define BuildVariant "Production"
+# define BuildVariant "Production" ObjectMemory
 #elif DEBUGVM
-# define BuildVariant "Debug"
+# define BuildVariant "Debug" ObjectMemory
 # else
-# define BuildVariant "Assert"
+# define BuildVariant "Assert" ObjectMemory
 #endif
 
   if (verbose)

Modified: branches/Cog/platforms/win32/vm/sqWin32Alloc.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Alloc.c	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/platforms/win32/vm/sqWin32Alloc.c	2013-11-13 22:27:21 UTC (rev 2805)
@@ -29,7 +29,7 @@
 #endif
 
 static LPSTR  pageBase;     /* base address of allocated memory */
-static DWORD  pageBits;     /* bit mask for the start of a memory page */
+static DWORD  pageMask;     /* bit mask for the start of a memory page */
 static DWORD  pageSize;     /* size of a memory page */
 static DWORD  nowReserved;  /* 'publicly' reserved virtual memory */
 static LPSTR  pageLimit;    /* upper limit of commited pages */
@@ -60,13 +60,13 @@
   /* determine page boundaries */
   GetSystemInfo(&sysInfo);
   pageSize = sysInfo.dwPageSize;
-  pageBits = ~(pageSize - 1);
+  pageMask = ~(pageSize - 1);
 
   /* round the requested size up to the next page boundary */
-  nowReserved = (desiredHeapSize + pageSize) & pageBits;
+  nowReserved = (desiredHeapSize + pageSize) & pageMask;
 
   /* round the initial commited size up to the next page boundary */
-  initialCommit = (minHeapSize + pageSize) & pageBits;
+  initialCommit = (minHeapSize + pageSize) & pageMask;
 
   /* Here, we only reserve the maximum memory to be used
      It will later be committed during actual access */
@@ -107,7 +107,7 @@
   if(fShowAllocations) {
     warnPrintf("Growing memory by %d...", delta);
   }
-  delta = (delta + pageSize) & pageBits;
+  delta = (delta + pageSize) & pageMask;
   if(!VirtualAlloc(pageLimit, delta, MEM_COMMIT, PAGE_READWRITE)) {
     if(fShowAllocations) {
       warnPrintf("failed\n");
@@ -139,7 +139,7 @@
     return oldLimit;
   }
 #endif
-  delta &= pageBits;
+  delta &= pageMask;
   if(!VirtualFree(pageLimit-delta, delta, MEM_DECOMMIT)) {
     if(fShowAllocations) {
       warnPrintf("failed\n");
@@ -176,17 +176,11 @@
   }
   return bytesLeft;
 }
+#endif /* NO_VIRTUAL_MEMORY */
 
-/************************************************************************/
-/* sqMemReleaseMemory: Release virtual memory                            */
-/************************************************************************/
-void sqReleaseMemory(void)
-{
-  /* Win32 will do that for us */
-}
+#define roundDownToPage(v) ((v)&pageMask)
+#define roundUpToPage(v) (((v)+pageSize-1)&pageMask)
 
-#endif /* NO_VIRTUAL_MEMORY */
-
 #if COGVM
 void
 sqMakeMemoryExecutableFromTo(unsigned long startAddr, unsigned long endAddr)
@@ -212,3 +206,42 @@
 		perror("VirtualProtect(x,y,PAGE_EXECUTE_READWRITE)");
 }
 #endif /* COGVM */
+
+#if SPURVM
+/* Allocate a region of memory of al least size bytes, at or above minAddress.
+ *  If the attempt fails, answer null.  If the attempt succeeds, answer the
+ * start of the region and assign its size through allocatedSizePointer.
+ */
+void *
+sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(sqInt size, void *minAddress, sqInt *allocatedSizePointer)
+{
+	void *alloc;
+	long bytes = roundUpToPage(size);
+
+	*allocatedSizePointer = bytes;
+	alloc = VirtualAlloc(0, bytes, MEM_COMMIT, PAGE_READWRITE);
+	if (!alloc) {
+		sqMessageBox(MB_OK | MB_ICONSTOP, TEXT("VM Error:"),
+					"Unable to VirtualAlloc committed memory (%d bytes requested)",
+					bytes);
+		return NULL;
+	}
+	if ((unsigned long)alloc >= (unsigned long)minAddress)
+		return alloc;
+	if (!VirtualFree(alloc, bytes, MEM_RELEASE))
+		sqMessageBox(MB_OK | MB_ICONSTOP, TEXT("VM Warning:"),
+					"Unable to VirtualFree committed memory (%d bytes requested)",
+					bytes);
+	alloc = VirtualAlloc(0, bytes, MEM_COMMIT+MEM_TOP_DOWN, PAGE_READWRITE);
+	if ((unsigned long)alloc >= (unsigned long)minAddress)
+		return alloc;
+	if (!VirtualFree(alloc, bytes, MEM_RELEASE))
+		sqMessageBox(MB_OK | MB_ICONSTOP, TEXT("VM Warning:"),
+					"Unable to VirtualFree committed memory (%d bytes requested)",
+					bytes);
+	sqMessageBox(MB_OK | MB_ICONSTOP, TEXT("VM Error:"),
+				"Unable to VirtualAlloc committed memory at desired address (%d bytes requested at or above %p)",
+				bytes, minAddress);
+	return NULL;
+}
+#endif /* SPURVM */

Modified: branches/Cog/platforms/win32/vm/sqWin32Alloc.h
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Alloc.h	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/platforms/win32/vm/sqWin32Alloc.h	2013-11-13 22:27:21 UTC (rev 2805)
@@ -28,7 +28,5 @@
 int sqShrinkMemoryBy(int oldLimit, int delta);
 int sqMemoryExtraBytesLeft(int includingSwap);
 
-void sqReleaseMemory(void);
-
 #endif /* NO_VIRTUAL_MEMORY */
 #endif /* __SQ_WIN32_ALLOC_H */

Modified: branches/Cog/platforms/win32/vm/sqWin32Intel.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Intel.c	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/platforms/win32/vm/sqWin32Intel.c	2013-11-13 22:27:21 UTC (rev 2805)
@@ -1188,9 +1188,6 @@
       fclose(stdout);
       remove(stdoutName);
     }
-#ifndef NO_VIRTUAL_MEMORY
-  sqReleaseMemory();
-#endif
   OleUninitialize();
 }
 

Modified: branches/Cog/spurstackbuild/cygwinbuild/Makefile
===================================================================
--- branches/Cog/spurstackbuild/cygwinbuild/Makefile	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/spurstackbuild/cygwinbuild/Makefile	2013-11-13 22:27:21 UTC (rev 2805)
@@ -9,7 +9,7 @@
 CONFIGURATION=product
 
 # The name of the VM to build
-VM:=Croquet
+VM:=Squeak
 VM_NAME?=$(VM)
 
 # Is this a Croquet VM (defaults to OGL instead of D3D)?
@@ -35,7 +35,7 @@
 OBJDIR:= $(BLDDIR)/vm
 
 # N.B. PLATDIR *must* be a relative path, see -f../../$(shell ./eitheror ... below
-PLATDIR:=../platforms
+PLATDIR:=../../platforms
 CROSSDIR:=$(PLATDIR)/Cross/vm
 WIN32DIR:=$(PLATDIR)/win32/vm
 MAKERDIR:=$(VMSRCDIR)/vm

Modified: branches/Cog/spurstackbuild/cygwinbuild/mvm
===================================================================
--- branches/Cog/spurstackbuild/cygwinbuild/mvm	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/spurstackbuild/cygwinbuild/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -1,5 +1,5 @@
 #!/bin/sh
-rm -rf build*/vm/Croquet*.exe
+rm -rf build*/vm/Squeak*.exe
 make debug;make assert;make
 make THREADING=multi CONFIGURATION=debug;make THREADING=multi CONFIGURATION=assert;make THREADING=multi
-ls -rlt build*/vm/Croquet*.exe
+ls -rlt build*/vm/Squeak*.exe

Modified: branches/Cog/spurstackbuild/macbuild/mvm
===================================================================
--- branches/Cog/spurstackbuild/macbuild/mvm	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/spurstackbuild/macbuild/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -7,7 +7,7 @@
 while [ -n "$1" ]; do
 	case $1 in
 	-c)	C=-c;; #-c == Core VM only
-	-A)	D=LOGD;A=LOGA;F=LOGS;;
+	-A)	D=LOGD;A=LOGA;F=LOGF;;
 	-d)	D=LOGD;;
 	-a)	A=LOGA;;
 	-f)	F=LOGF;;

Added: branches/Cog/spurstackbuild/unixbuild/HowToBuild
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/HowToBuild	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/HowToBuild	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,104 @@
+How To Build On Linux
+---------------------
+
+Contents:
+	- How to build the Spur Stack VM on Unix
+	- Testing an external plugin has completely linked
+	- Compiling in 32-bit mode on a 64-bit linux
+	- Testing an external plugin has completely linked
+	- N.B. Please read: Optimization level and gcc version
+
+How to build the Newspeak VM on Unix
+-------------------------------
+1. Install the tools (gcc, X11-devel, etc (e.g. libpng, libX11 & libxt source))
+2. Check out the following sources from svn (if you haven't already - if you're
+   reading this in unixbuild its likely you've already got the sources)
+     svn co http://www.squeakvm.org/svn/squeak/branches/Cog/platforms
+     svn co http://www.squeakvm.org/svn/squeak/branches/Cog/spurstacksrc
+     svn co http://www.squeakvm.org/svn/squeak/branches/Cog/spurstackbuild
+3. Open a shell, cd into the spurstackbuild/unixbuild/bld directory and execute
+   the mvm script.  This installs a VM in the sslinux  directory alongside
+   spurstacksrc et al.  Alternatively you can configure your own VM, e.g. with
+     ../../../platforms/unix/config/configure --with-src=spurstacksrc CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNO_VM_PROFILE=1 -DDEBUGVM=0" LIBS="-lpthread -luuid" LDFLAGS=-Wl,-z,now
+     make install prefix=WhereYouWantTheVmToGo
+
+	N.B.  On Ubuntu *do not* supply "LIBS="-lpthread -luuid"", i.e. use
+     ../../../platforms/unix/config/configure --with-src=spurstacksrc CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNO_VM_PROFILE=1 -DDEBUGVM=0" LDFLAGS=-Wl,-z,now
+
+4. At the end of it you'll get a new VM in sslinux, or in the path provided
+   via -prefix
+
+N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir.
+
+
+3a. For an assert-enabled VM use the astbld directory's mvm and find a vm in
+    sslinuxast, or do
+     ../../../platforms/unix/config/configure --with-src=spurstacksrc CFLAGS="-g -O1 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_VM_PROFILE=1 -DDEBUGVM=0 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" LIBS="-lpthread -luuid" LDFLAGS=-Wl,-z,now
+
+3b. For a full debug VM use the dbgbld's mvm and find a vm in sslinuxdbg,
+    or do
+	CFLAGS="-g -O0 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_VM_PROFILE=1 -DDEBUGVM=1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" LIBS="-lpthread -luuid" LDFLAGS=-Wl,-z,now
+
+3c. If you're building the VM on a 64-bit OS, you'll need a compiler which can
+compile and link to 32-bit binaries. On most Linuxes the gcc-multilib package
+provides the 32-bit compiler and the ia32-libs provides the 32-bit libraries.
+You'll also have to add the -m32 switch to all gcc & g++ invocations.  The
+easiest way to do this is to add CC="gcc -m32" & CXX="g++ -m32" to the configure
+script:
+     ../../../platforms/unix/config/configure CC="gcc -m32" CXX="g++ -m32" --with-src=spurstacksrc CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNO_VM_PROFILE=1" LIBS="-lpthread -luuid"
+To run a 32-bit VM on a 64-bit OS, you'll also need the 32-bit libraries
+provided by the ia32-libs package.
+
+
+3c. (see Compiling in 32-bit mode on a 64-bit linux below)
+If you're building the VM on a 64-bit OS, you'll need a compiler which can
+compile and link to 32-bit binaries. On most Linuxes the gcc-multilib package
+provides the 32-bit compiler and the ia32-libs provides the 32-bit libraries.
+You'll also have to add the -m32 switch to all gcc & g++ invocations.  The
+easiest way to do this is to add CC="gcc -m32" & CXX="g++ -m32" to the configure
+script:
+     ../../platforms/unix/config/configure CC="gcc -m32" CXX="g++ -m32" --without-npsqueak CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread
+To run a 32-bit VM on a 64-bit OS, you'll also need the 32-bit libraries
+provided by the ia32-libs package.
+
+Compiling in 32-bit mode on a 64-bit linux
+-------------------------------
+Follow 3c. above.  Also note that according to Paul DeBruicker the following
+packages need to be installed to compile in 32-bt mode on 64-bit ubuntu.  YMMV.
+
+build-essential
+ia32-libs
+gcc-multilib
+g++multilib
+
+In addition phil at highoctane.be installed libc6dev-i386.
+
+This in itself may not be enough, but persistence will pay off.  See for example
+http://permalink.gmane.org/gmane.comp.lang.smalltalk.pharo.devel/75198.
+
+Testing an external plugin has completely linked
+-------------------------------
+You may find that an external plugin compiles and links but does not load.
+This is usually because it contans undefined symbols.  To find undefined
+symbols, remake the plugin, capturing the link step and then supply
+	-Wl,--warn-unresolved-symbols -Wl,--no-allow-shlib-undefined
+when manually repeating the link command
+
+
+Optimization level and gcc version
+----------------------------------
+There are issues with gcc version > 4.2.1.  Any of the following flags may break the build at -O2:
+-ftree-pre
+-fpartial-inlining
+-fcaller-saves
+
+So turn them off.  e.g.
+     ../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g -O2 -msse2 -fno-caller-saves -fno-partial-inlining -fno-tree-pre -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread
+See http://smallissimo.blogspot.fr/2013/02/compiling-squeak-cog-virtual-machine-on.html
+
+There appear to be issues with 3.4.x gcc version on RedHat.  In particular
+compiling the Newspeak VM with either of
+	gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)
+	gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)
+using -O2 results in a VM that segfaults early in startup.  For these compilers
+it is probably wise to use -O1, even though -O3 seems to work.

Added: branches/Cog/spurstackbuild/unixbuild/astbld/mvm
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/astbld/mvm	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/astbld/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,27 @@
+#!/bin/bash
+INSTALLDIR=sslinuxast
+if [ $# -ge 1 ]; then
+	case "$1" in
+	-*)	;;
+	*)	INSTALLDIR="$1"; shift
+	esac
+fi
+OPT=-O1
+
+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 config.h || ../../../platforms/unix/config/configure --with-src=spurstacksrc \
+	--without-vm-display-fbdev --without-npsqueak \
+	CC="gcc -m32" \
+	CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DTIIMER_HEARTBEAT=1 -DDEBUGVM=0 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" \
+	LIBS="-lpthread -luuid" \
+	LDFLAGS=-Wl,-z,now
+../../../scripts/nukeversion
+rm -rf ../../../$INSTALLDIR
+# would prefer make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install prefix=`(cd ../../../;pwd)`/$INSTALLDIR


Property changes on: branches/Cog/spurstackbuild/unixbuild/astbld/mvm
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/Cog/spurstackbuild/unixbuild/astbld/plugins.ext
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/astbld/plugins.ext	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/astbld/plugins.ext	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL

Added: branches/Cog/spurstackbuild/unixbuild/astbld/plugins.int
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/astbld/plugins.int	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/astbld/plugins.int	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,26 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin

Added: branches/Cog/spurstackbuild/unixbuild/astbldt/mvm
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/astbldt/mvm	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/astbldt/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,28 @@
+#!/bin/bash
+# VM with VM profiler and threaded heartbeat assuming multiple thread priorities
+INSTALLDIR=sslinuxastht
+if [ $# -ge 1 ]; then
+	case "$1" in
+	-*)	;;
+	*)	INSTALLDIR="$1"; shift
+	esac
+fi
+OPT=-O1
+
+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 config.h || ../../../platforms/unix/config/configure --with-src=spurstacksrc \
+	--without-vm-display-fbdev --without-npsqueak \
+	CC="gcc -m32" \
+	CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUGVM=0 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" \
+	LIBS="-lpthread -luuid" \
+	LDFLAGS=-Wl,-z,now
+../../../scripts/nukeversion
+rm -rf ../../../$INSTALLDIR
+# would prefer make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install prefix=`(cd ../../../;pwd)`/$INSTALLDIR


Property changes on: branches/Cog/spurstackbuild/unixbuild/astbldt/mvm
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.ext
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.ext	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.ext	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL

Added: branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.int
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.int	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/astbldt/plugins.int	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,26 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin

Added: branches/Cog/spurstackbuild/unixbuild/bld/mvm
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/bld/mvm	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/bld/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,31 @@
+#!/bin/bash
+INSTALLDIR=sslinux
+if [ $# -ge 1 ]; then
+	case "$1" in
+	-*)	;;
+	*)	INSTALLDIR="$1"; shift
+	esac
+fi
+# Some gcc versions create a broken VM using -O2
+case `gcc -v 2>&1 | grep version | sed 's/gcc version *//'` in
+3.4.*)	OPT=-O1;;
+*)		OPT=-O2;;
+esac
+
+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 config.h || ../../../platforms/unix/config/configure --with-src=spurstacksrc \
+	--without-vm-display-fbdev --without-npsqueak \
+	CC="gcc -m32" \
+	CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DDEBUGVM=0" \
+	LIBS="-lpthread -luuid" \
+	LDFLAGS=-Wl,-z,now
+../../../scripts/nukeversion
+rm -rf ../../../$INSTALLDIR
+# would prefer make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install prefix=`(cd ../../../;pwd)`/$INSTALLDIR


Property changes on: branches/Cog/spurstackbuild/unixbuild/bld/mvm
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/Cog/spurstackbuild/unixbuild/bld/plugins.ext
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/bld/plugins.ext	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/bld/plugins.ext	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL

Added: branches/Cog/spurstackbuild/unixbuild/bld/plugins.int
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/bld/plugins.int	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/bld/plugins.int	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,26 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin

Added: branches/Cog/spurstackbuild/unixbuild/bldt/mvm
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/bldt/mvm	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/bldt/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,32 @@
+#!/bin/bash
+# VM with VM profiler and threaded heartbeat assuming multiple thread priorities
+INSTALLDIR=sslinuxht
+if [ $# -ge 1 ]; then
+	case "$1" in
+	-*)	;;
+	*)	INSTALLDIR="$1"; shift
+	esac
+fi
+# Some gcc versions create a broken VM using -O2
+case `gcc -v 2>&1 | grep version | sed 's/gcc version *//'` in
+3.4.*)	OPT=-O1;;
+*)		OPT=-O2;;
+esac
+
+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 config.h || ../../../platforms/unix/config/configure --with-src=spurstacksrc \
+	--without-vm-display-fbdev --without-npsqueak \
+	CC="gcc -m32" \
+	CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DDEBUGVM=0" \
+	LIBS="-lpthread -luuid" \
+	LDFLAGS=-Wl,-z,now
+../../../scripts/nukeversion
+rm -rf ../../../$INSTALLDIR
+# would prefer make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install prefix=`(cd ../../../;pwd)`/$INSTALLDIR


Property changes on: branches/Cog/spurstackbuild/unixbuild/bldt/mvm
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/Cog/spurstackbuild/unixbuild/bldt/plugins.ext
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/bldt/plugins.ext	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/bldt/plugins.ext	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL

Added: branches/Cog/spurstackbuild/unixbuild/bldt/plugins.int
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/bldt/plugins.int	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/bldt/plugins.int	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,26 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin

Added: branches/Cog/spurstackbuild/unixbuild/dbgbld/mvm
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/dbgbld/mvm	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/dbgbld/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,27 @@
+#!/bin/bash
+INSTALLDIR=sslinuxdbg
+if [ $# -ge 1 ]; then
+	case "$1" in
+	-*)	;;
+	*)	INSTALLDIR="$1"; shift
+	esac
+fi
+OPT=-O0
+
+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 config.h || ../../../platforms/unix/config/configure --with-src=spurstacksrc \
+	--without-vm-display-fbdev --without-npsqueak \
+	CC="gcc -m32" \
+	CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1 -DDEBUGVM=1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" \
+	LIBS="-lpthread -luuid" \
+	LDFLAGS=-Wl,-z,now
+../../../scripts/nukeversion
+rm -rf ../../../$INSTALLDIR
+# would prefer make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install prefix=`(cd ../../../;pwd)`/$INSTALLDIR


Property changes on: branches/Cog/spurstackbuild/unixbuild/dbgbld/mvm
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.ext
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.ext	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.ext	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL

Added: branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.int
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.int	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/dbgbld/plugins.int	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,26 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin

Added: branches/Cog/spurstackbuild/unixbuild/dbgbldt/mvm
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/dbgbldt/mvm	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/dbgbldt/mvm	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,28 @@
+#!/bin/bash
+# VM with VM profiler and threaded heartbeat assuming multiple thread priorities
+INSTALLDIR=sslinuxdbght
+if [ $# -ge 1 ]; then
+	case "$1" in
+	-*)	;;
+	*)	INSTALLDIR="$1"; shift
+	esac
+fi
+OPT=-O0
+
+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 config.h || ../../../platforms/unix/config/configure --with-src=spurstacksrc \
+	--without-vm-display-fbdev --without-npsqueak \
+	CC="gcc -m32" \
+	CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUGVM=1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" \
+	LIBS="-lpthread -luuid" \
+	LDFLAGS=-Wl,-z,now
+../../../scripts/nukeversion
+rm -rf ../../../$INSTALLDIR
+# would prefer make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
+# but older linux readlinks lack the -f flag
+make install prefix=`(cd ../../../;pwd)`/$INSTALLDIR


Property changes on: branches/Cog/spurstackbuild/unixbuild/dbgbldt/mvm
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.ext
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.ext	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.ext	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,3 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext
+EXTERNAL_PLUGINS = \
+SqueakSSL

Added: branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.int
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.int	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/dbgbldt/plugins.int	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,26 @@
+# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int
+INTERNAL_PLUGINS = \
+AsynchFilePlugin \
+BMPReadWriterPlugin \
+B2DPlugin \
+BitBltPlugin \
+DSAPrims \
+DropPlugin \
+FileCopyPlugin \
+FilePlugin \
+FloatArrayPlugin \
+FloatMathPlugin \
+ZipPlugin \
+JPEGReadWriter2Plugin \
+JPEGReaderPlugin \
+LargeIntegers \
+Matrix2x3Plugin \
+MiscPrimitivePlugin \
+IA32ABI \
+RePlugin \
+SecurityPlugin \
+SocketPlugin \
+SurfacePlugin \
+UUIDPlugin \
+UnixOSProcessPlugin \
+VMProfileLinuxSupportPlugin

Added: branches/Cog/spurstackbuild/unixbuild/mkNamedPrims.sh
===================================================================
--- branches/Cog/spurstackbuild/unixbuild/mkNamedPrims.sh	                        (rev 0)
+++ branches/Cog/spurstackbuild/unixbuild/mkNamedPrims.sh	2013-11-13 22:27:21 UTC (rev 2805)
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Generate a sqNamedPrims.h file from plugins.int.  The plugins.int used should
+# be the one and only argument.
+if [ $# != 1 -o ! -f "$1" ]; then
+	echo usage $0 plugins.int ">sqNamedPrims.h" 1>&2
+	exit 1
+fi
+echo "/* Automatically generated on "`date`" */"
+echo "extern sqExport vm_exports[];";
+echo "extern sqExport os_exports[];";
+for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'`
+do
+	echo "extern sqExport "$p"_exports[];"
+done
+echo
+echo "sqExport *pluginExports[] = {"
+echo "	vm_exports,"
+echo "	os_exports,"
+for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'`
+do
+	echo "	"$p"_exports,"
+done
+echo "	NULL"
+echo "};"


Property changes on: branches/Cog/spurstackbuild/unixbuild/mkNamedPrims.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: branches/Cog/spurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/spurstacksrc/vm/gcc3x-interp.c	2013-11-12 03:28:11 UTC (rev 2804)
+++ branches/Cog/spurstacksrc/vm/gcc3x-interp.c	2013-11-13 22:27:21 UTC (rev 2805)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.497 uuid: e1a38963-1741-4d75-99ae-af7006087d85
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.510 uuid: 70117c0d-28a7-4703-a044-cab26cfffe83
    from
-	StackInterpreter VMMaker.oscog-eem.497 uuid: e1a38963-1741-4d75-99ae-af7006087d85
+	StackInterpreter VMMaker.oscog-eem.510 uuid: 70117c0d-28a7-4703-a044-cab26cfffe83
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.497 uuid: e1a38963-1741-4d75-99ae-af7006087d85 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.510 uuid: 70117c0d-28a7-4703-a044-cab26cfffe83 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -267,8 +267,8 @@
 #define ProcessSignalingLowSpace 22
 #define ReceiverIndex 5
 #define RemapBufferSize 25
-#define RememberedSetLimit 0x4000
-#define RememberedSetRedZone 0x2000
+#define RememberedSetLimit 0x10000
+#define RememberedSetRedZone 0x8000
 #define SchedulerAssociation 3
 #define SelectorAboutToReturn 48
 #define SelectorCannotInterpret 34
@@ -284,6 +284,10 @@
 #define SmallContextSlots 22
 #define SmallIntegerShift 1
 #define SpecialSelectors 23
+#define StackPageReachedButUntraced 1
+#define StackPageTraced 2
+#define StackPageTraceInvalid -1
+#define StackPageUnreached 0
 #define StackPointerIndex 2
 #define SuperclassIndex 0
 #define SuspendedContextIndex 1
@@ -330,7 +334,6 @@
 static sqInt allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
 static void allocateOrExtendSegmentInfos(void);
 static sqInt allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, sqInt totalBytes, sqInt formatField, sqInt classIndex);
-static sqInt allocateSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
 static sqInt allocationUnit(void);
 static sqInt allUnscannedEphemeronsAreActive(void);
 sqInt argumentCountOfClosure(sqInt closurePointer);
@@ -345,7 +348,6 @@
 static sqInt becomeEffectFlagsFor(sqInt objOop);
 sqInt becomewith(sqInt array1, sqInt array2);
 static sqInt becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag);
-static void bestFitCompact(void);
 static sqInt bitsSetInFreeSpaceMaskForAllFreeLists(void);
 sqInt booleanValueOf(sqInt obj);
 static void bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil);
@@ -370,7 +372,7 @@
 sqInt checkedIntegerValueOf(sqInt intOop);
 sqInt checkedLongAt(sqInt byteAddress);
 static sqInt checkForEventsMayContextSwitch(sqInt mayContextSwitch);
-static sqInt checkHeapIntegrity(void);
+static sqInt checkHeapIntegrity(sqInt excludeUnmarkedNewSpaceObjs);
 static sqInt checkImageVersionFromstartingAt(sqImageFile  f, squeakFileOffsetType  imageOffset);
 static sqInt checkInterpreterIntegrity(void);
 static sqInt checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP);
@@ -423,6 +425,7 @@
 static sqInt copyAndForward(sqInt survivor);
 sqInt copyBits(void);
 sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y);
+void countMarkedAndUnmarkdObjects(sqInt printFlags);
 static void cr(void);
 static void createActualMessageTo(sqInt lookupClass);
 char * cStringOrNullFor(sqInt oop);
@@ -439,6 +442,7 @@
 EXPORT(sqInt) dumpImage(sqInt fileName);
 void dumpPrimTraceLog(void);
 sqInt eeInstantiateClassIndexformatnumSlots(sqInt knownClassIndex, sqInt objFormat, sqInt numSlots);
+static void eliminateAndFreeForwarders(void);
 static void ensureAdequateClassTableBitmap(void);
 static sqInt ensureBehaviorHash(sqInt aBehavior);
 static sqInt ensureCallerContext(char *theFP);
@@ -446,8 +450,8 @@
 static sqInt ensureRoomOnObjStackAt(sqInt objStackRootIndex);
 static sqInt enterIntoClassTable(sqInt aBehavior);
 static sqInt ephemeronFormat(void);
-static void exactFitCompact(void);
 static sqInt existInstancesInNewSpaceOf(sqInt classObj);
+static void expungeDuplicateClasses(void);
 static void externalDivorceFrameandContext(char *theFP, sqInt ctxt);
 static char * externalEnsureIsBaseFrame(char *aFramePtr);
 static sqInt externalInstVarofContext(sqInt offset, sqInt aContext);
@@ -465,6 +469,7 @@
 sqInt fetchLong32ofObject(sqInt fieldIndex, sqInt oop);
 sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop);
 static sqInt fetchStackPointerOf(sqInt aContext);
+static void fillHighestObjectsWithMovableObjectsFromupTo(sqInt startObj, sqInt limitObj);
 static sqInt findClassContainingMethodstartingAt(sqInt meth, sqInt classObj);
 sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr);
 static char * findFrameAboveinPage(char *theFP, StackPage *thePage);
@@ -479,6 +484,7 @@
 sqInt firstByteFormat(void);
 sqInt firstCompiledMethodFormat(void);
 static sqInt firstCorpse(sqInt headOfCorpseList);
+static void firstFitCompact(void);
 static void * firstFixedFieldOfMaybeImmediate(sqInt oop);
 void * firstFixedField(sqInt objOop);
 void * firstIndexableField(sqInt objOop);
@@ -516,6 +522,7 @@
 static sqInt freeChunkNextIndex(void);
 static sqInt freeChunkParentIndex(void);
 static sqInt freeChunkWithBytesat(sqInt bytes, sqInt address);
+static sqInt freeListsObj(void);
 static sqInt freeStackPageNoAssert(StackPage *aPage);
 static void freeUntracedStackPages(void);
 sqInt fullDisplayUpdate(void);
@@ -575,6 +582,7 @@
 static sqInt isContextHeader(sqInt aHeader);
 static sqInt isContextNonImm(sqInt oop);
 static sqInt isContext(sqInt oop);
+static sqInt isEnumerableObject(sqInt objOop);
 static sqInt isEphemeron(sqInt objOop);
 sqInt isFloatObject(sqInt oop);
 static sqInt isForwardedClassTag(sqInt classIndex);
@@ -587,6 +595,7 @@
 static sqInt isInFutureSpace(sqInt address);
 sqInt isInMemory(sqInt address);
 static sqInt isInNewSpace(sqInt objOop);
+static sqInt isInOldSpace(sqInt address);
 static sqInt isInRememberedSet(sqInt objOop);
 static sqInt isInSegments(usqInt address);
 sqInt isIntegerObject(sqInt oop);
@@ -646,6 +655,7 @@
 sqInt loadBitBltFrom(sqInt bb);
 void loadInitialContext(void);
 void longPrintOop(sqInt oop);
+void longPrintReferencesTo(sqInt anOop);
 sqInt longStoreBytecodeForHeader(sqInt methodHeader);
 static sqInt lookupInMethodCacheSelclassTag(sqInt selector, sqInt classTag);
 static sqInt lookupMethodInClass(sqInt class);
@@ -657,6 +667,8 @@
 sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue);
 static void mapInterpreterOops(void);
 static void mapStackPages(void);
+static sqInt markAndShouldScan(sqInt objOop);
+static void markAndTraceClassOf(sqInt objOop);
 static void markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents);
 static sqInt markAndTraceStackPages(sqInt fullGCFlag);
 static void markAndTraceStackPage(StackPage *thePage);
@@ -695,6 +707,7 @@
 static sqInt noUnscannedEphemerons(void);
 static sqInt numFreeLists(void);
 sqInt numPointerSlotsOf(sqInt objOop);
+static sqInt numSlotsMask(void);
 static usqInt numSlotsOfAny(sqInt objOop);
 usqInt numSlotsOf(sqInt objOop);
 sqInt numStrongSlotsOfephemeronInactiveIf(sqInt objOop, int (*criterion)(sqInt key));
@@ -702,12 +715,16 @@
 sqInt objectAfter(sqInt objOop);
 static sqInt objectAfterlimit(sqInt objOop, sqInt limit);
 sqInt objectArg(sqInt index);
+sqInt objectBefore(sqInt objOop);
 static sqInt objectStartingAt(sqInt address);
 sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop);
 static sqInt okayOop(sqInt signedOop);
 static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop);
 static sqInt oopisGreaterThanOrEqualToandLessThanOrEqualTo(sqInt anOop, sqInt baseOop, sqInt limitOop);
 static sqInt oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop);
+static sqInt oopisGreaterThan(sqInt anOop, sqInt otherOop);
+static sqInt oopisLessThanOrEqualTo(sqInt anOop, sqInt otherOop);
+static sqInt oopisLessThan(sqInt anOop, sqInt otherOop);
 static sqInt pageIndexFor(void *pointer);
 static sqInt pageListIsWellFormed(void);
 void pinObject(sqInt objOop);
@@ -977,6 +994,7 @@
 void printProcessStack(sqInt aProcess);
 sqInt printProcsOnList(sqInt procList);
 void printReferencesTo(sqInt anOop);
+sqInt printStackCallStackOf(char *aFramePointer);
 void printStackPageList(void);
 void printStackPageListInUse(void);
 void printStackPages(void);
@@ -1003,7 +1021,7 @@
 static usqInt rawNumSlotsOf(sqInt objOop);
 static usqInt rawOverflowSlotsOf(sqInt objOop);
 sqInt readableFormat(sqInt imageVersion);
-static sqInt readHeapFromImageFiledataBytes(sqInt f, sqInt numBytes);
+static sqInt readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes);
 size_t readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset);
 static sqInt rebuildFreeTreeFrom(sqInt sortedFreeChunks);
 EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext);
@@ -1016,7 +1034,7 @@
 static sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex);
 static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
 static sqInt roomToPushNArgs(sqInt n);
-static void runLeakCheckerForFullGC(sqInt fullGCFlag);
+static void runLeakCheckerForFullGCexcludeUnmarkedNewSpaceObjs(sqInt fullGCFlag, sqInt excludeUnmarkedNewSpaceObjs);
 static void scanClassPostBecomeeffects(sqInt startClassObj, sqInt becomeEffects);
 static void scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress);
 static void scavengeLoop(void);
@@ -1025,6 +1043,7 @@
 static float scavengerTenuringThreshold(void);
 static sqInt scavengeUnfiredEphemeronsOnEphemeronList(void);
 static void scavengingGCTenuringIf(sqInt tenuringCriterion);
+static usqInt segLimit(SpurSegmentInfo * self_in_segLimit);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
 EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr);
 void setBreakSelector(char *aString);
@@ -1058,7 +1077,7 @@
 static sqInt sixtyFourBitIndexableFormat(void);
 usqInt sizeOfAlienData(sqInt oop);
 sqInt sizeOfCallPrimitiveBytecode(sqInt methodHeader);
-static sqInt sizeOfFree(sqInt objOop);
+static usqLong sizeOfFree(sqInt objOop);
 sqInt sizeOfLongStoreTempBytecode(sqInt methodHeader);
 sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
 sqInt slotSizeOf(sqInt oop);
@@ -1109,6 +1128,7 @@
 sqInt trueObject(void);
 static void unlinkSolitaryFreeTreeNode(sqInt freeTreeNode);
 static void updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP);
+static sqInt usedSize(SpurCircularBuffer * self_in_usedSize);
 static sqInt validClassTableRootPages(void);
 static sqInt validInstructionPointerinFrame(usqInt anInstrPointer, char *fp);
 sqInt validInstructionPointerinMethodframePointer(usqInt theInstrPointer, usqInt aMethod, char *fp);
@@ -1136,32 +1156,32 @@
 _iss sqInt specialObjectsOop;
 _iss StackPage * stackPage;
 _iss sqInt nilObj;
-_iss char * framePointer;
-_iss usqInt newSpaceLimit;
 _iss usqInt method;
+_iss usqInt newSpaceLimit;
+_iss char * framePointer;
 _iss sqInt argumentCount;
 _iss usqInt newMethod;
 _iss sqInt messageSelector;
 _iss sqInt hiddenRootsObj;
 _iss usqInt instructionPointer;
-_iss usqInt freeOldSpaceStart;
 _iss usqInt freeStart;
 _iss sqInt remapBufferCount;
-_iss SpurCircularBuffer highestObjects;
+_iss usqInt freeOldSpaceStart;
 _iss sqInt trueObj;
 _iss sqInt falseObj;
-_iss sqInt totalFreeOldSpace;
 _iss StackPage * pages;
+_iss sqInt totalFreeOldSpace;
+_iss SpurCircularBuffer highestObjects;
 _iss sqInt * freeLists;
-_iss sqInt freeListsMask;
 _iss usqInt pastSpaceStart;
 _iss SpurSegmentInfo * segments;
 _iss char * stackLimit;
 _iss char * stackMemory;
+_iss usqInt freeListsMask;
 _iss sqInt rememberedSetSize;
-_iss sqInt weaklingStack;
 _iss sqInt bytesPerPage;
 _iss SpurNewSpaceSpace pastSpace;
+_iss sqInt weaklingStack;
 _iss SpurContiguousObjStack unscannedEphemerons;
 _iss SpurNewSpaceSpace futureSpace;
 _iss StackPage * mostRecentlyUsedPage;
@@ -1171,40 +1191,41 @@
 _iss sqInt jmpDepth;
 _iss sqInt numRememberedEphemerons;
 _iss sqInt classNameIndex;
-_iss usqInt endOfMemory;
 _iss sqInt markStack;
-_iss sqInt numStackPages;
+_iss usqInt endOfMemory;
 _iss sqInt numClassTablePages;
+_iss sqInt numStackPages;
 _iss sqLong nextProfileTick;
 _iss SpurNewSpaceSpace eden;
 _iss sqInt profileProcess;
 _iss sqInt tenureThreshold;
 _iss sqInt ephemeronList;
+_iss sqInt needGCFlag;
 _iss sqInt numPages;
 _iss sqInt tempOop;
 _iss sqInt previousRememberedSetSize;
+_iss unsigned char * classTableBitmap;
 _iss sqInt longRunningPrimitiveCheckMethod;
 _iss sqInt longRunningPrimitiveCheckSemaphore;
-_iss sqInt objStackInvalidBecause;
+_iss char * objStackInvalidBecause;
 _iss sqInt ephemeronQueue;
 _iss sqInt extraRootCount;
+_iss sqInt firstFreeChunk;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt profileMethod;
-_iss sqInt startOfMemory;
-_iss unsigned char * classTableBitmap;
+_iss usqInt startOfMemory;
+_iss sqInt growHeadroom;
 _iss sqInt invalidObjStackPage;
 _iss usqLong nextWakeupUsecs;
 _iss sqInt preemptionYields;
 _iss sqInt profileSemaphore;
 _iss sqInt highestRunnableProcessPriority;
+_iss sqInt lastSubdividedFreeChunk;
 _iss usqLong longRunningPrimitiveStartUsecs;
 _iss usqLong longRunningPrimitiveStopUsecs;
 _iss sqInt numSegInfos;
 _iss sqInt statCheckForEvents;
-_iss sqInt firstFreeChunk;
-_iss sqInt growHeadroom;
 _iss usqInt lowSpaceThreshold;
-_iss sqInt needGCFlag;
 _iss usqLong statGCEndUsecs;
 _iss sqInt classTableIndex;
 _iss sqInt lkupClass;
@@ -1217,7 +1238,7 @@
 _iss sqInt firstSegmentSize;
 _iss usqLong gcStartUsecs;
 _iss usqInt memory;
-_iss sqInt statCompactPassCount;
+_iss usqInt scavengeThreshold;
 _iss sqInt thisClassIndex;
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt fullScreenFlag;
@@ -1234,6 +1255,7 @@
 _iss sqInt globalSessionID;
 _iss sqInt interruptKeycode;
 _iss sqInt maxExtSemTabSizeSet;
+_iss sqInt statCompactPassCount;
 _iss usqLong statFullGCUsecs;
 _iss sqInt statFullGCs;
 _iss sqInt statGrowMemory;
@@ -1248,7 +1270,6 @@
 _iss sqInt methodDictLinearSearchLimit;
 _iss StackPage * overflowedPage;
 _iss sqInt savedWindowSize;
-_iss usqInt scavengeThreshold;
 _iss sqInt signalLowSpace;
 _iss sqInt statMarkCount;
 _iss sqInt statPendingFinalizationSignals;
@@ -1264,7 +1285,7 @@
 _iss long methodCache[MethodCacheSize + 1 /* 4097 */];
 _iss sqInt remapBuffer[RemapBufferSize + 1 /* 26 */];
 _iss sqInt atCache[AtCacheTotalSize + 1 /* 65 */];
-_iss sqInt rememberedSet[RememberedSetLimit + 1 /* 16385 */];
+_iss sqInt rememberedSet[RememberedSetLimit + 1 /* 65537 */];
 _iss sqInt *extraRoots[ExtraRootsSize + 1 /* 2049 */];
 _iss usqInt suspendedCallbacks[MaxJumpBuf + 1 /* 33 */];
 _iss usqInt suspendedMethods[MaxJumpBuf + 1 /* 33 */];
@@ -1889,7 +1910,7 @@
  0 };
 char * breakSelector;
 sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.497]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.510]";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -3475,8 +3496,10 @@
 		CASE(64)
 			/* pushLiteralVariableBytecode */
 			{
+				sqInt litVar;
 				sqInt object;
 				sqInt objOop;
+				sqInt referent;
 
 				VM_LABEL(0pushLiteralVariableBytecode);
 				/* begin fetchNextBytecode */
@@ -3490,20 +3513,38 @@
 #        endif /* MULTIPLEBYTECODESETS */
 
 				/* begin pushLiteralVariable: */
-				/* begin internalPush: */
-				/* begin fetchPointer:ofObject: */
+				VM_LABEL(0pushLiteralVariable);
+				
+				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
+				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
+				   all methods in the stack zone, and the entire method on return, and global variables are relatively
+				   rare; in my work image 8.7% of literals are globals). */
+
 				/* begin literal: */
 				assert(GIV(method) == (iframeMethod(localFP)));
-				objOop = longAt((GIV(method) + (BaseHeaderSize)) + 4 /* ((currentBytecode bitAnd: 31) + LiteralStart) << 2 */);
-				object = longAt((objOop + (BaseHeaderSize)) + (ValueIndex << 2));
-				longAtPointerput((localSP -= BytesPerOop), object);
+				litVar = longAt((GIV(method) + (BaseHeaderSize)) + 4 /* ((currentBytecode bitAnd: 31) + LiteralStart) << 2 */);
+				if (((longAt(litVar)) & 0x3FFFFF) == 8) {
+					/* begin followForwarded: */
+					assert(isForwarded(litVar));
+					referent = longAt((litVar + (BaseHeaderSize)) + (0 << 2));
+					while (((referent & 3) == 0)
+					 && (((longAt(referent)) & 0x3FFFFF) == 8)) {
+						referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
+					}
+					litVar = referent;
+				}
+				/* begin internalPush: */
+				longAtPointerput((localSP -= BytesPerOop), longAt((litVar + (BaseHeaderSize)) + (ValueIndex << 2)));
+
 			}
 			BREAK;
 		CASE(65)
 			/* pushLiteralVariableBytecode */
 			{
+				sqInt litVar;
 				sqInt object;
 				sqInt objOop;
+				sqInt referent;
 
 				VM_LABEL(1pushLiteralVariableBytecode);
 				/* begin fetchNextBytecode */
@@ -3517,20 +3558,38 @@
 #        endif /* MULTIPLEBYTECODESETS */
 
 				/* begin pushLiteralVariable: */
-				/* begin internalPush: */
-				/* begin fetchPointer:ofObject: */
+				VM_LABEL(1pushLiteralVariable);
+				
+				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
+				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
+				   all methods in the stack zone, and the entire method on return, and global variables are relatively
+				   rare; in my work image 8.7% of literals are globals). */
+
 				/* begin literal: */
 				assert(GIV(method) == (iframeMethod(localFP)));
-				objOop = longAt((GIV(method) + (BaseHeaderSize)) + 8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << 2 */);
-				object = longAt((objOop + (BaseHeaderSize)) + (ValueIndex << 2));
-				longAtPointerput((localSP -= BytesPerOop), object);
+				litVar = longAt((GIV(method) + (BaseHeaderSize)) + 8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << 2 */);
+				if (((longAt(litVar)) & 0x3FFFFF) == 8) {
+					/* begin followForwarded: */
+					assert(isForwarded(litVar));
+					referent = longAt((litVar + (BaseHeaderSize)) + (0 << 2));
+					while (((referent & 3) == 0)
+					 && (((longAt(referent)) & 0x3FFFFF) == 8)) {
+						referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
+					}
+					litVar = referent;
+				}
+				/* begin internalPush: */
+				longAtPointerput((localSP -= BytesPerOop), longAt((litVar + (BaseHeaderSize)) + (ValueIndex << 2)));
+
 			}
 			BREAK;
 		CASE(66)
 			/* pushLiteralVariableBytecode */
 			{
+				sqInt litVar;
 				sqInt object;
 				sqInt objOop;
+				sqInt referent;
 
 				VM_LABEL(2pushLiteralVariableBytecode);
 				/* begin fetchNextBytecode */
@@ -3544,20 +3603,38 @@
 #        endif /* MULTIPLEBYTECODESETS */
 
 				/* begin pushLiteralVariable: */
-				/* begin internalPush: */
-				/* begin fetchPointer:ofObject: */
+				VM_LABEL(2pushLiteralVariable);
+				
+				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
+				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
+				   all methods in the stack zone, and the entire method on return, and global variables are relatively
+				   rare; in my work image 8.7% of literals are globals). */
+
 				/* begin literal: */

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list