[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] e2fa2d: CogVM source as per VMMaker.oscog-eem.2436

GitHub noreply at github.com
Sat Aug 25 03:30:08 UTC 2018

  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: e2fa2d10b4e85f1fae03f4e759527eb8e1742385
  Author: Eliot Miranda <eliot.miranda at gmail.com>
  Date:   2018-08-24 (Fri, 24 Aug 2018)

  Changed paths:
    M image/BuildPharo6VMMakerImage.st
    M image/BuildSqueakSpurTrunkVMMakerImage.st
    A image/LoadFFI.st
    R image/Object-performwithwithwithwithwith.st
    M image/Slang Test Workspace.text
    M image/buildspurtrunkreader64image.sh
    M image/buildspurtrunkreaderimage.sh
    M image/getGoodSpur64VM.sh
    M image/getGoodSpurVM.sh
    M nsspur64src/vm/cogit.h
    M nsspur64src/vm/cogitX64SysV.c
    M nsspur64src/vm/cogitX64WIN64.c
    M nsspur64src/vm/cointerp.c
    M nsspur64src/vm/cointerp.h
    M nsspur64src/vm/gcc3x-cointerp.c
    M nsspur64src/vm/interp.h
    M nsspursrc/vm/cogit.h
    M nsspursrc/vm/cogitARMv5.c
    M nsspursrc/vm/cogitIA32.c
    M nsspursrc/vm/cogitMIPSEL.c
    M nsspursrc/vm/cointerp.c
    M nsspursrc/vm/cointerp.h
    M nsspursrc/vm/gcc3x-cointerp.c
    M nsspursrc/vm/interp.h
    M nsspurstack64src/vm/gcc3x-interp.c
    M nsspurstack64src/vm/interp.c
    M nsspurstack64src/vm/interp.h
    M nsspurstacksrc/vm/gcc3x-interp.c
    M nsspurstacksrc/vm/interp.c
    M nsspurstacksrc/vm/interp.h
    M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
    M platforms/Cross/vm/sqVirtualMachine.c
    M platforms/Cross/vm/sqVirtualMachine.h
    M platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m
    M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m
    A platforms/unix/vm/include_ucontext.h
    M platforms/unix/vm/sqUnixMain.c
    M platforms/unix/vm/sqUnixVMProfile.c
    M platforms/win32/vm/sqPlatformSpecific.h
    M platforms/win32/vm/sqWin32Main.c
    M platforms/win32/vm/sqWin32VMProfile.c
    M platforms/win32/vm/sqWin32Window.c
    M spur64src/vm/cogit.h
    M spur64src/vm/cogitX64SysV.c
    M spur64src/vm/cogitX64WIN64.c
    M spur64src/vm/cointerp.c
    M spur64src/vm/cointerp.h
    M spur64src/vm/cointerpmt.c
    M spur64src/vm/cointerpmt.h
    M spur64src/vm/gcc3x-cointerp.c
    M spur64src/vm/gcc3x-cointerpmt.c
    M spur64src/vm/interp.h
    M spurlowcode64src/vm/cogit.h
    M spurlowcode64src/vm/cogitX64SysV.c
    M spurlowcode64src/vm/cogitX64WIN64.c
    M spurlowcode64src/vm/cointerp.c
    M spurlowcode64src/vm/cointerp.h
    M spurlowcode64src/vm/gcc3x-cointerp.c
    M spurlowcode64src/vm/interp.h
    M spurlowcodesrc/vm/cogit.h
    M spurlowcodesrc/vm/cogitARMv5.c
    M spurlowcodesrc/vm/cogitIA32.c
    M spurlowcodesrc/vm/cogitMIPSEL.c
    M spurlowcodesrc/vm/cointerp.c
    M spurlowcodesrc/vm/cointerp.h
    M spurlowcodesrc/vm/gcc3x-cointerp.c
    M spurlowcodesrc/vm/interp.h
    M spurlowcodestack64src/vm/gcc3x-interp.c
    M spurlowcodestack64src/vm/interp.c
    M spurlowcodestack64src/vm/interp.h
    M spurlowcodestacksrc/vm/gcc3x-interp.c
    M spurlowcodestacksrc/vm/interp.c
    M spurlowcodestacksrc/vm/interp.h
    M spursista64src/vm/cogit.h
    M spursista64src/vm/cogitX64SysV.c
    M spursista64src/vm/cogitX64WIN64.c
    M spursista64src/vm/cointerp.c
    M spursista64src/vm/cointerp.h
    M spursista64src/vm/gcc3x-cointerp.c
    M spursista64src/vm/interp.h
    M spursistasrc/vm/cogit.h
    M spursistasrc/vm/cogitARMv5.c
    M spursistasrc/vm/cogitIA32.c
    M spursistasrc/vm/cogitMIPSEL.c
    M spursistasrc/vm/cointerp.c
    M spursistasrc/vm/cointerp.h
    M spursistasrc/vm/gcc3x-cointerp.c
    M spursistasrc/vm/interp.h
    M spursrc/vm/cogit.h
    M spursrc/vm/cogitARMv5.c
    M spursrc/vm/cogitIA32.c
    M spursrc/vm/cogitMIPSEL.c
    M spursrc/vm/cointerp.c
    M spursrc/vm/cointerp.h
    M spursrc/vm/cointerpmt.c
    M spursrc/vm/cointerpmt.h
    M spursrc/vm/gcc3x-cointerp.c
    M spursrc/vm/gcc3x-cointerpmt.c
    M spursrc/vm/interp.h
    M spurstack64src/vm/gcc3x-interp.c
    M spurstack64src/vm/interp.c
    M spurstack64src/vm/interp.h
    M spurstacksrc/vm/gcc3x-interp.c
    M spurstacksrc/vm/interp.c
    M spurstacksrc/vm/interp.h
    M src/plugins/FileAttributesPlugin/FileAttributesPlugin.c
    M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c
    M src/plugins/SqueakFFIPrims/IA32FFIPlugin.c
    M src/plugins/SqueakFFIPrims/X64SysVFFIPlugin.c
    M src/plugins/SqueakFFIPrims/X64Win64FFIPlugin.c
    M src/vm/cogit.h
    M src/vm/cogitARMv5.c
    M src/vm/cogitIA32.c
    M src/vm/cogitMIPSEL.c
    M src/vm/cointerp.c
    M src/vm/cointerp.h
    M src/vm/cointerpmt.c
    M src/vm/cointerpmt.h
    M src/vm/gcc3x-cointerp.c
    M src/vm/gcc3x-cointerpmt.c
    M src/vm/interp.h
    M stacksrc/vm/gcc3x-interp.c
    M stacksrc/vm/interp.c
    M stacksrc/vm/interp.h

  Log Message:
  CogVM source as per VMMaker.oscog-eem.2436

