Revision: 3591 Author: eliot Date: 2016-02-12 19:33:43 -0800 (Fri, 12 Feb 2016) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.1677
NewspeakVM: Don't use cppIf: #NewspeakVM in VM code. It is appropriate only in plugin code. VM code should use the NewspeakVM variable from VMBasicConstants. Nuke the obsolete Newspeak interpreter src (nssrc).
Slang: Fix nilOrBooleanConditionFor: to also work for symbol arguments (such as #Newspeak). Emit "# define FOO" for conditionally defined FOO instead of "#define FOO" which is nice for grepping.
IMMUTABILITY: Fix the declaration/definition of ceCannotAssignTo:withIndex:valueToAssign: which needs to be included, but only if -DIMMUTABILITY=1. So modify Slang to output #if FOO && !BAR code around functions that include option: pragmas whose arguments are in namesDefinedAtCompileTime. This also fixes generation of Pharo-specific support code in the FilePlugin.
MacOS X build Fix memory support for v3 VMs; sqMacV2Memory.[ch] must be in Common; sqUnixMemory should not be used. Fix stack backtrace for STACKVMs (no writeback of machine stack pointers). Fix makefiles to chose correct sources for stack VM builds.
Modified Paths: -------------- branches/Cog/build.macos32x86/common/Makefile.app branches/Cog/build.macos32x86/common/Makefile.vm branches/Cog/build.macos32x86/pharo.cog.spur/plugins.int branches/Cog/build.macos32x86/squeak+immutability.cog.spur/plugins.int branches/Cog/build.macos32x86/squeak.cog.spur/plugins.int branches/Cog/build.macos32x86/squeak.cog.v3/plugins.int branches/Cog/build.macos32x86/squeak.sista.spur/plugins.int branches/Cog/build.macos32x86/squeak.stack.spur/plugins.int branches/Cog/build.macos32x86/squeak.stack.v3/plugins.int branches/Cog/build.macos64x64/common/Makefile.app branches/Cog/build.macos64x64/common/Makefile.vm branches/Cog/build.macos64x64/pharo.cog.spur/plugins.int branches/Cog/build.macos64x64/squeak.cog.spur/plugins.int branches/Cog/build.macos64x64/squeak.sista.spur/plugins.int branches/Cog/build.macos64x64/squeak.stack.spur/plugins.int 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/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/platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m branches/Cog/platforms/iOS/vm/OSX/sqPlatformSpecific.h branches/Cog/platforms/unix/vm/sqUnixMain.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/FilePlugin/FilePlugin.c branches/Cog/src/plugins/IA32ABI/IA32ABI.c branches/Cog/src/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c branches/Cog/src/plugins/SerialPlugin/SerialPlugin.c branches/Cog/src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.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/platforms/iOS/vm/Common/sqMacV2Memory.c branches/Cog/platforms/iOS/vm/Common/sqMacV2Memory.h
Removed Paths: ------------- branches/Cog/nssrc/ branches/Cog/platforms/iOS/vm/iPhone/sqMacV2Memory.c branches/Cog/platforms/iOS/vm/iPhone/sqMacV2Memory.h
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/build.macos32x86/common/Makefile.app =================================================================== --- branches/Cog/build.macos32x86/common/Makefile.app 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/common/Makefile.app 2016-02-13 03:33:43 UTC (rev 3591) @@ -54,10 +54,10 @@ VMICONS:=$(addprefix $(APP)/Contents/Resources/,$(notdir $(OSXICONS))) VMMENUNIB:=$(APP)/Contents/Resources/English.lproj/MainMenu.nib SOURCES:= -ifneq ("$(SOURCEFILE)",) +ifneq ($(SOURCEFILE),) SOURCES:=./$(SOURCEFILE) endif -ifneq ("$(APPSOURCE)",) +ifneq ($(APPSOURCE),) SOURCES:=$(SOURCES) $(APP)/Contents/Resources/$(APPSOURCE) endif
@@ -96,7 +96,7 @@ # To sign the app, set SIGNING_IDENTITY in the environment, e.g. # export SIGNING_IDENTITY="Developer ID Application: Eliot Miranda" # -ifeq ("$(SIGNING_IDENTITY)",) +ifeq ($(SIGNING_IDENTITY),) signapp: echo "No signing identity found (SIGNING_IDENTITY unset). Not signing app." else @@ -121,4 +121,7 @@ @echo VMBUNDLES=$(VMBUNDLES) @echo VMPLIST=$(VMPLIST) @echo VMICONS=$(VMICONS) + @echo SIGNING_IDENTITY=$(SIGNING_IDENTITY) + @echo SOURCEFILE=$(SOURCEFILE) + @echo APPSOURCE=$(APPSOURCE) @echo -----------------------------------------------------
Modified: branches/Cog/build.macos32x86/common/Makefile.vm =================================================================== --- branches/Cog/build.macos32x86/common/Makefile.vm 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/common/Makefile.vm 2016-02-13 03:33:43 UTC (rev 3591) @@ -52,14 +52,14 @@ OSXPLUGINSDIR:=$(PLATDIR)/iOS/plugins UNIXVMDIR:=$(PLATDIR)/unix/vm
-MAKERSRC:=$(addprefix $(VMSRCDIR)/,gcc3x-cointerp.c cogit.c) +MAKERSRC:=$(wildcard $(VMSRCDIR)/gcc3x-*interp.c $(VMSRCDIR)/cogit.c) CROSSSRC:= $(wildcard $(CROSSDIR)/*.c) XEX:=%/sqSqueakMainApplication+screen.m OSXSRC:=$(wildcard $(OSXDIR)/*.c) $(filter-out $(XEX),$(wildcard $(OSXDIR)/*.m)) \ $(wildcard $(OSXCOMMONDIR)/*.c) $(wildcard $(OSXCOMMONDIR)/*.m) \ $(wildcard $(OSXCLASSESDIR)/*.c) $(wildcard $(OSXCLASSESDIR)/*.m) -UNIXSRC:=$(addprefix $(UNIXVMDIR)/,aio.c sqUnixHeartbeat.c sqUnixMemory.c \ - sqUnixSpurMemory.c sqUnixThreads.c sqUnixVMProfile.c) +UNIXSRC:=$(addprefix $(UNIXVMDIR)/,aio.c sqUnixHeartbeat.c sqUnixSpurMemory.c \ + sqUnixThreads.c sqUnixVMProfile.c) VMSRC:= $(MAKERSRC) $(CROSSSRC) $(OSXSRC) $(UNIXSRC) VMOBJ:= $(notdir $(VMSRC)) VMOBJ:= $(VMOBJ:.c=.o)
Modified: branches/Cog/build.macos32x86/pharo.cog.spur/plugins.int =================================================================== --- branches/Cog/build.macos32x86/pharo.cog.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/pharo.cog.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos32x86/squeak+immutability.cog.spur/plugins.int =================================================================== --- branches/Cog/build.macos32x86/squeak+immutability.cog.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/squeak+immutability.cog.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos32x86/squeak.cog.spur/plugins.int =================================================================== --- branches/Cog/build.macos32x86/squeak.cog.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/squeak.cog.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos32x86/squeak.cog.v3/plugins.int =================================================================== --- branches/Cog/build.macos32x86/squeak.cog.v3/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/squeak.cog.v3/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos32x86/squeak.sista.spur/plugins.int =================================================================== --- branches/Cog/build.macos32x86/squeak.sista.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/squeak.sista.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos32x86/squeak.stack.spur/plugins.int =================================================================== --- branches/Cog/build.macos32x86/squeak.stack.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/squeak.stack.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos32x86/squeak.stack.v3/plugins.int =================================================================== --- branches/Cog/build.macos32x86/squeak.stack.v3/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos32x86/squeak.stack.v3/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos64x64/common/Makefile.app =================================================================== --- branches/Cog/build.macos64x64/common/Makefile.app 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos64x64/common/Makefile.app 2016-02-13 03:33:43 UTC (rev 3591) @@ -54,10 +54,10 @@ VMICONS:=$(addprefix $(APP)/Contents/Resources/,$(notdir $(OSXICONS))) VMMENUNIB:=$(APP)/Contents/Resources/English.lproj/MainMenu.nib SOURCES:= -ifneq ("$(SOURCEFILE)",) +ifneq ($(SOURCEFILE),) SOURCES:=./$(SOURCEFILE) endif -ifneq ("$(APPSOURCE)",) +ifneq ($(APPSOURCE),) SOURCES:=$(SOURCES) $(APP)/Contents/Resources/$(APPSOURCE) endif
@@ -96,7 +96,7 @@ # To sign the app, set SIGNING_IDENTITY in the environment, e.g. # export SIGNING_IDENTITY="Developer ID Application: Eliot Miranda" # -ifeq ("$(SIGNING_IDENTITY)",) +ifeq ($(SIGNING_IDENTITY),) signapp: echo "No signing identity found (SIGNING_IDENTITY unset). Not signing app." else @@ -121,4 +121,7 @@ @echo VMBUNDLES=$(VMBUNDLES) @echo VMPLIST=$(VMPLIST) @echo VMICONS=$(VMICONS) + @echo SIGNING_IDENTITY=$(SIGNING_IDENTITY) + @echo SOURCEFILE=$(SOURCEFILE) + @echo APPSOURCE=$(APPSOURCE) @echo -----------------------------------------------------
Modified: branches/Cog/build.macos64x64/common/Makefile.vm =================================================================== --- branches/Cog/build.macos64x64/common/Makefile.vm 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos64x64/common/Makefile.vm 2016-02-13 03:33:43 UTC (rev 3591) @@ -52,14 +52,14 @@ OSXPLUGINSDIR:=$(PLATDIR)/iOS/plugins UNIXVMDIR:=$(PLATDIR)/unix/vm
-MAKERSRC:=$(addprefix $(VMSRCDIR)/,gcc3x-cointerp.c cogit.c) +MAKERSRC:=$(wildcard $(VMSRCDIR)/gcc3x-*interp.c $(VMSRCDIR)/cogit.c) CROSSSRC:= $(wildcard $(CROSSDIR)/*.c) XEX:=%/sqSqueakMainApplication+screen.m OSXSRC:=$(wildcard $(OSXDIR)/*.c) $(filter-out $(XEX),$(wildcard $(OSXDIR)/*.m)) \ $(wildcard $(OSXCOMMONDIR)/*.c) $(wildcard $(OSXCOMMONDIR)/*.m) \ $(wildcard $(OSXCLASSESDIR)/*.c) $(wildcard $(OSXCLASSESDIR)/*.m) -UNIXSRC:=$(addprefix $(UNIXVMDIR)/,aio.c sqUnixHeartbeat.c sqUnixMemory.c \ - sqUnixSpurMemory.c sqUnixThreads.c sqUnixVMProfile.c) +UNIXSRC:=$(addprefix $(UNIXVMDIR)/,aio.c sqUnixHeartbeat.c sqUnixSpurMemory.c \ + sqUnixThreads.c sqUnixVMProfile.c) VMSRC:= $(MAKERSRC) $(CROSSSRC) $(OSXSRC) $(UNIXSRC) VMOBJ:= $(notdir $(VMSRC)) VMOBJ:= $(VMOBJ:.c=.o)
Modified: branches/Cog/build.macos64x64/pharo.cog.spur/plugins.int =================================================================== --- branches/Cog/build.macos64x64/pharo.cog.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos64x64/pharo.cog.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -30,5 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# SerialPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos64x64/squeak.cog.spur/plugins.int =================================================================== --- branches/Cog/build.macos64x64/squeak.cog.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos64x64/squeak.cog.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,4 +30,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos64x64/squeak.sista.spur/plugins.int =================================================================== --- branches/Cog/build.macos64x64/squeak.sista.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos64x64/squeak.sista.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -26,7 +26,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -35,4 +34,5 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -# JoystickTabletPlugin +# JoystickTabletPlugin \ +# SerialPlugin
Modified: branches/Cog/build.macos64x64/squeak.stack.spur/plugins.int =================================================================== --- branches/Cog/build.macos64x64/squeak.stack.spur/plugins.int 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/build.macos64x64/squeak.stack.spur/plugins.int 2016-02-13 03:33:43 UTC (rev 3591) @@ -22,7 +22,6 @@ MiscPrimitivePlugin \ RePlugin \ SecurityPlugin \ -SerialPlugin \ SocketPlugin \ SoundCodecPrims \ SoundGenerationPlugin \ @@ -31,8 +30,9 @@ SurfacePlugin \ UUIDPlugin \ VMProfileMacSupportPlugin \ -#B3DAcceleratorPlugin \ -#ClipboardExtendedPlugin \ -#MIDIPlugin \ -#InternetConfigPlugin \ -# JoystickTabletPlugin +# B3DAcceleratorPlugin \ +# ClipboardExtendedPlugin \ +# InternetConfigPlugin \ +# JoystickTabletPlugin \ +# MIDIPlugin \ +# SerialPlugin
Modified: branches/Cog/nsspur64src/vm/cogit.h =================================================================== --- branches/Cog/nsspur64src/vm/cogit.h 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/nsspur64src/vm/cogit.h 2016-02-13 03:33:43 UTC (rev 3591) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1670 uuid: 6ba2dd3d-ab44-468e-9184-1c85580f980b + CCodeGenerator VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 */
Modified: branches/Cog/nsspur64src/vm/cogitX64.c =================================================================== --- branches/Cog/nsspur64src/vm/cogitX64.c 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/nsspur64src/vm/cogitX64.c 2016-02-13 03:33:43 UTC (rev 3591) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1668 uuid: 1f0b27be-e423-42d3-a18d-1c7e292a4f14 + CCodeGenerator VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1668 uuid: 1f0b27be-e423-42d3-a18d-1c7e292a4f14 + StackToRegisterMappingCogit VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1668 uuid: 1f0b27be-e423-42d3-a18d-1c7e292a4f14 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -185,7 +185,7 @@ #define HeaderIndex 0 #define IDIVR 117 #if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */ -#define IMMUTABILITY 0 +# define IMMUTABILITY 0 #endif #define IMULRR 118 #define InstanceSpecificationIndex 2 @@ -817,7 +817,16 @@ static sqInt NoDbgRegParms genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, sqInt destReg, sqInt scratchRegOrNone); static sqInt NoDbgRegParms genGetNumSlotsOfinto(sqInt srcReg, sqInt destReg); static sqInt NoDbgRegParms genGetRawSlotSizeOfNonImminto(sqInt sourceReg, sqInt destReg); +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpBaseHeaderImmutable(sqInt baseHeaderReg); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpBaseHeaderMutable(sqInt baseHeaderReg); +#endif /* IMMUTABILITY */ static AbstractInstruction * NoDbgRegParms genJumpImmediate(sqInt aRegister); +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ static sqInt NoDbgRegParms genNewArrayOfSizeinitialized(sqInt size, sqInt initialized); static sqInt NoDbgRegParms genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock); static sqInt genPrimitiveAsCharacter(void); @@ -1171,6 +1180,7 @@ void (*ceCallCogCodePopReceiverArg0Regs)(void); void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void); void (*ceCallCogCodePopReceiverReg)(void); +static sqInt ceCannotAssignToWithIndexTrampoline; sqInt ceCannotResumeTrampoline; void (*ceCaptureCStackPointers)(void); static unsigned long (*ceCheckFeaturesFunction)(void); @@ -7574,13 +7584,9 @@ markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); maybeMarkCountersIn(cogMethod); /* begin maybeMarkIRCsIn: */ - -# if NewspeakVM markIfIRC((cogMethod->nextMethodOrIRCs));
-# endif /* NewspeakVM */ - /* begin mapFor:performUntil:arg: */ mcpc = (((sqInt)cogMethod)) + cmNoCheckEntryOffset; map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; @@ -7622,13 +7628,9 @@ markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); maybeMarkCountersIn(cogMethod); /* begin maybeMarkIRCsIn: */ - -# if NewspeakVM markIfIRC((cogMethod->nextMethodOrIRCs));
-# endif /* NewspeakVM */ - /* begin mapFor:performUntil:arg: */ mcpc1 = (((sqInt)cogMethod)) + cmNoCheckEntryOffset; map1 = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; @@ -7730,13 +7732,9 @@ markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); maybeMarkCountersIn(cogMethod); /* begin maybeMarkIRCsIn: */ - -# if NewspeakVM markIfIRC((cogMethod->nextMethodOrIRCs));
-# endif /* NewspeakVM */ - /* begin mapFor:performUntil:arg: */ mcpc = (((sqInt)cogMethod)) + cmNoCheckEntryOffset; map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; @@ -8101,8 +8099,6 @@ { sqInt objOop;
- -# if NewspeakVM indexOfIRC = (theIRCs = 0); if (numIRCs > 0) { assert((noAssertMethodClassAssociationOf(methodObj)) != (nilObject())); @@ -8115,11 +8111,6 @@ } return 1;
-# else /* NewspeakVM */ - return 1; - -# endif /* NewspeakVM */ - }
@@ -12779,7 +12770,7 @@ AbstractInstruction * jumpFixedFieldsOutOfBounds; AbstractInstruction *jumpHasFixedFields; AbstractInstruction *jumpImmediate; - sqInt jumpImmutable; + AbstractInstruction * jumpImmutable; AbstractInstruction *jumpIsBytes; AbstractInstruction * jumpIsCompiledMethod; AbstractInstruction *jumpIsContext; @@ -12801,7 +12792,6 @@ sqInt quickConstant5; sqInt quickConstant6;
- jumpImmutable = 0; /* begin genLoadArgAtDepth:into: */ assert(1 < (numRegArgs())); /* begin genLoadArgAtDepth:into: */ @@ -14081,7 +14071,7 @@ AbstractInstruction *jumpBadIndex; AbstractInstruction *jumpBytesOutOfBounds; AbstractInstruction *jumpBytesOutOfRange; - sqInt jumpImmutable; + AbstractInstruction * jumpImmutable; AbstractInstruction *jumpIsBytes; AbstractInstruction * jumpIsCompiledMethod; AbstractInstruction *jumpIsShorts; @@ -14096,7 +14086,6 @@ sqInt quickConstant3; sqInt quickConstant4;
- jumpImmutable = 0; /* begin genLoadArgAtDepth:into: */ assert(1 < (numRegArgs())); /* begin genLoadArgAtDepth:into: */ @@ -14736,8 +14725,6 @@ static void generateObjectRepresentationTrampolines(void) { - sqInt ceCannotAssignToWithIndexTrampoline; - # if IMMUTABILITY
@@ -15297,6 +15284,46 @@ return 0; }
+ +/* baseHeader holds at least the least significant 32 bits of the object */ + + /* CogObjectRepresentationForSpur>>#genJumpBaseHeaderImmutable: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpBaseHeaderImmutable(sqInt baseHeaderReg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin TstCq:R: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(TstCqR, quickConstant, baseHeaderReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + +/* baseHeader holds at least the least significant 32 bits of the object */ + + /* CogObjectRepresentationForSpur>>#genJumpBaseHeaderMutable: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpBaseHeaderMutable(sqInt baseHeaderReg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin TstCq:R: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(TstCqR, quickConstant, baseHeaderReg); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + /* CogObjectRepresentationForSpur>>#genJumpImmediate: */ static AbstractInstruction * NoDbgRegParms genJumpImmediate(sqInt aRegister) @@ -15312,7 +15339,20 @@ return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); }
+ /* CogObjectRepresentationForSpur>>#genJumpMutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction;
+ /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + return genJumpBaseHeaderMutable(scratchReg); +} +#endif /* IMMUTABILITY */ + + /* Generate a call to code that allocates a new Array of size. The Array should be initialized with nils iff initialized is true. The size arg is passed in SendNumArgsReg, the result @@ -23829,12 +23869,8 @@ blockStart = blockStartAt(compiledBlocksCount); scanBlock(blockStart); initialOpcodeIndex = opcodeIndex; - -# if NewspeakVM initialIndexOfIRC = indexOfIRC;
-# endif /* NewspeakVM */ - while (1) { compileBlockEntry(blockStart); initialStackPtr = simStackPtr; @@ -23849,12 +23885,8 @@ bzero(abstractOpcodes + initialOpcodeIndex, (opcodeIndex - initialOpcodeIndex) * sizeof(AbstractInstruction)); opcodeIndex = initialOpcodeIndex; - -# if NewspeakVM indexOfIRC = initialIndexOfIRC;
-# endif /* NewspeakVM */ - } compiledBlocksCount += 1; } @@ -24185,15 +24217,11 @@ } /* begin annotateBytecode: */ (stackCheckLabel->annotation = HasBytecodePC); - -# if NewspeakVM if (numIRCs > 0) { /* begin PrefetchAw: */ anInstruction2 = genoperand(PrefetchAw, theIRCs); }
-# endif /* NewspeakVM */ - initSimStackForFramefulMethod(initialPC); }
@@ -26197,13 +26225,17 @@ genStorePopLiteralVariable(sqInt popBoolean, sqInt litVarIndex) { AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; sqInt association; - sqInt immutabilityFailure; + AbstractInstruction *fail; + AbstractInstruction * immutabilityFailure; + AbstractInstruction *mutableJump; sqInt needStoreCheck; sqInt topReg;
- immutabilityFailure = 0; assert(needsFrame); # if IMMUTABILITY @@ -26230,8 +26262,26 @@ topReg = ClassReg; ssStoreAndReplacePoptoReg(popBoolean, ClassReg); ssFlushTo(simStackPtr); - immutabilityFailure = genImmutableCheckslotIndexsourceRegscratchRegneedRestoreRcvr(ReceiverResultReg, ValueIndex, ClassReg, TempReg, 0); + /* begin genImmutableCheck:slotIndex:sourceReg:scratchReg:needRestoreRcvr: */ + assert(ReceiverResultReg == ReceiverResultReg); + assert(TempReg == TempReg); + assert(ClassReg == ClassReg);
+ /* We reach this code if the object mutated is immutable. */ + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, ValueIndex, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceCannotAssignToWithIndexTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); + /* begin Jump: */ + fail = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + immutabilityFailure = fail; + # else /* IMMUTABILITY */ topReg = allocateRegForStackEntryAtnotConflictingWith(0, registerMaskFor(ReceiverResultReg)); ssStorePoptoReg(popBoolean, topReg); @@ -26261,17 +26311,21 @@ { AbstractInstruction *abstractInstruction; AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction11; + AbstractInstruction *abstractInstruction2; AbstractInstruction *anInstruction; - sqInt immutabilityFailure; + AbstractInstruction *anInstruction1; + AbstractInstruction *fail; + AbstractInstruction * immutabilityFailure; AbstractInstruction *jmpDone; AbstractInstruction *jmpSingle; + AbstractInstruction *mutableJump; sqInt needStoreCheck;
/* 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 @@ -26318,8 +26372,29 @@ } # if IMMUTABILITY - immutabilityFailure = genImmutableCheckslotIndexsourceRegscratchRegneedRestoreRcvr(ReceiverResultReg, ValueIndex, ClassReg, TempReg, 1); + /* begin genImmutableCheck:slotIndex:sourceReg:scratchReg:needRestoreRcvr: */ + assert(ReceiverResultReg == ReceiverResultReg); + assert(TempReg == TempReg); + assert(ClassReg == ClassReg);
+ /* We reach this code if the object mutated is immutable. */ + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, ValueIndex, TempReg); + /* begin CallRT: */ + abstractInstruction11 = genoperand(Call, ceCannotAssignToWithIndexTrampoline); + (abstractInstruction11->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + + /* begin Jump: */ + fail = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + immutabilityFailure = fail; + # endif /* IMMUTABILITY */
genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(ClassReg, slotIndex, ReceiverResultReg, TempReg, 1, needStoreCheck); @@ -26339,11 +26414,15 @@ { AbstractInstruction *abstractInstruction; AbstractInstruction *abstractInstruction1; - sqInt immutabilityFailure; + AbstractInstruction *abstractInstruction11; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *anInstruction; + AbstractInstruction *fail; + AbstractInstruction * immutabilityFailure; + AbstractInstruction *mutableJump; sqInt needStoreCheck; sqInt topReg;
- immutabilityFailure = 0; # if IMMUTABILITY assert(needsFrame); @@ -26362,8 +26441,29 @@ topReg = ClassReg; ssStoreAndReplacePoptoReg(popBoolean, ClassReg); ssFlushTo(simStackPtr); - immutabilityFailure = genImmutableCheckslotIndexsourceRegscratchRegneedRestoreRcvr(ReceiverResultReg, slotIndex, ClassReg, TempReg, 1); + /* begin genImmutableCheck:slotIndex:sourceReg:scratchReg:needRestoreRcvr: */ + assert(ReceiverResultReg == ReceiverResultReg); + assert(TempReg == TempReg); + assert(ClassReg == ClassReg);
+ /* We reach this code if the object mutated is immutable. */ + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + /* begin CallRT: */ + abstractInstruction11 = genoperand(Call, ceCannotAssignToWithIndexTrampoline); + (abstractInstruction11->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + + /* begin Jump: */ + fail = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + immutabilityFailure = fail; + # else /* IMMUTABILITY */ topReg = allocateRegForStackEntryAtnotConflictingWith(0, registerMaskFor(ReceiverResultReg)); ssStorePoptoReg(popBoolean, topReg); @@ -27088,12 +27188,8 @@ needsFrame = 0; inBlock = 0; prevBCDescriptor = null; - -# if NewspeakVM numIRCs = 0;
-# endif /* NewspeakVM */ - if ((primitiveIndex > 0) && (isQuickPrimitiveIndex(primitiveIndex))) { return 0; @@ -27141,14 +27237,10 @@ targetPC = (pc + ((descriptor->numBytes))) + distance; latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); } - -# if NewspeakVM if ((descriptor->hasIRC)) { numIRCs += 1; }
-# endif /* NewspeakVM */ - pc += (descriptor->numBytes); if ((descriptor->isExtension)) { nExts += 1;
Modified: branches/Cog/nsspur64src/vm/cointerp.c =================================================================== --- branches/Cog/nsspur64src/vm/cointerp.c 2016-02-12 19:45:55 UTC (rev 3590) +++ branches/Cog/nsspur64src/vm/cointerp.c 2016-02-13 03:33:43 UTC (rev 3591) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1670 uuid: 6ba2dd3d-ab44-468e-9184-1c85580f980b + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 from - CoInterpreter VMMaker.oscog-eem.1670 uuid: 6ba2dd3d-ab44-468e-9184-1c85580f980b + CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1670 uuid: 6ba2dd3d-ab44-468e-9184-1c85580f980b " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -220,7 +220,7 @@ #define EncounteredUnknownBytecode -6 #define EndOfRun 0x101 #if !defined(EnforceAccessControl) /* Allow this to be overridden on the compiler command line */ -#define EnforceAccessControl 1 +# define EnforceAccessControl 1 #endif #define ExcessSignalsIndex 2 #define ExternalObjectsArray 38 @@ -247,7 +247,7 @@ #define HeaderIndex 0 #define IFrameSlots 7 #if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */ -#define IMMUTABILITY 0 +# define IMMUTABILITY 0 #endif #define InstanceSpecificationIndex 2 #define InstructionPointerIndex 1 @@ -355,6 +355,7 @@ #define ReturnToInterpreter 1 #define SchedulerAssociation 3 #define SelectorAboutToReturn 48 +#define SelectorAttemptToAssign 50 #define SelectorCannotInterpret 34 #define SelectorCannotReturn 21 #define SelectorDoesNotUnderstand 20 @@ -404,7 +405,7 @@ #define V3PrimitiveBitsMask 0x80000FF8ULL #define ValueIndex 1 #if !defined(VMBIGENDIAN) /* Allow this to be overridden on the compiler command line */ -#define VMBIGENDIAN 0 +# define VMBIGENDIAN 0 #endif #define WeaklingStackRootIndex 0x1001 #define XIndex 0 @@ -457,6 +458,9 @@ static void NoDbgRegParms callRegisterArgCogMethodatreceiver(CogMethod *cogMethod, sqInt entryOffset, sqInt rcvr); extern void ceActivateFailingPrimitiveMethod(sqInt aPrimitiveMethod); extern sqInt ceBaseFrameReturn(sqInt returnValue); +#if IMMUTABILITY +extern sqInt ceCannotAssignTowithIndexvalueToAssign(sqInt immutableObject, sqInt index, sqInt valueToAssign); +#endif /* IMMUTABILITY */ extern sqInt ceCannotResume(void); extern sqInt ceCheckForAndFollowForwardedPrimitiveState(void); extern void ceCheckForInterrupts(void); @@ -649,6 +653,9 @@ static void unmarkAllFrames(void); static void NoDbgRegParms initializeStacknumSlotspageSize(char *theStackPages, sqInt stackSlots, sqInt slotsPerPage); static sqInt NoDbgRegParms pageIndexFor(void *pointer); +#if IMMUTABILITY +static sqInt NoDbgRegParms canBeImmutable(sqInt oop); +#endif /* IMMUTABILITY */ extern char * cStringOrNullFor(sqInt oop); extern sqInt failed(void); static sqInt NoDbgRegParms isNegativeIntegerValueOf(sqInt oop); @@ -729,6 +736,7 @@ static void primitiveFormPrint(void); static void primitiveFractionalPart(void); static void primitiveGetAttribute(void); +static void primitiveGetImmutability(void); EXPORT(sqInt) primitiveGetLogDirectory(void); static void primitiveGetNextEvent(void); EXPORT(sqInt) primitiveGetWindowLabel(void); @@ -805,6 +813,7 @@ static void primitiveSecondsClock(void); static void primitiveSetDisplayMode(void); static void primitiveSetFullScreen(void); +static void primitiveSetImmutability(void); static void primitiveSetInterruptKey(void); EXPORT(sqInt) primitiveSetLogDirectory(void); static void primitiveSetOrHasIdentityHash(void); @@ -1061,6 +1070,9 @@ static usqLong NoDbgRegParms headerForSlotshashformatclassIndex(sqInt numSlots, sqInt hash, sqInt formatField, sqInt classIndex); static sqInt hiddenRootSlots(void); static sqInt imageSegmentVersion(void); +#if IMMUTABILITY +extern sqInt immutableBitMask(void); +#endif /* IMMUTABILITY */ extern void incrementalGC(void); static void NoDbgRegParms inFreeTreeReplacewith(sqInt treeNode, sqInt newNode); static sqInt NoDbgRegParms initialInstanceOf(sqInt classObj); @@ -1604,8 +1616,8 @@ _iss sqInt argumentCount; _iss sqInt specialObjectsOop; _iss sqInt bytecodeSetSelector; +_iss sqInt messageSelector; _iss usqInt instructionPointer; -_iss sqInt messageSelector; _iss usqInt newMethod; _iss usqInt freeStart; _iss sqInt markStack; @@ -1614,8 +1626,8 @@ _iss usqInt newSpaceLimit; _iss char * stackBasePlus1; _iss sqInt weaklingStack; +_iss sqInt trueObj; _iss usqInt newSpaceStart; -_iss sqInt trueObj; _iss sqInt falseObj; _iss sqInt hiddenRootsObj; _iss SpurSegmentInfo * segments; @@ -1984,8 +1996,8 @@ /* 160 */ primitiveAdoptInstance, /* 161 */ primitiveSetOrHasIdentityHash, /* 162 */ (void (*)(void))0, - /* 163 */ (void (*)(void))0, - /* 164 */ (void (*)(void))0, + /* 163 */ primitiveGetImmutability, + /* 164 */ primitiveSetImmutability, /* 165 */ primitiveIntegerAt, /* 166 */ primitiveIntegerAtPut, /* 167 */ primitiveYield, @@ -2407,7 +2419,7 @@ /*100*/ 1, 1, 0, 2,-1, 1,-1,-1,-1,-1, 0, 0,-1,-1,-1, 1, 1,-1, 1, 0, /*120*/ -1, 0,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 1, 0, 0,-1, 0,-1,-1,-1, /*140*/ -1, 1,-1, 1, 0, 0,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/*160*/ 0, 0,-1,-1,-1, 1, 1,-1, 1, 0, 0, 1,-1, 1, 1,-1,-1,-1,-1,-1, +/*160*/ 0, 0,-1, 0, 0, 1, 1,-1, 1, 0, 0, 1,-1, 1, 1,-1,-1,-1,-1,-1, /*180*/ 0,-1,-1, 0, 0, 0, 1, 1, 1, 0,-1,-1,-1,-1,-1, 1, 2,-1,-1,-1, /*200*/ -1, 2, 2, 2, 2, 2, 2,-1,-1,-1, 1, 1, 1, 1,-1, 1,-1,-1, 3,-1, /*220*/ -1, 2, 2,-1,-1,-1,-1,-1,-1,-1, 0,-1, 2, 0,-1,-1,-1,-1,-1,-1, @@ -2430,7 +2442,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.1670"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1677"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -4770,7 +4782,16 @@ # if IMMUTABILITY assert(!((isImmediate(rcvr)))); if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(top, rcvr, instVarIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((instVarIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l1; }
@@ -5758,7 +5779,16 @@ # if IMMUTABILITY assert(!((isImmediate(objOop)))); if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(value, objOop, variableIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), objOop); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((variableIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l4; }
@@ -5815,7 +5845,15 @@ # if IMMUTABILITY assert(!((isImmediate(litVar)))); if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(value, litVar, ValueIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((ValueIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; goto l5; }
@@ -5873,7 +5911,16 @@ # if IMMUTABILITY assert(!((isImmediate(objOop)))); if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(value, objOop, variableIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), objOop); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((variableIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l7; }
@@ -5930,7 +5977,15 @@ # if IMMUTABILITY assert(!((isImmediate(litVar)))); if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(value, litVar, ValueIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((ValueIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; goto l8; }
@@ -6584,7 +6639,15 @@ # if IMMUTABILITY assert(!((isImmediate(litVar)))); if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(top, litVar, ValueIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((ValueIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; goto l14; }
@@ -6714,7 +6777,16 @@ # if IMMUTABILITY assert(!((isImmediate(rcvr1)))); if (((((usqInt) (longAt(rcvr1))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(top, rcvr1, byte3); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((byte3 + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l11; }
@@ -11916,7 +11988,16 @@ # if IMMUTABILITY assert(!((isImmediate(rcvr)))); if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(top, rcvr, instVarIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((instVarIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l125; }
@@ -12497,7 +12578,16 @@ # if IMMUTABILITY assert(!((isImmediate(rcvr)))); if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(anObject, rcvr, variableIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), anObject); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((variableIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l132; }
@@ -12527,6 +12617,7 @@ case 489: /*233*/ /* extStoreLiteralVariableBytecode */ { + sqInt anObject; sqInt litVar; sqInt referent; sqInt variableIndex; @@ -12535,6 +12626,8 @@ variableIndex = (byteAtPointer(++localIP)) + (((long)extA) << 8); extA = 0; /* begin storeLiteralVariable:withValue: */ + anObject = longAtPointer(localSP); + /* begin literal: */ assert(GIV(method) == (iframeMethod(localFP))); litVar = longAt((GIV(method) + BaseHeaderSize) + (((long)(variableIndex + LiteralStart)) << (shiftForWord()))); if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { @@ -12552,7 +12645,15 @@ # if IMMUTABILITY assert(!((isImmediate(litVar)))); if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(longAtPointer(localSP), litVar, ValueIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), anObject); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((ValueIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; goto l134; }
@@ -12563,15 +12664,15 @@ if (isOldObject(litVar)) {
/* most stores into young objects */ - if ((((longAtPointer(localSP)) & (tagMask())) == 0) - && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { + if (((anObject & (tagMask())) == 0) + && (oopisLessThan(anObject, GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) { remember(litVar); } } } - longAtput((litVar + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord())), longAtPointer(localSP)); + longAtput((litVar + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord())), anObject); l134: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12715,7 +12816,16 @@ # if IMMUTABILITY assert(!((isImmediate(rcvr)))); if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(value, rcvr, variableIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((variableIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; + /* return self */ goto l135; }
@@ -12774,7 +12884,15 @@ # if IMMUTABILITY assert(!((isImmediate(litVar)))); if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { - cannotAssigntowithIndex(value, litVar, ValueIndex); + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((ValueIndex + 1) << 3) | 1)); + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))); + GIV(argumentCount) = 2; + goto normalSend; goto l137; }
@@ -15882,6 +16000,40 @@ }
+/* index is unboxed. */ + + /* CoInterpreter>>#ceCannotAssignTo:withIndex:valueToAssign: */ +#if IMMUTABILITY +sqInt +ceCannotAssignTowithIndexvalueToAssign(sqInt immutableObject, sqInt index, sqInt valueToAssign) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + char *sp1; + char *sp2; + char *sp3; + sqInt top; + + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), immutableObject); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), valueToAssign); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), ((index << 3) | 1)); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp3; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SelectorAttemptToAssign) << (shiftForWord()))), immutableObject, 2); +} +#endif /* IMMUTABILITY */ + + /* A context that has been returned from, or otherwise has an invalid pc has been reentered. Until we have a cannotResume: selector, simply resend cannotReturn:. */ @@ -18736,15 +18888,8 @@ fieldIndex1 = classTag & ((1LL << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((long)fieldIndex1) << (shiftForWord()))); l1: /* end classAtIndex: */; - -# if NewspeakVM lookupOrdinarySend();
-# else /* NewspeakVM */ - lookupMethodInClass(GIV(lkupClass)); - -# endif /* NewspeakVM */ - addNewMethodToCache(GIV(lkupClass)); } } @@ -19760,8 +19905,6 @@ else { classTag = (longAt(rcvr)) & (classIndexMask()); } - -# if NewspeakVM /* begin inlineLookupInNSMethodCacheSel:classTag:method:lookupRule: */ hash = (selector ^ classTag) ^ (0 ^ LookupRuleMNU);
@@ -19804,11 +19947,6 @@ inCache = 0; l1: /* end inlineLookupInNSMethodCacheSel:classTag:method:lookupRule: */;
-# else /* NewspeakVM */ - inCache = lookupInMethodCacheSelclassTag(selector, classTag); - -# endif /* NewspeakVM */ - if (!inCache) { GIV(messageSelector) = selector; erridx = lookupMNUInClass(classAtIndex(classTag)); @@ -28587,7 +28725,42 @@ return pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); }
+ /* InterpreterPrimitives>>#canBeImmutable: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +canBeImmutable(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt processLists; + sqInt scheduler;
+ assert(isNonImmediate(oop)); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + return 0; + } + if (((longAt(oop)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)ClassSemaphore) << (shiftForWord())))))) { + return 0; + } + /* begin fetchPointer:ofObject: */ + scheduler = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((long)SchedulerAssociation) << (shiftForWord())))) + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord()))); + processLists = longAt((scheduler + BaseHeaderSize) + (((long)ProcessListsIndex) << (shiftForWord()))); + if (oop == scheduler) { + return 0; + } + if (oop == processLists) { + return 0; + } + if ((classIndexOf(longAt((processLists + BaseHeaderSize) + (1LL << (shiftForWord()))))) == ((longAt(oop)) & (classIndexMask()))) { + return 0; + } + if ((classIndexOf(longAt((scheduler + BaseHeaderSize) + (((long)ActiveProcessIndex) << (shiftForWord()))))) == ((longAt(oop)) & (classIndexMask()))) { + return 0; + } + return 1; +} +#endif /* IMMUTABILITY */ + + /* Answer either a malloced string with the null-terminated contents of oop if oop is a string, or the null pointer if oop is nil, or fail. It is the client's @@ -34186,7 +34359,33 @@ } }
+ /* InterpreterPrimitives>>#primitiveGetImmutability */ +static void +primitiveGetImmutability(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rcvr; + char *sp; + sqInt trueOrFalse;
+ +# if IMMUTABILITY + rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin pop:thenPushBool: */ + trueOrFalse = ((rcvr & (tagMask())) != 0) + || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + +# else /* IMMUTABILITY */ + GIV(primFailCode) = PrimErrUnsupported; + +# endif /* IMMUTABILITY */ + +} + + /* Primitive. Answer the VM's current log directory */
/* InterpreterPrimitives>>#primitiveGetLogDirectory */ @@ -38383,7 +38582,60 @@ } }
+ /* InterpreterPrimitives>>#primitiveSetImmutability */ +static void +primitiveSetImmutability(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rcvr; + char *sp; + sqInt wasImmutable;
+ +# if IMMUTABILITY + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if ((rcvr & (tagMask())) != 0) { + (GIV(primFailCode) = PrimErrBadReceiver); + return; + } + wasImmutable = +# if IMMUTABILITY + ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 +# else /* IMMUTABILITY */ + 0 +# endif /* IMMUTABILITY */ + ; + if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { + if (!(canBeImmutable(rcvr))) { + (GIV(primFailCode) = PrimErrInappropriate); + return; + } + /* begin setIsImmutableOf:to: */ + longAtput(rcvr, (longAt(rcvr)) | (1LL << 23)); + } + else { + if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { + /* begin setIsImmutableOf:to: */ + longAtput(rcvr, (longAt(rcvr)) & (~(1LL << 23))); + } + else { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + } + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (wasImmutable + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + +# else /* IMMUTABILITY */ + GIV(primFailCode) = PrimErrUnsupported; + +# endif /* IMMUTABILITY */ + +} + + /* Set the user interrupt keycode. The keycode is an integer whose encoding is described in the comment for primitiveKbdNext. */ @@ -52154,6 +52406,18 @@ return (imageFormatVersion()) | (wholeWord & 0xFF000000ULL); }
+ +/* mask the immutable bit in the base header word */ + + /* SpurMemoryManager>>#immutableBitMask */ +#if IMMUTABILITY +sqInt +immutableBitMask(void) +{ + return 1LL << 23; +} +#endif /* IMMUTABILITY */ + /* SpurMemoryManager>>#incrementalGC */ void incrementalGC(void) @@ -61254,7 +61518,7 @@ usqInt prevFree; usqInt prevFreeChunk;
@@ Diff output truncated at 50000 characters. @@
vm-dev@lists.squeakfoundation.org