Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: 728d79ea5643580d010bd3ba169d4ad0524754f6
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/728d79ea5643580d01…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2020-04-28 (Tue, 28 Apr 2020)
Changed paths:
M build.win32x86/common/Makefile
M build.win32x86/common/Makefile.msvc
M build.win64x64/common/Makefile
M build.win64x64/common/Makefile.msvc
Log Message:
-----------
Add an APPPOST hook to the Windows makefiles. [ci skip]
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: b680bc531451fa26df212ce071c2bf2a4c3dacc3
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/b680bc531451fa26df…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2020-04-27 (Mon, 27 Apr 2020)
Changed paths:
M platforms/iOS/vm/OSX/sqMacUnixExternalPrims.m
Log Message:
-----------
Fix module loading on MacOS so that the app bindle's Resources directory is
searched for dylibs. Search for .dylib before .so in tryLoadingVariations,
unless on PharoVM (I don't want to break anything, but think Pharo should so so
too). Eliminate the use of Contents/macOS/Plugins except for Pharo. AFAIA,
no one else uses the Contents/MacOS/Plugins sub-directory, and
Contents/Frameworks is correct.
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: e36f650636dc3e8d6986689a072e74ccbc78b39a
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e36f650636dc3e8d69…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2020-04-27 (Mon, 27 Apr 2020)
Changed paths:
M build.win32x86/common/SETPATH.BAT
M build.win64x64/common/SETPATH.BAT
M platforms/Cross/plugins/IA32ABI/arm32abicc.c
M platforms/Cross/plugins/IA32ABI/arm64abicc.c
M platforms/Cross/plugins/IA32ABI/ia32abi.h
M platforms/Cross/plugins/IA32ABI/ia32abicc.c
M platforms/Cross/plugins/IA32ABI/ppc32abicc.c
M platforms/Cross/plugins/IA32ABI/x64sysvabicc.c
M platforms/Cross/plugins/IA32ABI/x64win64abicc.c
M platforms/Cross/vm/sqVirtualMachine.c
M platforms/Cross/vm/sqVirtualMachine.h
M platforms/win32/vm/sqWin32Alloc.c
M platforms/win32/vm/sqWin32Backtrace.c
M platforms/win32/vm/sqWin32DirectInput.c
M platforms/win32/vm/sqWin32Directory.c
M platforms/win32/vm/sqWin32DnsInfo.c
M platforms/win32/vm/sqWin32ExternalPrims.c
M platforms/win32/vm/sqWin32GUID.c
M platforms/win32/vm/sqWin32Heartbeat.c
M platforms/win32/vm/sqWin32Main.c
M platforms/win32/vm/sqWin32PluginSupport.c
M platforms/win32/vm/sqWin32Prefs.c
M platforms/win32/vm/sqWin32Service.c
M platforms/win32/vm/sqWin32SpurAlloc.c
M platforms/win32/vm/sqWin32Threads.c
M platforms/win32/vm/sqWin32Time.c
M platforms/win32/vm/sqWin32Utils.c
M platforms/win32/vm/sqWin32VMProfile.c
M platforms/win32/vm/sqWin32Window.c
M src/plugins/B2DPlugin/B2DPlugin.c
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.2748
Plugins: Add error to the VM proxy API, deleting obsoleteDontUseThisFetchWord:
ofObject:. obsoleteDontUseThisFetchWord:ofObject: has never been used by a
Cog/Stack VM plugin, and no plugin has sent erro up until now, so this is a
safe repurpose of an unused slot.
Have BalloonEngineBase>>errorWrongIndex use the VM proxy API's error.
Fix the path to cygwin in SETPATH.BAT to contain a drive letter; needed if
making e.g. on a network drive.
Fix the type of allocateExecutablePage's argument to agree with
primAllocateExecutablePage's byteSize var.
Placate Clang-cl somewhat by changing files in platforms/win32/vm to include
Windows.h rather than windows.h.
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2748.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2748
Author: eem
Time: 27 April 2020, 2:22:49.428028 pm
UUID: 76ab3da9-b0d6-4c09-9d55-9ac9d70f5ec3
Ancestors: VMMaker.oscog-eem.2747
Plugins: Add error to the VM proxy API, deleting obsoleteDontUseThisFetchWord:ofObject:. obsoleteDontUseThisFetchWord:ofObject: has never been used by a Cog/Stack VM plugin, and no plugin has sent erro up until now, so this is a safe repurpose of an unused slot.
Have BalloonEngineBase>>errorWrongIndex use the VM proxy API's error.
Slang: clean-up shouldGenerateAsInterpreterProxySend:, implementing it simply in CCodeGenerator and overriding in VMPluginCodeGenerator. Hence nuke messageReceiverIsInterpreterProxy:.
=============== Diff against VMMaker.oscog-eem.2747 ===============
Item was changed:
----- Method: BalloonEngineBase>>errorWrongIndex (in category 'private') -----
errorWrongIndex
+ interpreterProxy error:'BalloonEngine: Fatal dispatch error'!
- "Ignore dispatch errors when translating to C
- (since we have no entry point for #error in the VM proxy)"
- self cCode:'' inSmalltalk:[self error:'BalloonEngine: Fatal dispatch error']!
Item was removed:
- ----- Method: BalloonEngineSimulation>>assert: (in category 'simulation') -----
- assert: aBoolean
- aBoolean ifFalse:[^self error:'Assertion failed'].!
Item was removed:
- ----- Method: CCodeGenerator>>messageReceiverIsInterpreterProxy: (in category 'utilities') -----
- messageReceiverIsInterpreterProxy: sendNode
- ^self isGeneratingPluginCode
- and: [sendNode receiver isVariable
- and: ['interpreterProxy' = sendNode receiver name
- and: [(self isKernelSelector: sendNode selector) not]]]!
Item was changed:
----- Method: CCodeGenerator>>shouldGenerateAsInterpreterProxySend: (in category 'utilities') -----
shouldGenerateAsInterpreterProxySend: aSendNode
+ ^false!
- ^(self messageReceiverIsInterpreterProxy: aSendNode)
- and: [(VMBasicConstants mostBasicConstantSelectors includes: aSendNode selector) not]!
Item was changed:
----- Method: IA32ABIPlugin>>primAllocateExecutablePage (in category 'primitives-memory management') -----
primAllocateExecutablePage
"Answer an Alien for an executable page; for thunks"
"primAllocateExecutablePage ^<Alien>
<primitive: 'primAllocateExecutablePage' error: errorCode module: 'IA32ABI'>"
| byteSize ptr mem alien |
<export: true>
<var: #byteSize type: #'sqIntptr_t'>
<var: #ptr type: #'sqIntptr_t *'>
<var: #mem type: #'void *'>
+ mem := self allocateExecutablePage: (self addressOf: byteSize put: [:v| byteSize := v]).
- self cCode: 'mem = allocateExecutablePage(&byteSize)'
- inSmalltalk: [self error: 'not yet implemented'. mem := 0. byteSize := 0].
mem = 0 ifTrue:
[^interpreterProxy primitiveFailFor: PrimErrNoCMemory].
alien := interpreterProxy
instantiateClass: interpreterProxy classAlien
indexableSize: 2 * interpreterProxy bytesPerOop.
interpreterProxy failed ifTrue:
[^interpreterProxy primitiveFailFor: PrimErrNoMemory].
ptr := interpreterProxy firstIndexableField: alien.
ptr at: 0 put: 0 - byteSize. "indirect mem indicated by negative size. Slang doesn't grok negated"
ptr at: 1 put: (self cCoerce: mem to: #'sqIntptr_t').
interpreterProxy methodReturnValue: alien!
Item was added:
+ ----- Method: IA32ABIPluginSimulator>>allocateExecutablePage: (in category 'platform support') -----
+ allocateExecutablePage: byteSizePtrBlock
+ "void *allocateExecutablePage(sqIntptr_t *byteSizePtrBlock)"
+ self error: 'not yet implemented'.
+ byteSizePtrBlock value: 0.
+ ^0!
Item was added:
+ ----- Method: InterpreterProxy>>error: (in category 'other') -----
+ error: aString
+ <returnTypeC: #void>
+ <var: 'aString' type: #'char *'>
+ "In the real VM this prints aString to stderr and then calls exit(-1) or abort()."
+ ^super error: aString!
Item was removed:
- ----- Method: InterpreterProxy>>obsoleteDontUseThisFetchWord:ofObject: (in category 'object access') -----
- obsoleteDontUseThisFetchWord: fieldIndex ofObject: oop
- "fetchWord:ofObject: is rescinded as of VMMaker 3.8 64bit VM. This is a placeholder to sit in the sqVirtualMachine structure to support older plugins for a while"
- self halt: 'deprecated method'!
Item was removed:
- ----- Method: ObjectMemory>>obsoleteDontUseThisFetchWord:ofObject: (in category 'interpreter access') -----
- obsoleteDontUseThisFetchWord: fieldIndex ofObject: oop
- "This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code"
-
- ^self fetchLong32: fieldIndex ofObject: oop!
Item was removed:
- ----- Method: SmartSyntaxInterpreterPlugin>>sqAssert: (in category 'debugging') -----
- sqAssert: aBool
- self debugCode:
- [aBool ifFalse:
- [self error: 'Assertion failed!!']].
- ^aBool!
Item was removed:
- ----- Method: SpurMemoryManager>>obsoleteDontUseThisFetchWord:ofObject: (in category 'plugin support') -----
- obsoleteDontUseThisFetchWord: fieldIndex ofObject: oop
- "This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code"
- <api>
- ^self fetchLong32: fieldIndex ofObject: oop!
Item was changed:
----- Method: ThreadedFFIPlugin>>morphIntoConcreteSubclass: (in category 'simulation') -----
morphIntoConcreteSubclass: aCoInterpreter
<doNotGenerate>
| concreteClass |
concreteClass :=
aCoInterpreter ISA caseOf: {
[#X64] -> [(Smalltalk platformName beginsWith: 'Win')
ifTrue: [ThreadedX64Win64FFIPlugin]
ifFalse: [ThreadedX64SysVFFIPlugin]].
[#IA32] -> [ThreadedIA32FFIPlugin].
+ [#ARMv5] -> [ThreadedARM32FFIPlugin].
+ [#ARMv8] -> [ThreadedARM64FFIPlugin] }
- [#ARMv5] -> [ThreadedARM32FFIPlugin] }
otherwise: [self error: 'simulation not set up for this ISA'].
"If the concreteClass has an initialize method, other than ThreadedFFIPlugin class>>initialize
then it needs to be run."
((concreteClass class whichClassIncludesSelector: #initialize) inheritsFrom: self class class) ifTrue:
[concreteClass initialize].
concreteClass adoptInstance: self!
Item was added:
+ ----- Method: VMPluginCodeGenerator>>shouldGenerateAsInterpreterProxySend: (in category 'utilities') -----
+ shouldGenerateAsInterpreterProxySend: aSendNode
+ "Answer if this send should be generated as interpreterProxy->foo or its moral equivalent (*).
+ (*) since we now use function pointers declared in each external plugin we only indirect through
+ interopreterProxy at plugin initialization. But we still have to find the set of sends a plugin uses."
+ | selector |
+ (aSendNode receiver isVariable and: ['interpreterProxy' = aSendNode receiver name]) ifFalse: [^false].
+ selector := aSendNode selector.
+ "baseHeaderSize, minSmallInteger et al are #defined in each VM's interp.h"
+ (VMBasicConstants mostBasicConstantSelectors includes: selector) ifTrue: [^false].
+ "Only include genuine InterpreterProxy methods, excluding things not understood
+ by InterpreterProxy and things in its initialize and private protocols."
+ ^(#(initialize private) includes: (InterpreterProxy compiledMethodAt: selector ifAbsent: [^false]) protocol) not!
hi all,
I'm curious about the exposure that new issue tickets gets, versus a mail to the vm-dev.
If you are reading this, could you follow the link to github and tag this comment with an emoji.
cheers -ben
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/346
Hi,
Currently, at feenk we have feenkcom/opensmalltalk-vm:
https://github.com/feenkcom/opensmalltalk-vm
This is a small fork of the headless branch from pharo-project/opensmalltalk-vm that appeared out of practical necessities, but that we would like to avoid having. This post briefly describes the changes in the feenkcom/opensmalltalk-vm repo and the functionality those changes provide for Glamorous Toolkit.
For Glamorous Toolkit we aimed for the following functionality:
• Open the GUI natively and have native display quality (GUI opened through FFI calls)
• Have a Glamorous Toolkit app for Mac OS that works as any other apps for Mac OS
• Create end-user applications that are fully customisable (executable name, menus, etc)
• Use Github actions for doing all compilations of external libraries and the vm instead of Travis CI.
• Have Iceberg running in native windows (which requires nested FFI callbacks)
There has been work on these issues in both OpenSmalltalk/opensmalltalk-vm and pharo-project/opensmalltalk-vm but they were not entirely addressed. We needed to have something reliable a few months ago, and forking and doing some quick changes made that possible.
Ideally we want to be able to run Glamorous Toolkit on both OpenSmalltalk/opensmalltalk-vm and pharo-project/opensmalltalk-vm.
To have native GUIs we relied on Ronie Salgado’s work on the headless vm and started with pharo-project/opensmalltalk-vm - headless branch:
https://github.com/pharo-project/opensmalltalk-vm/tree/headless
That provided a solution for opening the GUI from the image through FFI calls. Currently we use Glutin (a library for OpenGL context creation, written in pure Rust) and this made it possible to run the entire Glamorous Toolkit inside a callback.
On macOS when running an app, even a notarized one, the OS warns the user that the app is downloaded from the internet, and the user needs to confirm that they agree. Once the user agrees the app should automatically start. This is not currently possible with Pharo apps (for example PharoLaunched.app) and users have to again run the app manually after giving permission. Also Gatekeeper in macOS runs applications downloaded from zips in a randomized read-only DMG. We do not want this behaviour as users not copying Glamorous Toolkit to the Applications folder on macOS would then experience incorrect application behaviour.
To create end-user applications we also need to fully customize the executable name (what the user sees in the Task Runner/Activity monitor), icons, native menus. Part of this work is already integrated in the pharo-project/opensmalltalk-vm - headless branch (Customizing the OS X icons, Brand the VM executable and package).
Since last year Github offers Github Actions similar to Travis. We found it much easier to use than Travis for external libraries and the vm. Also we get to manage the code and the builds in the same place. This work is already integrated in the pharo-project/opensmalltalk-vm - headless branch (Build the VM under GitHub actions: https://github.com/pharo-project/opensmalltalk-vm/pull/56).
The issues related to running Iceberg is a bit more technical. By moving to the headless vm we are running the entire image computation inside a callback from Glutin (https://github.com/rust-windowing/glutin/). When using Iceberg we get nested callbacks which we could not get to work using Alien. Instead we are using the ThreadedFFI Plugin and running all callback from Iceberg and Glutin using the Threaded FFI plugin (https://github.com/pharo-project/threadedFFI-Plugin). Currently we have a small fork of this plugin (feenkcom/threadedFFI-Plugin) and we also ship a custom plugin with the VM to fix a race condition due to having two copies of the callback stack (a pull request is here: https://github.com/pharo-project/threadedFFI-Plugin/pull/17).
While not specific to our environment, openssl1.0 is no longer supported, and we are seeing users who are unable to run Pharo due to version conflicts, as reported in https://github.com/pharo-project/opensmalltalk-vm/issues/62.
To sum up, a fork was the easiest way to get all this running. Now some changes are already in the pharo-project/opensmalltalk-vm - headless branch. What we are still missing are the changes that get the VM to work nicely with Mac OS and a bug fix in ThreadedFFI.
We would also love it to have all these changes integrated in OpenSmalltalk/opensmalltalk-vm in the headless vm. This requires additional coordination as the required changes are somewhat deeper.
Please let us know you would prefer to coordinate.
Cheers,
Tudor, on behalf of the feenk team
--
feenk.com
"The coherence of a trip is given by the clearness of the goal."