Core VM:
Support for failing FFI calls that raise exceptions.  primitiveFailForFFIException:at:
is the entry point for the platform exception handlers (sigsegv,
squeakExceptionHandler, et al) to catch the signal and call to activate the
invoking method as a primitive failure.

Have the ThreadedFFIPlugin always call disownVM: and ownVM:, providing a flag
that states if this is a threaded callout or not, and another flag that states
that this is an FFI call.

Provide ffiExceptionResponse as a global variable the VM command line argument
processors can set.  By default this is 0 and whether an FFI exception is caught
or not depends on there being an error code in the FFI callout.  If there is one
any exception will be caught; if there isn't a crash will occur as always.  If
ffiExceptionResponse is < 0 FFI exceptions will never be caught and never
delivered as primitive failures (which is selected by -nofailonffiexception).
If ffiExceptionResponse is > 0 then FFI exceptions will always be caught and
always delivered as primitive failures (which is selected by -failonffiexception).

primitiveFailForFFIException:at: now fails if
- in an FFI call as indicated by DisownVMForFFICall being set in inFFIFlags
- ffiExceptionResponse > 0 or ffiExceptionResponse = 0 and newMethod has an error code

So it should always be called from the platform exception handlers such as sigsegv on Unix platforms.

Move reenterInterpreter up to StackInterpreter from CoInterpreter, along with
all relevant methods.  Add mustBeInterpreterFrame agument to justActivateNewMethod:
to that the Cog VM can insist on activating the failing FFI invoking method in
the interpreter, which simplifies the machinery in activateFailingPrimitiveMethod,
which does the work of failing the primitive and long-jumping to the interpreter.
Fix a bug in CoInterpreter's justActivateNewMethod: which left the
instructionPointer one ahead if activating a failing primitive method.
Add primitiveFailForFFIException:at: as a setter for the exception state.

Add PrimErrFFIException.  Update cloneOSErrorObj:numSlots: to deal with a three
slot subclass of PrimitiveError that adds a pc at which an exception took place
(exception can be represented by errorCode).

Initializing extensions should occur before fetching a bytecode, in case the bytecode is itself extended.


274: Update primitiveFileStdioHandles error handling.

Previously validMask = -1 was considered an error.  Now validMask < 0 is
considered an error and the value is returned to the image with

This is more robust against word length in the VM and provides a general
mechanism for the plugin to provide error information back to the image.

274: primitiveFileStdioHandles() fails to return nil if stdio file is not

Modify FilePlugin>>primitiveFileStdioHandles to treat validMask = 0 as
successfully determining that no stdio streams are available.

Previously validMask = 0 would result in the primitive failing with Unsupported.
However having no stdio streams available is normal on Windows, and so shouldn't
signal an error.

sqFileStdioHandlesInto() can either return -1 to signal an unspecified error or use primitiveFailFor() or primitiveFailForOSError() to specify an error.

Image Directory:
Add LoadFFI.st to ease creating spurreader images containing the FFI.
Fix the use of getGoodSpur[64]VM.sh so the buildspurtrunkreader[64]image.sh
commands can take both a -vm foo and an FFI argument.
Nuke Object-performwithwithwithwithwith.st.  This is now in VMMaker.oscog.

      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

More information about the Vm-dev mailing list