Revision: 3263 Author: eliot Date: 2015-02-24 14:04:06 -0800 (Tue, 24 Feb 2015) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.1080
General: Fix a type declaration error uncvered by the new inlining. Simplify primitiveMakePoint. Include primitiveMethodXray Include freeMethod: in Cogit's api for method xray.
Spur: Fix a typing bug in initializeOldSpaceFirstFree:.
Newspeak: Move the Newspeak plugins to nsspursrc/plugins.
Fix privacy violation checking for super sends. Fix some type warnings in Spur stack VMs.
Slang: More improvement to type inferrence/propagation. Support ifTrue:ifFalse:. Better separate the passes in inferTypesForImplicitlyTypedVariablesAndMethods. Fix slip in nodeToCast:to:. Provide types for atan, et al. Avoid casting nil.
Don't inline complex expressions that are bound to variables used in asserts.
Modified Paths: -------------- branches/Cog/build.linux32x86/newspeak.cog.spur/build/mvm branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert/mvm branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert.itimerheartbeat/mvm branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug/mvm branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug.itimerheartbeat/mvm branches/Cog/build.linux32x86/newspeak.cog.spur/build.itimerheartbeat/mvm branches/Cog/build.linux32x86/newspeak.stack.spur/build/mvm branches/Cog/build.linux32x86/newspeak.stack.spur/build.assert/mvm branches/Cog/build.linux32x86/newspeak.stack.spur/build.debug/mvm branches/Cog/build.linux64x64/newspeak.cog.spur/build/mvm branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert/mvm branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert.itimerheartbeat/mvm branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug/mvm branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug.itimerheartbeat/mvm branches/Cog/build.linux64x64/newspeak.cog.spur/build.itimerheartbeat/mvm branches/Cog/build.linux64x64/newspeak.stack.spur/build/mvm branches/Cog/build.linux64x64/newspeak.stack.spur/build.assert/mvm branches/Cog/build.linux64x64/newspeak.stack.spur/build.debug/mvm branches/Cog/build.macos32x86/newspeak.cog.spur/CoreVM.xcodeproj/project.pbxproj branches/Cog/build.macos32x86/newspeak.cog.v3/CoreVM.xcodeproj/project.pbxproj branches/Cog/build.macos32x86/newspeak.stack.spur/CoreVM.xcodeproj/project.pbxproj branches/Cog/build.win32x86/newspeak.cog.spur/Makefile branches/Cog/build.win32x86/newspeak.cog.v3/Makefile branches/Cog/build.win32x86/newspeak.stack.spur/Makefile branches/Cog/nsspursrc/vm/cogit.c branches/Cog/nsspursrc/vm/cogit.h branches/Cog/nsspursrc/vm/cointerp.c branches/Cog/nsspursrc/vm/cointerp.h branches/Cog/nsspursrc/vm/gcc3x-cointerp.c branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c branches/Cog/nsspurstacksrc/vm/interp.c branches/Cog/platforms/Cross/vm/dispdbg.h branches/Cog/scripts/svnci branches/Cog/sistasrc/vm/cogit.c branches/Cog/sistasrc/vm/cogit.h branches/Cog/sistasrc/vm/cointerp.c branches/Cog/sistasrc/vm/cointerp.h branches/Cog/sistasrc/vm/gcc3x-cointerp.c branches/Cog/spursistasrc/vm/cogit.c branches/Cog/spursistasrc/vm/cogit.h branches/Cog/spursistasrc/vm/cointerp.c branches/Cog/spursistasrc/vm/cointerp.h branches/Cog/spursistasrc/vm/gcc3x-cointerp.c branches/Cog/spursrc/vm/cogit.c branches/Cog/spursrc/vm/cogit.h branches/Cog/spursrc/vm/cointerp.c branches/Cog/spursrc/vm/cointerp.h branches/Cog/spursrc/vm/gcc3x-cointerp.c branches/Cog/spurstack64src/vm/exampleSqNamedPrims.h 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/AioPlugin/AioPlugin.c branches/Cog/src/plugins/B2DPlugin/B2DPlugin.c branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c branches/Cog/src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c branches/Cog/src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c branches/Cog/src/plugins/XDisplayControlPlugin/XDisplayControlPlugin.c branches/Cog/src/vm/cogit.c branches/Cog/src/vm/cogit.h 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/nsspursrc/plugins/ branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c branches/Cog/nsspursrc/plugins/AsynchFilePlugin/AsynchFilePlugin.c branches/Cog/nsspursrc/plugins/B2DPlugin/B2DPlugin.c branches/Cog/nsspursrc/plugins/BitBltPlugin/BitBltPlugin.c branches/Cog/nsspursrc/plugins/DSAPrims/DSAPrims.c branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c branches/Cog/nsspursrc/plugins/FloatMathPlugin/FloatMathPlugin.c branches/Cog/nsspursrc/plugins/IA32ABI/IA32ABI.c branches/Cog/nsspursrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c branches/Cog/nsspursrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c branches/Cog/nsspursrc/plugins/RePlugin/RePlugin.c branches/Cog/nsspursrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c branches/Cog/nsspursrc/plugins/VMProfileLinuxSupportPlugin/VMProfileLinuxSupportPlugin.c branches/Cog/nsspursrc/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c branches/Cog/nsspursrc/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c branches/Cog/nsspursrc/plugins/ZipPlugin/ZipPlugin.c
Removed Paths: ------------- branches/Cog/nscogsrc/plugins/ branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c branches/Cog/nsspursrc/plugins/AsynchFilePlugin/AsynchFilePlugin.c branches/Cog/nsspursrc/plugins/B2DPlugin/B2DPlugin.c branches/Cog/nsspursrc/plugins/BitBltPlugin/BitBltPlugin.c branches/Cog/nsspursrc/plugins/DSAPrims/DSAPrims.c branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c branches/Cog/nsspursrc/plugins/FloatMathPlugin/FloatMathPlugin.c branches/Cog/nsspursrc/plugins/IA32ABI/IA32ABI.c branches/Cog/nsspursrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c branches/Cog/nsspursrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c branches/Cog/nsspursrc/plugins/RePlugin/RePlugin.c branches/Cog/nsspursrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c branches/Cog/nsspursrc/plugins/VMProfileLinuxSupportPlugin/VMProfileLinuxSupportPlugin.c branches/Cog/nsspursrc/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c branches/Cog/nsspursrc/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c branches/Cog/nsspursrc/plugins/ZipPlugin/ZipPlugin.c
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/build.linux32x86/newspeak.cog.spur/build/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.cog.spur/build/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.cog.spur/build/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -22,7 +22,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspursrc --with-plugins=nscogsrc/plugins \ + --with-src=nsspursrc --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspursrc --with-plugins=nscogsrc/plugins \ + --with-src=nsspursrc --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert.itimerheartbeat/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert.itimerheartbeat/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.cog.spur/build.assert.itimerheartbeat/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspursrc --with-plugins=nscogsrc/plugins \ + --with-src=nsspursrc --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspursrc --with-plugins=nscogsrc/plugins \ + --with-src=nsspursrc --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug.itimerheartbeat/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug.itimerheartbeat/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.cog.spur/build.debug.itimerheartbeat/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspursrc --with-plugins=nscogsrc/plugins \ + --with-src=nsspursrc --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.cog.spur/build.itimerheartbeat/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.cog.spur/build.itimerheartbeat/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.cog.spur/build.itimerheartbeat/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -22,7 +22,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspursrc --with-plugins=nscogsrc/plugins \ + --with-src=nsspursrc --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.stack.spur/build/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.stack.spur/build/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.stack.spur/build/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -22,7 +22,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspurstacksrc --with-plugins=nscogsrc/plugins --disable-cogit \ + --with-src=nsspurstacksrc --with-plugins=nsspursrc/plugins --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.stack.spur/build.assert/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.stack.spur/build.assert/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.stack.spur/build.assert/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspurstacksrc --with-plugins=nscogsrc/plugins --disable-cogit \ + --with-src=nsspurstacksrc --with-plugins=nsspursrc/plugins --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux32x86/newspeak.stack.spur/build.debug/mvm =================================================================== --- branches/Cog/build.linux32x86/newspeak.stack.spur/build.debug/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux32x86/newspeak.stack.spur/build.debug/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspurstacksrc --with-plugins=nscogsrc/plugins --disable-cogit \ + --with-src=nsspurstacksrc --with-plugins=nsspursrc/plugins --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m32" \ CXX="g++ -m32" \
Modified: branches/Cog/build.linux64x64/newspeak.cog.spur/build/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.cog.spur/build/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.cog.spur/build/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -22,7 +22,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspur64src --with-plugins=nscogsrc/plugins \ + --with-src=nsspur64src --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspur64src --with-plugins=nscogsrc/plugins \ + --with-src=nsspur64src --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert.itimerheartbeat/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert.itimerheartbeat/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.cog.spur/build.assert.itimerheartbeat/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspur64src --with-plugins=nscogsrc/plugins \ + --with-src=nsspur64src --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspur64src --with-plugins=nscogsrc/plugins \ + --with-src=nsspur64src --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug.itimerheartbeat/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug.itimerheartbeat/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.cog.spur/build.debug.itimerheartbeat/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspur64src --with-plugins=nscogsrc/plugins \ + --with-src=nsspur64src --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.cog.spur/build.itimerheartbeat/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.cog.spur/build.itimerheartbeat/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.cog.spur/build.itimerheartbeat/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -22,7 +22,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspur64src --with-plugins=nscogsrc/plugins \ + --with-src=nsspur64src --with-plugins=nsspursrc/plugins \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.stack.spur/build/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.stack.spur/build/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.stack.spur/build/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -22,7 +22,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspurstack64src --with-plugins=nscogsrc/plugins --disable-cogit \ + --with-src=nsspurstack64src --with-plugins=nsspursrc/plugins --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.stack.spur/build.assert/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.stack.spur/build.assert/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.stack.spur/build.assert/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspurstack64src --with-plugins=nscogsrc/plugins --disable-cogit \ + --with-src=nsspurstack64src --with-plugins=nsspursrc/plugins --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.linux64x64/newspeak.stack.spur/build.debug/mvm =================================================================== --- branches/Cog/build.linux64x64/newspeak.stack.spur/build.debug/mvm 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.linux64x64/newspeak.stack.spur/build.debug/mvm 2015-02-24 22:04:06 UTC (rev 3263) @@ -18,7 +18,7 @@ esac test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ - --with-src=nsspurstack64src --with-plugins=nscogsrc/plugins --disable-cogit \ + --with-src=nsspurstack64src --with-plugins=nsspursrc/plugins --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ CC="gcc -m64" \ CXX="g++ -m64" \
Modified: branches/Cog/build.macos32x86/newspeak.cog.spur/CoreVM.xcodeproj/project.pbxproj =================================================================== --- branches/Cog/build.macos32x86/newspeak.cog.spur/CoreVM.xcodeproj/project.pbxproj 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.macos32x86/newspeak.cog.spur/CoreVM.xcodeproj/project.pbxproj 2015-02-24 22:04:06 UTC (rev 3263) @@ -607,7 +607,7 @@ A27729370CE7A8D300ABAFCA /* ZipPlugin.c */, ); name = plugins; - path = ../../nscogsrc/plugins; + path = ../../nsspursrc/plugins; sourceTree = "<group>"; }; 738FB1E80EE4CF4B004BEE42 /* IA32ABI */ = {
Modified: branches/Cog/build.macos32x86/newspeak.cog.v3/CoreVM.xcodeproj/project.pbxproj =================================================================== --- branches/Cog/build.macos32x86/newspeak.cog.v3/CoreVM.xcodeproj/project.pbxproj 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.macos32x86/newspeak.cog.v3/CoreVM.xcodeproj/project.pbxproj 2015-02-24 22:04:06 UTC (rev 3263) @@ -609,7 +609,7 @@ A27729370CE7A8D300ABAFCA /* ZipPlugin.c */, ); name = plugins; - path = ../../nscogsrc/plugins; + path = ../../nsspursrc/plugins; sourceTree = "<group>"; }; 738FB1E80EE4CF4B004BEE42 /* IA32ABI */ = {
Modified: branches/Cog/build.macos32x86/newspeak.stack.spur/CoreVM.xcodeproj/project.pbxproj =================================================================== --- branches/Cog/build.macos32x86/newspeak.stack.spur/CoreVM.xcodeproj/project.pbxproj 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.macos32x86/newspeak.stack.spur/CoreVM.xcodeproj/project.pbxproj 2015-02-24 22:04:06 UTC (rev 3263) @@ -597,7 +597,7 @@ A27729370CE7A8D300ABAFCA /* ZipPlugin.c */, ); name = plugins; - path = ../../nscogsrc/plugins; + path = ../../nsspursrc/plugins; sourceTree = "<group>"; }; 738FB1E80EE4CF4B004BEE42 /* IA32ABI */ = {
Modified: branches/Cog/build.win32x86/newspeak.cog.spur/Makefile =================================================================== --- branches/Cog/build.win32x86/newspeak.cog.spur/Makefile 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.win32x86/newspeak.cog.spur/Makefile 2015-02-24 22:04:06 UTC (rev 3263) @@ -27,7 +27,7 @@ else BUILD:=builddbg endif -PLUGINSRCDIR:= ../../nscogsrc +PLUGINSRCDIR:= ../../nsspursrc VMSRCDIR:= ../../nsspursrc BLDDIR:= $(BASEDIR)/$(BUILD) OBJDIR:= $(BLDDIR)/vm
Modified: branches/Cog/build.win32x86/newspeak.cog.v3/Makefile =================================================================== --- branches/Cog/build.win32x86/newspeak.cog.v3/Makefile 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.win32x86/newspeak.cog.v3/Makefile 2015-02-24 22:04:06 UTC (rev 3263) @@ -27,7 +27,7 @@ else BUILD:=builddbg endif -PLUGINSRCDIR:= ../../nscogsrc +PLUGINSRCDIR:= ../../nsspursrc VMSRCDIR:= ../../nscogsrc BLDDIR:= $(BASEDIR)/$(BUILD) OBJDIR:= $(BLDDIR)/vm
Modified: branches/Cog/build.win32x86/newspeak.stack.spur/Makefile =================================================================== --- branches/Cog/build.win32x86/newspeak.stack.spur/Makefile 2015-02-23 00:31:15 UTC (rev 3262) +++ branches/Cog/build.win32x86/newspeak.stack.spur/Makefile 2015-02-24 22:04:06 UTC (rev 3263) @@ -27,7 +27,7 @@ else BUILD:=builddbg endif -PLUGINSRCDIR:= ../../nscogsrc +PLUGINSRCDIR:= ../../nsspursrc VMSRCDIR:= ../../nsspurstacksrc BLDDIR:= $(BASEDIR)/$(BUILD) OBJDIR:= $(BLDDIR)/vm
Deleted: branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c =================================================================== --- branches/Cog/nscogsrc/plugins/AioPlugin/AioPlugin.c 2015-01-07 00:59:06 UTC (rev 3216) +++ branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c 2015-02-24 22:04:06 UTC (rev 3263) @@ -1,711 +0,0 @@ -/* Automatically generated by - VMPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d - from - UnixAioPlugin VMConstruction-Plugins-AioPlugin-eem.17 uuid: a2b39cb2-e681-4bc3-a777-f03b2e3f2de0 - */ -static char __buildInfo[] = "UnixAioPlugin VMConstruction-Plugins-AioPlugin-eem.17 uuid: a2b39cb2-e681-4bc3-a777-f03b2e3f2de0 " __DATE__ ; - - - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <unistd.h> -#define FILEHANDLETYPE FILE * /* the type of low level stream to be used in a struct SQFile */ - -/* Default EXPORT macro that does nothing (see comment in sq.h): */ -#define EXPORT(returnType) returnType - -/* Do not include the entire sq.h file but just those parts needed. */ -/* The virtual machine proxy definition */ -#include "sqVirtualMachine.h" -/* Configuration options */ -#include "sqConfig.h" -/* Platform specific definitions */ -#include "sqPlatformSpecific.h" - -#define true 1 -#define false 0 -#define null 0 /* using 'null' because nil is predefined in Think C */ -#ifdef SQUEAK_BUILTIN_PLUGIN -#undef EXPORT -// was #undef EXPORT(returnType) but screws NorCroft cc -#define EXPORT(returnType) static returnType -#endif - -#include "FilePlugin.h" -#include "SocketPlugin.h" -#include "config.h" -#define SESSIONIDENTIFIERTYPE int -#include "sqaio.h" -#include "sqMemoryAccess.h" - - -/*** Constants ***/ - - -/*** Function Prototypes ***/ -static void aioForwardwithDataandFlags(int fd, void *data, int flags); -static sqInt fileDescriptorFrom(sqInt aSQFileByteArray); -static FILEHANDLETYPE fileHandleFrom(sqInt sqFileStructByteArray); -static sqInt fileRecordSize(void); -static SQFile * fileValueOf(sqInt anSQFileRecord); -EXPORT(const char*) getModuleName(void); -static sqInt getThisSessionIdentifier(void); -EXPORT(sqInt) initialiseModule(void); -static sqInt isNonNullSQFile(sqInt objectPointer); -static sqInt isNullSQSocket(sqInt objectPointer); -static sqInt isSQFileObject(sqInt objectPointer); -static sqInt isSQSocketObject(sqInt objectPointer); -static sqInt isValidFileSession(sqInt objectPointer); -EXPORT(sqInt) moduleUnloaded(char *aModuleName); -EXPORT(sqInt) primitiveAioDisable(void); -EXPORT(sqInt) primitiveAioEnable(void); -EXPORT(sqInt) primitiveAioHandle(void); -EXPORT(sqInt) primitiveAioSuspend(void); -EXPORT(sqInt) primitiveModuleName(void); -EXPORT(sqInt) primitiveOSFileHandle(void); -EXPORT(sqInt) primitiveOSSocketHandle(void); -EXPORT(sqInt) primitiveVersionString(void); -static SESSIONIDENTIFIERTYPE sessionIdentifierFromSqFile(SQFile *sqFile); -EXPORT(sqInt) setInterpreter(struct VirtualMachine*anInterpreter); -EXPORT(sqInt) shutdownModule(void); -static int socketDescriptorFrom(sqInt sqSocketOop); -static sqInt socketRecordSize(void); -static SQSocket * socketValueOf(sqInt anSQSocketRecord); -static sqInt stringFromCString(const char *aCString); -static char * versionString(void); - - -/*** Variables ***/ - -#if !defined(SQUEAK_BUILTIN_PLUGIN) -static void * (*arrayValueOf)(sqInt oop); -static sqInt (*byteSizeOf)(sqInt oop); -static sqInt (*classString)(void); -static sqInt (*getThisSessionID)(void); -static sqInt (*instantiateClassindexableSize)(sqInt classPointer, sqInt size); -static sqInt (*isBytes)(sqInt oop); -static sqInt (*nilObject)(void); -static sqInt (*pop)(sqInt nItems); -static sqInt (*popthenPush)(sqInt nItems, sqInt oop); -static sqInt (*primitiveFail)(void); -static sqInt (*pushInteger)(sqInt integerValue); -static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex); -static sqInt (*stackIntegerValue)(sqInt offset); -static sqInt (*stackObjectValue)(sqInt offset); -static sqInt (*stackValue)(sqInt offset); -static sqInt (*trueObject)(void); -#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */ -extern void * arrayValueOf(sqInt oop); -extern sqInt byteSizeOf(sqInt oop); -extern sqInt classString(void); -extern sqInt getThisSessionID(void); -extern sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size); -extern sqInt isBytes(sqInt oop); -extern sqInt nilObject(void); -extern sqInt pop(sqInt nItems); -extern sqInt popthenPush(sqInt nItems, sqInt oop); -extern sqInt primitiveFail(void); -extern sqInt pushInteger(sqInt integerValue); -extern sqInt signalSemaphoreWithIndex(sqInt semaIndex); -extern sqInt stackIntegerValue(sqInt offset); -extern sqInt stackObjectValue(sqInt offset); -extern sqInt stackValue(sqInt offset); -extern sqInt trueObject(void); -extern -#endif -struct VirtualMachine* interpreterProxy; -static const char *moduleName = -#ifdef SQUEAK_BUILTIN_PLUGIN - "AioPlugin VMConstruction-Plugins-AioPlugin-eem.17 (i)" -#else - "AioPlugin VMConstruction-Plugins-AioPlugin-eem.17 (e)" -#endif -; - - - -/* This function is called to signal a Smalltalk Semaphore when an - asynchronous event is - detected. When translated to C, the name of this method is - aioForwardwithDataandFlags. The event handler is set up by - #primitiveAioHandle. - */ - -static void -aioForwardwithDataandFlags(int fd, void *data, int flags) -{ - int *pfd; - sqInt semaIndex; - - pfd = data; - semaIndex = *pfd; - signalSemaphoreWithIndex(semaIndex); -} - - -/* Answer the OS file descriptor, an integer value, from a SQFile data - structure byte array, or answer -1 if unable to obtain the file descriptor - (probably due - to receiving an incorrect type of object as aFileHandle). - */ -/* return type should be int, but skip the declaration to permit inlining */ - -static sqInt -fileDescriptorFrom(sqInt aSQFileByteArray) -{ - if (!((((isBytes(aSQFileByteArray)) - && ((byteSizeOf(aSQFileByteArray)) == (sizeof(SQFile)))) - && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(aSQFileByteArray))))) - && (isNonNullSQFile(aSQFileByteArray)))) { - return -1; - } - return fileno(fileHandleFrom(aSQFileByteArray)); -} - - -/* Answer a file handle from a SQFile structure. On most platforms, this - will be a (FILE *). On Win32, it is a HANDLE. */ - -static FILEHANDLETYPE -fileHandleFrom(sqInt sqFileStructByteArray) -{ - SQFile *sqFile; - - sqFile = arrayValueOf(sqFileStructByteArray); - return sqFile->file; -} - - -/* Answer the size of a SQFile data structure in bytes. */ - -static sqInt -fileRecordSize(void) -{ - return sizeof(SQFile); -} - - -/* Return a pointer to the first byte of of the SQFile data structure file - record within - anSQFileRecord, which is expected to be a ByteArray of size - self>>fileRecordSize. - */ - -static SQFile * -fileValueOf(sqInt anSQFileRecord) -{ - return arrayValueOf(anSQFileRecord); -} - - -/* Note: This is hardcoded so it can be run from Squeak. - The module name is used for validating a module *after* - it is loaded to check if it does really contain the module - we're thinking it contains. This is important! */ - -EXPORT(const char*) -getModuleName(void) -{ - return moduleName; -} - -static sqInt -getThisSessionIdentifier(void) -{ - return getThisSessionID(); -} - -EXPORT(sqInt) -initialiseModule(void) -{ - return 1; -} - - -/* Check for the common failure mode of a SQFile record with all zeros. */ - -static sqInt -isNonNullSQFile(sqInt objectPointer) -{ - unsigned idx; - unsigned char *sqFileBytes; - - sqFileBytes = arrayValueOf(objectPointer); - idx = 0; - while (idx < (sizeof(SQFile))) { - if ((sqFileBytes[idx]) != 0) { - return 1; - } - idx += 1; - } - return 0; -} - - -/* Check for the common failure mode of a SQSocket record with all zeros. */ - -static sqInt -isNullSQSocket(sqInt objectPointer) -{ - sqInt idx; - unsigned char *sqSocketBytes; - - sqSocketBytes = arrayValueOf(objectPointer); - idx = 0; - while (idx < (socketRecordSize())) { - if ((sqSocketBytes[idx]) != 0) { - return 0; - } - idx += 1; - } - return 1; -} - - -/* Answer true if objectPointer appears to be a valid SQFile ByteArray. - This check is appropriate if objectPointer has been passed as a parameter - to a primitive, and is expected to represent a valid file reference. */ - -static sqInt -isSQFileObject(sqInt objectPointer) -{ - return (((isBytes(objectPointer)) - && ((byteSizeOf(objectPointer)) == (sizeof(SQFile)))) - && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(objectPointer))))) - && (isNonNullSQFile(objectPointer)); -} - - -/* Answer true if objectPointer appears to be a valid SQSocket ByteArray. - This check - is appropriate if objectPointer has been passed as a parameter to a - primitive, and - is expected to represent a valid socket reference. - */ - -static sqInt -isSQSocketObject(sqInt objectPointer) -{ - return ((isBytes(objectPointer)) - && ((byteSizeOf(objectPointer)) == (socketRecordSize()))) - && (!(isNullSQSocket(objectPointer))); -} - - -/* Answer true if the file session matches the current interpreter session - identifier. - */ - -static sqInt -isValidFileSession(sqInt objectPointer) -{ - return (getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(objectPointer))); -} - - -/* The module with the given name was just unloaded. - Make sure we have no dangling references. */ - -EXPORT(sqInt) -moduleUnloaded(char *aModuleName) -{ -} - - -/* Definitively disable asynchronous event notification for a descriptor. The - parameter is an OS level integer file descriptor. */ - -EXPORT(sqInt) -primitiveAioDisable(void) -{ - sqInt fd; - - if ((nilObject()) == (stackValue(0))) { - return primitiveFail(); - } - fd = stackIntegerValue(0); - if (fd < 0) { - return primitiveFail(); - } - aioDisable(fd); - pop(2); - pushInteger(fd); -} - - -/* Enable asynchronous notification for a descriptor. The first parameter is - an OS - level integer file descriptor. The second parameter is the index of a - Semaphore to - be notified, and the third parameter is a flag indicating that descriptor - represents an external object and should not be closed on termination of - aio handling. Answer - the semaphore index. - */ - -EXPORT(sqInt) -primitiveAioEnable(void) -{ - static int eventSemaphoreIndices[FD_SETSIZE]; - sqInt externalObject; - sqInt fd; - sqInt flags; - sqInt semaIndex; - - if ((nilObject()) == (stackValue(2))) { - return primitiveFail(); - } - fd = stackIntegerValue(2); - if (fd < 0) { - return primitiveFail(); - } - semaIndex = stackIntegerValue(1); - eventSemaphoreIndices[semaIndex] = semaIndex; - externalObject = stackObjectValue(0); - if (externalObject == (trueObject())) { - flags = AIO_EXT; - } - else { - flags = 0; - } - aioEnable(fd, &(eventSemaphoreIndices[semaIndex]), flags); - pop(4); - pushInteger(semaIndex); -} - - -/* Handle asynchronous event notification for a descriptor. The first - parameter is - an OS level integer file descriptor. The remaining three parameters are - Boolean flags representing the types of events for which notification is - being requested: - handle exceptions, handle for read, and handle for write. - Flags are defined in the aio.h source as: - AIO_X (1<<0) handle for exceptions - AIO_R (1<<1) handle for read - AIO_W (1<<2) handle for write */ - -EXPORT(sqInt) -primitiveAioHandle(void) -{ - sqInt exceptionWatch; - sqInt fd; - sqInt flags; - sqInt readWatch; - sqInt writeWatch; - - if ((nilObject()) == (stackValue(3))) { - return primitiveFail(); - } - fd = stackIntegerValue(3); - if (fd < 0) { - return primitiveFail(); - } - exceptionWatch = stackObjectValue(2); - readWatch = stackObjectValue(1); - writeWatch = stackObjectValue(0); - flags = 0; - if (exceptionWatch == (trueObject())) { - flags = flags | (AIO_X); - } - if (readWatch == (trueObject())) { - flags = flags | (AIO_R); - } - if (writeWatch == (trueObject())) { - flags = flags | (AIO_W); - } - aioHandle(fd, aioForwardwithDataandFlags, flags); - pop(5); - pushInteger(flags); -} - - -/* Temporarily suspend asynchronous event notification for a descriptor. The - first parameter is an OS level integer file descriptor. The remaining - three parameters - are Boolean flags representing the types of events for which notification - is being - requested: handle exceptions, handle for read, and handle for write. - Flags are defined in the aio.h source as: - AIO_X (1<<0) handle for exceptions - AIO_R (1<<1) handle for read - AIO_W (1<<2) handle for write */ - -EXPORT(sqInt) -primitiveAioSuspend(void) -{ - sqInt exceptionWatch; - sqInt fd; - sqInt flags; - sqInt readWatch; - sqInt writeWatch; - - if ((nilObject()) == (stackValue(3))) { - return primitiveFail(); - } - fd = stackIntegerValue(3); - if (fd < 0) { - return primitiveFail(); - } - exceptionWatch = stackObjectValue(2); - readWatch = stackObjectValue(1); - writeWatch = stackObjectValue(0); - flags = 0; - if (exceptionWatch == (trueObject())) { - flags = flags | (AIO_X); - } - if (readWatch == (trueObject())) { - flags = flags | (AIO_R); - } - if (writeWatch == (trueObject())) { - flags = flags | (AIO_W); - } - aioSuspend(fd, flags); - pop(5); - pushInteger(flags); -} - - -/* Answer a string containing the module name string for this plugin. */ - -EXPORT(sqInt) -primitiveModuleName(void) -{ - popthenPush(1, stringFromCString(getModuleName())); -} - - -/* Take a struct SQFile from the stack, and answer the value of its Unix file - number. - */ - -EXPORT(sqInt) -primitiveOSFileHandle(void) -{ - sqInt fileNo; - sqInt sqFileOop; - - sqFileOop = stackValue(0); - if (!((((isBytes(sqFileOop)) - && ((byteSizeOf(sqFileOop)) == (sizeof(SQFile)))) - && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop))))) - && (isNonNullSQFile(sqFileOop)))) { - return primitiveFail(); - } - /* begin fileDescriptorFrom: */ - if (!((((isBytes(sqFileOop)) - && ((byteSizeOf(sqFileOop)) == (sizeof(SQFile)))) - && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop))))) - && (isNonNullSQFile(sqFileOop)))) { - fileNo = -1; - goto l1; - } - fileNo = fileno(fileHandleFrom(sqFileOop)); -l1: /* end fileDescriptorFrom: */; - pop(2); - pushInteger(fileNo); -} - - -/* Take a struct SQSocket from the stack, and answer the value of its Unix - file number. - */ - -EXPORT(sqInt) -primitiveOSSocketHandle(void) -{ - int fileNo; - sqInt sqSocketOop; - - sqSocketOop = stackValue(0); - if (!(((isBytes(sqSocketOop)) - && ((byteSizeOf(sqSocketOop)) == (socketRecordSize()))) - && (!(isNullSQSocket(sqSocketOop))))) { - return primitiveFail(); - } - fileNo = socketDescriptorFrom(sqSocketOop); - if (fileNo < 0) { - return primitiveFail(); - } - pop(2); - pushInteger(fileNo); -} - - -/* Answer a string containing the version string for this plugin. */ - -EXPORT(sqInt) -primitiveVersionString(void) -{ - popthenPush(1, stringFromCString(versionString())); -} - - -/* Answer the session identifier from a SQFile structure. For a valid file - reference, this identifier will match the session identifier supplied by - the interpreter. */ - -static SESSIONIDENTIFIERTYPE -sessionIdentifierFromSqFile(SQFile *sqFile) -{ - return sqFile->sessionID; -} - - -/* Note: This is coded so that it can be run in Squeak. */ - -EXPORT(sqInt) -setInterpreter(struct VirtualMachine*anInterpreter) -{ - sqInt ok; - - interpreterProxy = anInterpreter; - ok = ((interpreterProxy->majorVersion()) == (VM_PROXY_MAJOR)) - && ((interpreterProxy->minorVersion()) >= (VM_PROXY_MINOR)); - if (ok) { - -#if !defined(SQUEAK_BUILTIN_PLUGIN) - arrayValueOf = interpreterProxy->arrayValueOf; - byteSizeOf = interpreterProxy->byteSizeOf; - classString = interpreterProxy->classString; - getThisSessionID = interpreterProxy->getThisSessionID; - instantiateClassindexableSize = interpreterProxy->instantiateClassindexableSize; - isBytes = interpreterProxy->isBytes; - nilObject = interpreterProxy->nilObject; - pop = interpreterProxy->pop; - popthenPush = interpreterProxy->popthenPush; - primitiveFail = interpreterProxy->primitiveFail; - pushInteger = interpreterProxy->pushInteger; - signalSemaphoreWithIndex = interpreterProxy->signalSemaphoreWithIndex; - stackIntegerValue = interpreterProxy->stackIntegerValue; - stackObjectValue = interpreterProxy->stackObjectValue; - stackValue = interpreterProxy->stackValue; - trueObject = interpreterProxy->trueObject; -#endif /* !defined(SQUEAK_BUILTIN_PLUGIN) */ - } - return ok; -} - -EXPORT(sqInt) -shutdownModule(void) -{ -} - - -/* Answer the OS file descriptor, an integer value, from a SQSocket data - structure, or answer -1 if unable to obtain the file descriptor (probably - due to receiving - an incorrect type of object as aFileHandle). - - Warning: The first element of privateSocketStruct happens to be the Unix - file number of the socket. See sqUnixSocket.c for the definition. This - method takes - advantage of this, and will break if anyone ever redefines the data - structure. - */ - -static int -socketDescriptorFrom(sqInt sqSocketOop) -{ - void *privateSocketStruct; - SQSocket *sqSocket; - - /* begin socketValueOf: */ - sqSocket = arrayValueOf(sqSocketOop); - privateSocketStruct = sqSocket->privateSocketPtr; - if (privateSocketStruct == 0) { - return -1; - } - return * (int *) privateSocketStruct; -} - - -/* Answer the size of a SQSocket data structure in bytes. */ - -static sqInt -socketRecordSize(void) -{ - return sizeof(SQSocket); -} - - -/* Return a pointer to the first byte of of the SQsocket data structure - socket record within - anSQSocketRecord, which is expected to be a ByteArray of size - self>>socketRecordSize. - */ - -static SQSocket * -socketValueOf(sqInt anSQSocketRecord) -{ - return arrayValueOf(anSQSocketRecord); -} - - -/* Answer a new String copied from a null-terminated C string. - Caution: This may invoke the garbage collector. */ - -static sqInt -stringFromCString(const char *aCString) -{ - sqInt len; - sqInt newString; - - len = strlen(aCString); - newString = instantiateClassindexableSize(classString(), len); - strncpy(arrayValueOf(newString), aCString, len); - return newString; -} - - -/* Answer a string containing the version string for this plugin. Handle MNU - errors, which can occur if class InterpreterPlugin has been removed from - the system. - - Important: When this method is changed, the class side method must also be - changed to match. - */ -/* 2.0 supports 64bit code base */ - -static char * -versionString(void) -{ - static char version[]= "2.2.6"; - - return version; -} - - -#ifdef SQUEAK_BUILTIN_PLUGIN - -void* AioPlugin_exports[][3] = { - {"AioPlugin", "getModuleName", (void*)getModuleName}, - {"AioPlugin", "initialiseModule", (void*)initialiseModule}, - {"AioPlugin", "moduleUnloaded", (void*)moduleUnloaded}, - {"AioPlugin", "primitiveAioDisable\000\000", (void*)primitiveAioDisable}, - {"AioPlugin", "primitiveAioEnable\000\000", (void*)primitiveAioEnable}, - {"AioPlugin", "primitiveAioHandle\000\000", (void*)primitiveAioHandle}, - {"AioPlugin", "primitiveAioSuspend\000\000", (void*)primitiveAioSuspend}, - {"AioPlugin", "primitiveModuleName\000\377", (void*)primitiveModuleName}, - {"AioPlugin", "primitiveOSFileHandle\000\001", (void*)primitiveOSFileHandle}, - {"AioPlugin", "primitiveOSSocketHandle\000\001", (void*)primitiveOSSocketHandle}, - {"AioPlugin", "primitiveVersionString\000\377", (void*)primitiveVersionString}, - {"AioPlugin", "setInterpreter", (void*)setInterpreter}, - {"AioPlugin", "shutdownModule\000\377", (void*)shutdownModule}, - {NULL, NULL, NULL} -}; - -#else /* ifdef SQ_BUILTIN_PLUGIN */ - -signed char primitiveAioDisableAccessorDepth = 0; -signed char primitiveAioEnableAccessorDepth = 0; -signed char primitiveAioHandleAccessorDepth = 0; -signed char primitiveAioSuspendAccessorDepth = 0; -signed char primitiveOSFileHandleAccessorDepth = 1; -signed char primitiveOSSocketHandleAccessorDepth = 1; - -#endif /* ifdef SQ_BUILTIN_PLUGIN */
Copied: branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c (from rev 3260, branches/Cog/nscogsrc/plugins/AioPlugin/AioPlugin.c) =================================================================== --- branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c (rev 0) +++ branches/Cog/nsspursrc/plugins/AioPlugin/AioPlugin.c 2015-02-24 22:04:06 UTC (rev 3263) @@ -0,0 +1,711 @@ +/* Automatically generated by + VMPluginCodeGenerator VMMaker.oscog-eem.1080 uuid: 8b1a09b7-4f58-4375-b16a-e42e63ffd542 + from + UnixAioPlugin VMConstruction-Plugins-AioPlugin-eem.17 uuid: a2b39cb2-e681-4bc3-a777-f03b2e3f2de0 + */ +static char __buildInfo[] = "UnixAioPlugin VMConstruction-Plugins-AioPlugin-eem.17 uuid: a2b39cb2-e681-4bc3-a777-f03b2e3f2de0 " __DATE__ ; + + + +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> +#define FILEHANDLETYPE FILE * /* the type of low level stream to be used in a struct SQFile */ + +/* Default EXPORT macro that does nothing (see comment in sq.h): */ +#define EXPORT(returnType) returnType + +/* Do not include the entire sq.h file but just those parts needed. */ +/* The virtual machine proxy definition */ +#include "sqVirtualMachine.h" +/* Configuration options */ +#include "sqConfig.h" +/* Platform specific definitions */ +#include "sqPlatformSpecific.h" + +#define true 1 +#define false 0 +#define null 0 /* using 'null' because nil is predefined in Think C */ +#ifdef SQUEAK_BUILTIN_PLUGIN +#undef EXPORT +// was #undef EXPORT(returnType) but screws NorCroft cc +#define EXPORT(returnType) static returnType +#endif + +#include "FilePlugin.h" +#include "SocketPlugin.h" +#include "config.h" +#define SESSIONIDENTIFIERTYPE int +#include "sqaio.h" +#include "sqMemoryAccess.h" + + +/*** Constants ***/ + + +/*** Function Prototypes ***/ +static void aioForwardwithDataandFlags(int fd, void *data, int flags); +static sqInt fileDescriptorFrom(sqInt aSQFileByteArray); +static FILEHANDLETYPE fileHandleFrom(sqInt sqFileStructByteArray); +static sqInt fileRecordSize(void); +static SQFile * fileValueOf(sqInt anSQFileRecord); +EXPORT(const char*) getModuleName(void); +static sqInt getThisSessionIdentifier(void); +EXPORT(sqInt) initialiseModule(void); +static sqInt isNonNullSQFile(sqInt objectPointer); +static sqInt isNullSQSocket(sqInt objectPointer); +static sqInt isSQFileObject(sqInt objectPointer); +static sqInt isSQSocketObject(sqInt objectPointer); +static sqInt isValidFileSession(sqInt objectPointer); +EXPORT(sqInt) moduleUnloaded(char *aModuleName); +EXPORT(sqInt) primitiveAioDisable(void); +EXPORT(sqInt) primitiveAioEnable(void); +EXPORT(sqInt) primitiveAioHandle(void); +EXPORT(sqInt) primitiveAioSuspend(void); +EXPORT(sqInt) primitiveModuleName(void); +EXPORT(sqInt) primitiveOSFileHandle(void); +EXPORT(sqInt) primitiveOSSocketHandle(void); +EXPORT(sqInt) primitiveVersionString(void); +static SESSIONIDENTIFIERTYPE sessionIdentifierFromSqFile(SQFile *sqFile); +EXPORT(sqInt) setInterpreter(struct VirtualMachine*anInterpreter); +EXPORT(sqInt) shutdownModule(void); +static int socketDescriptorFrom(sqInt sqSocketOop); +static sqInt socketRecordSize(void); +static SQSocket * socketValueOf(sqInt anSQSocketRecord); +static sqInt stringFromCString(const char *aCString); +static char * versionString(void); + + +/*** Variables ***/ + +#if !defined(SQUEAK_BUILTIN_PLUGIN) +static void * (*arrayValueOf)(sqInt oop); +static sqInt (*byteSizeOf)(sqInt oop); +static sqInt (*classString)(void); +static sqInt (*getThisSessionID)(void); +static sqInt (*instantiateClassindexableSize)(sqInt classPointer, sqInt size); +static sqInt (*isBytes)(sqInt oop); +static sqInt (*nilObject)(void); +static sqInt (*pop)(sqInt nItems); +static sqInt (*popthenPush)(sqInt nItems, sqInt oop); +static sqInt (*primitiveFail)(void); +static sqInt (*pushInteger)(sqInt integerValue); +static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex); +static sqInt (*stackIntegerValue)(sqInt offset); +static sqInt (*stackObjectValue)(sqInt offset); +static sqInt (*stackValue)(sqInt offset); +static sqInt (*trueObject)(void); +#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */ +extern void * arrayValueOf(sqInt oop); +extern sqInt byteSizeOf(sqInt oop); +extern sqInt classString(void); +extern sqInt getThisSessionID(void); +extern sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size); +extern sqInt isBytes(sqInt oop); +extern sqInt nilObject(void); +extern sqInt pop(sqInt nItems); +extern sqInt popthenPush(sqInt nItems, sqInt oop); +extern sqInt primitiveFail(void); +extern sqInt pushInteger(sqInt integerValue); +extern sqInt signalSemaphoreWithIndex(sqInt semaIndex); +extern sqInt stackIntegerValue(sqInt offset); +extern sqInt stackObjectValue(sqInt offset); +extern sqInt stackValue(sqInt offset); +extern sqInt trueObject(void); +extern +#endif +struct VirtualMachine* interpreterProxy; +static const char *moduleName = +#ifdef SQUEAK_BUILTIN_PLUGIN + "AioPlugin VMConstruction-Plugins-AioPlugin-eem.17 (i)" +#else + "AioPlugin VMConstruction-Plugins-AioPlugin-eem.17 (e)" +#endif +; + + + +/* This function is called to signal a Smalltalk Semaphore when an + asynchronous event is + detected. When translated to C, the name of this method is + aioForwardwithDataandFlags. The event handler is set up by + #primitiveAioHandle. + */ + +static void +aioForwardwithDataandFlags(int fd, void *data, int flags) +{ + int *pfd; + sqInt semaIndex; + + pfd = data; + semaIndex = *pfd; + signalSemaphoreWithIndex(semaIndex); +} + + +/* Answer the OS file descriptor, an integer value, from a SQFile data + structure byte array, or answer -1 if unable to obtain the file descriptor + (probably due + to receiving an incorrect type of object as aFileHandle). + */ +/* return type should be int, but skip the declaration to permit inlining */ + +static sqInt +fileDescriptorFrom(sqInt aSQFileByteArray) +{ + if (!((((isBytes(aSQFileByteArray)) + && ((byteSizeOf(aSQFileByteArray)) == (sizeof(SQFile)))) + && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(aSQFileByteArray))))) + && (isNonNullSQFile(aSQFileByteArray)))) { + return -1; + } + return fileno(fileHandleFrom(aSQFileByteArray)); +} + + +/* Answer a file handle from a SQFile structure. On most platforms, this + will be a (FILE *). On Win32, it is a HANDLE. */ + +static FILEHANDLETYPE +fileHandleFrom(sqInt sqFileStructByteArray) +{ + SQFile *sqFile; + + sqFile = arrayValueOf(sqFileStructByteArray); + return sqFile->file; +} + + +/* Answer the size of a SQFile data structure in bytes. */ + +static sqInt +fileRecordSize(void) +{ + return sizeof(SQFile); +} + + +/* Return a pointer to the first byte of of the SQFile data structure file + record within + anSQFileRecord, which is expected to be a ByteArray of size + self>>fileRecordSize. + */ + +static SQFile * +fileValueOf(sqInt anSQFileRecord) +{ + return arrayValueOf(anSQFileRecord); +} + + +/* Note: This is hardcoded so it can be run from Squeak. + The module name is used for validating a module *after* + it is loaded to check if it does really contain the module + we're thinking it contains. This is important! */ + +EXPORT(const char*) +getModuleName(void) +{ + return moduleName; +} + +static sqInt +getThisSessionIdentifier(void) +{ + return getThisSessionID(); +} + +EXPORT(sqInt) +initialiseModule(void) +{ + return 1; +} + + +/* Check for the common failure mode of a SQFile record with all zeros. */ + +static sqInt +isNonNullSQFile(sqInt objectPointer) +{ + unsigned idx; + unsigned char *sqFileBytes; + + sqFileBytes = arrayValueOf(objectPointer); + idx = 0; + while (idx < (sizeof(SQFile))) { + if ((sqFileBytes[idx]) != 0) { + return 1; + } + idx += 1; + } + return 0; +} + + +/* Check for the common failure mode of a SQSocket record with all zeros. */ + +static sqInt +isNullSQSocket(sqInt objectPointer) +{ + sqInt idx; + unsigned char *sqSocketBytes; + + sqSocketBytes = arrayValueOf(objectPointer); + idx = 0; + while (idx < (socketRecordSize())) { + if ((sqSocketBytes[idx]) != 0) { + return 0; + } + idx += 1; + } + return 1; +} + + +/* Answer true if objectPointer appears to be a valid SQFile ByteArray. + This check is appropriate if objectPointer has been passed as a parameter + to a primitive, and is expected to represent a valid file reference. */ + +static sqInt +isSQFileObject(sqInt objectPointer) +{ + return (((isBytes(objectPointer)) + && ((byteSizeOf(objectPointer)) == (sizeof(SQFile)))) + && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(objectPointer))))) + && (isNonNullSQFile(objectPointer)); +} + + +/* Answer true if objectPointer appears to be a valid SQSocket ByteArray. + This check + is appropriate if objectPointer has been passed as a parameter to a + primitive, and + is expected to represent a valid socket reference. + */ + +static sqInt +isSQSocketObject(sqInt objectPointer) +{ + return ((isBytes(objectPointer)) + && ((byteSizeOf(objectPointer)) == (socketRecordSize()))) + && (!(isNullSQSocket(objectPointer))); +} + + +/* Answer true if the file session matches the current interpreter session + identifier. + */ + +static sqInt +isValidFileSession(sqInt objectPointer) +{ + return (getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(objectPointer))); +} + + +/* The module with the given name was just unloaded. + Make sure we have no dangling references. */ + +EXPORT(sqInt) +moduleUnloaded(char *aModuleName) +{ +} + + +/* Definitively disable asynchronous event notification for a descriptor. The + parameter is an OS level integer file descriptor. */ + +EXPORT(sqInt) +primitiveAioDisable(void) +{ + sqInt fd; + + if ((nilObject()) == (stackValue(0))) { + return primitiveFail(); + } + fd = stackIntegerValue(0); + if (fd < 0) { + return primitiveFail(); + } + aioDisable(fd); + pop(2); + pushInteger(fd); +} + + +/* Enable asynchronous notification for a descriptor. The first parameter is + an OS + level integer file descriptor. The second parameter is the index of a + Semaphore to + be notified, and the third parameter is a flag indicating that descriptor + represents an external object and should not be closed on termination of + aio handling. Answer + the semaphore index. + */ + +EXPORT(sqInt) +primitiveAioEnable(void) +{ + static int eventSemaphoreIndices[FD_SETSIZE]; + sqInt externalObject; + sqInt fd; + sqInt flags; + sqInt semaIndex; + + if ((nilObject()) == (stackValue(2))) { + return primitiveFail(); + } + fd = stackIntegerValue(2); + if (fd < 0) { + return primitiveFail(); + } + semaIndex = stackIntegerValue(1); + eventSemaphoreIndices[semaIndex] = semaIndex; + externalObject = stackObjectValue(0); + if (externalObject == (trueObject())) { + flags = AIO_EXT; + } + else { + flags = 0; + } + aioEnable(fd, &(eventSemaphoreIndices[semaIndex]), flags); + pop(4); + pushInteger(semaIndex); +} + + +/* Handle asynchronous event notification for a descriptor. The first + parameter is + an OS level integer file descriptor. The remaining three parameters are + Boolean flags representing the types of events for which notification is + being requested: + handle exceptions, handle for read, and handle for write. + Flags are defined in the aio.h source as: + AIO_X (1<<0) handle for exceptions + AIO_R (1<<1) handle for read + AIO_W (1<<2) handle for write */ + +EXPORT(sqInt) +primitiveAioHandle(void) +{ + sqInt exceptionWatch; + sqInt fd; + usqInt flags; + sqInt readWatch; + sqInt writeWatch; + + if ((nilObject()) == (stackValue(3))) { + return primitiveFail(); + } + fd = stackIntegerValue(3); + if (fd < 0) { + return primitiveFail(); + } + exceptionWatch = stackObjectValue(2); + readWatch = stackObjectValue(1); + writeWatch = stackObjectValue(0); + flags = 0; + if (exceptionWatch == (trueObject())) { + flags = flags | (AIO_X); + } + if (readWatch == (trueObject())) { + flags = flags | (AIO_R); + } + if (writeWatch == (trueObject())) { + flags = flags | (AIO_W); + } + aioHandle(fd, aioForwardwithDataandFlags, flags); + pop(5); + pushInteger(flags); +} + + +/* Temporarily suspend asynchronous event notification for a descriptor. The + first parameter is an OS level integer file descriptor. The remaining + three parameters + are Boolean flags representing the types of events for which notification + is being + requested: handle exceptions, handle for read, and handle for write. + Flags are defined in the aio.h source as: + AIO_X (1<<0) handle for exceptions + AIO_R (1<<1) handle for read + AIO_W (1<<2) handle for write */ + +EXPORT(sqInt) +primitiveAioSuspend(void) +{ + sqInt exceptionWatch; + sqInt fd; + usqInt flags; + sqInt readWatch; + sqInt writeWatch; + + if ((nilObject()) == (stackValue(3))) { + return primitiveFail(); + } + fd = stackIntegerValue(3); + if (fd < 0) { + return primitiveFail(); + } + exceptionWatch = stackObjectValue(2); + readWatch = stackObjectValue(1); + writeWatch = stackObjectValue(0); + flags = 0; + if (exceptionWatch == (trueObject())) { + flags = flags | (AIO_X); + } + if (readWatch == (trueObject())) { + flags = flags | (AIO_R); + } + if (writeWatch == (trueObject())) { + flags = flags | (AIO_W); + } + aioSuspend(fd, flags); + pop(5); + pushInteger(flags); +} + + +/* Answer a string containing the module name string for this plugin. */ + +EXPORT(sqInt) +primitiveModuleName(void) +{ + popthenPush(1, stringFromCString(getModuleName())); +} + + +/* Take a struct SQFile from the stack, and answer the value of its Unix file + number. + */ + +EXPORT(sqInt) +primitiveOSFileHandle(void) +{ + sqInt fileNo; + sqInt sqFileOop; + + sqFileOop = stackValue(0); + if (!((((isBytes(sqFileOop)) + && ((byteSizeOf(sqFileOop)) == (sizeof(SQFile)))) + && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop))))) + && (isNonNullSQFile(sqFileOop)))) { + return primitiveFail(); + } + /* begin fileDescriptorFrom: */ + if (!((((isBytes(sqFileOop)) + && ((byteSizeOf(sqFileOop)) == (sizeof(SQFile)))) + && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop))))) + && (isNonNullSQFile(sqFileOop)))) { + fileNo = -1; + goto l1; + } + fileNo = fileno(fileHandleFrom(sqFileOop)); +l1: /* end fileDescriptorFrom: */; + pop(2); + pushInteger(fileNo); +} + + +/* Take a struct SQSocket from the stack, and answer the value of its Unix + file number. + */ + +EXPORT(sqInt) +primitiveOSSocketHandle(void) +{ + int fileNo; + sqInt sqSocketOop; + + sqSocketOop = stackValue(0); + if (!(((isBytes(sqSocketOop)) + && ((byteSizeOf(sqSocketOop)) == (socketRecordSize()))) + && (!(isNullSQSocket(sqSocketOop))))) { + return primitiveFail(); + } + fileNo = socketDescriptorFrom(sqSocketOop); + if (fileNo < 0) { + return primitiveFail(); + } + pop(2); + pushInteger(fileNo); +} + + +/* Answer a string containing the version string for this plugin. */ + +EXPORT(sqInt) +primitiveVersionString(void) +{ + popthenPush(1, stringFromCString(versionString())); +} + + +/* Answer the session identifier from a SQFile structure. For a valid file + reference, this identifier will match the session identifier supplied by + the interpreter. */ + +static SESSIONIDENTIFIERTYPE +sessionIdentifierFromSqFile(SQFile *sqFile) +{ + return sqFile->sessionID; +} + + +/* Note: This is coded so that it can be run in Squeak. */ + +EXPORT(sqInt) +setInterpreter(struct VirtualMachine*anInterpreter) +{ + sqInt ok; +
@@ Diff output truncated at 50000 characters. @@
vm-dev@lists.squeakfoundation.org