From squeak-dev-noreply at lists.squeakfoundation.org Sun Nov 1 02:50:11 2020 From: squeak-dev-noreply at lists.squeakfoundation.org (squeak-dev-noreply at lists.squeakfoundation.org) Date: Sun, 1 Nov 2020 02:50:11 0000 Subject: [Vm-dev] OSProcessPlugin: VMConstruction-Plugins-OSProcessPlugin.oscog-dtl.72.mcz Message-ID: Dave Lewis uploaded a new version of VMConstruction-Plugins-OSProcessPlugin to project OSProcessPlugin: http://www.squeaksource.com/OSProcessPlugin/VMConstruction-Plugins-OSProcessPlugin.oscog-dtl.72.mcz ==================== Summary ==================== Name: VMConstruction-Plugins-OSProcessPlugin.oscog-dtl.72 Author: dtl Time: 31 October 2020, 10:50:11.064324 pm UUID: 6d4fa432-7fde-4829-8832-ddad21ca21a3 Ancestors: VMConstruction-Plugins-OSProcessPlugin.oscog-eem.71 OSProcessPlugin 4.6.7 merge from VMConstruction-Plugins-OSProcessPlugin-dtl.53 Add new primitives for posix system configuration access via sysconf(3), confstr(3), pathconf(3), and fpathconf(3). For example usage, see OSProcess class>>gnuLinuxConf. From noreply at github.com Sun Nov 1 03:01:41 2020 From: noreply at github.com (David T Lewis) Date: Sat, 31 Oct 2020 20:01:41 -0700 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] fa5a08: UnixOSProcessPlugin as per VMConstruction-Plugins-... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: fa5a08b25945107d0a9f2ef446844c7fbebfdf88 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/fa5a08b25945107d0a9f2ef446844c7fbebfdf88 Author: David T. Lewis Date: 2020-10-31 (Sat, 31 Oct 2020) Changed paths: M src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c Log Message: ----------- UnixOSProcessPlugin as per VMConstruction-Plugins-OSProcessPlugin.oscog-dtl.72 Add new primitives for posix system configuration access via sysconf(3), confstr(3), pathconf(3), and fpathconf(3). For example usage, see OSProcess class>>gnuLinuxConf. From builds at travis-ci.org Sun Nov 1 03:08:16 2020 From: builds at travis-ci.org (Travis CI) Date: Sun, 01 Nov 2020 03:08:16 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2292 (Cog - fa5a08b) In-Reply-To: Message-ID: <5f9e26a022abb_13f95bc4f28d8101725@travis-tasks-59ccc6c69d-mh29t.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2292 Status: Still Failing Duration: 6 mins and 3 secs Commit: fa5a08b (Cog) Author: David T. Lewis Message: UnixOSProcessPlugin as per VMConstruction-Plugins-OSProcessPlugin.oscog-dtl.72 Add new primitives for posix system configuration access via sysconf(3), confstr(3), pathconf(3), and fpathconf(3). For example usage, see OSProcess class>>gnuLinuxConf. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/61a3e3df190e...fa5a08b25945 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/740530901?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.cellier.aka.nice at gmail.com Sun Nov 1 11:33:34 2020 From: nicolas.cellier.aka.nice at gmail.com (Nicolas Cellier) Date: Sun, 1 Nov 2020 12:33:34 +0100 Subject: [Vm-dev] CI status In-Reply-To: References: Message-ID: Hi Eliot, Le mer. 28 oct. 2020 à 23:56, Eliot Miranda a écrit : > > Hi Nicolas, > > On Wed, Oct 28, 2020 at 2:21 PM Nicolas Cellier < > nicolas.cellier.aka.nice at gmail.com> wrote: > >> >> >> >> Le mer. 28 oct. 2020 à 22:11, Nicolas Cellier < >> nicolas.cellier.aka.nice at gmail.com> a écrit : >> >>> >>> >>> Le mer. 28 oct. 2020 à 17:23, Eliot Miranda a >>> écrit : >>> >>>> >>>> Hi Tobi, Hi Levente, >>>> >>>> > On Oct 28, 2020, at 7:06 AM, Tobias Pape wrote: >>>> > >>>> >  >>>> > Hi >>>> > >>>> >>>>> On 27.10.2020, at 23:39, Nicolas Cellier < >>>> nicolas.cellier.aka.nice at gmail.com> wrote: >>>> >> Hi Tim, >>>> >> what is the result on that box with threaded heartbeat VM of: >>>> >> [SUnitToolBuilderTests new testHandlingNotification] timeToRun. >>>> >> If it is more than 5000 ms, then you would confirm the problem that >>>> I encounter. >>>> >> This testHandlingNotification is repeating 10 loops with a 200ms >>>> delay wait. >>>> >> The problem I've got with threaded heartbeat VM is that first 5 >>>> delays run normally, but next 5 will last for 1 second instead of 200ms... >>>> >> This is probably what happens on the CI server too (the test times >>>> out and CI fails). >>>> > >>>> > Also note that the CI test builds both vms but uses the last one >>>> built (because it overwrites the first), and that happens to be the itimer >>>> one, not th ethreaded. >>>> > >>>> > The code above runs in around ~2000 ms on my machine (~2015, with >>>> ubuntu 18.04) >>>> > >>>> > Things that happened: >>>> > - I just ran the test suite in the DEBUG itimer headful and headless >>>> variant and it passes. >>>> > - I just ran the test suite in the DEBUG threaded headful and >>>> headless variant and it passes. >>>> > - I ran the RELEASE itimer headful and headless variant and it passes >>>> > - I ran the RELEASE threaded headless variant and it FAILED as on the >>>> CI >>>> > - I ran the RELEASE threaded headful variant and it FAILED LESS >>>> > I mean: testHandlingNotification passed, and so did >>>> testValueWithinTimingBasic and testValueWithinTimingNestedInner >>>> > but testValueWithinTimingNestedOuter testValueWithinTimingRepeat >>>> still fail! >>>> > >>>> > So there are discrepancies between >>>> > debug and release and >>>> > headful and headless (at least for threaded release) >>>> > >>>> > TL;DR: The linux x86_32 cog v3 threaded release vm has a timing >>>> problem ... >>>> > >>>> > Does that help anyone? >>>> >>>> If you add code to extract the number of ioProcessEvents calls etc (see >>>> About Squeak VM parameters tab for the relevant info) does that tell us >>>> more? IIRC one available vm parameter is the number of heartbeats. So we >>>> should be able to see if it is the heartbeat itself that is failing or if >>>> it is further up stream. >>>> >>>> >>> Hi Eliot, >>> I instrumented the code like that: >>> >>> testHandlingNotification >>> | receivedSignal resumed | >>> receivedSignal := resumed := false. >>> [ | count | >>> "client-code puts up progress, and signals some notications" >>> Transcript cr; nextPutAll: 'test begins:'; print: Time >>> utcMicrosecondClock \\ 3600000000. >>> count := 0. >>> 'doing something' >>> displayProgressFrom: 0 >>> to: 10 >>> during: >>> [ : bar | 10 timesRepeat: >>> [ bar value: (count := count + 1). >>> Transcript cr; nextPutAll: 'count:'; print: count. >>> Transcript cr; nextPutAll: 'before wait:'; print: Time >>> utcMicrosecondClock \\ 3600000000. >>> (Delay forMilliseconds: 200) wait. >>> Transcript cr; nextPutAll: 'after wait:'; print: Time >>> utcMicrosecondClock \\ 3600000000. >>> Notification signal: 'message'. >>> Transcript cr; nextPutAll: 'after notified:'; print: >>> Time utcMicrosecondClock \\ 3600000000. >>> Transcript cr; nextPutAll: '# ioProcessEvents: '; print: >>> (Smalltalk vmParameterAt: 57). >>> Transcript cr; nextPutAll: '# forceInterruptCheck: '; >>> print: (Smalltalk vmParameterAt: 58). >>> Transcript cr; nextPutAll: '# check event calls: '; >>> print: (Smalltalk vmParameterAt: 59). >>> resumed := true ] ] ] >>> on: Notification >>> do: >>> [ : noti | receivedSignal := true. >>> Transcript cr; nextPutAll: 'notified at:'; print: Time >>> utcMicrosecondClock \\ 3600000000. >>> noti resume ]. >>> Transcript endEntry. >>> self >>> assert: receivedSignal ; >>> assert: resumed >>> >>> The result I obtain with an updated trunk image and 64bits threaded VM: >>> build.linux64x64/squeak.cog.spur/build$ ./squeak >>> ../../../image/trunk6-64.image >>> >>> test begins:80631205 >>> notified at:80631251 >>> count:1 >>> before wait:80633324 >>> after wait:80834614 >>> after notified:80834670 >>> # ioProcessEvents: 94 >>> # forceInterruptCheck: 3368 >>> # check event calls: 815 >>> count:2 >>> before wait:80835008 >>> after wait:81036398 >>> after notified:81036454 >>> # ioProcessEvents: 103 >>> # forceInterruptCheck: 3459 >>> # check event calls: 906 >>> count:3 >>> before wait:81036755 >>> after wait:81238355 >>> after notified:81238374 >>> # ioProcessEvents: 113 >>> # forceInterruptCheck: 3549 >>> # check event calls: 996 >>> count:4 >>> before wait:81238633 >>> after wait:81440889 >>> after notified:81440909 >>> # ioProcessEvents: 123 >>> # forceInterruptCheck: 3639 >>> # check event calls: 1086 >>> count:5 >>> before wait:81441151 >>> after wait:82609021 >>> after notified:82609053 >>> # ioProcessEvents: 132 >>> # forceInterruptCheck: 4119 >>> # check event calls: 1161 >>> count:6 >>> before wait:82609520 >>> after wait:83611465 >>> after notified:83611497 >>> # ioProcessEvents: 133 >>> # forceInterruptCheck: 4536 >>> # check event calls: 1162 >>> count:7 >>> before wait:83611974 >>> after wait:84614429 >>> after notified:84614462 >>> # ioProcessEvents: 134 >>> # forceInterruptCheck: 4961 >>> # check event calls: 1165 >>> count:8 >>> before wait:84614926 >>> after wait:85617377 >>> after notified:85617404 >>> # ioProcessEvents: 135 >>> # forceInterruptCheck: 5368 >>> # check event calls: 1166 >>> count:9 >>> before wait:85617840 >>> after wait:86618396 >>> after notified:86618428 >>> # ioProcessEvents: 136 >>> # forceInterruptCheck: 5776 >>> # check event calls: 1167 >>> count:10 >>> before wait:86618896 >>> after wait:87620232 >>> after notified:87620291 >>> # ioProcessEvents: 137 >>> # forceInterruptCheck: 6196 >>> # check event calls: 1168 >>> >>> Notice 10 ioProcessEvents and about 200ms wait on loop 1-5. >>> Then a single ioProcessEvent and about 1000ms wait on loops 6-10 (single >>> check event call too). >>> >> >> and on itimer heatbeat, 200ms per loop, 10 ioProcessEvents, 100 >> forceInterruptCheck and 100 check event calls >> This is consistent with the 2ms heartbeat (vmParameter #26). >> linux64x64/squeak.cog.spur/build.itimerheartbeat$ ./squeak >> ../../../image/trunk6-64.image >> >> test begins:1013906366 >> notified at:1013906407 >> count:1 >> before wait:1013910362 >> after wait:1014112028 >> after notified:1014112085 >> # ioProcessEvents: 208 >> # forceInterruptCheck: 2299 >> # check event calls: 2236 >> count:2 >> before wait:1014112443 >> after wait:1014314011 >> after notified:1014314062 >> # ioProcessEvents: 218 >> # forceInterruptCheck: 2400 >> # check event calls: 2337 >> count:3 >> before wait:1014314405 >> after wait:1014516017 >> after notified:1014516052 >> # ioProcessEvents: 228 >> # forceInterruptCheck: 2501 >> # check event calls: 2438 >> count:4 >> before wait:1014516326 >> after wait:1014718011 >> after notified:1014718039 >> # ioProcessEvents: 237 >> # forceInterruptCheck: 2602 >> # check event calls: 2539 >> count:5 >> before wait:1014718296 >> after wait:1014920490 >> after notified:1014920521 >> # ioProcessEvents: 247 >> # forceInterruptCheck: 2703 >> # check event calls: 2640 >> count:6 >> before wait:1014920967 >> after wait:1015122184 >> after notified:1015122215 >> # ioProcessEvents: 256 >> # forceInterruptCheck: 2804 >> # check event calls: 2741 >> count:7 >> before wait:1015122608 >> after wait:1015324166 >> after notified:1015324198 >> # ioProcessEvents: 266 >> # forceInterruptCheck: 2905 >> # check event calls: 2841 >> count:8 >> before wait:1015324595 >> after wait:1015526278 >> after notified:1015526299 >> # ioProcessEvents: 275 >> # forceInterruptCheck: 3006 >> # check event calls: 2942 >> count:9 >> before wait:1015526556 >> after wait:1015728488 >> after notified:1015728518 >> # ioProcessEvents: 285 >> # forceInterruptCheck: 3107 >> # check event calls: 3042 >> count:10 >> before wait:1015728947 >> after wait:1015930499 >> after notified:1015930530 >> # ioProcessEvents: 295 >> # forceInterruptCheck: 3208 >> # check event calls: 3143 >> > > Thanks that's great. SO the problem is nothing to do with the heartbeat. > It seems to be working perfectly OK, right? > _,,,^..^,,,_ > best, Eliot > Well itimer flavour works fine, but threaded not so much. Why is there 1000ms wait per loop instead of 200ms, and a single check for event and ioProcessEvent per loop instead of 10 starting at loop #6? Or do you mean that forceInterruptCheck count remains correct? (about 90 interrupt/200ms then 420 interrupt/1000ms - compared to more regular 100 interrupt/200ms in itimer flavour) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Sun Nov 1 15:46:19 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 1 Nov 2020 10:46:19 -0500 Subject: [Vm-dev] CI status In-Reply-To: References: <20201026145401.GA17603@shell.msen.com> Message-ID: <20201101154619.GA40576@shell.msen.com> Hi Levente, Sorry for my delay in replying, these tips are very helpful. On Tue, Oct 27, 2020 at 12:59:55AM +0100, Levente Uzonyi wrote: > > Hi David > > On Mon, 26 Oct 2020, David T. Lewis wrote: > > >I do not know if it is related to the CI issues, but here is one clue: > > > >I am maintaining a V3 "trunk" image that attempts to keep in sync with > >trunk except for changes that pertain to Spur object format (immediate > >characters, etc). As of Monticello-ul.728 I get failures in SSL connection > >to e.g. source.squeak.org. The failures happen with both Cog and the > >interpreter VM (although the specific error symptoms are different). > > > >I can bypass the errors by reverting MCHttpRepository>>httpGet:arguments: > >to its prior version (stamped ul 9/20/2019). > > That version adds some rewrite rules, so some http urls are converted to > https. > If that doesn't work, then there is a problem with the SqueakSSL plugin in > your VM. Does the following print true? > > | response | > response := WebClient httpGet: 'https://source.squeak.org'. > response code = 200 > The plugin is out of date in the interpreter VM, and I get a certificate mismatch that is almost certainly related to the plugin. With a Cog VM, I get a primitive failure in SqueakSSL>>primitiveSSLCreate. So in both cases it is presumably a plugin issue. > > Instead of reverting #httpGet:arguments: you can remove the individual > http->https rewrite rules with the following snippet: > > MCHttpRepository urlRewriteRules in: [ :rules | > rules size // 3 timesRepeat: [ > | set | > set := rules removeFirst: 3. > (set second beginsWith: 'https') ifFalse: [ > rules addAll: set ] ] ] Thanks for explaining, I understand it now. > > But it would be better to use https for those repositories. > Yes for sure. Thank you! Dave > > Levente > > > > >I have not had time to dig into the underlying cause of the problem, > >but it seems likely that any CI test for Cog that requires the use > >of secure sockets will fail as of Monticello-ul.728 or later. This > >would include any test that needs to access the source.squeak.org > >repository. > > > >Dave From lewis at mail.msen.com Sun Nov 1 20:33:18 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 1 Nov 2020 15:33:18 -0500 Subject: [Vm-dev] CI status In-Reply-To: <20201101154619.GA40576@shell.msen.com> References: <20201026145401.GA17603@shell.msen.com> <20201101154619.GA40576@shell.msen.com> Message-ID: <20201101203318.GA84557@shell.msen.com> Hi Levente, One final follow up - the reason that my Cog VM failed on primitiveSSLCreate was simply that I did not have 32 bit libssl libraries installed on my system. Sorry for the noise, Dave On Sun, Nov 01, 2020 at 10:46:19AM -0500, David T. Lewis wrote: > > Hi Levente, > > Sorry for my delay in replying, these tips are very helpful. > > > On Tue, Oct 27, 2020 at 12:59:55AM +0100, Levente Uzonyi wrote: > > > > Hi David > > > > On Mon, 26 Oct 2020, David T. Lewis wrote: > > > > >I do not know if it is related to the CI issues, but here is one clue: > > > > > >I am maintaining a V3 "trunk" image that attempts to keep in sync with > > >trunk except for changes that pertain to Spur object format (immediate > > >characters, etc). As of Monticello-ul.728 I get failures in SSL connection > > >to e.g. source.squeak.org. The failures happen with both Cog and the > > >interpreter VM (although the specific error symptoms are different). > > > > > >I can bypass the errors by reverting MCHttpRepository>>httpGet:arguments: > > >to its prior version (stamped ul 9/20/2019). > > > > That version adds some rewrite rules, so some http urls are converted to > > https. > > If that doesn't work, then there is a problem with the SqueakSSL plugin in > > your VM. Does the following print true? > > > > | response | > > response := WebClient httpGet: 'https://source.squeak.org'. > > response code = 200 > > > > The plugin is out of date in the interpreter VM, and I get a certificate > mismatch that is almost certainly related to the plugin. > > With a Cog VM, I get a primitive failure in SqueakSSL>>primitiveSSLCreate. > > So in both cases it is presumably a plugin issue. > > > > > Instead of reverting #httpGet:arguments: you can remove the individual > > http->https rewrite rules with the following snippet: > > > > MCHttpRepository urlRewriteRules in: [ :rules | > > rules size // 3 timesRepeat: [ > > | set | > > set := rules removeFirst: 3. > > (set second beginsWith: 'https') ifFalse: [ > > rules addAll: set ] ] ] > > Thanks for explaining, I understand it now. > > > > > But it would be better to use https for those repositories. > > > > Yes for sure. > > Thank you! > > Dave > > > > > Levente > > > > > > > >I have not had time to dig into the underlying cause of the problem, > > >but it seems likely that any CI test for Cog that requires the use > > >of secure sockets will fail as of Monticello-ul.728 or later. This > > >would include any test that needs to access the source.squeak.org > > >repository. > > > > > >Dave From noreply at github.com Tue Nov 3 19:04:55 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 03 Nov 2020 11:04:55 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] efea8b: Update README.md Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: efea8b21036f982abb53f2a697f7028db7af17fa https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/efea8b21036f982abb53f2a697f7028db7af17fa Author: Eliot Miranda Date: 2020-11-03 (Tue, 03 Nov 2020) Changed paths: M README.md Log Message: ----------- Update README.md Add the URL for http://source.squeak.org/VMMaker.html. Add a pointer to the Wiki as a place to look for project suggestions. From noreply at github.com Tue Nov 3 19:07:33 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 03 Nov 2020 11:07:33 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 7f0f29: Update README.md Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 7f0f29562ed30bf28d4b17574cbdebdb3c1f6df0 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7f0f29562ed30bf28d4b17574cbdebdb3c1f6df0 Author: Eliot Miranda Date: 2020-11-03 (Tue, 03 Nov 2020) Changed paths: M README.md Log Message: ----------- Update README.md Formatting From noreply at github.com Tue Nov 3 19:09:59 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 03 Nov 2020 11:09:59 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 3b9eb5: Update README.md Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 3b9eb5d65a96fb4d18394d538d47cd66e949c759 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3b9eb5d65a96fb4d18394d538d47cd66e949c759 Author: Eliot Miranda Date: 2020-11-03 (Tue, 03 Nov 2020) Changed paths: M README.md Log Message: ----------- Update README.md More attempts at formatting From commits at source.squeak.org Tue Nov 3 19:24:43 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 3 Nov 2020 19:24:43 0000 Subject: [Vm-dev] VM Maker: Cog-eem.426.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.426.mcz ==================== Summary ==================== Name: Cog-eem.426 Author: eem Time: 3 November 2020, 11:24:40.724902 am UUID: 57f98fd8-7671-417b-830a-c838de7cde4e Ancestors: Cog-eem.425 Include CogAbstractRegisters in CogProcessorAlien. It's much nicer to use the abstract names tan hacks such as ReceiverResultRegDereference. =============== Diff against Cog-eem.425 =============== Item was changed: Alien variableByteSubclass: #CogProcessorAlien instanceVariableNames: '' classVariableNames: 'BadCPUInstance ExecutionError InstructionPrefetchError MemoryBoundsError NoError PanicError PostBuildStackDelta PrintCodeBytes PrintTempNames ReceiverResultRegDereference SavedState SomethingLoggedError UnsupportedOperationError' + poolDictionaries: 'CogAbstractRegisters' - poolDictionaries: '' category: 'Cog-Processors'! !CogProcessorAlien commentStamp: 'eem 11/21/2019 11:17' prior: 0! I am the superclass for the Simulation CPU instance wrappers. I ensure that methods used in both/all of them need not be copied. Class Variables error codes answered by the execution primitives, primitiveRunInMemory:minimumAddress:maximumAddress:readOnlyBelow: et al NoError BadCPUInstance the receiver Alien does not appear to reference a valid underlying CPU object/struct/c++ instance, etc ExecutionError something went wrong when executing an instruction InstructionPrefetchError an attempt was made to fetch an instruction from an invalid address, e.g. below the minimum executable address MemoryBoundsError an attempt was made to access memory outside the bounds of the memory byte array. This is key to how the simulator accesses Smalltalk variables PanicError the simulator "panicked", i.e. hit an error from which no propgress, such as delivering an exception, is possible SomethingLoggedError the simulator logged something, presumably an error, to its error log UnsupportedOperationError an attempt was made to do something currently unsupported or unimplemented (a lazy man's deferral) simulation PostBuildStackDelta the amount to decrement the stack pointer after a simulated call disassembly PrintCodeBytes when disassembling, whether to include the bytes comprising an insruction, false for faster single-stepping PrintTempNames when disassembling, whether to attempt to decorate temp var references with Smalltalk temp var names ReceiverResultRegDereference the concrete register holding ReceiverResultReg, used to decorate this register with ReceiverResultReg during disassembly restart SavedState a Dictionary from processor to saved register state used to restore processor Aliens to their sate at snapshot, hence enabling continuing simulation after a snapshot, e.g. to save set-up time by advancing simulation to a given point and then saving and quitting! From commits at source.squeak.org Tue Nov 3 19:26:32 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 3 Nov 2020 19:26:32 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2869.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2869.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2869 Author: eem Time: 3 November 2020, 11:26:21.471595 am UUID: 5c8f4f27-a134-41ec-a32a-090a9a8fc371 Ancestors: VMMaker.oscog-eem.2868 Update in-image compilation to support decoration with abstract register names. =============== Diff against VMMaker.oscog-eem.2868 =============== Item was added: + ----- Method: Cogit>>lookupRegisterNumber: (in category 'disassembly') ----- + lookupRegisterNumber: n + true ifTrue: + [Arg0Reg = n ifTrue: [^'Arg0']. + Arg1Reg = n ifTrue: [^'Arg1']. + ClassReg = n ifTrue: [^'Class']. + ReceiverResultReg = n ifTrue: [^'ReceiverResult']. + (SPReg = n and: [n ~= NativeSPReg]) ifTrue: [^'SP']. + FPReg = n ifTrue: [^'FP']. + SendNumArgsReg = n ifTrue: [^'SendNumArgs']. + VarBaseReg = n ifTrue: [^'VarBase']. + RISCTempReg = n ifTrue: [^'RISCTemp']. + ^nil]. + + Arg0Reg = n ifTrue: [^'a0']. + Arg1Reg = n ifTrue: [^'a1']. + ClassReg = n ifTrue: [^'cr']. + ReceiverResultReg = n ifTrue: [^'rr']. + (SPReg = n and: [n ~= NativeSPReg]) ifTrue: [^'sp']. + FPReg = n ifTrue: [^'fp'"#FPReg"]. + SendNumArgsReg = n ifTrue: [^'sna']. + VarBaseReg = n ifTrue: [^'vb']. + RISCTempReg = n ifTrue: [^'rt']. + + Arg0Reg = n ifTrue: [^#Arg0Reg]. + Arg1Reg = n ifTrue: [^#Arg1Reg]. + ClassReg = n ifTrue: [^#ClassReg]. + ReceiverResultReg = n ifTrue: [^#ReceiverResultReg]. + (SPReg = n and: [n ~= NativeSPReg]) ifTrue: [^#SPReg]. + FPReg = n ifTrue: [^#FPReg]. + SendNumArgsReg = n ifTrue: [^#SendNumArgsReg]. + VarBaseReg = n ifTrue: [^#VarBaseReg]. + RISCTempReg = n ifTrue: [^#RISCTempReg]. + ^nil! Item was added: + ----- Method: CurrentImageCoInterpreterFacade>>setFramePointer:stackPointer:for: (in category 'accessing') ----- + setFramePointer: cFramePointer stackPointer: cStackPointer for: processor + ^coInterpreter setFramePointer: cFramePointer stackPointer: cStackPointer for: processor! From builds at travis-ci.org Tue Nov 3 20:09:33 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Nov 2020 20:09:33 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2293 (Cog - efea8b2) In-Reply-To: Message-ID: <5fa1b8fd60db4_13fbc481f38641339b2@travis-tasks-5f588f4969-cdmx8.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2293 Status: Still Failing Duration: 1 hr, 3 mins, and 21 secs Commit: efea8b2 (Cog) Author: Eliot Miranda Message: Update README.md Add the URL for http://source.squeak.org/VMMaker.html. Add a pointer to the Wiki as a place to look for project suggestions. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/fa5a08b25945...efea8b21036f View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/741216182?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Tue Nov 3 21:09:41 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 03 Nov 2020 21:09:41 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2295 (Cog - 3b9eb5d) In-Reply-To: Message-ID: <5fa1c714af35a_13ff53c0d416848265@travis-tasks-659cf849c-sls2g.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2295 Status: Still Failing Duration: 1 hr, 4 mins, and 4 secs Commit: 3b9eb5d (Cog) Author: Eliot Miranda Message: Update README.md More attempts at formatting View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/7f0f29562ed3...3b9eb5d65a96 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/741217680?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Wed Nov 4 16:28:40 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Wed, 4 Nov 2020 08:28:40 -0800 Subject: [Vm-dev] nuSqueak source In-Reply-To: <34747C38-114D-4594-9A88-4E851CA2D87F@rowledge.org> References: <750899A3-0407-4D0C-89A4-E88C4384C504@gmail.com> <34747C38-114D-4594-9A88-4E851CA2D87F@rowledge.org> Message-ID: Yup. I just needed to fall into the same trap... Now that we have an improved version of the VM, what is the "rest" of procedure to get the next version of Raspberry Pi OS to have the updated VM and installation? Somebody would make an apt package? On Wed, Oct 28, 2020 at 4:22 PM tim Rowledge wrote: > > > > > On 2020-10-28, at 4:05 PM, Yoshiki Ohshima > wrote: > > > > I may be simply on a wrong OS. The main reason for me to dive in again > was to fix it for Raspberry Pi OS users: > > > > https://www.raspberrypi.org/downloads/raspberry-pi-os/ > > > > but then it simply is not a 64bit OS I gather. It's just the compiler on > targets 32 bit. > > Ah, you're making a mistake made by many. > > The Pi 4 (and indeed 3+, 3 and even the 2) have ARMv8 cpus. *BUT* Raspbian > is a 32bit OS using the v7 support in the ARM A53 & A72 cores. > A lot of people have posted questions asking if they have been sold a > 'fake' Pi after seeing that the API for querying the processor type tells > them they have a 32 bit v7. That is actually an upstream Debian issue not > under the control of RPF at all. > > So the squeak vm supplied for the current default Raspbian (or rather, > recently renamed, Raspberry Pi OS) is a 32 bit version as built in the > opensmalltalk-vm⁩ ▸ ⁨build.linux32ARMv6⁩ ▸ ⁨squeak.stack.spur⁩ tree. > > There *is* a 64 bit version of Raspberry PI OS that is currently in > late-beta. That would need a VM from the opensmalltalk-vm⁩ ▸ > ⁨build.linux32ARMv6⁩ ▸ ⁨squeak.stack.spur⁩ tree and of course a 64 bit > image. That VMworks on *some* OS but not others due to some issue with the > permission bits for memory being messed around in the name of some sort of > security waffle. Eliot has made it work for at least some cases - Manjaro, > for example. It still needs sorting out for the Pi 64bit OS. > > As soon as you have a 32bit vm that handled the Japanese input stuff ok, > let me know and I'll do a build and ask RPF to upload it. I don't know how > many people still use it on any sort of regular basis but it certainly > isn't 0, which is gratifying. > > > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > On a clear disk you can seek forever... > > > -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Wed Nov 4 21:50:03 2020 From: tim at rowledge.org (tim Rowledge) Date: Wed, 4 Nov 2020 13:50:03 -0800 Subject: [Vm-dev] nuSqueak source In-Reply-To: References: <750899A3-0407-4D0C-89A4-E88C4384C504@gmail.com> <34747C38-114D-4594-9A88-4E851CA2D87F@rowledge.org> Message-ID: <5E187135-A58B-495D-8234-04A015F86633@rowledge.org> > On 2020-11-04, at 8:28 AM, Yoshiki Ohshima wrote: > > Yup. I just needed to fall into the same trap... Life is full of silly traps. > > Now that we have an improved version of the VM, what is the "rest" of procedure to get the next version of Raspberry Pi OS to have the updated VM and installation? Somebody would make an apt package? What we do is make sure I can build an identical and working VM, I put together a new 5.3 based NuScratch image, we test it a bit, I pass the vm & image to RPF and they do the rest of the magic. And of course, some documentation about how to make use of the new inputs is needed. Are there any changes to any of the translation files required? Anything else needing attention? tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Fractured Idiom:- IDIOS AMIGOS - We're wild and crazy guys! From Yoshiki.Ohshima at acm.org Fri Nov 6 03:58:17 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Thu, 5 Nov 2020 19:58:17 -0800 Subject: [Vm-dev] nuSqueak source In-Reply-To: <5E187135-A58B-495D-8234-04A015F86633@rowledge.org> References: <750899A3-0407-4D0C-89A4-E88C4384C504@gmail.com> <34747C38-114D-4594-9A88-4E851CA2D87F@rowledge.org> <5E187135-A58B-495D-8234-04A015F86633@rowledge.org> Message-ID: Hi Tim, This is probably a fix we'd do on the image side, but one thing Abe-san mentioned was that the first time playing a sound takes longer as it would be initializing the sound system. Maybe we can play a silent sound (like the sound of one hand clapping) at the start up time anyway as many Scratch projects involve sound anyway. On Wed, Nov 4, 2020 at 1:50 PM tim Rowledge wrote: > > > > > On 2020-11-04, at 8:28 AM, Yoshiki Ohshima > wrote: > > > > Yup. I just needed to fall into the same trap... > > Life is full of silly traps. > > > > > Now that we have an improved version of the VM, what is the "rest" of > procedure to get the next version of Raspberry Pi OS to have the updated VM > and installation? Somebody would make an apt package? > > What we do is make sure I can build an identical and working VM, I put > together a new 5.3 based NuScratch image, we test it a bit, I pass the vm & > image to RPF and they do the rest of the magic. > > And of course, some documentation about how to make use of the new inputs > is needed. Are there any changes to any of the translation files required? > Anything else needing attention? > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Fractured Idiom:- IDIOS AMIGOS - We're wild and crazy guys! > > > -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Fri Nov 6 19:21:37 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 6 Nov 2020 11:21:37 -0800 Subject: [Vm-dev] nuSqueak source In-Reply-To: References: <750899A3-0407-4D0C-89A4-E88C4384C504@gmail.com> <34747C38-114D-4594-9A88-4E851CA2D87F@rowledge.org> <5E187135-A58B-495D-8234-04A015F86633@rowledge.org> Message-ID: <1AEE8F33-3596-4A38-88BC-35F748B27990@rowledge.org> > On 2020-11-05, at 7:58 PM, Yoshiki Ohshima wrote: > > This is probably a fix we'd do on the image side, but one thing Abe-san mentioned was that the first time playing a sound takes longer as it would be initializing the sound system. Ah, yes, that problem. It's basically a result of the utterly pathetic sound capabilities of linuxes. The 'fun' we had with pulseaudio and so on... (un)happy days. > Maybe we can play a silent sound (like the sound of one hand clapping) at the start up time anyway as many Scratch projects involve sound anyway. There was, at some point, a Very Good Reason for using the 'stop sounds when done' preference. IIRC there was something about hissing background noises? We can certainly try again and see if the march of time has improved things. There is also (as I've just been reminded by the very famous Scratcher Simon Walters) still the ancient bug of odd morph clipping when dropping a block onto another block to add it to the script. Never did manage to solve that one and it doesn't happen when you try to degub it... if anyone has any ideas... tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Strange OpCodes: SDD: Scratch Disk and Die From Yoshiki.Ohshima at acm.org Fri Nov 6 19:42:32 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Fri, 6 Nov 2020 11:42:32 -0800 Subject: [Vm-dev] nuSqueak source In-Reply-To: <1AEE8F33-3596-4A38-88BC-35F748B27990@rowledge.org> References: <750899A3-0407-4D0C-89A4-E88C4384C504@gmail.com> <34747C38-114D-4594-9A88-4E851CA2D87F@rowledge.org> <5E187135-A58B-495D-8234-04A015F86633@rowledge.org> <1AEE8F33-3596-4A38-88BC-35F748B27990@rowledge.org> Message-ID: Another thing Abe-san told me is that the font rendering result is not good, as if anti-aliasing is not giving the right alpha. I have not looked into it but sounds like an annoying problem. On Fri, Nov 6, 2020 at 11:21 AM tim Rowledge wrote: > > > > > On 2020-11-05, at 7:58 PM, Yoshiki Ohshima > wrote: > > > > This is probably a fix we'd do on the image side, but one thing Abe-san > mentioned was that the first time playing a sound takes longer as it would > be initializing the sound system. > > Ah, yes, that problem. It's basically a result of the utterly pathetic > sound capabilities of linuxes. The 'fun' we had with pulseaudio and so > on... (un)happy days. > > > > Maybe we can play a silent sound (like the sound of one hand clapping) > at the start up time anyway as many Scratch projects involve sound anyway. > > > There was, at some point, a Very Good Reason for using the 'stop sounds > when done' preference. IIRC there was something about hissing background > noises? We can certainly try again and see if the march of time has > improved things. > > There is also (as I've just been reminded by the very famous Scratcher > Simon Walters) still the ancient bug of odd morph clipping when dropping a > block onto another block to add it to the script. Never did manage to solve > that one and it doesn't happen when you try to degub it... if anyone has > any ideas... > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Strange OpCodes: SDD: Scratch Disk and Die > > > -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Sat Nov 7 07:18:28 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sat, 7 Nov 2020 08:18:28 +0100 (CET) Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h Message-ID: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hello, After removal of the sunos.h header file in platforms/unix/vm/sunos.h this old file is gone now after some cleanup, it seems the Cog VM and Stack VM still compile fine on Solaris 11.3. I did not test yet on Solaris 11.4, but on Solaris 11.3 at least, it works. The 64bit Cog VM and Stack VM compile fine (even after removal of sunos.h), and they work. HOWEVER ... the 32bit version seems to compile fine but there's a new problem: $ sqcogspursunosht/usr/bin/squeak Squeak6.0alpha-19843-32bit.image sqImageFileSeek lseek: Invalid argument also with the Stack VM in 32bit: $ sqstkspursunosht/usr/bin/squeak Squeak6.0alpha-19843-32bit.image sqImageFileSeek lseek: Invalid argument The ckformat tool reports : $ ckformat Squeak6.0alpha-19843-32bit.image 6521 What can be the reason / cause for this new "lseek Invalid argument" ? So this problem does NOT happen on 64 bit. For example with $ ckformat Squeak5.3-19431-64bit.image 68021 the 64bit VM opens this image 68021 format just fine. Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfpknkAAoJEAwpOKXMq1MaAo8IAJcv1N3ExsJgoLeYz/PrIxY+ saawdjwqVy+nVsKjVXHB29jDEgBnrC9vrIUxY/RJ4bJe4jItto8mlGVUUnxspzwa jvApj2DFpaKXbzQboCpiwE2AYdfzsE07DHXppBvspC+xjCe4mG7lliiFyjxfGOne iHBmCvJoaDvVyBCb8Uu5TShaRW+/ttcAARGmfbdmIz/zYKQLNc67IEfOPrIlS9Ks VX4K6izd3Oim9KHAEBF5qC65RJSomI9VC8kI/QowCKEpkSQic+RsP1BdqXhDWKbP k0k5znQ4ag96X/Sl8NjjqfP+hUEOPL5YGGo1QuxieY/nwbMX+rvzDS/UZ/U137g= =u+R0 -----END PGP SIGNATURE----- From eliot.miranda at gmail.com Sat Nov 7 19:32:25 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sat, 7 Nov 2020 11:32:25 -0800 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> Message-ID: Hi David, On Fri, Nov 6, 2020 at 11:18 PM stes at PANDORA.BE wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > Hello, > > After removal of the sunos.h header file in > > platforms/unix/vm/sunos.h > > this old file is gone now after some cleanup, it seems the Cog VM and > Stack VM > still compile fine on Solaris 11.3. > > I did not test yet on Solaris 11.4, but on Solaris 11.3 at least, it works. > > The 64bit Cog VM and Stack VM compile fine (even after removal of sunos.h), > and they work. > > HOWEVER ... the 32bit version seems to compile fine but there's a new > problem: > > $ sqcogspursunosht/usr/bin/squeak Squeak6.0alpha-19843-32bit.image > sqImageFileSeek lseek: Invalid argument > > also with the Stack VM in 32bit: > > $ sqstkspursunosht/usr/bin/squeak Squeak6.0alpha-19843-32bit.image > sqImageFileSeek lseek: Invalid argument > > The ckformat tool reports : > > $ ckformat Squeak6.0alpha-19843-32bit.image > 6521 > > > What can be the reason / cause for this new "lseek Invalid argument" ? > So the question is how 32-bit sunos does 64-bit file offsets. Linux & MacOS use offset_t and this is a 64-bit type in both 64 and 32 bits with the relevant defines. Here's a stackoverflow answer that should help you find what sunos 32-bits requires. That can either be added to the mvm script (ideal) or shoe-horned into sqPlatformSpecific.h. HTH So this problem does NOT happen on 64 bit. > > For example with > > $ ckformat Squeak5.3-19431-64bit.image > 68021 > > the 64bit VM opens this image 68021 format just fine. > > Regards, > David Stes > _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.fazio at eggingtons.com Sat Nov 7 19:34:17 2020 From: p.fazio at eggingtons.com (p.fazio at eggingtons.com) Date: Sat, 07 Nov 2020 12:34:17 -0700 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h Message-ID: <20201107123417.6660d575ab2651c878a98e9495b99492.0a1ac8cbce.wbe@email24.secureserver.net> An HTML attachment was scrubbed... URL: From stes at telenet.be Sun Nov 8 10:00:58 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 8 Nov 2020 11:00:58 +0100 (CET) Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> Message-ID: <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 In the past there was a rather odd definition in: platforms/unix/vm/sqPlatformSpecific.h #ifndef __sun__ #define ftell(s) ftello(s) #define fseek(s,o,w) fseeko(s,o,w) #endif /* __sun__ */ I don't know what the reasoning behind that was. I would prudently say that it looks suspicious to have such special cases, in the source code (the presence of those __sun__ or sunos.h header file, is perhaps going back to old work in porting or developing squeak on SunOS). These functions ftell and ftello are: long ftell(FILE *stream); off_t ftello(FILE *stream); where off_t is the type that is intended for 64bit file offsets I think. Also there exists a lseek64() function. I have no idea whether this is correct, but if I change: - --- a/platforms/unix/vm/sqImageFileAccess.h +++ b/platforms/unix/vm/sqImageFileAccess.h @@ -108,7 +108,7 @@ sqImageFileWrite(void *ptr_arg, size_t sz, size_t count, sqImageFile f) static inline off_t sqImageFilePosition(sqImageFile f) { - - off_t pos = lseek(f, 0, SEEK_CUR); + off_t pos = lseek64(f, 0, SEEK_CUR); if (pos == (off_t)-1) perror("sqImageFilePosition lseek"); return pos; @@ -117,14 +117,14 @@ sqImageFilePosition(sqImageFile f) static inline void sqImageFileSeek(sqImageFile f,off_t pos) { - - if (lseek(f, pos, SEEK_SET) < 0) + if (lseek64(f, pos, SEEK_SET) < 0) perror("sqImageFileSeek lseek"); } static inline void sqImageFileSeekEnd(sqImageFile f,off_t pos) { - - if (lseek(f, pos, SEEK_END) < 0) + if (lseek64(f, pos, SEEK_END) < 0) perror("sqImageFileSeekEnd lseek"); } Then the VM compiles in 32bit mode (as before) but now it succesfully loads a 32bit VM image. I'll have to think about this. Maybe some "configure" script patch would be needed. The old way to #undef lseek and so on seems ugly to me, personally. (So I'm not unhappy about the cleanup that was done ...) By the way, as I said before the 64bit VM on SunOS was and still is OK; it is just after the recent change that the 32bit VM has this issue. Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfp8FtAAoJEAwpOKXMq1MaVVYH/1Bz8MFEBs30KqfuFGk/oqjb FNemHin321i/Elz0YZ04qn6Ch/1dV8PeotNPa1ZBZVczE6p9wBAJoSo9C/8uj83A J+t2XwntLisUDgbEDb7Bo1Im8HlDn0ttuk4EHDMfhdHbXyF6F7XxSbT/T1H2UnAH WH+qlaJUvqymTPJWUaDydlWR9AzJMk/wuXOzYqf5g1s/fWmD87U5OO3h5jhe2FcY KAXdTc3Xeufy4kvAUmEnmVePE271oCIqEiQ1I+tcmwo92q1AUpzt3WJ3uPFp38/o 4GzMZIaKRyr1ddawM1L1R2zgV8XCM9iy/KVN+Mad2TyGv74GQokscGXuhcbZi28= =WdhW -----END PGP SIGNATURE----- From stes at telenet.be Sun Nov 8 11:19:10 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 8 Nov 2020 12:19:10 +0100 (CET) Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> Message-ID: <139814250.43516978.1604834350663.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 After experimenting with lseek and lseek64, the following also could help: bash-4.4$ cat fileoffsetbits.c #include #include #include int main(int argc,char *argv[]) { printf("_FILE_OFFSET_BITS is %i\n",_FILE_OFFSET_BITS); } bash-4.4$ cc -m64 fileoffsetbits.c bash-4.4$ ./a.out _FILE_OFFSET_BITS is 64 bash-4.4$ cc -m32 fileoffsetbits.c bash-4.4$ ./a.out _FILE_OFFSET_BITS is 32 bash-4.4$ cc -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 fileoffsetbits.c bash-4.4$ ./a.out _FILE_OFFSET_BITS is 64 The lfcompile manpage on Solaris says that one possibility is to compile with the above -D flags to support large files on 32bit executables. This seems an issue that is also related to the configure.ac test for AC_SYS_LARGEFILE But that sets the _FILE_OFFSET_BITS in the "config.h". So then it is an issue of having to #include config.h before the Anyway, the SunOS 32bit VM used to work, but currently has this (minor) issue. It is minor because it seems solvable by setting the -D options in the mvm script. If I use the following patch it works: - --- a/build.sunos32x86/squeak.stack.spur/build/mvm +++ b/build.sunos32x86/squeak.stack.spur/build/mvm @@ -10,7 +10,7 @@ esac # Stack Spur VM with VM profiler and threaded heartbeat INSTALLDIR=sqstkspursunosht/usr # Some gcc versions create a broken VM using -O2 - -OPT="-g -DAIO_DEBUG -DNDEBUG -DDEBUGVM=0" +OPT="-g -DAIO_DEBUG -DNDEBUG -DDEBUGVM=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" That is probably the easiest way to get the old behavior back. Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfp9PkAAoJEAwpOKXMq1MaZCcIAKzwPC+8nrluYmdLC/g+vJNf oIF76MmaCIkaY3pfMNnjY+KyCJZk/wkM4tKXLrsEGGwUuwFXqK4ffBcmvsHCt8Zu N+32QijgjkICqMuDX9B4kL3pQe1Jyx2e8A7NqTEL8cd0Omrw6eOmr8xnJ7f1JhC9 RSH+bGwzipwFZD9Lfn0ZlTkiYOhqZ+291OEhhvVqJuHHNUk0pcnaNcrc0iVDoTTp BDE9mZKABzThr6MlCLyx4UmWn0cOUAikg9wf3kZYkF4qjZ4/zjQqJ/a+oZnyjqmn 3gEzqa4k2GZFa3H4xQtaZmXN9La6LgRMUv0G9y9dgu8nqBxdzb/15tjC9idi71E= =MorK -----END PGP SIGNATURE----- From notifications at github.com Sun Nov 8 12:50:15 2020 From: notifications at github.com (Alan Zimmerman) Date: Sun, 08 Nov 2020 04:50:15 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] the opensmalltalk.org web site no longer works (#533) Message-ID: It goes to a github "site not found" page -- 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/533 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Sun Nov 8 12:53:10 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 8 Nov 2020 13:53:10 +0100 (CET) Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <139814250.43516978.1604834350663.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> <139814250.43516978.1604834350663.JavaMail.zimbra@telenet.be> Message-ID: <1908279326.43766377.1604839990019.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I should add that I think normally the config.h header file already set the 64 bit offset (via "configure"). The configure log shows: configure:15085: cc -c -g -DAIO_DEBUG -DNDEBUG -DDEBUGVM=0 -D_POSIX_PTHREAD_SEMANTICS -mt -m32 conftest.c >&5 configure:15085: $? = 0 configure:15093: result: 64 So it sets correctly in config.h #define _FILE_OFFSET_BITS 64 So depending on how to look at this, it may not be desired or needed to - -D_FILE_OFFSET_BITS=64 in the mvm script. That's because it is already set in the config.h. But then there is an issue (possibly) with the #include order, whether config.h is included before or after system headers. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfp+mYAAoJEAwpOKXMq1MarYoIAImi+NL7Tk8gTNsfkqpjDYjk lK3XS5TK0vZDNXz2GalO8i5x+6mec9BMrS5IzZn+I6JtteYlVZGPmhdV/e2iK+tR c4CJuXlvcAaXOGysHQ3DjirnRUSsUeh17iMAeQW90eJrusFXOJ26lgzq3JgMbQOs O69dGwT9s8ypp7j3UG3qEh36TELDZpI+3kL7T3DzmjhzsDlzNhVay5CqeGgn1bF6 cCKpyti7c/pnCFwAxzZOdXMriVUVbkCpbZF33pjUaPhfl4IUXGba3N37IQINgYuJ TfGQ+3IHgNAZiBDgPPtFOMTcA6i6BYEQqGlo1aXsdbf7l7LQWapEctvX6ZRP/JM= =/7eY -----END PGP SIGNATURE----- From eliot.miranda at gmail.com Sat Nov 7 21:45:44 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sat, 7 Nov 2020 13:45:44 -0800 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h Message-ID: <596D3B3D-7CD8-4C42-8FB8-BDF249486849@gmail.com>  _,,,^..^,,,_ (phone) > On Nov 7, 2020, at 11:34 AM, p.fazio at eggingtons.com wrote: >  > please remove me from the list Remove yourself. > > -------- Original Message -------- > Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h > From: "stes at PANDORA.BE" > Date: Sat, November 07, 2020 12:18 am > To: vm-dev > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > Hello, > > After removal of the sunos.h header file in > > platforms/unix/vm/sunos.h > > this old file is gone now after some cleanup, it seems the Cog VM and Stack VM > still compile fine on Solaris 11.3. > > I did not test yet on Solaris 11.4, but on Solaris 11.3 at least, it works. > > The 64bit Cog VM and Stack VM compile fine (even after removal of sunos.h), > and they work. > > HOWEVER ... the 32bit version seems to compile fine but there's a new problem: > > $ sqcogspursunosht/usr/bin/squeak Squeak6.0alpha-19843-32bit.image > sqImageFileSeek lseek: Invalid argument > > also with the Stack VM in 32bit: > > $ sqstkspursunosht/usr/bin/squeak Squeak6.0alpha-19843-32bit.image > sqImageFileSeek lseek: Invalid argument > > The ckformat tool reports : > > $ ckformat Squeak6.0alpha-19843-32bit.image > 6521 > > > What can be the reason / cause for this new "lseek Invalid argument" ? > > So this problem does NOT happen on 64 bit. > > For example with > > $ ckformat Squeak5.3-19431-64bit.image > 68021 > > the 64bit VM opens this image 68021 format just fine. > > Regards, > David Stes > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJfpknkAAoJEAwpOKXMq1MaAo8IAJcv1N3ExsJgoLeYz/PrIxY+ > saawdjwqVy+nVsKjVXHB29jDEgBnrC9vrIUxY/RJ4bJe4jItto8mlGVUUnxspzwa > jvApj2DFpaKXbzQboCpiwE2AYdfzsE07DHXppBvspC+xjCe4mG7lliiFyjxfGOne > iHBmCvJoaDvVyBCb8Uu5TShaRW+/ttcAARGmfbdmIz/zYKQLNc67IEfOPrIlS9Ks > VX4K6izd3Oim9KHAEBF5qC65RJSomI9VC8kI/QowCKEpkSQic+RsP1BdqXhDWKbP > k0k5znQ4ag96X/Sl8NjjqfP+hUEOPL5YGGo1QuxieY/nwbMX+rvzDS/UZ/U137g= > =u+R0 > -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Sun Nov 8 15:08:29 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sun, 8 Nov 2020 07:08:29 -0800 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <1908279326.43766377.1604839990019.JavaMail.zimbra@telenet.be> References: <1908279326.43766377.1604839990019.JavaMail.zimbra@telenet.be> Message-ID: <93C4B3BF-D950-453C-A29D-64C032FC4AB9@gmail.com> Hi David, > On Nov 8, 2020, at 4:53 AM, stes at telenet.be wrote: > >  > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > I should add that I think normally the config.h header file already set > the 64 bit offset (via "configure"). > > The configure log shows: > > configure:15085: cc -c -g -DAIO_DEBUG -DNDEBUG -DDEBUGVM=0 -D_POSIX_PTHREAD_SEMANTICS -mt -m32 conftest.c >&5 > configure:15085: $? = 0 > configure:15093: result: 64 > > > So it sets correctly in config.h > > #define _FILE_OFFSET_BITS 64 > > > > So depending on how to look at this, it may not be desired or needed to > - -D_FILE_OFFSET_BITS=64 in the mvm script. > > That's because it is already set in the config.h. > > But then there is an issue (possibly) with the #include order, whether > config.h is included before or after system headers. We should arrange that config.h is included first before anything else. In this sense config.h is a substitute for/convenience for command line defines. sqPlatformSpecific.h should be included after all (alas in practice most, because done system headers are pulled in before a specific function etc) system headers. > > David Stes > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJfp+mYAAoJEAwpOKXMq1MarYoIAImi+NL7Tk8gTNsfkqpjDYjk > lK3XS5TK0vZDNXz2GalO8i5x+6mec9BMrS5IzZn+I6JtteYlVZGPmhdV/e2iK+tR > c4CJuXlvcAaXOGysHQ3DjirnRUSsUeh17iMAeQW90eJrusFXOJ26lgzq3JgMbQOs > O69dGwT9s8ypp7j3UG3qEh36TELDZpI+3kL7T3DzmjhzsDlzNhVay5CqeGgn1bF6 > cCKpyti7c/pnCFwAxzZOdXMriVUVbkCpbZF33pjUaPhfl4IUXGba3N37IQINgYuJ > TfGQ+3IHgNAZiBDgPPtFOMTcA6i6BYEQqGlo1aXsdbf7l7LQWapEctvX6ZRP/JM= > =/7eY > -----END PGP SIGNATURE----- From notifications at github.com Sun Nov 8 15:47:43 2020 From: notifications at github.com (Alan Zimmerman) Date: Sun, 08 Nov 2020 07:47:43 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk.github.io] the opensmalltalk.org web site no longer works (#1) Message-ID: It goes to a github "site not found" page -- 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.github.io/issues/1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sun Nov 8 15:48:25 2020 From: notifications at github.com (Tobias Pape) Date: Sun, 08 Nov 2020 07:48:25 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk.github.io] the opensmalltalk.org web site no longer works (#1) In-Reply-To: References: Message-ID: Thanks. We're working on it. -- 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.github.io/issues/1#issuecomment-723595686 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kksubbu.ml at gmail.com Sun Nov 8 16:55:52 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Sun, 8 Nov 2020 22:25:52 +0530 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> Message-ID: On 08/11/20 3:30 pm, stes at PANDORA.BE wrote: > #ifndef __sun__ > #define ftell(s) ftello(s) > #define fseek(s,o,w) fseeko(s,o,w) > #endif /* __sun__ */ > > I don't know what the reasoning behind that was. It dates back to a transitional period when 32-bit kernels just started handling 64-bit file sizes. ISO C99 specified 32-bit offsets in ftell/fseek while POSIX large file extensions mapped them to calls with 64-bit offsets. I doubt if these are required anymore because modern toolchains use POSIX LFS by default. See http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html > Also there exists a lseek64() function. > > I have no idea whether this is correct, but if I change: > > - --- a/platforms/unix/vm/sqImageFileAccess.h > +++ b/platforms/unix/vm/sqImageFileAccess.h > @@ -108,7 +108,7 @@ sqImageFileWrite(void *ptr_arg, size_t sz, size_t count, sqImageFile f) > static inline off_t > sqImageFilePosition(sqImageFile f) > { > - - off_t pos = lseek(f, 0, SEEK_CUR); > ..... > Then the VM compiles in 32bit mode (as before) but now it succesfully loads > a 32bit VM image. But it will use 32-bit offsets and can't handle images larger than 2GB :-(. This shouldn't be required if compiles use -D_FILE_OFFSET_BITS=64 through autoconf or make scripts. The description for _FILE_OFFSET_BITS in the URL above has more detail. HTH .. Subbu From notifications at github.com Sun Nov 8 16:36:58 2020 From: notifications at github.com (Fabio Niephaus) Date: Sun, 08 Nov 2020 08:36:58 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk.github.io] the opensmalltalk.org web site no longer works (#1) In-Reply-To: References: Message-ID: The settings page reveals thee problem: > The custom domain for your GitHub Pages site is pointed at an outdated IP address. You must update your site's DNS records if you'd like it to be available via your custom domain. For more information, see https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/. -- 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.github.io/issues/1#issuecomment-723625393 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sun Nov 8 16:38:18 2020 From: notifications at github.com (Tobias Pape) Date: Sun, 08 Nov 2020 08:38:18 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk.github.io] the opensmalltalk.org web site no longer works (#1) In-Reply-To: References: Message-ID: As I said, we're on it -- 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.github.io/issues/1#issuecomment-723625889 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Mon Nov 9 06:03:29 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 9 Nov 2020 06:03:29 0000 Subject: [Vm-dev] VM Maker: FileAttributesPlugin.oscog-eem.60.mcz Message-ID: Eliot Miranda uploaded a new version of FileAttributesPlugin to project VM Maker: http://source.squeak.org/VMMaker/FileAttributesPlugin.oscog-eem.60.mcz ==================== Summary ==================== Name: FileAttributesPlugin.oscog-eem.60 Author: eem Time: 8 November 2020, 10:03:27.152197 pm UUID: de623342-2160-415d-a342-f64410f5ba5e Ancestors: FileAttributesPlugin.oscog-eem.59 Make sure initialiseModule invokes faInitialiseModule so faInitialiseModule can do its thing. =============== Diff against FileAttributesPlugin.oscog-eem.59 =============== Item was changed: ----- Method: FileAttributesPlugin>>initialiseModule (in category 'initialize-release') ----- initialiseModule sCOFfn := interpreterProxy ioLoadFunction: 'secCanOpenFileOfSizeWritable' From: 'SecurityPlugin'. sCLPfn := interpreterProxy ioLoadFunction: 'secCanListPathOfSize' From: 'SecurityPlugin'. + ^self faInitialiseModule! - ^true! Item was added: + ----- Method: FileAttributesPluginSimulator>>faInitialiseModule (in category 'initialize-release') ----- + faInitialiseModule + "In the real simulator this can determine whether to answer local or utc times, and can acche nil, true & false." + ^true! From commits at source.squeak.org Mon Nov 9 06:25:34 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 9 Nov 2020 06:25:34 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2870.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2870.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2870 Author: eem Time: 8 November 2020, 10:25:21.301268 pm UUID: 28fdb4ad-28aa-44e5-bef2-0d6851fb7750 Ancestors: VMMaker.oscog-eem.2869 Add an image header flag that selects UTC times form the FilePlugin and FileAttributesPlugin, rather than local tme. e.g. to set (until we have a proper accessor) use Smalltalk vmParameterAt: 48 put: ((Smalltalk vmParameterAt: 48) bitOr: 128) =============== Diff against VMMaker.oscog-eem.2869 =============== Item was changed: ----- Method: CoInterpreter>>setImageHeaderFlags: (in category 'internal interpreter access') ----- setImageHeaderFlags: flags "Set an array of flags indicating various properties of the saved image, responded to on image load. These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) (meaningful to the MT VM only) Bit 1: if set, methods that are interpreted will have the flag bit set in their header Bit 2: if set, implies preempting a process does not put it to the back of its run queue Bit 3: if set, implies a threaded VM will not disown the VM if owned by the GUI thread (meaningful to the MT VM only) Bit 4: if set, implies the new finalization scheme where WeakArrays are queued Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events + Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) + Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times" + flags asUnsignedInteger > 255 ifTrue: - Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)" - flags asUnsignedInteger > 127 ifTrue: [^self primitiveFailFor: PrimErrUnsupported]. "processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 1) ifTrue: [imageHeaderFlags bitOr: 4] ifFalse: [imageHeaderFlags bitClear: 4]. flagInterpretedMethods := flags anyMask: 2. preemptionYields := flags noMask: 4. "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 8) ifTrue: [imageHeaderFlags bitOr: 32] ifFalse: [imageHeaderFlags bitClear: 32]. newFinalization := flags anyMask: 16. sendWheelEvents := flags anyMask: 32. + primitiveDoMixedArithmetic := flags noMask: 64. + imageHeaderFlags := (flags anyMask: 128) + ifTrue: [imageHeaderFlags bitOr: 128] + ifFalse: [imageHeaderFlags bitClear: 128]! - primitiveDoMixedArithmetic := flags noMask: 64! Item was changed: ----- Method: CoInterpreterMT>>setImageHeaderFlags: (in category 'internal interpreter access') ----- setImageHeaderFlags: flags "Set an array of flags indicating various properties of the saved image, responded to on image load. These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) Bit 1: if set, methods that are interpreted will have the flag bit set in their header Bit 2: if set, implies preempting a process does not put it to the back of its run queue Bit 3: if set, implies a threaded VM will not disown the VM if owned by the GUI thread Bit 4: if set, implies the new finalization scheme where WeakArrays are queued Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events + Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) + Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times" + flags asUnsignedInteger > 255 ifTrue: - Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)" - flags asUnsignedInteger > 127 ifTrue: [^self primitiveFailFor: PrimErrUnsupported]. processHasThreadId := flags anyMask: 1. flagInterpretedMethods := flags anyMask: 2. preemptionYields := flags noMask: 4. noThreadingOfGUIThread := flags anyMask: 8. newFinalization := flags anyMask: 16. sendWheelEvents := flags anyMask: 32. + primitiveDoMixedArithmetic := flags noMask: 64. + imageHeaderFlags := (flags anyMask: 8) + ifTrue: [imageHeaderFlags bitOr: 128] + ifFalse: [imageHeaderFlags bitClear: 128]! - primitiveDoMixedArithmetic := flags noMask: 64! Item was added: + ----- Method: InterpreterProxy>>fileTimesInUTC (in category 'other') ----- + fileTimesInUTC + + ^(Smalltalk vmParameterAt: 48) anyMask: 128! Item was added: + ----- Method: SpurMemoryManager>>fileTimesInUTC (in category 'simulation only') ----- + fileTimesInUTC + "hack around the CoInterpreter/ObjectMemory split refactoring" + + ^coInterpreter fileTimesInUTC! Item was added: + ----- Method: StackInterpreter>>fileTimesInUTC (in category 'plugin support') ----- + fileTimesInUTC + "Answer if file times, including those from the FilePlugin and FileAttributesPlugin, + should be answered in UTC seconds from the epoch rather than local seconds." + ^imageHeaderFlags anyMask: 128! Item was changed: ----- Method: StackInterpreter>>setImageHeaderFlags: (in category 'internal interpreter access') ----- setImageHeaderFlags: flags "Set an array of flags indicating various properties of the saved image, responded to on image load. These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) (meaningful to the MT VM only) Bit 1: if set, methods that are interpreted will have the flag bit set in their header (meaningful to the Cog VM only) Bit 2: if set, implies preempting a process does not put it to the back of its run queue Bit 3: if set, implies a threaded VM will not disown the VM if owned by the GUI thread (meaningful to the MT VM only) Bit 4: if set, implies the new finalization scheme where WeakArrays are queued Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events + Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) + Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times" + flags asUnsignedInteger > 255 ifTrue: - Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int)" - flags asUnsignedInteger > 127 ifTrue: [^self primitiveFailFor: PrimErrUnsupported]. "processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 1) ifTrue: [imageHeaderFlags bitOr: 4] ifFalse: [imageHeaderFlags bitClear: 4]. "flagInterpretedMethods := flags anyMask: 2. specific to CoInterpreter" imageHeaderFlags := (flags anyMask: 2) ifTrue: [imageHeaderFlags bitOr: 8] ifFalse: [imageHeaderFlags bitClear: 8]. preemptionYields := flags noMask: 4. "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 8) ifTrue: [imageHeaderFlags bitOr: 32] ifFalse: [imageHeaderFlags bitClear: 32]. newFinalization := flags anyMask: 16. sendWheelEvents := flags anyMask: 32. + primitiveDoMixedArithmetic := flags noMask: 64. + imageHeaderFlags := (flags anyMask: 8) + ifTrue: [imageHeaderFlags bitOr: 128] + ifFalse: [imageHeaderFlags bitClear: 128]! - primitiveDoMixedArithmetic := flags noMask: 64! From noreply at github.com Mon Nov 9 06:38:04 2020 From: noreply at github.com (Eliot Miranda) Date: Sun, 08 Nov 2020 22:38:04 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 151793: CogVM source as per VMMaker.oscog-eem.2870 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 151793a3a6a54744e3ac9151300c6ccde763c761 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/151793a3a6a54744e3ac9151300c6ccde763c761 Author: Eliot Miranda Date: 2020-11-08 (Sun, 08 Nov 2020) Changed paths: M nsspur64src/vm/cointerp.c M nsspur64src/vm/cointerp.h M nsspur64src/vm/gcc3x-cointerp.c M nsspursrc/vm/cointerp.c M nsspursrc/vm/cointerp.h M nsspursrc/vm/gcc3x-cointerp.c M nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.c M platforms/Cross/plugins/FileAttributesPlugin/faCommon.c M platforms/Cross/plugins/FileAttributesPlugin/faCommon.h M platforms/Cross/vm/sqVirtualMachine.c M platforms/Cross/vm/sqVirtualMachine.h M platforms/iOS/plugins/FilePlugin/sqUnixFile.c M platforms/unix/plugins/FileAttributesPlugin/faSupport.c M platforms/unix/plugins/FilePlugin/sqUnixFile.c M platforms/win32/plugins/FileAttributesPlugin/faSupport.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 spurlowcode64src/vm/cointerp.c M spurlowcode64src/vm/cointerp.h M spurlowcode64src/vm/gcc3x-cointerp.c M spurlowcodesrc/vm/cointerp.c M spurlowcodesrc/vm/cointerp.h M spurlowcodesrc/vm/gcc3x-cointerp.c M spurlowcodestack64src/vm/gcc3x-interp.c M spurlowcodestack64src/vm/interp.c M spurlowcodestacksrc/vm/gcc3x-interp.c M spurlowcodestacksrc/vm/interp.c M spursista64src/vm/cointerp.c M spursista64src/vm/cointerp.h M spursista64src/vm/gcc3x-cointerp.c M spursistasrc/vm/cointerp.c M spursistasrc/vm/cointerp.h M spursistasrc/vm/gcc3x-cointerp.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 spurstack64src/vm/gcc3x-interp.c M spurstack64src/vm/interp.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/validImage.c M src/plugins/FileAttributesPlugin/FileAttributesPlugin.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 stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2870 Add an image header flag that selects UTC times from the FilePlugin and FileAttributesPlugin, rather than local time. e.g. to set (until we have a proper accessor) use Smalltalk vmParameterAt: 48 put: ((Smalltalk vmParameterAt: 48) bitOr: 128) Have the FileAttributesPlugin cache nil, true & false, since these never change. From builds at travis-ci.org Mon Nov 9 06:49:35 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Nov 2020 06:49:35 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2296 (Cog - 151793a) In-Reply-To: Message-ID: <5fa8e6822596c_13ffc868aad8c6712a@travis-tasks-f6df768db-58wbr.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2296 Status: Still Failing Duration: 10 mins and 59 secs Commit: 151793a (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2870 Add an image header flag that selects UTC times from the FilePlugin and FileAttributesPlugin, rather than local time. e.g. to set (until we have a proper accessor) use Smalltalk vmParameterAt: 48 put: ((Smalltalk vmParameterAt: 48) bitOr: 128) Have the FileAttributesPlugin cache nil, true & false, since these never change. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/3b9eb5d65a96...151793a3a6a5 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/742369517?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Mon Nov 9 06:55:37 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 9 Nov 2020 06:55:37 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2871.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2871.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2871 Author: eem Time: 8 November 2020, 10:55:27.287421 pm UUID: 326d8568-fcb5-46f0-bc8f-16f391448dec Ancestors: VMMaker.oscog-eem.2870 Ugh, the 2 bit shift in the image flags will be the end of me. Get the file times in utc flag set code correct. Bah... =============== Diff against VMMaker.oscog-eem.2870 =============== Item was changed: ----- Method: CoInterpreter>>setImageHeaderFlags: (in category 'internal interpreter access') ----- setImageHeaderFlags: flags "Set an array of flags indicating various properties of the saved image, responded to on image load. These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) (meaningful to the MT VM only) Bit 1: if set, methods that are interpreted will have the flag bit set in their header Bit 2: if set, implies preempting a process does not put it to the back of its run queue Bit 3: if set, implies a threaded VM will not disown the VM if owned by the GUI thread (meaningful to the MT VM only) Bit 4: if set, implies the new finalization scheme where WeakArrays are queued Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times" flags asUnsignedInteger > 255 ifTrue: [^self primitiveFailFor: PrimErrUnsupported]. "processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 1) ifTrue: [imageHeaderFlags bitOr: 4] ifFalse: [imageHeaderFlags bitClear: 4]. flagInterpretedMethods := flags anyMask: 2. preemptionYields := flags noMask: 4. "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 8) ifTrue: [imageHeaderFlags bitOr: 32] ifFalse: [imageHeaderFlags bitClear: 32]. newFinalization := flags anyMask: 16. sendWheelEvents := flags anyMask: 32. primitiveDoMixedArithmetic := flags noMask: 64. imageHeaderFlags := (flags anyMask: 128) + ifTrue: [imageHeaderFlags bitOr: 512] + ifFalse: [imageHeaderFlags bitClear: 512]! - ifTrue: [imageHeaderFlags bitOr: 128] - ifFalse: [imageHeaderFlags bitClear: 128]! Item was changed: ----- Method: CoInterpreterMT>>setImageHeaderFlags: (in category 'internal interpreter access') ----- setImageHeaderFlags: flags "Set an array of flags indicating various properties of the saved image, responded to on image load. These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) Bit 1: if set, methods that are interpreted will have the flag bit set in their header Bit 2: if set, implies preempting a process does not put it to the back of its run queue Bit 3: if set, implies a threaded VM will not disown the VM if owned by the GUI thread Bit 4: if set, implies the new finalization scheme where WeakArrays are queued Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times" flags asUnsignedInteger > 255 ifTrue: [^self primitiveFailFor: PrimErrUnsupported]. processHasThreadId := flags anyMask: 1. flagInterpretedMethods := flags anyMask: 2. preemptionYields := flags noMask: 4. noThreadingOfGUIThread := flags anyMask: 8. newFinalization := flags anyMask: 16. sendWheelEvents := flags anyMask: 32. primitiveDoMixedArithmetic := flags noMask: 64. + imageHeaderFlags := (flags anyMask: 128) + ifTrue: [imageHeaderFlags bitOr: 512] + ifFalse: [imageHeaderFlags bitClear: 512]! - imageHeaderFlags := (flags anyMask: 8) - ifTrue: [imageHeaderFlags bitOr: 128] - ifFalse: [imageHeaderFlags bitClear: 128]! Item was changed: ----- Method: StackInterpreter>>fileTimesInUTC (in category 'plugin support') ----- fileTimesInUTC "Answer if file times, including those from the FilePlugin and FileAttributesPlugin, should be answered in UTC seconds from the epoch rather than local seconds." + ^imageHeaderFlags anyMask: 512! - ^imageHeaderFlags anyMask: 128! Item was changed: ----- Method: StackInterpreter>>setImageHeaderFlags: (in category 'internal interpreter access') ----- setImageHeaderFlags: flags "Set an array of flags indicating various properties of the saved image, responded to on image load. These are the same as the image header flags shifted right two bits, omitting the fullScreenFlag and float byte order flag. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) (meaningful to the MT VM only) Bit 1: if set, methods that are interpreted will have the flag bit set in their header (meaningful to the Cog VM only) Bit 2: if set, implies preempting a process does not put it to the back of its run queue Bit 3: if set, implies a threaded VM will not disown the VM if owned by the GUI thread (meaningful to the MT VM only) Bit 4: if set, implies the new finalization scheme where WeakArrays are queued Bit 5: if set, implies wheel events will be delivered as such and not mapped to arrow key events Bit 6: if set, implies arithmetic primitives will fail if given arguments of different types (float vs int) Bit 7: if set, implies file primitives (FilePlugin, FileAttributesPlugin) will answer file times in UTC not local times" flags asUnsignedInteger > 255 ifTrue: [^self primitiveFailFor: PrimErrUnsupported]. "processHasThreadId := flags anyMask: 1. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 1) ifTrue: [imageHeaderFlags bitOr: 4] ifFalse: [imageHeaderFlags bitClear: 4]. "flagInterpretedMethods := flags anyMask: 2. specific to CoInterpreter" imageHeaderFlags := (flags anyMask: 2) ifTrue: [imageHeaderFlags bitOr: 8] ifFalse: [imageHeaderFlags bitClear: 8]. preemptionYields := flags noMask: 4. "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT" imageHeaderFlags := (flags anyMask: 8) ifTrue: [imageHeaderFlags bitOr: 32] ifFalse: [imageHeaderFlags bitClear: 32]. newFinalization := flags anyMask: 16. sendWheelEvents := flags anyMask: 32. primitiveDoMixedArithmetic := flags noMask: 64. + imageHeaderFlags := (flags anyMask: 128) + ifTrue: [imageHeaderFlags bitOr: 512] + ifFalse: [imageHeaderFlags bitClear: 512]! - imageHeaderFlags := (flags anyMask: 8) - ifTrue: [imageHeaderFlags bitOr: 128] - ifFalse: [imageHeaderFlags bitClear: 128]! From noreply at github.com Mon Nov 9 07:04:47 2020 From: noreply at github.com (Eliot Miranda) Date: Sun, 08 Nov 2020 23:04:47 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 0748fb: CogVM source as per VMMaker.oscog-eem.2871 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 0748fb622d16ed55de212ed2c6aca1a0defa1799 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/0748fb622d16ed55de212ed2c6aca1a0defa1799 Author: Eliot Miranda Date: 2020-11-08 (Sun, 08 Nov 2020) Changed paths: M nsspur64src/vm/cointerp.c M nsspur64src/vm/cointerp.h M nsspur64src/vm/gcc3x-cointerp.c M nsspursrc/vm/cointerp.c M nsspursrc/vm/cointerp.h M nsspursrc/vm/gcc3x-cointerp.c M nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.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 spurlowcode64src/vm/cointerp.c M spurlowcode64src/vm/cointerp.h M spurlowcode64src/vm/gcc3x-cointerp.c M spurlowcodesrc/vm/cointerp.c M spurlowcodesrc/vm/cointerp.h M spurlowcodesrc/vm/gcc3x-cointerp.c M spurlowcodestack64src/vm/gcc3x-interp.c M spurlowcodestack64src/vm/interp.c M spurlowcodestacksrc/vm/gcc3x-interp.c M spurlowcodestacksrc/vm/interp.c M spursista64src/vm/cointerp.c M spursista64src/vm/cointerp.h M spursista64src/vm/gcc3x-cointerp.c M spursistasrc/vm/cointerp.c M spursistasrc/vm/cointerp.h M spursistasrc/vm/gcc3x-cointerp.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 spurstack64src/vm/gcc3x-interp.c M spurstack64src/vm/interp.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/validImage.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 stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2871 Ugh, the 2 bit shift in the image flags will be the end of me. Get the file times in utc flag set code correct. From builds at travis-ci.org Mon Nov 9 07:18:46 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Nov 2020 07:18:46 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2297 (Cog - 0748fb6) In-Reply-To: Message-ID: <5fa8ed5953b54_13fe750ba6bf87962e@travis-tasks-f6df768db-n9vsn.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2297 Status: Still Failing Duration: 13 mins and 35 secs Commit: 0748fb6 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2871 Ugh, the 2 bit shift in the image flags will be the end of me. Get the file times in utc flag set code correct. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/151793a3a6a5...0748fb622d16 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/742373044?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Mon Nov 9 07:48:38 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Mon, 9 Nov 2020 08:48:38 +0100 (CET) Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <1908279326.43766377.1604839990019.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> <139814250.43516978.1604834350663.JavaMail.zimbra@telenet.be> <1908279326.43766377.1604839990019.JavaMail.zimbra@telenet.be> Message-ID: <484094493.45696588.1604908118745.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Thanks for the interesting link to https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html To quote from that page: "You should define these macros by using #define preprocessor directives at the top of your source code files. These directives must come before any #include of a system header file. It is best to make them the very first thing in the file, preceded only by comments. You could also use the -D option to GCC, but it's better if you make the source files indicate their own meaning in a self-contained way. " Note the fact that it says: "before any #include of a system header file". So the change that I observe (because it used to work) is perhaps due to reorganizing the source code so that the "before any #include" is no longer so. Also this is of course very fragile, perhaps using the -D option in the mvm script (which is an alternative that I tested and it works) can be done. In fact the issue could be due to AC_SYS_LARGEFILE in the platforms/unix/config/configure.ac which currently seems to set in the config.h.in the _FILE_OFFSET_BITS. However perhaps AC_SYS_LARGEFILE could be instructed to not change the config.h header but rather just add the -D option to the CFLAGS. David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfqPQ3AAoJEAwpOKXMq1MaFwIH/RP9Yg6cXLZl2smd+QlQGHoe 4iR0tDzkcSImSmIySY/2FS+4eHKvodMfNkIbRTRDhgvbFsV9ajKKi/m7oCAqgt6f OTES0SXxZNZojDinM18IelVbnVZ0S+9MzPw1LXBrToqhKJ+PfPK+kHBnBbSMcpHF /29pyFT4x3nhG7xzACCCHNiZ2NN2LJdf7u8TYf41kt6EL7SRvsaR3cwK7kRJmli2 dmtrUGBN0VJ4bxYIEi4ztvbtaOCCqLbIQRJ+5e9Qjuq7xjK+H5ZPDyJgU/aZHRrm VW/i1ne7r/1zLqR4ulECLqX9rYGrm19ItcUka8cU/0dEi9d1HVX5C/zy1ut3QfI= =ftSh -----END PGP SIGNATURE----- From no-reply at appveyor.com Mon Nov 9 08:26:32 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 09 Nov 2020 08:26:32 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2299 Message-ID: <20201109082632.1.B2C427383E7B4F0F@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Nov 9 10:27:58 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 09 Nov 2020 10:27:58 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2300 Message-ID: <20201109102758.1.04DE20C3211C0514@appveyor.com> An HTML attachment was scrubbed... URL: From stes at telenet.be Mon Nov 9 10:49:47 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Mon, 9 Nov 2020 11:49:47 +0100 (CET) Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <484094493.45696588.1604908118745.JavaMail.zimbra@telenet.be> References: <1537978107.39891217.1604733508583.JavaMail.zimbra@telenet.be> <1451351116.43253930.1604829658613.JavaMail.zimbra@telenet.be> <139814250.43516978.1604834350663.JavaMail.zimbra@telenet.be> <1908279326.43766377.1604839990019.JavaMail.zimbra@telenet.be> <484094493.45696588.1604908118745.JavaMail.zimbra@telenet.be> Message-ID: <1243389986.46411040.1604918987878.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Also see an interesting bug report for Debian Linux: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=158969 So arguably this is some sort of "bug" (or feature?) of "GNU configure" and the AC_SYS_LARGEFILE macro. The documentation says that it will append -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 but this is apparently in my version of configure to "DEFS". The Debian Linux guy correctly states that the variable is DEFS. I just tested it and for me on Solaris 11.3 at least, the configure AC_SYS_LARGEFILE tests and expands than in the Makefile : @DEFS@ expands to - -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -D_FILE_OFFSET_BITS=64 Note that it appends the -D_FILE_OFFSET_BITS=64 to @DEFS@ ! So it is not so clear to me whether to patch the "mvm" script to set - -D_FILE_OFFSET_BITS=64 or whether this is some sort of GNU configure bug ... Anyway an easy solution would be to just patch the SunOS mvm script and set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 in the mvm script. However that duplicates part of the autoconf configure script functionality (the AC_SYS_LARGEFILE macro). David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfqR50AAoJEAwpOKXMq1Main4H/1uQ84SNt3ZJVEhO6PFe+GGP qBReQhzrt2n0SAUkY/p/sn14lX9czBOumwXcDNwiE3AaE1+i/2r+F+XRMXfQp8Bn WjyoehUDdO/qZIC580OBBDKTbiLMM7Zp5PJ7IWKrT7ue4QQZOmTbZvrroT9z3Ja4 dn8a44xesheY7e5JHi+rrZ0W0nr+vdhPdNNDZ6oU6N4SabIAYcys7QxnfTsfXYVr Of7ZM0dYnDffoW7wJbaoxdcIr/qu+JmrCfcNC7jXDHhHppF2onnUibH0PNWlf6v4 H3tHFCdhlBCiZ0cb+SSjYWahSjJIVuC10d2u5oaC7a10WfhSaGv4sH7zlxKW9Es= =TMvm -----END PGP SIGNATURE----- From boris at shingarov.com Mon Nov 9 12:42:23 2020 From: boris at shingarov.com (Boris Shingarov) Date: Mon, 9 Nov 2020 07:42:23 -0500 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: <596D3B3D-7CD8-4C42-8FB8-BDF249486849@gmail.com> References: <596D3B3D-7CD8-4C42-8FB8-BDF249486849@gmail.com> Message-ID: Has Squeak come full circle with this question? A quarter century ago Dicky T was funnier: http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-August/009428.html On 11/7/20 4:45 PM, Eliot Miranda wrote: > _,,,^..^,,,_ (phone) > >> On Nov 7, 2020, at 11:34 AM, p.fazio at eggingtons.com wrote: >> >>  >> please remove me from the list > > Remove yourself. From notifications at github.com Mon Nov 9 13:39:44 2020 From: notifications at github.com (dcstes) Date: Mon, 09 Nov 2020 05:39:44 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] SunOS change: make sure lseek64 is used (configure in 32bit) (#534) Message-ID: Add -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to the mvm scripts for SunOS 32bit. This could be due to a 'bug' in GNU autoconf / configure which makes AC_SYS_LARGEFILE only set those defines in the config.h and not on the cc command line in the Makefile's. Even if the configure script would be fixed, I think the defines on the cmd.line would not hurt, but if configure would be fixed then these defines would be unnecessary. David Stes You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/534 -- Commit Summary -- * SunOS change: make sure lseek64 is used (configure in 32bit) -- File Changes -- M build.sunos32x86/squeak.cog.spur/build/mvm (4) M build.sunos32x86/squeak.stack.spur/build/mvm (4) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/534.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/534.diff -- 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/pull/534 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Nov 9 14:13:48 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 09 Nov 2020 06:13:48 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] SunOS change: make sure lseek64 is used (configure in 32bit) (#534) In-Reply-To: References: Message-ID: Merged #534 into Cog. -- 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/pull/534#event-3973955712 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Mon Nov 9 14:13:48 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 09 Nov 2020 06:13:48 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f5d8be: SunOS change: make sure lseek64 is used (configure... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f5d8be2a39be369727753f9dadad5b9c61743422 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f5d8be2a39be369727753f9dadad5b9c61743422 Author: stes Date: 2020-11-09 (Mon, 09 Nov 2020) Changed paths: M build.sunos32x86/squeak.cog.spur/build/mvm M build.sunos32x86/squeak.stack.spur/build/mvm Log Message: ----------- SunOS change: make sure lseek64 is used (configure in 32bit) Commit: 8114f36f205ab8514fb344b504e561fb5559d6b5 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8114f36f205ab8514fb344b504e561fb5559d6b5 Author: Eliot Miranda Date: 2020-11-09 (Mon, 09 Nov 2020) Changed paths: M build.sunos32x86/squeak.cog.spur/build/mvm M build.sunos32x86/squeak.stack.spur/build/mvm Log Message: ----------- Merge pull request #534 from dcstes/lseekfix SunOS change: make sure lseek64 is used (configure in 32bit) Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/0748fb622d16...8114f36f205a From builds at travis-ci.org Mon Nov 9 14:56:30 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 09 Nov 2020 14:56:30 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2299 (Cog - 8114f36) In-Reply-To: Message-ID: <5fa9589deaa37_13f81040ef118764ea@travis-tasks-7695898ffc-dvjrs.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2299 Status: Still Failing Duration: 41 mins and 26 secs Commit: 8114f36 (Cog) Author: Eliot Miranda Message: Merge pull request #534 from dcstes/lseekfix SunOS change: make sure lseek64 is used (configure in 32bit) View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/0748fb622d16...8114f36f205a View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/742450506?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Nov 9 16:21:21 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 09 Nov 2020 16:21:21 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2302 Message-ID: <20201109162121.1.596103320241ABEB@appveyor.com> An HTML attachment was scrubbed... URL: From karlramberg at gmail.com Mon Nov 9 18:37:59 2020 From: karlramberg at gmail.com (karl ramberg) Date: Mon, 9 Nov 2020 19:37:59 +0100 Subject: [Vm-dev] latest sources removal platforms/unix/vm/sunos.h In-Reply-To: References: <596D3B3D-7CD8-4C42-8FB8-BDF249486849@gmail.com> Message-ID: Haha :-D Best, Karl On Mon, Nov 9, 2020 at 1:42 PM Boris Shingarov wrote: > > Has Squeak come full circle with this question? > > A quarter century ago Dicky T was funnier: > > > http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-August/009428.html > > On 11/7/20 4:45 PM, Eliot Miranda wrote: > > _,,,^..^,,,_ (phone) > > > >> On Nov 7, 2020, at 11:34 AM, p.fazio at eggingtons.com wrote: > >> > >>  > >> please remove me from the list > > > > Remove yourself. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Nov 9 20:00:20 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 09 Nov 2020 12:00:20 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Customization for Pharo & About Dialog (#524) In-Reply-To: References: Message-ID: Hi Christophe, when I try and build a PharoVM from the Cog sources after merging this pull request I get the following error: ```../../platforms/iOS/vm/OSX/SqueakOSXApplication.m:76:37: error: no visible @interface for 'sqSqueakMainApplication' declares the selector 'setAboutWindow:' [gDelegateApp.squeakApplication setAboutWindow: [self keyWindow]]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~ 1 error generated.``` It's coming from this method: ```@implementation SqueakOSXApplication ... - (void)orderFrontStandardAboutPanel:(id)sender; { [super orderFrontStandardAboutPanel: sender]; [gDelegateApp.squeakApplication setAboutWindow: [self keyWindow]]; }``` -- 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/pull/524#issuecomment-724245207 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Nov 10 00:25:00 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 00:25:00 0000 Subject: [Vm-dev] VM Maker: VMMakerUI-eem.33.mcz Message-ID: Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.33.mcz ==================== Summary ==================== Name: VMMakerUI-eem.33 Author: eem Time: 9 November 2020, 4:24:58.670815 pm UUID: 3ea7d85d-5abd-49c2-a870-576e907a1a05 Ancestors: VMMakerUI-eem.32 Hack in a short cut to the CogBytecodeMethodInspector in machine code frame inspectors if the shift key is pressed (we're missing a CogMethodInspector for now). =============== Diff against VMMakerUI-eem.32 =============== Item was changed: ----- Method: CogAbstractFrameInspector>>interpretMethod:value:at: (in category 'evaluating') ----- interpretMethod: fieldName value: valueString at: address | methodFieldString secondMethodFieldString | methodFieldString := valueString copyUpTo: Character tab. secondMethodFieldString := (ReadStream on: valueString from: methodFieldString size + 2 to: valueString size) skipSeparators; upTo: $:. + Sensor shiftPressed ifTrue: + [^(CogBytecodeMethodInspector on: coInterpreter) + oop: (coInterpreter frameMethodObject: self framePointer); + displayPinnable: fieldName, ' ', valueString]. + "compare ignoring least significant bits, which are flags" - "compare ignoring least signirficant bits, which are flags" methodFieldString allButLast = secondMethodFieldString allButLast ifTrue: [^(CogBytecodeMethodInspector on: coInterpreter) oop: (coInterpreter longAt: address); displayPinnable: fieldName, ' ', valueString]. "It's a CogMethod; use a different inspector" self shouldBeImplemented! From commits at source.squeak.org Tue Nov 10 00:38:20 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 00:38:20 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2872.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2872.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2872 Author: eem Time: 9 November 2020, 4:38:11.22011 pm UUID: 5d072666-2fed-4361-871b-354b8e6f93e2 Ancestors: VMMaker.oscog-eem.2871 COGMTVM: Change the lock to Cogit>>tryLockVMOwnerTo: from tryLockVMOwner: & tryLockVMToIndex:. Clean up various asserts; in partcular match simulator stack depth checks in disownVM: and ownVM:. Have print[Stack]CallStackOf: handle the active process (suspendedContext isNil). Slang: give flexibility to the simulator by only performing a translation-time super expension if the super selector is the same as the current method's. =============== Diff against VMMaker.oscog-eem.2871 =============== Item was added: + ----- Method: CoInterpreterMT>>assertCStackAssignedToCurrentThread (in category 'debug support') ----- + assertCStackAssignedToCurrentThread + "void in production; see the simulator subclass..." + ! Item was changed: ----- Method: CoInterpreterMT>>disownVM: (in category 'vm scheduling') ----- disownVM: flags "Release the VM to other threads and answer the current thread's index. Currently valid flags: DisownVMLockOutFullGC - prevent fullGCs while this thread disowns the VM DisownVMForFFICall - informs the VM that it is entering an FFI call DisownVMForThreading - informs the VM that it is entering an FFI call etc during which threading should be permitted OwnVMForeignThreadFlag - indicates lowest-level entry from a foreign thread - not to be used explicitly by clients - only set by ownVMFromUnidentifiedThread VMAlreadyOwnedHenceDoNotDisown - indicates an ownVM from a callback was made when the vm was still owned. - not to be used explicitly by clients - only set by ownVMFromUnidentifiedThread This is the entry-point for plugins and primitives that wish to release the VM while performing some operation that may potentially block, and for callbacks returning back to some blocking operation. If this thread does not reclaim the VM before- hand then when the next heartbeat occurs the thread manager will schedule a thread to acquire the VM which may start running the VM in place of this thread. N.B. Most of the state needed to resume after preemption is set in preemptDisowningThread." | vmThread result | self assert: self successful. cogit recordEventTrace ifTrue: [self recordTrace: TraceDisownVM thing: (objectMemory integerObjectOf: flags) source: 0]. processHasThreadId ifFalse: [willNotThreadWarnCount < 10 ifTrue: [self print: 'warning: VM parameter 48 indicates Process doesn''t have threadId; VM will not thread'; cr. willNotThreadWarnCount := willNotThreadWarnCount + 1]]. vmThread := cogThreadManager currentVMThread. (flags anyMask: VMAlreadyOwnedHenceDoNotDisown) ifTrue: [disowningVMThread := vmThread. vmThread state: CTMUnavailable. ^0]. + self assertCStackPointersBelongToCurrentThread. - self cCode: '' - inSmalltalk: - [| range | - range := self cStackRangeForThreadIndex: vmThread index. - self assert: (range includes: CStackPointer). - self assert: (range includes: CFramePointer)]. (flags anyMask: DisownVMForProcessorRelinquish) ifTrue: [| proc | (proc := objectMemory splObj: foreignCallbackProcessSlot) ~= objectMemory nilObject ifTrue: [foreignCallbackPriority := self quickFetchInteger: PriorityIndex ofObject: proc]. relinquishing := true. self sqLowLevelMFence]. (flags anyMask: DisownVMLockOutFullGC) ifTrue: [objectMemory incrementFullGCLock]. (noThreadingOfGUIThread and: [self inGUIThread]) ifTrue: [^vmThread index + LockGUIThreadFlag + (activeProcessAffined ifTrue: [0] ifFalse: [ProcessUnaffinedOnDisown]) + (flags << DisownFlagsShift)]. disowningVMThread := vmThread. "self cr; cr; print: 'disownVM Csp: '; printHex: vmThread cStackPointer; cr. (0 to: 16 by: 4) do: [:offset| self print: ' *(esp+'; printNum: offset; print: ': '; printHex: (stackPages longAt: cogit processor sp + offset); cr]. cogit processor printIntegerRegistersOn: Transcript." "OwnVMForeignThreadFlag indicates lowest-level of entry by a foreign thread. If that's where we are then release the vmThread. Otherwise indicate the vmThread is off doing something outside of the VM." (flags anyMask: OwnVMForeignThreadFlag) ifTrue: ["I don't think this is quite right. Josh's use case is creating some foreign thread and then registering it with the VM. That's not the same as binding a process to a foreign thread given that the foreign callback process is about to terminate anyway (it is returning from a callback here). So do we need an additional concept, that of a vmThread being either of the set known to the VM or floating?" self flag: 'issue with registering foreign threads with the VM'. (self isBoundProcess: self activeProcess) ifFalse: [cogThreadManager unregisterVMThread: vmThread]] ifFalse: [vmThread state: CTMUnavailable]. result := vmThread index + (activeProcessAffined ifTrue: [0] ifFalse: [ProcessUnaffinedOnDisown]) + (flags << DisownFlagsShift). cogThreadManager releaseVM. ^result! Item was removed: - ----- Method: CoInterpreterMT>>initializeProcessorStackForSimulation: (in category 'initialization') ----- - initializeProcessorStackForSimulation: vmThread - - self cCode: [] inSmalltalk: - [| range | - range := self cStackRangeForThreadIndex: vmThread index. - cogit processor - setFramePointer: range last - stackPointer: range last - 32. - self setCFramePointer: cogit processor fp setCStackPointer: cogit processor sp]! Item was changed: ----- Method: CoInterpreterMT>>ownVMFromUnidentifiedThread (in category 'vm scheduling') ----- ownVMFromUnidentifiedThread "Attempt to take ownership from a thread that as yet doesn't know its index. This supports callbacks where the callback could originate from any thread. Answer 0 if the owning thread is known to the VM. Answer 1 if the owning thread is unknown to the VM and now owns the VM. Answer -1 if the owning thread is unknown to the VM and fails to own the VM. Answer -2 if the owning thread is unknown to the VM and there is no foreign callback process installed." | count threadIndex vmThread | (threadIndex := cogThreadManager ioGetThreadLocalThreadIndex) ~= 0 ifTrue: [ "this is a callback from a known thread" (cogThreadManager vmOwnerIs: threadIndex) ifTrue: "the VM has not been disowned" [self assert: (disowningVMThread isNil or: [disowningVMThread = self currentVMThread]). disowningVMThread := nil. self currentVMThread state: CTMAssignableOrInVM. ^VMAlreadyOwnedHenceDoNotDisown]. ^self ownVM: threadIndex]. foreignCallbackPriority = 0 ifTrue: [^-2]. count := 0. "If the current thread doesn't have an index it's new to the vm and we need to allocate a new threadInfo, failing if we can't. We also need a process in the foreignCallbackProcessSlot upon which to run the thread's eventual callback." + [[cogit tryLockVMOwnerTo: cogThreadManager ioCurrentOSThread] whileFalse: - [[cogit tryLockVMToIndex: cogThreadManager ioCurrentOSThread] whileFalse: [self waitingPriorityIsAtLeast: foreignCallbackPriority. cogThreadManager ioTransferTimeslice]. (objectMemory splObj: foreignCallbackProcessSlot) ~= objectMemory nilObject] whileFalse: [cogThreadManager releaseVM. (count := count + 1) > 1000 ifTrue: [^-2]. cogThreadManager ioMilliSleep: 1]. vmThread := cogThreadManager unusedThreadInfo. "N.B. Keep the VM locked anonymously so that we reserve the non-nil ForeignCallbackProcess for this thread, avoiding the race between competing foreign callbacks. The acquireVMFor: in ownVM: will set the vmOwner to the actual index. So only unlock on failure." vmThread ifNil: [cogThreadManager releaseVM. ^-1]. cogThreadManager setVMOwner: vmThread index. vmThread state: CTMWantingOwnership; priority: foreignCallbackPriority. cogThreadManager registerVMThread: vmThread. ^self ownVM: vmThread index + OwnVMForeignThreadFlag! Item was changed: ----- Method: CoInterpreterMT>>preemptDisowningThread (in category 'vm scheduling') ----- preemptDisowningThread "Set the relevant state for disowningVMThread so that it can resume after being preempted and set disowningVMThread to nil to indicate preemption. N.B. This should only be sent from checkPreemptionOfDisowningThread. There are essentially four things to do. a) save the VM's notion of the current C stack pointers; these are pointers into a thread's stack and must be saved and restored in thread switch. b) save the VM's notion of the current Smalltalk execution point. This is simply the suspend half of a process switch that saves the current context in the current process. c) add the process to the thread's set of AWOL processes so that the scheduler won't try to run the process while the thread has disowned the VM. d) save the in-primitive VM state, newMethod and argumentCount ownVM: will restore the VM context as of disownVM: from the above when it finds it has been preempted." | activeProc activeContext preemptedThread | self assert: disowningVMThread notNil. self assert: (disowningVMThread state = CTMUnavailable or: [disowningVMThread state = CTMWantingOwnership]). + self assertCStackPointersBelongToDisowningThread. - self cCode: '' - inSmalltalk: - [| range | - range := self cStackRangeForThreadIndex: disowningVMThread index. - disowningVMThread index = cogThreadManager getVMOwner - ifTrue: [self assert: ((range includes: CStackPointer) and: [range includes: CFramePointer])] - ifFalse: [self deny: ((range includes: CStackPointer) or: [range includes: CFramePointer])]]. cogit recordEventTrace ifTrue: [self recordTrace: TracePreemptDisowningThread thing: (objectMemory integerObjectOf: disowningVMThread index) source: 0]. disowningVMThread cStackPointer: CStackPointer. disowningVMThread cFramePointer: CFramePointer. activeProc := self activeProcess. self assert: (objectMemory fetchPointer: MyListIndex ofObject: activeProc) = objectMemory nilObject. objectMemory storePointer: MyListIndex ofObject: activeProc withValue: (objectMemory splObj: ProcessInExternalCodeTag). "The instructionPointer must be pushed because the convention for inactive stack pages is that the instructionPointer is top of stack. We need to know if this primitive is called from machine code because the invariant that the return pc of an interpreter callee calling a machine code caller is ceReturnToInterpreterPC must be maintained." self push: instructionPointer. self externalWriteBackHeadFramePointers. activeContext := self ensureFrameIsMarried: framePointer SP: stackPointer. objectMemory storePointer: SuspendedContextIndex ofObject: activeProc withValue: activeContext. "Since pushing the awol process may realloc disowningVMThread we need to reassign. But since we're going to nil disowningVMThread anyway we can assign to a local." preemptedThread := cogThreadManager pushAWOLProcess: activeProc on: disowningVMThread. disowningVMThread := nil. preemptedThread priority: (self quickFetchInteger: PriorityIndex ofObject: activeProc). (self ownerIndexOfProcess: activeProc) = 0 ifTrue: [self setOwnerIndexOfProcess: activeProc to: preemptedThread index bind: false] ifFalse: [self assert: (self ownerIndexOfProcess: activeProc) = preemptedThread index]. preemptedThread newMethodOrNull: newMethod; argumentCount: argumentCount; primitiveFunctionPointer: primitiveFunctionPointer; inMachineCode: instructionPointer asUnsignedInteger <= objectMemory startOfMemory! Item was changed: ----- Method: CoInterpreterMT>>restoreVMStateFor:threadIndexAndFlags: (in category 'vm scheduling') ----- restoreVMStateFor: vmThread threadIndexAndFlags: threadIndexAndFlags "We've been preempted; we must restore state and update the threadId in our process, and may have to put the active process to sleep." | sched activeProc myProc | sched := self schedulerPointer. activeProc := objectMemory fetchPointer: ActiveProcessIndex ofObject: sched. (threadIndexAndFlags anyMask: OwnVMForeignThreadFlag) ifTrue: [self assert: foreignCallbackProcessSlot == ForeignCallbackProcess. myProc := objectMemory splObj: foreignCallbackProcessSlot. self assert: myProc ~= objectMemory nilObject. objectMemory splObj: foreignCallbackProcessSlot put: objectMemory nilObject] ifFalse: [myProc := cogThreadManager popAWOLProcess: vmThread]. self assert: activeProc ~= myProc. (activeProc ~= objectMemory nilObject and: [(objectMemory fetchPointer: MyListIndex ofObject: activeProc) = objectMemory nilObject]) ifTrue: [self putToSleep: activeProc yieldingIf: preemptionYields]. self assert: (objectMemory fetchPointer: MyListIndex ofObject: myProc) = (objectMemory splObj: ProcessInExternalCodeTag). objectMemory storePointer: ActiveProcessIndex ofObject: sched withValue: myProc; storePointerUnchecked: MyListIndex ofObject: myProc withValue: objectMemory nilObject. "Only unaffine if the process was affined at this level and did not become bound in the interim." ((threadIndexAndFlags anyMask: ProcessUnaffinedOnDisown) and: [(self isBoundProcess: myProc) not]) ifTrue: [self setOwnerIndexOfProcess: myProc to: 0 bind: false]. self initPrimCall. + "Bypass the no-offset stack depth check in the simulator's externalSetStackPageAndPointersForSuspendedContextOfProcess:" + super externalSetStackPageAndPointersForSuspendedContextOfProcess: myProc. + "We're in ownVM:, hence in a primitive, hence need to include the argument count" + (self isMachineCodeFrame: framePointer) ifTrue: + [self maybeCheckStackDepth: vmThread argumentCount + sp: stackPointer + pc: instructionPointer]. - self externalSetStackPageAndPointersForSuspendedContextOfProcess: myProc. "If this primitive is called from machine code maintain the invariant that the return pc of an interpreter callee calling a machine code caller is ceReturnToInterpreterPC." (vmThread inMachineCode and: [instructionPointer >= objectMemory startOfMemory]) ifTrue: [self iframeSavedIP: framePointer put: instructionPointer. instructionPointer := cogit ceReturnToInterpreterPC]. newMethod := vmThread newMethodOrNull. argumentCount := vmThread argumentCount. primitiveFunctionPointer := vmThread primitiveFunctionPointer. vmThread newMethodOrNull: nil. self cCode: '' inSmalltalk: [| range | range := self cStackRangeForThreadIndex: vmThread index. self assert: ((range includes: vmThread cStackPointer) and: [range includes: vmThread cFramePointer])]. self setCFramePointer: vmThread cFramePointer setCStackPointer: vmThread cStackPointer. self assert: newMethod notNil ! Item was added: + ----- Method: CoInterpreterMT>>saveVMStateFor:threadIndexAndFlags: (in category 'vm scheduling') ----- + saveVMStateFor: vmThread threadIndexAndFlags: threadIndexAndFlags + "Save the VM state for the disowning thread." + + vmThread + newMethodOrNull: newMethod; + argumentCount: argumentCount; + primitiveFunctionPointer: primitiveFunctionPointer; + inMachineCode: instructionPointer asUnsignedInteger <= objectMemory startOfMemory! Item was added: + ----- Method: CoInterpreterMT>>setCFramePointer: (in category 'simulation') ----- + setCFramePointer: cfp + "Set the CFramePointer, either on initialization (see initializeProcessorStack:) or from + machine code in ceCaptureCStackPointers. Unlike the superclass, CFramePointer + will be different for each thread using teh VM." + + ^CFramePointer := cfp! Item was added: + ----- Method: CoInterpreterMT>>setCStackPointer: (in category 'simulation') ----- + setCStackPointer: csp + "Set the CStackPointer, either on initialization (see initializeProcessorStack:) or from + machine code in ceCaptureCStackPointers. Unlike the superclass, CStackPointer + will be different for each thread using the VM." + + ^CStackPointer := csp! Item was changed: ----- Method: CoInterpreterMT>>threadSchedulingLoop: (in category 'vm scheduling') ----- threadSchedulingLoop: vmThread "Enter a loop attempting to run the VM with the highest priority process and blocking on the thread's OS semaphore when unable to run that process. This version is for simulation only, simulating the longjmp back to the real threadSchedulingLoopImplementation: through exception handling." + self initializeProcessorForThreadIndex: vmThread index. - self initializeProcessorStackForSimulation: vmThread. [([self threadSchedulingLoopImplementation: vmThread] on: ReenterThreadSchedulingLoop do: [:ex| ex return: ex returnValue]) = ReenterThreadSchedulingLoop] whileTrue! Item was changed: ----- Method: CoInterpreterMT>>threadSchedulingLoopImplementation: (in category 'vm scheduling') ----- threadSchedulingLoopImplementation: vmThread "Enter a loop attempting to run the VM with the highest priority process and blocking on the thread's OS semaphore when unable to run that process. We will return to this via threadSwitchIfNecessary:from: which is called in the middle of transferTo:from: once the active process has been stored in the scheduler." | attemptToRun | self _setjmp: reenterThreadSchedulingLoop. [self assert: vmThread state = CTMAssignableOrInVM. attemptToRun := false. (cogThreadManager vmOwnerIs: vmThread index) ifTrue: [attemptToRun := true] ifFalse: + [(cogit tryLockVMOwnerTo: vmThread index) ifTrue: - [(cogit tryLockVMToIndex: vmThread index) ifTrue: ["If relinquishing is true, then primitiveRelinquishProcessor has disowned the VM and only a returning call or callback should take ownership in that case." relinquishing ifTrue: [cogThreadManager releaseVM] ifFalse: [attemptToRun := true]]]. attemptToRun ifTrue: [self tryToExecuteSmalltalk: vmThread]. (cogThreadManager vmOwnerIs: vmThread index) ifFalse: [cogThreadManager waitForWork: vmThread]. true] whileTrue! Item was changed: ----- Method: CogThreadManager>>acquireVMFor: (in category 'public api') ----- acquireVMFor: threadIndex "Attempt to acquire the VM, eventually blocking until it becomes available. Spin until the maxWaitingPriority has been updated if it is lower than this thread's priority." | vmThread | self assert: threadIndex = self ioGetThreadLocalThreadIndex. vmThread := self vmThreadAt: threadIndex. self assert: (vmThread state = CTMUnavailable or: [vmThread state = CTMWantingOwnership]). + (cogit tryLockVMOwnerTo: threadIndex) ifFalse: - (cogit tryLockVMOwner: threadIndex) ifFalse: [vmThread state: CTMWantingOwnership. [(self vmOwnerIs: threadIndex) + or: [cogit tryLockVMOwnerTo: threadIndex]] whileFalse: - or: [cogit tryLockVMOwner: threadIndex]] whileFalse: [[coInterpreter getMaxWaitingPriority < vmThread priority] whileTrue: [coInterpreter waitingPriorityIsAtLeast: vmThread priority]. (self vmOwnerIs: threadIndex) ifFalse: [self ioWaitOnOSSemaphore: (self addressOf: vmThread osSemaphore)]]]. vmOSThread := vmThread osThread. vmThread state: CTMAssignableOrInVM. ^vmThread! Item was changed: ----- Method: CogThreadManager>>ensureRunningVMThread: (in category 'public api') ----- ensureRunningVMThread: vmIsRelinquishing "Called from checkVMOwnershipFromHeartbeat if the VM is unowned. Hence we are in the heartbeat thread. The race is against that thread owning the VM and against foreign callbacks." self willingVMThread ifNotNil: [:vmThread| "If the VM is relinquishing the processor then only schedule a thread if it has work to do." (vmIsRelinquishing and: [vmThread state ~= CTMWantingOwnership]) ifTrue: [^self]. + (cogit tryLockVMOwnerTo: vmThread index) ifFalse: "someone beat us to it..." - (cogit tryLockVMToIndex: vmThread index) ifFalse: "someone beat us to it..." [^self]. vmOSThread := vmThread osThread. "release the thread from its blocking loop" self ioSignalOSSemaphore: (self addressOf: vmThread osSemaphore). self ioTransferTimeslice. "self cCode: [coInterpreter print: 'ERVT signalled '; printNum: vmThread index; cr]." ^self]. "If the VM is relinquishing the processor then only schedule a thread if it has work to do (willingVMThread not nil above). If we have failed to allocate thread storage before there is no point continuing to try to do so. By this time we should have quite a few threads in the pool." (vmIsRelinquishing or: [memoryIsScarce]) ifTrue: [^self]. self unusedThreadInfo ifNotNil: [:vmThread| + (cogit tryLockVMOwnerTo: vmThread index) ifTrue: - (cogit tryLockVMOwner: vmThread index) ifTrue: [(self startThreadForThreadInfo: vmThread) ifFalse: [self releaseVM]]]! Item was changed: + ----- Method: CogVMSimulator>>assertCStackPointersBelongToCurrentThread (in category 'debug support') ----- - ----- Method: CogVMSimulator>>assertCStackPointersBelongToCurrentThread (in category 'multi-threading simulation switch') ----- assertCStackPointersBelongToCurrentThread + | ownerIndex range | + self assert: (ownerIndex := cogThreadManager getVMOwner) > 0. + self assert: ((range := self cStackRangeForThreadIndex: ownerIndex) includes: CFramePointer). + self assert: (range includes: CStackPointer)! - "This method includes or excludes CoInterpreterMT methods as required. - Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" - - ^self perform: #assertCStackPointersBelongToCurrentThread - withArguments: {} - inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was added: + ----- Method: CogVMSimulator>>assertCStackPointersBelongToDisowningThread (in category 'debug support') ----- + assertCStackPointersBelongToDisowningThread + | range | + self assert: disowningVMThread notNil. + self assert: ((range := self cStackRangeForThreadIndex: disowningVMThread index) includes: CFramePointer). + self assert: (range includes: CStackPointer)! Item was changed: + ----- Method: CogVMSimulator>>disownVM: (in category 'vm scheduling') ----- - ----- Method: CogVMSimulator>>disownVM: (in category 'multi-threading simulation switch') ----- disownVM: flags + "Override to insert a stack depth check." + self assert: self successful. + (self isMachineCodeFrame: framePointer) ifTrue: + [self maybeCheckStackDepth: argumentCount + sp: stackPointer + pc: instructionPointer]. - "This method includes or excludes CoInterpreterMT methods as required. - Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" - ^self perform: #disownVM: withArguments: {flags} inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was added: + ----- Method: CogVMSimulator>>setCFramePointer: (in category 'multi-threading simulation switch') ----- + setCFramePointer: cfp + "This method includes or excludes CoInterpreterMT methods as required. + Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" + + ^self perform: #setCFramePointer: + withArguments: {cfp} + inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was added: + ----- Method: CogVMSimulator>>setCStackPointer: (in category 'multi-threading simulation switch') ----- + setCStackPointer: csp + "This method includes or excludes CoInterpreterMT methods as required. + Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" + + ^self perform: #setCStackPointer: + withArguments: {csp} + inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was removed: - ----- Method: Cogit>>tryLockVMOwner: (in category 'multi-threading') ----- - tryLockVMOwner: value - - "ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner - variable with zero and the argument, setting vmOwner to value if it was - zero. It answers if the lock was zero and hence was acquired." - - processor abiMarshalArg0: value in: objectMemory memory. - ^[(self simulateLeafCallOf: ceTryLockVMOwner) ~= 0] ensure: - [processor abiUnmarshal: 1]! Item was added: + ----- Method: Cogit>>tryLockVMOwnerTo: (in category 'multi-threading') ----- + tryLockVMOwnerTo: value + + "ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner + variable with zero and the argument, setting vmOwner to value if it was + zero. It answers if the lock was zero and hence was acquired." + + processor abiMarshalArg0: value in: objectMemory memory. + ^[(self simulateLeafCallOf: ceTryLockVMOwner) ~= 0] ensure: + [processor abiUnmarshal: 1]! Item was changed: ----- Method: MessageNode>>asTranslatorNodeIn: (in category '*VMMaker-C translation') ----- asTranslatorNodeIn: aTMethod "Answer a TParseNode subclass equivalent of me" "selector is sometimes a Symbol, sometimes a SelectorNode!! On top of this, numArgs is needed due to the (truly grody) use of arguments as a place to store the extra expressions needed to generate code for in-line to:by:do:, etc. see below, where it is used. Expand super nodes in place. Elide sends of halt so that halts can be sprinkled through the simulator but will be eliminated from the generated C." | rcvrOrNil sel args ifNotNilBlock | rcvrOrNil := receiver ifNotNil: [receiver asTranslatorNodeIn: aTMethod]. (rcvrOrNil notNil and: [rcvrOrNil isVariable + and: [rcvrOrNil name = 'super' + and: [aTMethod selector == selector key]]]) ifTrue: - and: [rcvrOrNil name = 'super']]) ifTrue: [^aTMethod superExpansionNodeFor: selector key args: arguments]. sel := selector isSymbol ifTrue: [selector] ifFalse: [selector key]. sel == #halt ifTrue: [^rcvrOrNil]. (sel == #cCode:inSmalltalk: "extracting here rather than in translation allows inlining in the block." or: [sel == #cCode:]) ifTrue: [arguments first isBlockNode ifTrue: [| block | ^(block := arguments first asTranslatorNodeIn: aTMethod) statements size = 1 ifTrue: [block statements first] ifFalse: [block]]. (arguments first isLiteralNode and: [arguments first key isString and: [arguments first key isEmpty]]) ifTrue: [^arguments first asTranslatorNodeIn: aTMethod]]. args := arguments select: [:arg| arg notNil] thenCollect: [:arg| arg asTranslatorNodeIn: aTMethod]. (sel = #to:by:do: and: [arguments size = 7 and: [(arguments at: 7) notNil]]) ifTrue: ["Restore limit expr that got moved by transformToDo:" args := {(arguments at: 7) value asTranslatorNodeIn: aTMethod. args second. args third. "add the limit var as a hidden extra argument; we may need it later" TVariableNode new setName: arguments first key}]. (sel == #ifTrue:ifFalse: and: [arguments first isJust: NodeNil]) ifTrue: [sel := #ifFalse:. args := {args last}]. (sel == #ifTrue:ifFalse: and: [arguments last isJust: NodeNil]) ifTrue: [sel := #ifTrue:. args := {args first}]. (sel == #ifFalse:ifTrue: and: [arguments first isJust: NodeNil]) ifTrue: [sel := #ifTrue:. args := {args last}]. (sel == #ifFalse:ifTrue: and: [arguments last isJust: NodeNil]) ifTrue: [sel := #ifTrue:. args := {args first}]. ((sel == #ifFalse: or: [sel == #or:]) and: [arguments size = 2 and: [(arguments at: 2) notNil]]) ifTrue: ["Restore argument block that got moved by transformOr: or transformIfFalse:" args := {(arguments at: 2) asTranslatorNodeIn: aTMethod}]. (args size > sel numArgs and: [sel ~~ #to:by:do:]) ifTrue: "to:by:do: has iLimiT hidden in last arg" ["prune the extra blocks left by ifTrue:, ifFalse:, and: & or:" self assert: args size - sel numArgs = 1. self assert: (args last isStmtList and: [args last statements size = 1 and: [(args last statements first isVariable or: [args last statements first isConstant]) and: [#('nil' true false) includes: args last statements first nameOrValue]]]). args := args first: sel numArgs]. "For the benefit of later passes, e.g. value: inlining, transform e ifNotNil: [:v| ...] into v := e. v ifNotNil: [...], which in fact means transforming (v := e) ifTrue: [:v|...] into v := e. v ifTrue: [...]." ((sel == #ifTrue: or: [sel == #ifFalse: or: [sel == #ifTrue:ifFalse: or: [sel == #ifFalse:ifTrue:]]]) and: [receiver notNil and: [receiver isAssignmentEqualsEqualsNil and: [(ifNotNilBlock := args detect: [:arg| arg isStmtList and: [arg args size = 1]] ifNone: []) notNil]]]) ifTrue: [ifNotNilBlock setArguments: #(). ^TStmtListNode new setArguments: #() statements: { receiver receiver asTranslatorNodeIn: aTMethod. TSendNode new setSelector: sel receiver: (TSendNode new setSelector: #== receiver: (receiver receiver variable asTranslatorNodeIn: aTMethod) arguments: {receiver arguments first asTranslatorNodeIn: aTMethod}) arguments: args }]. ((CCodeGenerator isVarargsSelector: sel) and: [args last isCollection and: [args last isSequenceable]]) ifTrue: [args := args allButLast, args last]. ^TSendNode new setSelector: sel receiver: rcvrOrNil arguments: args! Item was changed: ----- Method: StackInterpreter>>printCallStackOf: (in category 'debug printing') ----- printCallStackOf: aContextOrProcessOrFrame | context | (stackPages couldBeFramePointer: aContextOrProcessOrFrame) ifTrue: [^self printCallStackFP: (self cCoerceSimple: aContextOrProcessOrFrame to: #'char *')]. + aContextOrProcessOrFrame = self activeProcess ifTrue: + [^self printCallStackOf: (self cCode: [framePointer] inSmalltalk: [self headFramePointer])]. (self couldBeProcess: aContextOrProcessOrFrame) ifTrue: [^self printCallStackOf: (objectMemory fetchPointer: SuspendedContextIndex ofObject: aContextOrProcessOrFrame)]. context := aContextOrProcessOrFrame. [context = objectMemory nilObject] whileFalse: [(self isMarriedOrWidowedContext: context) ifTrue: [(self checkIsStillMarriedContext: context currentFP: framePointer) ifFalse: [self shortPrintContext: context. ^nil]. context := self shortReversePrintFrameAndCallers: (self frameOfMarriedContext: context)] ifFalse: [context := self printContextCallStackOf: context]]! Item was changed: ----- Method: StackInterpreter>>printStackCallStackOf: (in category 'debug printing') ----- printStackCallStackOf: aContextOrProcessOrFrame | theFP context | (self cCode: [false] "In the stack simulator, frame pointers are negative which upsets addressCouldBeObj:" inSmalltalk: [stackPages couldBeFramePointer: aContextOrProcessOrFrame]) ifFalse: [(objectMemory addressCouldBeObj: aContextOrProcessOrFrame) ifTrue: [((objectMemory isContext: aContextOrProcessOrFrame) and: [self checkIsStillMarriedContext: aContextOrProcessOrFrame currentFP: nil]) ifTrue: [^self printStackCallStackOf: (self frameOfMarriedContext: aContextOrProcessOrFrame) asInteger]. + aContextOrProcessOrFrame = self activeProcess ifTrue: + [^self printStackCallStackOf: (self cCode: [framePointer] inSmalltalk: [self headFramePointer])]. (self couldBeProcess: aContextOrProcessOrFrame) ifTrue: [^self printCallStackOf: (objectMemory fetchPointer: SuspendedContextIndex ofObject: aContextOrProcessOrFrame)]. ^nil]]. theFP := aContextOrProcessOrFrame asVoidPointer. [context := self shortReversePrintFrameAndCallers: theFP. ((self isMarriedOrWidowedContext: context) and: [theFP := self frameOfMarriedContext: context. self checkIsStillMarriedContext: context currentFP: theFP]) ifFalse: [^nil]] repeat! From commits at source.squeak.org Tue Nov 10 00:54:38 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 00:54:38 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2873.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2873.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2873 Author: eem Time: 9 November 2020, 4:54:28.78066 pm UUID: 0d03b37a-cec9-44cc-b9b8-abace901cd20 Ancestors: VMMaker.oscog-eem.2872 COGMTVM: The Slang change to super sends won't work. Use a clumsier approach. =============== Diff against VMMaker.oscog-eem.2872 =============== Item was changed: ----- Method: CoInterpreterMT>>restoreVMStateFor:threadIndexAndFlags: (in category 'vm scheduling') ----- restoreVMStateFor: vmThread threadIndexAndFlags: threadIndexAndFlags "We've been preempted; we must restore state and update the threadId in our process, and may have to put the active process to sleep." | sched activeProc myProc | sched := self schedulerPointer. activeProc := objectMemory fetchPointer: ActiveProcessIndex ofObject: sched. (threadIndexAndFlags anyMask: OwnVMForeignThreadFlag) ifTrue: [self assert: foreignCallbackProcessSlot == ForeignCallbackProcess. myProc := objectMemory splObj: foreignCallbackProcessSlot. self assert: myProc ~= objectMemory nilObject. objectMemory splObj: foreignCallbackProcessSlot put: objectMemory nilObject] ifFalse: [myProc := cogThreadManager popAWOLProcess: vmThread]. self assert: activeProc ~= myProc. (activeProc ~= objectMemory nilObject and: [(objectMemory fetchPointer: MyListIndex ofObject: activeProc) = objectMemory nilObject]) ifTrue: [self putToSleep: activeProc yieldingIf: preemptionYields]. self assert: (objectMemory fetchPointer: MyListIndex ofObject: myProc) = (objectMemory splObj: ProcessInExternalCodeTag). objectMemory storePointer: ActiveProcessIndex ofObject: sched withValue: myProc; storePointerUnchecked: MyListIndex ofObject: myProc withValue: objectMemory nilObject. "Only unaffine if the process was affined at this level and did not become bound in the interim." ((threadIndexAndFlags anyMask: ProcessUnaffinedOnDisown) and: [(self isBoundProcess: myProc) not]) ifTrue: [self setOwnerIndexOfProcess: myProc to: 0 bind: false]. self initPrimCall. + self cCode: + [self externalSetStackPageAndPointersForSuspendedContextOfProcess: myProc] + inSmalltalk: + ["Bypass the no-offset stack depth check in the simulator's externalSetStackPageAndPointersForSuspendedContextOfProcess:" + super externalSetStackPageAndPointersForSuspendedContextOfProcess: myProc. + "We're in ownVM:, hence in a primitive, hence need to include the argument count" + (self isMachineCodeFrame: framePointer) ifTrue: + [self maybeCheckStackDepth: vmThread argumentCount + sp: stackPointer + pc: instructionPointer]]. - "Bypass the no-offset stack depth check in the simulator's externalSetStackPageAndPointersForSuspendedContextOfProcess:" - super externalSetStackPageAndPointersForSuspendedContextOfProcess: myProc. - "We're in ownVM:, hence in a primitive, hence need to include the argument count" - (self isMachineCodeFrame: framePointer) ifTrue: - [self maybeCheckStackDepth: vmThread argumentCount - sp: stackPointer - pc: instructionPointer]. "If this primitive is called from machine code maintain the invariant that the return pc of an interpreter callee calling a machine code caller is ceReturnToInterpreterPC." (vmThread inMachineCode and: [instructionPointer >= objectMemory startOfMemory]) ifTrue: [self iframeSavedIP: framePointer put: instructionPointer. instructionPointer := cogit ceReturnToInterpreterPC]. newMethod := vmThread newMethodOrNull. argumentCount := vmThread argumentCount. primitiveFunctionPointer := vmThread primitiveFunctionPointer. vmThread newMethodOrNull: nil. self cCode: '' inSmalltalk: [| range | range := self cStackRangeForThreadIndex: vmThread index. self assert: ((range includes: vmThread cStackPointer) and: [range includes: vmThread cFramePointer])]. self setCFramePointer: vmThread cFramePointer setCStackPointer: vmThread cStackPointer. self assert: newMethod notNil ! Item was changed: ----- Method: MessageNode>>asTranslatorNodeIn: (in category '*VMMaker-C translation') ----- asTranslatorNodeIn: aTMethod "Answer a TParseNode subclass equivalent of me" "selector is sometimes a Symbol, sometimes a SelectorNode!! On top of this, numArgs is needed due to the (truly grody) use of arguments as a place to store the extra expressions needed to generate code for in-line to:by:do:, etc. see below, where it is used. Expand super nodes in place. Elide sends of halt so that halts can be sprinkled through the simulator but will be eliminated from the generated C." | rcvrOrNil sel args ifNotNilBlock | rcvrOrNil := receiver ifNotNil: [receiver asTranslatorNodeIn: aTMethod]. (rcvrOrNil notNil and: [rcvrOrNil isVariable + and: [rcvrOrNil name = 'super']]) ifTrue: - and: [rcvrOrNil name = 'super' - and: [aTMethod selector == selector key]]]) ifTrue: [^aTMethod superExpansionNodeFor: selector key args: arguments]. sel := selector isSymbol ifTrue: [selector] ifFalse: [selector key]. sel == #halt ifTrue: [^rcvrOrNil]. (sel == #cCode:inSmalltalk: "extracting here rather than in translation allows inlining in the block." or: [sel == #cCode:]) ifTrue: [arguments first isBlockNode ifTrue: [| block | ^(block := arguments first asTranslatorNodeIn: aTMethod) statements size = 1 ifTrue: [block statements first] ifFalse: [block]]. (arguments first isLiteralNode and: [arguments first key isString and: [arguments first key isEmpty]]) ifTrue: [^arguments first asTranslatorNodeIn: aTMethod]]. args := arguments select: [:arg| arg notNil] thenCollect: [:arg| arg asTranslatorNodeIn: aTMethod]. (sel = #to:by:do: and: [arguments size = 7 and: [(arguments at: 7) notNil]]) ifTrue: ["Restore limit expr that got moved by transformToDo:" args := {(arguments at: 7) value asTranslatorNodeIn: aTMethod. args second. args third. "add the limit var as a hidden extra argument; we may need it later" TVariableNode new setName: arguments first key}]. (sel == #ifTrue:ifFalse: and: [arguments first isJust: NodeNil]) ifTrue: [sel := #ifFalse:. args := {args last}]. (sel == #ifTrue:ifFalse: and: [arguments last isJust: NodeNil]) ifTrue: [sel := #ifTrue:. args := {args first}]. (sel == #ifFalse:ifTrue: and: [arguments first isJust: NodeNil]) ifTrue: [sel := #ifTrue:. args := {args last}]. (sel == #ifFalse:ifTrue: and: [arguments last isJust: NodeNil]) ifTrue: [sel := #ifTrue:. args := {args first}]. ((sel == #ifFalse: or: [sel == #or:]) and: [arguments size = 2 and: [(arguments at: 2) notNil]]) ifTrue: ["Restore argument block that got moved by transformOr: or transformIfFalse:" args := {(arguments at: 2) asTranslatorNodeIn: aTMethod}]. (args size > sel numArgs and: [sel ~~ #to:by:do:]) ifTrue: "to:by:do: has iLimiT hidden in last arg" ["prune the extra blocks left by ifTrue:, ifFalse:, and: & or:" self assert: args size - sel numArgs = 1. self assert: (args last isStmtList and: [args last statements size = 1 and: [(args last statements first isVariable or: [args last statements first isConstant]) and: [#('nil' true false) includes: args last statements first nameOrValue]]]). args := args first: sel numArgs]. "For the benefit of later passes, e.g. value: inlining, transform e ifNotNil: [:v| ...] into v := e. v ifNotNil: [...], which in fact means transforming (v := e) ifTrue: [:v|...] into v := e. v ifTrue: [...]." ((sel == #ifTrue: or: [sel == #ifFalse: or: [sel == #ifTrue:ifFalse: or: [sel == #ifFalse:ifTrue:]]]) and: [receiver notNil and: [receiver isAssignmentEqualsEqualsNil and: [(ifNotNilBlock := args detect: [:arg| arg isStmtList and: [arg args size = 1]] ifNone: []) notNil]]]) ifTrue: [ifNotNilBlock setArguments: #(). ^TStmtListNode new setArguments: #() statements: { receiver receiver asTranslatorNodeIn: aTMethod. TSendNode new setSelector: sel receiver: (TSendNode new setSelector: #== receiver: (receiver receiver variable asTranslatorNodeIn: aTMethod) arguments: {receiver arguments first asTranslatorNodeIn: aTMethod}) arguments: args }]. ((CCodeGenerator isVarargsSelector: sel) and: [args last isCollection and: [args last isSequenceable]]) ifTrue: [args := args allButLast, args last]. ^TSendNode new setSelector: sel receiver: rcvrOrNil arguments: args! From commits at source.squeak.org Tue Nov 10 04:03:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 04:03:09 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2874.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2874.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2874 Author: eem Time: 9 November 2020, 8:03:01.884433 pm UUID: 0bad3d2d-1051-4c4f-a77e-c9525ed39079 Ancestors: VMMaker.oscog-eem.2873 COGMTVM: Nuke the old V3 GC lock hack. Restore disownCount cuz aio.c uses it (to reduce noise when using the repl image). Use DisownVMForThreading as the disown flag in primitiveFileReadPinningAndDisowning rather than DisownVMForFFICall because this flag is used for the fail-on-ffi-exceptin machinery. Get the Vm to compile, making sure funcitons used in asserts are not always inlined (& hence inlined away). =============== Diff against VMMaker.oscog-eem.2873 =============== Item was changed: CoInterpreterPrimitives subclass: #CoInterpreterMT + instanceVariableNames: 'cogThreadManager checkThreadActivation maxWaitingPriority foreignCallbackPriority deferThreadSwitch disowningVMThread disownCount foreignCallbackProcessSlot willNotThreadWarnCount activeProcessAffined relinquishing processHasThreadId noThreadingOfGUIThread reenterThreadSchedulingLoop' - instanceVariableNames: 'cogThreadManager checkThreadActivation maxWaitingPriority foreignCallbackPriority deferThreadSwitch disowningVMThread foreignCallbackProcessSlot willNotThreadWarnCount activeProcessAffined relinquishing processHasThreadId noThreadingOfGUIThread reenterThreadSchedulingLoop' classVariableNames: 'DisownFlagsShift DisownVMForProcessorRelinquish LockGUIThreadFlag LockGUIThreadShift OwnVMForeignThreadFlag ProcessUnaffinedOnDisown ReturnToThreadSchedulingLoop VMAlreadyOwnedHenceDoNotDisown' poolDictionaries: 'VMThreadingConstants' category: 'VMMaker-Multithreading'! Item was changed: ----- Method: CoInterpreterMT class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator aCCodeGenerator addHeaderFile:'"sqAtomicOps.h"'. "For THRLOG" aCCodeGenerator vmClass declareInterpreterVersionIn: aCCodeGenerator defaultName: 'Cog MT'. aCCodeGenerator + var: #disowningVMThread type: #'CogVMThread *'. + aCCodeGenerator var: #reenterThreadSchedulingLoop type: 'jmp_buf'.! - var: #disowningVMThread type: #'CogVMThread *'! Item was changed: ----- Method: CoInterpreterMT>>assertCStackPointersBelongToCurrentThread (in category 'simulation') ----- assertCStackPointersBelongToCurrentThread + "simulation only" + | ownerIndex range | + self assert: (ownerIndex := cogThreadManager getVMOwner) > 0. + self assert: ((range := self cStackRangeForThreadIndex: ownerIndex) includes: CFramePointer). + self assert: (range includes: CStackPointer)! - - | range | - range := self cStackRangeForCurrentThread. - self assert: ((range includes: CStackPointer) - and: [range includes: CFramePointer])! Item was added: + ----- Method: CoInterpreterMT>>assertCStackPointersBelongToDisowningThread (in category 'debug support') ----- + assertCStackPointersBelongToDisowningThread + "simulation only" + | range | + self assert: disowningVMThread notNil. + self assert: ((range := self cStackRangeForThreadIndex: disowningVMThread index) includes: CFramePointer). + self assert: (range includes: CStackPointer)! Item was changed: ----- Method: CoInterpreterMT>>disownVM: (in category 'vm scheduling') ----- disownVM: flags "Release the VM to other threads and answer the current thread's index. Currently valid flags: - DisownVMLockOutFullGC - prevent fullGCs while this thread disowns the VM DisownVMForFFICall - informs the VM that it is entering an FFI call + DisownVMForThreading - informs the VM that it is entering code during which threading should be permitted - DisownVMForThreading - informs the VM that it is entering an FFI call etc during which threading should be permitted OwnVMForeignThreadFlag - indicates lowest-level entry from a foreign thread - not to be used explicitly by clients - only set by ownVMFromUnidentifiedThread VMAlreadyOwnedHenceDoNotDisown - indicates an ownVM from a callback was made when the vm was still owned. - not to be used explicitly by clients - only set by ownVMFromUnidentifiedThread This is the entry-point for plugins and primitives that wish to release the VM while performing some operation that may potentially block, and for callbacks returning back to some blocking operation. If this thread does not reclaim the VM before- hand then when the next heartbeat occurs the thread manager will schedule a thread to acquire the VM which may start running the VM in place of this thread. N.B. Most of the state needed to resume after preemption is set in preemptDisowningThread." | vmThread result | self assert: self successful. cogit recordEventTrace ifTrue: [self recordTrace: TraceDisownVM thing: (objectMemory integerObjectOf: flags) source: 0]. processHasThreadId ifFalse: [willNotThreadWarnCount < 10 ifTrue: [self print: 'warning: VM parameter 48 indicates Process doesn''t have threadId; VM will not thread'; cr. willNotThreadWarnCount := willNotThreadWarnCount + 1]]. vmThread := cogThreadManager currentVMThread. (flags anyMask: VMAlreadyOwnedHenceDoNotDisown) ifTrue: [disowningVMThread := vmThread. vmThread state: CTMUnavailable. ^0]. self assertCStackPointersBelongToCurrentThread. (flags anyMask: DisownVMForProcessorRelinquish) ifTrue: [| proc | (proc := objectMemory splObj: foreignCallbackProcessSlot) ~= objectMemory nilObject ifTrue: [foreignCallbackPriority := self quickFetchInteger: PriorityIndex ofObject: proc]. relinquishing := true. self sqLowLevelMFence]. - (flags anyMask: DisownVMLockOutFullGC) ifTrue: - [objectMemory incrementFullGCLock]. (noThreadingOfGUIThread and: [self inGUIThread]) ifTrue: [^vmThread index + LockGUIThreadFlag + (activeProcessAffined ifTrue: [0] ifFalse: [ProcessUnaffinedOnDisown]) + (flags << DisownFlagsShift)]. + disownCount := disownCount + 1. disowningVMThread := vmThread. "self cr; cr; print: 'disownVM Csp: '; printHex: vmThread cStackPointer; cr. (0 to: 16 by: 4) do: [:offset| self print: ' *(esp+'; printNum: offset; print: ': '; printHex: (stackPages longAt: cogit processor sp + offset); cr]. cogit processor printIntegerRegistersOn: Transcript." "OwnVMForeignThreadFlag indicates lowest-level of entry by a foreign thread. If that's where we are then release the vmThread. Otherwise indicate the vmThread is off doing something outside of the VM." (flags anyMask: OwnVMForeignThreadFlag) ifTrue: ["I don't think this is quite right. Josh's use case is creating some foreign thread and then registering it with the VM. That's not the same as binding a process to a foreign thread given that the foreign callback process is about to terminate anyway (it is returning from a callback here). So do we need an additional concept, that of a vmThread being either of the set known to the VM or floating?" self flag: 'issue with registering foreign threads with the VM'. (self isBoundProcess: self activeProcess) ifFalse: [cogThreadManager unregisterVMThread: vmThread]] ifFalse: [vmThread state: CTMUnavailable]. result := vmThread index + (activeProcessAffined ifTrue: [0] ifFalse: [ProcessUnaffinedOnDisown]) + (flags << DisownFlagsShift). cogThreadManager releaseVM. ^result! Item was removed: - ----- Method: CoInterpreterMT>>enterSmalltalkExecutiveFromCallback (in category 'callback support') ----- - enterSmalltalkExecutiveFromCallback - - self threadSchedulingLoop: cogThreadManager currentVMThread! Item was changed: ----- Method: CoInterpreterMT>>initialEnterSmalltalkExecutive (in category 'initialization') ----- initialEnterSmalltalkExecutive "Main entry-point into the interpreter at system start-up." "Ensure that the myList of the activeProcess is nil. Needed to load old images which don't nil myList in transferTo:{from:}" objectMemory storePointerUnchecked: MyListIndex ofObject: self activeProcess withValue: objectMemory nilObject. cogThreadManager startThreadSubsystem. + self threadSchedulingLoop: (cogThreadManager vmThreadAt: 1). + "NOTREACHED. The following is to fool Slang" + self threadSchedulingLoopImplementation: cogThreadManager currentVMThread! - self threadSchedulingLoop: (cogThreadManager vmThreadAt: 1)! Item was changed: ----- Method: CoInterpreterMT>>initialize (in category 'initialization') ----- initialize super initialize. relinquishing := checkThreadActivation := deferThreadSwitch := false. + foreignCallbackPriority := maxWaitingPriority := disownCount := willNotThreadWarnCount := 0! - foreignCallbackPriority := maxWaitingPriority := willNotThreadWarnCount := 0! Item was changed: ----- Method: CoInterpreterMT>>ownVM: (in category 'vm scheduling') ----- ownVM: threadIndexAndFlags "This is the entry-point for plugins and primitives that wish to reacquire the VM after having released it via disownVM or callbacks that want to acquire it without knowing their ownership status. This call will block until the VM is owned by the current thread or an error occurs. The argument should be the value answered by disownVM, or 0 for callbacks that don't know if they have disowned or not. This is both an optimization to avoid having to query thread- local storage for the current thread's index (since it can easily keep it in some local variable), and a record of when an unbound process becomes affined to a thread for the dynamic extent of some operation. Answer 0 if the current thread is known to the VM (and on return owns the VM). Answer 1 if the current thread is unknown to the VM and takes ownership. Answer -1 if the current thread is unknown to the VM and fails to take ownership." | threadIndex flags vmThread | threadIndexAndFlags = 0 ifTrue: [^self ownVMFromUnidentifiedThread]. threadIndex := threadIndexAndFlags bitAnd: ThreadIdMask. flags := threadIndexAndFlags >> DisownFlagsShift. (flags anyMask: DisownVMForProcessorRelinquish) ifTrue: ["Presumably we have nothing to do; this primitive is typically called from the background process. So we should /not/ try and activate any threads in the pool; they will waste cycles finding there is no runnable process, and will cause a VM abort if no runnable process is found. But we /do/ want to allow FFI calls that have completed, or callbacks a chance to get into the VM; they do have something to do. DisownVMForProcessorRelinquish indicates this." relinquishing := false. self sqLowLevelMFence]. - (flags anyMask: DisownVMLockOutFullGC) ifTrue: - [objectMemory decrementFullGCLock]. - (threadIndexAndFlags anyMask: LockGUIThreadFlag) ifTrue: [self assert: (noThreadingOfGUIThread and: [self inGUIThread]). self assert: disowningVMThread isNil. cogit recordEventTrace ifTrue: [self recordTrace: TraceOwnVM thing: ConstZero source: 0]. ^0]. vmThread := cogThreadManager acquireVMFor: threadIndex. + disownCount := disownCount - 1. disowningVMThread ifNotNil: [vmThread = disowningVMThread ifTrue: [self cCode: '' inSmalltalk: [| range | range := self cStackRangeForThreadIndex: threadIndex. self assert: ((range includes: CStackPointer) and: [range includes: CFramePointer])]. self assert: self successful. self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. disowningVMThread := nil. cogit recordEventTrace ifTrue: [self recordTrace: TraceOwnVM thing: ConstOne source: 0]. ^0]. "if not preempted we're done." self preemptDisowningThread]. "We've been preempted; we must restore state and update the threadId in our process, and may have to put the active process to sleep." self restoreVMStateFor: vmThread threadIndexAndFlags: threadIndexAndFlags. cogit recordEventTrace ifTrue: [self recordTrace: TraceOwnVM thing: ConstTwo source: 0]. ^threadIndexAndFlags bitAnd: OwnVMForeignThreadFlag! Item was changed: ----- Method: CogThreadManager>>vmIsOwned (in category 'public api-testing') ----- vmIsOwned "Answer if the vm is owned" + - self sqLowLevelMFence. ^vmOwner > 0! Item was changed: ----- Method: CogThreadManager>>vmOwnerIs: (in category 'public api-testing') ----- vmOwnerIs: index "Test if the vmOwner is index." + - self sqLowLevelMFence. ^vmOwner = index! Item was removed: - ----- Method: CogVMSimulator>>assertCStackPointersBelongToCurrentThread (in category 'debug support') ----- - assertCStackPointersBelongToCurrentThread - | ownerIndex range | - self assert: (ownerIndex := cogThreadManager getVMOwner) > 0. - self assert: ((range := self cStackRangeForThreadIndex: ownerIndex) includes: CFramePointer). - self assert: (range includes: CStackPointer)! Item was removed: - ----- Method: CogVMSimulator>>assertCStackPointersBelongToDisowningThread (in category 'debug support') ----- - assertCStackPointersBelongToDisowningThread - | range | - self assert: disowningVMThread notNil. - self assert: ((range := self cStackRangeForThreadIndex: disowningVMThread index) includes: CFramePointer). - self assert: (range includes: CStackPointer)! Item was removed: - ----- Method: CogVMSimulator>>enterSmalltalkExecutiveFromCallback (in category 'multi-threading simulation switch') ----- - enterSmalltalkExecutiveFromCallback - "This method includes or excludes CoInterpreterMT methods as required. - Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" - - ^self perform: #enterSmalltalkExecutiveFromCallback - withArguments: {} - inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was changed: ----- Method: FilePlugin>>primitiveFileReadPinningAndDisowning (in category 'file primitives') ----- primitiveFileReadPinningAndDisowning "This version of primitiveFileRead is for garbage collectors that support pinning and the multi-threaded VM. It actually does the own/disown dance." | count startIndex array file slotSize elementSize bytesRead threadIndexAndFlags wasPinned | count := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 0). startIndex := interpreterProxy positiveMachineIntegerValueOf: (interpreterProxy stackValue: 1). array := interpreterProxy stackValue: 2. file := self fileValueOf: (interpreterProxy stackValue: 3). (interpreterProxy failed "buffer can be any indexable words or bytes object except CompiledMethod" or: [(interpreterProxy isWordsOrBytes: array) not]) ifTrue: [^interpreterProxy primitiveFailFor: PrimErrBadArgument]. slotSize := interpreterProxy slotSizeOf: array. (startIndex >= 1 and: [startIndex + count - 1 <= slotSize]) ifFalse: [^interpreterProxy primitiveFailFor: PrimErrBadIndex]. (wasPinned := interpreterProxy isPinned: array) ifFalse: [array := interpreterProxy pinObject: array]. + threadIndexAndFlags := interpreterProxy disownVM: DisownVMForThreading. - threadIndexAndFlags := interpreterProxy disownVM: DisownVMForFFICall. "Note: adjust startIndex for zero-origin byte indexing" elementSize := slotSize = 0 ifTrue: [1] ifFalse: [(interpreterProxy byteSizeOf: array) // slotSize]. bytesRead := self sqFile: file Read: count * elementSize Into: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *') At: startIndex - 1 * elementSize. interpreterProxy ownVM: threadIndexAndFlags. wasPinned ifFalse: [interpreterProxy unpinObject: array]. interpreterProxy failed ifFalse: [interpreterProxy methodReturnInteger: bytesRead // elementSize] "answer # of elements read"! Item was changed: ----- Method: InterpreterPrimitives>>primitiveFullGC (in category 'memory space primitives') ----- primitiveFullGC "Do a full garbage collection. In SqueakV3ObjectMemory, answer the number of bytes available (including swap space if dynamic memory management is supported). In Spur, answer the size of the largest free chunk." objectMemory hasSpurMemoryManagerAPI ifTrue: + [self methodReturnInteger: objectMemory fullGC. - [self pop: 1 thenPushInteger: objectMemory fullGC. ^self]. - objectMemory fullGCLock > 0 ifTrue: - [self primitiveFailFor: PrimErrInappropriate. - ^self]. objectMemory incrementalGC. "maximimize space for forwarding table" objectMemory fullGC. + self methodReturnInteger: (objectMemory bytesLeft: true)! - self pop: 1 thenPushInteger: (objectMemory bytesLeft: true)! Item was changed: ObjectMemory subclass: #NewObjectMemory + instanceVariableNames: 'coInterpreter freeStart reserveStart scavengeThreshold needGCFlag edenBytes checkForLeaks statGCEndUsecs heapMap' - instanceVariableNames: 'coInterpreter freeStart reserveStart scavengeThreshold needGCFlag fullGCLock edenBytes checkForLeaks statGCEndUsecs heapMap' classVariableNames: '' poolDictionaries: '' category: 'VMMaker-Interpreter'! !NewObjectMemory commentStamp: '' prior: 0! I am a refinement of ObjectMemory that eliminates the need for pushRemappableOop:/popRemappableOop in the interpreter proper. Certain primitives that do major allocation may still want to provoke a garbage collection and hence may still need to remap private pointers. But the interpreter subclass of this class does not have to provided it reserves sufficient space for it to make progress to the next scavenge point (send or backward branch).! Item was removed: - ----- Method: NewObjectMemory>>decrementFullGCLock (in category 'interpreter access') ----- - decrementFullGCLock - self assert: fullGCLock > 0. - (fullGCLock := fullGCLock - 1) < 0 ifTrue: - [fullGCLock := 0]! Item was changed: ----- Method: NewObjectMemory>>fullGC (in category 'garbage collection') ----- fullGC "Do a mark/sweep garbage collection of the entire object memory. Free inaccessible objects but do not move them." - fullGCLock > 0 ifTrue: - [self warning: 'aborting fullGC because fullGCLock > 0'. - ^self]. self runLeakCheckerFor: GCModeFull. coInterpreter preGCAction: GCModeFull. needGCFlag := false. gcStartUsecs := self ioUTCMicrosecondsNow. statSweepCount := statMarkCount := statMkFwdCount := statCompMoveCount := 0. self clearRootsTable. self initWeakTableForIncrementalGC: false. youngStart := self startOfMemory. "process all of memory" self markPhase: true. "Sweep phase returns the number of survivors. Use the up-to-date version instead the one from startup." totalObjectCount := self sweepPhaseForFullGC. self runLeakCheckerFor: GCModeFull. self fullCompaction. statFullGCs := statFullGCs + 1. statGCEndUsecs := self ioUTCMicrosecondsNow. statFullGCUsecs := statFullGCUsecs + (statGCEndUsecs - gcStartUsecs). coInterpreter capturePendingFinalizationSignals. youngStart := freeStart. "reset the young object boundary" self attemptToShrink. coInterpreter postGCAction: GCModeFull. self runLeakCheckerFor: GCModeFull! Item was removed: - ----- Method: NewObjectMemory>>fullGCLock (in category 'accessing') ----- - fullGCLock - ^fullGCLock! Item was removed: - ----- Method: NewObjectMemory>>incrementFullGCLock (in category 'interpreter access') ----- - incrementFullGCLock - fullGCLock := fullGCLock + 1! Item was changed: ----- Method: NewObjectMemory>>initialize (in category 'initialization') ----- initialize "Initialize NewObjectMemory when simulating the VM inside Smalltalk." super initialize. + checkForLeaks := 0. - checkForLeaks := fullGCLock := 0. needGCFlag := false. heapMap := CogCheck32BitHeapMap new! Item was removed: - ----- Method: SpurMemoryManager>>fullGCLock (in category 'gc - global') ----- - fullGCLock - "Spur never has a need to lock GC because it does not move pinned objects." - ^0! Item was changed: ----- Method: StackInterpreter class>>initializeMiscConstants (in category 'initialization') ----- initializeMiscConstants super initializeMiscConstants. STACKVM := true. "These flags function to identify a GC operation, or to specify what operations the leak checker should be run for." GCModeFull := 1. "stop-the-world global GC" GCModeNewSpace := 2. "Spur's scavenge, or V3's incremental" GCModeIncremental := 4. "incremental global gc (Dijkstra tri-colour marking); as yet unimplemented" GCModeBecome := 8. "v3 post-become sweeping/Spur forwarding" GCModeImageSegment := 16. "just a flag for leak checking image segments" GCModeFreeSpace := 32. "just a flag for leak checking free space; Spur only" GCCheckPrimCall := 64. "just a flag for leak checking external primitive calls" StackPageTraceInvalid := -1. StackPageUnreached := 0. StackPageReachedButUntraced := 1. StackPageTraced := 2. DumpStackOnLowSpace := 0. MillisecondClockMask := 16r1FFFFFFF. "Note: The external primitive table should actually be dynamically sized but for the sake of inferior platforms (e.g., Mac :-) who cannot allocate memory in any reasonable way, we keep it static (and cross our fingers...)" MaxExternalPrimitiveTableSize := 4096. "entries" MaxJumpBuf := 32. "max. callback depth" FailImbalancedPrimitives := InitializationOptions at: #FailImbalancedPrimitives ifAbsentPut: [true]. EnforceAccessControl := InitializationOptions at: #EnforceAccessControl ifAbsent: [true]. ReturnToInterpreter := 1. "setjmp/longjmp code." + "Because of a hack with callbacks in the non-threaded VM they must not conflct with the VM's tag bits." - "N.B. some of these DisownFlags are replicated in platforms/Cross/vm/sqVirtualMachine.h. - Hence they should always be initialized. Because of a hack with callbacks in the non-threaded - VM they must not conflct with the VM's tag bits." - DisownVMLockOutFullGC := 8. DisownVMForFFICall := 16. DisownVMForThreading := 32 ! Item was changed: ----- Method: StackInterpreter class>>writeVMHeaderTo:bytesPerWord:generator: (in category 'translation') ----- writeVMHeaderTo: aStream bytesPerWord: bytesPerWord generator: aCCodeGenerator super writeVMHeaderTo: aStream bytesPerWord: bytesPerWord generator: aCCodeGenerator. SistaVM ifTrue: [aCCodeGenerator putDefineOf: #SistaVM as: 1 on: aStream]. NewspeakVM ifTrue: [aCCodeGenerator putDefineOf: #NewspeakVM as: 1 on: aStream]. MULTIPLEBYTECODESETS ifTrue: [aCCodeGenerator putDefineOf: #MULTIPLEBYTECODESETS as: 1 on: aStream]. IMMUTABILITY ifTrue: [aCCodeGenerator putConditionalDefineOf: #IMMUTABILITY as: 1 comment: 'Allow this to be overridden on the compiler command line' on: aStream]. SistaVM | NewspeakVM | MULTIPLEBYTECODESETS | IMMUTABILITY ifTrue: [aStream cr]. aCCodeGenerator putDefineOf: #STACKVM as: 1 on: aStream. (InitializationOptions at: #SpurObjectMemory ifAbsent: false) ifTrue: [aCCodeGenerator putDefineOf: #SPURVM as: 1 on: aStream]. aCCodeGenerator - putDefineOf: #DisownVMLockOutFullGC as: DisownVMLockOutFullGC on: aStream; putDefineOf: #DisownVMForFFICall as: DisownVMForFFICall on: aStream; putDefineOf: #DisownVMForThreading as: DisownVMForThreading on: aStream! Item was changed: ----- Method: StackInterpreter>>disownVM: (in category 'vm scheduling') ----- disownVM: flags "Release the VM to other threads and answer the current thread's index. Currently valid flags for the non-threaded VM are: DisownVMLockOutFullGC - prevent fullGCs while this thread disowns the VM DisownVMForFFICall - informs the VM that it is entering an FFI call This is the entry-point for plugins and primitives that wish to release the VM while performing some operation that may potentially block, and for callbacks returning back to some blocking operation. While this exists for the threaded FFI VM we use it to reset newMethod and the argumentCount after a callback." self assert: primFailCode = 0. "Hack encodings of client state. We use non-immediates (bottom three bits clear) for FFI/Plugin doing save := self disownVM: FLAGS. ... callout ... self ownVM: save. We use immediate integer (bottom bit 1) for callbacks doing save := self ownVM: 0. ... callback ... self disownVM: save. return to C" self assert: ((objectMemory isImmediate: flags) ifFalse: + [flags = (flags bitAnd: DisownVMForFFICall+DisownVMForThreading) - [flags = (flags bitAnd: DisownVMLockOutFullGC+DisownVMForFFICall+DisownVMForThreading) and: [flags anyMask: DisownVMForFFICall]] ifTrue: [(objectMemory isIntegerObject: flags) and: [(objectMemory integerValueOf: flags) between: 0 and: (self argumentCountOfMethodHeader: -1)]]). "If DisownVMForFFICall this is from the FFI plugin and we're making a callout; remember the fact." (((objectMemory isImmediate: flags)) not and: [flags anyMask: DisownVMForFFICall]) ifTrue: [self assert: ((objectMemory isOopCompiledMethod: newMethod) and: [(self argumentCountOf: newMethod) = argumentCount]). inFFIFlags := DisownVMForFFICall. ^flags]. self assert: ((objectMemory isIntegerObject: flags) and: [(objectMemory integerValueOf: flags) between: 0 and: (self argumentCountOfMethodHeader: -1)]). "Otherwise this is a callback return; restore argumentCount and newMethod as per the ownVM: on callback." argumentCount := objectMemory integerValueOf: flags. newMethod := self popStack. self assert: ((objectMemory isOopCompiledMethod: newMethod) and: [(self argumentCountOf: newMethod) = argumentCount]). ^0! Item was changed: ----- Method: ThreadedFFIPlugin>>ffiAtomicArgByReference:Class:in: (in category 'callout support') ----- ffiAtomicArgByReference: oop Class: oopClass in: calloutState "Support for generic callout. Prepare a pointer reference to an atomic type for callout. Note: for type 'void*' we allow ByteArray/String/Symbol, wordVariableSubclass, Alien or ExternalAddress. for other types we allow ByteArray, wordVariableSubclass, Alien or ExternalAddress." + | atomicType isString argIsAlien | - | atomicType isString isAlien | atomicType := self atomicTypeOf: calloutState ffiArgHeader. (atomicType = FFITypeBool) ifTrue: "No bools on input" [^FFIErrorCoercionFailed]. + argIsAlien := (isString := interpreterProxy + includesBehavior: oopClass + ThatOf: interpreterProxy classString) + ifTrue: [false] + ifFalse: + [interpreterProxy + includesBehavior: oopClass + ThatOf: interpreterProxy classAlien]. - isAlien := (isString := interpreterProxy - includesBehavior: oopClass - ThatOf: interpreterProxy classString) - ifTrue: [false] - ifFalse: - [interpreterProxy - includesBehavior: oopClass - ThatOf: interpreterProxy classAlien]. ((atomicType >> 1) = (FFITypeSignedChar >> 1)) ifTrue:"string value (char*)" "note: the only types allowed for passing into char* types are ByteArray, String, Symbol, Alien and *no* other byte indexed objects (e.g., CompiledMethod, LargeInteger). We only check for strings here and fall through to the byte* check otherwise." [isString ifTrue:"String/Symbol" "Strings must be allocated by the ffi support code" [^self ffiPushString: (interpreterProxy firstIndexableField: oop) OfLength: (interpreterProxy byteSizeOf: oop) in: calloutState]. "Fall through to byte* test" atomicType := FFITypeUnsignedByte]. self cppIf: COGMTVM ifTrue: ["Since all the following pass the address of the first indexable field we need to fail the call if it is threaded and the object is young, since it may move during the call." ((calloutState callFlags anyMask: FFICallFlagThreaded) + and: [(argIsAlien not or: [self isDirectAlien: oop]) - and: [(isAlien not or: [self isDirectAlien: oop]) and: [interpreterProxy isYoung: oop]]) ifTrue: [^PrimErrObjectMayMove negated]]. (atomicType = FFITypeVoid or:[(atomicType >> 1) = (FFITypeSignedByte >> 1)]) ifTrue: "byte* -- see comment on string above" [(isString or: [oopClass = interpreterProxy classByteArray]) ifTrue: "String/Symbol/ByteArray" [^self ffiPushPointer: (interpreterProxy firstIndexableField: oop) in: calloutState]. (oopClass = interpreterProxy classExternalAddress) ifTrue: [^self ffiPushPointer: (self longAt: oop + interpreterProxy baseHeaderSize) in: calloutState]. + argIsAlien ifTrue: - isAlien ifTrue: [^self ffiPushPointer: (self pointerForOop: (self startOfData: oop)) in: calloutState]. atomicType = FFITypeVoid ifFalse: [^FFIErrorCoercionFailed]]. "note: type void falls through" "I can push pointers to any type (take for instance calls who receive int* output arguments, etc.) but I need to store them into a ByteArray, ExternalAddress or Alien" (atomicType <= FFITypeDoubleFloat) ifTrue: [((interpreterProxy isWords: oop) or: [oopClass = interpreterProxy classByteArray]) ifTrue: [^self ffiPushPointer: (interpreterProxy firstIndexableField: oop) in: calloutState]. (oopClass = interpreterProxy classExternalAddress) ifTrue: [^self ffiPushPointer: (self longAt: oop + interpreterProxy baseHeaderSize) in: calloutState]. + argIsAlien ifTrue: - isAlien ifTrue: [^self ffiPushPointer: (self pointerForOop: (self startOfData: oop)) in: calloutState]]. ^FFIErrorCoercionFailed! Item was changed: SharedPool subclass: #VMBasicConstants instanceVariableNames: '' + classVariableNames: 'BaseHeaderSize BytecodeSetHasExtensions BytesPerOop BytesPerWord COGMTVM COGVM CloneOnGC CloneOnScavenge DisownVMForFFICall DisownVMForThreading DoAssertionChecks DoExpensiveAssertionChecks GCCheckPrimCall GCModeBecome GCModeFreeSpace GCModeFull GCModeImageSegment GCModeIncremental GCModeNewSpace HashMultiplyConstant HashMultiplyMask IMMUTABILITY LowcodeVM MULTIPLEBYTECODESETS NewspeakVM PharoVM PrimErrBadArgument PrimErrBadIndex PrimErrBadMethod PrimErrBadNumArgs PrimErrBadReceiver PrimErrCallbackError PrimErrFFIException PrimErrGenericFailure PrimErrInappropriate PrimErrLimitExceeded PrimErrNamedInternal PrimErrNeedCompaction PrimErrNoCMemory PrimErrNoMemory PrimErrNoModification PrimErrNotFound PrimErrOSError PrimErrObjectIsPinned PrimErrObjectMayMove PrimErrObjectMoved PrimErrObjectNotPinned PrimErrOperationFailed PrimErrUnsupported PrimErrWritePastObject PrimNoErr SPURVM STACKVM SistaVM TempVectReadBarrier VMBIGENDIAN' - classVariableNames: 'BaseHeaderSize BytecodeSetHasExtensions BytesPerOop BytesPerWord COGMTVM COGVM CloneOnGC CloneOnScavenge DisownVMForFFICall DisownVMForThreading DisownVMLockOutFullGC DoAssertionChecks DoExpensiveAssertionChecks GCCheckPrimCall GCModeBecome GCModeFreeSpace GCModeFull GCModeImageSegment GCModeIncremental GCModeNewSpace HashMultiplyConstant HashMultiplyMask IMMUTABILITY LowcodeVM MULTIPLEBYTECODESETS NewspeakVM PharoVM PrimErrBadArgument PrimErrBadIndex PrimErrBadMethod PrimErrBadNumArgs PrimErrBadReceiver PrimErrCallbackError PrimErrFFIException PrimErrGenericFailure PrimErrInappropriate PrimErrLimitExceeded PrimErrNamedInternal PrimErrNeedCompaction PrimErrNoCMemory PrimErrNoMemory PrimErrNoModification PrimErrNotFound PrimErrOSError PrimErrObjectIsPinned PrimErrObjectMayMove PrimErrObjectMoved PrimErrObjectNotPinned PrimErrOperationFailed PrimErrUnsupported PrimErrWritePastObject PrimNoErr SPURVM STACKVM SistaVM TempVectReadBarrier VMBIGENDIAN' poolDictionaries: '' category: 'VMMaker-Interpreter'! !VMBasicConstants commentStamp: '' prior: 0! I am a shared pool for basic constants upon which the VM as a whole depends. self ensureClassPool. self classPool declare: #BytesPerWord from: VMSqueakV3ObjectRepresentationConstants classPool. self classPool declare: #BaseHeaderSize from: VMSqueakV3ObjectRepresentationConstants classPool (ObjectMemory classPool keys select: [:k| k beginsWith: 'Byte']) do: [:k| self classPool declare: k from: ObjectMemory classPool]! From eliot.miranda at gmail.com Tue Nov 10 17:03:46 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 10 Nov 2020 09:03:46 -0800 Subject: [Vm-dev] [off topic] System Architecture Diagrams Message-ID: <789D5649-CE67-4A4E-8714-6D1085769522@gmail.com> Hi All, thanks to Bruce O’Neel I checked out libevdev, Linux’s “event device” library, which is the “i” in linux’s user-space i/o libraries. I’m used to seeing (& drawing) system architecture diagrams which have the hardware at the bottom, the kernel above it, and so on. In this style of diagram components of the system that use facilities provided by others are above those other components. The metaphor is one of support, a layered wedding cake if you like. But in this lovely diagram from the Wikipedia evdev page, the scheme is turned on its ear. The interface between human and machine is correctly identified as between computer hardware and our sensorimotor organs (is there a separate category name that includes the vocal cords?). Our brain and the application are correctly located at several removes. Nice! -------------- next part -------------- A non-text attachment was scrubbed... Name: 800px-Linux_kernel_and_gaming_input-output_latency.svg.png Type: image/png Size: 111744 bytes Desc: not available URL: -------------- next part -------------- Eliot _,,,^..^,,,_ (phone) From squeak-dev-noreply at lists.squeakfoundation.org Tue Nov 10 21:27:11 2020 From: squeak-dev-noreply at lists.squeakfoundation.org (squeak-dev-noreply at lists.squeakfoundation.org) Date: Tue, 10 Nov 2020 21:27:11 0000 Subject: [Vm-dev] AioPlugin: VMConstruction-Plugins-AioPlugin.oscog-eem.26.mcz Message-ID: Eliot Miranda uploaded a new version of VMConstruction-Plugins-AioPlugin to project AioPlugin: http://www.squeaksource.com/AioPlugin/VMConstruction-Plugins-AioPlugin.oscog-eem.26.mcz ==================== Summary ==================== Name: VMConstruction-Plugins-AioPlugin.oscog-eem.26 Author: eem Time: 10 November 2020, 1:27:09.569504 pm UUID: 9d32c4ef-9646-4ce2-b069-44fe86a2dbfb Ancestors: VMConstruction-Plugins-AioPlugin.oscog-eem.25 Less cCode:, use stackBooleanValue: rather than stackObjectValue:, and use methodReturnInteger:. From squeak-dev-noreply at lists.squeakfoundation.org Tue Nov 10 21:31:38 2020 From: squeak-dev-noreply at lists.squeakfoundation.org (squeak-dev-noreply at lists.squeakfoundation.org) Date: Tue, 10 Nov 2020 21:31:38 0000 Subject: [Vm-dev] OSProcessPlugin: VMConstruction-Plugins-OSProcessPlugin.oscog-eem.73.mcz Message-ID: Eliot Miranda uploaded a new version of VMConstruction-Plugins-OSProcessPlugin to project OSProcessPlugin: http://www.squeaksource.com/OSProcessPlugin/VMConstruction-Plugins-OSProcessPlugin.oscog-eem.73.mcz ==================== Summary ==================== Name: VMConstruction-Plugins-OSProcessPlugin.oscog-eem.73 Author: eem Time: 10 November 2020, 1:31:36.51167 pm UUID: 78f4b0c0-0615-44be-81ad-5804b1f8a80c Ancestors: VMConstruction-Plugins-OSProcessPlugin.oscog-dtl.72 Make sure shutdownModule returns a boolean as per its contract. From commits at source.squeak.org Tue Nov 10 21:33:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 21:33:09 0000 Subject: [Vm-dev] VM Maker: Cog-eem.427.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.427.mcz ==================== Summary ==================== Name: Cog-eem.427 Author: eem Time: 10 November 2020, 1:33:07.49707 pm UUID: 070d0057-5e06-4607-93dc-0a8c8da9e43e Ancestors: Cog-eem.426 fullGCLock is obsolete. =============== Diff against Cog-eem.426 =============== Item was changed: ----- Method: CogScripts class>>readOnlyVars (in category 'separate vm scripts') ----- readOnlyVars + ^#(#checkForLeaks #gcStartUsecs #memoryLimit #scavengeThreshold #youngStart - ^#(#checkForLeaks #fullGCLock #gcStartUsecs #memoryLimit #scavengeThreshold #youngStart #statCompMoveCount #statFullGCUsecs #statFullGCs #statGCEndUsecs #statGrowMemory #statIGCDeltaUsecs #statIncrGCUsecs #statIncrGCs #statMarkCount #statMkFwdCount #statRootTableCount #statRootTableOverflows #statShrinkMemory #statSpecialMarkCount #statSurvivorCount #statSweepCount #statTenures)! From commits at source.squeak.org Tue Nov 10 21:33:59 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 21:33:59 0000 Subject: [Vm-dev] VM Maker: VMMakerUI-eem.34.mcz Message-ID: Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.34.mcz ==================== Summary ==================== Name: VMMakerUI-eem.34 Author: eem Time: 10 November 2020, 1:33:58.14547 pm UUID: 6ca78e84-00fc-4343-8c7b-fcae369b5904 Ancestors: VMMakerUI-eem.33 Fix a sequencing glitch with shutting down a SimulatorMorphicModel =============== Diff against VMMakerUI-eem.33 =============== Item was changed: ----- Method: SimulatorMorphicModel>>ioExit (in category 'buttons callbacks') ----- ioExit + vm displayView activeHand removeEventListener: self model. + vm ioExit! - vm ioExit - displayView activeHand removeEventListener: self model. "This is a bug as the user in vm ioExit may have cancelled the confirm t.m." - "^UserDialogBoxMorph inform: 'Toggle Transcript' title: 'TODO:'"! From commits at source.squeak.org Tue Nov 10 21:39:05 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 10 Nov 2020 21:39:05 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2875.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2875.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2875 Author: eem Time: 10 November 2020, 1:38:57.951349 pm UUID: fbdf45b1-d757-4183-a2bd-1ebc595763e9 Ancestors: VMMaker.oscog-eem.2874 COGMTVM/interpreters: make sure the VM shuts down correctly, including terminating all threads/processes in the MT simulation, the SocketPlgin, etc. Fix the mapping of Processes (which are emulating threads) to integers by adding Process>>asUnsignedInteger. Hence CogThreadManager>>ioCurrentOSThread to answer Processor activeProcess. In simulation make sure the VM calls ioShutdownAllModules. InterpreterPlugin: Add the stackBooleanValue: from the 3D-ICC plugins. =============== Diff against VMMaker.oscog-eem.2874 =============== Item was changed: ----- Method: AsynchFilePlugin>>shutdownModule (in category 'initialize-release') ----- shutdownModule "Initialise the module" + ^self asyncFileShutdown! - ^self cCode: 'asyncFileShutdown()' inSmalltalk:[true]! Item was changed: ----- Method: CoInterpreterMT>>ownVMFromUnidentifiedThread (in category 'vm scheduling') ----- ownVMFromUnidentifiedThread "Attempt to take ownership from a thread that as yet doesn't know its index. This supports callbacks where the callback could originate from any thread. Answer 0 if the owning thread is known to the VM. Answer 1 if the owning thread is unknown to the VM and now owns the VM. Answer -1 if the owning thread is unknown to the VM and fails to own the VM. Answer -2 if the owning thread is unknown to the VM and there is no foreign callback process installed." | count threadIndex vmThread | (threadIndex := cogThreadManager ioGetThreadLocalThreadIndex) ~= 0 ifTrue: [ "this is a callback from a known thread" (cogThreadManager vmOwnerIs: threadIndex) ifTrue: "the VM has not been disowned" [self assert: (disowningVMThread isNil or: [disowningVMThread = self currentVMThread]). disowningVMThread := nil. self currentVMThread state: CTMAssignableOrInVM. ^VMAlreadyOwnedHenceDoNotDisown]. ^self ownVM: threadIndex]. foreignCallbackPriority = 0 ifTrue: [^-2]. count := 0. "If the current thread doesn't have an index it's new to the vm and we need to allocate a new threadInfo, failing if we can't. We also need a process in the foreignCallbackProcessSlot upon which to run the thread's eventual callback." + [[cogit tryLockVMOwnerTo: cogThreadManager ioCurrentOSThread asUnsignedInteger] whileFalse: - [[cogit tryLockVMOwnerTo: cogThreadManager ioCurrentOSThread] whileFalse: [self waitingPriorityIsAtLeast: foreignCallbackPriority. cogThreadManager ioTransferTimeslice]. (objectMemory splObj: foreignCallbackProcessSlot) ~= objectMemory nilObject] whileFalse: [cogThreadManager releaseVM. (count := count + 1) > 1000 ifTrue: [^-2]. cogThreadManager ioMilliSleep: 1]. vmThread := cogThreadManager unusedThreadInfo. "N.B. Keep the VM locked anonymously so that we reserve the non-nil ForeignCallbackProcess for this thread, avoiding the race between competing foreign callbacks. The acquireVMFor: in ownVM: will set the vmOwner to the actual index. So only unlock on failure." vmThread ifNil: [cogThreadManager releaseVM. ^-1]. cogThreadManager setVMOwner: vmThread index. vmThread state: CTMWantingOwnership; priority: foreignCallbackPriority. cogThreadManager registerVMThread: vmThread. ^self ownVM: vmThread index + OwnVMForeignThreadFlag! Item was changed: ----- Method: CogThreadManager>>ioCurrentOSThread (in category 'simulation') ----- ioCurrentOSThread "See platforms//vm/sqPlatformSpecific.h for the real definition." + ^Processor activeProcess! - ^Processor activeProcess identityHash! Item was changed: ----- Method: CogThreadManager>>ioNewOSSemaphore: (in category 'simulation') ----- ioNewOSSemaphore: semaphorePointer "" "See platforms/Cross/vm/sq.h for the real definition." + semaphorePointer at: 0 put: Semaphore new. - semaphorePointer value: Semaphore new. ^0! Item was changed: ----- Method: CogThreadManager>>populate:from:to: (in category 'thread set') ----- populate: vmThreadPointers from: start to: finish "Populate vmThreadPointers with vmThreads over the given range." | nThreads vmThreads | nThreads := finish - start + 1. + vmThreads := self cCode: [self calloc: nThreads _: (self sizeof: CogVMThread)] - vmThreads := self cCode: [self c: nThreads alloc: (self sizeof: CogVMThread)] inSmalltalk: [CArrayAccessor on: ((1 to: nThreads) collect: [:ign| CogVMThread new])]. + vmThreads ifNil: - vmThreads isNil ifTrue: [^false]. + "Since 0 is not a valid index, in C we allocate one extra CogVMThread and use 1-relative indices." + self cCode: [start = 1 ifTrue: [vmThreadPointers at: 0 put: nil]] - self cCode: - [start = 1 ifTrue: - [vmThreadPointers at: 0 put: nil]] inSmalltalk: []. start to: finish do: [:i| | vmThread | vmThread := self addressOf: (vmThreads at: i - start). + (self ioNewOSSemaphore: (self addressOf: vmThread osSemaphore put: [:sem| vmThread osSemaphore: sem])) ~= 0 ifTrue: - (self ioNewOSSemaphore: (self cCode: [self addressOf: vmThread osSemaphore] - inSmalltalk: [[:sem| vmThread osSemaphore: sem]])) ~= 0 ifTrue: [start to: i - 1 do: [:j| vmThread := self addressOf: (vmThreads at: j - start). self ioDestroyOSSemaphore: (self addressOf: vmThread osSemaphore)]. self free: vmThreads. ^false]. vmThreadPointers at: i put: vmThread. vmThread awolProcLength: AWOLProcessesIncrement. vmThread index: i]. ^true! Item was added: + ----- Method: CogThreadManager>>shutdownModule (in category 'simulation') ----- + shutdownModule + + | guiProcess | + threads ifNil: [^self]. + (guiProcess := self guiProcess) ~= Processor activeProcess ifTrue: + [guiProcess + signalException: + (Notification new tag: #evaluateQuit; yourself). + Processor terminateActive]. + threads do: + [:ea| + ea osThread ifNotNil: + [:aProcess| + (aProcess ~~ Processor activeProcess and: [aProcess ~~ guiProcess]) ifTrue: + [aProcess terminate]]]! Item was changed: + ----- Method: CogVMSimulator>>close (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>close (in category 'initialization') ----- close "close any files that ST may have opened, etc" pluginList do: [:assoc| | plugin | plugin := assoc value. plugin ~~ self ifTrue: [plugin close]]. "Ugh; at least some of this code belongs in the UI..." displayView ifNotNil: [displayView activeHand removeEventListener: self]. ActiveHand removeEventListener: self. World submorphs do: [:submorph| (submorph model isVMObjectInspector and: [submorph model coInterpreter == self]) ifTrue: [submorph delete]. (submorph model isDebugger and: [(submorph model interruptedProcess suspendedContext ifNotNil: [:sctxt| sctxt findContextSuchThat: [:ctxt| (ctxt receiver == cogit and: [ctxt selector == #simulateCogCodeAt:]) or: [ctxt receiver == self and: [ctxt selector == #interpret]]]]) notNil]) ifTrue: [submorph model windowIsClosing. submorph delete]]! Item was changed: + ----- Method: CogVMSimulator>>desiredCogCodeSize: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>desiredCogCodeSize: (in category 'initialization') ----- desiredCogCodeSize: anInteger desiredCogCodeSize := anInteger! Item was changed: + ----- Method: CogVMSimulator>>desiredEdenBytes: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>desiredEdenBytes: (in category 'initialization') ----- desiredEdenBytes: anInteger desiredEdenBytes := anInteger! Item was changed: + ----- Method: CogVMSimulator>>desiredNumStackPages: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>desiredNumStackPages: (in category 'initialization') ----- desiredNumStackPages: anInteger desiredNumStackPages := anInteger! Item was changed: + ----- Method: CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate (in category 'initialization') ----- ensureMultiThreadingOverridesAreUpToDate "Make sure the CoInterpreterMT switch methods are implemented. These methods select between CoInterpreterMT's implementation or CoInterpreter's implementation depending on cogThreadManager being non-nil or nil respectively. i.e. they allow us to use this one simulator class to simulate for both CoInterpreterMT and CoInterpreter." | thisClass me mtInterpreterClass | self cppIf: COGMTVM ifTrue: [ ] ifFalse: [ ^self ]. thisClass := thisContext methodClass. mtInterpreterClass := thisClass superclass. me := thisClass name, '>>', thisContext method selector. "We want override switches for everything implemented by CoInterpreter and CoInterpreterMT that is either not implemented by CogVMSimulator or already implemented by CogVMSimulator as an override switch." (mtInterpreterClass selectors select: [:sel| (mtInterpreterClass superclass whichClassIncludesSelector: sel) notNil and: [(thisClass organization categoryOfElement: sel) ifNil: [true] ifNotNil: [:cat| cat == #'multi-threading simulation switch']]]) do: [:sel| | argNames desiredSource | argNames := Parser new initPattern: (mtInterpreterClass sourceCodeAt: sel) return: [:pattern| pattern second]. desiredSource := String streamContents: [:str| argNames isEmpty ifTrue: [str nextPutAll: sel] ifFalse: [sel keywords with: argNames do: [:kw :arg| str nextPutAll: kw; space; nextPutAll: arg; space]. str skip: -1]. str crtab; nextPutAll: '"This method includes or excludes ', mtInterpreterClass name, ' methods as required.'; crtab; nextPutAll: ' Auto-generated by ', me, '"'; cr; crtab; nextPutAll: '^self perform: '; store: sel; crtab: 2; nextPutAll: 'withArguments: {'. argNames do: [:arg| str nextPutAll: arg] separatedBy: [str nextPut: $.; space]. str nextPut: $}; crtab: 2; nextPutAll: 'inSuperclass: (cogThreadManager ifNil: ['; print: mtInterpreterClass superclass; nextPutAll: '] ifNotNil: ['; print: mtInterpreterClass; nextPutAll: '])']. desiredSource ~= (thisClass sourceCodeAt: sel ifAbsent: ['']) asString ifTrue: [((thisClass includesSelector: sel) and: [(thisClass compiledMethodAt: sel) messages includesAnyOf: #(halt halt:)]) ifTrue: [self transcript cr; nextPutAll: 'WARNING, because of halts, not generating '; nextPutAll: desiredSource; cr; flush] ifFalse: [thisClass compile: desiredSource classified: #'multi-threading simulation switch']]]. "Make sure obsolete CoInterpreterMT switch methods are deleted." ((thisContext methodClass organization listAtCategoryNamed: #'multi-threading simulation switch') select: [:sel| (mtInterpreterClass whichClassIncludesSelector: sel) isNil]) do: [:sel| thisClass removeSelector: sel]! Item was changed: + ----- Method: CogVMSimulator>>initialEnterSmalltalkExecutive (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>initialEnterSmalltalkExecutive (in category 'initialization') ----- initialEnterSmalltalkExecutive "Main entry-point into the interpreter at system start-up. Override to choose between the threaded and non-threaded versions and if threaded to ensure that the switch method overrides are up-to-date." self ensureMultiThreadingOverridesAreUpToDate. self assert: (cogit processor fp = CFramePointer and: [cogit processor sp = CStackPointer]). ^self perform: #initialEnterSmalltalkExecutive withArguments: {} inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was changed: + ----- Method: CogVMSimulator>>initialize (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>initialize (in category 'initialization') ----- initialize "Initialize the CogVMSimulator when running the interpreter inside Smalltalk. The primary responsibility of this method is to allocate Smalltalk Arrays for variables that will be declared as statically-allocated global arrays in the translated code." super initialize. transcript := Transcript. objectMemory ifNil: [objectMemory := self class objectMemoryClass simulatorClass new]. cogit ifNil: [cogit := self class cogitClass new setInterpreter: self]. objectMemory coInterpreter: self cogit: cogit. (cogit numRegArgs > 0 and: [VMClass initializationOptions at: #CheckStackDepth ifAbsent: [true]]) ifTrue: [debugStackDepthDictionary := Dictionary new]. cogThreadManager ifNotNil: [super initialize]. self assert: ConstMinusOne = (objectMemory integerObjectOf: -1). cogMethodZone := cogit methodZone. "Because Slang can't remove intermediate implicit receivers (cogit methodZone foo doesn't reduce to foo())" enableCog := true. methodCache := Array new: MethodCacheSize. nsMethodCache := Array new: NSMethodCacheSize. atCache := nil. self flushMethodCache. cogCompiledCodeCompactionCalledFor := false. gcSemaphoreIndex := 0. externalSemaphoreSignalRequests := externalSemaphoreSignalResponses := #(). externalPrimitiveTable := CArrayAccessor on: (Array new: MaxExternalPrimitiveTableSize). externalPrimitiveTableFirstFreeIndex := 0. primitiveTable := self class primitiveTable copy. self initializePluginEntries. desiredNumStackPages := InitializationOptions at: #desiredNumStackPages ifAbsent: [0]. desiredEdenBytes := InitializationOptions at: #desiredEdenBytes ifAbsent: [0]. desiredCogCodeSize := InitializationOptions at: #desiredCogCodeSize ifAbsent: [0]. "This is initialized on loading the image, but convenient for testing stack page values..." numStackPages := self defaultNumStackPages. startMicroseconds := lastYieldMicroseconds := self ioUTCStartMicroseconds. maxLiteralCountForCompile := MaxLiteralCountForCompile. minBackwardJumpCountForCompile := MinBackwardJumpCountForCompile. flagInterpretedMethods := false. "initialize InterpreterSimulator variables used for debugging" byteCount := lastPollCount := sendCount := lookupCount := 0. quitBlock := [^self close]. traceOn := true. printSends := printFrameAtEachStep := printBytecodeAtEachStep := false. myBitBlt := BitBltSimulator new setInterpreter: self. displayForm := fakeForm := 'Display has not yet been installed' asDisplayText form. suppressHeartbeatFlag := deferSmash := deferredSmash := false. systemAttributes := Dictionary new. primTraceLog := CArrayAccessor on: (Array new: 256 withAll: 0). primTraceLogIndex := 0. traceLog := CArrayAccessor on: (Array new: TraceBufferSize withAll: 0). traceLogIndex := 0. traceSources := TraceSources. statCodeCompactionCount := 0. statCodeCompactionUsecs := 0. extSemTabSize := 256! Item was changed: + ----- Method: CogVMSimulator>>initializeThreadSupport (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>initializeThreadSupport (in category 'initialization') ----- initializeThreadSupport "Do this post new if you want to simulate with thread support." cogThreadManager := CogThreadManager new setInterpreter: self cogit: cogit. cogit setThreadManager: cogThreadManager! Item was changed: ----- Method: CogVMSimulator>>ioExit (in category 'primitive support') ----- ioExit + self ioExitWithErrorCode: 0! - self threadManager ifNotNil: - [:threadManager| - threadManager guiProcess ~= Processor activeProcess ifTrue: - [threadManager guiProcess - signalException: - (Notification new tag: #evaluateQuit; yourself). - Processor terminateActive]]. - quitBlock value "Cause return from #test"! Item was changed: ----- Method: CogVMSimulator>>ioExitWithErrorCode: (in category 'primitive support') ----- ioExitWithErrorCode: ec + self ioShutdownAllModules. + self threadManager ifNotNil: + [:threadManager| threadManager shutdownModule]. + quitBlock value "Cause return from #test"! - self ioExit! Item was changed: + ----- Method: CogVMSimulator>>ioInitHeartbeat (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>ioInitHeartbeat (in category 'initialization') ----- ioInitHeartbeat "No-op in the simulator. We cause a poll every 1000 bytecodes instead."! Item was added: + ----- Method: CogVMSimulator>>ioShutdownAllModules (in category 'initialize-release') ----- + ioShutdownAllModules + pluginList do: + [:assoc| | pluginOrSelf | + ((pluginOrSelf := assoc value) ~~ self + and: [pluginOrSelf respondsTo: #shutdownModule]) ifTrue: + [pluginOrSelf shutdownModule]]! Item was changed: + ----- Method: CogVMSimulator>>moveMethodCacheToMemoryAt: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>moveMethodCacheToMemoryAt: (in category 'initialization') ----- moveMethodCacheToMemoryAt: address | oldMethodCache | oldMethodCache := methodCache. "In the VM the methodCache is written as a normal array with 1-relative addressing. In C this works by allocating an extra element in the methodCache array (see class-side declareCVarsIn:). In simulation simply position the start of the methodCache one word lower, achieving the same effect. -1 because CArrayAccessor is 0-relative and adds 1 on accesses itself." methodCache := CMethodCacheAccessor new objectMemory: objectMemory at: address array: oldMethodCache functionPointerIndex: MethodCachePrimFunction entrySize: MethodCacheEntrySize. self assert: address - objectMemory wordSize = self methodCacheAddress. 1 to: MethodCacheSize do: [:i| self assert: (methodCache at: i) = 0]. methodCache at: 1 put: 16rC4EC4. self assert: (objectMemory longAt: address) = 16rC4EC4. 1 to: MethodCacheSize do: [:i| methodCache at: i put: (oldMethodCache at: i)]! Item was changed: + ----- Method: CogVMSimulator>>movePrimTraceLogToMemoryAt: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>movePrimTraceLogToMemoryAt: (in category 'initialization') ----- movePrimTraceLogToMemoryAt: address | oldTraceLog | oldTraceLog := primTraceLog. primTraceLog := CArrayOfLongsAccessor new objectMemory: objectMemory at: address. self assert: address = self primTraceLogAddress. 0 to: PrimTraceLogSize - 1 do: [:i| self assert: (primTraceLog at: i) = 0]. primTraceLog at: 0 put: 16rC4EC4. self assert: (objectMemory longAt: address) = 16rC4EC4. 0 to: PrimTraceLogSize - 1 do: [:i| primTraceLog at: i put: (oldTraceLog at: i)]! Item was changed: + ----- Method: CogVMSimulator>>nextShortFrom: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>nextShortFrom: (in category 'initialization') ----- nextShortFrom: aStream "Read a 16-bit quantity from the given (binary) stream." ^self subclassResponsibility! Item was changed: + ----- Method: CogVMSimulator>>openOn:extraMemory: (in category 'initialize-release') ----- - ----- Method: CogVMSimulator>>openOn:extraMemory: (in category 'initialization') ----- openOn: fileName extraMemory: extraBytes "CogVMSimulator new openOn: 'clone.im' extraMemory: 100000" | f version headerSize dataSize count oldBaseAddr bytesToShift swapBytes headerFlags firstSegSize heapSize hdrNumStackPages hdrEdenBytes hdrMaxExtSemTabSize hdrCogCodeSize stackZoneSize methodCacheSize primTraceLogSize allocationReserve | "open image file and read the header" (f := self openImageFileNamed: fileName) ifNil: [^self]. "Set the image name and the first argument; there are no arguments during simulation unless set explicitly." systemAttributes at: 1 put: fileName. ["begin ensure block..." imageName := f fullName. f binary. version := self getWord32FromFile: f swap: false. "current version: 16r1968 (=6504) vive la revolucion!!" (self readableFormat: version) ifTrue: [swapBytes := false] ifFalse: [(version := version byteSwap32) = self imageFormatVersion ifTrue: [swapBytes := true] ifFalse: [self error: 'incomaptible image format']]. headerSize := self getWord32FromFile: f swap: swapBytes. dataSize := self getLongFromFile: f swap: swapBytes. "length of heap in file" oldBaseAddr := self getLongFromFile: f swap: swapBytes. "object memory base address of image" objectMemory specialObjectsOop: (self getLongFromFile: f swap: swapBytes). objectMemory lastHash: (self getLongFromFile: f swap: swapBytes). "Should be loaded from, and saved to the image header" savedWindowSize := self getLongFromFile: f swap: swapBytes. headerFlags := self getLongFromFile: f swap: swapBytes. self setImageHeaderFlagsFrom: headerFlags. extraVMMemory := self getWord32FromFile: f swap: swapBytes. hdrNumStackPages := self getShortFromFile: f swap: swapBytes. "4 stack pages is small. Should be able to run with as few as three. 4 should be comfortable but slow. 8 is a reasonable default. Can be changed via vmParameterAt: 43 put: n" numStackPages := desiredNumStackPages ~= 0 ifTrue: [desiredNumStackPages] ifFalse: [hdrNumStackPages = 0 ifTrue: [self defaultNumStackPages] ifFalse: [hdrNumStackPages]]. desiredNumStackPages := hdrNumStackPages. stackZoneSize := self computeStackZoneSize. "This slot holds the size of the native method zone in 1k units. (pad to word boundary)." hdrCogCodeSize := (self getShortFromFile: f swap: swapBytes) * 1024. cogCodeSize := desiredCogCodeSize ~= 0 ifTrue: [desiredCogCodeSize] ifFalse: [hdrCogCodeSize = 0 ifTrue: [cogit defaultCogCodeSize] ifFalse: [hdrCogCodeSize]]. desiredCogCodeSize := hdrCogCodeSize. self assert: f position = (objectMemory wordSize = 4 ifTrue: [40] ifFalse: [64]). hdrEdenBytes := self getWord32FromFile: f swap: swapBytes. objectMemory edenBytes: (desiredEdenBytes ~= 0 ifTrue: [desiredEdenBytes] ifFalse: [hdrEdenBytes = 0 ifTrue: [objectMemory defaultEdenBytes] ifFalse: [hdrEdenBytes]]). desiredEdenBytes := hdrEdenBytes. hdrMaxExtSemTabSize := self getShortFromFile: f swap: swapBytes. hdrMaxExtSemTabSize ~= 0 ifTrue: [self setMaxExtSemSizeTo: hdrMaxExtSemTabSize]. "pad to word boundary. This slot can be used for anything else that will fit in 16 bits. Preserve it to be polite to other VMs." the2ndUnknownShort := self getShortFromFile: f swap: swapBytes. self assert: f position = (objectMemory wordSize = 4 ifTrue: [48] ifFalse: [72]). firstSegSize := self getLongFromFile: f swap: swapBytes. objectMemory firstSegmentSize: firstSegSize. "For Open PICs to be able to probe the method cache during simulation the methodCache must be relocated to memory." methodCacheSize := methodCache size * objectMemory wordSize. primTraceLogSize := primTraceLog size * objectMemory wordSize. "To cope with modern OSs that disallow executing code in writable memory we dual-map the code zone, one mapping with read/write permissions and the other with read/execute permissions. In simulation all we can do is use memory, so if we're simulating dual mapping we use double the memory and simulate the memory sharing in the Cogit's backEnd." effectiveCogCodeSize := (InitializationOptions at: #DUAL_MAPPED_CODE_ZONE ifAbsent: [false]) ifTrue: [cogCodeSize * 2] ifFalse: [cogCodeSize]. "allocate interpreter memory. This list is in address order, low to high. In the actual VM the stack zone exists on the C stack." heapBase := (Cogit guardPageSize + effectiveCogCodeSize + stackZoneSize + methodCacheSize + primTraceLogSize + self rumpCStackSize) roundUpTo: objectMemory allocationUnit. "compare memory requirements with availability" allocationReserve := self interpreterAllocationReserveBytes. objectMemory hasSpurMemoryManagerAPI ifTrue: [| freeOldSpaceInImage headroom | freeOldSpaceInImage := self getLongFromFile: f swap: swapBytes. headroom := objectMemory initialHeadroom: extraVMMemory givenFreeOldSpaceInImage: freeOldSpaceInImage. heapSize := objectMemory roundUpHeapSize: dataSize + headroom + objectMemory newSpaceBytes + (headroom > allocationReserve ifTrue: [0] ifFalse: [allocationReserve])] ifFalse: [heapSize := dataSize + extraBytes + objectMemory newSpaceBytes + (extraBytes > allocationReserve ifTrue: [0] ifFalse: [allocationReserve])]. heapBase := objectMemory setHeapBase: heapBase memoryLimit: heapBase + heapSize endOfMemory: heapBase + dataSize. self assert: cogCodeSize \\ 4 = 0. self assert: objectMemory memoryLimit \\ 4 = 0. self assert: self rumpCStackSize \\ 4 = 0. objectMemory allocateMemoryOfSize: objectMemory memoryLimit. "read in the image in bulk, then swap the bytes if necessary" f position: headerSize. count := objectMemory readHeapFromImageFile: f dataBytes: dataSize. count ~= dataSize ifTrue: [self halt]] ensure: [f close]. self moveMethodCacheToMemoryAt: objectMemory cogCodeBase + effectiveCogCodeSize + stackZoneSize. self movePrimTraceLogToMemoryAt: objectMemory cogCodeBase + effectiveCogCodeSize + stackZoneSize + methodCacheSize. self ensureImageFormatIsUpToDate: swapBytes. bytesToShift := objectMemory memoryBaseForImageRead - oldBaseAddr. "adjust pointers for zero base address" UIManager default informUser: 'Relocating object pointers...' during: [self initializeInterpreter: bytesToShift]. self initializeCodeGenerator! Item was changed: ----- Method: CogVMThread>>osThread: (in category 'accessing') ----- osThread: anObject "Set the value of osThread" + self assert: (osThread isNil or: [osThread isKindOf: Process]). - ^osThread := anObject! Item was changed: ----- Method: FilePlugin>>shutdownModule (in category 'initialize-release') ----- shutdownModule + ^self sqFileShutdown! - ^self cCode: 'sqFileShutdown()' inSmalltalk:[true]! Item was added: + ----- Method: FilePluginSimulator>>sqFileShutdown (in category 'initialize-release') ----- + sqFileShutdown + self close. + ^true! Item was changed: ----- Method: HostWindowPlugin>>shutdownModule (in category 'initialize-release') ----- shutdownModule "do any window related VM closing down work your platform requires." + ^self ioCloseAllWindows! - ^self cCode: 'ioCloseAllWindows()' inSmalltalk:[true]! Item was added: + ----- Method: InterpreterPlugin>>stackBooleanValue: (in category 'API access') ----- + stackBooleanValue: index + + ^interpreterProxy booleanValueOf: (interpreterProxy stackValue: index)! Item was changed: ----- Method: Mpeg3Plugin>>shutdownModule (in category 'support') ----- shutdownModule 1 to: maximumNumberOfFilesToWatch do: + [:i | + ((mpegFiles at: i) ~= 0) ifTrue: + [self mpeg3_close: (mpegFiles at: i). - [:i | ((mpegFiles at: i) ~= 0) ifTrue: - [self cCode: 'mpeg3_close(mpegFiles[i])'. mpegFiles at: i put: 0]]. ^true! Item was added: + ----- Method: Process>>asUnsignedInteger (in category '*VMMaker-simulation') ----- + asUnsignedInteger + "Processes are used to model OS threads in the COGMTVM. + But native threads are typically simply pointers which can hence be mapped to integers. + This is used in locking the VM from an unknown thread on callback. Hence mimic the + ability to map a thread to an integer by answering the receiver's identityHash." + ^self identityHash! Item was added: + ----- Method: SmartSyntaxPluginSimulator>>shutdownModule (in category 'initialize') ----- + shutdownModule + ^(actualPlugin respondsTo: #shutdownModule) + ifTrue: [actualPlugin shutdownModule] + ifFalse: [true]! Item was changed: ----- Method: SocketPlugin>>shutdownModule (in category 'initialize-release') ----- shutdownModule + ^self socketShutdown! - ^self cCode: 'socketShutdown()' inSmalltalk:[true]! Item was added: + ----- Method: SocketPluginSimulator>>socketShutdown (in category 'simulation') ----- + socketShutdown + self close. + ^true! Item was changed: + ----- Method: StackInterpreterSimulator>>close (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>close (in category 'initialization') ----- close "close any files that ST may have opened, etc" pluginList do: [:assoc| | plugin | plugin := assoc value. plugin ~~ self ifTrue: [plugin close]]. "Ugh; at least some of this code belongs in the UI..." displayView ifNotNil: [displayView activeHand removeEventListener: self]. ActiveHand removeEventListener: self. World submorphs do: [:submorph| (submorph model isVMObjectInspector and: [submorph model coInterpreter == self]) ifTrue: [submorph delete]. (submorph model isDebugger and: [(submorph model interruptedProcess suspendedContext ifNotNil: [:sctxt| sctxt findContextSuchThat: [:ctxt| ctxt receiver == self and: [ctxt selector == #run]]]) notNil]) ifTrue: [submorph model windowIsClosing. submorph delete]]! Item was changed: + ----- Method: StackInterpreterSimulator>>desiredEdenBytes: (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>desiredEdenBytes: (in category 'initialization') ----- desiredEdenBytes: anInteger desiredEdenBytes := anInteger! Item was changed: + ----- Method: StackInterpreterSimulator>>desiredNumStackPages: (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>desiredNumStackPages: (in category 'initialization') ----- desiredNumStackPages: anInteger desiredNumStackPages := anInteger! Item was changed: + ----- Method: StackInterpreterSimulator>>initialize (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>initialize (in category 'initialization') ----- initialize "Initialize the StackInterpreterSimulator when running the interpreter inside Smalltalk. The primary responsibility of this method is to allocate Smalltalk Arrays for variables that will be declared as statically-allocated global arrays in the translated code." super initialize. bootstrapping := false. transcript := Transcript. objectMemory ifNil: [objectMemory := self class objectMemoryClass simulatorClass new]. objectMemory coInterpreter: self. self assert: ConstMinusOne = (objectMemory integerObjectOf: -1). methodCache := Array new: MethodCacheSize. nsMethodCache := Array new: NSMethodCacheSize. atCache := Array new: AtCacheTotalSize. self flushMethodCache. gcSemaphoreIndex := 0. externalSemaphoreSignalRequests := externalSemaphoreSignalResponses := #(). externalPrimitiveTable := CArrayAccessor on: (Array new: MaxExternalPrimitiveTableSize). externalPrimitiveTableFirstFreeIndex := 0. primitiveTable := self class primitiveTable copy. self initializePluginEntries. desiredNumStackPages := desiredEdenBytes := 0. "This is initialized on loading the image, but convenient for testing stack page values..." numStackPages := self defaultNumStackPages. startMicroseconds := lastYieldMicroseconds := self ioUTCStartMicroseconds. "initialize InterpreterSimulator variables used for debugging" byteCount := sendCount := lookupCount := 0. quitBlock := [^self close]. traceOn := true. printSends := printReturns := printFrameAtEachStep := printBytecodeAtEachStep := false. myBitBlt := BitBltSimulator new setInterpreter: self. displayForm := fakeForm := 'Display has not yet been installed' asDisplayText form. suppressHeartbeatFlag := false. systemAttributes := Dictionary new. extSemTabSize := 256. disableBooleanCheat := false. assertVEPAES := false. "a flag so the assertValidExecutionPointers can be disabled for simulation speed and enabled when necessary."! Item was changed: ----- Method: StackInterpreterSimulator>>ioExit (in category 'primitive support') ----- ioExit + self ioExitWithErrorCode: 0! - - quitBlock value "Cause return from #test"! Item was changed: ----- Method: StackInterpreterSimulator>>ioExitWithErrorCode: (in category 'primitive support') ----- ioExitWithErrorCode: ec + self ioShutdownAllModules. - quitBlock value "Cause return from #test"! Item was changed: + ----- Method: StackInterpreterSimulator>>ioInitHeartbeat (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>ioInitHeartbeat (in category 'initialization') ----- ioInitHeartbeat "No-op in the simulator. We cause a poll every 1000 bytecodes instead."! Item was added: + ----- Method: StackInterpreterSimulator>>ioShutdownAllModules (in category 'initialize-release') ----- + ioShutdownAllModules + pluginList do: + [:assoc| | pluginOrSelf | + ((pluginOrSelf := assoc value) ~~ self + and: [pluginOrSelf respondsTo: #shutdownModule]) ifTrue: + [pluginOrSelf shutdownModule]]! Item was changed: + ----- Method: StackInterpreterSimulator>>nextShortFrom: (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>nextShortFrom: (in category 'initialization') ----- nextShortFrom: aStream "Read a 16-bit quantity from the given (binary) stream." ^self subclassResponsibility! Item was changed: + ----- Method: StackInterpreterSimulator>>openOn:extraMemory: (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>openOn:extraMemory: (in category 'initialization') ----- openOn: fileName extraMemory: extraBytes "StackInterpreterSimulator new openOn: 'clone.im' extraMemory: 100000" | f version headerSize dataSize count oldBaseAddr bytesToShift swapBytes headerFlags heapBase firstSegSize heapSize hdrNumStackPages hdrEdenBytes hdrMaxExtSemTabSize allocationReserve | "open image file and read the header" (f := self openImageFileNamed: fileName) ifNil: [^self]. "Set the image name and the first argument; there are no arguments during simulation unless set explicitly." systemAttributes at: 1 put: fileName. ["begin ensure block..." imageName := f fullName. f binary. version := self getWord32FromFile: f swap: false. "current version: 16r1968 (=6504) vive la revolucion!!" (self readableFormat: version) ifTrue: [swapBytes := false] ifFalse: [(version := objectMemory byteSwapped: version) = self imageFormatVersion ifTrue: [swapBytes := true] ifFalse: [self error: 'incomaptible image format']]. headerSize := self getWord32FromFile: f swap: swapBytes. dataSize := self getLongFromFile: f swap: swapBytes. "length of heap in file" oldBaseAddr := self getLongFromFile: f swap: swapBytes. "object memory base address of image" objectMemory specialObjectsOop: (self getLongFromFile: f swap: swapBytes). objectMemory lastHash: (self getLongFromFile: f swap: swapBytes). "Should be loaded from, and saved to the image header" savedWindowSize := self getLongFromFile: f swap: swapBytes. headerFlags := self getLongFromFile: f swap: swapBytes. self setImageHeaderFlagsFrom: headerFlags. extraVMMemory := self getWord32FromFile: f swap: swapBytes. hdrNumStackPages := self getShortFromFile: f swap: swapBytes. "4 stack pages is small. Should be able to run with as few as three. 4 should be comfortable but slow. 8 is a reasonable default. Can be changed via vmParameterAt: 43 put: n" numStackPages := desiredNumStackPages ~= 0 ifTrue: [desiredNumStackPages] ifFalse: [hdrNumStackPages = 0 ifTrue: [self defaultNumStackPages] ifFalse: [hdrNumStackPages]]. desiredNumStackPages := hdrNumStackPages. "pad to word boundary. This slot can be used for anything else that will fit in 16 bits. It is used for the cog code size in Cog. Preserve it to be polite to other VMs." theUnknownShort := self getShortFromFile: f swap: swapBytes. self assert: f position = (objectMemory wordSize = 4 ifTrue: [40] ifFalse: [64]). hdrEdenBytes := self getWord32FromFile: f swap: swapBytes. objectMemory edenBytes: (hdrEdenBytes = 0 ifTrue: [objectMemory defaultEdenBytes] ifFalse: [hdrEdenBytes]). desiredEdenBytes := hdrEdenBytes. hdrMaxExtSemTabSize := self getShortFromFile: f swap: swapBytes. hdrMaxExtSemTabSize ~= 0 ifTrue: [self setMaxExtSemSizeTo: hdrMaxExtSemTabSize]. "pad to word boundary. This slot can be used for anything else that will fit in 16 bits. Preserve it to be polite to other VMs." the2ndUnknownShort := self getShortFromFile: f swap: swapBytes. self assert: f position = (objectMemory wordSize = 4 ifTrue: [48] ifFalse: [72]). firstSegSize := self getLongFromFile: f swap: swapBytes. objectMemory firstSegmentSize: firstSegSize. "compare memory requirements with availability" allocationReserve := self interpreterAllocationReserveBytes. objectMemory hasSpurMemoryManagerAPI ifTrue: [| freeOldSpaceInImage headroom | freeOldSpaceInImage := self getLongFromFile: f swap: swapBytes. headroom := objectMemory initialHeadroom: extraVMMemory givenFreeOldSpaceInImage: freeOldSpaceInImage. heapSize := objectMemory roundUpHeapSize: dataSize + headroom + objectMemory newSpaceBytes + (headroom > allocationReserve ifTrue: [0] ifFalse: [allocationReserve])] ifFalse: [heapSize := dataSize + extraBytes + objectMemory newSpaceBytes + (extraBytes > allocationReserve ifTrue: [0] ifFalse: [allocationReserve])]. "allocate interpreter memory" heapBase := objectMemory startOfMemory. objectMemory setHeapBase: heapBase memoryLimit: heapBase + heapSize endOfMemory: heapBase + dataSize. "bogus for Spur" objectMemory allocateMemoryOfSize: objectMemory memoryLimit. "read in the image in bulk, then swap the bytes if necessary" f position: headerSize. count := objectMemory readHeapFromImageFile: f dataBytes: dataSize. count ~= dataSize ifTrue: [self halt]] ensure: [f close]. self ensureImageFormatIsUpToDate: swapBytes. bytesToShift := objectMemory memoryBaseForImageRead - oldBaseAddr. "adjust pointers for zero base address" UIManager default informUser: 'Relocating object pointers...' during: [self initializeInterpreter: bytesToShift]! Item was changed: + ----- Method: StackInterpreterSimulator>>startOfMemory (in category 'initialize-release') ----- - ----- Method: StackInterpreterSimulator>>startOfMemory (in category 'initialization') ----- startOfMemory self shouldNotImplement! From eliot.miranda at gmail.com Tue Nov 10 21:55:49 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Tue, 10 Nov 2020 13:55:49 -0800 Subject: [Vm-dev] [squeak-dev] Current state of the Arm 64 cog vm In-Reply-To: <1605013381-e35215725173a707863ed7c800776110@pckswarms.ch> References: <1604932479-16324668f481548c43d3aebb05f294c6@pckswarms.ch> <1605013381-e35215725173a707863ed7c800776110@pckswarms.ch> Message-ID: On Tue, Nov 10, 2020 at 5:03 AM Bruce O'Neel wrote: > Hi, > > Thanks to everyone who responded. It works perfectly after I installed > > sudo apt install libevdev-dev > presumably this is now necessary in all linux builds? cheers > > bruce > > > > > *09 November 2020 15:34 "Bruce O'Neel" > wrote:* > > Hi, > > What's the current state of the ARM 64 cog VM? Does it build? If not, > what magic is needed... > > Thanks. > > bruce > > <> > > > > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Tue Nov 10 22:54:38 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Tue, 10 Nov 2020 17:54:38 -0500 Subject: [Vm-dev] [SQUEAKVM] SqueakSSL support code updated on squeakvm.org SVN repository Message-ID: <20201110225438.GA50908@shell.msen.com> Hi Ian, Tobias Pape (with others) has done a significant update of the SqueakSSL plugin support code in the opensmalltalk-vm git repository. I have moved his updates into the squeakvm SVN repository. Version history for your original sqUnixOpenSSL.c is preserved with an SVN move to sqUnixOpenSSL.inc, and new files are copied without modification. The config.cmake file is merged and set up to use Tobias' new dynamic lookup mechanism, which handles some issues with inconsistent libraries on some Linux distributions. With these changes, the portable VM (aka interpreter VM) now works with recent images that require https secure connections to servers such as source.squeak.org and squeaksource.org. Cheers, Dave From commits at source.squeak.org Wed Nov 11 03:46:14 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 11 Nov 2020 03:46:14 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2876.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2876.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2876 Author: eem Time: 10 November 2020, 7:46:01.852115 pm UUID: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2 Ancestors: VMMaker.oscog-eem.2875 Cogit: Fix a sign bug in addressIsInCodeZone: which could affect 32-bit VMs. Fix NumTrampolines for COGMTVM, moving the computation to where it belongs, in Cogit. Add a range-check assert to catch overrunning the trampolineTable (failure modes are confusing; e.g. limitAddress got smashed which made Open PIC generation break). Fix the mis-assumption in postGCUpdateDisplayBits that Display bits is always an object (it could be a surface handle). =============== Diff against VMMaker.oscog-eem.2875 =============== Item was changed: ----- Method: CogObjectRepresentationForSpur class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCodeGen - "Deal wuth the fact that the number of trampolines depends on IMMUTABILITY - and that IMMUTABILITY can be defined at compile time. Yes, this is a mess." - | current values | - current := InitializationOptions at: #IMMUTABILITY ifAbsent: nil. - values := #(true false) collect: - [:bool| - InitializationOptions at: #IMMUTABILITY put: bool. - self cogitClass initializeNumTrampolines. - (Cogit classPool at: #NumTrampolines) printString]. - current - ifNil: [InitializationOptions removeKey: #IMMUTABILITY] - ifNotNil: [InitializationOptions at: #IMMUTABILITY put: current]. - values first ~= values last ifTrue: - [aCodeGen addConstantForBinding: #NumTrampolines -> ('(IMMUTABILITY ? ' , values first , ' : ' , values last , ')')]. aCodeGen var: #ceStoreTrampolines + declareC: '#if IMMUTABILITY\sqInt ceStoreTrampolines[', NumStoreTrampolines printString, '];\#endif'! - declareC: '#if IMMUTABILITY\sqInt ceStoreTrampolines[', NumStoreTrampolines printString, '];\#endif'! Item was changed: ----- Method: CogObjectRepresentationForSpur class>>numTrampolines (in category 'trampoline support') ----- numTrampolines ^super numTrampolines + (SistaV1BytecodeSet ifTrue: [9] "(small,large)x(method,block,fullBlock) context creation, ceNewHashTrampoline, ceStoreCheckContextReceiverTrampoline and ceScheduleScavengeTrampoline" ifFalse: [7] "(small,large)x(method,block) context creation, ceNewHashTrampoline, ceStoreCheckContextReceiverTrampoline and ceScheduleScavengeTrampoline") + + (IMMUTABILITY + ifTrue: [NumStoreTrampolines] + ifFalse: [0]) - + NumStoreTrampolines + (SistaVM ifTrue: [1] "inline newHash" ifFalse: [0])! Item was changed: ----- Method: CogX64Compiler>>isWithinMwOffsetRange: (in category 'testing') ----- isWithinMwOffsetRange: anAddress "Answer if an address can be accessed using the offset in a MoveMw:r:R: or similar instruction. We assume this is true for 32-bit processors and expect 64-bit processors to answer false for values in the interpreter or the object memory. Restrict our use of offsets to reference + addresses within the method zone, rather than checking for a 32-bit offset, so as to keep the - addresses within the method zone, rather than checking for a 32-bit offset, si as to keep the simulator and real VM in sync." ^cogit addressIsInCodeZone: anAddress! Item was added: + ----- Method: Cogit class>>bindingForNumTrampolines (in category 'translation') ----- + bindingForNumTrampolines + "The number of trampolines depends on some translation-time constants and some compile-time constants. + This answers a binding the computes the right value for the compile-time defintions." + | mtValues roValues | + mtValues := self numTrampolineValuesFor: #COGMTVM. + roValues := self numTrampolineValuesFor: #IMMUTABILITY. + ^#NumTrampolines -> ('(', (mtValues min min: roValues min) printString, + ' + (COGMTVM ? ', (mtValues max - mtValues min) printString, ' : 0)', + ' + (IMMUTABILITY ? ', (roValues max - roValues min) printString, ' : 0))') + + "self bindingForNumTrampolines"! Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner declareC: '#if COGMTVM\uintptr_t (*ceTryLockVMOwner)(uintptr_t);\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator + addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! Item was added: + ----- Method: Cogit class>>numTrampolineValuesFor: (in category 'translation') ----- + numTrampolineValuesFor: option + | current values | + current := VMBasicConstants classPool at: option. + values := #(true false) collect: + [:bool| + VMBasicConstants classPool at: option put: bool. + self cogitClass initializeNumTrampolines. + Cogit classPool at: #NumTrampolines]. + VMBasicConstants classPool at: option put: current. + ^values! Item was changed: ----- Method: Cogit class>>numTrampolines (in category 'trampoline support') ----- numTrampolines ^37 "29 + 4 each for self and super sends" + + (COGMTVM ifTrue: [1] ifFalse: [0]) "try lock routine" - + (COGMTVM ifTrue: [2] ifFalse: [0]) "try lock/unlock routines" + (LowcodeVM ifTrue: [3] ifFalse: [0]) + CogCompilerClass numTrampolines "self withAllSubclasses collect: [:c| {c. (c instVarNames select: [:ea| ea beginsWith: 'ce']) size}]"! Item was changed: ----- Method: Cogit>>addressIsInCodeZone: (in category 'testing') ----- addressIsInCodeZone: address ^address asUnsignedInteger >= codeBase + and: [address asUnsignedInteger < methodZone zoneEnd]! - and: [address < methodZone zoneEnd]! Item was changed: ----- Method: Cogit>>recordGeneratedRunTime:address: (in category 'initialization') ----- recordGeneratedRunTime: aString address: address + self assert: trampolineTableIndex + 2 <= (NumTrampolines * 2). trampolineAddresses at: trampolineTableIndex put: aString; at: trampolineTableIndex + 1 put: (self cCoerceSimple: address to: #'char *'). + trampolineTableIndex := trampolineTableIndex + 2 + + "self printTrampolineTable"! - trampolineTableIndex := trampolineTableIndex + 2! Item was changed: ----- Method: StackInterpreter>>ioBeDisplay:width:height:depth: (in category 'I/O primitive support') ----- ioBeDisplay: bitsOrHandle width: width height: height depth: depth "Record the position and dimensions of the display bitmap, and inform the display subsystem of the installation of a new display bitmap." - | changed | - changed := displayBits ~= bitsOrHandle. displayBits := bitsOrHandle. displayWidth := width. displayHeight := height. displayDepth := depth. self ioNoteDisplayChanged: bitsOrHandle width: width height: height depth: depth! Item was changed: ----- Method: StackInterpreter>>postGCUpdateDisplayBits (in category 'object memory support') ----- postGCUpdateDisplayBits "Update the displayBits after a GC may have moved it. + Answer if the displayBits appear valid. The wrinkle here is that the displayBits could be a surface handle." - Answer if the displayBits appear valid" | displayObj bitsOop bitsNow | displayObj := objectMemory splObj: TheDisplay. ((objectMemory isPointers: displayObj) + and: [(objectMemory lengthOf: displayObj) >= 4]) ifFalse: - and: [(objectMemory lengthOf: displayObj) >= 4 - and: [objectMemory isWordsOrBytes: (bitsOop := objectMemory fetchPointer: 0 ofObject: displayObj)]]) ifFalse: [^false]. + + bitsOop := objectMemory fetchPointer: 0 ofObject: displayObj. + (objectMemory isIntegerObject: bitsOop) ifTrue: "It's a surface; our work here is done..." + [^true]. + ((objectMemory addressCouldBeObj: bitsOop) + and: [objectMemory isWordsOrBytes: bitsOop]) ifFalse: + [^false]. + (objectMemory hasSpurMemoryManagerAPI and: [objectMemory isPinned: bitsOop]) ifFalse: [bitsNow := self cCode: [objectMemory firstIndexableField: bitsOop] inSmalltalk: [(objectMemory firstIndexableField: bitsOop) asInteger]. displayBits ~= bitsNow ifTrue: [displayBits := bitsNow. + self ioNoteDisplayChanged: displayBits width: displayWidth height: displayHeight depth: displayDepth]. + objectMemory hasSpurMemoryManagerAPI ifTrue: + [objectMemory pinObject: bitsOop]]. - self ioNoteDisplayChanged: displayBits width: displayWidth height: displayHeight depth: displayDepth]]. ^true! From noreply at github.com Wed Nov 11 03:53:53 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 10 Nov 2020 19:53:53 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 4c31c5: Nuke old COGMT lock0-out of fullGC. This is obsol... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 4c31c557b15b7f4052ad46dae300bbb308c875e7 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4c31c557b15b7f4052ad46dae300bbb308c875e7 Author: Eliot Miranda Date: 2020-11-10 (Tue, 10 Nov 2020) Changed paths: M build.linux64ARMv8/HowToBuild M build.macos64x64/common/Makefile.vm M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c M platforms/Cross/vm/sqNamedPrims.c M platforms/Cross/vm/sqVirtualMachine.h M platforms/iOS/vm/OSX/SqueakOSXApplication.m M platforms/unix/vm-display-X11/sqUnixX11.c M platforms/unix/vm/sqUnixMain.c Log Message: ----------- Nuke old COGMT lock0-out of fullGC. This is obsolete given Spur. Move calling ioShutdownAllModules from platforms/unix/vm-display-X11/sqUnixX11.c to platforms/unix/vm/sqUnixMain.c. It should be done for all display configs. Get the COGMTVM to build on build.macos64x64. Quick hack in platforms/iOS/vm/OSX/SqueakOSXApplication.m to get the PharoVM to compile. We are beholding to Christophe for the correct fix. From builds at travis-ci.org Wed Nov 11 04:36:33 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 11 Nov 2020 04:36:33 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2300 (Cog - 4c31c55) In-Reply-To: Message-ID: <5fab6a509ea1f_13fb975caae7c696d@travis-tasks-6c4ffff589-rc85x.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2300 Status: Still Failing Duration: 34 mins and 11 secs Commit: 4c31c55 (Cog) Author: Eliot Miranda Message: Nuke old COGMT lock0-out of fullGC. This is obsolete given Spur. Move calling ioShutdownAllModules from platforms/unix/vm-display-X11/sqUnixX11.c to platforms/unix/vm/sqUnixMain.c. It should be done for all display configs. Get the COGMTVM to build on build.macos64x64. Quick hack in platforms/iOS/vm/OSX/SqueakOSXApplication.m to get the PharoVM to compile. We are beholding to Christophe for the correct fix. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/8114f36f205a...4c31c557b15b View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/742862174?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Nov 11 05:01:01 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 11 Nov 2020 05:01:01 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2877.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2877.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2877 Author: eem Time: 10 November 2020, 9:00:52.40434 pm UUID: 55d7110f-7928-4bfb-9e03-08363928f52b Ancestors: VMMaker.oscog-eem.2876 Nuke the old V3 MTVM. =============== Diff against VMMaker.oscog-eem.2876 =============== Item was changed: ----- Method: VMMaker class>>generateAllCogConfigurationsUnderVersionControl (in category 'configurations') ----- generateAllCogConfigurationsUnderVersionControl self executeDisplayingProgress: (OrderedDictionary new add: 'Generate newspeak spur cog 32bits' -> [ self generateNewspeakSpurCogVM ]; add: 'Generate newspeak spur cog 64bits' -> [ self generateNewspeakSpurCog64VM ]; add: 'Generate squeak cog' -> [ self generateSqueakCogVM ]; - add: 'Generate squeak cog multi-threaded' -> [ self generateSqueakCogMTVM ]; add: 'Generate squeak spur cog 32bits' -> [ self generateSqueakSpurCogVM ]; add: 'Generate squeak spur cog 64bits' -> [ self generateSqueakSpurCog64VM ]; add: 'Generate squeak spur cog sista 32bits' -> [ self generateSqueakSpurCogSistaVM ]; add: 'Generate squeak spur cog sista 64bits' -> [ self generateSqueakSpurCogSista64VM ]; yourself)! Item was changed: ----- Method: VMMaker class>>generateAllNonSpurConfigurationsUnderVersionControl (in category 'configurations') ----- generateAllNonSpurConfigurationsUnderVersionControl self executeDisplayingProgress: (OrderedDictionary with: 'Generate squeak cog' -> [ self generateSqueakCogVM ] - with: 'Generate squeak cog multi-threaded' -> [ self generateSqueakCogMTVM ] with: 'Generate squeak stack' -> [ self generateSqueakStackVM ])! Item was changed: ----- Method: VMMaker class>>generateAllSqueakConfigurationsUnderVersionControl (in category 'configurations') ----- generateAllSqueakConfigurationsUnderVersionControl self executeDisplayingProgress: (OrderedDictionary new add: 'Generate squeak stack' -> [ self generateSqueakStackVM ]; add: 'Generate squeak cog' -> [ self generateSqueakCogVM ]; - add: 'Generate squeak cog multi-threaded' -> [ self generateSqueakCogMTVM ]; add: 'Generate squeak spur stack 32bits' -> [ self generateSqueakSpurStackVM ]; add: 'Generate squeak spur stack 64bits' -> [ self generateSqueakSpurStack64VM ]; add: 'Generate squeak spur cog 32bits' -> [ self generateSqueakSpurCogVM ]; add: 'Generate squeak spur cog 64bits' -> [ self generateSqueakSpurCog64VM ]; add: 'Generate squeak spur cog sista 32bits' -> [ self generateSqueakSpurCogSistaVM ]; add: 'Generate squeak spur cog sista 64bits' -> [ self generateSqueakSpurCogSista64VM ]; add: 'Generate squeak spur cog multi-threaded 32bits' -> [ self generateSqueakSpurCogMTVM ]; add: 'Generate squeak spur cog multi-threaded 64bits' -> [ self generateSqueakSpurCog64MTVM ]; yourself)! Item was removed: - ----- Method: VMMaker class>>generateSqueakCogMTVM (in category 'configurations') ----- - generateSqueakCogMTVM - ^self generateSqueakCogVMWithInterpreterClass: CoInterpreterMT - options: #(COGMTVM true)! From noreply at github.com Wed Nov 11 05:07:58 2020 From: noreply at github.com (Eliot Miranda) Date: Tue, 10 Nov 2020 21:07:58 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] db05a5: CogVM source as per VMMaker.oscog-eem.2877 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: db05a53a9f41dc87aafed07cc83d1ff22b46d42c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/db05a53a9f41dc87aafed07cc83d1ff22b46d42c Author: Eliot Miranda Date: 2020-11-10 (Tue, 10 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c 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 spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c 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/cogitARMv8.c 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/cogitARMv8.c 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 spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/interp.h M spurstacksrc/vm/validImage.c M src/plugins/AioPlugin/AioPlugin.c M src/plugins/FilePlugin/FilePlugin.c M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c M src/plugins/SqueakFFIPrims/ARM64FFIPlugin.c M src/plugins/SqueakFFIPrims/IA32FFIPlugin.c M src/plugins/SqueakFFIPrims/X64SysVFFIPlugin.c M src/plugins/SqueakFFIPrims/X64Win64FFIPlugin.c M src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c M src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.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 R src/vm/cointerpmt.c M src/vm/cointerpmt.h M src/vm/gcc3x-cointerp.c R 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.2877 Cogit: Fix a sign bug in addressIsInCodeZone: which could affect 32-bit VMs. Fix NumTrampolines for COGMTVM. COGMTVM: Nuke the old V3 MTVM. Nuke the old V3 GC lock hack. Use DisownVMForThreading as disown flag in primitiveFileReadPinningAndDisowning rather than DisownVMForFFICall because this flag is used for the fail-on-ffi-exceptin machinery. Change to Cogit>>tryLockVMOwnerTo: from tryLockVMOwner: & tryLockVMToIndex:. Interpreter: Fix the mis-assumption in postGCUpdateDisplayBits that Display bits is always an object (it could be a surface handle). Have print[Stack]CallStackOf: handle active process (suspendedContext isNil). AioPlugin as per VMConstruction-Plugins-AioPlugin.oscog-eem.26. From builds at travis-ci.org Wed Nov 11 05:42:00 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 11 Nov 2020 05:42:00 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2301 (Cog - db05a53) In-Reply-To: Message-ID: <5fab79a852fcc_13fb975caaf6c3138a@travis-tasks-6c4ffff589-rc85x.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2301 Status: Still Failing Duration: 32 mins and 48 secs Commit: db05a53 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2877 Cogit: Fix a sign bug in addressIsInCodeZone: which could affect 32-bit VMs. Fix NumTrampolines for COGMTVM. COGMTVM: Nuke the old V3 MTVM. Nuke the old V3 GC lock hack. Use DisownVMForThreading as disown flag in primitiveFileReadPinningAndDisowning rather than DisownVMForFFICall because this flag is used for the fail-on-ffi-exceptin machinery. Change to Cogit>>tryLockVMOwnerTo: from tryLockVMOwner: & tryLockVMToIndex:. Interpreter: Fix the mis-assumption in postGCUpdateDisplayBits that Display bits is always an object (it could be a surface handle). Have print[Stack]CallStackOf: handle active process (suspendedContext isNil). AioPlugin as per VMConstruction-Plugins-AioPlugin.oscog-eem.26. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/4c31c557b15b...db05a53a9f41 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/742870373?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Nov 11 05:44:36 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 11 Nov 2020 05:44:36 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2303 Message-ID: <20201111054436.1.B0B11C88BE855DA5@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Nov 11 07:33:51 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 11 Nov 2020 07:33:51 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2304 Message-ID: <20201111073351.1.A8BF2C14DD16C266@appveyor.com> An HTML attachment was scrubbed... URL: From stes at telenet.be Wed Nov 11 11:47:28 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Wed, 11 Nov 2020 12:47:28 +0100 (CET) Subject: [Vm-dev] [SQUEAKVM] SqueakSSL support code updated on squeakvm.org SVN repository Message-ID: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I've emailed some patches a while ago to Ian Piumarta but had no response. 01-aio.patch 04-sunproversion.patch 02-sqUnixSoundPulseAudio.patch 05-installdoc.patch 03-sqUnixSoundSun.patch I use those patches to compile with SunPRO cc compiler squeak-4 on Solaris 11. Those are minor patches; anyway it is a good thing that the subversion (SVN) repository remains only for reference how the squeak-4 sources were. Just to be able to compare to the old sources the SVN repo is really nice ... David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfq87BAAoJEAwpOKXMq1Ma+CoIAIM96azxWsadClIAG7cv2K+O RU542mP8DWeu7T7nEthmL0EpVb/z2tBmug0JteLQrlxTFHSknmoYp2LBh9m7RerE r+irS2Ar2ELP+SKJ8Nb+Ba9vZpRin46bZ64idiJgxi2ak9keyQMnWSzb3bjltrtF Fm1M4ivPIPEeVwTiBOo3Iz9baCGiJaYscqjWWr9aGpsVFKXp6Lh10vBU2tqsdH2A lUK7wRB3/p9zaQES7zUCAmoj4picUYdvXgYR09lEAiDgvcnvukVSyPviLdqZF6if blChKZPkmCaTVHjgQ02OhvnjATygDZZKlbIHfK4KiLmkU6IL1EUyzXOCkvsNlnY= =cnQl -----END PGP SIGNATURE----- From noreply at github.com Thu Nov 12 01:36:29 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 11 Nov 2020 17:36:29 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f86d85: Have LoadReader set the processHasThreadId bit if ... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f86d8551390cd5d9fa7aa2f3c4cae5334d05b2d9 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f86d8551390cd5d9fa7aa2f3c4cae5334d05b2d9 Author: Eliot Miranda Date: 2020-11-11 (Wed, 11 Nov 2020) Changed paths: M image/LoadReader.st Log Message: ----------- Have LoadReader set the processHasThreadId bit if it's appropriate and unset. From commits at source.squeak.org Thu Nov 12 02:16:21 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 12 Nov 2020 02:16:21 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2878.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2878.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2878 Author: eem Time: 11 November 2020, 6:16:10.058202 pm UUID: 3916b8e8-4967-46d8-b2ca-45a1091519e2 Ancestors: VMMaker.oscog-eem.2877 Fix a slip declaring ceTryLockVMOwner. Yet more effort correctly computing numTrampolines. =============== Diff against VMMaker.oscog-eem.2877 =============== Item was changed: ----- Method: Cogit class>>bindingForNumTrampolines (in category 'translation') ----- bindingForNumTrampolines "The number of trampolines depends on some translation-time constants and some compile-time constants. This answers a binding the computes the right value for the compile-time defintions." | mtValues roValues | + self savingCurrentValuesOf: #(COGMTVM IMMUTABILITY) + do: [mtValues := self numTrampolineValuesFor: #COGMTVM. + roValues := self numTrampolineValuesFor: #IMMUTABILITY]. - mtValues := self numTrampolineValuesFor: #COGMTVM. - roValues := self numTrampolineValuesFor: #IMMUTABILITY. ^#NumTrampolines -> ('(', (mtValues min min: roValues min) printString, ' + (COGMTVM ? ', (mtValues max - mtValues min) printString, ' : 0)', ' + (IMMUTABILITY ? ', (roValues max - roValues min) printString, ' : 0))') "self bindingForNumTrampolines"! Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner + declareC: '#if COGMTVM\uintptr_t (*ceTryLockVMOwner)(uintptr_t)\#endif'. - declareC: '#if COGMTVM\uintptr_t (*ceTryLockVMOwner)(uintptr_t);\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! Item was added: + ----- Method: Cogit class>>savingCurrentValuesOf:do: (in category 'translation') ----- + savingCurrentValuesOf: anArrayOfOptions do: aBlock + | current | + current := anArrayOfOptions collect: [:option| VMBasicConstants classPool at: option]. + anArrayOfOptions do: [:option| VMBasicConstants classPool at: option put: false]. + ^aBlock ensure: + [anArrayOfOptions with: current do: + [:option :value| VMBasicConstants classPool at: option put: value]]! From builds at travis-ci.org Thu Nov 12 02:22:10 2020 From: builds at travis-ci.org (Travis CI) Date: Thu, 12 Nov 2020 02:22:10 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2302 (Cog - f86d855) In-Reply-To: Message-ID: <5fac9c55b085a_13fc561bd42a8478f0@travis-tasks-6698c55758-5p696.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2302 Status: Still Failing Duration: 44 mins and 23 secs Commit: f86d855 (Cog) Author: Eliot Miranda Message: Have LoadReader set the processHasThreadId bit if it's appropriate and unset. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/db05a53a9f41...f86d8551390c View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/743078392?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Thu Nov 12 02:23:02 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 11 Nov 2020 18:23:02 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] afcd23: CogVM source as per VMMaker.oscog-eem.2878 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: afcd238df30836bd8586111585116cda4f9be432 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/afcd238df30836bd8586111585116cda4f9be432 Author: Eliot Miranda Date: 2020-11-11 (Wed, 11 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M src/vm/cogit.h M src/vm/cogitARMv5.c M src/vm/cogitIA32.c M src/vm/cogitMIPSEL.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2878 Fix a slip declaring ceTryLockVMOwner. [ci skip] From commits at source.squeak.org Thu Nov 12 02:26:43 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 12 Nov 2020 02:26:43 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2879.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2879.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2879 Author: eem Time: 11 November 2020, 6:26:32.227544 pm UUID: d024a598-2be9-4f62-a1fa-dd832d57dfd0 Ancestors: VMMaker.oscog-eem.2878 And linux doesn't pick up sys/types.h in cogit.c so type ceTryLockVMOwner using usqIntptr_t. =============== Diff against VMMaker.oscog-eem.2878 =============== Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner + declareC: '#if COGMTVM\usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t)\#endif'. - declareC: '#if COGMTVM\uintptr_t (*ceTryLockVMOwner)(uintptr_t)\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! From commits at source.squeak.org Thu Nov 12 02:27:41 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 12 Nov 2020 02:27:41 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2879.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2879.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2879 Author: eem Time: 11 November 2020, 6:26:32.227544 pm UUID: d024a598-2be9-4f62-a1fa-dd832d57dfd0 Ancestors: VMMaker.oscog-eem.2878 And linux doesn't pick up sys/types.h in cogit.c so type ceTryLockVMOwner using usqIntptr_t. =============== Diff against VMMaker.oscog-eem.2878 =============== Item was changed: ----- Method: Cogit class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator | backEnd | backEnd := CogCompilerClass basicNew. #( 'coInterpreter' 'objectMemory' 'methodZone' 'objectRepresentation' 'cogBlockMethodSurrogateClass' 'cogMethodSurrogateClass' 'nsSendCacheSurrogateClass' 'threadManager' 'processor' 'lastNInstructions' 'simulatedAddresses' 'simulatedTrampolines' 'simulatedVariableGetters' 'simulatedVariableSetters' 'processorFrameValid' 'printRegisters' 'printInstructions' 'clickConfirm' 'singleStep') do: [:simulationVariableNotNeededForRealVM| aCCodeGenerator removeVariable: simulationVariableNotNeededForRealVM]. NewspeakVM ifFalse: [#( 'selfSendTrampolines' 'dynamicSuperSendTrampolines' 'implicitReceiverSendTrampolines' 'outerSendTrampolines' 'ceEnclosingObjectTrampoline' 'numIRCs' 'indexOfIRC' 'theIRCs') do: [:variableNotNeededInNormalVM| aCCodeGenerator removeVariable: variableNotNeededInNormalVM]]. aCCodeGenerator removeConstant: #COGMTVM. "this should be defined at compile time" aCCodeGenerator addHeaderFile:''; "for e.g. offsetof" addHeaderFile:'"sqCogStackAlignment.h"'; addHeaderFile:'"dispdbg.h"'; "must precede cointerp.h & cogit.h otherwise NoDbgRegParms gets screwed up" addHeaderFile:'"cogmethod.h"'. NewspeakVM ifTrue: [aCCodeGenerator addHeaderFile:'"nssendcache.h"']. aCCodeGenerator addHeaderFile:'#if COGMTVM'; addHeaderFile:'"cointerpmt.h"'; addHeaderFile:'#else'; addHeaderFile:'"cointerp.h"'; addHeaderFile:'#endif'; addHeaderFile:'"cogit.h"'. aCCodeGenerator var: #ceGetFP declareC: 'usqIntptr_t (*ceGetFP)(void)'; var: #ceGetSP declareC: 'usqIntptr_t (*ceGetSP)(void)'; var: #ceCaptureCStackPointers declareC: 'void (*ceCaptureCStackPointers)(void)'; var: #ceInvokeInterpret declareC: 'void (*ceInvokeInterpret)(void)'; var: #ceEnterCogCodePopReceiverReg declareC: 'void (*ceEnterCogCodePopReceiverReg)(void)'; var: #realCEEnterCogCodePopReceiverReg declareC: 'void (*realCEEnterCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverReg declareC: 'void (*ceCallCogCodePopReceiverReg)(void)'; var: #realCECallCogCodePopReceiverReg declareC: 'void (*realCECallCogCodePopReceiverReg)(void)'; var: #ceCallCogCodePopReceiverAndClassRegs declareC: 'void (*ceCallCogCodePopReceiverAndClassRegs)(void)'; var: #realCECallCogCodePopReceiverAndClassRegs declareC: 'void (*realCECallCogCodePopReceiverAndClassRegs)(void)'; var: #postCompileHook declareC: 'void (*postCompileHook)(CogMethod *)'; var: #openPICList declareC: 'CogMethod *openPICList = 0'; var: #maxMethodBefore type: #'CogBlockMethod *'; var: 'enumeratingCogMethod' type: #'CogMethod *'. aCCodeGenerator var: #ceTryLockVMOwner + declareC: '#if COGMTVM\usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t)\#endif'. - declareC: '#if COGMTVM\uintptr_t (*ceTryLockVMOwner)(uintptr_t)\#endif'. backEnd numICacheFlushOpcodes > 0 ifTrue: [aCCodeGenerator var: #ceFlushICache declareC: 'static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to)']. aCCodeGenerator var: #ceFlushDCache declareC: '#if DUAL_MAPPED_CODE_ZONE\static void (*ceFlushDCache)(usqIntptr_t from, usqIntptr_t to)\#endif'; var: #codeToDataDelta declareC: '#if DUAL_MAPPED_CODE_ZONE\static sqInt codeToDataDelta\#else\# define codeToDataDelta 0\#endif'. aCCodeGenerator declareVar: 'aMethodLabel' type: #'AbstractInstruction'; "Has to come lexicographically before backEnd & methodLabel" var: #backEnd declareC: 'AbstractInstruction * const backEnd = &aMethodLabel'; var: #methodLabel declareC: 'AbstractInstruction * const methodLabel = &aMethodLabel'. self declareC: #(abstractOpcodes stackCheckLabel blockEntryLabel blockEntryNoContextSwitch stackOverflowCall sendMiss entry noCheckEntry selfSendEntry dynSuperEntry fullBlockNoContextSwitchEntry fullBlockEntry picMNUAbort picInterpretAbort endCPICCase0 endCPICCase1 cPICEndOfCodeLabel) as: #'AbstractInstruction *' in: aCCodeGenerator. aCCodeGenerator declareVar: #cPICPrototype type: #'CogMethod *'; declareVar: #blockStarts type: #'BlockStart *'; declareVar: #fixups type: #'BytecodeFixup *'; declareVar: #methodZoneBase type: #usqInt. aCCodeGenerator var: #ordinarySendTrampolines declareC: 'sqInt ordinarySendTrampolines[NumSendTrampolines]'; var: #superSendTrampolines declareC: 'sqInt superSendTrampolines[NumSendTrampolines]'. BytecodeSetHasDirectedSuperSend ifTrue: [aCCodeGenerator var: #directedSuperSendTrampolines declareC: 'sqInt directedSuperSendTrampolines[NumSendTrampolines]'; var: #directedSuperBindingSendTrampolines declareC: 'sqInt directedSuperBindingSendTrampolines[NumSendTrampolines]']. NewspeakVM ifTrue: [aCCodeGenerator var: #selfSendTrampolines declareC: 'sqInt selfSendTrampolines[NumSendTrampolines]'; var: #dynamicSuperSendTrampolines declareC: 'sqInt dynamicSuperSendTrampolines[NumSendTrampolines]'; var: #implicitReceiverSendTrampolines declareC: 'sqInt implicitReceiverSendTrampolines[NumSendTrampolines]'; var: #outerSendTrampolines declareC: 'sqInt outerSendTrampolines[NumSendTrampolines]']. aCCodeGenerator addConstantForBinding: self bindingForNumTrampolines; var: #trampolineAddresses declareC: 'static char *trampolineAddresses[NumTrampolines*2]'; var: #objectReferencesInRuntime declareC: 'static usqInt objectReferencesInRuntime[NumObjRefsInRuntime+1]'; var: #labelCounter type: #int; var: #traceFlags declareC: 'int traceFlags = 8 /* prim trace log on by default */'; var: #cStackAlignment declareC: 'const int cStackAlignment = STACK_ALIGN_BYTES'. aCCodeGenerator declareVar: #minValidCallAddress type: #'usqIntptr_t'. aCCodeGenerator vmClass generatorTable ifNotNil: [:bytecodeGenTable| aCCodeGenerator var: #generatorTable declareC: 'static BytecodeDescriptor generatorTable[', bytecodeGenTable size printString, ']', (self tableInitializerFor: bytecodeGenTable in: aCCodeGenerator)]. "In C the abstract opcode names clash with the Smalltalk generator syntactic sugar. Most of the syntactic sugar is inlined, but alas some remains. Rename the syntactic sugar to avoid the clash." (self organization listAtCategoryNamed: #'abstract instructions') do: [:s| aCCodeGenerator addSelectorTranslation: s to: 'g', (aCCodeGenerator cFunctionNameFor: s)]. aCCodeGenerator addSelectorTranslation: #halt: to: 'haltmsg'. self declareFlagVarsAsByteIn: aCCodeGenerator! From noreply at github.com Thu Nov 12 02:34:04 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 11 Nov 2020 18:34:04 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 9d27ce: CogVM source as per VMMaker.oscog-eem.2879 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 9d27ce456f125e82847232a82176f2ee01007d7c https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9d27ce456f125e82847232a82176f2ee01007d7c Author: Eliot Miranda Date: 2020-11-11 (Wed, 11 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M src/vm/cogit.h M src/vm/cogitARMv5.c M src/vm/cogitIA32.c M src/vm/cogitMIPSEL.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2879 And linux doesn't pick up sys/types.h in cogit.c so type ceTryLockVMOwner using usqIntptr_t. [ci skip] From commits at source.squeak.org Thu Nov 12 02:39:48 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 12 Nov 2020 02:39:48 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2880.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2880.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2880 Author: eem Time: 11 November 2020, 6:39:39.03013 pm UUID: 6baaab83-7f09-434a-9db1-affff34cc15a Ancestors: VMMaker.oscog-eem.2879 ...and there's a lot more where that came from. =============== Diff against VMMaker.oscog-eem.2879 =============== Item was changed: ----- Method: CoInterpreter>>isCFramePointerInUse:_: (in category 'cog jit support') ----- isCFramePointerInUse: cFrmPtrPtr _: cStkPtrPtr + + - - "This must be implemented externally, e.g. in sqPlatMain.c." ^self class initializationOptions at: #isCFramePointerInUse ifAbsent: [true]! Item was changed: ----- Method: CogClass>>cCoerceSimple:to: (in category 'translation support') ----- cCoerceSimple: value to: cTypeString "Type coercion for translation and simulation. For simulation answer a suitable surrogate for the struct types" ^cTypeString caseOf: { [#'unsigned long'] -> [value]. [#'unsigned int'] -> [value]. [#'unsigned short'] -> [value]. [#sqInt] -> [value]. [#'sqIntptr_t'] -> [value]. [#'usqIntptr_t'] -> [value]. [#usqInt] -> [value]. [#sqLong] -> [value]. [#usqLong] -> [value]. [#'AbstractInstruction *'] -> [value]. [#'SpurSegmentInfo *'] -> [value]. [#'BytecodeFixup *'] -> [value]. [#'CogMethod *'] -> [value]. [#'char *'] -> [value]. [#'sqInt *'] -> [value]. [#'void *'] -> [value]. [#void] -> [value]. [#'void (*)()'] -> [value]. [#'void (*)(void)'] -> [value]. [#'usqIntptr_t (*)(void)'] -> [value]. [#'void (*)(usqIntptr_t,usqIntptr_t)'] -> [value]. + [#'usqIntptr_t (*)(usqIntptr_t)'] -> [value]. + [#'usqIntptr_t (*)(void)'] -> [value] }! - [#'uintptr_t (*)(uintptr_t)'] -> [value]. - [#'uintptr_t (*)(void)'] -> [value] }! Item was changed: ----- Method: CogIA32Compiler class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator aCCodeGenerator + declareVar: 'cpuidWord0' type: #usqIntptr_t; + declareVar: 'cpuidWord1' type: #usqIntptr_t! - declareVar: 'cpuidWord0' type: #uintptr_t; - declareVar: 'cpuidWord1' type: #uintptr_t! Item was changed: ----- Method: CogIA32Compiler>>detectFeatures (in category 'feature detection') ----- detectFeatures "Do a throw-away compilation to get at the cpuid info and initialize cpuidWord0 and cpuidWord1. N.B. All of MSVC, gcc & clang have intrinsics for this, so if you have the energy by all means reimplement as an #if _MSC_VER...#elif __GNUC__ #else ... saga." | startAddress cpuid | + - startAddress := cogit methodZoneBase. cogit allocateOpcodes: 10 bytecodes: 0. + cpuid := cogit cCoerceSimple: cogit methodZoneBase to: #'usqIntptr_t (*)(usqIntptr_t)'. - cpuid := cogit cCoerceSimple: cogit methodZoneBase to: #'uintptr_t (*)(uintptr_t)'. cogit PushR: EDX; PushR: ECX; PushR: EBX; MoveMw: 16 "3 saved registers plus return pc" r: ESP R: EAX; gen: CPUID; MoveR: EDX R: EAX; PopR: EBX; PopR: ECX; PopR: EDX; RetN: 0. cogit outputInstructionsForGeneratedRuntimeAt: startAddress. cogit resetMethodZoneBase: startAddress. self setCpuidWord0: (self cCode: 'cpuid(1)' inSmalltalk: [self cpuid: 1]). cogit zeroOpcodeIndexForNewOpcodes. cogit PushR: EDX; PushR: ECX; PushR: EBX; MoveMw: 16 "3 saved registers plus return pc" r: ESP R: EAX; gen: CPUID; MoveR: ECX R: EAX; PopR: EBX; PopR: ECX; PopR: EDX; RetN: 0. cogit outputInstructionsForGeneratedRuntimeAt: startAddress. cogit resetMethodZoneBase: startAddress. self setCpuidWord1: (self cCode: 'cpuid(0x80000001)' inSmalltalk: [self cpuid: 16r80000001])! Item was changed: ----- Method: CogX64Compiler class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator aCCodeGenerator + declareVar: 'cpuidWord1' type: #usqIntptr_t! - declareVar: 'cpuidWord1' type: #uintptr_t! Item was changed: ----- Method: CogX64Compiler>>detectFeatures (in category 'feature detection') ----- detectFeatures "Do a throw-away compilation to get at the cpuid info and initialize cpuidWord1 N.B. All of MSVC, gcc & clang have intrinsics for this, so if you have the energy by all means reimplement as an #if _MSC_VER...#elif __GNUC__ #else ... saga." | startAddress cpuid | + - startAddress := cogit methodZoneBase. cogit allocateOpcodes: 10 bytecodes: 0. + cpuid := cogit cCoerceSimple: startAddress to: #'usqIntptr_t (*)(void)'. - cpuid := cogit cCoerceSimple: startAddress to: #'uintptr_t (*)(void)'. cogit PushR: RDX; PushR: RCX; PushR: RBX; MoveCq: 16r80000001 R: RAX; gen: CPUID; MoveR: RCX R: RAX; PopR: RBX; PopR: RCX; PopR: RDX; RetN: 0. cogit outputInstructionsForGeneratedRuntimeAt: startAddress. cogit resetMethodZoneBase: startAddress. self setCpuidWord1: (self cCode: 'cpuid()' inSmalltalk: [cogit simulateLeafCallOf: startAddress])! Item was changed: ----- Method: Cogit>>generateVMOwnerLockFunctions (in category 'initialization') ----- generateVMOwnerLockFunctions self cppIf: COGMTVM ifTrue: [| startAddress | self allocateOpcodes: backEnd numLowLevelLockOpcodes bytecodes: 0. self zeroOpcodeIndex. startAddress := methodZoneBase. backEnd generateLowLevelTryLock: coInterpreter vmOwnerAddress. self outputInstructionsForGeneratedRuntimeAt: startAddress. self recordGeneratedRunTime: 'ceTryLockVMOwner' address: startAddress. + ceTryLockVMOwner := self cCoerceSimple: startAddress to: #'usqIntptr_t (*)(usqIntptr_t)']! - ceTryLockVMOwner := self cCoerceSimple: startAddress to: #'uintptr_t (*)(uintptr_t)']! Item was changed: ----- Method: StackInterpreter>>lowcodePrimitiveInt32ToPointer (in category 'inline primitive generated code') ----- lowcodePrimitiveInt32ToPointer "Lowcode instruction generator" | value result | value := self internalPopStackInt32. + result := self cCoerce: (self cCoerce: value to: 'usqIntptr_t') to: 'char*'. - result := self cCoerce: (self cCoerce: value to: 'uintptr_t') to: 'char*'. self internalPushPointer: result. ! Item was changed: ----- Method: StackInterpreter>>lowcodePrimitivePointerToInt32 (in category 'inline primitive generated code') ----- lowcodePrimitivePointerToInt32 "Lowcode instruction generator" | pointer result | pointer := self internalPopStackPointer. + result := self cCoerce: pointer to: 'usqIntptr_t'. - result := self cCoerce: pointer to: 'uintptr_t'. self internalPushInt32: result. ! Item was changed: ----- Method: StackInterpreter>>lowcodePrimitivePointerToInt64 (in category 'inline primitive generated code') ----- lowcodePrimitivePointerToInt64 "Lowcode instruction generator" | pointer result | pointer := self internalPopStackPointer. + result := self cCoerce: pointer to: 'usqIntptr_t'. - result := self cCoerce: pointer to: 'uintptr_t'. self internalPushInt64: result. ! From noreply at github.com Thu Nov 12 02:50:38 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 11 Nov 2020 18:50:38 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 7308cc: CogVM source as per VMMaker.oscog-eem.2880 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 7308ccacf448eb09b77c1e462d6136451014499e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7308ccacf448eb09b77c1e462d6136451014499e Author: Eliot Miranda Date: 2020-11-11 (Wed, 11 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c 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 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 nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c 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 spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c 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 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 spurlowcodestack64src/vm/gcc3x-interp.c M spurlowcodestack64src/vm/interp.c M spurlowcodestacksrc/vm/gcc3x-interp.c M spurlowcodestacksrc/vm/interp.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c 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 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 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 spurstack64src/vm/gcc3x-interp.c M spurstack64src/vm/interp.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/validImage.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/gcc3x-cointerp.c M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2880 linux doesn't pick up sys/types.h in core vm so use usqIntptr_t not uintptr_t. From no-reply at appveyor.com Thu Nov 12 03:27:02 2020 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 12 Nov 2020 03:27:02 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2305 Message-ID: <20201112032702.1.102A053B9356053D@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Thu Nov 12 03:29:48 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 11 Nov 2020 19:29:48 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f3103e: Fix COGMTVM & FileAttributePlugin compilation erro... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f3103e1c553d5a916733d8150a1761df7c71a1e1 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f3103e1c553d5a916733d8150a1761df7c71a1e1 Author: Eliot Miranda Date: 2020-11-11 (Wed, 11 Nov 2020) Changed paths: M build.linux64ARMv8/HowToBuild A build.linux64ARMv8/squeak.cogmt.spur/build.assert/mvm A build.linux64ARMv8/squeak.cogmt.spur/build.debug/mvm A build.linux64ARMv8/squeak.cogmt.spur/build/mvm A build.linux64ARMv8/squeak.cogmt.spur/makeclean A build.linux64ARMv8/squeak.cogmt.spur/makedirty A build.linux64ARMv8/squeak.cogmt.spur/plugins.ext A build.linux64ARMv8/squeak.cogmt.spur/plugins.int M platforms/Cross/plugins/FileAttributesPlugin/faCommon.c M platforms/Cross/plugins/FileAttributesPlugin/faCommon.h M platforms/unix/vm/sqUnixThreads.c Log Message: ----------- Fix COGMTVM & FileAttributePlugin compilation errors on Manjaro ARMv8 Add an MT build for build.linux64ARMv8. From noreply at github.com Thu Nov 12 03:31:24 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 11 Nov 2020 19:31:24 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] b0e63a: Minor edit [ci skip] Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: b0e63a85a96d4f74f6c11016282ed56780198209 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/b0e63a85a96d4f74f6c11016282ed56780198209 Author: Eliot Miranda Date: 2020-11-11 (Wed, 11 Nov 2020) Changed paths: M build.linux64ARMv8/squeak.cogmt.spur/build.assert/mvm M build.linux64ARMv8/squeak.cogmt.spur/build.debug/mvm M build.linux64ARMv8/squeak.cogmt.spur/build/mvm Log Message: ----------- Minor edit [ci skip] From no-reply at appveyor.com Thu Nov 12 03:37:15 2020 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 12 Nov 2020 03:37:15 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2306 Message-ID: <20201112033715.1.A5BE4A41091963E7@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Thu Nov 12 05:35:54 2020 From: builds at travis-ci.org (Travis CI) Date: Thu, 12 Nov 2020 05:35:54 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2303 (Cog - 7308cca) In-Reply-To: Message-ID: <5facc9baa504_13ff8d8be8fb4655c8@travis-tasks-55579b88c8-bvgm8.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2303 Status: Still Failing Duration: 2 hrs, 44 mins, and 6 secs Commit: 7308cca (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2880 linux doesn't pick up sys/types.h in core vm so use usqIntptr_t not uintptr_t. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/9d27ce456f12...7308ccacf448 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/743088032?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Thu Nov 12 05:39:25 2020 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 12 Nov 2020 05:39:25 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2308 Message-ID: <20201112053925.1.473B20FCFD4728F3@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Thu Nov 12 06:52:17 2020 From: builds at travis-ci.org (Travis CI) Date: Thu, 12 Nov 2020 06:52:17 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2304 (Cog - f3103e1) In-Reply-To: Message-ID: <5facdba17d63c_13f90cccdd36c163137@travis-tasks-55579b88c8-pgpg9.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2304 Status: Still Failing Duration: 3 hrs, 21 mins, and 19 secs Commit: f3103e1 (Cog) Author: Eliot Miranda Message: Fix COGMTVM & FileAttributePlugin compilation errors on Manjaro ARMv8 Add an MT build for build.linux64ARMv8. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/7308ccacf448...f3103e1c553d View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/743092330?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Thu Nov 12 07:29:33 2020 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 12 Nov 2020 07:29:33 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2309 Message-ID: <20201112072933.1.66E98C5C9AC2BEA3@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Fri Nov 13 04:19:06 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 13 Nov 2020 04:19:06 0000 Subject: [Vm-dev] VM Maker: CogPools-ISAs-eem.12.mcz Message-ID: Eliot Miranda uploaded a new version of CogPools-ISAs to project VM Maker: http://source.squeak.org/VMMaker/CogPools-ISAs-eem.12.mcz ==================== Summary ==================== Name: CogPools-ISAs-eem.12 Author: eem Time: 12 November 2020, 8:19:03.781938 pm UUID: f332f7eb-c22a-4d78-99e8-bfa62c9f3f3c Ancestors: CogPools-ISAs-eem.11 Support for ClosedVMMaker-eem.111. Implement the 8.0 version of ceTryLockVMOwner above LDAXR/STLXR/CLREX, adding spiffy new CBNZ/CBZ. =============== Diff against CogPools-ISAs-eem.11 =============== Item was changed: ----- Method: ARMv8A64Opcodes class>>extractOffsetFromLoadStore: (in category 'accessing') ----- extractOffsetFromLoadStore: word "C4.1.4 Loads and Stores C4-266 Table C4-5 Encoding table for the Loads and Stores group LDAPR/STLR (unscaled immediate) on page C4-279 signed imm9 12 - 20 Load/store register (unscaled immediate) on page C4-283 signed imm9 12 - 20 Load/store register (immediate post-indexed) on page C4-284 signed imm9 12 - 20 Load/store register (immediate pre-indexed) on page C4-286 signed imm9 12 - 20 Load/store register (pac) on page C4-297 signed imm9 12 - 20 Load/store register (unsigned immediate) on page C4-297 unsigned imm12 21 - 10 + Load/store register pair (signed immediate) on page C4-282 signed imm7 15 - 21 + LDAXR/STRXR register on page C4-279" - Load/store register pair (sugned immediate) on page C4-282 signed imm7 15 - 21" "(word >> 23 bitAnd: 2r001110110) binary" ^(word >> 23 bitAnd: 2r001110110) caseOf: { [2r001110010 "ld/st unsigned immediate op0 = xx11, b27=1, b25=0, op2 = 1x"] -> [(word >> 10 bitAnd: 1 << 12 - 1) bitShift: word >> 30]. [2r001010010] "ldp/stp op0=xx10, b27=1, op2 = 10" -> [(word >> 15 bitAnd: 1 << 7 - 1) - (word >> 14 bitAnd: 1 << 7) << 3]. + [2r000010000] "ldaxr op0=1, o1=1, op2 = 0" + -> [0]. } otherwise: [(word >> 12 bitAnd: 1 << 9 - 1) - (word >> 11 bitAnd: 1 << 9)]! From commits at source.squeak.org Fri Nov 13 04:20:00 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 13 Nov 2020 04:20:00 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2881.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2881.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2881 Author: eem Time: 12 November 2020, 8:19:51.34424 pm UUID: 79cfb342-74fc-4cac-b8c1-34a5beace8be Ancestors: VMMaker.oscog-eem.2880 generateLowLevelUnlock: is unused. =============== Diff against VMMaker.oscog-eem.2880 =============== Item was removed: - ----- Method: CogAbstractInstruction>>generateLowLevelUnlock: (in category 'multi-threading') ----- - generateLowLevelUnlock: vmOwnerLockAddress - self subclassResponsibility! Item was removed: - ----- Method: CogIA32Compiler>>generateLowLevelUnlock: (in category 'multi-threading') ----- - generateLowLevelUnlock: vmOwnerLockAddress - vmOwnerLockAddress ~= 0 ifTrue: - [cogit - MoveCq: 0 R: EAX; - MoveR: EAX Aw: vmOwnerLockAddress; - gen: SFENCE]. - cogit RetN: 0! Item was removed: - ----- Method: CogX64Compiler>>generateLowLevelUnlock: (in category 'multi-threading') ----- - generateLowLevelUnlock: vmOwnerLockAddress - vmOwnerLockAddress ~= 0 ifTrue: - [cogit - MoveCq: 0 R: RAX; - "VarBaseRegister is only live in Smalltalk machine code so cannot be used here." - gen: MoveRAwNoVBR operand: RAX operand: vmOwnerLockAddress; - gen: SFENCE]. - cogit RetN: 0! From lewis at mail.msen.com Fri Nov 13 19:15:06 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 13 Nov 2020 14:15:06 -0500 Subject: [Vm-dev] [SQUEAKVM] SqueakSSL support code updated on squeakvm.org SVN repository In-Reply-To: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> References: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> Message-ID: <20201113191506.GA23449@shell.msen.com> On Wed, Nov 11, 2020 at 12:47:28PM +0100, stes at PANDORA.BE wrote: > > I've emailed some patches a while ago to Ian Piumarta but had no response. > > 01-aio.patch 04-sunproversion.patch > 02-sqUnixSoundPulseAudio.patch 05-installdoc.patch > 03-sqUnixSoundSun.patch > > I use those patches to compile with SunPRO cc compiler squeak-4 on Solaris 11. > > Those are minor patches; anyway it is a good thing that the subversion > (SVN) repository remains only for reference how the squeak-4 sources were. > > Just to be able to compare to the old sources the SVN repo is really nice ... > Hi David, Could you please post those five patch files here to the list? I'll see if I can get them applied. I do recall committing one one of your Solaris sound fixes a while ago: http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c?r1=2595&r2=3778 Thanks, Dave From commits at source.squeak.org Fri Nov 13 22:11:48 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 13 Nov 2020 22:11:48 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2882.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2882.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2882 Author: eem Time: 13 November 2020, 2:11:40.169267 pm UUID: 56de32d6-c90d-4050-a303-72f507d82266 Ancestors: VMMaker.oscog-eem.2881 Fix the longjmp's back to the interpreter and the thread scheduling loop so they make sense. Add a useful assert to tryLockVMOwnerTo: that catches a broken implementation (as was the initial version of ARMv8 above LDAXR/STLXR). =============== Diff against VMMaker.oscog-eem.2881 =============== Item was changed: ----- Method: CoInterpreterMT>>threadSchedulingLoop: (in category 'vm scheduling') ----- threadSchedulingLoop: vmThread "Enter a loop attempting to run the VM with the highest priority process and blocking on the thread's OS semaphore when unable to run that process. This version is for simulation only, simulating the longjmp back to the real threadSchedulingLoopImplementation: through exception handling." self initializeProcessorForThreadIndex: vmThread index. + [[self threadSchedulingLoopImplementation: vmThread] - [([self threadSchedulingLoopImplementation: vmThread] on: ReenterThreadSchedulingLoop + do: [:ex| self assert: ex returnValue = 1. ex return: true]] whileTrue! - do: [:ex| ex return: ex returnValue]) = ReenterThreadSchedulingLoop] whileTrue! Item was changed: ----- Method: Cogit>>tryLockVMOwnerTo: (in category 'multi-threading') ----- tryLockVMOwnerTo: value "ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner variable with zero and the argument, setting vmOwner to value if it was zero. It answers if the lock was zero and hence was acquired." processor abiMarshalArg0: value in: objectMemory memory. + ^[ | result | + result := self simulateLeafCallOf: ceTryLockVMOwner. + self assert: (result ~= 0) = (coInterpreter threadManager getVMOwner = value). + result ~= 0] ensure: + [processor abiUnmarshal: 1]! - ^[(self simulateLeafCallOf: ceTryLockVMOwner) ~= 0] ensure: - [processor abiUnmarshal: 1]! Item was changed: ----- Method: StackInterpreter>>enterSmalltalkExecutive (in category 'initialization') ----- enterSmalltalkExecutive "Main entry-point into the interpreter at each execution level, where an execution level is either the start of execution or reentry for a callback." "Simulation of the setjmp in enterSmalltalkExecutiveImplementation for reentry into interpreter." + [[self enterSmalltalkExecutiveImplementation] - [([self enterSmalltalkExecutiveImplementation] on: ReenterInterpreter + do: [:ex| self assert: ex returnValue = ReturnToInterpreter. ex return: true]] whileTrue! - do: [:ex| ex return: ex returnValue]) = ReturnToInterpreter] whileTrue! From commits at source.squeak.org Fri Nov 13 23:21:00 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 13 Nov 2020 23:21:00 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2883.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2883.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2883 Author: eem Time: 13 November 2020, 3:20:51.730358 pm UUID: 178413b2-f5ef-4ea3-b7ee-f820c36333dd Ancestors: VMMaker.oscog-eem.2882 Minor cleanup. =============== Diff against VMMaker.oscog-eem.2882 =============== Item was changed: ----- Method: Cogit class>>mustBeGlobal: (in category 'translation') ----- mustBeGlobal: var "Answer if a variable must be global and exported. Used for inst vars that are + accessed from VM support code, or that need visibility at the gdb/lldb level." - accessed from VM support code." ^#('ceBaseFrameReturnTrampoline' ceCaptureCStackPointers 'ceCheckForInterruptTrampoline' ceEnterCogCodePopReceiverReg realCEEnterCogCodePopReceiverReg ceCallCogCodePopReceiverReg realCECallCogCodePopReceiverReg ceCallCogCodePopReceiverAndClassRegs realCECallCogCodePopReceiverAndClassRegs ceInvokeInterpret 'ceReturnToInterpreterTrampoline' 'ceCannotResumeTrampoline' + ceTryLockVMOwner - ceTryLockVMOwner ceUnlockVMOwner 'cmEntryOffset' 'cmNoCheckEntryOffset' 'cmDynSuperEntryOffset' 'cmSelfSendEntryOffset' 'missOffset' 'cbEntryOffset' 'cbNoSwitchEntryOffset' 'blockNoContextSwitchOffset' breakPC ceGetFP ceGetSP cFramePointerInUse traceFlags traceStores) includes: var! From noreply at github.com Fri Nov 13 23:35:02 2020 From: noreply at github.com (Eliot Miranda) Date: Fri, 13 Nov 2020 15:35:02 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f3947d: CogVM source as per VMMaker.oscog-eem.2883/ClosedV... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f3947d4d07faad02fdbc20a98dbfad19e6117a8d https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f3947d4d07faad02fdbc20a98dbfad19e6117a8d Author: Eliot Miranda Date: 2020-11-13 (Fri, 13 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spur64src/vm/cointerpmt.c M spur64src/vm/cointerpmt.h M spur64src/vm/gcc3x-cointerpmt.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c M spurlowcode64src/vm/cogitX64SysV.c M spurlowcode64src/vm/cogitX64WIN64.c M spurlowcodesrc/vm/cogit.h M spurlowcodesrc/vm/cogitARMv5.c M spurlowcodesrc/vm/cogitIA32.c M spurlowcodesrc/vm/cogitMIPSEL.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerpmt.c M src/vm/cogit.h M src/vm/cogitARMv5.c M src/vm/cogitIA32.c M src/vm/cogitMIPSEL.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2883/ClosedVMMaker-eem.112 Cogit: generateLowLevelUnlock: is unused. ARMv8 Cogit: Correctly detect if Atomic Instructions are available (at least using code that works on RPi 4). Implement the 8.0 version of ceTryLockVMOwner above LDAXR/STLXR/CLREX, adding spiffy new CBNZ/CBZ. From no-reply at appveyor.com Sat Nov 14 01:27:30 2020 From: no-reply at appveyor.com (AppVeyor) Date: Sat, 14 Nov 2020 01:27:30 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2310 Message-ID: <20201114012730.1.5DFB7CDA01E22C8A@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Sat Nov 14 02:46:04 2020 From: builds at travis-ci.org (Travis CI) Date: Sat, 14 Nov 2020 02:46:04 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2305 (Cog - f3947d4) In-Reply-To: Message-ID: <5faf44ef7f165_13fa915eaa88c1637f6@travis-tasks-58dddf4f75-84659.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2305 Status: Still Failing Duration: 3 hrs, 10 mins, and 3 secs Commit: f3947d4 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2883/ClosedVMMaker-eem.112 Cogit: generateLowLevelUnlock: is unused. ARMv8 Cogit: Correctly detect if Atomic Instructions are available (at least using code that works on RPi 4). Implement the 8.0 version of ceTryLockVMOwner above LDAXR/STLXR/CLREX, adding spiffy new CBNZ/CBZ. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/b0e63a85a96d...f3947d4d07fa View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/743518908?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Nov 14 10:36:30 2020 From: notifications at github.com (Marcel Taeumel) Date: Sat, 14 Nov 2020 02:36:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) Message-ID: No crash dump. It just closes. Not sure why exactly. Last time, it happened after loading Metacello and Squot in Squeak 5.3. Before it happened in Trunk after playing around with FFI and OpenGL. The VM silently closes on "save" or "save and quot". VM: 202011120327 (win64x64.squeak.cog.spur) OS: Windows 10 (2004 Build 19041.630) Squeak: latest 5.3 or 6.0alpha Here is the report that Windows generated: ``` Quelle Squeak Cog Spur Virtual Machine Zusammenfassung Nicht mehr funktionsfähig Datum ‎14.‎11.‎2020 11:25 Status Der Bericht wurde gesendet. Beschreibung Pfad der fehlerhaften Anwendung: C:\Tools\squeak_53_ecoop\Squeak.exe Problemsignatur Problemereignisame: APPCRASH Anwendungsname: Squeak.exe Anwendungsversion: 2020.11.12.327 Anwendungszeitstempel: 00000000 Fehlermodulname: Squeak.exe Fehlermodulversion: 2020.11.12.327 Fehlermodulzeitstempel: 00000000 Ausnahmecode: c0000005 Ausnahmeoffset: 0000000000033cd5 Betriebsystemversion: 10.0.19041.2.0.0.768.101 Gebietsschema-ID: 1031 Zusatzinformation 1: e064 Zusatzinformation 2: e0644d1b3ac5fae3d6c60b42d946256e Zusatzinformation 3: 4588 Zusatzinformation 4: 45886eecb7a8f73a86ab34ad6194fd79 Weitere Informationen über das Problem Bucket-ID: 5801b02358401c93cbecf9af1e413cb3 (2012257664049953971) ``` -- 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/535 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Nov 14 15:17:15 2020 From: notifications at github.com (Eliot Miranda) Date: Sat, 14 Nov 2020 07:17:15 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: Yes, I’m seeing this tooon MacOS. I’ve caused a regression. I suspect it was the changes I made to pinning/unpinning the display bitmap on snapshot. I’ll revert and see if it fixes it. But there are other changes. If anyone has the patience to bisect and find out exactly which commit is responsible that would be great. -- 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/535#issuecomment-727221646 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sat Nov 14 17:54:27 2020 From: notifications at github.com (Eliot Miranda) Date: Sat, 14 Nov 2020 09:54:27 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: I can confirm that 4c31c557b15b7f4052ad46dae300bbb308c875e7 is good. -- 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/535#issuecomment-727242636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sun Nov 15 06:01:06 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 15 Nov 2020 06:01:06 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2884.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2884.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2884 Author: eem Time: 14 November 2020, 10:00:58.142178 pm UUID: a121227d-80b9-46e4-aa93-f9ac9d7b2ca6 Ancestors: VMMaker.oscog-eem.2883 Slang: Fix a regression with inlining isClassOfNonImm:equalTo:compactClassIndex:. Not quite sure why but an argument assignment for the unused classOop argument was being generated when it shouldn't be. Cogit: save several lines by inlining wrappers around genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:appendOpcodes: =============== Diff against VMMaker.oscog-eem.2883 =============== Item was changed: ----- Method: CoInterpreter>>convertToInterpreterFrame: (in category 'frame access') ----- convertToInterpreterFrame: pcDelta + "Convert the top machine code frame to an interpreter frame. Support for - "Convert the top machine code frame to an interpeeter frame. Support for mustBeBoolean in the RegisterAllocatingCogit and for cloneContext: in shallowCopy when a code compaction is caused by machine code to bytecode pc mapping." | cogMethod methodHeader methodObj startBcpc | self assert: (self isMachineCodeFrame: framePointer). cogMethod := self mframeCogMethod: framePointer. ((self mframeIsBlockActivation: framePointer) and: [cogMethod cmIsFullBlock not]) ifTrue: [methodHeader := (self cCoerceSimple: cogMethod cmHomeMethod to: #'CogMethod *') methodHeader. methodObj := (self cCoerceSimple: cogMethod cmHomeMethod to: #'CogMethod *') methodObject. startBcpc := cogMethod startpc] ifFalse: [methodHeader := (self cCoerceSimple: cogMethod to: #'CogMethod *') methodHeader. methodObj := (self cCoerceSimple: cogMethod to: #'CogMethod *') methodObject. startBcpc := self startPCOfMethod: methodObj]. "Map the machine code instructionPointer to the interpreter instructionPointer of the branch." instructionPointer := cogit bytecodePCFor: instructionPointer startBcpc: startBcpc in: cogMethod. instructionPointer := methodObj + objectMemory baseHeaderSize + instructionPointer - pcDelta - 1. "pre-decrement" self validInstructionPointer: instructionPointer inMethod: methodObj framePointer: framePointer. "Make space for the two extra fields in an interpreter frame" stackPointer to: framePointer + FoxMFReceiver by: objectMemory wordSize do: [:p| | oop | oop := objectMemory longAt: p. objectMemory longAt: p - objectMemory wordSize - objectMemory wordSize put: (objectMemory longAt: p)]. stackPointer := stackPointer - objectMemory wordSize - objectMemory wordSize. "Fill in the fields" objectMemory longAt: framePointer + FoxIFrameFlags put: (self encodeFrameFieldHasContext: (self mframeHasContext: framePointer) isBlock: (self mframeIsBlockActivation: framePointer) numArgs: cogMethod cmNumArgs); longAt: framePointer + FoxIFSavedIP put: instructionPointer; longAt: framePointer + FoxMethod put: methodObj. self setMethod: methodObj methodHeader: methodHeader! Item was changed: ----- Method: CoInterpreter>>iframeSavedIP: (in category 'frame access') ----- iframeSavedIP: theFP + ^(stackPages longAt: theFP + FoxIFSavedIP) asUnsignedInteger! - ^stackPages longAt: theFP + FoxIFSavedIP! Item was changed: ----- Method: CoInterpreter>>returnToExecutive:postContextSwitch: (in category 'enilopmarts') ----- returnToExecutive: inInterpreter postContextSwitch: switchedContext "Return to the current frame, either by entering machine code, or longjmp-ing back to the interpreter or simply returning, depending on where we are. To know whether to return or enter machine code we have to know from whence we came. We could have come from the interpreter, either directly or via a machine code primitive. We could have come from machine code. The instructionPointer tells us where from. If it is above startOfMemory we're in the interpreter. If it is below, then we are in machine-code unless it is ceReturnToInterpreterPC, in which case we're in a machine-code primitive called from the interpreter." | cogMethod retValue fullyInInterpreter | cogit assertCStackWellAligned. (self isMachineCodeFrame: framePointer) ifTrue: [self assertValidExecutionPointe: instructionPointer r: framePointer s: stackPointer imbar: false line: #'__LINE__'. "If returning after a context switch then a result may have to be popped from the stack. If the process is suspended at a send then the result of the primitive in which the process was suspended is still on the stack and must be popped into ReceiverResultReg. If not, nothing should be popped and ReceiverResultReg gets the receiver." switchedContext ifTrue: [cogMethod := self mframeCogMethod: framePointer. self assert: (instructionPointer > cogit minCogMethodAddress and: [instructionPointer < cogit maxCogMethodAddress]). (instructionPointer ~= (cogMethod asInteger + cogMethod stackCheckOffset) and: [cogit isSendReturnPC: instructionPointer]) ifTrue: [self assert: (objectMemory addressCouldBeOop: self stackTop). retValue := self popStack] ifFalse: [retValue := self mframeReceiver: framePointer]] ifFalse: [retValue := self mframeReceiver: framePointer]. self push: instructionPointer. self push: retValue. cogit ceEnterCogCodePopReceiverReg "NOTREACHED"]. self setMethod: (self iframeMethod: framePointer). fullyInInterpreter := inInterpreter. instructionPointer = cogit ceReturnToInterpreterPC ifTrue: + [instructionPointer := self iframeSavedIP: framePointer. - [instructionPointer := (self iframeSavedIP: framePointer) asUnsignedInteger. fullyInInterpreter := false]. self assertValidExecutionPointe: instructionPointer r: framePointer s: stackPointer imbar: true line: #'__LINE__'. fullyInInterpreter ifFalse: [cogit ceInvokeInterpret "NOTREACHED"]. ^nil! Item was changed: ----- Method: CoInterpreterMT>>primitiveRelinquishProcessor (in category 'I/O primitives') ----- primitiveRelinquishProcessor "Relinquish the processor for up to the given number of microseconds. The exact behavior of this primitive is platform dependent. Override to check for waiting threads." | microSecs threadIndexAndFlags currentCStackPointer currentCFramePointer | - microSecs := self stackTop. (objectMemory isIntegerObject: microSecs) ifFalse: [^self primitiveFail]. self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. self assert: relinquishing not. "DO NOT allow relinquishing the processor while we are profiling since this may skew the time base for our measures (it may reduce processor speed etc). Instead we go full speed, therefore measuring the precise time we spend in the inner idle loop as a busy loop." nextProfileTick = 0 ifTrue: "Presumably we have nothing to do; this primitive is typically called from the background process. So we should /not/ try and activate any threads in the pool; they will waste cycles finding there is no runnable process, and will cause a VM abort if no runnable process is found. But we /do/ want to allow FFI calls that have completed, or callbacks a chance to get into the VM; they do have something to do. DisownVMForProcessorRelinquish indicates this." [currentCStackPointer := CStackPointer. currentCFramePointer := CFramePointer. threadIndexAndFlags := self disownVM: DisownVMForProcessorRelinquish. self assert: relinquishing. self ioRelinquishProcessorForMicroseconds: (objectMemory integerValueOf: microSecs). self assert: relinquishing. self ownVM: threadIndexAndFlags. self assert: relinquishing not. self assert: cogThreadManager currentVMThread state = CTMAssignableOrInVM. self assert: currentCStackPointer = CStackPointer. self assert: currentCFramePointer = CFramePointer. "In simulation we allow ioRelinquishProcessorForMicroseconds: to fail so that we can arrange that the simulator responds to input events promply. This *DOES NOT HAPPEN* in the real vm." self cCode: [] inSmalltalk: [primFailCode ~= 0 ifTrue: [^self]]]. self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. self pop: 1 "microSecs; leave rcvr on stack"! Item was changed: ----- Method: Cogit>>genCheckForInterruptsTrampoline (in category 'initialization') ----- genCheckForInterruptsTrampoline + self zeroOpcodeIndex. "if we have a link register we will assume that it does not get automatically pushed onto the stack and thus there is no need to pop it before saving to instructionPointerAddress" backEnd hasLinkRegister ifTrue: [self MoveR: LinkReg Aw: coInterpreter instructionPointerAddress] ifFalse: [self PopR: TempReg. "instruction pointer" self MoveR: TempReg Aw: coInterpreter instructionPointerAddress]. ^self genTrampolineFor: #ceCheckForInterrupts called: 'ceCheckForInterruptsTrampoline' numArgs: 0 arg: nil arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: false resultReg: NoReg appendOpcodes: true! Item was changed: ----- Method: Cogit>>genNonLocalReturnTrampoline (in category 'initialization') ----- genNonLocalReturnTrampoline + self zeroOpcodeIndex. "write the return address to the coInterpreter instructionPointerAddress; following the CallRT to this CISCs will have pushed it on the stack, so pop it first; RISCs will have it in their link register so just write it directly." backEnd hasLinkRegister ifTrue: [self MoveR: LinkReg Aw: coInterpreter instructionPointerAddress] ifFalse: [self PopR: TempReg. "instruction pointer" self MoveR: TempReg Aw: coInterpreter instructionPointerAddress]. ^self genTrampolineFor: #ceNonLocalReturn: called: 'ceNonLocalReturnTrampoline' numArgs: 1 arg: ReceiverResultReg arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: false resultReg: NoReg appendOpcodes: true! Item was changed: ----- Method: Cogit>>genPICAbortTrampoline (in category 'initialization') ----- genPICAbortTrampoline "Generate the abort for a PIC. This abort performs either a call of ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged target or a call of ceMNUFromPICMNUMethod:receiver: to handle an MNU dispatch in a closed PIC. It distinguishes the two by testing ClassReg. If the register is zero then this is an MNU." + self zeroOpcodeIndex. backEnd hasLinkRegister ifTrue: [self PushR: LinkReg]. ^self genInnerPICAbortTrampoline: 'cePICAbort'! Item was changed: ----- Method: Cogit>>genReturnTrampolineFor:called:arg: (in category 'initialization') ----- genReturnTrampolineFor: aRoutine called: aString arg: regOrConst0 "Generate a trampoline for a routine used as a return address, that has one argument. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 1 arg: regOrConst0 arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: false "Since the routine is reached by a return instruction it should /not/ push the link register." resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString "Generate a trampoline with no arguments" + ^self genTrampolineFor: aRoutine called: aString numArgs: 0 arg: nil arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 "Generate a trampoline with one argument. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 1 arg: regOrConst0 arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:arg: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 arg: regOrConst1 "Generate a trampoline with two arguments. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 2 arg: regOrConst0 arg: regOrConst1 arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:arg:arg: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 "Generate a trampoline with three arguments. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 3 arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:arg:arg:arg: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3 "Generate a trampoline with four arguments. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 4 arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3 regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:arg:arg:result: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 result: resultReg "Generate a trampoline with two arguments that answers a result. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 3 arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: resultReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:arg:regsToSave: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 arg: regOrConst1 regsToSave: regMask "Generate a trampoline with two arguments. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 2 arg: regOrConst0 arg: regOrConst1 arg: nil arg: nil regsToSave: regMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:arg:result: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 arg: regOrConst1 result: resultReg "Generate a trampoline with two arguments that answers a result. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 2 arg: regOrConst0 arg: regOrConst1 arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: resultReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:regsToSave: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 regsToSave: regMask "Generate a trampoline with one argument. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 1 arg: regOrConst0 arg: nil arg: nil arg: nil regsToSave: regMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:regsToSave:result: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 regsToSave: regMask result: resultReg "Generate a trampoline with one argument that answers a result. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 1 arg: regOrConst0 arg: nil arg: nil arg: nil regsToSave: regMask pushLinkReg: true resultReg: resultReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:arg:result: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString arg: regOrConst0 result: resultReg "Generate a trampoline with one argument that answers a result. Hack: a negative value indicates an abstract register, a non-negative value indicates a constant." + ^self genTrampolineFor: aRoutine called: aString numArgs: 1 arg: regOrConst0 arg: nil arg: nil arg: nil regsToSave: self emptyRegisterMask pushLinkReg: true resultReg: resultReg appendOpcodes: false! Item was changed: ----- Method: Cogit>>genTrampolineFor:called:regsToSave: (in category 'initialization') ----- genTrampolineFor: aRoutine called: aString regsToSave: regMask "Generate a trampoline with no arguments" + ^self genTrampolineFor: aRoutine called: aString numArgs: 0 arg: nil arg: nil arg: nil arg: nil regsToSave: regMask pushLinkReg: true resultReg: NoReg appendOpcodes: false! Item was changed: ----- Method: StackInterpreter>>frameCallerFP: (in category 'frame access') ----- frameCallerFP: theFP + - ^self pointerForOop: (stackPages longAt: theFP + FoxSavedFP)! Item was changed: ----- Method: StackInterpreter>>postGCUpdateDisplayBits (in category 'object memory support') ----- postGCUpdateDisplayBits "Update the displayBits after a GC may have moved it. Answer if the displayBits appear valid. The wrinkle here is that the displayBits could be a surface handle." | displayObj bitsOop bitsNow | displayObj := objectMemory splObj: TheDisplay. ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]) ifFalse: [^false]. bitsOop := objectMemory fetchPointer: 0 ofObject: displayObj. (objectMemory isIntegerObject: bitsOop) ifTrue: "It's a surface; our work here is done..." [^true]. + self assert: ((objectMemory addressCouldBeObj: bitsOop) + and: [objectMemory isWordsOrBytes: bitsOop]). - ((objectMemory addressCouldBeObj: bitsOop) - and: [objectMemory isWordsOrBytes: bitsOop]) ifFalse: - [^false]. (objectMemory hasSpurMemoryManagerAPI and: [objectMemory isPinned: bitsOop]) ifFalse: [bitsNow := self cCode: [objectMemory firstIndexableField: bitsOop] inSmalltalk: [(objectMemory firstIndexableField: bitsOop) asInteger]. displayBits ~= bitsNow ifTrue: [displayBits := bitsNow. self ioNoteDisplayChanged: displayBits width: displayWidth height: displayHeight depth: displayDepth]. objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory pinObject: bitsOop]]. ^true! Item was changed: ----- Method: StackInterpreter>>printStackCallStackOf: (in category 'debug printing') ----- printStackCallStackOf: aContextOrProcessOrFrame | theFP context | (self cCode: [false] "In the stack simulator, frame pointers are negative which upsets addressCouldBeObj:" inSmalltalk: [stackPages couldBeFramePointer: aContextOrProcessOrFrame]) ifFalse: [(objectMemory addressCouldBeObj: aContextOrProcessOrFrame) ifTrue: [((objectMemory isContext: aContextOrProcessOrFrame) and: [self checkIsStillMarriedContext: aContextOrProcessOrFrame currentFP: nil]) ifTrue: [^self printStackCallStackOf: (self frameOfMarriedContext: aContextOrProcessOrFrame) asInteger]. aContextOrProcessOrFrame = self activeProcess ifTrue: + [^self printStackCallStackOf: (self cCode: [framePointer asInteger] inSmalltalk: [self headFramePointer])]. - [^self printStackCallStackOf: (self cCode: [framePointer] inSmalltalk: [self headFramePointer])]. (self couldBeProcess: aContextOrProcessOrFrame) ifTrue: [^self printCallStackOf: (objectMemory fetchPointer: SuspendedContextIndex ofObject: aContextOrProcessOrFrame)]. ^nil]]. theFP := aContextOrProcessOrFrame asVoidPointer. [context := self shortReversePrintFrameAndCallers: theFP. ((self isMarriedOrWidowedContext: context) and: [theFP := self frameOfMarriedContext: context. self checkIsStillMarriedContext: context currentFP: theFP]) ifFalse: [^nil]] repeat! Item was changed: ----- Method: StackToRegisterMappingCogit>>genPICAbortTrampolineFor: (in category 'initialization') ----- genPICAbortTrampolineFor: numArgs "Generate the abort for a PIC. This abort performs either a call of ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged target or a call of ceMNUFromPICMNUMethod:receiver: to handle an MNU dispatch in a closed PIC. It distinguishes the two by testing ClassReg. If the register is zero then this is an MNU." + self zeroOpcodeIndex. backEnd genPushRegisterArgsForAbortMissNumArgs: numArgs. ^self genInnerPICAbortTrampoline: (self trampolineName: 'cePICAbort' numRegArgs: numArgs)! Item was changed: ----- Method: TMethod>>addTypesFor:to:in: (in category 'type inference') ----- addTypesFor: node to: typeSet in: aCodeGen "Add the value types for the node to typeSet. Answer if any type was derived from an as-yet-untyped method or variable, which allows us to abort inferReturnTypeFromReturnsIn: if the return type depends on a yet-to-be-typed method or variable." | expr | expr := node. [expr isAssignment or: [expr isStmtList]] whileTrue: [expr isAssignment ifTrue: [expr := expr variable]. expr isStmtList ifTrue: [expr := expr statements last]]. expr isSend ifTrue: [(#(ifTrue: ifFalse: ifTrue:ifFalse: ifFalse:ifTrue:) includes: expr selector) ifTrue: [^expr args inject: false into: [:asYetUntyped :block| asYetUntyped | (self addTypesFor: block to: typeSet in: aCodeGen)]]. (aCodeGen returnTypeForSend: expr in: self ifNil: nil) ifNil: [^(aCodeGen methodNamed: expr selector) notNil and: [expr selector ~~ selector]] ifNotNil: [:type | typeSet add: type. ^false]]. expr isVariable ifTrue: [(aCodeGen typeOfVariable: expr name) ifNotNil: [:type| typeSet add: type] + ifNil: [expr name ~= 'nil' ifTrue: "nil could be a pointer or integer value, so it is effectively untyped." + [(typeSet add: (expr name = 'self' "self definitely means no type, at least in non-struct classes..." - ifNil: [(typeSet add: (expr name = 'self' ifTrue: [#void] ifFalse: [#sqInt])) == #sqInt ifTrue: + [^true]]]]. - [^true]]]. expr isConstant ifTrue: [(expr value isInteger and: [expr value >= 0]) "cannot determine if signed or unsigned yet..." ifTrue: [typeSet add: expr value] ifFalse: [(expr typeOrNilFrom: aCodeGen in: self) ifNotNil: [:type | typeSet add: type]]]. ^false! Item was added: + ----- Method: TMethod>>allReferencedArgumentsUsing: (in category 'accessing') ----- + allReferencedArgumentsUsing: aCodeGen + "Answer the set of all variables referenced in the receiver." + | refs | + refs := Set new. + "Find all the variable names referenced in this method. + Don't descend into conditionals that won't be generated." + parseTree + nodesWithParentsDo: + [:node :parent| + node isVariable ifTrue: [refs add: node name asString]. + (node isSend + and: [node selector beginsWith: #cCode:]) ifTrue: + [aCodeGen addVariablesInVerbatimCIn: node to: refs]] + unless: + [:node :parent| + parent notNil + and: [parent isSend + and: [aCodeGen nodeIsDeadCode: node withParent: parent]]]. + ^refs intersection: args! Item was changed: ----- Method: TMethod>>argAssignmentsFor:send:except:in: (in category 'inlining') ----- argAssignmentsFor: meth send: aSendNode except: elidedArgs in: aCodeGen + "Answer a collection of assignment nodes that assign the given argument expressions to the formal parameter variables of the given method." + "Optimization: If the actual parameters are either constants or local variables in the target method (the receiver), substitute them directly into the body of meth. Note that global variables cannot be substituted because the inlined method might depend on the exact ordering of side effects to the globals. + Optimization: Don't answer statements for formal parameters which are unused in the method body." - "Return a collection of assignment nodes that assign the given argument expressions to the formal parameter variables of the given method." - "Optimization: If the actual parameters are either constants or local variables in the target method (the receiver), substitute them directly into the body of meth. Note that global variables cannot be subsituted because the inlined method might depend on the exact ordering of side effects to the globals." + | stmtList substitutionDict argList referencedArguments | - | stmtList substitutionDict argList | meth args size > (argList := aSendNode args) size ifTrue: [self assert: (meth args first beginsWith: 'self_in_'). argList := {aSendNode receiver}, aSendNode args]. - stmtList := OrderedCollection new: argList size. substitutionDict := Dictionary new: argList size. meth args with: argList do: [:argName :exprNode | (self isNode: exprNode substitutableFor: argName inMethod: meth in: aCodeGen) ifTrue: [substitutionDict at: argName put: (aCodeGen node: exprNode typeCompatibleWith: argName inliningInto: meth in: self). locals remove: argName ifAbsent: [self assert: (argName beginsWith: 'self_in_')]. declarations removeKey: argName ifAbsent: nil] ifFalse: "Add an assignment for anything except an unused self_in_foo argument" [(elidedArgs includes: argName) ifFalse: [self deny: exprNode isLiteralBlock. stmtList addLast: (TAssignmentNode new setVariable: (TVariableNode new setName: argName) expression: (aCodeGen node: exprNode copy typeCompatibleWith: argName inliningInto: meth in: self))]]]. meth parseTree: (meth parseTree bindVariablesIn: substitutionDict). + referencedArguments := meth allReferencedArgumentsUsing: aCodeGen. + ^stmtList select: [:assignment| referencedArguments includes: assignment variable name]! - ^stmtList! From notifications at github.com Sun Nov 15 13:19:03 2020 From: notifications at github.com (Marcel Taeumel) Date: Sun, 15 Nov 2020 05:19:03 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: > I can confirm that [4c31c55](https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4c31c557b15b7f4052ad46dae300bbb308c875e7) is good. Hmm... that commit was 4 days ago? Well, I also experienced that bug today on a 202011091413 VM (32-bit), that is, from 6 days ago. -- 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/535#issuecomment-727568547 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Sun Nov 15 13:52:41 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sun, 15 Nov 2020 14:52:41 +0100 (CET) Subject: [Vm-dev] [SQUEAKVM] SqueakSSL support code updated on squeakvm.org SVN repository In-Reply-To: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> References: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> Message-ID: <741209258.5768433.1605448361727.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 You can find the patches for squeak-4 (subversion sources) at: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/runtime/squeak4/patches The patch for pulseaudio would be very useful to apply: 02-sqUnixSoundPulseAudio.patch Also the 01-aio.patch is important because otherwise you can't do much, since the default action on Solaris System V UNIX is to sigkill on SIGIO or SIGPIPE (so without the 01-aio.path the VM runs, but is killed pretty soon). In some sense 01-aio.patch is optional as the VM compiles without it, so 01-aio.patch is perhaps not required to add to the Squeak VM svn repo. The 04-sunproversion.patch is required to compile with SunPRO cc (C compiler). The 05-installdoc.patch is something that I use, but perhaps not required to add to the Squeak VM. All of those patches can be either incorporated in the mainline (upstream) Squeak VM sources OR I can just continue to apply those patches when a package, is built (as external patches, which also works fine). Anyway you get the entire package (manifest + patches) by : git clone https://github.com/OpenIndiana/oi-userland The patches are in components/runtime/squeak4/patches (in the oi-userland, cd). OpenIndiana is an OpenSolaris derived system, which has the squeak-4 and squeak-5 + squeak-5c packages in their repository. The same patches also are used on Solaris 11.4 (the Oracle product). The packages squeak-4 etc. are also available for Oracle Solaris 11.4. By the way the folks at OpenIndiana host the documentation as well: http://docs.openindiana.org/handbook/community/ There are installation instructions at : http://docs.openindiana.org/handbook/community/squeak/index.html Which explains how to use IPS (Image Packet System) to install squeak-4 and/or squeak-5 the stack-spur or squeak-5c the cog-spur VM. Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfsTJTAAoJEAwpOKXMq1MaGOMH/AzUQY6Md6PnpAO4rOvq+h/b 9b2kyEi2/Dao/xv9N5MubRNYGBEgfv1ibdDirHA/c41DHGUdYqOkSJPvDPhOjPrK zopmGISImyBhyDxQB30J7dwz8PA4JysBnXquvZuj/UemVL2JVc2ezvJN6juowg38 wEzH362wlP8vwtVEJ3KS1aRsliXsjCeItgiv1U/JeEI3Xla+cD+mb0DNl20fdIpP +lRPe8fIenWtu4KpgK4EgHjUlDO+DjzSregujCCYQ5223gQmY4ugylzvts8P0ZFB SBuM6p9S6Qx6+S6PJok/dsj/s+MoOR7iNnauU01WC42XVveIzAlQ/BLNqRINAcI= =up9Y -----END PGP SIGNATURE----- From lewis at mail.msen.com Sun Nov 15 19:11:24 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sun, 15 Nov 2020 14:11:24 -0500 Subject: [Vm-dev] [SQUEAKVM] SqueakSSL support code updated on squeakvm.org SVN repository In-Reply-To: <741209258.5768433.1605448361727.JavaMail.zimbra@telenet.be> References: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> <741209258.5768433.1605448361727.JavaMail.zimbra@telenet.be> Message-ID: <20201115191124.GA74793@shell.msen.com> Thanks David, I added/merged your updates into SVN trunk with the following changes: 01-aio.patch: generalized for all platforms because sigaction is portable, so the #ifdef __sun__ is not required. 02-sqUnixSoundPulseAudio.patch: Added, no changes. 03-sqUnixSoundSun.patch: I had applied this already back in May or so, so no new update needed. 04-sunproversion.patch: For the compiler version string fix, use ${CMAKE_C_COMPILER_VERSION} for all compilers. No need for a SunPro variant because cmake does the right thing for all compilers including gnu and llvm. 05-installdoc.patch: I did not include this patch for adding the LICENSE file because I'm worried that it might cause confusion with the various build VM systems, and because it's probably not needed for most users. With these updates, I think that you will be able to use the latest SVN platforms without further patching, except for the LICENSE patch that you will probably want to keep using in your environment. If possible I would suggest that you move forward to latest platform sources because they include recent updates by Tobias Pape that make the SSL connections to source.squeak.org and squeaksource.com work correctly. Thanks, Dave On Sun, Nov 15, 2020 at 02:52:41PM +0100, stes at PANDORA.BE wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > You can find the patches for squeak-4 (subversion sources) at: > > https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/runtime/squeak4/patches > > The patch for pulseaudio would be very useful to apply: > > 02-sqUnixSoundPulseAudio.patch > > Also the 01-aio.patch is important because otherwise you can't do much, > since the default action on Solaris System V UNIX is to sigkill on SIGIO > or SIGPIPE (so without the 01-aio.path the VM runs, but is killed pretty soon). > > In some sense 01-aio.patch is optional as the VM compiles without it, > so 01-aio.patch is perhaps not required to add to the Squeak VM svn repo. > > The 04-sunproversion.patch is required to compile with SunPRO cc (C compiler). > > The 05-installdoc.patch is something that I use, but perhaps not required to > add to the Squeak VM. > > All of those patches can be either incorporated in the mainline (upstream) > Squeak VM sources OR I can just continue to apply those patches when a package, > is built (as external patches, which also works fine). > > Anyway you get the entire package (manifest + patches) by : > > git clone https://github.com/OpenIndiana/oi-userland > > The patches are in components/runtime/squeak4/patches (in the oi-userland, cd). > > OpenIndiana is an OpenSolaris derived system, which has the squeak-4 > and squeak-5 + squeak-5c packages in their repository. > > The same patches also are used on Solaris 11.4 (the Oracle product). > The packages squeak-4 etc. are also available for Oracle Solaris 11.4. > > By the way the folks at OpenIndiana host the documentation as well: > > http://docs.openindiana.org/handbook/community/ > > There are installation instructions at : > > http://docs.openindiana.org/handbook/community/squeak/index.html > > Which explains how to use IPS (Image Packet System) to install squeak-4 > and/or squeak-5 the stack-spur or squeak-5c the cog-spur VM. > > Regards, > David Stes > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJfsTJTAAoJEAwpOKXMq1MaGOMH/AzUQY6Md6PnpAO4rOvq+h/b > 9b2kyEi2/Dao/xv9N5MubRNYGBEgfv1ibdDirHA/c41DHGUdYqOkSJPvDPhOjPrK > zopmGISImyBhyDxQB30J7dwz8PA4JysBnXquvZuj/UemVL2JVc2ezvJN6juowg38 > wEzH362wlP8vwtVEJ3KS1aRsliXsjCeItgiv1U/JeEI3Xla+cD+mb0DNl20fdIpP > +lRPe8fIenWtu4KpgK4EgHjUlDO+DjzSregujCCYQ5223gQmY4ugylzvts8P0ZFB > SBuM6p9S6Qx6+S6PJok/dsj/s+MoOR7iNnauU01WC42XVveIzAlQ/BLNqRINAcI= > =up9Y > -----END PGP SIGNATURE----- From commits at source.squeak.org Mon Nov 16 07:12:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 16 Nov 2020 07:12:03 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2885.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2885.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2885 Author: eem Time: 15 November 2020, 11:11:53.385644 pm UUID: 23635dc5-2413-4ea8-bc4a-29927206bb3b Ancestors: VMMaker.oscog-eem.2884 Fix the regression in VMMaker.oscog-eem.2876. Since pinning is potentially a become operation followForwardingPointersInStackZone: is invoked, and that crashes when stackPage is 0, is it is when snapshotting. So the fix is to return to not pinning in postGCUpdateDisplayBits if snapshotting. =============== Diff against VMMaker.oscog-eem.2884 =============== Item was changed: ----- Method: CoInterpreter>>markCogMethodsAndReferentsOnPage: (in category 'frame access') ----- markCogMethodsAndReferentsOnPage: thePage + | theFP callerFP cogMethod theIP | - | theFP callerFP | - - self assert: (stackPages isFree: thePage) not. self assert: (self ifCurrentStackPageHasValidHeadPointers: thePage). theFP := thePage headFP. + + "If a machine code primitive is in progress then there will be a return address on top of stack + which does not refer to the current frame's method (which is the caller of the primitive), since + the primitive has not built a frame. It is vital that that method not be reclaimed!!!!" + theIP := (stackPages longAt: thePage headSP) asUnsignedInteger. + (theIP < objectMemory startOfMemory + and: [theIP ~= cogit ceReturnToInterpreterPC]) ifTrue: + [self assert: (self isMachineCodeFrame: theFP). + cogMethod := self mframeHomeMethod: theFP. + (theIP >= cogMethod asUnsignedInteger + and: [theIP < (cogMethod asUnsignedInteger + cogMethod blockSize)]) ifFalse: + [(cogit cogMethodContaining: theIP) ifNotNil: + [:primCogMethod| cogit markMethodAndReferents: primCogMethod]]]. + - "Skip the instruction pointer on top of stack of inactive pages." [(self isMachineCodeFrame: theFP) ifTrue: [cogit markMethodAndReferents: (self mframeCogMethod: theFP)]. (callerFP := self frameCallerFP: theFP) ~= 0] whileTrue: [theFP := callerFP]! Item was changed: ----- Method: StackInterpreter>>followForwardingPointersInStackZone: (in category 'object memory support') ----- followForwardingPointersInStackZone: theBecomeEffectsFlags "Spur's become: is lazy, turning the becommed object into a forwarding object to the other. The read-barrier is minimised by arranging that forwarding pointers will fail a method cache probe, since notionally objects' internals are accessed only via sending messages to them, the exception is primitives that access the internals of the non-receiver argument(s). To avoid a read barrier on bytecode, literal and inst var fetch and non-local return, we scan the receivers (including the stacked receiver for non-local return) and method references in the stack zone and follow any forwarded ones. This is of course way cheaper than scanning all of memory as in the old become." | theIPPtr | stackPage = 0 ifTrue: "the system must be snapshotting; nothing to do..." + [self assert: (stackPages mostRecentlyUsedPage isNil or: [stackPages mostRecentlyUsedPage isFree]). - [self assert: stackPages mostRecentlyUsedPage isFree. self cCode: [] inSmalltalk: [self assert: stackPages allPagesFree]. ^self]. self externalWriteBackHeadFramePointers. (theBecomeEffectsFlags anyMask: BecameCompiledMethodFlag) ifTrue: [(objectMemory isForwarded: method) ifTrue: [theIPPtr := instructionPointer - method. method := objectMemory followForwarded: method. instructionPointer := method + theIPPtr]. (objectMemory isOopForwarded: newMethod) ifTrue: [newMethod := objectMemory followForwarded: newMethod]]. self assert: stackPage ~= 0. 0 to: numStackPages - 1 do: [:i| | thePage theFP callerFP offset oop | thePage := stackPages stackPageAt: i. thePage isFree ifFalse: [self assert: (self ifCurrentStackPageHasValidHeadPointers: thePage). theFP := thePage headFP. "Skip the instruction pointer on top of stack of inactive pages." theIPPtr := thePage = stackPage ifTrue: [0] ifFalse: [thePage headSP asUnsignedInteger]. [self assert: (thePage addressIsInPage: theFP). self assert: (theIPPtr = 0 or: [thePage addressIsInPage: theIPPtr asVoidPointer]). oop := stackPages longAt: theFP + FoxReceiver. (objectMemory isOopForwarded: oop) ifTrue: [stackPages longAt: theFP + FoxReceiver put: (objectMemory followForwarded: oop)]. ((self frameHasContext: theFP) and: [(objectMemory isForwarded: (self frameContext: theFP))]) ifTrue: [stackPages longAt: theFP + FoxThisContext put: (objectMemory followForwarded: (self frameContext: theFP))]. oop := self frameMethod: theFP. (objectMemory isForwarded: oop) ifTrue: [| newOop delta | newOop := objectMemory followForwarded: oop. theIPPtr ~= 0 ifTrue: [self assert: (stackPages longAt: theIPPtr) > (self frameMethod: theFP). delta := newOop - oop. stackPages longAt: theIPPtr put: (stackPages longAt: theIPPtr) + delta]. stackPages longAt: theFP + FoxMethod put: (oop := newOop)]. offset := self frameStackedReceiverOffset: theFP. oop := stackPages longAt: theFP + offset. (objectMemory isOopForwarded: oop) ifTrue: [stackPages longAt: theFP + offset put: (objectMemory followForwarded: oop)]. (callerFP := self frameCallerFP: theFP) ~= 0] whileTrue: [theIPPtr := (theFP + FoxCallerSavedIP) asUnsignedInteger. theFP := callerFP]. "And finally follow the caller context." self assert: theFP = thePage baseFP. oop := self frameCallerContext: theFP. (objectMemory isForwarded: oop) ifTrue: [self frameCallerContext: theFP put: (objectMemory followForwarded: oop)]]]! Item was changed: ----- Method: StackInterpreter>>postGCUpdateDisplayBits (in category 'object memory support') ----- postGCUpdateDisplayBits "Update the displayBits after a GC may have moved it. Answer if the displayBits appear valid. The wrinkle here is that the displayBits could be a surface handle." | displayObj bitsOop bitsNow | displayObj := objectMemory splObj: TheDisplay. ((objectMemory isPointers: displayObj) and: [(objectMemory lengthOf: displayObj) >= 4]) ifFalse: [^false]. bitsOop := objectMemory fetchPointer: 0 ofObject: displayObj. (objectMemory isIntegerObject: bitsOop) ifTrue: "It's a surface; our work here is done..." [^true]. self assert: ((objectMemory addressCouldBeObj: bitsOop) and: [objectMemory isWordsOrBytes: bitsOop]). (objectMemory hasSpurMemoryManagerAPI and: [objectMemory isPinned: bitsOop]) ifFalse: [bitsNow := self cCode: [objectMemory firstIndexableField: bitsOop] inSmalltalk: [(objectMemory firstIndexableField: bitsOop) asInteger]. displayBits ~= bitsNow ifTrue: [displayBits := bitsNow. self ioNoteDisplayChanged: displayBits width: displayWidth height: displayHeight depth: displayDepth]. + (objectMemory hasSpurMemoryManagerAPI + and: [stackPage ~= 0]) ifTrue: "If stackPage is zero we're snapshotting and now is not the time to pin." - objectMemory hasSpurMemoryManagerAPI ifTrue: [objectMemory pinObject: bitsOop]]. ^true! From noreply at github.com Mon Nov 16 07:24:11 2020 From: noreply at github.com (Eliot Miranda) Date: Sun, 15 Nov 2020 23:24:11 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 862bc3: CogVM source as per VMMaker.oscog-eem.2885 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 862bc3704dbbdf2b4ce7ca3a8112d6616d613e9e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/862bc3704dbbdf2b4ce7ca3a8112d6616d613e9e Author: Eliot Miranda Date: 2020-11-15 (Sun, 15 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c 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 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 nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c 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 spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c 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 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 spurlowcodestack64src/vm/gcc3x-interp.c M spurlowcodestack64src/vm/interp.c M spurlowcodestacksrc/vm/gcc3x-interp.c M spurlowcodestacksrc/vm/interp.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c 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 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 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 spurstack64src/vm/gcc3x-interp.c M spurstack64src/vm/interp.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/validImage.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/gcc3x-cointerp.c M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2885 Fix the regression in db05a53a9f41dc87aafed07cc83d1ff22b46d42c/ VMMaker.oscog-eem.2876. Since pinning is potentially a become operation followForwardingPointersInStackZone: is invoked, and that crashes when stackPage is 0, as is it is when snapshotting. So the fix is to return to not pinning in postGCUpdateDisplayBits if snapshotting. Slang: Fix a regression with inlining isClassOfNonImm:equalTo:compactClassIndex Not quite sure why but an argument assignment for the unused classOop argument was being generated when it shouldn't be. Cogit: save several lines by inlining wrappers around genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:appendOpcodes:. N.B. This breaks translation of the SimpleStackBasedCogit but we don't care. It can be simulation only. From builds at travis-ci.org Mon Nov 16 07:30:47 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 16 Nov 2020 07:30:47 +0000 Subject: [Vm-dev] Errored: OpenSmalltalk/opensmalltalk-vm#2306 (Cog - 862bc37) In-Reply-To: Message-ID: <5fb22aa6e7bbe_13ff3bf4d42641827f@travis-tasks-6997b7486b-gxlqw.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2306 Status: Errored Duration: 6 mins and 2 secs Commit: 862bc37 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2885 Fix the regression in db05a53a9f41dc87aafed07cc83d1ff22b46d42c/ VMMaker.oscog-eem.2876. Since pinning is potentially a become operation followForwardingPointersInStackZone: is invoked, and that crashes when stackPage is 0, as is it is when snapshotting. So the fix is to return to not pinning in postGCUpdateDisplayBits if snapshotting. Slang: Fix a regression with inlining isClassOfNonImm:equalTo:compactClassIndex Not quite sure why but an argument assignment for the unused classOop argument was being generated when it shouldn't be. Cogit: save several lines by inlining wrappers around genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:appendOpcodes:. N.B. This breaks translation of the SimpleStackBasedCogit but we don't care. It can be simulation only. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/f3947d4d07fa...862bc3704dbb View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/743881932?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Mon Nov 16 07:34:18 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 16 Nov 2020 07:34:18 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2887.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2887.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2887 Author: eem Time: 15 November 2020, 11:34:08.438409 pm UUID: 835695f1-3354-4db4-9d20-dff979802ef4 Ancestors: VMMaker.oscog-eem.2886 ...and another one. =============== Diff against VMMaker.oscog-eem.2886 =============== Item was changed: ----- Method: CoInterpreter>>markCogMethodsAndReferentsOnPage: (in category 'frame access') ----- markCogMethodsAndReferentsOnPage: thePage + | theFP callerFP | + + - | theFP callerFP cogMethod theIP | self assert: (stackPages isFree: thePage) not. self assert: (self ifCurrentStackPageHasValidHeadPointers: thePage). theFP := thePage headFP. + "Skip the instruction pointer on top of stack of inactive pages." - - "If a machine code primitive is in progress then there will be a return address on top of stack - which does not refer to the current frame's method (which is the caller of the primitive), since - the primitive has not built a frame. It is vital that that method not be reclaimed!!!!" - theIP := (stackPages longAt: thePage headSP) asUnsignedInteger. - (theIP < objectMemory startOfMemory - and: [theIP ~= cogit ceReturnToInterpreterPC]) ifTrue: - [self assert: (self isMachineCodeFrame: theFP). - cogMethod := self mframeHomeMethod: theFP. - (theIP >= cogMethod asUnsignedInteger - and: [theIP < (cogMethod asUnsignedInteger + cogMethod blockSize)]) ifFalse: - [(cogit cogMethodContaining: theIP) ifNotNil: - [:primCogMethod| cogit markMethodAndReferents: primCogMethod]]]. - [(self isMachineCodeFrame: theFP) ifTrue: [cogit markMethodAndReferents: (self mframeCogMethod: theFP)]. (callerFP := self frameCallerFP: theFP) ~= 0] whileTrue: [theFP := callerFP]! From no-reply at appveyor.com Mon Nov 16 07:36:46 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 16 Nov 2020 07:36:46 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2311 Message-ID: <20201116073646.1.FB87EE10345939EF@appveyor.com> An HTML attachment was scrubbed... URL: From noreply at github.com Mon Nov 16 07:47:20 2020 From: noreply at github.com (Eliot Miranda) Date: Sun, 15 Nov 2020 23:47:20 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 400dfa: CogVM source as per VMMaker.oscog-eem.2887 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 400dfa3fddce98a0b9127b3981109b5ec61623a5 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/400dfa3fddce98a0b9127b3981109b5ec61623a5 Author: Eliot Miranda Date: 2020-11-15 (Sun, 15 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c 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 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 spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c 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 spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c 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 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 spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c 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 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 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 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/gcc3x-cointerp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2887 Oops. Forgot to revert methods necessary to make the previous commit compile. From builds at travis-ci.org Mon Nov 16 07:57:19 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 16 Nov 2020 07:57:19 +0000 Subject: [Vm-dev] Errored: OpenSmalltalk/opensmalltalk-vm#2307 (Cog - 400dfa3) In-Reply-To: Message-ID: <5fb230df8970a_13ff3bea77ec41991f6@travis-tasks-6997b7486b-gxlqw.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2307 Status: Errored Duration: 9 mins and 28 secs Commit: 400dfa3 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2887 Oops. Forgot to revert methods necessary to make the previous commit compile. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/862bc3704dbb...400dfa3fddce View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/743884752?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Nov 16 08:01:16 2020 From: notifications at github.com (Eliot Miranda) Date: Mon, 16 Nov 2020 00:01:16 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: Hi Marcel, it should be fixed in 400dfa3fddce98a0b9127b3981109b5ec61623a5 Apologies for the loss of snapshots!! -- 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/535#issuecomment-727807530 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Mon Nov 16 08:13:40 2020 From: notifications at github.com (Marcel Taeumel) Date: Mon, 16 Nov 2020 00:13:40 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] win64x64.squeak.cog.spur silently crashes on save or save&quit (#535) In-Reply-To: References: Message-ID: Thanks! I am building it now to try it during the next days. I will report back. -- 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/535#issuecomment-727813760 -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Nov 16 09:36:08 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 16 Nov 2020 09:36:08 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2312 Message-ID: <20201116093608.1.414A843F775E48A0@appveyor.com> An HTML attachment was scrubbed... URL: From stes at telenet.be Mon Nov 16 09:54:31 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Mon, 16 Nov 2020 10:54:31 +0100 (CET) Subject: [Vm-dev] [SQUEAKVM] SqueakSSL support code updated on squeakvm.org SVN repository In-Reply-To: <741209258.5768433.1605448361727.JavaMail.zimbra@telenet.be> References: <597982338.54087789.1605095248188.JavaMail.zimbra@telenet.be> <741209258.5768433.1605448361727.JavaMail.zimbra@telenet.be> Message-ID: <731589900.8115739.1605520471669.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Great. For the aio patch where I replaced signal() by sigaction() it's because I think the SIGPOLL (=SIGIO on Solaris) requires to reinstall the handler, which signal() doesn't do on some SVR4 Unix type systems, whereas when using POSIX sigaction() which was designed to address this, the VM does not abort all the time on 'Pollable Event' (which indicates SIGPOLL is not caught by a handler), so that was broken on Solaris in the past. In Squeak5 (Git OpenSmalltalk) somebody implemented a sigaction() based system, so for Squeak5 that was not a problem because it didn't use signal(). I checked out with subversion revision 3790 on Solaris 11.3 and it builds ok. Following the instructions from http://wiki.squeak.org/squeak/6354 The following 'make' compiles both 32bit and 64bit : $ make O=.. S=./src P=./platforms install I can open Squeak4.6-15102.image (format 6504) with that VM and, in the about squeak dialog : Unix built on Nov 16 2020 10:12:41 Compiler: 5.15.0 platform sources revision 3790 VMMaker versionString 4.19.2 When I select from the menu "Update Squeak" it downloads a bunch of updates, and then I save the (updated) image. The SqueakMap catalog browser seems to work. When I go to the Test Runner and select "SqueakSSL-Tests", in the left pane I have one test SqueakSSLTest. It seems to run 14 tests: 14 run, 14 passes, 0 expected failures, 0 failures, 0 errors, 0 unexpected passes That's already good. I suspect to further test Tobias Pape's SSL module (on Solaris 11) with the updated VM I can try to connect with a "Monticello" browser or similar that uses the new/updated SSL code. But it seems fine. I'll update the OpenIndiana and Solaris packages to use subversion revision 3790 instead of revision 3775; it definitely seems not worse than the older squeak4 VM, on the contrary. in revision 3775 : platforms/unix/plugins/SqueakSSL/ config.cmake sqUnixOpenSSL.c in revisision 3790: platforms/unix/plugins/SqueakSSL/ config.cmake sqUnixLibreSSL.inc sqUnixSSL.c openssl_overlay.h sqUnixOpenSSL.inc I had sent a few emails to Ian Piumarta but never had a reply; I'm pretty sure back in the days 1995-1998 Ian (and maybe others) had access to SunOS machines for early version of the Squeak VM (Unix version). Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfskuMAAoJEAwpOKXMq1Ma1PsIAJJ8Vm3wDhu8FPp+fco50kHL RlLuWgw5hL2NSu0Pb4eleYRZYL5oRvQgFzjVF7uGVfS9ig4Wb5EQVNnSic/bLD0H PK4BrFKddcrFoW3kQJM+QUiXARj8+XK8z/3IUZVgdf+jrtwrBvdK+7d7tpopyH08 BLelDmWCu8dQe3VrrhWF1CRhamrLTEfKfih/TCy1Yuz2dNy3pCjqBR2aikHdDXTD 3RXKMP/i/WoPr8oiAdijGnexjhzDky5e4y2iGFGvvYepVKrrPtzWNBkPX0/skrLZ Nbal0ZTmeRT2TF6Pa8wLmH3Kad9/gFgNPDJMOdHoC6l2/D7arA+8i15TQJe3xWE= =gvh5 -----END PGP SIGNATURE----- From notifications at github.com Wed Nov 18 10:05:26 2020 From: notifications at github.com (Marcel Taeumel) Date: Wed, 18 Nov 2020 02:05:26 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Context >> #printOn: is weird (#536) Message-ID: VM: win32x86.cog.spur (202011160746, VMMaker.oscog-eem.2887) OS: Windows 10 SQ: Squeak6.0alpha #20077 I suppose that `Context >> #objectClass:` (primitive 111) answers `Context` from time to time. I cannot really debug it, though. Sometimes `Context >> #printOn:` does the right thing. ![grafik](https://user-images.githubusercontent.com/5765308/99515452-459d5b00-298d-11eb-93f3-a617c099a95a.png) -- 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/536 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Wed Nov 18 22:20:03 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 18 Nov 2020 14:20:03 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d86b48: unistd.h is required on Big Sur since the compiler... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d86b483695d3fef5004ab1e25d5beb8de95066c7 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d86b483695d3fef5004ab1e25d5beb8de95066c7 Author: Eliot Miranda Date: 2020-11-18 (Wed, 18 Nov 2020) Changed paths: M build.macos32x86/common/Makefile.app M build.macos64ARMv8/common/Makefile.app M build.macos64x64/common/Makefile.app M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c M platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c M platforms/unix/vm/sqUnixThreads.c Log Message: ----------- unistd.h is required on Big Sur since the compiler will no longer tolerate implciit declarations. From builds at travis-ci.org Wed Nov 18 23:31:58 2020 From: builds at travis-ci.org (Travis CI) Date: Wed, 18 Nov 2020 23:31:58 +0000 Subject: [Vm-dev] Failed: OpenSmalltalk/opensmalltalk-vm#2308 (Cog - d86b483) In-Reply-To: Message-ID: <5fb5aeee78e37_13fe4425aa4b8221586@travis-tasks-58b546749f-cgtpk.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2308 Status: Failed Duration: 1 hr, 10 mins, and 16 secs Commit: d86b483 (Cog) Author: Eliot Miranda Message: unistd.h is required on Big Sur since the compiler will no longer tolerate implciit declarations. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/400dfa3fddce...d86b483695d3 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/744535684?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Wed Nov 18 23:35:06 2020 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 18 Nov 2020 23:35:06 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2313 Message-ID: <20201118233506.1.051BE2899EEF2EBF@appveyor.com> An HTML attachment was scrubbed... URL: From notifications at github.com Thu Nov 19 10:31:21 2020 From: notifications at github.com (Marcel Taeumel) Date: Thu, 19 Nov 2020 02:31:21 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Context >> #printOn: is weird (#536) In-Reply-To: References: Message-ID: I suspect that this is a VM bug because it works with older VMs. :-) -- 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/536#issuecomment-730280524 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Thu Nov 19 22:06:38 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 19 Nov 2020 22:06:38 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2888.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2888.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2888 Author: eem Time: 19 November 2020, 2:06:30.613338 pm UUID: 4ab1879f-b54c-4058-9623-0e9566427b23 Ancestors: VMMaker.oscog-eem.2887 Fix a Slang regression in VMMaker.oscog-eem.2884. The elision of unused argument assignments also elided argument expressions that had side-effects. The fix is to retain epxressions that have side effects but generate assignments of those expressions to inlined variables only for variables that are actually used in the expansion. =============== Diff against VMMaker.oscog-eem.2887 =============== Item was changed: ----- Method: TMethod>>argAssignmentsFor:send:except:in: (in category 'inlining') ----- argAssignmentsFor: meth send: aSendNode except: elidedArgs in: aCodeGen "Answer a collection of assignment nodes that assign the given argument expressions to the formal parameter variables of the given method." "Optimization: If the actual parameters are either constants or local variables in the target method (the receiver), substitute them directly into the body of meth. Note that global variables cannot be substituted because the inlined method might depend on the exact ordering of side effects to the globals. Optimization: Don't answer statements for formal parameters which are unused in the method body." | stmtList substitutionDict argList referencedArguments | meth args size > (argList := aSendNode args) size ifTrue: [self assert: (meth args first beginsWith: 'self_in_'). argList := {aSendNode receiver}, aSendNode args]. stmtList := OrderedCollection new: argList size. substitutionDict := Dictionary new: argList size. meth args with: argList do: [:argName :exprNode | (self isNode: exprNode substitutableFor: argName inMethod: meth in: aCodeGen) ifTrue: [substitutionDict at: argName put: (aCodeGen node: exprNode typeCompatibleWith: argName inliningInto: meth in: self). locals remove: argName ifAbsent: [self assert: (argName beginsWith: 'self_in_')]. declarations removeKey: argName ifAbsent: nil] ifFalse: "Add an assignment for anything except an unused self_in_foo argument" [(elidedArgs includes: argName) ifFalse: [self deny: exprNode isLiteralBlock. stmtList addLast: (TAssignmentNode new setVariable: (TVariableNode new setName: argName) expression: (aCodeGen node: exprNode copy typeCompatibleWith: argName inliningInto: meth in: self))]]]. meth parseTree: (meth parseTree bindVariablesIn: substitutionDict). referencedArguments := meth allReferencedArgumentsUsing: aCodeGen. + ^(stmtList + collect: + [:assignment| + (referencedArguments includes: assignment variable name) + ifTrue: [assignment] + ifFalse: + [assignment expression hasSideEffect ifTrue: + [assignment expression]]]) + select: [:node| node notNil]! - ^stmtList select: [:assignment| referencedArguments includes: assignment variable name]! From commits at source.squeak.org Thu Nov 19 22:32:52 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 19 Nov 2020 22:32:52 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2889.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2889.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2889 Author: eem Time: 19 November 2020, 2:32:43.668199 pm UUID: 01cc1b20-736a-4b9d-9631-743896b4dc66 Ancestors: VMMaker.oscog-eem.2888 But we can do a little better than VMMaker.oscog-eem.2888. Better comment argAssignmentsFor:send:except:in: and make sure that side-effect-less longAt: is recognised as such, hcen inlining of SpurMemoryManager>>#isClassOfNonImm:equalTo:compactClassIndex: is much improved (less noise). =============== Diff against VMMaker.oscog-eem.2888 =============== Item was changed: ----- Method: TMethod>>argAssignmentsFor:send:except:in: (in category 'inlining') ----- argAssignmentsFor: meth send: aSendNode except: elidedArgs in: aCodeGen + "Answer a collection of assignment nodes that assign the given argument expressions + to the formal parameter variables of the given method. - "Answer a collection of assignment nodes that assign the given argument expressions to the formal parameter variables of the given method." - "Optimization: If the actual parameters are either constants or local variables in the target method (the receiver), substitute them directly into the body of meth. Note that global variables cannot be substituted because the inlined method might depend on the exact ordering of side effects to the globals. - Optimization: Don't answer statements for formal parameters which are unused in the method body." + Optimization: If the actual parameters are either constants or local variables in the target + method (the receiver), substitute them directly into the body of meth. Note that global + variables cannot be substituted because the inlined method might depend on the exact + ordering of side effects to the globals. + + Optimization: Don't generate assignment statements for formal parameters which are unused in + the method body, retaining statements for unused parameter expressions that have side-effects." + | stmtList substitutionDict argList referencedArguments | meth args size > (argList := aSendNode args) size ifTrue: [self assert: (meth args first beginsWith: 'self_in_'). argList := {aSendNode receiver}, aSendNode args]. stmtList := OrderedCollection new: argList size. substitutionDict := Dictionary new: argList size. meth args with: argList do: [:argName :exprNode | (self isNode: exprNode substitutableFor: argName inMethod: meth in: aCodeGen) ifTrue: [substitutionDict at: argName put: (aCodeGen node: exprNode typeCompatibleWith: argName inliningInto: meth in: self). locals remove: argName ifAbsent: [self assert: (argName beginsWith: 'self_in_')]. declarations removeKey: argName ifAbsent: nil] ifFalse: "Add an assignment for anything except an unused self_in_foo argument" [(elidedArgs includes: argName) ifFalse: [self deny: exprNode isLiteralBlock. stmtList addLast: (TAssignmentNode new setVariable: (TVariableNode new setName: argName) expression: (aCodeGen node: exprNode copy typeCompatibleWith: argName inliningInto: meth in: self))]]]. meth parseTree: (meth parseTree bindVariablesIn: substitutionDict). referencedArguments := meth allReferencedArgumentsUsing: aCodeGen. + "Now filter-out assignments for unused formal parameters, while + retaining any actual parameter expressions that have side-effects." ^(stmtList collect: [:assignment| (referencedArguments includes: assignment variable name) ifTrue: [assignment] ifFalse: [assignment expression hasSideEffect ifTrue: [assignment expression]]]) select: [:node| node notNil]! Item was changed: ----- Method: TSendNode>>hasSideEffect (in category 'testing') ----- hasSideEffect "Answer if the parse tree rooted at this node has a side-effect or not." + selector == #longAt: ifTrue: "Important for inlining Spur's isClassOfNonImm:equalTo:compactClassIndex:" + [^arguments first hasSideEffect "a.k.a. arguments anySatisfy: [:node| node hasSideEffect]"]. + ^(#(#+ #- #* #/ #// #\\ #= #== #~= #~~ << >>) includes: selector) not! - ^(#(#+ #- #* #/ #// #\\ #= #== #~= #~~) includes: selector) not! From commits at source.squeak.org Thu Nov 19 23:27:41 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 19 Nov 2020 23:27:41 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2890.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2890.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2890 Author: eem Time: 19 November 2020, 3:27:30.098527 pm UUID: efbda991-7783-410b-a286-305ddf6fde8a Ancestors: VMMaker.oscog-eem.2889 More effort is required to delete the unnecessary read before Spur is:instanceOf:compactClassIndex:. =============== Diff against VMMaker.oscog-eem.2889 =============== Item was removed: - ----- Method: TParseNode>>collect: (in category 'enumerating') ----- - collect: aBlock - | nodes | - self halt. "This is a misnomer; should be deleted" - nodes := OrderedCollection new. - self nodesDo: [:n| (aBlock value: n) ifTrue: [nodes add: n]]. - ^nodes! Item was changed: + ----- Method: TParseNode>>deny: (in category 'testing') ----- - ----- Method: TParseNode>>deny: (in category 'as yet unclassified') ----- deny: aBooleanOrBlock aBooleanOrBlock value ifTrue: [AssertionFailure signal: 'Assertion failed']! Item was changed: ----- Method: TSendNode>>hasSideEffect (in category 'testing') ----- hasSideEffect + "Answer if the parse tree rooted at this node has a side-effect or not. + We aassume most sends do, but filter-out arithmetic and certain reads." + (#( baseHeaderSize bytesPerOop bytesPerWord logBytesPerOop + numSmallIntegerBits numSmallIntegerTagBits numTagBits + shiftForWord tagMask wordSize) includes: selector) ifTrue: + [^false]. + (#(#+ #- #* #/ #// #\\ #= #== #~= #~~ << >> + "These two important for Spur is:instanceOf:compactClassIndex: et al" + longAt: fetchPointer:ofObject:) includes: selector) ifFalse: + [^true]. + ^receiver hasSideEffect or: [arguments first hasSideEffect]! - "Answer if the parse tree rooted at this node has a side-effect or not." - selector == #longAt: ifTrue: "Important for inlining Spur's isClassOfNonImm:equalTo:compactClassIndex:" - [^arguments first hasSideEffect "a.k.a. arguments anySatisfy: [:node| node hasSideEffect]"]. - ^(#(#+ #- #* #/ #// #\\ #= #== #~= #~~ << >>) includes: selector) not! From commits at source.squeak.org Thu Nov 19 23:42:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 19 Nov 2020 23:42:03 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2891.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2891.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2891 Author: eem Time: 19 November 2020, 3:41:54.060939 pm UUID: c72f6268-da7e-45bc-9d75-146609259374 Ancestors: VMMaker.oscog-eem.2890 And splObj: is needed for the last case in cStringOrNullFor:. =============== Diff against VMMaker.oscog-eem.2890 =============== Item was changed: ----- Method: TSendNode>>hasSideEffect (in category 'testing') ----- hasSideEffect "Answer if the parse tree rooted at this node has a side-effect or not. We aassume most sends do, but filter-out arithmetic and certain reads." (#( baseHeaderSize bytesPerOop bytesPerWord logBytesPerOop numSmallIntegerBits numSmallIntegerTagBits numTagBits shiftForWord tagMask wordSize) includes: selector) ifTrue: [^false]. (#(#+ #- #* #/ #// #\\ #= #== #~= #~~ << >> "These two important for Spur is:instanceOf:compactClassIndex: et al" + longAt: fetchPointer:ofObject: splObj:) includes: selector) ifFalse: - longAt: fetchPointer:ofObject:) includes: selector) ifFalse: [^true]. ^receiver hasSideEffect or: [arguments first hasSideEffect]! From noreply at github.com Fri Nov 20 00:41:27 2020 From: noreply at github.com (Eliot Miranda) Date: Thu, 19 Nov 2020 16:41:27 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] aaff42: CogVM source as per VMMaker.oscog-eem.2891 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: aaff428d0fae173c0e69a12c48be010742730954 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aaff428d0fae173c0e69a12c48be010742730954 Author: Eliot Miranda Date: 2020-11-19 (Thu, 19 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c 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 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 spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spur64src/vm/cointerp.c M spur64src/vm/cointerp.h M spur64src/vm/gcc3x-cointerp.c M spur64src/vm/gcc3x-cointerpmt.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c 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 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 spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c 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 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 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 spurstack64src/vm/validImage.c M spurstacksrc/vm/validImage.c M src/plugins/B2DPlugin/B2DPlugin.c M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c M src/plugins/SqueakFFIPrims/IA32FFIPlugin.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/gcc3x-cointerp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2891 Fix a Slang regression in VMMaker.oscog-eem.2884. The elision of unused argument assignments also elided argument expressions that had side-effects. The fix is to retain epxressions that have side effects but generate assignments of those expressions to inlined variables only for variables that are actually used in the expansion. The symptom fixed is the bad bug of Context>>objectClass: answering the class of the receiver, not its argument. From noreply at github.com Fri Nov 20 00:44:44 2020 From: noreply at github.com (Eliot Miranda) Date: Thu, 19 Nov 2020 16:44:44 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 1326e8: unistd.h is required on Big Sur since the compiler... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 1326e87a906b4e975ff89d8e54ac0ad2af4d4e4b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/1326e87a906b4e975ff89d8e54ac0ad2af4d4e4b Author: Eliot Miranda Date: 2020-11-19 (Thu, 19 Nov 2020) Changed paths: M build.macos32x86/common/Makefile.app M build.macos64ARMv8/common/Makefile.app M build.macos64x64/common/Makefile.app M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c M nsspur64src/vm/cogitX64SysV.c M nsspur64src/vm/cogitX64WIN64.c M nsspursrc/vm/cogit.h M nsspursrc/vm/cogitARMv5.c M nsspursrc/vm/cogitIA32.c M nsspursrc/vm/cogitMIPSEL.c M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c M platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c M platforms/unix/vm/sqUnixThreads.c M scripts/revertIfEssentiallyUnchanged M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spur64src/vm/gcc3x-cointerpmt.c M spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c 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 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 spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c M spursista64src/vm/cogitX64SysV.c M spursista64src/vm/cogitX64WIN64.c M spursistasrc/vm/cogit.h M spursistasrc/vm/cogitARMv5.c M spursistasrc/vm/cogitIA32.c M spursistasrc/vm/cogitMIPSEL.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerpmt.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/validImage.c M src/plugins/B2DPlugin/B2DPlugin.c M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c M src/plugins/SqueakFFIPrims/IA32FFIPlugin.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 Log Message: ----------- unistd.h is required on Big Sur since the compiler will no longer tolerate implciit declarations. Commit: adfff2166ce847ea12c1f50a4eeb771cef969afa https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/adfff2166ce847ea12c1f50a4eeb771cef969afa Author: Eliot Miranda Date: 2020-11-19 (Thu, 19 Nov 2020) Changed paths: Log Message: ----------- unistd.h is required on Big Sur since the compiler will no longer tolerate implciit declarations. Commit: 47691a29af57ed6e2b01b5de11fee7ef03b3833d https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/47691a29af57ed6e2b01b5de11fee7ef03b3833d Author: Eliot Miranda Date: 2020-11-19 (Thu, 19 Nov 2020) Changed paths: M nsspur64src/vm/cointerp.c M nsspur64src/vm/cointerp.h M nsspur64src/vm/gcc3x-cointerp.c M nsspursrc/vm/cointerp.c M nsspursrc/vm/cointerp.h M nsspursrc/vm/gcc3x-cointerp.c M spur64src/vm/cointerp.c M spur64src/vm/cointerp.h M spur64src/vm/gcc3x-cointerp.c M spursista64src/vm/cointerp.c M spursista64src/vm/cointerp.h M spursista64src/vm/gcc3x-cointerp.c M spursistasrc/vm/cointerp.c M spursistasrc/vm/cointerp.h M spursistasrc/vm/gcc3x-cointerp.c M spursrc/vm/cointerp.c M spursrc/vm/cointerp.h M spursrc/vm/gcc3x-cointerp.c M src/vm/cogitMIPSEL.c M src/vm/cointerp.c M src/vm/cointerp.h M src/vm/gcc3x-cointerp.c Log Message: ----------- Merge branch 'Cog' of https://github.com/OpenSmalltalk/opensmalltalk-vm into Cog Commit: df0256b37d2673e017114f7ed0a01a7cb35b00d3 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/df0256b37d2673e017114f7ed0a01a7cb35b00d3 Author: Eliot Miranda Date: 2020-11-19 (Thu, 19 Nov 2020) Changed paths: M scripts/revertIfEssentiallyUnchanged Log Message: ----------- Ugh, what a pain when MacOS's status bug causes vi to apparently answer 0 and one loses a perfectly good commit, message, files and all. Never mind. This commit adds a straggler. [ci skip] Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/aaff428d0fae...df0256b37d26 From no-reply at appveyor.com Fri Nov 20 02:30:53 2020 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 20 Nov 2020 02:30:53 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2314 Message-ID: <20201120023053.1.189714558B79135E@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Fri Nov 20 08:25:47 2020 From: builds at travis-ci.org (Travis CI) Date: Fri, 20 Nov 2020 08:25:47 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2309 (Cog - aaff428) In-Reply-To: Message-ID: <5fb77d8a9c1ed_13f91315ae8b031573@travis-tasks-5cb7946958-5s4gg.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2309 Status: Still Failing Duration: 7 hrs, 43 mins, and 14 secs Commit: aaff428 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2891 Fix a Slang regression in VMMaker.oscog-eem.2884. The elision of unused argument assignments also elided argument expressions that had side-effects. The fix is to retain epxressions that have side effects but generate assignments of those expressions to inlined variables only for variables that are actually used in the expansion. The symptom fixed is the bad bug of Context>>objectClass: answering the class of the receiver, not its argument. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/d86b483695d3...aaff428d0fae View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/744782599?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Fri Nov 20 12:36:20 2020 From: builds at travis-ci.org (Travis CI) Date: Fri, 20 Nov 2020 12:36:20 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2310 (Cog - 47691a2) In-Reply-To: Message-ID: <5fb7b84410f70_13ffda0aee70482118@travis-tasks-54859cdbcc-jz89h.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2310 Status: Still Failing Duration: 10 hrs, 15 mins, and 14 secs Commit: 47691a2 (Cog) Author: Eliot Miranda Message: Merge branch 'Cog' of https://github.com/OpenSmalltalk/opensmalltalk-vm into Cog View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/aaff428d0fae...df0256b37d26 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/744782956?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stes at telenet.be Fri Nov 20 15:00:26 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Fri, 20 Nov 2020 16:00:26 +0100 (CET) Subject: [Vm-dev] VM_VERSION triplet Message-ID: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 An interesting side-effect of David Lewis's update of the subversion repo, was that I observed that the new VM is called : 4.19.2-3790 and 4.19.2-3790_64bit The subversion source code seems to be generated from the VMMaker 4.19.2, and this automatically sets VM_VERSION to 4.19.2 : The code in the configure script that is doing this: vmmversion="`tr '\015 ' '\012\012' < \"${interp_h}\" | sed '1,/VMMaker/d;q'`" VM_VERSION="${vmmversion}-${svnversion}${RELEASE_TAG}" So it automatically creates a 3 digit version with the subversion 3790 suffix, based on the SVN version and the VMMaker version. The subversion version number is 3790 so far is clear, but the VM version seems to be set by the above code now to "4.19.2". For the Solaris IPS COMPONENT_VERSION I had a number 4.16.7 and I updated it to the new COMPONENT_VERSION= 4.19.2 . For the squeak-5 Git OpenSmalltalk VM I would also like to use a 3 digit version number that makes some sense. Currently I create 3 digit numbers myself (without any relationship to squeak). However I was thinking that maybe I can use: 5.0.x where x is the VMMaker version number. It appears that nowadays the VMmaker is called VMMaker.oscog-eem.2887 So I could use the number 2887 in 5.0.2887 where 2887 is the VMMaker number. This relates to my question a few months ago as to the #define platforms/Cross/vm/sqVirtualMachine.h:# define VM_VERSION "5.0" which in my understanding sets the VM_VERSION of all VM's to "5.0". An issue could be that the "stack" VM and the "cog" VM actually seem to use, different VMmaker numbers. For example currently for the "stack" VM the VMmaker number is 2885. For the "cog" VM the VMmaker number is 2891. So they are slightly different. I guess that what I wonder is whether it makes sense to use version numbers, 5.0.x 5.0.2885 5.0.2891 where x= VMmaker release number following Eliot Miranda's VMmaker release. Is there an established triplet 3digit release number for OpenSmalltalk ?? Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJft9m+AAoJEAwpOKXMq1MaNnEIALdzkb00VEQ/XHn+F/8G37tE EteNRCQtIawigsUn+aSh+OLX0NbTOyyzCbHh2ihqWFMyIvdisT9SP9FlRUzXryBR gW14p3xgHoLot2sGChXDro6ZLYsaRVDsnJVuzFTBuyClwlK4HwJXvJdOsEP3TMo4 Nr8w0ldX4hDpoNvil0d/K/uxJ8Cg1XENQ4ECv0DEUv3qMgJeOynDyqRbOWRqym9e Gc+Bya71kKYrWLHI7/ekxO0I99p6YGYXMb+sjxM+xCY9IIxm0Lcq5IjLNEPwvvpX nHp1U4n9BUYc40P+Cja9m2+olI0uTix/+FzmGM3G/biqbIIf3u+B5qg97gr3z5g= =eFQV -----END PGP SIGNATURE----- From commits at source.squeak.org Fri Nov 20 19:51:34 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 20 Nov 2020 19:51:34 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2892.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2892.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2892 Author: eem Time: 20 November 2020, 11:51:23.884407 am UUID: c01b9cfa-a988-4deb-952c-2decf8ea1a0c Ancestors: VMMaker.oscog-eem.2891 Implement a better fix for the VMMaker.oscog-eem.2824/http://forum.world.st/corruption-of-PC-in-context-objects-or-not-tt5121662.html case. Instead of changing to the interpreter, mark the cog method containing instructionPointer and relocate instructionPointer in markActiveMethodsAndReferents/updateStackZoneReferencesToCompiledCodePreCompaction. Rename PrimCallMayCallBack to PrimCallMayEndureCodeCompaction. Get rid of some 's from initialize methods. =============== Diff against VMMaker.oscog-eem.2891 =============== Item was changed: ----- Method: CoInterpreter class>>initializeMiscConstants (in category 'initialization') ----- initializeMiscConstants super initializeMiscConstants. COGVM := true. MinBackwardJumpCountForCompile := 40. MaxNumArgs := 15. PrimCallNeedsNewMethod := 1. PrimCallNeedsPrimitiveFunction := 2. + PrimCallMayEndureCodeCompaction := 4. - PrimCallMayCallBack := 4. PrimCallOnSmalltalkStack := 8. PrimCallCollectsProfileSamples := 16. "CheckAllocationFillerAfterPrimCall := 32. this has never been successfully used in all the years we've had it; nuking it" PrimCallDoNotJIT := 64. PrimTraceLogSize := 256. "Room for 256 selectors. Must be 256 because we use a byte to hold the index" TraceBufferSize := 256 * 3. "Room for 256 events" TraceContextSwitch := self objectMemoryClass basicNew integerObjectOf: 1. TraceBlockActivation := self objectMemoryClass basicNew integerObjectOf: 2. TraceBlockCreation := self objectMemoryClass basicNew integerObjectOf: 3. TraceIncrementalGC := self objectMemoryClass basicNew integerObjectOf: 4. TraceFullGC := self objectMemoryClass basicNew integerObjectOf: 5. TraceCodeCompaction := self objectMemoryClass basicNew integerObjectOf: 6. TraceOwnVM := self objectMemoryClass basicNew integerObjectOf: 7. TraceDisownVM := self objectMemoryClass basicNew integerObjectOf: 8. TraceThreadSwitch := self objectMemoryClass basicNew integerObjectOf: 9. TracePreemptDisowningThread := self objectMemoryClass basicNew integerObjectOf: 10. TraceVMCallback := self objectMemoryClass basicNew integerObjectOf: 11. TraceVMCallbackReturn := self objectMemoryClass basicNew integerObjectOf: 12. TraceStackOverflow := self objectMemoryClass basicNew integerObjectOf: 13. TracePrimitiveFailure := self objectMemoryClass basicNew integerObjectOf: 14. TracePrimitiveRetry := self objectMemoryClass basicNew integerObjectOf: 15. TraceIsFromMachineCode := 1. TraceIsFromInterpreter := 2. CSCallbackEnter := 3. CSCallbackLeave := 4. CSEnterCriticalSection := 5. CSExitCriticalSection := 6. CSResume := 7. CSSignal := 8. CSSuspend := 9. CSWait := 10. CSYield := 11. CSCheckEvents := 12. CSThreadSchedulingLoop := 13. CSOwnVM := 14. CSThreadBind := 15. CSSwitchIfNeccessary := 16. TraceSources := CArrayAccessor on: #('?' 'm' 'i' 'callbackEnter' 'callbackLeave' 'enterCritical' 'exitCritical' 'resume' 'signal' 'suspend' 'wait' 'yield' 'eventcheck' 'threadsched' 'ownVM' 'bindToThread' 'switchIfNecessary'). "this is simulation only" RumpCStackSize := 4096! Item was added: + ----- Method: CoInterpreter>>isCodeCompactingPrimitiveIndex: (in category 'primitive support') ----- + isCodeCompactingPrimitiveIndex: primIndex + "If instVarAt:, slotAt: or shallowCopy operate on a Context then they compute a + bytecode pc and hence may provoke a code compaction. Hence primtiive invocation + from these primitives must use a static return address (cePrimReturnEnterCogCode:)." + + self cCode: [] inSmalltalk: [#primitiveClone. #primitiveInstVarAt. #primitiveSlotAt]. "For senders..." + ^primIndex = PrimNumberInstVarAt + or: [primIndex = PrimNumberShallowCopy + or: [primIndex = PrimNumberSlotAt]]! Item was changed: ----- Method: CoInterpreter>>markActiveMethodsAndReferents (in category 'cog jit support') ----- markActiveMethodsAndReferents + "If instructionPointer is referring to machine code, as it will be if a primitive is in progress + (see isCodeCompactingPrimitiveIndex:) it may refer to a method, and if so that method + must be retained." + instructionPointer ~= 0 ifTrue: + [(cogit cogMethodContaining: instructionPointer) ifNotNil: + [:primCogMethod| + cogit markMethodAndReferents: primCogMethod]]. + - | thePage | - 0 to: numStackPages - 1 do: + [:i| | thePage | - [:i| thePage := stackPages stackPageAt: i. (stackPages isFree: thePage) ifFalse: [self markCogMethodsAndReferentsOnPage: thePage]]! Item was changed: ----- Method: CoInterpreter>>markCogMethodsAndReferentsOnPage: (in category 'frame access') ----- markCogMethodsAndReferentsOnPage: thePage | theFP callerFP | - - self assert: (stackPages isFree: thePage) not. self assert: (self ifCurrentStackPageHasValidHeadPointers: thePage). theFP := thePage headFP. - "Skip the instruction pointer on top of stack of inactive pages." [(self isMachineCodeFrame: theFP) ifTrue: [cogit markMethodAndReferents: (self mframeCogMethod: theFP)]. (callerFP := self frameCallerFP: theFP) ~= 0] whileTrue: [theFP := callerFP]! Item was changed: ----- Method: CoInterpreter>>primitivePropertyFlagsForSpur: (in category 'cog jit support') ----- primitivePropertyFlagsForSpur: primIndex "Answer any special requirements of the given primitive. Spur always needs to set primitiveFunctionPointer and newMethod so primitives can retry on failure due to forwarders." | baseFlags | self cCode: [] inSmalltalk: [#(mcprimHashMultiply: primitiveExternalCall primitiveCalloutToFFI)]. "For senders..." primIndex = PrimNumberHashMultiply ifTrue: [^PrimCallOnSmalltalkStack]. baseFlags := PrimCallNeedsPrimitiveFunction + PrimCallNeedsNewMethod. profileSemaphore ~= objectMemory nilObject ifTrue: [baseFlags := baseFlags bitOr: PrimCallCollectsProfileSamples]. + ((self isCalloutPrimitiveIndex: primIndex) "For callbacks" + or: [self isCodeCompactingPrimitiveIndex: primIndex]) ifTrue: "For code reclamations" + [baseFlags := baseFlags bitOr: PrimCallMayEndureCodeCompaction]. - (self isCalloutPrimitiveIndex: primIndex) ifTrue: "For callbacks" - [baseFlags := baseFlags bitOr: PrimCallMayCallBack]. ^baseFlags! Item was changed: ----- Method: CoInterpreter>>primitivePropertyFlagsForV3: (in category 'cog jit support') ----- primitivePropertyFlagsForV3: primIndex "Answer any special requirements of the given primitive" | baseFlags | baseFlags := profileSemaphore ~= objectMemory nilObject ifTrue: [PrimCallNeedsNewMethod + PrimCallCollectsProfileSamples] ifFalse: [0]. longRunningPrimitiveCheckSemaphore ifNotNil: [baseFlags := baseFlags bitOr: PrimCallNeedsNewMethod]. (self isCalloutPrimitiveIndex: primIndex) ifTrue: "For callbacks" + [baseFlags := baseFlags bitOr: PrimCallNeedsNewMethod + PrimCallNeedsPrimitiveFunction + PrimCallMayEndureCodeCompaction]. - [baseFlags := baseFlags bitOr: PrimCallNeedsNewMethod + PrimCallNeedsPrimitiveFunction + PrimCallMayCallBack]. (self isCodeCompactingPrimitiveIndex: primIndex) ifTrue: + [baseFlags := baseFlags bitOr: PrimCallNeedsNewMethod + PrimCallMayEndureCodeCompaction]. - [baseFlags := baseFlags bitOr: PrimCallNeedsNewMethod]. ^baseFlags! Item was changed: ----- Method: CoInterpreter>>updateStackZoneReferencesToCompiledCodePreCompaction (in category 'code compaction') ----- updateStackZoneReferencesToCompiledCodePreCompaction + "Go through all frames in the stack zone and mark their methods + so that compaction does not free any methods that are in use." + + + "If instructionPointer is referring to machine code, as it will be if a primitive is in progress + (see isCodeCompactingPrimitiveIndex:) it must be updated if it is referring to a moved + method." + instructionPointer ~= 0 ifTrue: + [(cogit cogMethodContaining: instructionPointer) ifNotNil: + [:primCogMethod| + instructionPointer := instructionPointer + primCogMethod objectHeader]]. + - - - - - - 0 to: numStackPages - 1 do: + [:i| | thePage | - [:i| | thePage theFP callerFP theIPPtr theIP theMethodField theFlags theMethod | thePage := stackPages stackPageAt: i. (stackPages isFree: thePage) ifFalse: + [self updateStackZoneReferencesToCompiledCodePreCompactionOnPage: thePage]]! - [theIPPtr := thePage headSP. - theFP := thePage headFP. - [(self isMachineCodeFrame: theFP) ifTrue: - [theMethodField := self frameMethodField: theFP. - theFlags := theMethodField bitAnd: MFMethodFlagsMask. - theMethod := self cCoerceSimple: theMethodField - theFlags to: #'CogMethod *'. - theMethod cmType = CMBlock ifTrue: - [theMethod := (self cCoerceSimple: theMethodField - theFlags to: #'CogBlockMethod *') cmHomeMethod]. - theIP := (stackPages longAt: theIPPtr) asUnsignedInteger. - (theIP ~= cogit ceCannotResumePC - and: [self asserta: (theIP >= theMethod asUnsignedInteger - and: [theIP < (theMethod asUnsignedInteger + theMethod blockSize)])]) ifTrue: - [stackPages - longAt: theIPPtr - put: theIP + theMethod objectHeader]. - stackPages - longAt: theFP + FoxMethod - put: theMethodField + theMethod objectHeader]. - (callerFP := self frameCallerFP: theFP) ~= 0] whileTrue: - [theIPPtr := theFP + FoxCallerSavedIP. - theFP := callerFP]]]! Item was added: + ----- Method: CoInterpreter>>updateStackZoneReferencesToCompiledCodePreCompactionOnPage: (in category 'frame access') ----- + updateStackZoneReferencesToCompiledCodePreCompactionOnPage: thePage + + + | theFP callerFP theIPPtr theIP theMethodField theFlags theMethod | + theIPPtr := thePage headSP. + theFP := thePage headFP. + [(self isMachineCodeFrame: theFP) ifTrue: + [theMethodField := self frameMethodField: theFP. + theFlags := theMethodField bitAnd: MFMethodFlagsMask. + theMethod := self cCoerceSimple: theMethodField - theFlags to: #'CogMethod *'. + theMethod cmType = CMBlock ifTrue: + [theMethod := (self cCoerceSimple: theMethodField - theFlags to: #'CogBlockMethod *') cmHomeMethod]. + theIP := (stackPages longAt: theIPPtr) asUnsignedInteger. + (theIP ~= cogit ceCannotResumePC + and: [self asserta: (theIP >= theMethod asUnsignedInteger + and: [theIP < (theMethod asUnsignedInteger + theMethod blockSize)])]) ifTrue: + [stackPages + longAt: theIPPtr + put: theIP + theMethod objectHeader]. + stackPages + longAt: theFP + FoxMethod + put: theMethodField + theMethod objectHeader]. + (callerFP := self frameCallerFP: theFP) ~= 0] whileTrue: + [theIPPtr := theFP + FoxCallerSavedIP. + theFP := callerFP]! Item was removed: - ----- Method: CoInterpreterPrimitives>>cloneContext: (in category 'primitive support') ----- - cloneContext: aContext - "Copy a Context. There are complications here. - Fields of married contexts must be mapped to image-level values. - In mapping a machine code pc, a code compaction may occur. - In this case return through machine code is impossible without - updating a C call stack return address, since the machine code - method that invoked this primitive could have moved. So if this - happens, map to an interpreter frame and return to the interpreter." - | cloned couldBeCogMethod | - self assert: ((objectMemory isCompiledMethod: newMethod) - and: [(self primitiveIndexOf: newMethod) > 0]). - - couldBeCogMethod := objectMemory rawHeaderOf: newMethod. - cloned := super cloneContext: aContext. - - "If the header has changed in any way then it is most likely that machine code - has been moved or reclaimed for this method and so normal return is impossible." - couldBeCogMethod ~= (objectMemory rawHeaderOf: newMethod) ifTrue: - [self convertToInterpreterFrame: 0. - self push: cloned. - cogit ceInvokeInterpret - "NOTREACHED"]. - - ^cloned! Item was removed: - ----- Method: CoInterpreterPrimitives>>primitiveInstVarAt (in category 'object access primitives') ----- - primitiveInstVarAt - "Override to deal with potential code compaction on accessing context pcs" - | index rcvr hdr fmt totalLength fixedFields value | - self assert: ((objectMemory isCompiledMethod: newMethod) - and: [(self primitiveIndexOf: newMethod) > 0]). - - index := self stackTop. - rcvr := self stackValue: 1. - ((objectMemory isNonIntegerObject: index) - or: [argumentCount > 1 "e.g. object:instVarAt:" - and: [objectMemory isOopForwarded: rcvr]]) ifTrue: - [^self primitiveFailFor: PrimErrBadArgument]. - (objectMemory isImmediate: rcvr) ifTrue: [^self primitiveFailFor: PrimErrInappropriate]. - index := objectMemory integerValueOf: index. - hdr := objectMemory baseHeader: rcvr. - fmt := objectMemory formatOfHeader: hdr. - totalLength := objectMemory lengthOf: rcvr baseHeader: hdr format: fmt. - fixedFields := objectMemory fixedFieldsOf: rcvr format: fmt length: totalLength. - (index >= 1 and: [index <= fixedFields]) ifFalse: - [^self primitiveFailFor: PrimErrBadIndex]. - (fmt = objectMemory indexablePointersFormat - and: [objectMemory isContextHeader: hdr]) - ifTrue: - [| couldBeCogMethod | - self externalWriteBackHeadFramePointers. - "Note newMethod's header to check for potential code compaction - in mapping the context's pc from machine code to bytecode." - index = InstructionPointerIndex ifTrue: - [couldBeCogMethod := objectMemory rawHeaderOf: newMethod]. - value := self externalInstVar: index - 1 ofContext: rcvr. - "If the header has changed in any way then it is most likely that machine code - has been moved or reclaimed for this method and so normal return is impossible." - (index = InstructionPointerIndex - and: [couldBeCogMethod ~= (objectMemory rawHeaderOf: newMethod)]) ifTrue: - [self pop: argumentCount + 1. - self convertToInterpreterFrame: 0. - self push: value. - cogit ceInvokeInterpret - "NOTREACHED"]] - ifFalse: [value := self subscript: rcvr with: index format: fmt]. - self pop: argumentCount + 1 thenPush: value! Item was removed: - ----- Method: CoInterpreterPrimitives>>primitiveSlotAt (in category 'object access primitives') ----- - primitiveSlotAt - "Answer a slot in an object. This numbers all slots from 1, ignoring the distinction between - named and indexed inst vars. In objects with both named and indexed inst vars, the named - inst vars precede the indexed ones. In non-object indexed objects (objects that contain - bits, not object references) this primitive answers the raw integral value at each slot. - e.g. for Strings it answers the character code, not the Character object at each slot." - - "Override to deal with potential code compaction on accessing context pcs" - | index rcvr fmt numSlots | - self assert: ((objectMemory isCompiledMethod: newMethod) - and: [(self primitiveIndexOf: newMethod) > 0]). - - index := self stackTop. - rcvr := self stackValue: 1. - (objectMemory isIntegerObject: index) ifFalse: - [^self primitiveFailFor: PrimErrBadArgument]. - (objectMemory isImmediate: rcvr) ifTrue: - [^self primitiveFailFor: PrimErrBadReceiver]. - fmt := objectMemory formatOf: rcvr. - index := (objectMemory integerValueOf: index) - 1. - - fmt <= objectMemory lastPointerFormat ifTrue: - [numSlots := objectMemory numSlotsOf: rcvr. - (self asUnsigned: index) < numSlots ifTrue: - [| value numLiveSlots | - (objectMemory isContextNonImm: rcvr) - ifTrue: - [self externalWriteBackHeadFramePointers. - numLiveSlots := (self stackPointerForMaybeMarriedContext: rcvr) + CtxtTempFrameStart. - (self asUnsigned: index) < numLiveSlots - ifTrue: - [| couldBeCogMethod | - "Note newMethod's header to check for potential code compaction - in mapping the context's pc from machine code to bytecode." - index = InstructionPointerIndex ifTrue: - [couldBeCogMethod := objectMemory rawHeaderOf: newMethod]. - value := self externalInstVar: index ofContext: rcvr. - "If the header has changed in any way then it is most likely that machine code - has been moved or reclaimed for this method and so normal return is impossible." - (index = InstructionPointerIndex - and: [couldBeCogMethod ~= (objectMemory rawHeaderOf: newMethod)]) ifTrue: - [self pop: argumentCount + 1. - self convertToInterpreterFrame: 0. - self push: value. - cogit ceInvokeInterpret - "NOTREACHED"]] - ifFalse: [value := objectMemory nilObject]] - ifFalse: - [value := objectMemory fetchPointer: index ofObject: rcvr]. - self pop: argumentCount + 1 thenPush: value. - ^0]. - ^self primitiveFailFor: PrimErrBadIndex]. - - fmt >= objectMemory firstByteFormat ifTrue: - [fmt >= objectMemory firstCompiledMethodFormat ifTrue: - [^self primitiveFailFor: PrimErrUnsupported]. - numSlots := objectMemory numBytesOfBytes: rcvr. - (self asUnsigned: index) < numSlots ifTrue: - [self pop: argumentCount + 1 thenPushInteger: (objectMemory fetchByte: index ofObject: rcvr). - ^0]. - ^self primitiveFailFor: PrimErrBadIndex]. - - (objectMemory hasSpurMemoryManagerAPI - and: [fmt >= objectMemory firstShortFormat]) ifTrue: - [numSlots := objectMemory num16BitUnitsOf: rcvr. - (self asUnsigned: index) < numSlots ifTrue: - [self pop: argumentCount + 1 thenPushInteger: (objectMemory fetchUnsignedShort16: index ofObject: rcvr). - ^0]. - ^self primitiveFailFor: PrimErrBadIndex]. - - fmt = objectMemory sixtyFourBitIndexableFormat ifTrue: - [numSlots := objectMemory num64BitUnitsOf: rcvr. - (self asUnsigned: index) < numSlots ifTrue: - [self pop: argumentCount + 1 - thenPush: (self positive64BitIntegerFor: (objectMemory fetchLong64: index ofObject: rcvr)). - ^0]. - ^self primitiveFailFor: PrimErrBadIndex]. - - fmt >= objectMemory firstLongFormat ifTrue: - [numSlots := objectMemory num32BitUnitsOf: rcvr. - (self asUnsigned: index) < numSlots ifTrue: - [self pop: argumentCount + 1 - thenPush: (self positive32BitIntegerFor: (objectMemory fetchLong32: index ofObject: rcvr)). - ^0]. - ^self primitiveFailFor: PrimErrBadIndex]. - - ^self primitiveFailFor: PrimErrBadReceiver! Item was removed: - ----- Method: CogARMCompiler>>initialize (in category 'generate machine code') ----- - initialize - "This method intializes the Smalltalk instance. The C instance is merely a struct and doesn't need initialization." - - operands := CArrayAccessor on: (Array new: NumOperands). - machineCode := CArrayAccessor on: (WordArray new: self machineCodeWords)! Item was changed: ----- Method: CogAbstractInstruction>>initialize (in category 'initialization') ----- initialize "This method intializes the Smalltalk instance. The C instance is merely a struct and doesn't need initialization." - operands := CArrayAccessor on: (Array new: NumOperands). + machineCode := CArrayAccessor on: (self codeGranularity = 4 + ifTrue: [WordArray new: self machineCodeWords] + ifFalse: [ByteArray new: self machineCodeBytes])! - machineCode := CArrayAccessor on: (ByteArray new: self machineCodeBytes)! Item was removed: - ----- Method: CogMIPSELCompiler>>initialize (in category 'generate machine code') ----- - initialize - "This method intializes the Smalltalk instance. The C instance is merely a struct and doesn't need initialization." - - operands := CArrayAccessor on: (Array new: NumOperands). - machineCode := CArrayAccessor on: (Array new: self machineCodeWords)! Item was changed: SharedPool subclass: #CogMethodConstants instanceVariableNames: '' + classVariableNames: 'CMBlock CMClosedPIC CMFree CMMaxUsageCount CMMethod CMOpenPIC CompletePrimitive EncounteredUnknownBytecode InsufficientCodeSpace MaxLiteralCountForCompile MaxMethodSize MaxNegativeErrorCode MaxNumArgs MaxStackCheckOffset MethodTooBig NotFullyInitialized PrimCallCollectsProfileSamples PrimCallDoNotJIT PrimCallMayEndureCodeCompaction PrimCallNeedsNewMethod PrimCallNeedsPrimitiveFunction PrimCallOnSmalltalkStack ShouldNotJIT UnfailingPrimitive UnimplementedPrimitive YoungSelectorInPIC' - classVariableNames: 'CMBlock CMClosedPIC CMFree CMMaxUsageCount CMMethod CMOpenPIC CompletePrimitive EncounteredUnknownBytecode InsufficientCodeSpace MaxLiteralCountForCompile MaxMethodSize MaxNegativeErrorCode MaxNumArgs MaxStackCheckOffset MethodTooBig NotFullyInitialized PrimCallCollectsProfileSamples PrimCallDoNotJIT PrimCallMayCallBack PrimCallNeedsNewMethod PrimCallNeedsPrimitiveFunction PrimCallOnSmalltalkStack ShouldNotJIT UnfailingPrimitive UnimplementedPrimitive YoungSelectorInPIC' poolDictionaries: '' category: 'VMMaker-JIT'! Item was added: + ----- Method: CogMethodZone>>cogMethodContaining: (in category 'jit - api') ----- + cogMethodContaining: mcpc + "Answer the method containing mcpc for the purposes of code zone compaction, + where mcpc is actually the value of instructionPointer at the time of a compaction." + + + | cogMethod prevMethod | + mcpc > limitAddress ifTrue: + [^nil]. + mcpc < baseAddress ifTrue: + [cogit assertMcpcIsPrimReturn: mcpc. + ^nil]. + self assert: mcpc < self limitZony. + cogMethod := coInterpreter cCoerceSimple: baseAddress to: #'CogMethod *'. + [cogMethod < mcpc] whileTrue: + [prevMethod := cogMethod. + cogMethod := self methodAfter: cogMethod]. + + "Since mcpc is actually instructionPointer we expect that it is either at the stack check + (normal code zone reclamation invoked through checkForEventsMayContextSwitch:) + or is in a primitive, immediately following the call of the C primitive routine." + self assert: (prevMethod notNil + and: [mcpc = prevMethod asUnsignedInteger + prevMethod stackCheckOffset + or: [(coInterpreter + primitiveIndexOfMethod: prevMethod methodObject + header: prevMethod methodHeader) > 0 + and: [cogit backEnd isCallPrecedingReturnPC: mcpc]]]). + ^prevMethod! Item was added: + ----- Method: Cogit>>assertMcpcIsPrimReturn: (in category 'debugging') ----- + assertMcpcIsPrimReturn: mcpc + + ^self assert: (mcpc = cePrimReturnEnterCogCode + or: [mcpc = cePrimReturnEnterCogCodeProfiling])! Item was added: + ----- Method: Cogit>>cogMethodContaining: (in category 'jit - api') ----- + cogMethodContaining: mcpc + + ^methodZone cogMethodContaining: mcpc! Item was changed: ----- Method: SimpleStackBasedCogit>>compileInterpreterPrimitive:flags: (in category 'primitive generators') ----- compileInterpreterPrimitive: primitiveRoutine flags: flags "Compile a call to an interpreter primitive. Call the C routine with the usual stack-switching dance, test the primFailCode and then either return on success or continue to the method body." | jmp jmpSamplePrim continuePostSamplePrim jmpSampleNonPrim continuePostSampleNonPrim | "Save processor fp, sp and return pc in the interpreter's frame stack and instruction pointers" self genExternalizePointersForPrimitiveCall. "Switch to the C stack." self genLoadCStackPointersForPrimCall. (flags anyMask: PrimCallCollectsProfileSamples) ifTrue: ["Test nextProfileTick for being non-zero and call checkProfileTick if so" objectMemory wordSize = 4 ifTrue: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self MoveAw: coInterpreter nextProfileTickAddress + objectMemory wordSize R: ClassReg. self OrR: TempReg R: ClassReg] ifFalse: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self CmpCq: 0 R: TempReg]. "If set, jump to record sample call." jmpSampleNonPrim := self JumpNonZero: 0. continuePostSampleNonPrim := self Label]. "Old full prim trace is in VMMaker-eem.550 and prior" self recordPrimTrace ifTrue: [self genFastPrimTraceUsing: ClassReg and: SendNumArgsReg]. "Clear the primFailCode and set argumentCount" self MoveCq: 0 R: TempReg. self MoveR: TempReg Aw: coInterpreter primFailCodeAddress. methodOrBlockNumArgs ~= 0 ifTrue: [self MoveCq: methodOrBlockNumArgs R: TempReg]. self MoveR: TempReg Aw: coInterpreter argumentCountAddress. "If required, set primitiveFunctionPointer and newMethod" (flags anyMask: PrimCallNeedsPrimitiveFunction) ifTrue: [self MoveCw: primitiveRoutine asInteger R: TempReg. primSetFunctionLabel := self MoveR: TempReg Aw: coInterpreter primitiveFunctionPointerAddress]. + (flags anyMask: PrimCallNeedsNewMethod+PrimCallMayEndureCodeCompaction) ifTrue: - (flags anyMask: PrimCallNeedsNewMethod+PrimCallMayCallBack) ifTrue: ["The ceActivateFailingPrimitiveMethod: machinery can't handle framelessness." + (flags anyMask: PrimCallMayEndureCodeCompaction) ifTrue: - (flags anyMask: PrimCallMayCallBack) ifTrue: [needsFrame := true]. methodLabel addDependent: (self annotateAbsolutePCRef: (self MoveCw: methodLabel asInteger R: ClassReg)). self MoveMw: (self offset: CogMethod of: #methodObject) r: ClassReg R: TempReg. self MoveR: TempReg Aw: coInterpreter newMethodAddress]. "Invoke the primitive" self PrefetchAw: coInterpreter primFailCodeAddress. + (flags anyMask: PrimCallMayEndureCodeCompaction) - (flags anyMask: PrimCallMayCallBack) ifTrue: "Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode." ["On Spur ceActivateFailingPrimitiveMethod: would like to retry if forwarders are found. So insist on PrimCallNeedsPrimitiveFunction being set too." self assert: (flags anyMask: PrimCallNeedsPrimitiveFunction). backEnd genMarshallNArgs: 0 arg: nil arg: nil arg: nil arg: nil; genSubstituteReturnAddress: ((flags anyMask: PrimCallCollectsProfileSamples) ifTrue: [cePrimReturnEnterCogCodeProfiling] ifFalse: [cePrimReturnEnterCogCode]). primInvokeInstruction := self JumpFullRT: primitiveRoutine asInteger. jmp := jmpSamplePrim := continuePostSamplePrim := nil] ifFalse: ["Call the C primitive routine." backEnd genMarshallNArgs: 0 arg: 0 arg: 0 arg: 0 arg: 0. primInvokeInstruction := self CallFullRT: primitiveRoutine asInteger. backEnd genRemoveNArgsFromStack: 0. (flags anyMask: PrimCallCollectsProfileSamples) ifTrue: [self assert: (flags anyMask: PrimCallNeedsNewMethod). "Test nextProfileTick for being non-zero and call checkProfileTick if so" objectMemory wordSize = 4 ifTrue: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self MoveAw: coInterpreter nextProfileTickAddress + objectMemory wordSize R: ClassReg. self OrR: TempReg R: ClassReg] ifFalse: [self MoveAw: coInterpreter nextProfileTickAddress R: TempReg. self CmpCq: 0 R: TempReg]. "If set, jump to record sample call." jmpSamplePrim := self JumpNonZero: 0. continuePostSamplePrim := self Label]. objectRepresentation maybeCompileRetryOnPrimitiveFail: primitiveIndex. "Switch back to the Smalltalk stack. Stack better be in either of these two states: success: stackPointer -> result (was receiver) arg1 ... argN return pc failure: receiver arg1 ... stackPointer -> argN return pc In either case we can push the instructionPointer or load it into the LinkRegister to reestablish the return pc" self MoveAw: coInterpreter instructionPointerAddress R: (backEnd hasLinkRegister ifTrue: [LinkReg] ifFalse: [ClassReg]). backEnd genLoadStackPointers. "Test primitive failure" self MoveAw: coInterpreter primFailCodeAddress R: TempReg. backEnd hasLinkRegister ifFalse: [self PushR: ClassReg]. "Restore return pc on CISCs" self flag: 'ask concrete code gen if move sets condition codes?'. self CmpCq: 0 R: TempReg. jmp := self JumpNonZero: 0. "Fetch result from stack" self MoveMw: (backEnd hasLinkRegister ifTrue: [0] ifFalse: [objectMemory wordSize]) r: SPReg R: ReceiverResultReg. self RetN: objectMemory wordSize]. "return to caller, popping receiver" (flags anyMask: PrimCallCollectsProfileSamples) ifTrue: ["The sample is collected by cePrimReturnEnterCogCode for external calls" jmpSamplePrim ifNotNil: ["Call ceCheckProfileTick: to record sample and then continue." jmpSamplePrim jmpTarget: self Label. self assert: (flags anyMask: PrimCallNeedsNewMethod). self CallFullRT: (self cCode: [#ceCheckProfileTick asUnsignedIntegerPtr] inSmalltalk: [self simulatedTrampolineFor: #ceCheckProfileTick]). "reenter the post-primitive call flow" self Jump: continuePostSamplePrim]. "Null newMethod and call ceCheckProfileTick: to record sample and then continue. ceCheckProfileTick will map null/0 to coInterpreter nilObject" jmpSampleNonPrim jmpTarget: self Label. self MoveCq: 0 R: TempReg. self MoveR: TempReg Aw: coInterpreter newMethodAddress. self CallFullRT: (self cCode: [#ceCheckProfileTick asUnsignedIntegerPtr] inSmalltalk: [self simulatedTrampolineFor: #ceCheckProfileTick]). "reenter the post-primitive call flow" self Jump: continuePostSampleNonPrim]. jmp ifNotNil: ["Jump to restore of receiver reg and proceed to frame build for failure." jmp jmpTarget: self Label. "Restore receiver reg from stack. If on RISCs ret pc is in LinkReg, if on CISCs ret pc is on stack." self MoveMw: objectMemory wordSize * (methodOrBlockNumArgs + (backEnd hasLinkRegister ifTrue: [0] ifFalse: [1])) r: SPReg R: ReceiverResultReg]. ^0! Item was changed: ----- Method: SimpleStackBasedCogit>>rewritePrimInvocationIn:to: (in category 'external primitive support') ----- rewritePrimInvocationIn: cogMethod to: primFunctionPointer | primIndex flags address extent | self cCode: [] inSmalltalk: [primFunctionPointer isInteger ifFalse: [^self rewritePrimInvocationIn: cogMethod to: (self simulatedTrampolineFor: primFunctionPointer)]]. self assert: cogMethod cmType = CMMethod. primIndex := coInterpreter primitiveIndexOfMethod: cogMethod methodObject header: cogMethod methodHeader. flags := coInterpreter primitivePropertyFlags: primIndex. (flags anyMask: PrimCallNeedsPrimitiveFunction) ifTrue: [backEnd storeLiteral: primFunctionPointer asUnsignedInteger beforeFollowingAddress: cogMethod asUnsignedInteger + (externalSetPrimOffsets at: cogMethod cmNumArgs)]. "See compileInterpreterPrimitive:" + (flags anyMask: PrimCallMayEndureCodeCompaction) - (flags anyMask: PrimCallMayCallBack) ifTrue: [address := cogMethod asUnsignedInteger + (externalPrimJumpOffsets at: cogMethod cmNumArgs). extent := backEnd rewriteJumpFullAt: address target: primFunctionPointer asUnsignedInteger] ifFalse: [address := cogMethod asUnsignedInteger + (externalPrimCallOffsets at: cogMethod cmNumArgs). extent := backEnd rewriteCallFullAt: address target: primFunctionPointer asUnsignedInteger]. extent > 0 ifTrue: [backEnd flushICacheFrom: cogMethod asUnsignedInteger + cmNoCheckEntryOffset to: address asUnsignedInteger + extent]! Item was removed: - ----- Method: StackInterpreter>>isCodeCompactingPrimitiveIndex: (in category 'primitive support') ----- - isCodeCompactingPrimitiveIndex: primIndex - "If instVarAt:, slotAt: or shallowCopy operate on a Context then they compute a - bytecode pc and hence may provoke a code compaction. If so, they *cannot* - return through the potentially moved method and so continue in the interpreter." - - self cCode: [] inSmalltalk: [#primitiveClone primitiveInstVarAt primitiveSlotAt]. "For senders..." - ^primIndex = PrimNumberInstVarAt - or: [primIndex = PrimNumberShallowCopy - or: [primIndex = PrimNumberSlotAt]]! From commits at source.squeak.org Fri Nov 20 20:19:07 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Fri, 20 Nov 2020 20:19:07 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2893.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2893.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2893 Author: eem Time: 20 November 2020, 12:18:59.36201 pm UUID: 80846f05-27f9-4e14-a97e-11dcde420a0b Ancestors: VMMaker.oscog-eem.2892 Make sure that primitiveRelinquishProcessor has PrimCallMayEndureCodeCompaction set. Simulation: Change simulation away from MultiProcessor to switching register contents in CogThreadManager>>#tryLockVMOwnerTo:, which invokes Cogit>>#tryLockVMOwnerTo:, hence change senders of tryLockVMOwnerTo:. Retain Multiprocessor via an option only. Fix termination of processes on shutdown. Put a breakpoint in CogVMSimulator>>#ownVM: for now. Eliminate unused stuff from CogVMThread. =============== Diff against VMMaker.oscog-eem.2892 =============== Item was changed: CoInterpreterPrimitives subclass: #CoInterpreterMT instanceVariableNames: 'cogThreadManager checkThreadActivation maxWaitingPriority foreignCallbackPriority deferThreadSwitch disowningVMThread disownCount foreignCallbackProcessSlot willNotThreadWarnCount activeProcessAffined relinquishing processHasThreadId noThreadingOfGUIThread reenterThreadSchedulingLoop' + classVariableNames: 'DisownFlagsShift DisownVMForProcessorRelinquish LockGUIThreadFlag LockGUIThreadShift OwnVMForeignThreadFlag PrimNumberRelinquishProcessor ProcessUnaffinedOnDisown ReturnToThreadSchedulingLoop VMAlreadyOwnedHenceDoNotDisown' - classVariableNames: 'DisownFlagsShift DisownVMForProcessorRelinquish LockGUIThreadFlag LockGUIThreadShift OwnVMForeignThreadFlag ProcessUnaffinedOnDisown ReturnToThreadSchedulingLoop VMAlreadyOwnedHenceDoNotDisown' poolDictionaries: 'VMThreadingConstants' category: 'VMMaker-Multithreading'! Item was changed: ----- Method: CoInterpreterMT class>>initializePrimitiveTable (in category 'initialization') ----- initializePrimitiveTable super initializePrimitiveTable. + PrimNumberRelinquishProcessor := 230. COGMTVM ifTrue: [(227 to: 229) do: [:pidx| self assert: (PrimitiveTable at: pidx + 1) = #primitiveFail]. PrimitiveTable at: 227 + 1 put: #primitiveVMCurrentThreadId; at: 228 + 1 put: #primitiveProcessBoundThreadId; at: 229 + 1 put: #primitiveProcessBindToThreadId]! Item was added: + ----- Method: CoInterpreterMT>>assertValidNewMethodPropertyFlags (in category 'simulation') ----- + assertValidNewMethodPropertyFlags + "simulation only" + self assert: (objectMemory addressCouldBeObj: newMethod). + self assert: (objectMemory isCompiledMethod: newMethod). + self assert: (self primitiveIndexOf: newMethod) > 0. + self assert: ((self primitivePropertyFlags: (self primitiveIndexOf: newMethod)) anyMask: PrimCallMayEndureCodeCompaction)! Item was changed: ----- Method: CoInterpreterMT>>disownVM: (in category 'vm scheduling') ----- disownVM: flags "Release the VM to other threads and answer the current thread's index. Currently valid flags: DisownVMForFFICall - informs the VM that it is entering an FFI call DisownVMForThreading - informs the VM that it is entering code during which threading should be permitted OwnVMForeignThreadFlag - indicates lowest-level entry from a foreign thread - not to be used explicitly by clients - only set by ownVMFromUnidentifiedThread VMAlreadyOwnedHenceDoNotDisown - indicates an ownVM from a callback was made when the vm was still owned. - not to be used explicitly by clients - only set by ownVMFromUnidentifiedThread This is the entry-point for plugins and primitives that wish to release the VM while performing some operation that may potentially block, and for callbacks returning back to some blocking operation. If this thread does not reclaim the VM before- hand then when the next heartbeat occurs the thread manager will schedule a thread to acquire the VM which may start running the VM in place of this thread. N.B. Most of the state needed to resume after preemption is set in preemptDisowningThread." | vmThread result | self assert: self successful. cogit recordEventTrace ifTrue: [self recordTrace: TraceDisownVM thing: (objectMemory integerObjectOf: flags) source: 0]. processHasThreadId ifFalse: [willNotThreadWarnCount < 10 ifTrue: [self print: 'warning: VM parameter 48 indicates Process doesn''t have threadId; VM will not thread'; cr. willNotThreadWarnCount := willNotThreadWarnCount + 1]]. vmThread := cogThreadManager currentVMThread. (flags anyMask: VMAlreadyOwnedHenceDoNotDisown) ifTrue: [disowningVMThread := vmThread. vmThread state: CTMUnavailable. ^0]. self assertCStackPointersBelongToCurrentThread. + self assertValidNewMethodPropertyFlags. (flags anyMask: DisownVMForProcessorRelinquish) ifTrue: [| proc | (proc := objectMemory splObj: foreignCallbackProcessSlot) ~= objectMemory nilObject ifTrue: [foreignCallbackPriority := self quickFetchInteger: PriorityIndex ofObject: proc]. relinquishing := true. self sqLowLevelMFence]. (noThreadingOfGUIThread and: [self inGUIThread]) ifTrue: [^vmThread index + LockGUIThreadFlag + (activeProcessAffined ifTrue: [0] ifFalse: [ProcessUnaffinedOnDisown]) + (flags << DisownFlagsShift)]. disownCount := disownCount + 1. disowningVMThread := vmThread. "self cr; cr; print: 'disownVM Csp: '; printHex: vmThread cStackPointer; cr. (0 to: 16 by: 4) do: [:offset| self print: ' *(esp+'; printNum: offset; print: ': '; printHex: (stackPages longAt: cogit processor sp + offset); cr]. cogit processor printIntegerRegistersOn: Transcript." "OwnVMForeignThreadFlag indicates lowest-level of entry by a foreign thread. If that's where we are then release the vmThread. Otherwise indicate the vmThread is off doing something outside of the VM." (flags anyMask: OwnVMForeignThreadFlag) ifTrue: ["I don't think this is quite right. Josh's use case is creating some foreign thread and then registering it with the VM. That's not the same as binding a process to a foreign thread given that the foreign callback process is about to terminate anyway (it is returning from a callback here). So do we need an additional concept, that of a vmThread being either of the set known to the VM or floating?" self flag: 'issue with registering foreign threads with the VM'. (self isBoundProcess: self activeProcess) ifFalse: [cogThreadManager unregisterVMThread: vmThread]] ifFalse: [vmThread state: CTMUnavailable]. result := vmThread index + (activeProcessAffined ifTrue: [0] ifFalse: [ProcessUnaffinedOnDisown]) + (flags << DisownFlagsShift). cogThreadManager releaseVM. ^result! Item was changed: ----- Method: CoInterpreterMT>>ownVMFromUnidentifiedThread (in category 'vm scheduling') ----- ownVMFromUnidentifiedThread "Attempt to take ownership from a thread that as yet doesn't know its index. This supports callbacks where the callback could originate from any thread. Answer 0 if the owning thread is known to the VM. Answer 1 if the owning thread is unknown to the VM and now owns the VM. Answer -1 if the owning thread is unknown to the VM and fails to own the VM. Answer -2 if the owning thread is unknown to the VM and there is no foreign callback process installed." | count threadIndex vmThread | (threadIndex := cogThreadManager ioGetThreadLocalThreadIndex) ~= 0 ifTrue: [ "this is a callback from a known thread" (cogThreadManager vmOwnerIs: threadIndex) ifTrue: "the VM has not been disowned" [self assert: (disowningVMThread isNil or: [disowningVMThread = self currentVMThread]). disowningVMThread := nil. self currentVMThread state: CTMAssignableOrInVM. ^VMAlreadyOwnedHenceDoNotDisown]. ^self ownVM: threadIndex]. foreignCallbackPriority = 0 ifTrue: [^-2]. count := 0. "If the current thread doesn't have an index it's new to the vm and we need to allocate a new threadInfo, failing if we can't. We also need a process in the foreignCallbackProcessSlot upon which to run the thread's eventual callback." + [[cogThreadManager tryLockVMOwnerTo: cogThreadManager ioCurrentOSThread asUnsignedInteger] whileFalse: - [[cogit tryLockVMOwnerTo: cogThreadManager ioCurrentOSThread asUnsignedInteger] whileFalse: [self waitingPriorityIsAtLeast: foreignCallbackPriority. cogThreadManager ioTransferTimeslice]. (objectMemory splObj: foreignCallbackProcessSlot) ~= objectMemory nilObject] whileFalse: [cogThreadManager releaseVM. (count := count + 1) > 1000 ifTrue: [^-2]. cogThreadManager ioMilliSleep: 1]. vmThread := cogThreadManager unusedThreadInfo. "N.B. Keep the VM locked anonymously so that we reserve the non-nil ForeignCallbackProcess for this thread, avoiding the race between competing foreign callbacks. The acquireVMFor: in ownVM: will set the vmOwner to the actual index. So only unlock on failure." vmThread ifNil: [cogThreadManager releaseVM. ^-1]. cogThreadManager setVMOwner: vmThread index. vmThread state: CTMWantingOwnership; priority: foreignCallbackPriority. cogThreadManager registerVMThread: vmThread. ^self ownVM: vmThread index + OwnVMForeignThreadFlag! Item was added: + ----- Method: CoInterpreterMT>>primitivePropertyFlagsForSpur: (in category 'cog jit support') ----- + primitivePropertyFlagsForSpur: primIndex + + "Answer any special requirements of the given primitive. Spur always needs to set + primitiveFunctionPointer and newMethod so primitives can retry on failure due to forwarders." + self cCode: [] inSmalltalk: [#(primitiveRelinquishProcessor)]. "For senders..." + primIndex = PrimNumberRelinquishProcessor ifTrue: + [^profileSemaphore ~= objectMemory nilObject + ifTrue: [PrimCallNeedsPrimitiveFunction + PrimCallNeedsNewMethod + PrimCallMayEndureCodeCompaction + PrimCallCollectsProfileSamples] + ifFalse: [PrimCallNeedsPrimitiveFunction + PrimCallNeedsNewMethod + PrimCallMayEndureCodeCompaction]]. + ^super primitivePropertyFlagsForSpur: primIndex! Item was changed: ----- Method: CoInterpreterMT>>threadSchedulingLoopImplementation: (in category 'vm scheduling') ----- threadSchedulingLoopImplementation: vmThread "Enter a loop attempting to run the VM with the highest priority process and blocking on the thread's OS semaphore when unable to run that process. We will return to this via threadSwitchIfNecessary:from: which is called in the middle of transferTo:from: once the active process has been stored in the scheduler." - | attemptToRun | self _setjmp: reenterThreadSchedulingLoop. [self assert: vmThread state = CTMAssignableOrInVM. + (cogThreadManager tryLockVMOwnerTo: vmThread index) ifTrue: + ["If relinquishing is true, then primitiveRelinquishProcessor has disowned the + VM and only a returning call or callback should take ownership in that case." + relinquishing + ifTrue: [cogThreadManager releaseVM] + ifFalse: [self tryToExecuteSmalltalk: vmThread]]. - attemptToRun := false. - (cogThreadManager vmOwnerIs: vmThread index) - ifTrue: [attemptToRun := true] - ifFalse: - [(cogit tryLockVMOwnerTo: vmThread index) ifTrue: - ["If relinquishing is true, then primitiveRelinquishProcessor has disowned the - VM and only a returning call or callback should take ownership in that case." - relinquishing - ifTrue: [cogThreadManager releaseVM] - ifFalse: [attemptToRun := true]]]. - attemptToRun ifTrue: - [self tryToExecuteSmalltalk: vmThread]. (cogThreadManager vmOwnerIs: vmThread index) ifFalse: [cogThreadManager waitForWork: vmThread]. true] whileTrue! Item was changed: ----- Method: CoInterpreterMT>>tryToExecuteSmalltalk: (in category 'vm scheduling') ----- tryToExecuteSmalltalk: vmThread "Attempt to run the current process, if it exists, on the given vmThread." | dvmt activeProc ownerIndex | self assert: (cogThreadManager vmOwnerIs: vmThread index). self assert: cogThreadManager ioGetThreadLocalThreadIndex = vmThread index. dvmt := disowningVMThread. disowningVMThread ifNil: [activeProc := self activeProcess] ifNotNil: [self preemptDisowningThread. activeProc := self wakeHighestPriority. activeProc ifNil: [activeProc := objectMemory nilObject] ifNotNil: [objectMemory storePointerUnchecked: MyListIndex ofObject: activeProc withValue: objectMemory nilObject]. objectMemory storePointer: ActiveProcessIndex ofObject: self schedulerPointer withValue: activeProc]. activeProc = objectMemory nilObject ifTrue: [cogThreadManager releaseVM. ^nil]. ownerIndex := self ownerIndexOfProcess: activeProc. (ownerIndex = 0 or: [cogThreadManager vmOwnerIs: ownerIndex]) ifTrue: [self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. (objectMemory fetchPointer: SuspendedContextIndex ofObject: activeProc) ~= objectMemory nilObject ifTrue: [self externalSetStackPageAndPointersForSuspendedContextOfProcess: activeProc]. + instructionPointer = cogit ceReturnToInterpreterPC ifTrue: + [self deny: (self isMachineCodeFrame: framePointer). + instructionPointer := self iframeSavedIP: framePointer]. self enterSmalltalkExecutive. "When we return here we should have already given up the VM and so we cannot touch any interpreter state." "NOTREACHED"]. cogThreadManager wakeVMThreadFor: ownerIndex! Item was changed: CogClass subclass: #CogThreadManager (excessive size, no diff calculated) Item was changed: ----- Method: CogThreadManager class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: cCodeGen cCodeGen removeVariable: 'coInterpreter'; removeVariable: 'cogit'; removeVariable: 'threadLocalStorage'; + removeVariable: 'processorOwner'; + removeVariable: 'registerStates'. - removeVariable: 'processorOwner'. cCodeGen var: #threads type: #'CogVMThread **'; var: #vmOSThread type: #sqOSThread! Item was changed: ----- Method: CogThreadManager>>acquireVMFor: (in category 'public api') ----- acquireVMFor: threadIndex "Attempt to acquire the VM, eventually blocking until it becomes available. Spin until the maxWaitingPriority has been updated if it is lower than this thread's priority." | vmThread | self assert: threadIndex = self ioGetThreadLocalThreadIndex. vmThread := self vmThreadAt: threadIndex. self assert: (vmThread state = CTMUnavailable or: [vmThread state = CTMWantingOwnership]). + (self tryLockVMOwnerTo: threadIndex) ifFalse: - (cogit tryLockVMOwnerTo: threadIndex) ifFalse: [vmThread state: CTMWantingOwnership. [(self vmOwnerIs: threadIndex) + or: [self tryLockVMOwnerTo: threadIndex]] whileFalse: + [vmThread priority ifNotNil: - or: [cogit tryLockVMOwnerTo: threadIndex]] whileFalse: - [[coInterpreter getMaxWaitingPriority < vmThread priority] whileTrue: [coInterpreter waitingPriorityIsAtLeast: vmThread priority]. (self vmOwnerIs: threadIndex) ifFalse: [self ioWaitOnOSSemaphore: (self addressOf: vmThread osSemaphore)]]]. vmOSThread := vmThread osThread. vmThread state: CTMAssignableOrInVM. ^vmThread! Item was changed: ----- Method: CogThreadManager>>ensureRunningVMThread: (in category 'public api') ----- ensureRunningVMThread: vmIsRelinquishing "Called from checkVMOwnershipFromHeartbeat if the VM is unowned. Hence we are in the heartbeat thread. The race is against that thread owning the VM and against foreign callbacks." self willingVMThread ifNotNil: [:vmThread| "If the VM is relinquishing the processor then only schedule a thread if it has work to do." (vmIsRelinquishing and: [vmThread state ~= CTMWantingOwnership]) ifTrue: [^self]. + (self tryLockVMOwnerTo: vmThread index) ifFalse: "someone beat us to it..." - (cogit tryLockVMOwnerTo: vmThread index) ifFalse: "someone beat us to it..." [^self]. vmOSThread := vmThread osThread. "release the thread from its blocking loop" self ioSignalOSSemaphore: (self addressOf: vmThread osSemaphore). self ioTransferTimeslice. "self cCode: [coInterpreter print: 'ERVT signalled '; printNum: vmThread index; cr]." ^self]. "If the VM is relinquishing the processor then only schedule a thread if it has work to do (willingVMThread not nil above). If we have failed to allocate thread storage before there is no point continuing to try to do so. By this time we should have quite a few threads in the pool." (vmIsRelinquishing or: [memoryIsScarce]) ifTrue: [^self]. self unusedThreadInfo ifNotNil: [:vmThread| + (self tryLockVMOwnerTo: vmThread index) ifTrue: - (cogit tryLockVMOwnerTo: vmThread index) ifTrue: [(self startThreadForThreadInfo: vmThread) ifFalse: [self releaseVM]]]! Item was changed: ----- Method: CogThreadManager>>initialize (in category 'initialize-release') ----- initialize - vmOwner := numThreads := numThreadsIncrement := 0. memoryIsScarce := false. + "N.B. Do not initialize threadLocalStorage; leave this to ioInitThreadLocalThreadIndices". + registerStates := IdentityDictionary new! - "N.B. Do not initialize threadLocalStorage; leave this to ioInitThreadLocalThreadIndices"! Item was changed: ----- Method: CogThreadManager>>shutdownModule (in category 'simulation') ----- shutdownModule + | guiProcess activeProcess | - | guiProcess | threads ifNil: [^self]. + (guiProcess := self guiProcess) ~= (activeProcess := Processor activeProcess) ifTrue: - (guiProcess := self guiProcess) ~= Processor activeProcess ifTrue: [guiProcess signalException: (Notification new tag: #evaluateQuit; yourself). + Project current spawnNewProcessIfThisIsUI: activeProcess. + activeProcess terminate]. - Processor terminateActive]. threads do: [:ea| ea osThread ifNotNil: [:aProcess| + (aProcess ~~ activeProcess and: [aProcess ~~ guiProcess]) ifTrue: + [aProcess terminate]]]. + threads := nil! - (aProcess ~~ Processor activeProcess and: [aProcess ~~ guiProcess]) ifTrue: - [aProcess terminate]]]! Item was added: + ----- Method: CogThreadManager>>tryLockVMOwnerTo: (in category 'simulation') ----- + tryLockVMOwnerTo: value + "In the real VM this is a direct call of Cogit>>#tryLockVMOwnerTo:/ceTryLockVMOwner. + In the simulation this is where we save and switch register state." + + | current post prior processor | + processor := cogit processor. + prior := processor registerState. + vmOwner ~= 0 ifTrue: + [registerStates at: vmOwner put: prior]. + (cogit tryLockVMOwnerTo: value) ifFalse: + [^false]. + post := processor registerState. + current := registerStates + at: vmOwner + ifAbsentPut: + [self assert: vmOwner = value. + processor voidRegisterState; registerState]. + 1 to: prior size do: + [:i| | neuf | + (prior at: i) ~= (neuf := post at: i) ifTrue: + [current at: i put: neuf]]. + cogit processor setRegisterState: current. + ^true! Item was changed: + ----- Method: CogVMSimulator>>ownVM: (in category 'debugging traps') ----- - ----- Method: CogVMSimulator>>ownVM: (in category 'multi-threading simulation switch') ----- ownVM: threadIndexAndFlags "This method includes or excludes CoInterpreterMT methods as required. Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" + (threadIndexAndFlags anyMask: DisownVMForProcessorRelinquish << DisownFlagsShift) ifFalse: + [self break]. - ^self perform: #ownVM: withArguments: {threadIndexAndFlags} inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was added: + ----- Method: CogVMSimulator>>primitivePropertyFlagsForSpur: (in category 'multi-threading simulation switch') ----- + primitivePropertyFlagsForSpur: primIndex + "This method includes or excludes CoInterpreterMT methods as required. + Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" + + ^self perform: #primitivePropertyFlagsForSpur: + withArguments: {primIndex} + inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was changed: ----- Method: CogVMSimulator>>windowIsClosing (in category 'primitive support') ----- windowIsClosing self threadManager ifNotNil: + [:threadManager| threadManager shutdownModule]. - [:threadManager| - threadManager guiProcess ifNotNil: - [:guiProcess| - (guiProcess ~= Processor activeProcess - and: [guiProcess isInteger not]) ifTrue: - [guiProcess - signalException: - (Notification new tag: #evaluateQuit; yourself). - Processor terminateActive]]]. quitBlock ifNotNil: [:effectiveQuitBlock| quitBlock := nil. "stop recursion on explicit window close." [effectiveQuitBlock value] on: BlockCannotReturn do: [:ex|]] "Cause return from #test, et al"! Item was changed: VMStructType subclass: #CogVMThread + instanceVariableNames: 'index state priority osSemaphore osThread newMethodOrNull argumentCount primitiveFunctionPointer inMachineCode cStackPointer cFramePointer awolProcIndex awolProcLength awolProcesses' - instanceVariableNames: 'index state priority osSemaphore osThread newMethodOrNull argumentCount primitiveFunctionPointer inMachineCode cStackPointer cFramePointer reenterInterpreter awolProcIndex awolProcLength awolProcesses' classVariableNames: '' poolDictionaries: 'VMThreadingConstants' category: 'VMMaker-Multithreading'! !CogVMThread commentStamp: '' prior: 0! Instances of this class represent control blocks for native threads that cooperatively schedule the VM. See the class comment of CogThreadManager for full documentation. N.B. awolProcesses must be the last inst var.! Item was removed: - ----- Method: CogVMThread>>awolProcesses: (in category 'accessing') ----- - awolProcesses: anObject - "Set the value of awolProcesses" - - ^awolProcesses := anObject! Item was changed: ----- Method: CogVMThread>>initialize (in category 'initialize-release') ----- initialize - awolProcLength := CogThreadManager awolProcessesIncrement. awolProcesses := CArrayAccessor on: (Array new: awolProcLength). awolProcIndex := 0! Item was removed: - ----- Method: CogVMThread>>reenterInterpreter (in category 'accessing') ----- - reenterInterpreter - "Answer the value of reenterInterpreter" - - ^ reenterInterpreter! Item was removed: - ----- Method: CogVMThread>>reenterInterpreter: (in category 'accessing') ----- - reenterInterpreter: anObject - "Set the value of reenterInterpreter" - - ^reenterInterpreter := anObject! Item was changed: ----- Method: Cogit>>initializeProcessor (in category 'initialization') ----- initializeProcessor "Initialize the simulation processor, arranging that its initial stack is somewhere on the rump C stack." guardPageSize := self class guardPageSize. lastNInstructions := OrderedCollection new. processor initializeStackFor: self. self initializeProcessorStack: coInterpreter rumpCStackAddress. coInterpreter setCFramePointer: processor fp setCStackPointer: processor sp. + (InitializationOptions at: #UseMultiProcessor ifAbsent: [false]) ifTrue: - threadManager ifNotNil: [processor := MultiProcessor for: processor coInterpreter: coInterpreter]! From noreply at github.com Fri Nov 20 20:47:20 2020 From: noreply at github.com (Eliot Miranda) Date: Fri, 20 Nov 2020 12:47:20 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] bd18c0: CogVM source as per VMMaker.oscog-eem.2893 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: bd18c0e866193292af8573a93a5529a1bb6ce043 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/bd18c0e866193292af8573a93a5529a1bb6ce043 Author: Eliot Miranda Date: 2020-11-20 (Fri, 20 Nov 2020) Changed paths: M nsspur64src/vm/cogit.h M nsspur64src/vm/cogitARMv8.c 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 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 nsspurstack64src/vm/gcc3x-interp.c M nsspurstack64src/vm/interp.c M nsspurstacksrc/vm/gcc3x-interp.c M nsspurstacksrc/vm/interp.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c 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 spurlowcode64src/vm/cogit.h M spurlowcode64src/vm/cogitARMv8.c 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 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 spurlowcodestack64src/vm/gcc3x-interp.c M spurlowcodestack64src/vm/interp.c M spurlowcodestacksrc/vm/gcc3x-interp.c M spurlowcodestacksrc/vm/interp.c M spursista64src/vm/cogit.h M spursista64src/vm/cogitARMv8.c 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 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 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 spurstack64src/vm/gcc3x-interp.c M spurstack64src/vm/interp.c M spurstack64src/vm/validImage.c M spurstacksrc/vm/gcc3x-interp.c M spurstacksrc/vm/interp.c M spurstacksrc/vm/validImage.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/gcc3x-cointerp.c M stacksrc/vm/gcc3x-interp.c M stacksrc/vm/interp.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2893 Implement a better fix for the VMMaker.oscog-eem.2824/ http://forum.world.st/corruption-of-PC-in-context-objects-or-not-tt5121662.html case. Instead of changing to the interpreter, mark the cog method containing instructionPointer and relocate instructionPointer in markActiveMethodsAndReferents/updateStackZoneReferencesToCompiledCodePreCompaction. Rename PrimCallMayCallBack to PrimCallMayEndureCodeCompaction. Make sure that primitiveRelinquishProcessor has PrimCallMayEndureCodeCompaction set. From eliot.miranda at gmail.com Fri Nov 20 21:15:31 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Fri, 20 Nov 2020 13:15:31 -0800 Subject: [Vm-dev] VM_VERSION triplet In-Reply-To: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> References: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> Message-ID: Hi David, On Fri, Nov 20, 2020 at 7:00 AM stes at PANDORA.BE wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > An interesting side-effect of David Lewis's update of the subversion repo, > was that I observed that the new VM is called : > > 4.19.2-3790 and 4.19.2-3790_64bit > > The subversion source code seems to be generated from the VMMaker 4.19.2, > and this automatically sets VM_VERSION to 4.19.2 : > > The code in the configure script that is doing this: > > vmmversion="`tr '\015 ' '\012\012' < \"${interp_h}\" | sed > '1,/VMMaker/d;q'`" > > VM_VERSION="${vmmversion}-${svnversion}${RELEASE_TAG}" > > So it automatically creates a 3 digit version with the subversion 3790 > suffix, > based on the SVN version and the VMMaker version. > > The subversion version number is 3790 so far is clear, but the VM version > seems to be set by the above code now to "4.19.2". > > For the Solaris IPS COMPONENT_VERSION I had a number 4.16.7 > and I updated it to the new COMPONENT_VERSION= 4.19.2 . > > For the squeak-5 Git OpenSmalltalk VM I would also like to use a 3 digit > version number that makes some sense. > > Currently I create 3 digit numbers myself (without any relationship to > squeak). > > However I was thinking that maybe I can use: > > 5.0.x where x is the VMMaker version number. > > It appears that nowadays the VMmaker is called VMMaker.oscog-eem.2887 > > So I could use the number 2887 in 5.0.2887 where 2887 is the VMMaker > number. > > This relates to my question a few months ago as to the #define > > platforms/Cross/vm/sqVirtualMachine.h:# define VM_VERSION "5.0" > > which in my understanding sets the VM_VERSION of all VM's to "5.0". > > An issue could be that the "stack" VM and the "cog" VM actually seem to > use, > different VMmaker numbers. > > For example currently for the "stack" VM the VMmaker number is 2885. > > For the "cog" VM the VMmaker number is 2891. > That's right. The sources are generated from a particular version of VMMaker and not all sources change. So if I make a change that only affects the Cog VM's interpreter the StackInterperteer VMs will not get generated. The situation is more varied in src/plugins. Look at the range of version numbers in there and you'll see a broad spread. We don't want to regenerate code every time if it doesn't change. > > So they are slightly different. > > I guess that what I wonder is whether it makes sense to use version > numbers, > > 5.0.x > 5.0.2885 > 5.0.2891 > > where x= VMmaker release number following Eliot Miranda's VMmaker release. > Well, that would be nice. But the effort of incrementing the version number is very hard. I prefer to leave it as vm -version providing the full verison info, the VMMaker versions for interpreter and cogit (and for all plugins), and the git commit for opensmalltalk-vm. The basic version number could be incremented if the build system did it automatically but I would forget all the time. > Is there an established triplet 3digit release number for OpenSmalltalk ?? > No. > > Regards, > David Stes > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBCAAGBQJft9m+AAoJEAwpOKXMq1MaNnEIALdzkb00VEQ/XHn+F/8G37tE > EteNRCQtIawigsUn+aSh+OLX0NbTOyyzCbHh2ihqWFMyIvdisT9SP9FlRUzXryBR > gW14p3xgHoLot2sGChXDro6ZLYsaRVDsnJVuzFTBuyClwlK4HwJXvJdOsEP3TMo4 > Nr8w0ldX4hDpoNvil0d/K/uxJ8Cg1XENQ4ECv0DEUv3qMgJeOynDyqRbOWRqym9e > Gc+Bya71kKYrWLHI7/ekxO0I99p6YGYXMb+sjxM+xCY9IIxm0Lcq5IjLNEPwvvpX > nHp1U4n9BUYc40P+Cja9m2+olI0uTix/+FzmGM3G/biqbIIf3u+B5qg97gr3z5g= > =eFQV > -----END PGP SIGNATURE----- > -- _,,,^..^,,,_ best, Eliot -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Fri Nov 20 22:37:45 2020 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 20 Nov 2020 22:37:45 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2315 Message-ID: <20201120223745.1.9BFF643B6C2303B1@appveyor.com> An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Fri Nov 20 23:10:43 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Fri, 20 Nov 2020 15:10:43 -0800 Subject: [Vm-dev] Another NuScratch issue Message-ID: So I built a new VM with a fix for the input method change. I did not fully test the other things but Scratch on the VM does not do animations. It updates screen only when mouse is moved, or some slower interval: https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 I suspect that there might have been some options I needed to pass in to specify some timers? Can you think of other reasons why this might happen and where to look to fix it? -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Sat Nov 21 00:50:01 2020 From: tim at rowledge.org (tim Rowledge) Date: Fri, 20 Nov 2020 16:50:01 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: Message-ID: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> > On 2020-11-20, at 3:10 PM, Yoshiki Ohshima wrote: > > So I built a new VM with a fix for the input method change. I did not fully test the other things but Scratch on the VM does not do animations. It updates screen only when mouse is moved, or some slower interval: > > https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 That's really weird. I see two systems running at the same time there - same image? Different VM? > > I suspect that there might have been some options I needed to pass in to specify some timers? Can you think of other reasons why this might happen and where to look to fix it? I never had any timer related options to worry about, so it shouldn't be anything to do with that. What happens if you use the 'new' VM but don't use the compositor/input thing? IIRC I had terrible problems caused by that ibus program and we had to make sure it didn't get into the Raspbian release. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Useful random insult:- Several nuts over fruitcake minimum. From Yoshiki.Ohshima at acm.org Sat Nov 21 01:11:01 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Fri, 20 Nov 2020 17:11:01 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> References: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> Message-ID: On Fri, Nov 20, 2020 at 4:50 PM tim Rowledge wrote: > > > > > On 2020-11-20, at 3:10 PM, Yoshiki Ohshima > wrote: > > > > So I built a new VM with a fix for the input method change. I did not > fully test the other things but Scratch on the VM does not do animations. > It updates screen only when mouse is moved, or some slower interval: > > > > https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 > > That's really weird. I see two systems running at the same time there - > same image? Different VM? > Yeah, those are running the same image on different VMs. > > > > > I suspect that there might have been some options I needed to pass in to > specify some timers? Can you think of other reasons why this might happen > and where to look to fix it? > > I never had any timer related options to worry about, so it shouldn't be > anything to do with that. > > What happens if you use the 'new' VM but don't use the compositor/input > thing? IIRC I had terrible problems caused by that ibus program and we had > to make sure it didn't get into the Raspbian release. > I'll check it out. I wasn't expecting this kind of problem and did not fully test things out. -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From builds at travis-ci.org Sat Nov 21 02:19:27 2020 From: builds at travis-ci.org (Travis CI) Date: Sat, 21 Nov 2020 02:19:27 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2311 (Cog - bd18c0e) In-Reply-To: Message-ID: <5fb8792eeb58a_13fa75e3d40b0927c1@travis-tasks-7597568d7b-fz924.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2311 Status: Still Failing Duration: 5 hrs, 30 mins, and 58 secs Commit: bd18c0e (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2893 Implement a better fix for the VMMaker.oscog-eem.2824/ http://forum.world.st/corruption-of-PC-in-context-objects-or-not-tt5121662.html case. Instead of changing to the interpreter, mark the cog method containing instructionPointer and relocate instructionPointer in markActiveMethodsAndReferents/updateStackZoneReferencesToCompiledCodePreCompaction. Rename PrimCallMayCallBack to PrimCallMayEndureCodeCompaction. Make sure that primitiveRelinquishProcessor has PrimCallMayEndureCodeCompaction set. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/df0256b37d26...bd18c0e86619 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/744971185?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewis at mail.msen.com Sat Nov 21 03:11:02 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Fri, 20 Nov 2020 22:11:02 -0500 Subject: [Vm-dev] VM_VERSION triplet In-Reply-To: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> References: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> Message-ID: <20201121031102.GA45856@shell.msen.com> Hi David, Eliot replied with respect to the oscog VMs, so let me just add a note regarding the older "interpreter VM" virtual machines. On Fri, Nov 20, 2020 at 04:00:26PM +0100, stes at PANDORA.BE wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > An interesting side-effect of David Lewis's update of the subversion repo, > was that I observed that the new VM is called : > > 4.19.2-3790 and 4.19.2-3790_64bit The "64bit" here refers to the 64-bit image format, and is unrelated to the 32/64 bit-ness of the VM executable. The 64-bit image was never in wide circulation, but the VM for running that image format is available and is installed with "_64bit" suffix to distinguish it from the executable VM (32 or 64 bit) for the standard 32-bit V3 images. > > The subversion source code seems to be generated from the VMMaker 4.19.2, > and this automatically sets VM_VERSION to 4.19.2 : > > The code in the configure script that is doing this: > > vmmversion="`tr '\015 ' '\012\012' < \"${interp_h}\" | sed '1,/VMMaker/d;q'`" > > VM_VERSION="${vmmversion}-${svnversion}${RELEASE_TAG}" > > So it automatically creates a 3 digit version with the subversion 3790 suffix, > based on the SVN version and the VMMaker version. > > The subversion version number is 3790 so far is clear, but the VM version > seems to be set by the above code now to "4.19.2". > This is just a naming convention to identify the VM executable. It is not intended to be exact, but it shows you the version level of the Smalltalk VM sources (VMMaker versionString ==> '4.19.2') and it shows you the revision level of the platforms sources (svn info | grep Revision). In practice this works well as an identifier for the VM, but it is important to recognize that it has nothing to do with the version of the Squeak image. One version of a VM is expected to be able to run many versions of the image, and one image should be able to run on many different VMs. As an example, suppose that you have a 4.19.2-3790 VM installed on your computer, and suppose that you are running an application based on the Squeak1.23.image (which was released back in October 1997). If you wanted to provide a version identifier for your application, you might want to base it on the 1.23 image version number, but you would not want to base it on the version number of a VM that was built over 20 years later. Dave From stes at telenet.be Sat Nov 21 10:18:46 2020 From: stes at telenet.be (stes@PANDORA.BE) Date: Sat, 21 Nov 2020 11:18:46 +0100 (CET) Subject: [Vm-dev] VM_VERSION triplet In-Reply-To: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> References: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> Message-ID: <1861614439.12165455.1605953926201.JavaMail.zimbra@telenet.be> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I understand that the VM version has no relation to the Squeak image (the version of the Smalltalk image file). However there is a relation between the VM version and the VMmaker used to generate the files in the OpenSmalltalk repository. If I understand correctly it is in fact good style to use VMmaker yourself, to create one's own set of sources. For the moment I just checkout the Git sources but those are created by VMmaker (the output of VMmaker) so it makes sense to use VMmaker instead yourself. Anyway sorry for the noise on this list ... Regards, David Stes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJfuOlaAAoJEAwpOKXMq1MagXkIAJECTigop3kerEXpZznvPbQX H3QrlUn+RChcWBOegShfO1qVAD273UMGhvgI6y2bJb36kOWx+KTsGdhE8JF1yHjM lL5+k24xDekEjl/HGtyhhA5YagqdLJo4H+BD/GfFe/IQqur698+duS2ACtRuCQpa U/H59nJbYO9kWNxZg4lq1jXUEyv26DPczk+gYufDFGFpL3cNudRpdqngnUiCQBnj b04JL0TuJUcfaB7L+MBp66tSOd3HsAxHHrvkqEdWqM22OkwqqHIRW12xqFlGnYr5 P5Jzo/NHrXjutrMnVm5+1gxO1LipdY98I7Q5UtKz/oPsomkS67aF7J8ETXUYb+c= =LM/2 -----END PGP SIGNATURE----- From lewis at mail.msen.com Sat Nov 21 15:08:27 2020 From: lewis at mail.msen.com (David T. Lewis) Date: Sat, 21 Nov 2020 10:08:27 -0500 Subject: [Vm-dev] VM_VERSION triplet In-Reply-To: <1861614439.12165455.1605953926201.JavaMail.zimbra@telenet.be> References: <200778565.9595181.1605884426052.JavaMail.zimbra@telenet.be> <1861614439.12165455.1605953926201.JavaMail.zimbra@telenet.be> Message-ID: <20201121150827.GA77914@shell.msen.com> Hi David, On Sat, Nov 21, 2020 at 11:18:46AM +0100, stes at PANDORA.BE wrote: > > I understand that the VM version has no relation to the Squeak image > (the version of the Smalltalk image file). > > However there is a relation between the VM version and the VMmaker used to > generate the files in the OpenSmalltalk repository. > Yes. And just to be clear, in the case of the interpreter VM it would be the squeakvm.org Subversion repository. There is a very out date copy of those sources in the OpenSmalltalk repository, which is useful as a convenient reference, but please don't use it to build a VM. > If I understand correctly it is in fact good style to use VMmaker yourself, > to create one's own set of sources. > I don't know if it's any better or worse as a policy, but I would certainly encourage you to do it if you have an interest. For an opensmalltalk to use with the latest Squeak images, follow the instructions and use the scripts in opensmalltalk-vm/image/ to make an up to date VMMaker image. That image will have open workspaces that explain how to generate the code (and many other things of interest, well worth a look). For an interpreter VM, follow the instructions for "How to build a standard VM with Squeak on Linux" at http://wiki.squeak.org/squeak/6177. This gives step by step instructions for the process. > For the moment I just checkout the Git sources but those are created by VMmaker > (the output of VMmaker) so it makes sense to use VMmaker instead yourself. > Either way is fine. The advantage of checking out the sources from git or subversion is that it is easy, and you are working with a known good set of sources. But if you are interested in doing the code generation yourself I would certainly encourage you to give it a try. > Anyway sorry for the noise on this list ... > Not at all!!! Thanks for asking. Dave From Yoshiki.Ohshima at acm.org Sat Nov 21 17:32:23 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Sat, 21 Nov 2020 09:32:23 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> Message-ID: On Fri, Nov 20, 2020 at 5:11 PM Yoshiki Ohshima wrote: > > > On Fri, Nov 20, 2020 at 4:50 PM tim Rowledge wrote: > >> >> >> >> > On 2020-11-20, at 3:10 PM, Yoshiki Ohshima >> wrote: >> > >> > So I built a new VM with a fix for the input method change. I did >> not fully test the other things but Scratch on the VM does not do >> animations. It updates screen only when mouse is moved, or some slower >> interval: >> > >> > https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 >> >> That's really weird. I see two systems running at the same time there - >> same image? Different VM? >> > > Yeah, those are running the same image on different VMs. > >> >> > >> > I suspect that there might have been some options I needed to pass in >> to specify some timers? Can you think of other reasons why this might >> happen and where to look to fix it? >> >> I never had any timer related options to worry about, so it shouldn't be >> anything to do with that. >> >> What happens if you use the 'new' VM but don't use the compositor/input >> thing? IIRC I had terrible problems caused by that ibus program and we had >> to make sure it didn't get into the Raspbian release. >> > > I'll check it out. I wasn't expecting this kind of problem and did not > fully test things out. > Not having compositioninput does not fix the problem. With a non-scratch image and I run BouncingAtomsMorph, the screen update on my VM is one frame per second unless I move the mouse pointer. Which function to obtain the current time to tell the VM to run the next event loop? I can check if it is called. -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Sat Nov 21 17:42:12 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Sat, 21 Nov 2020 09:42:12 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> Message-ID: On Sat, Nov 21, 2020 at 9:32 AM Yoshiki Ohshima wrote: > > > On Fri, Nov 20, 2020 at 5:11 PM Yoshiki Ohshima > wrote: > >> >> >> On Fri, Nov 20, 2020 at 4:50 PM tim Rowledge wrote: >> >>> >>> >>> >>> > On 2020-11-20, at 3:10 PM, Yoshiki Ohshima >>> wrote: >>> > >>> > So I built a new VM with a fix for the input method change. I did >>> not fully test the other things but Scratch on the VM does not do >>> animations. It updates screen only when mouse is moved, or some slower >>> interval: >>> > >>> > https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 >>> >>> That's really weird. I see two systems running at the same time there - >>> same image? Different VM? >>> >> >> Yeah, those are running the same image on different VMs. >> >>> >>> > >>> > I suspect that there might have been some options I needed to pass in >>> to specify some timers? Can you think of other reasons why this might >>> happen and where to look to fix it? >>> >>> I never had any timer related options to worry about, so it shouldn't be >>> anything to do with that. >>> >>> What happens if you use the 'new' VM but don't use the compositor/input >>> thing? IIRC I had terrible problems caused by that ibus program and we had >>> to make sure it didn't get into the Raspbian release. >>> >> >> I'll check it out. I wasn't expecting this kind of problem and did not >> fully test things out. >> > > Not having compositioninput does not fix the problem. With a non-scratch > image and I run BouncingAtomsMorph, the screen update on my VM is one frame > per second unless I move the mouse pointer. > > Which function to obtain the current time to tell the VM to run the next > event loop? I can check if it is called. > One datapoint is that making the argument for aioSleepForUsecs in display_ioRelinquishProcessorForMicroseconds() to be always zero: static sqInt display_ioRelinquishProcessorForMicroseconds(sqInt microSeconds) { aioSleepForUsecs(handleEvents() ? 0 : 0); // aioSleepForUsecs(handleEvents() ? 0 : 1000); return 0; } makes it run smoothly. So the return value from handleEvents() would have to make sense. (still investigating..) -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From Yoshiki.Ohshima at acm.org Sat Nov 21 18:27:53 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Sat, 21 Nov 2020 10:27:53 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> Message-ID: On Sat, Nov 21, 2020 at 9:42 AM Yoshiki Ohshima wrote: > > > On Sat, Nov 21, 2020 at 9:32 AM Yoshiki Ohshima > wrote: > >> >> >> On Fri, Nov 20, 2020 at 5:11 PM Yoshiki Ohshima >> wrote: >> >>> >>> >>> On Fri, Nov 20, 2020 at 4:50 PM tim Rowledge wrote: >>> >>>> >>>> >>>> >>>> > On 2020-11-20, at 3:10 PM, Yoshiki Ohshima >>>> wrote: >>>> > >>>> > So I built a new VM with a fix for the input method change. I did >>>> not fully test the other things but Scratch on the VM does not do >>>> animations. It updates screen only when mouse is moved, or some slower >>>> interval: >>>> > >>>> > https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 >>>> >>>> That's really weird. I see two systems running at the same time there - >>>> same image? Different VM? >>>> >>> >>> Yeah, those are running the same image on different VMs. >>> >>>> >>>> > >>>> > I suspect that there might have been some options I needed to pass in >>>> to specify some timers? Can you think of other reasons why this might >>>> happen and where to look to fix it? >>>> >>>> I never had any timer related options to worry about, so it shouldn't >>>> be anything to do with that. >>>> >>>> What happens if you use the 'new' VM but don't use the compositor/input >>>> thing? IIRC I had terrible problems caused by that ibus program and we had >>>> to make sure it didn't get into the Raspbian release. >>>> >>> >>> I'll check it out. I wasn't expecting this kind of problem and did not >>> fully test things out. >>> >> >> Not having compositioninput does not fix the problem. With a non-scratch >> image and I run BouncingAtomsMorph, the screen update on my VM is one frame >> per second unless I move the mouse pointer. >> >> Which function to obtain the current time to tell the VM to run the next >> event loop? I can check if it is called. >> > > One datapoint is that making the argument for aioSleepForUsecs > in display_ioRelinquishProcessorForMicroseconds() to be always zero: > > static sqInt display_ioRelinquishProcessorForMicroseconds(sqInt > microSeconds) > { > aioSleepForUsecs(handleEvents() ? 0 : 0); > // aioSleepForUsecs(handleEvents() ? 0 : 1000); > return 0; > } > > makes it run smoothly. So the return value from handleEvents() would have > to make sense. > > (still investigating..) > So the handleEvents() looks like this: -------------------- int handleEvents(void) { if (recordPendingKeys()) return 0; if (!isConnectedToXServer || !XPending(stDisplay)) { return !iebEmptyP(); } while (XPending(stDisplay)) { XEvent evt; XNextEvent(stDisplay, &evt); handleEvent(&evt); } return 1; } -------------------- but the part that affecting the animation performance is "return !iebEmptyP()". If I take out "!", it tells the caller that it handled an event when (?) not collected to the X server (which is a weird test) or not X event is not pending, check if the input event buffer is empty or not. This check may be okay but needs some clarifications. But I suspect that aioSleepForUsecs() on this platform may be sleeping given milliseconds and not microseconds. That may be consistent with the symptom of waking up at every second... -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at rowledge.org Sat Nov 21 19:40:33 2020 From: tim at rowledge.org (tim Rowledge) Date: Sat, 21 Nov 2020 11:40:33 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> Message-ID: <2852EA4F-1192-4C33-B572-3078B06D2B73@rowledge.org> OK, just tried this on my built-last-week ARM64 VM on a Pi 4 and BouncingAtoms happily bounce. 300 -> throttled, 3000 -> 11fps. The code for handleEvents() in this VM is the same as you posted. Apparently (if we trust 'guthub desktop') I last downloaded any sources on Oct 16 (or as I prefer to think of it, March 230th). Maybe that provides a useful check point. > On 2020-11-21, at 9:32 AM, Yoshiki Ohshima wrote: > > Not having compositioninput does not fix the problem. With a non-scratch image and I run BouncingAtomsMorph, the screen update on my VM is one frame per second unless I move the mouse pointer. The only weirdness about my setup that might, just possibly, affect this is that my Pi are all connected to my iMac with VNC; none have local displays. tim -- tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Useful random insult:- Put a lens in each ear and you've got a telescope. From Yoshiki.Ohshima at acm.org Sat Nov 21 20:39:29 2020 From: Yoshiki.Ohshima at acm.org (Yoshiki Ohshima) Date: Sat, 21 Nov 2020 12:39:29 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: <2852EA4F-1192-4C33-B572-3078B06D2B73@rowledge.org> References: <8067F527-965D-4D6E-B886-61E9E31BF571@rowledge.org> <2852EA4F-1192-4C33-B572-3078B06D2B73@rowledge.org> Message-ID: On Sat, Nov 21, 2020 at 11:40 AM tim Rowledge wrote: > > OK, just tried this on my built-last-week ARM64 VM on a Pi 4 and > BouncingAtoms happily bounce. 300 -> throttled, 3000 -> 11fps. > Ok... How about ARM32? If that makes a difference, it may be about the complex ifdefs in aioPoll() that somehow fails to capture the case. > > The code for handleEvents() in this VM is the same as you posted. > Apparently (if we trust 'guthub desktop') I last downloaded any sources on > Oct 16 (or as I prefer to think of it, March 230th). Maybe that provides a > useful check point. > > > On 2020-11-21, at 9:32 AM, Yoshiki Ohshima > wrote: > > > > Not having compositioninput does not fix the problem. With a non-scratch > image and I run BouncingAtomsMorph, the screen update on my VM is one frame > per second unless I move the mouse pointer. > > > The only weirdness about my setup that might, just possibly, affect this > is that my Pi are all connected to my iMac with VNC; none have local > displays. > > tim > -- > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim > Useful random insult:- Put a lens in each ear and you've got a telescope. > > > -- -- Yoshiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From eliot.miranda at gmail.com Sun Nov 22 05:26:51 2020 From: eliot.miranda at gmail.com (Eliot Miranda) Date: Sat, 21 Nov 2020 21:26:51 -0800 Subject: [Vm-dev] Another NuScratch issue In-Reply-To: References: Message-ID: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> Hi Yoshiki, Levente replaced the select code with epoll code on Linux a fey weeks ago. Maybe there’s a regression. _,,,^..^,,,_ (phone) > On Nov 21, 2020, at 10:28 AM, Yoshiki Ohshima wrote: > >  > > >> On Sat, Nov 21, 2020 at 9:42 AM Yoshiki Ohshima wrote: >> >> >>> On Sat, Nov 21, 2020 at 9:32 AM Yoshiki Ohshima wrote: >>> >>> >>>> On Fri, Nov 20, 2020 at 5:11 PM Yoshiki Ohshima wrote: >>>> >>>> >>>>> On Fri, Nov 20, 2020 at 4:50 PM tim Rowledge wrote: >>>>> >>>>> >>>>> >>>>> > On 2020-11-20, at 3:10 PM, Yoshiki Ohshima wrote: >>>>> > >>>>> > So I built a new VM with a fix for the input method change. I did not fully test the other things but Scratch on the VM does not do animations. It updates screen only when mouse is moved, or some slower interval: >>>>> > >>>>> > https://photos.app.goo.gl/QHgKCeeP2bnQGESu5 >>>>> >>>>> That's really weird. I see two systems running at the same time there - same image? Different VM? >>>> >>>> Yeah, those are running the same image on different VMs. >>>>> >>>>> > >>>>> > I suspect that there might have been some options I needed to pass in to specify some timers? Can you think of other reasons why this might happen and where to look to fix it? >>>>> >>>>> I never had any timer related options to worry about, so it shouldn't be anything to do with that. >>>>> >>>>> What happens if you use the 'new' VM but don't use the compositor/input thing? IIRC I had terrible problems caused by that ibus program and we had to make sure it didn't get into the Raspbian release. >>>> >>>> I'll check it out. I wasn't expecting this kind of problem and did not fully test things out. >>> >>> Not having compositioninput does not fix the problem. With a non-scratch image and I run BouncingAtomsMorph, the screen update on my VM is one frame per second unless I move the mouse pointer. >>> >>> Which function to obtain the current time to tell the VM to run the next event loop? I can check if it is called. >> >> One datapoint is that making the argument for aioSleepForUsecs in display_ioRelinquishProcessorForMicroseconds() to be always zero: >> >> static sqInt display_ioRelinquishProcessorForMicroseconds(sqInt microSeconds) >> { >> aioSleepForUsecs(handleEvents() ? 0 : 0); // aioSleepForUsecs(handleEvents() ? 0 : 1000); >> return 0; >> } >> >> makes it run smoothly. So the return value from handleEvents() would have to make sense. >> >> (still investigating..) > > So the handleEvents() looks like this: > > -------------------- > int handleEvents(void) > { > if (recordPendingKeys()) > return 0; > > if (!isConnectedToXServer || !XPending(stDisplay)) { > return !iebEmptyP(); > } > > while (XPending(stDisplay)) > { > XEvent evt; > XNextEvent(stDisplay, &evt); > handleEvent(&evt); > } > return 1; > } > -------------------- > but the part that affecting the animation performance is "return !iebEmptyP()". If I take out "!", it tells the caller that it handled an event when (?) not collected to the X server (which is a weird test) or not X event is not pending, check if the input event buffer is empty or not. > > This check may be okay but needs some clarifications. > > But I suspect that aioSleepForUsecs() on this platform may be sleeping given milliseconds and not microseconds. That may be consistent with the symptom of waking up at every second... > > -- > -- Yoshiki > -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sun Nov 22 14:33:54 2020 From: notifications at github.com (Christoph Thiede) Date: Sun, 22 Nov 2020 06:33:54 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] [Win10] [Squeak] High CPU usage in different images for a few minutes after resume from sleep (#537) Message-ID: I noticed this a few times, and today I observed it a bit: After resuming my Win10 message from sleep, my two open Squeak.exe processes both made up each ~14% CPU load. I suspect this performance gap is caused by the VM because, in one image, a nearly empty Morphic world was open (two non-stepping windows only) and in the other one, a completely empty MVC world; both images were responsive; and according to Squeak's CPU watcher, only ~20% of time were spent in the UI process but 80% in idle. After a few minutes, both VM instances fall back to ~0.1% of total CPU usage. Is there any chance to find an explanation for this behavior in the VM implementation, are there any hidden background operations (maybe certain WM_MESSAGES) that are triggered after resuming from sleep? Does anyone else notice similar behavior? For sake of completeness, I should mention that my RAM and disk usage are chronically near maximum (90% of RAM in use, 25 GB on SSD free. Squeak images are so large 😐). But this does not change after a few minutes so I don't think it explains the observed slowdown completely. VM build 202010232046; but I could already have experienced similar issues a few months ago. -- 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/537 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sun Nov 22 19:27:53 2020 From: notifications at github.com (Christoph Thiede) Date: Sun, 22 Nov 2020 11:27:53 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] [Ubuntu] libpulse-simple.so.0: cannot open shared object file: No such file or directory (#538) Message-ID: Today encountered the following error when running **Squeak in smalltalkCI** on **ubuntu-latest** (as part of a GitHub workflow): ``` Extracting virtual machine... Cog VM Information /home/runner/.smalltalkCI/_cache/vms/Squeak64-Trunk/sqcogspur64linuxht/lib/squeak/5.0-202003021730/squeak: error while loading shared libraries: libpulse-simple.so.0: cannot open shared object file: No such file or directory Error with status code 127: 264 squeak::prepare_vm /home/runner/.smalltalkCI/squeak/run.sh ``` If this error turns out to be permanent, I will try to find out why it did not occur before. Maybe an update in the pulseaudio upstream dependency? -- 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/538 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Sun Nov 22 19:47:01 2020 From: notifications at github.com (Christoph Thiede) Date: Sun, 22 Nov 2020 11:47:01 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] [Ubuntu] libpulse-simple.so.0: cannot open shared object file: No such file or directory (#538) In-Reply-To: References: Message-ID: Well, a few builds later it worked again ... Sporadic issue. -- 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/538#issuecomment-731834000 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sun Nov 22 23:34:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 22 Nov 2020 23:34:15 0000 Subject: [Vm-dev] VM Maker: VMMaker-dtl.419.mcz Message-ID: David T. Lewis uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-dtl.419.mcz ==================== Summary ==================== Name: VMMaker-dtl.419 Author: dtl Time: 22 November 2020, 11:52:26.748 am UUID: 13a52440-38ce-414c-92a9-8a2ba438b91b Ancestors: VMMaker-dtl.418 Extend image version compatibility. For Squeak 6 alpha (current trunk): Remove use of deprecated hideVScrollBarIndefinitely: with possible cosmetic impact on older image versions but otherwise harmless to remove. Provide a compatibility method to handle the renaming of includesSubString: to includesSubstring: Handle the removal of CrLfFileStream. For circa Squeak 3.8: Use ifNotNilDo: instead of ifNotNil: when passing a block argument. Use ifNil:ifNotNilDo: instead of ifNil:ifNotNil: when passing a block argument. Note, early images require Pragmatizer to undo pragma usage =============== Diff against VMMaker-dtl.418 =============== Item was changed: ----- Method: BalloonEngineBase class>>initialize (in category 'class initialization') ----- initialize "BalloonEngineBase initialize" "BalloonEnginePlugin translateDoInlining: true." EdgeInitTable := self initializeEdgeInitTable. EdgeStepTable := self initializeEdgeStepTable. WideLineWidthTable := self initializeWideLineWidthTable. WideLineFillTable := self initializeWideLineFillTable. FillTable := self initializeFillTable. + (Smalltalk classNamed: #BalloonEngineConstants) ifNotNilDo: - (Smalltalk classNamed: #BalloonEngineConstants) ifNotNil: [:balloonEngineConstants| (balloonEngineConstants classPool anySatisfy: [:classVarValue| classVarValue isNil]) ifTrue: [balloonEngineConstants initialize]]! Item was changed: ----- Method: BalloonEngineSimulation>>copyBitsFrom:to:at: (in category 'simulation') ----- copyBitsFrom: x0 to: x1 at: y "Simulate the copyBits primitive" | bb | bbObj isInteger ifTrue: ["Create a proxy object to handle BitBlt calls" bb := savedBBObj ifNil: [BitBltSimulator new initialiseModule; setInterpreter: interpreterProxy; yourself] + ifNotNilDo: [savedBBObj]. - ifNotNil: [savedBBObj]. (bb loadBitBltFrom: bbObj) ifTrue: [bbObj := bb] ifFalse: [^ self]]. bbObj copyBitsFrom: x0 to: x1 at: y. " interpreterProxy showDisplayBits: bbObj destForm Left: bb affectedLeft Top: bb affectedTop Right: bb affectedRight Bottom: bb affectedBottom. "! Item was changed: ----- Method: CCodeGenerator>>addMethodFor:selector: (in category 'utilities') ----- addMethodFor: aClass selector: selector "Add the given method to the code base and answer its translation or nil if it shouldn't be translated." | method tmethod | method := aClass compiledMethodAt: selector. method requiresConcreteImplementation ifTrue: [abstractDeclarations add: selector]. method isAbstract ifTrue: [^nil]. (method pragmaAt: #doNotGenerate) ifNotNil: [^nil]. "process optional methods by interpreting the argument to the option: pragma as either a Cogit class name or a class variable name or a variable name in VMBasicConstants." + (method pragmaAt: #option:) ifNotNilDo: - (method pragmaAt: #option:) ifNotNil: [:pragma| | key | key := pragma argumentAt: 1. "((Cogit withAllSubclasses anySatisfy: [:c| c name = key]) and: [VMClass getVMMaker cogitClassName ~= key]) ifTrue: [^nil]." + (aClass bindingOf: key) ifNotNilDo: - (aClass bindingOf: key) ifNotNil: [:binding| binding value ifFalse: [^nil]]. + (VMBasicConstants bindingOf: key) ifNotNilDo: - (VMBasicConstants bindingOf: key) ifNotNil: [:binding| binding value ifFalse: [^nil]]]. tmethod := self compileToTMethodSelector: selector in: aClass. tmethod hasDoNotGenerateStatement ifTrue: [^nil]. self addMethod: tmethod. "If the method has a macro then add the macro. But keep the method for analysis purposes (e.g. its variable accesses)." + (method pragmaAt: #cmacro:) ifNotNilDo: - (method pragmaAt: #cmacro:) ifNotNil: [:pragma| self addMacro: (pragma argumentAt: 1) for: selector]. + (method propertyValueAt: #cmacro:) ifNotNilDo: - (method propertyValueAt: #cmacro:) ifNotNil: [:macro| self addMacro: macro for: selector]. ^tmethod! Item was changed: ----- Method: CCodeGenerator>>addStructMethodFor:selector: (in category 'utilities') ----- addStructMethodFor: aClass selector: selector "Add the given struct method to the code base and answer its translation or nil if it shouldn't be translated." + ^(self addMethodFor: aClass selector: selector) ifNotNilDo: - ^(self addMethodFor: aClass selector: selector) ifNotNil: [:tmethod| tmethod transformToStructClassMethodFor: self. tmethod]! Item was changed: ----- Method: CCodeGenerator>>declToType: (in category 'public') ----- declToType: decl "Extracts the type from a C declaration string" | strs r | decl isNil ifFalse: [ (decl indexOf: $=) > 0 ifTrue: [ strs := (decl copyFrom: 1 to: ((decl indexOf: $=) - 1)) ] ifFalse: [ strs := decl ]. strs := (strs withoutTrailingBlanks) subStrings: ' '. strs size == 1 ifTrue: [ ^ strs first ] ifFalse: [ | asterisks | r := ''. strs allButLastDo: [ :s | r := r,s,' ' ]. "Bit of a hack to get 'type *'" asterisks := (strs last copyFrom: 1 to: (strs last lastIndexOf: $*)). asterisks size > 0 ifTrue: [ r := r,' ',asterisks ]. r := r withoutTrailingBlanks. + (((r indexOf: $( ) > 0) or: [ (r indexOf: $) ) > 0 ] ) ifTrue: [ ^nil ]. - (((r indexOf: $() > 0) or: ((r indexOf: $)) > 0)) ifTrue: [ ^nil ]. ^r withoutTrailingBlanks ]. ] ifTrue: [ ^nil ].! Item was changed: ----- Method: CCodeGenerator>>extractTypeFor:fromDeclaration: (in category 'utilities') ----- extractTypeFor: aVariable fromDeclaration: aVariableDeclaration "Eliminate inessentials from aVariableDeclaration to answer a C type without the variable, or initializations etc" | decl | decl := aVariableDeclaration. (decl beginsWith: 'static') ifTrue: [decl := decl allButFirst: 6]. + (decl indexOf: $= ifAbsent: []) ifNotNilDo: - (decl indexOf: $= ifAbsent: []) ifNotNil: [:index| decl := decl copyFrom: 1 to: index - 1]. decl := decl copyReplaceAll: aVariable with: '' tokenish: [:ch| ch = $_ or: [ch isAlphaNumeric]]. ^self baseTypeForType: decl! Item was changed: ----- Method: CCodeGenerator>>generateIfFalse:on:indent: (in category 'C translation') ----- generateIfFalse: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPutAll: 'if (!!('. msgNode receiver emitCCodeAsExpressionOn: aStream level: level + 1 generator: self. aStream nextPutAll: ')) {'; cr. msgNode args last emitCCodeOn: aStream level: level + 1 generator: self. level timesRepeat: [aStream tab]. aStream nextPut: $}] + ifNotNilDo: - ifNotNil: [:const | const ifFalse: [msgNode args first emitCCodeOn: aStream level: level generator: self]]! Item was changed: ----- Method: CCodeGenerator>>generateIfFalseAsArgument:on:indent: (in category 'C translation') ----- generateIfFalseAsArgument: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPutAll: '(!!('. msgNode receiver emitCCodeAsArgumentOn: aStream level: 0 generator: self. aStream nextPut: $); crtab: level + 1; nextPut: $?; space. msgNode args last emitCCodeAsArgumentOn: aStream level: level + 2 generator: self. aStream crtab: level + 1; nextPutAll: ': 0)'] + ifNotNilDo: - ifNotNil: [:const| const ifFalse: [msgNode args first emitCCodeAsArgumentOn: aStream level: level generator: self]]! Item was changed: ----- Method: CCodeGenerator>>generateIfFalseIfTrue:on:indent: (in category 'C translation') ----- generateIfFalseIfTrue: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPutAll: 'if ('. msgNode receiver emitCCodeAsExpressionOn: aStream level: level generator: self. aStream nextPutAll: ') {'; cr. msgNode args last emitCCodeOn: aStream level: level + 1 generator: self. aStream tab: level; nextPut: $}; nextPutAll: ' else {'; cr. msgNode args first emitCCodeOn: aStream level: level + 1 generator: self. aStream tab: level; nextPut: $}] + ifNotNilDo: - ifNotNil: [:const | (const ifTrue: [msgNode args last] ifFalse: [msgNode args first]) emitCCodeOn: aStream level: level generator: self]! Item was changed: ----- Method: CCodeGenerator>>generateIfFalseIfTrueAsArgument:on:indent: (in category 'C translation') ----- generateIfFalseIfTrueAsArgument: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPut: $(. msgNode receiver emitCCodeAsArgumentOn: aStream level: level generator: self. aStream crtab: level + 1; nextPut: $?; space. msgNode args last emitCCodeAsArgumentOn: aStream level: level + 2 generator: self. aStream crtab: level + 1; nextPut: $:; space. msgNode args first emitCCodeAsArgumentOn: aStream level: level + 2 generator: self. aStream nextPut: $)] + ifNotNilDo: - ifNotNil: [:const| (const ifTrue: [msgNode args last] ifFalse: [msgNode args first]) emitCCodeAsArgumentOn: aStream level: level generator: self]! Item was changed: ----- Method: CCodeGenerator>>generateIfTrue:on:indent: (in category 'C translation') ----- generateIfTrue: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPutAll: 'if ('. msgNode receiver emitCCodeAsExpressionOn: aStream level: level generator: self. aStream nextPutAll: ') {'; cr. msgNode args first emitCCodeOn: aStream level: level + 1 generator: self. level timesRepeat: [ aStream tab ]. aStream nextPut: $}] + ifNotNilDo: - ifNotNil: [:const | const ifTrue: [msgNode args first emitCCodeOn: aStream level: level generator: self]]! Item was changed: ----- Method: CCodeGenerator>>generateIfTrueAsArgument:on:indent: (in category 'C translation') ----- generateIfTrueAsArgument: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPut: $(. msgNode receiver emitCCodeAsArgumentOn: aStream level: level generator: self. aStream crtab: level + 1; nextPut: $?; space. msgNode args first emitCCodeAsArgumentOn: aStream level: level + 2 generator: self. aStream crtab: level + 1; nextPutAll: ': 0)'] + ifNotNilDo: - ifNotNil: [:const| const ifTrue: [msgNode args first emitCCodeAsArgumentOn: aStream level: level generator: self]]! Item was changed: ----- Method: CCodeGenerator>>generateIfTrueIfFalse:on:indent: (in category 'C translation') ----- generateIfTrueIfFalse: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPutAll: 'if ('. msgNode receiver emitCCodeAsExpressionOn: aStream level: level generator: self. aStream nextPutAll: ') {'; cr. msgNode args first emitCCodeOn: aStream level: level + 1 generator: self. aStream tab: level; nextPut: $}; nextPutAll: ' else {'; cr. msgNode args last emitCCodeOn: aStream level: level + 1 generator: self. aStream tab: level; nextPut: $}] + ifNotNilDo: - ifNotNil: [:const | (const ifTrue: [msgNode args first] ifFalse: [msgNode args last]) emitCCodeOn: aStream level: level generator: self]! Item was changed: ----- Method: CCodeGenerator>>generateIfTrueIfFalseAsArgument:on:indent: (in category 'C translation') ----- generateIfTrueIfFalseAsArgument: msgNode on: aStream indent: level "Generate the C code for this message onto the given stream." (self nilOrBooleanConstantReceiverOf: msgNode) ifNil: [aStream nextPut: $(. msgNode receiver emitCCodeAsArgumentOn: aStream level: level generator: self. aStream crtab: level + 1; nextPut: $?; space. msgNode args first emitCCodeAsArgumentOn: aStream level: level + 2 generator: self. aStream crtab: level + 1; nextPut: $:; space. msgNode args last emitCCodeAsArgumentOn: aStream level: level + 2 generator: self. aStream nextPut: $)] + ifNotNilDo: - ifNotNil: [:const| (const ifTrue: [msgNode args first] ifFalse: [msgNode args last]) emitCCodeAsArgumentOn: aStream level: level generator: self]! Item was changed: ----- Method: CCodeGenerator>>generateValue:on:indent: (in category 'C translation') ----- generateValue: aTSendNode on: aStream indent: level "Reduce [:formal ... :formalN| body ] value: actual ... value: actualN to body with formals substituted for by actuals." | substitution substitutionDict newLabels | self assert: aTSendNode receiver isStmtList. self assert: aTSendNode receiver args size = aTSendNode args size. substitution := aTSendNode receiver copy. substitution renameLabelsForInliningInto: currentMethod. substitutionDict := Dictionary new: aTSendNode args size * 2. aTSendNode receiver args with: aTSendNode args do: [ :argName :exprNode | substitutionDict at: argName put: exprNode]. substitution bindVariablesIn: substitutionDict; emitCCodeOn: aStream level: level generator: self. newLabels := Set withAll: currentMethod labels. substitution nodesDo: + [:node| node isLabel ifTrue: [node label ifNotNilDo: [:label| newLabels add: label]]]. - [:node| node isLabel ifTrue: [node label ifNotNil: [:label| newLabels add: label]]]. "now add the new labels so that a subsequent inline of the same block will be renamed with different labels." currentMethod labels: newLabels! Item was changed: ----- Method: CCodeGenerator>>generateValueAsArgument:on:indent: (in category 'C translation') ----- generateValueAsArgument: aTSendNode on: aStream indent: level "Reduce [:formal ... :formalN| body ] value: actual ... value: actualN to body with formals substituted for by actuals." | substitution substitutionDict newLabels | self assert: aTSendNode receiver isStmtList. self assert: aTSendNode receiver args size = aTSendNode args size. substitution := aTSendNode receiver copy. substitution renameLabelsForInliningInto: currentMethod. substitutionDict := Dictionary new: aTSendNode args size * 2. aTSendNode receiver args with: aTSendNode args do: [ :argName :exprNode | substitutionDict at: argName put: exprNode]. substitution bindVariablesIn: substitutionDict; emitCCodeAsArgumentOn: aStream level: level generator: self. newLabels := Set withAll: currentMethod labels. substitution nodesDo: + [:node| node isLabel ifTrue: [node label ifNotNilDo: [:label| newLabels add: label]]]. - [:node| node isLabel ifTrue: [node label ifNotNil: [:label| newLabels add: label]]]. "now add the new labels so that a subsequent inline of the same block will be renamed with different labels." currentMethod labels: newLabels! Item was changed: ----- Method: CCodeGenerator>>storeCodeOnFile:doInlining:doAssertions: (in category 'public') ----- storeCodeOnFile: fileName doInlining: inlineFlag doAssertions: assertionFlag "Store C code for this code base on the given file." | stream | + stream := VMMaker forceNewFileNamed: fileName. - stream := CrLfFileStream forceNewFileNamed: fileName. stream ifNil: [Error signal: 'Could not open C code file: ', fileName]. self emitCCodeOn: stream doInlining: inlineFlag doAssertions: assertionFlag. stream close! Item was changed: ----- Method: CCodeGenerator>>storeHeaderFor:onFile: (in category 'public') ----- storeHeaderFor: interpreterClassName onFile: fileName "Store C header code for this interpreter on the given file." | aStream | + aStream := VMMaker forceNewFileNamed: fileName. - aStream := CrLfFileStream forceNewFileNamed: fileName. aStream ifNil: [Error signal: 'Could not open C header file: ', fileName]. aStream nextPutAll: '/* '; nextPutAll: VMMaker headerNotice; nextPutAll: ' */'; cr; cr; nextPutAll: (self fileHeaderVersionStampForSourceClass: nil); cr; cr; nextPutAll: '#ifndef HAVE_INTERP_H'; cr; nextPutAll: '# define HAVE_INTERP_H'; cr; nextPutAll: '#endif'; cr; cr. self emitVmmVersionOn: aStream. (Smalltalk classNamed: interpreterClassName) emitInterpreterProxyVersionOn: aStream. self emitDefineBytesPerWordOn: aStream. aStream cr. aStream close ! Item was changed: ----- Method: CCodeGenerator>>var:declareC: (in category 'public') ----- var: varName declareC: declarationString "Record the given C declaration for a global variable." + (self string: declarationString includesSubstring: varName) ifFalse: - (declarationString includesSubString: varName) ifFalse: [self error: 'declaration omits variable name. probably an error. use e.g. var:type:']. variableDeclarations at: varName asString put: declarationString.! Item was changed: ----- Method: ContextInterpreter>>primitiveMemorySnapshotBytesWithHeader (in category 'snapshot utility primitives') ----- primitiveMemorySnapshotBytesWithHeader "Primitive. Answer an array with a snapshot copy of the object memory as of the point of entry to this primitive, and with the header information for the image at the point of the snapshot. The memory snapshot is a ByteArray copy of the object memory, and the header information is an array of the values that would be stored in an image file header if the image was being saved to disk. The header state information along with memory snapshot are sufficient to initialize an an image to be run in an interpreter." - "pop rcvr. A resuming image will see this primitive answering true, otherwise it will answer the expected value of a two element array. Test for result equal to true to determine if the image is being resumed from a saved snapshot.." | result | + self pop: argumentCount + 1. self push: objectMemory getTrueObj. "resuming image will see this" result := self headerAndSnapshotOfSize: self prepareForSnapshot class: objectMemory classByteArray. self pop: 1. "restore stack" self push: result. "normal sender will see this" ! Item was changed: ----- Method: ContextInterpreter>>primitiveMemorySnapshotWithHeader (in category 'snapshot utility primitives') ----- primitiveMemorySnapshotWithHeader "Primitive. Answer an array with a snapshot copy of the object memory as of the point of entry to this primitive, and with the header information for the image at the point of the snapshot. The memory snapshot is a Bitmap copy of the object memory, and the header information is an array of the values that would be stored in an image file header if the image was being saved to disk. The header state information along with memory snapshot are sufficient to initialize an an image to be run in an interpreter." - "pop rcvr. A resuming image will see this primitive answering true, otherwise it will answer the expected value of a two element array. Test for result equal to true to determine if the image is being resumed from a saved snapshot.." | result | + self pop: argumentCount + 1. + self push: objectMemory getTrueObj. "resuming image will see this" - self push: objectMemory getTrueObj. "resuming image will see this" result := self headerAndSnapshotOfSize: self prepareForSnapshot class: objectMemory classBitmap. self pop: 1. "restore stack" self push: result. "normal sender will see this" ! Item was changed: ----- Method: ContextInterpreter>>primitiveResumeFromSnapshot (in category 'snapshot utility primitives') ----- primitiveResumeFromSnapshot "Discard the current object memory and resume interpreter execution in the provided snapshot." - | expectedArraySize snapshotValues size newMemoryBytesOrBitmap bigEndian snapshotImageFormat snapshotStartOfMemory snapshotSpecialObjectsOop snapshotLastHash screenSizePoint headerSize imageBytes imageHeaderFlags snapshotExtraVMMemory swapBytes snapshotFullScreen defaultHeapSize desiredHeapSize | + expectedArraySize := 11. "ImageSnapshot new asValues size => 11" argumentCount == 1 ifFalse: [ ^self primitiveFailFor: PrimErrBadNumArgs]. snapshotValues := self stackObjectValue: 0. self assertClassOf: snapshotValues is: (objectMemory splObj: ClassArray). self successful ifFalse: [ ^self primitiveFailFor: PrimErrBadArgument]. size := objectMemory numSlotsOf: snapshotValues. size < expectedArraySize ifTrue: [ ^self primitiveFailFor: PrimErrBadArgument]. newMemoryBytesOrBitmap := objectMemory fetchPointer: 0 ofObject: snapshotValues. bigEndian := (objectMemory fetchPointer: 1 ofObject: snapshotValues) = objectMemory trueObject. snapshotImageFormat := objectMemory integerValueOf: (objectMemory fetchPointer: 2 ofObject: snapshotValues).. (self readableFormat: snapshotImageFormat) ifFalse: [ ^self primitiveFailFor: PrimErrInappropriate ]. headerSize := objectMemory integerValueOf: (objectMemory fetchPointer: 3 ofObject: snapshotValues).. imageBytes := self positive32BitValueOf: (objectMemory fetchPointer: 4 ofObject: snapshotValues).. "good for up to 2GB image" snapshotStartOfMemory := objectMemory integerValueOf: (objectMemory fetchPointer: 5 ofObject: snapshotValues).. snapshotSpecialObjectsOop := objectMemory integerValueOf: (objectMemory fetchPointer: 6 ofObject: snapshotValues).. snapshotLastHash := objectMemory integerValueOf: (objectMemory fetchPointer: 7 ofObject: snapshotValues).. screenSizePoint := objectMemory fetchPointer: 8 ofObject: snapshotValues.. self assertClassOf: screenSizePoint is: (objectMemory splObj: ClassPoint). self successful ifFalse: [ ^self primitiveFailFor: PrimErrBadArgument]. imageHeaderFlags := objectMemory integerValueOf: (objectMemory fetchPointer: 9 ofObject: snapshotValues).. snapshotExtraVMMemory := objectMemory integerValueOf: (objectMemory fetchPointer: 10 ofObject: snapshotValues).. swapBytes := bigEndian ~= self isBigEnder. snapshotFullScreen := false. "FIXME" "From sqUnixMain.c #define DefaultHeapSize 20 megabytes BEYOND actual image size" defaultHeapSize := 20 * 1000 * 1000. desiredHeapSize := defaultHeapSize + imageBytes. self snapshotResume: newMemoryBytesOrBitmap heapSize: desiredHeapSize swapBytes: swapBytes oldBaseAddr: snapshotStartOfMemory specialObjectsOop: snapshotSpecialObjectsOop lastHash: snapshotLastHash savedWindowSize: screenSizePoint fullScreenFlag: snapshotFullScreen extraVMMemory: snapshotExtraVMMemory. self pop: 1 thenPush: newMemoryBytesOrBitmap. ! Item was changed: ----- Method: InterpreterPlugin class>>storeString:onFileNamed: (in category 'translation') ----- storeString: s onFileNamed: fileName "Store the given string in a file of the given name." | f | + f := VMMaker forceNewFileNamed: fileName. - f := CrLfFileStream forceNewFileNamed: fileName. f nextPutAll: s. f close.! Item was changed: ----- Method: NewObjectMemorySimulator>>lookupAddress: (in category 'memory access') ----- lookupAddress: address "If address appears to be that of a Symbol or a few well-known objects (such as classes) answer it, otherwise answer nil. For code disassembly" | fmt size string class classSize maybeThisClass classNameIndex thisClassIndex | (self addressCouldBeObj: address) ifFalse: [^nil]. fmt := self formatOf: address. size := self lengthOf: address baseHeader: (self baseHeader: address) format: fmt. size = 0 ifTrue: [^address caseOf: { [nilObj] -> ['nil']. [trueObj] -> ['true']. [falseObj] -> ['false'] } otherwise: []]. ((fmt between: 8 and: 11) "indexable byte fields" and: [(size between: 1 and: 64) and: [Scanner isLiteralSymbol: (string := (0 to: size - 1) collect: [:i| Character value: (self fetchByte: i ofObject: address)])]]) ifTrue: [^'#', (ByteString withAll: string)]. class := self fetchClassOfNonInt: address. ((self addressCouldBeObj: class) and: [(self headerType: class) ~= HeaderTypeShort]) ifFalse: [^nil]. "address is either a class or a metaclass, or an instance of a class or invalid. determine which." classNameIndex := coInterpreter classNameIndex. thisClassIndex := coInterpreter thisClassIndex. ((classSize := self lengthOf: class baseHeader: (self baseHeader: address) format: fmt) <= (classNameIndex max: thisClassIndex) or: [classSize > 255]) ifTrue: [^nil]. "Address could be a class or a metaclass" (fmt = 1 and: [size >= classNameIndex]) ifTrue: ["Is address a class? If so class's thisClass is address." + (self lookupAddress: (self fetchPointer: classNameIndex ofObject: address)) ifNotNilDo: - (self lookupAddress: (self fetchPointer: classNameIndex ofObject: address)) ifNotNil: [:maybeClassName| (self fetchPointer: thisClassIndex ofObject: class) = address ifTrue: [^maybeClassName allButFirst]]. "Is address a Metaclass? If so class's name is Metaclass and address's thisClass holds the class name" ((self isBytes: (self fetchPointer: classNameIndex ofObject: class)) and: [(self lookupAddress: (self fetchPointer: classNameIndex ofObject: class)) = '#Metaclass' and: [size >= thisClassIndex]]) ifTrue: [maybeThisClass := self fetchPointer: thisClassIndex ofObject: address. (self lookupAddress: (self fetchPointer: classNameIndex ofObject: maybeThisClass)) ifNotNil: [:maybeThisClassName| ^maybeThisClassName allButFirst, ' class']]]. ^(self lookupAddress: (self fetchPointer: classNameIndex ofObject: class)) ifNotNil: [:maybeClassName| 'a(n) ', maybeClassName allButFirst]! Item was added: + ----- Method: Object>>string:includesSubstring: (in category '*VMMaker-translation support') ----- + string: aString includesSubstring: substring + "Backward compatibility for a method that was renamed but needs to + remain functional for VMMaker across a range of images." + + ^ (aString respondsTo: #includesSubstring: ) + ifTrue: [aString perform: #includesSubstring: with: substring] + ifFalse: [aString perform: #includesSubString: with: substring] + ! Item was changed: ----- Method: SlangTest>>testInterpDeclareStatic (in category 'testing interpreter') ----- testInterpDeclareStatic "A static directive should cause the generated function to be declared static." | stssi m1 p1 m2 p2 | stssi := SlangTestSupportInterpreter inline: false. m1 := (stssi asCString: #declareStaticTrueByMethod) copyReplaceAll: 'declareStaticTrueByMethod' with: 'methodName'. p1 := (stssi asCString: #declareStaticTrueByPragma) copyReplaceAll: 'declareStaticTrueByPragma' with: 'methodName'. self assert: m1 = p1. m2 := (stssi asCString: #declareStaticFalseByMethod) copyReplaceAll: 'declareStaticFalseByMethod' with: 'methodName'. p2 := (stssi asCString: #declareStaticFalseByPragma) copyReplaceAll: 'declareStaticFalseByPragma' with: 'methodName'. self assert: m2 = p2. "verify that the keyword 'static appears in the generated C source" + self assert: (self string: m1 includesSubstring: 'static'). + self assert: (self string: p1 includesSubstring: 'static'). + self deny: (self string: m2 includesSubstring: 'static'). + self deny: (self string: p2 includesSubstring: 'static') - self assert: (m1 includesSubString: 'static'). - self assert: (p1 includesSubString: 'static'). - self deny: (m2 includesSubString: 'static'). - self deny: (p2 includesSubString: 'static') ! Item was changed: ----- Method: SlangTest>>testInterpDoNotdoNotGenerateByMethod (in category 'testing interpreter') ----- testInterpDoNotdoNotGenerateByMethod "A doNotdoNotGenerate statement should prevent code generation" "(SlangTest selector: #testInterpDoNotdoNotGenerateByMethod) debug" | stssi m | stssi := SlangTestSupportInterpreter inline: false. self assert: (SlangTestSupportInterpreter canUnderstand: #doNotGenerateByMethod). m := stssi asCString: #doNotGenerateByMethod. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stssi asCString includesSubstring: 'doNotGenerateByMethod'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stssi asCString includesSubString: 'doNotGenerateByMethod'). self assert: (stssi doNotGenerateByMethod = 4) ! Item was changed: ----- Method: SlangTest>>testInterpDoNotdoNotGenerateByPragma (in category 'testing interpreter') ----- testInterpDoNotdoNotGenerateByPragma "A declaration should prevent code generation" | stssi m | stssi := SlangTestSupportInterpreter inline: false. self assert: (SlangTestSupportInterpreter canUnderstand: #doNotGenerateByPragma). m := stssi asCString: #doNotGenerateByPragma. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stssi asCString includesSubstring: 'doNotGenerateByPragma'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stssi asCString includesSubString: 'doNotGenerateByPragma'). self assert: (stssi doNotGenerateByPragma = 4) ! Item was changed: ----- Method: SlangTest>>testInterpDoNotdoNotGenerateSubclassResponsibility (in category 'testing interpreter') ----- testInterpDoNotdoNotGenerateSubclassResponsibility "If a method contains self subclassResponsibility, assume it is not meant for translation." | stssi m | stssi := SlangTestSupportInterpreter inline: false. self assert: (SlangTestSupportInterpreter canUnderstand: #anAbstractMethod). m := stssi asCString: #anAbstractMethod. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stssi asCString includesSubstring: 'anAbstractMethod'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stssi asCString includesSubString: 'anAbstractMethod'). self should: [stssi anAbstractMethod] raise: Error ! Item was changed: ----- Method: SlangTest>>testInterpMixedMethodAndPragmaDeclarations (in category 'testing interpreter') ----- testInterpMixedMethodAndPragmaDeclarations "Pragmas and method declarations should coexist" | stssi s | stssi := SlangTestSupportInterpreter inline: false. s := (stssi asCString: #varDefByMethodAndPragma) copyReplaceAll: 'varDefByMethod' with: 'methodName'. + self assert: (self string: s includesSubstring: 'unsigned int * bar'). + self assert: (self string: s includesSubstring: 'char *foo'). + self assert: (self string: s includesSubstring: 'float baz'). + self assert: (self string: s includesSubstring: 'double fum'). - self assert: (s includesSubString: 'unsigned int * bar'). - self assert: (s includesSubString: 'char *foo'). - self assert: (s includesSubString: 'float baz'). - self assert: (s includesSubString: 'double fum'). ! Item was changed: ----- Method: SlangTest>>testIvarShouldNotBeRedeclaredAsLocal (in category 'testing variable declaration') ----- testIvarShouldNotBeRedeclaredAsLocal "Document a bug in some versions of the code generator. If an instance variable is referenced in the generated code, that variable should not be declared as a local in the function." | stssi s | stssi := SlangTestSupportInterpreter inline: false. s := stssi asCString: #setBreakSelector: . + self deny: (self string: s includesSubstring: 'sqInt breakSelector;') - self deny: (s includesSubString: 'sqInt breakSelector;') ! Item was changed: ----- Method: SlangTest>>testLiteralName (in category 'testing variable declaration') ----- testLiteralName "sizeOf: #Foo should translated to C function call sizeof(Foo), where Foo is a literal, not a string" | stssi s | stssi := SlangTestSupportInterpreter inline: false. s := stssi asCString: #sizeOfFoo . + self assert: (self string: s includesSubstring: 'sizeOf(Foo)'). + self deny: (self string: s includesSubstring: 'sizeOf("Foo")'). - self assert: (s includesSubString: 'sizeOf(Foo)'). - self deny: (s includesSubString: 'sizeOf("Foo")'). ! Item was changed: ----- Method: SlangTest>>testLocalizeGlobalVariables (in category 'testing variable declaration') ----- testLocalizeGlobalVariables "CCodeGenerator>>localizeGlobalVariables performs an optimization that may be misleading when introducing a new method. This test documents that optimization. If a method makes reference to an instance variable, and if this is the only method containing a reference to that variable, then the C translator will produce a local variable declaration in the generated function, and no global declaration will appear in the generated source file. This optimization is applied after inlining has been performed, so there are legitimate cases where a variable must be an instance variable referenced by two methods, but can be made local if those methods are inlined into a single method and only one method reference to the variable remains. See ObjectMemory>>markAndSweep: for an example." | stssi s | stssi := SlangTestSupportInterpreter inline: false. s := stssi asCString: #methodWithReferenceToVariables . "variable with one method reference is promoted to a local method variable" + self assert: (self string: s includesSubstring: 'sqInt aVarWithOneReference;'). - self assert: (s includesSubString: 'sqInt aVarWithOneReference;'). "normal expected behavior, the variable is global in the generated source module." + self deny: (self string: s includesSubstring: 'sqInt aVarWithTwoReferences;') - self deny: (s includesSubString: 'sqInt aVarWithTwoReferences;') ! Item was changed: ----- Method: SlangTest>>testPluginDeclareStatic (in category 'testing base plugins') ----- testPluginDeclareStatic "A static directive should cause the generated function to be declared static." | stsp m1 p1 m2 p2 | stsp := SlangTestSupportPlugin inline: false. m1 := (stsp asCString: #declareStaticTrueByMethod) copyReplaceAll: 'declareStaticTrueByMethod' with: 'methodName'. p1 := (stsp asCString: #declareStaticTrueByPragma) copyReplaceAll: 'declareStaticTrueByPragma' with: 'methodName'. self assert: m1 = p1. m2 := (stsp asCString: #declareStaticFalseByMethod) copyReplaceAll: 'declareStaticFalseByMethod' with: 'methodName'. p2 := (stsp asCString: #declareStaticFalseByPragma) copyReplaceAll: 'declareStaticFalseByPragma' with: 'methodName'. self assert: m2 = p2. "verify that the keyword 'static appears in the generated C source" + self assert: (self string: m1 includesSubstring: 'static'). + self assert: (self string: p1 includesSubstring: 'static'). + self deny: (self string: m2 includesSubstring: 'static'). + self deny: (self string: p2 includesSubstring: 'static') - self assert: (m1 includesSubString: 'static'). - self assert: (p1 includesSubString: 'static'). - self deny: (m2 includesSubString: 'static'). - self deny: (p2 includesSubString: 'static') ! Item was changed: ----- Method: SlangTest>>testPluginDoNotGenerateByMethod (in category 'testing base plugins') ----- testPluginDoNotGenerateByMethod "A doNotdoNotGenerate statement should prevent code generation" | stsp m | stsp := SlangTestSupportPlugin inline: false. self assert: (SlangTestSupportPlugin canUnderstand: #doNotGenerateByMethod). m := stsp asCString: #doNotGenerateByMethod. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stsp asCString includesSubstring: 'doNotGenerateByMethod'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stsp asCString includesSubString: 'doNotGenerateByMethod'). self assert: (stsp doNotGenerateByMethod = 4) ! Item was changed: ----- Method: SlangTest>>testPluginDoNotGenerateByPragma (in category 'testing base plugins') ----- testPluginDoNotGenerateByPragma "A declaration should prevent code generation" | stsp m | stsp := SlangTestSupportPlugin inline: false. self assert: (SlangTestSupportPlugin canUnderstand: #doNotGenerateByPragma). m := stsp asCString: #doNotGenerateByPragma. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stsp asCString includesSubstring: 'doNotGenerateByPragma'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stsp asCString includesSubString: 'doNotGenerateByPragma'). self assert: (stsp doNotGenerateByPragma = 4) ! Item was changed: ----- Method: SlangTest>>testPluginDoNotGenerateSubclassResponsibility (in category 'testing base plugins') ----- testPluginDoNotGenerateSubclassResponsibility "If a method contains self subclassResponsibility, assume it is not meant for translation." | stsp m | stsp := SlangTestSupportPlugin inline: false. self assert: (SlangTestSupportPlugin canUnderstand: #anAbstractMethod). m := stsp asCString: #anAbstractMethod. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stsp asCString includesSubstring: 'anAbstractMethod'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stsp asCString includesSubString: 'anAbstractMethod'). self should: [stsp anAbstractMethod] raise: Error ! Item was changed: ----- Method: SlangTest>>testPluginMixedMethodAndPragmaDeclarations (in category 'testing base plugins') ----- testPluginMixedMethodAndPragmaDeclarations "Pragmas and method declarations should coexist" | stsp s | stsp := SlangTestSupportPlugin inline: false. s := (stsp asCString: #varDefByMethodAndPragma) copyReplaceAll: 'varDefByMethod' with: 'methodName'. + self assert: (self string: s includesSubstring: 'unsigned int * bar'). + self assert: (self string: s includesSubstring: 'char *foo'). + self assert: (self string: s includesSubstring: 'float baz'). + self assert: (self string: s includesSubstring: 'double fum'). - self assert: (s includesSubString: 'unsigned int * bar'). - self assert: (s includesSubString: 'char *foo'). - self assert: (s includesSubString: 'float baz'). - self assert: (s includesSubString: 'double fum'). ! Item was changed: ----- Method: SlangTest>>testSSIPDeclareStatic (in category 'testing ssip plugins') ----- testSSIPDeclareStatic "A static directive should cause the generated function to be declared static." | stss m1 p1 m2 p2 | stss := SlangTestSupportSSIP inline: false. m1 := (stss asCString: #declareStaticTrueByMethod) copyReplaceAll: 'declareStaticTrueByMethod' with: 'methodName'. p1 := (stss asCString: #declareStaticTrueByPragma) copyReplaceAll: 'declareStaticTrueByPragma' with: 'methodName'. self assert: m1 = p1. m2 := (stss asCString: #declareStaticFalseByMethod) copyReplaceAll: 'declareStaticFalseByMethod' with: 'methodName'. p2 := (stss asCString: #declareStaticFalseByPragma) copyReplaceAll: 'declareStaticFalseByPragma' with: 'methodName'. self assert: m2 = p2. "verify that the keyword 'static appears in the generated C source" + self assert: (self string: m1 includesSubstring: 'static'). + self assert: (self string: p1 includesSubstring: 'static'). + self deny: (self string: m2 includesSubstring: 'static'). + self deny: (self string: p2 includesSubstring: 'static') - self assert: (m1 includesSubString: 'static'). - self assert: (p1 includesSubString: 'static'). - self deny: (m2 includesSubString: 'static'). - self deny: (p2 includesSubString: 'static') ! Item was changed: ----- Method: SlangTest>>testSSIPDoNotGenerateByMethod (in category 'testing ssip plugins') ----- testSSIPDoNotGenerateByMethod "A doNotdoNotGenerate statement should prevent code generation" | stss m | stss := SlangTestSupportSSIP inline: false. self assert: (SlangTestSupportSSIP canUnderstand: #doNotGenerateByMethod). m := stss asCString: #doNotGenerateByMethod. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stss asCString includesSubstring: 'doNotGenerateByMethod'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stss asCString includesSubString: 'doNotGenerateByMethod'). self assert: (stss doNotGenerateByMethod = 4)! Item was changed: ----- Method: SlangTest>>testSSIPDoNotGenerateByPragma (in category 'testing ssip plugins') ----- testSSIPDoNotGenerateByPragma "A declaration should prevent code generation" | stss m | stss := SlangTestSupportSSIP inline: false. self assert: (SlangTestSupportSSIP canUnderstand: #doNotGenerateByPragma). m := stss asCString: #doNotGenerateByPragma. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stss asCString includesSubstring: 'doNotGenerateByPragma'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stss asCString includesSubString: 'doNotGenerateByPragma'). self assert: (stss doNotGenerateByPragma = 4) ! Item was changed: ----- Method: SlangTest>>testSSIPDoNotGenerateSubclassResponsibility (in category 'testing ssip plugins') ----- testSSIPDoNotGenerateSubclassResponsibility "If a method contains self subclassResponsibility, assume it is not meant for translation." | stss m | stss := SlangTestSupportSSIP inline: false. self assert: (SlangTestSupportSSIP canUnderstand: #anAbstractMethod). m := stss asCString: #anAbstractMethod. + self assert: (self string: m includesSubstring: 'No source has been generated'). + self deny: (self string: stss asCString includesSubstring: 'anAbstractMethod'). - self assert: (m includesSubString: 'No source has been generated'). - self deny: (stss asCString includesSubString: 'anAbstractMethod'). self should: [stss anAbstractMethod] raise: Error ! Item was changed: ----- Method: SlangTest>>testSSIPMixedMethodAndPragmaDeclarations (in category 'testing ssip plugins') ----- testSSIPMixedMethodAndPragmaDeclarations "Pragmas and method declarations should coexist" | stss s | stss := SlangTestSupportSSIP inline: false. s := (stss asCString: #varDefByMethodAndPragma) copyReplaceAll: 'varDefByMethod' with: 'methodName'. + self assert: (self string: s includesSubstring: 'unsigned int * bar'). + self assert: (self string: s includesSubstring: 'char *foo'). + self assert: (self string: s includesSubstring: 'float baz'). + self assert: (self string: s includesSubstring: 'double fum'). - self assert: (s includesSubString: 'unsigned int * bar'). - self assert: (s includesSubString: 'char *foo'). - self assert: (s includesSubString: 'float baz'). - self assert: (s includesSubString: 'double fum'). ! Item was changed: ----- Method: SlangTest>>testSetInstanceVariableWithAnAccessorMethod (in category 'testing intermediate variable removal') ----- testSetInstanceVariableWithAnAccessorMethod "Intermediate variable from parameter of accessor method should be removed. This is an existing limitation of the inliner, and could be improved for better code generation. It is not a bug." | stssi s | stssi := SlangTestSupportInterpreter inline: true. s := (stssi asCString: #setInstanceVariableWithAnAccessorMethod) copyReplaceAll: 'setInstanceVariableWithAnAccessorMethod' with: 'methodName'. + self deny: (self string: s includesSubstring: 'sqInt oop'). + self assert: (self string: s includesSubstring: 'aVariable = remap('). - self deny: (s includesSubString: 'sqInt oop'). - self assert: (s includesSubString: 'aVariable = remap('). "Should be translated to something similar to this: aVariable = remap(objectMemory, nilObj); Not like this: oop = remap(objectMemory, nilObj); aVariable = oop;" ! Item was changed: ----- Method: SmartSyntaxPluginSimulator>>computeSignatureFor:from: (in category 'initialize') ----- computeSignatureFor: selector from: tuple | signature | self assert: tuple first == #forMap. signature := tuple third collect: [:className| (Smalltalk classNamed: className) ifNil: [self error: 'Argument class' , className, ' does not exist'] + ifNotNilDo: - ifNotNil: [:argClass| argClass ccg: self prolog: true expr: [interpreterProxy primitiveFail] index: nil]]. ^signatureMap at: tuple second asSymbol put: { selector. signature. tuple fourth ifNil: [[:oop| oop]] + ifNotNilDo: - ifNotNil: [:rcvrClassSymbol| (Smalltalk classNamed: rcvrClassSymbol) ifNil: [self error: 'Receiver class' , rcvrClassSymbol, ' does not exist'] + ifNotNilDo: - ifNotNil: [:rcvrClass| rcvrClass ccg: self prolog: false expr: [interpreterProxy primitiveFail] index: nil]] }! Item was changed: ----- Method: SmartSyntaxPluginSimulator>>computeSignatureMap (in category 'initialize') ----- computeSignatureMap forMap := true. "true only while we compute the signatureMap" signatureMap := Dictionary new. actualPlugin class selectorsAndMethodsDo: [:s :m| (m messages includesAnyOf: #(primitive:parameters: primitive:parameters:receiver:)) ifTrue: [self getPrimitiveSignatureFor: s] ifFalse: + [(m pragmaAt: #export:) ifNotNilDo: - [(m pragmaAt: #export:) ifNotNil: [:exportPragma| (exportPragma argumentAt: 1) ifTrue: [self computeSignatureFor: s from: { #forMap. s. #(). nil }]]]]. forMap := false! Item was changed: ----- Method: StackInterpreter class>>declareCVarsIn: (in category 'translation') ----- declareCVarsIn: aCCodeGenerator self class == thisContext methodClass ifFalse: [^self]. "Don't duplicate decls in subclasses" aCCodeGenerator addHeaderFile:' /* for e.g. alloca */'; addHeaderFile:''; addHeaderFile:'"vmCallback.h"'. self declareInterpreterVersionIn: aCCodeGenerator defaultName: 'Stack'. aCCodeGenerator var: #interpreterProxy type: #'struct VirtualMachine*'. aCCodeGenerator declareVar: #sendTrace type: 'volatile int'; declareVar: #byteCount type: 'unsigned long'. "These need to be pointers or unsigned." self declareC: #(instructionPointer method newMethod) as: #usqInt in: aCCodeGenerator. "These are all pointers; char * because Slang has no support for C pointer arithmetic." self declareC: #(localIP localSP localFP stackPointer framePointer stackLimit stackMemory) as: #'char *' in: aCCodeGenerator. self declareC: #(stackPage overflowedPage) as: #'StackPage *' in: aCCodeGenerator. aCCodeGenerator removeVariable: 'stackPages'. "this is an implicit receiver in the translated code." aCCodeGenerator var: #methodCache declareC: 'long methodCache[MethodCacheSize + 1 /* ', (MethodCacheSize + 1) printString, ' */]'. aCCodeGenerator var: #atCache declareC: 'sqInt atCache[AtCacheTotalSize + 1 /* ', (AtCacheTotalSize + 1) printString, ' */]'. self primitiveTable do: [:symbolOrNot| (symbolOrNot isSymbol and: [symbolOrNot ~~ #primitiveFail]) ifTrue: + [(aCCodeGenerator methodNamed: symbolOrNot) ifNotNilDo: - [(aCCodeGenerator methodNamed: symbolOrNot) ifNotNil: [:tMethod| tMethod returnType: #void]]]. aCCodeGenerator var: #primitiveFunctionPointer declareC: 'void (*primitiveFunctionPointer)()'. aCCodeGenerator var: #showSurfaceFn type: #'void *'. aCCodeGenerator var: #jmpBuf declareC: 'jmp_buf jmpBuf[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. aCCodeGenerator var: #suspendedCallbacks declareC: 'usqInt suspendedCallbacks[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. aCCodeGenerator var: #suspendedMethods declareC: 'usqInt suspendedMethods[MaxJumpBuf + 1 /* ', (MaxJumpBuf + 1) printString, ' */]'. aCCodeGenerator var: #interruptCheckChain declareC: 'void (*interruptCheckChain)(void) = 0'. aCCodeGenerator var: #breakSelector type: #'char *'; var: #breakSelectorLength declareC: 'sqInt breakSelectorLength = -1'. self declareC: #(nextPollUsecs nextWakeupUsecs longRunningPrimitiveGCUsecs longRunningPrimitiveStartUsecs longRunningPrimitiveStopUsecs) as: #usqLong in: aCCodeGenerator. aCCodeGenerator var: #nextProfileTick type: #sqLong. aCCodeGenerator var: #primitiveTable declareC: 'void (*primitiveTable[' , (MaxPrimitiveIndex + 2) printString , '] )(void)= ' , self primitiveTableString. aCCodeGenerator var: #externalPrimitiveTable declareC: 'void (*externalPrimitiveTable[' , (MaxExternalPrimitiveTableSize + 1) printString , '])(void)'. ! Item was changed: ----- Method: StackInterpreter class>>table:from: (in category 'initialization') ----- table: anArray from: specArray "SpecArray is an array of one of (index selector) or (index1 index2 selector) or (index nil) or (index1 index2 nil). If selector then the entry is the selector, but if nil the entry is the index." | contiguous | contiguous := 0. specArray do: [:spec | (spec at: 1) = contiguous ifFalse: [self error: 'Non-contiguous table entry']. spec size = 2 ifTrue: [anArray at: (spec at: 1) + 1 + put: ((spec at: 2) ifNil: [spec at: 1] ifNotNilDo: [:sym| sym]). - put: ((spec at: 2) ifNil: [spec at: 1] ifNotNil: [:sym| sym]). contiguous := contiguous + 1] ifFalse: [(spec at: 1) to: (spec at: 2) do: + [:i | anArray at: i + 1 put: ((spec at: 3) ifNil: [i] ifNotNilDo: [:sym| sym])]. - [:i | anArray at: i + 1 put: ((spec at: 3) ifNil: [i] ifNotNil: [:sym| sym])]. contiguous := contiguous + ((spec at: 2) - (spec at: 1)) + 1]]! Item was changed: ----- Method: StackInterpreterSimulator>>run (in category 'testing') ----- run "Just run" quitBlock := [([transcript dependents anyOne outermostMorphThat: [:m| m isSystemWindow]] on: Error do: [:ex| nil]) + ifNotNilDo: [:window| (UIManager default confirm: 'close?') ifTrue: [window delete]]. - ifNotNil: [:window| (UIManager default confirm: 'close?') ifTrue: [window delete]]. ^self]. self initStackPages. self loadInitialContext. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self assertValidExecutionPointers. atEachStepBlock value. "N.B. may be nil" self dispatchOn: currentBytecode in: BytecodeTable. self incrementByteCount]. localIP := localIP - 1. "undo the pre-increment of IP before returning" self externalizeIPandSP! Item was changed: ----- Method: StackInterpreterSimulator>>runWithBreakCount: (in category 'testing') ----- runWithBreakCount: theBreakCount "Just run, halting when byteCount is reached" quitBlock := [(displayView notNil and: [UIManager default confirm: 'close?']) ifTrue: + [(displayView outermostMorphThat: [:m| m isSystemWindow]) ifNotNilDo: - [(displayView outermostMorphThat: [:m| m isSystemWindow]) ifNotNil: [:topWindow| topWindow delete]]. ^self]. breakCount := theBreakCount. self initStackPages. self loadInitialContext. self internalizeIPandSP. self fetchNextBytecode. [true] whileTrue: [self assertValidExecutionPointers. self dispatchOn: currentBytecode in: BytecodeTable. self incrementByteCount]. localIP := localIP - 1. "undo the pre-increment of IP before returning" self externalizeIPandSP! Item was changed: ----- Method: StackInterpreterSimulator>>utilitiesMenu: (in category 'UI') ----- utilitiesMenu: aMenuMorph aMenuMorph add: 'toggle transcript' action: #toggleTranscript; addLine; add: 'print ext head frame' action: #printExternalHeadFrame; add: 'print int head frame' action: #printHeadFrame; add: 'short print frame & callers' action: [self shortPrintFrameAndCallers: framePointer]; add: 'long print frame & callers' action: [self printFrameAndCallers: framePointer SP: stackPointer]; + add: 'print frame...' target: self action: [(self promptHex: 'print frame') ifNotNilDo: [:fp| self printFrame: fp]]; - add: 'print frame...' target: self action: [(self promptHex: 'print frame') ifNotNil: [:fp| self printFrame: fp]]; add: 'print call stack' action: #printCallStack; + add: 'print oop...' action: [(self promptHex: 'print oop') ifNotNilDo: [:oop| self printOop: oop]]; - add: 'print oop...' action: [(self promptHex: 'print oop') ifNotNil: [:oop| self printOop: oop]]; addLine; add: 'inspect object memory' target: objectMemory action: #inspect; add: 'inspect cointerpreter' action: #inspect; addLine; add: 'set break count...' action: #setBreakCount; add: (printSends ifTrue: ['no print sends'] ifFalse: ['print sends']) action: [self ensureDebugAtEachStepBlock. printSends := printSends not]; "currently printReturns does nothing" "add: (printReturns ifTrue: ['no print returns'] ifFalse: ['print returns']) action: [self ensureDebugAtEachStepBlock. printReturns := printReturns not];" add: (printBytecodeAtEachStep ifTrue: ['no print bytecode each bytecode'] ifFalse: ['print bytecode each bytecode']) action: [self ensureDebugAtEachStepBlock. printBytecodeAtEachStep := printBytecodeAtEachStep not]; add: (printFrameAtEachStep ifTrue: ['no print frame each bytecode'] ifFalse: ['print frame each bytecode']) action: [self ensureDebugAtEachStepBlock. printFrameAtEachStep := printFrameAtEachStep not]. ^aMenuMorph! Item was changed: ----- Method: TCaseStmtNode>>assumesCurrentBytecodeMatchesCaseValue: (in category 'as yet unclassified') ----- assumesCurrentBytecodeMatchesCaseValue: statementList "Test for the special case of certain methods that rely on the value of the currentBytecode variable to be expanded to a constant. This is a performance optimization that permits the next bytecode to be fetched early while not affecting the prior value of currentBytecode, which will have been translated to a constant. See senders of #'requires currentBytecode to be expanded to a constant' for methods that rely on this behavior." | trickySelectors commentString firstLine | trickySelectors := { #pushLiteralConstantBytecode . #pushLiteralVariableBytecode . #pushReceiverVariableBytecode . #pushTemporaryVariableBytecode . #storeAndPopTemporaryVariableBytecode . #storeAndPopReceiverVariableBytecode }. firstLine := statementList statements first. firstLine isComment ifTrue: [ commentString := firstLine asString. + trickySelectors detect: [:e | self string: commentString includesSubstring: e] - trickySelectors detect: [:e | commentString includesSubString: e] ifNone: [^ false]. ^ true]. ^ false! Item was changed: ----- Method: TMethod>>addTypeForSelf (in category 'utilities') ----- addTypeForSelf "If self should be typed then add a suitable type declaration. Preserve the flagging of an implicit self using the #implicit symbol as the fake type." + self typeForSelf ifNotNilDo: - self typeForSelf ifNotNil: [:typeForSelf| self declarationAt: 'self' put: (typeForSelf == #implicit ifTrue: [typeForSelf] ifFalse: [typeForSelf, ' self'])]! Item was changed: ----- Method: TMethod>>argConversionExprFor:stackIndex: (in category 'primitive compilation') ----- argConversionExprFor: varName stackIndex: stackIndex "Return the parse tree for an expression that fetches and converts the primitive argument at the given stack offset." | exprList decl stmtList | exprList := OrderedCollection new. (declarations includesKey: varName) ifTrue:[ decl := declarations at: varName. (decl includes: $*) ifTrue:["array" + (self string: decl includesSubstring: 'char') ifTrue:[ | expr | - (decl includesSubString: 'char') ifTrue:[ | expr | expr := '(interpreterProxy isBytes: (interpreterProxy stackValue: (stackIndex))) ifFalse:[^interpreterProxy primitiveFail].'. expr := expr copyReplaceAll: 'interpreterProxy' with: self vmNameString. expr := expr copyReplaceAll: 'stackIndex' with: stackIndex printString. exprList add: expr. ]. exprList add: varName , ' := ', self vmNameString, ' arrayValueOf: (', self vmNameString, ' stackValue: (' , stackIndex printString , '))'. exprList add: varName , ' := ' , varName , ' - 1'. ] ifFalse:["must be a double" (decl findString: 'double' startingAt: 1) = 0 ifTrue: [ self error: 'unsupported type declaration in a primitive method' ]. exprList add: varName , ' := ', self vmNameString, ' stackFloatValue: ' , stackIndex printString. ] ] ifFalse: ["undeclared variables are taken to be integer" exprList add: varName , ' := ', self vmNameString, ' stackIntegerValue: ' , stackIndex printString ]. stmtList := OrderedCollection new. exprList do: [:e | stmtList addAll: (self statementsFor: e varName: varName)]. ^ stmtList! Item was changed: ----- Method: TMethod>>emitCFunctionPrototype:generator:newlineBeforeName: (in category 'C code generation') ----- emitCFunctionPrototype: aStream generator: aCodeGen newlineBeforeName: newlineBeforeName "" "Emit a C function header for this method onto the given stream." export ifTrue:[aStream nextPutAll: 'EXPORT('; nextPutAll: returnType; nextPut: $)] ifFalse:[(self isStaticIn: aCodeGen) ifTrue:[aStream nextPutAll: 'static ']. aStream nextPutAll: returnType]. newlineBeforeName ifTrue: [aStream cr] ifFalse: [aStream space]. (returnType last = $) + and: [self string: returnType includesSubstring: (aCodeGen cFunctionNameFor: self selectorForCodeGeneration)]) ifTrue: - and: [returnType includesSubString: (aCodeGen cFunctionNameFor: self selectorForCodeGeneration)]) ifTrue: ["Hack fix for e.g. " ^self]. aStream nextPutAll: (aCodeGen cFunctionNameFor: self selectorForCodeGeneration); nextPut: $(. args isEmpty ifTrue: [aStream nextPutAll: #void] ifFalse: [args do: [:arg| aStream nextPutAll: (self declarationAt: arg)] separatedBy: [ aStream nextPutAll: ', ' ]]. aStream nextPut: $)! Item was changed: ----- Method: TMethod>>extractDirective:valueBlock:default: (in category 'transformations') ----- extractDirective: theSelector valueBlock: aBlock default: defaultResult "Find a pragma of the form: Answer the result of evaluating aBock with a TSendNode corresponding to the pragma node, or defaultResult if there is no matching pragma." | result found newStatements | + (properties at: theSelector ifAbsent: []) ifNotNilDo: - (properties at: theSelector ifAbsent: []) ifNotNil: [:pragma| ^aBlock value: (TSendNode new setSelector: pragma keyword receiver: (TVariableNode new setName: 'self') arguments: (pragma arguments collect: [:const| TConstantNode new setValue: const]))]. "Pre-pragma backward compatibility: Scan the top-level statements for a labelling directive of the form: self theSelector[args] and remove the directive from the method body if found. Answer the result of evaluating aBock with the send node, or defaultResult if there is no labelling directive." result := defaultResult. found := false. newStatements := OrderedCollection new: parseTree statements size. parseTree statements do: [ :stmt | (stmt isSend and: [stmt selector = theSelector]) ifTrue: [found := true. result := aBlock value: stmt] ifFalse: [newStatements add: stmt]]. ^found ifTrue: [parseTree setStatements: newStatements asArray. result] ifFalse: [defaultResult]! Item was changed: ----- Method: TMethod>>maybeBreakFor:in: (in category 'inlining') ----- maybeBreakFor: aNode in: aCodeGen "convenient for debugging..." (aNode isSend and: [(aCodeGen breakSrcInlineSelector notNil or: [aCodeGen breakDestInlineSelector notNil]) + and: [(aCodeGen breakSrcInlineSelector ifNil: [true] ifNotNilDo: [:srcSel| srcSel = aNode selector]) + and: [aCodeGen breakDestInlineSelector ifNil: [true] ifNotNilDo: [:dstSel| dstSel = selector]]]]) ifTrue: - and: [(aCodeGen breakSrcInlineSelector ifNil: [true] ifNotNil: [:srcSel| srcSel = aNode selector]) - and: [aCodeGen breakDestInlineSelector ifNil: [true] ifNotNil: [:dstSel| dstSel = selector]]]]) ifTrue: [self halt: selector]! Item was changed: ----- Method: TMethod>>superExpansionNodeFor:args: (in category 'inlining') ----- superExpansionNodeFor: aSelector args: argumentNodes "Answer the expansion of a super send. Merge the super expansion's locals, properties and comment into this method's properties." (definingClass superclass lookupSelector: aSelector) ifNil: [self error: 'superclass does not define super method'] + ifNotNilDo: - ifNotNil: [:superMethod| | superTMethod commonVars varMap | superTMethod := superMethod methodNode asTranslationMethodOfClass: self class. ((argumentNodes allSatisfy: [:parseNode| parseNode isVariableNode]) and: [(argumentNodes asOrderedCollection collect: [:parseNode| parseNode key]) = superTMethod args]) ifFalse: [self error: definingClass name, '>>',selector, ' args ~= ', superTMethod definingClass name, '>>', aSelector, (String with: $. with: Character cr), 'For super expansions to be translated correctly each argument must be a variable with the same name as the corresponding argument in the super method.']. self mergePropertiesOfSuperMethod: superTMethod. (commonVars := superTMethod locals intersection: self locals) notEmpty ifTrue: [varMap := Dictionary new. commonVars do: [:k| varMap at: k put: (superTMethod unusedNamePrefixedBy: k avoiding: self allLocals)]. superTMethod renameVariablesUsing: varMap]. self assert: (superTMethod locals allSatisfy: [:var| (self locals includes: var) not]). locals addAll: superTMethod locals. superTMethod declarations keysAndValuesDo: [:var :decl| self declarationAt: var put: decl]. + superTMethod comment ifNotNilDo: - superTMethod comment ifNotNil: [:superComment| comment := comment ifNil: [superComment] + ifNotNilDo: [superComment, comment]]. + superTMethod extraVariableNumber ifNotNilDo: - ifNotNil: [superComment, comment]]. - superTMethod extraVariableNumber ifNotNil: [:scvn| extraVariableNumber := extraVariableNumber ifNil: [scvn] ifNotNil: [:cvn| cvn + scvn]]. superTMethod elideAnyFinalReturn. ^superTMethod parseTree]! Item was changed: ----- Method: TMethod>>tryToInlineMethodsIn: (in category 'inlining') ----- tryToInlineMethodsIn: aCodeGen "Expand any (complete) inline methods called by this method. Set the complete bit when all inlining has been done. Return true if something was inlined." | stmtLists didSomething newStatements sendsToInline | self definedAsMacro ifTrue: [complete := true. ^false]. didSomething := false. sendsToInline := Dictionary new: 100. parseTree nodesDo: [:node| (self inlineableFunctionCall: node in: aCodeGen) ifTrue: [sendsToInline at: node put: (self inlineFunctionCall: node in: aCodeGen)]] unless: "Don't inline the arguments to asserts to keep the asserts readable" [:node| node isSend and: [aCodeGen isAssertSelector: node selector]]. sendsToInline isEmpty ifFalse: [didSomething := true. self removeUnreferencedDeclarations. parseTree := parseTree replaceNodesIn: sendsToInline]. didSomething ifTrue: [writtenToGlobalVarsCache := nil. ^didSomething]. stmtLists := self statementsListsForInliningIn: aCodeGen. stmtLists do: [:stmtList| newStatements := OrderedCollection new: 100. stmtList statements do: [:stmt| (self inlineCodeOrNilForStatement: stmt in: aCodeGen) ifNil: [newStatements addLast: stmt] + ifNotNilDo: [:inlinedStmts| - ifNotNil: [:inlinedStmts| didSomething := true. newStatements addAllLast: inlinedStmts]]. stmtList setStatements: newStatements asArray]. didSomething ifTrue: [writtenToGlobalVarsCache := nil. ^didSomething]. complete ifFalse: [self checkForCompleteness: stmtLists in: aCodeGen. complete ifTrue: [ didSomething := true ]]. "marking a method complete is progress" ^didSomething! Item was changed: ----- Method: TSendNode>>isStructSend: (in category 'testing') ----- isStructSend: aCodeGen "Answer if the recever is a send of a structure accessor. This is tricky. We want foo bar => foo->bar foo bar => foo.bar foo bar: expr => foo->bar = expr foo bar: expr => foo.bar = expr depending on whether foo is a struct or a pointer to a struct, but only if both foo is a struct type and bar is a field accessor. The tricky cases are self-sends within struct class methods. Here we need to distinguish between self-sends of ordinary methods from self sends of accessors." ^arguments size <= 1 and: [(receiver structTargetKind: aCodeGen) notNil and: [(aCodeGen methodNamed: selector) ifNil: [false] + ifNotNilDo: [:method| method isStructAccessor]]]! - ifNotNil: [:method| method isStructAccessor]]]! Item was changed: ----- Method: TSendNode>>isStructSendIn: (in category 'testing') ----- isStructSendIn: aCodeGen "Answer if the recever is a send of a structure accessor. This is tricky. We want foo bar => foo->bar foo bar => foo.bar foo bar: expr => foo->bar = expr foo bar: expr => foo.bar = expr depending on whether foo is a struct or a pointer to a struct, but only if both foo is a struct type and bar is a field accessor. The tricky cases are self-sends within struct class methods. Here we need to distinguish between self-sends of ordinary methods from self sends of accessors." ^arguments size <= 1 and: [(receiver structTargetKindIn: aCodeGen) notNil and: [(aCodeGen methodNamed: selector) ifNil: [false] + ifNotNilDo: [:method| method isStructAccessor]]]! - ifNotNil: [:method| method isStructAccessor]]]! Item was changed: ----- Method: TSendNode>>structTargetKindIn: (in category 'testing') ----- structTargetKindIn: aCodeGen "Answer if the recever evaluates to a struct or struct pointer and hence can be dereferenced using . or ->. Answer any of #struct #pointer or nil. Right now we don't need or support structure return so this method answers either #pointer or nil." selector == #cCoerceSimple:to: ifTrue: [^(VMStructType isTypePointerToStruct: arguments last value) ifTrue: [#pointer]]. selector == #addressOf: ifTrue: [^#pointer]. selector == #at: ifTrue: [receiver isVariable ifTrue: + [(aCodeGen typeOfVariable: receiver name) ifNotNilDo: - [(aCodeGen typeOfVariable: receiver name) ifNotNil: [:type| | derefType | type last = $* ifFalse: [^receiver structTargetKindIn: aCodeGen]. (VMStructType isTypeStruct: (aCodeGen extractTypeFor: receiver name fromDeclaration: type allButLast)) ifTrue: [^#struct]]]. + (receiver structTargetKindIn: aCodeGen) ifNotNilDo: - (receiver structTargetKindIn: aCodeGen) ifNotNil: [:kind| ^kind]]. (aCodeGen selectorReturnsPointerToStruct: selector) ifTrue: [^#pointer]. (aCodeGen selectorReturnsStruct: selector) ifTrue: [^#struct]. ^nil! Item was changed: ----- Method: VMMaker class>>forceNewFileNamed: (in category 'utilities') ----- + forceNewFileNamed: fileName + "Use CrLfFileStream for older images such as Squeak 3.6, or MultiByteFileStream + if CrLfFileStream is no longer present. LrLfFileStream is first choice because + forceNewFileNamed: was a late addition to MultiByteFileStream." - forceNewFileNamed: aFilename - "Always output files in unix lf format. - A single format is friendlier to e.g. external version control systems. - The Microsoft and old MacOS classic C compilers all accept lf format files." + (Smalltalk classNamed: 'CrLfFileStream') + ifNotNilDo: [ :crlf | ^ crlf forceNewFileNamed: fileName ]. + (Smalltalk classNamed: 'MultiByteFileStream') + ifNotNilDo: [ :cls | ^ ((cls forceNewFileNamed: fileName) lineEndConvention: #lf; yourself) ]. + ! - ^(MultiByteFileStream forceNewFileNamed: aFilename) - lineEndConvention: #lf; - yourself! Item was changed: ----- Method: VMMakerTool>>entryRowWithLabel:labelWidth:balloonText:getFieldText:setFieldText:buttonLabel:buttonAction:buttonBalloonText: (in category 'window construction') ----- entryRowWithLabel: label labelWidth: lWidth balloonText: balloonText getFieldText: getTextSelector setFieldText: setTextSelector buttonLabel: buttonLabel buttonAction: buttonAction buttonBalloonText: buttonBalloonText | row tm | row := Morph new color: Color transparent; hResizing: #spaceFill; vResizing: #spaceFill; extent: 550 @ 40; layoutPolicy: ProportionalLayout new; borderWidth: 2; setBalloonText: balloonText translated; yourself. row addMorph: (TextMorph new contents: label translated asText allBold) lock fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 0 @ 1) offsets: (3 @ 3 corner: lWidth @ -3)). row addMorph: ((tm := PluggableTextMorph on: self text: getTextSelector + accept: setTextSelector) acceptOnCR: true) - accept: setTextSelector) hideVScrollBarIndefinitely: true; - acceptOnCR: true) fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1) offsets: (lWidth + 10 @ 0 corner: (lWidth / 1.8 + 10) negated @ 0)). "Make the background a solid color so that eventual bleed from the labels doesn't make the entire input field unreadable. Happens when the bold font is significantly wider than the non-bold font or when the spacing of the font doesn't match the guess above" tm color: (Color gray: 0.9). buttonAction ifNotNil: [row addMorph: (SimpleButtonMorph new target: self; label: buttonLabel translated; actionSelector: buttonAction; hResizing: #spaceFill; setBalloonText: buttonBalloonText translated) fullFrame: (LayoutFrame fractions: (1 @ 0 corner: 1 @ 1) offsets: ((lWidth / 1.8 + 5) negated @ 3 corner: -5 @ -3))]. ^ row! Item was changed: ----- Method: VMStructType class>>checkGenerateFieldAccessors:bitPosition:in: (in category 'code generation') ----- checkGenerateFieldAccessors: fieldSpecs bitPosition: firstBitPosition in: surrogateClass | bitPosition alignedByteSize | bitPosition := firstBitPosition. fieldSpecs do: [:spec| | code | "If the accessor is already defined in a superclass don't redefine it in the subclass. We assume it is correctly defined in the superclass." (spec first ~= #unused and: [(surrogateClass whichClassIncludesSelector: spec first asSymbol) ifNil: [true] + ifNotNilDo: [:implementingClass| - ifNotNil: [:implementingClass| self assert: (implementingClass inheritsFrom: Object). implementingClass == surrogateClass]]) ifTrue: [code := self getter: spec first bitPosition: bitPosition bitWidth: spec second bool: (spec at: 3 ifAbsent: []) = #Boolean. code ~= (surrogateClass sourceCodeAt: spec first asSymbol ifAbsent: ['']) asString ifTrue: [surrogateClass compile: code classified: #accessing]. code := self setter: spec first bitPosition: bitPosition bitWidth: spec second bool: (spec at: 3 ifAbsent: []) = #Boolean. code ~= (surrogateClass sourceCodeAt: (spec first, ':') asSymbol ifAbsent: ['']) asString ifTrue: [surrogateClass compile: code classified: #accessing]]. bitPosition := bitPosition + spec second]. alignedByteSize := bitPosition / 8. self assert: alignedByteSize isInteger. alignedByteSize ~= surrogateClass alignedByteSize ifTrue: [surrogateClass class compile: 'alignedByteSize' , (String with: Character cr with: Character tab with: $^) , alignedByteSize printString classified: #accessing]! Item was changed: ----- Method: VMStructType class>>needsTypeTag (in category 'translation') ----- needsTypeTag self instVarNamesAndTypesForTranslationDo: [:ivn :type| + (self string: (type isArray ifTrue: [type first] ifFalse: [type]) includesSubstring: self structTagName) ifTrue: - ((type isArray ifTrue: [type first] ifFalse: [type]) includesSubString: self structTagName) ifTrue: [^true]]. ^false! From leves at caesar.elte.hu Mon Nov 23 04:50:12 2020 From: leves at caesar.elte.hu (Levente Uzonyi) Date: Mon, 23 Nov 2020 05:50:12 +0100 (CET) Subject: [Vm-dev] Another NuScratch issue In-Reply-To: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> References: <92B39CC3-A573-4BC2-B73C-F54138FF6DED@gmail.com> Message-ID: On Sat, 21 Nov 2020, Eliot Miranda wrote: > Hi Yoshiki, > > Levente replaced the select code with epoll code on Linux a fey weeks > ago. Maybe there’s a regression. That is indeed the culprit. epoll_wait expects the timeout in milliseconds but the value is in microseconds. Unfortunately, fixing that brings back the old increased cpu usage. Levente From commits at source.squeak.org Mon Nov 23 05:40:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 23 Nov 2020 05:40:09 0000 Subject: [Vm-dev] VM Maker: Cog-eem.428.mcz Message-ID: Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.428.mcz ==================== Summary ==================== Name: Cog-eem.428 Author: eem Time: 22 November 2020, 9:40:06.97214 pm UUID: ce3f36e8-89b5-4ce8-8636-8a967ae4d08a Ancestors: Cog-eem.427 Separating from MultiProcessor. =============== Diff against Cog-eem.427 =============== Item was changed: Object subclass: #MultiProcessor instanceVariableNames: 'mutex processor guardedProcessorProtocol unguardedProcessorProtocol owner registerState coInterpreter threadIndex cogit' classVariableNames: '' poolDictionaries: '' category: 'Cog-Processors'! + + !MultiProcessor commentStamp: 'eem 11/22/2020 21:28' prior: 0! + A MultiProcessor is a hack for implementing a multi-processor above a single processor simulation. It is an expensive anachronism, now being replaced by simpler code in CogThreadManager>>releaseVM and CogThreadManager>>tryLockVMOwnerTo:. Never the less it has some interesting and potentially useful exception handling code in its doesNotUnderatand: method so we keep it for reference. + + Instance Variables + coInterpreter: + cogit: + guardedProcessorProtocol: + mutex: + owner: + processor: + registerState: + threadIndex: + unguardedProcessorProtocol: + + coInterpreter + - xxxxx + + cogit + - xxxxx + + guardedProcessorProtocol + - xxxxx + + mutex + - xxxxx + + owner + - xxxxx + + processor + - xxxxx + + registerState + - xxxxx + + threadIndex + - xxxxx + + unguardedProcessorProtocol + - xxxxx + ! From commits at source.squeak.org Mon Nov 23 05:46:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 23 Nov 2020 05:46:15 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2894.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2894.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2894 Author: eem Time: 22 November 2020, 9:46:07.518953 pm UUID: 6c77c06e-a17e-4dcf-85d9-90943dd5eae8 Ancestors: VMMaker.oscog-eem.2893 MTVM: Separate from MultiProcessor. Have CogThreadManager>>releaseVM & tryLockVMOwnerTo: simulate thread switches, since these are effectively the only places they occur in this simple threading scheme. The full complexity of MultiProcessor isn't needed. To make this work change all senders of tryLockVMOwnerTo: to invoke CogThreadManager's simulation-only wrapper around Cogit>>tryLockVMOwnerTo:. Simplify and correct checks and initialization of the processor's thread-specific stack pointers. Provide a multi-threaded version of primtRumpCStack that prints the individual stacks for active threads. =============== Diff against VMMaker.oscog-eem.2893 =============== Item was changed: ----- Method: CoInterpreter>>assertValidExternalStackPointers (in category 'debug support') ----- assertValidExternalStackPointers + "For use *ONLY* by routines coming in to the VM, + i.e. handleCallOrJumpSimulationTrap:. This is because it nils localFP as a side-effect, + and it does so so that the head frame can be determined reliably." - i.e. handleCallOrJumpSimulationTrap:. This is because it nils localFP as a side-effect." self assert: framePointer < stackPage baseAddress. self assert: stackPointer < framePointer. self assert: framePointer > stackPointer. self assert: stackPointer >= (stackPage realStackLimit - self stackLimitOffset). localFP := nil! Item was removed: - ----- Method: CoInterpreter>>setFramePointer:stackPointer:for: (in category 'initialization') ----- - setFramePointer: cFramePointer stackPointer: cStackPointer for: processor - - processor - setFramePointer: (self setCFramePointer: cFramePointer) - stackPointer: (self setCStackPointer: cStackPointer)! Item was changed: ----- Method: CoInterpreterMT>>assertCStackPointersBelongToCurrentThread (in category 'simulation') ----- assertCStackPointersBelongToCurrentThread + "simulation only" - "simulation only" | ownerIndex range | self assert: (ownerIndex := cogThreadManager getVMOwner) > 0. + range := self cStackRangeForThreadIndex: ownerIndex. + self assert: ((range includes: CFramePointer) and: [range includes: CStackPointer])! - self assert: ((range := self cStackRangeForThreadIndex: ownerIndex) includes: CFramePointer). - self assert: (range includes: CStackPointer)! Item was added: + ----- Method: CoInterpreterMT>>assertProcessorStackPointersBelongToCurrentThread (in category 'simulation') ----- + assertProcessorStackPointersBelongToCurrentThread + "simulation only" + | ownerIndex range | + self assert: (ownerIndex := cogThreadManager getVMOwner) > 0. + range := self cStackRangeForThreadIndex: ownerIndex. + self assert: ((range includes: cogit processor fp) and: [range includes: cogit processor sp])! Item was changed: ----- Method: CoInterpreterMT>>enterSmalltalkExecutiveImplementation (in category 'initialization') ----- enterSmalltalkExecutiveImplementation "Main entry-point into the interpreter at each execution level, where an execution level is either the start of execution or reentry for a callback. Capture the C stack pointers so that calls from machine-code into the C run-time occur at this level. This is the actual implementation, separated from enterSmalltalkExecutive so the simulator can wrap it in an exception handler and hence simulate the setjmp/longjmp. Override to return if a longjmp to reenterInterpreter passes a parameter greater than 1. This causes a return to threadSchedulingLoop:startingVM: and is used to surrender control to another thread." self assertSaneThreadAndProcess. + self assertProcessorStackPointersBelongToCurrentThread. "At this point CFramePointer/CStackPointer have yet to be assigned". ^super enterSmalltalkExecutiveImplementation! Item was changed: ----- Method: CoInterpreterMT>>returnToSchedulingLoopAndReleaseVMOrWakeThread:source: (in category 'process primitive support') ----- returnToSchedulingLoopAndReleaseVMOrWakeThread: vmThread source: source - self cCode: - [self flag: 'this is just for debugging. Note the current C stack pointers'. - cogThreadManager currentVMThread - cStackPointer: CStackPointer; - cFramePointer: CFramePointer] - inSmalltalk: - [| range | range := self cStackRangeForThreadIndex: cogThreadManager getVMOwner. - self assert: ((range includes: CStackPointer) and: [range includes: CFramePointer])]. self recordThreadSwitchTo: (vmThread ifNotNil: [vmThread index] ifNil: [0]) source: source. vmThread ifNotNil: [cogThreadManager wakeVMThreadFor: vmThread index] ifNil: [cogThreadManager releaseVM]. "I am not frightened of flying. Any value will do. I don't mind. Why should I be frightened of flying? There's no reason for it." self _longjmp: reenterThreadSchedulingLoop _: 1 ! Item was removed: - ----- Method: CoInterpreterMT>>setFramePointer:stackPointer:for: (in category 'initialization') ----- - setFramePointer: cFramePointer stackPointer: cStackPointer for: processor - - self flag: #design. - CFramePointer ifNil: - [self setCFramePointer: cFramePointer; setCStackPointer: cStackPointer]. - processor - setFramePointer: cFramePointer - stackPointer: cStackPointer! Item was changed: ----- Method: CoInterpreterMT>>threadSchedulingLoop: (in category 'vm scheduling') ----- threadSchedulingLoop: vmThread "Enter a loop attempting to run the VM with the highest priority process and blocking on the thread's OS semaphore when unable to run that process. This version is for simulation only, simulating the longjmp back to the real threadSchedulingLoopImplementation: through exception handling." + cogit initializeProcessorStack: (self cStackRangeForThreadIndex: vmThread index) last. - self initializeProcessorForThreadIndex: vmThread index. [[self threadSchedulingLoopImplementation: vmThread] on: ReenterThreadSchedulingLoop do: [:ex| self assert: ex returnValue = 1. ex return: true]] whileTrue! Item was added: + ----- Method: CogThreadManager>>ensureInitializedProcessor:forThreadIndex: (in category 'simulation') ----- + ensureInitializedProcessor: aProcessor forThreadIndex: threadIndex + "Ensure aProcessor has stack pointers within its defined range, initializing it if not." + + | range | + range := coInterpreter cStackRangeForThreadIndex: threadIndex. + self assert: (range includes: aProcessor fp) = (range includes: aProcessor sp). + ((range includes: aProcessor fp) and: [range includes: aProcessor sp]) ifFalse: + [aProcessor smashCallerSavedRegistersWithValuesFrom: 16r90000000 by: coInterpreter objectMemory wordSize / 2. + cogit initializeProcessorStack: range last]! Item was changed: ----- Method: CogThreadManager>>releaseVM (in category 'public api') ----- releaseVM + "In the simulation this is where register state is saved; it is switched in tryLockVMOwnerTo:." + self cCode: [] inSmalltalk: + [vmOwner ~= 0 ifTrue: + [registerStates at: vmOwner put: cogit processor registerState]]. self setVMOwner: 0! Item was added: + ----- Method: CogThreadManager>>threadsDo: (in category 'simulation') ----- + threadsDo: aBlock + 1 to: numThreads do: + [:i| + (threads at: i) ifNotNil: + [:thread| aBlock value: thread]]! Item was changed: ----- Method: CogThreadManager>>tryLockVMOwnerTo: (in category 'simulation') ----- + tryLockVMOwnerTo: threadIndex - tryLockVMOwnerTo: value "In the real VM this is a direct call of Cogit>>#tryLockVMOwnerTo:/ceTryLockVMOwner. + In the simulation this is where register state is saved and switched, simulaitng a thread switch. + releaseVM also saves register state. The code here and in registerState allow us to avoid the + expensive and complex MultiProcessor hack." - In the simulation this is where we save and switch register state." + | prior processor result | + self deny: threadIndex = 0. - | current post prior processor | processor := cogit processor. prior := processor registerState. + "A thread switch would (have) occur(ed) if it were that the VM were owned other than by threadIndex" + vmOwner ~= threadIndex ifTrue: + [vmOwner ~= 0 ifTrue: + [registerStates at: vmOwner put: prior]. + processor setRegisterState: (registerStates + at: threadIndex + ifAbsentPut: + [self ensureInitializedProcessor: processor forThreadIndex: threadIndex. + processor registerState])]. + result := cogit tryLockVMOwnerTo: threadIndex. + self assert: result = (threadIndex = vmOwner). + registerStates at: threadIndex put: processor registerState. + threadIndex ~= vmOwner ifTrue: "the lock attempt failed; undo the (processor) thread switch." + [processor setRegisterState: prior]. + ^result! - vmOwner ~= 0 ifTrue: - [registerStates at: vmOwner put: prior]. - (cogit tryLockVMOwnerTo: value) ifFalse: - [^false]. - post := processor registerState. - current := registerStates - at: vmOwner - ifAbsentPut: - [self assert: vmOwner = value. - processor voidRegisterState; registerState]. - 1 to: prior size do: - [:i| | neuf | - (prior at: i) ~= (neuf := post at: i) ifTrue: - [current at: i put: neuf]]. - cogit processor setRegisterState: current. - ^true! Item was changed: ----- Method: CogVMSimulator>>ownVM: (in category 'debugging traps') ----- ownVM: threadIndexAndFlags "This method includes or excludes CoInterpreterMT methods as required. Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" + "(threadIndexAndFlags anyMask: DisownVMForProcessorRelinquish << DisownFlagsShift) ifFalse: + [self break]." - (threadIndexAndFlags anyMask: DisownVMForProcessorRelinquish << DisownFlagsShift) ifFalse: - [self break]. ^self perform: #ownVM: withArguments: {threadIndexAndFlags} inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was changed: ----- Method: CogVMSimulator>>printRumpCStack (in category 'rump c stack') ----- printRumpCStack + cogThreadManager ifNil: + [^self printRumpCStackTo: heapBase - objectMemory wordSize]. + cogThreadManager threadsDo: + [:thread| self printRumpCStackForThread: thread]! - self printRumpCStackTo: heapBase - objectMemory wordSize! Item was added: + ----- Method: CogVMSimulator>>printRumpCStackForThread: (in category 'rump c stack') ----- + printRumpCStackForThread: thread + | range start coldTop | + range := self cStackRangeForThreadIndex: thread index. + start := range first bitClear: objectMemory tagMask. + coldTop := range last. + [start < coldTop and: [(objectMemory longAt: start) = 0]] whileTrue: + [start := start + objectMemory wordSize]. + (start = coldTop and: [(objectMemory longAt: start) = 0]) ifTrue: + [^self]. + start := start - (2 * objectMemory wordSize) max: range start. + transcript nextPutAll: 'thread '; print: thread index; cr. + self printRumpCStackFrom: start to: coldTop cfp: thread cFramePointer csp: thread cStackPointer. + range first < start ifTrue: + [self print: 'zeros...'; cr]! Item was added: + ----- Method: CogVMSimulator>>printRumpCStackFrom:to:cfp:csp: (in category 'rump c stack') ----- + printRumpCStackFrom: start to: address cfp: cfp csp: csp + address + to: start + by: objectMemory wordSize negated + do: [:addr| | label | + self printHex: addr. + addr = cogit processor sp ifTrue: [label := ' sp']. + addr = cogit processor fp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'fp']. + addr = csp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'CSP']. + addr = cfp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'CFP']. + label ifNil: [self tab] ifNotNil: [self print: ' ', label, '->']. + self tab; printHex: (objectMemory longAt: addr); cr]! Item was changed: ----- Method: CogVMSimulator>>printRumpCStackTo: (in category 'rump c stack') ----- printRumpCStackTo: address | start | self assert: (self isOnRumpCStack: address). start := heapBase - self rumpCStackSize. [start < address and: [(objectMemory longAt: start) = 0]] whileTrue: [start := start + objectMemory wordSize]. start := start - (3 * objectMemory wordSize) max: heapBase - self rumpCStackSize. + self printRumpCStackFrom: start to: address cfp: CFramePointer csp: CStackPointer. - address - to: start - by: objectMemory wordSize negated - do: [:addr| | label | - self printHex: addr. - addr = cogit processor sp ifTrue: [label := ' sp']. - addr = cogit processor fp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'fp']. - addr = CStackPointer ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'CSP']. - addr = CFramePointer ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'CFP']. - label ifNil: [self tab] ifNotNil: [self print: ' ', label, '->']. - self tab; printHex: (objectMemory longAt: addr); cr]. heapBase - self rumpCStackSize < start ifTrue: [self print: 'zeros...'; cr]! Item was removed: - ----- Method: CogVMSimulator>>setFramePointer:stackPointer:for: (in category 'multi-threading simulation switch') ----- - setFramePointer: cFramePointer stackPointer: cStackPointer for: processor - "This method includes or excludes CoInterpreterMT methods as required. - Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" - - ^self perform: #setFramePointer:stackPointer:for: - withArguments: {cFramePointer. cStackPointer. processor} - inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was changed: ----- Method: Cogit>>ceCaptureCStackPointers (in category 'jit - api') ----- ceCaptureCStackPointers - | range | coInterpreter isCurrentImageFacade ifTrue: [^self]. self simulateLeafCallOf: ceCaptureCStackPointers. thisContext sender selector == #generateStackPointerCapture ifTrue: [^self]. coInterpreter isThreadedVM ifTrue: + [coInterpreter assertProcessorStackPointersBelongToCurrentThread]! - [range := coInterpreter cStackRangeForThreadIndex: coInterpreter threadManager getVMOwner. - self assert: (range notNil "VM is owned" - and: [(range includes: coInterpreter getCFramePointer) - and: [range includes: coInterpreter getCStackPointer]])]! Item was changed: ----- Method: Cogit>>initializeProcessorStack: (in category 'initialization') ----- initializeProcessorStack: rumpCStackAddress "Initialize the simulation processor's stack pointers, arranging that they are somewhere on the rump C stack." | stackPad cFramePointer cStackPointer | stackPad := 64 max: cStackAlignment. cStackPointer := rumpCStackAddress - stackPad + expectedSPAlignment. cFramePointer := rumpCStackAddress - stackPad + cStackAlignment + expectedFPAlignment. self assert: cStackPointer \\ cStackAlignment = expectedSPAlignment. self assert: cFramePointer \\ cStackAlignment = expectedFPAlignment. + processor setFramePointer: cFramePointer stackPointer: cStackPointer! - coInterpreter setFramePointer: cFramePointer stackPointer: cStackPointer for: processor! Item was removed: - ----- Method: CurrentImageCoInterpreterFacade>>setFramePointer:stackPointer:for: (in category 'accessing') ----- - setFramePointer: cFramePointer stackPointer: cStackPointer for: processor - ^coInterpreter setFramePointer: cFramePointer stackPointer: cStackPointer for: processor! From noreply at github.com Mon Nov 23 18:30:14 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 23 Nov 2020 10:30:14 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] d424c8: Allow Mac builds to use whatever the installed SDK... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: d424c8e49346914b5dfa80341108d990b2df636b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d424c8e49346914b5dfa80341108d990b2df636b Author: Eliot Miranda Date: 2020-11-23 (Mon, 23 Nov 2020) Changed paths: M build.macos32x86/common/Makefile.flags M build.macos64ARMv8/common/Makefile.flags M build.macos64x64/common/Makefile.flags Log Message: ----------- Allow Mac builds to use whatever the installed SDK is. Bump the minimum supported target up to 10.9 (Mavericks). From noreply at github.com Mon Nov 23 18:47:06 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 23 Nov 2020 10:47:06 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a49b21: Add commentary to the Mac Makefiles on how to unlo... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a49b2135dc336c2efe3ae5a81b61aa689d9ff122 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a49b2135dc336c2efe3ae5a81b61aa689d9ff122 Author: Eliot Miranda Date: 2020-11-23 (Mon, 23 Nov 2020) Changed paths: M build.macos32x86/common/Makefile.app M build.macos64ARMv8/common/Makefile.app M build.macos64x64/common/Makefile.app Log Message: ----------- Add commentary to the Mac Makefiles on how to unlock one's keychain when using ssh. [ci skip] From builds at travis-ci.org Mon Nov 23 20:07:05 2020 From: builds at travis-ci.org (Travis CI) Date: Mon, 23 Nov 2020 20:07:05 +0000 Subject: [Vm-dev] Errored: OpenSmalltalk/opensmalltalk-vm#2312 (Cog - d424c8e) In-Reply-To: Message-ID: <5fbc16693c222_13f9f355c5df01147b6@travis-tasks-6df5d8dd64-zdm7g.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2312 Status: Errored Duration: 1 hr, 35 mins, and 28 secs Commit: d424c8e (Cog) Author: Eliot Miranda Message: Allow Mac builds to use whatever the installed SDK is. Bump the minimum supported target up to 10.9 (Mavericks). View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/bd18c0e86619...d424c8e49346 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/745479458?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Nov 23 20:24:55 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 23 Nov 2020 20:24:55 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2316 Message-ID: <20201123202455.1.2A20454D489446E3@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Tue Nov 24 02:15:25 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Tue, 24 Nov 2020 02:15:25 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2895.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2895.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2895 Author: eem Time: 23 November 2020, 6:15:14.771492 pm UUID: b23435ec-e114-4c55-9349-24ab4b95baec Ancestors: VMMaker.oscog-eem.2894 Avoid really ugly generated code for InterpreterPlugin>>sizeField:. =============== Diff against VMMaker.oscog-eem.2894 =============== Item was changed: ----- Method: InterpreterPlugin>>sizeField: (in category 'alien support') ----- sizeField: alienOop "Answer the size field of an alienOop which is assumed to be an Alien of at least 8 bytes (32-bits) or 16 bytes (64 bits)" + ^self cCode: + [self longAt: alienOop + interpreterProxy baseHeaderSize] + inSmalltalk: + [| field | + field := interpreterProxy longAt: alienOop + interpreterProxy baseHeaderSize. + interpreterProxy wordSize = 8 + ifTrue: [field signedIntFromLong64] + ifFalse: [field signedIntFromLong]]! - ^interpreterProxy wordSize = 8 - ifTrue: [(interpreterProxy longAt: alienOop + interpreterProxy baseHeaderSize) signedIntFromLong64] - ifFalse: [(interpreterProxy longAt: alienOop + interpreterProxy baseHeaderSize) signedIntFromLong]! From noreply at github.com Tue Nov 24 02:20:53 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 23 Nov 2020 18:20:53 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 79188a: CogVM source as per VMMaker.oscog-eem.2895 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 79188a3c8dbf80dcf71a99d752f5c925e653be2e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/79188a3c8dbf80dcf71a99d752f5c925e653be2e Author: Eliot Miranda Date: 2020-11-23 (Mon, 23 Nov 2020) Changed paths: M src/plugins/BochsIA32Plugin/BochsIA32Plugin.c M src/plugins/BochsX64Plugin/BochsX64Plugin.c M src/plugins/GdbARMPlugin/GdbARMPlugin.c M src/plugins/GdbARMv8Plugin/GdbARMv8Plugin.c M src/plugins/IA32ABI/IA32ABI.c M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c M src/plugins/SqueakFFIPrims/ARM64FFIPlugin.c M src/plugins/SqueakFFIPrims/IA32FFIPlugin.c M src/plugins/SqueakFFIPrims/X64SysVFFIPlugin.c M src/plugins/SqueakFFIPrims/X64Win64FFIPlugin.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2895 Avoid really ugly generated code for InterpreterPlugin>>sizeField:. From noreply at github.com Tue Nov 24 02:30:35 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 23 Nov 2020 18:30:35 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 529937: Avoid Big Sur refusal to compile when macosx-versi... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 529937d09cdb1c296ed7bfb56f5de55a7c94941f https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/529937d09cdb1c296ed7bfb56f5de55a7c94941f Author: Eliot Miranda Date: 2020-11-23 (Mon, 23 Nov 2020) Changed paths: M platforms/iOS/plugins/CameraPlugin/AVFoundationVideoGrabber.m Log Message: ----------- Avoid Big Sur refusal to compile when macosx-version-min<=10.7. [ci skip] From no-reply at appveyor.com Tue Nov 24 02:33:43 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 24 Nov 2020 02:33:43 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2317 Message-ID: <20201124023343.1.BC42939A47BB394A@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Tue Nov 24 03:33:32 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 24 Nov 2020 03:33:32 +0000 Subject: [Vm-dev] Errored: OpenSmalltalk/opensmalltalk-vm#2313 (Cog - 79188a3) In-Reply-To: Message-ID: <5fbc7f0c15692_13ff83fbd46c01663f3@travis-tasks-57d7b4cff8-xvlg9.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2313 Status: Errored Duration: 1 hr, 11 mins, and 28 secs Commit: 79188a3 (Cog) Author: Eliot Miranda Message: CogVM source as per VMMaker.oscog-eem.2895 Avoid really ugly generated code for InterpreterPlugin>>sizeField:. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/a49b2135dc33...79188a3c8dbf View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/745550651?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Tue Nov 24 05:28:22 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 23 Nov 2020 21:28:22 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] dc384c: On MacOS the minor version number needs to be prin... Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: dc384cdd1b3df1580af0329b8e9caac73c696866 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/dc384cdd1b3df1580af0329b8e9caac73c696866 Author: Eliot Miranda Date: 2020-11-23 (Mon, 23 Nov 2020) Changed paths: M platforms/iOS/vm/OSX/sqSqueakOSXApplication+attributes.m Log Message: ----------- On MacOS the minor version number needs to be printed with two characters other wise Smalltalk getSystemAttribute: 1002 answers 110.1 on Big Sur 11.0 instead of 1100.1 as expected. From no-reply at appveyor.com Tue Nov 24 07:20:30 2020 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 24 Nov 2020 07:20:30 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2318 Message-ID: <20201124072030.1.15CB19C750EAF13D@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Tue Nov 24 10:08:14 2020 From: builds at travis-ci.org (Travis CI) Date: Tue, 24 Nov 2020 10:08:14 +0000 Subject: [Vm-dev] Failed: OpenSmalltalk/opensmalltalk-vm#2314 (Cog - dc384cd) In-Reply-To: Message-ID: <5fbcdb8e3fe67_13f83475fb6a8631f2@travis-tasks-756484d5ff-j2nqf.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2314 Status: Failed Duration: 4 hrs, 38 mins, and 42 secs Commit: dc384cd (Cog) Author: Eliot Miranda Message: On MacOS the minor version number needs to be printed with two characters other wise Smalltalk getSystemAttribute: 1002 answers 110.1 on Big Sur 11.0 instead of 1100.1 as expected. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/529937d09cdb...dc384cdd1b3d View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/745571638?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Wed Nov 25 03:08:19 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 25 Nov 2020 03:08:19 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2896.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2896.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2896 Author: eem Time: 24 November 2020, 7:08:08.082966 pm UUID: 0f15d287-0675-49c0-8fed-925890a76ffc Ancestors: VMMaker.oscog-eem.2895 An alloca version of stackStringValue: (stackEphemeralStringValue:) could be generally useful. =============== Diff against VMMaker.oscog-eem.2895 =============== Item was added: + ----- Method: InterpreterPlugin>>stackEphemeralStringValue: (in category 'API access') ----- + stackEphemeralStringValue: index + "Convenience to answer a given argument as a C string using stack allocation. + Fails if the argument is not a string or there is no memory." + + + | obj sz dstPtr | + + obj := interpreterProxy stackValue: index. + (interpreterProxy isBytes: obj) ifFalse: + [interpreterProxy primitiveFailFor: PrimErrBadArgument. + ^nil]. + sz := interpreterProxy byteSizeOf: obj. + dstPtr := self alloca: sz+1. + dstPtr ifNil: + [interpreterProxy primitiveFailFor: PrimErrNoCMemory. + ^nil]. + self memcpy: dstPtr _: (interpreterProxy firstIndexableField: obj) _: sz. + dstPtr at: sz put: 0. + ^dstPtr! From commits at source.squeak.org Wed Nov 25 07:25:40 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 25 Nov 2020 07:25:40 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2897.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2897.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2897 Author: eem Time: 24 November 2020, 11:25:32.968954 pm UUID: 7f4d1c8f-4546-451d-96dc-3c90be8edde6 Ancestors: VMMaker.oscog-eem.2896 Simulaiton: Symbolic names for addresses on the rump C stack. More asserts tracking c/processor stack pointers in the MT VM. =============== Diff against VMMaker.oscog-eem.2896 =============== Item was changed: ----- Method: CoInterpreter>>setCFramePointer:setCStackPointer: (in category 'callback support') ----- setCFramePointer: cFramePointer setCStackPointer: cStackPointer + self deny: (cFramePointer isNil or: [cStackPointer isNil]). CStackPointer := cStackPointer. CFramePointer := cFramePointer! Item was added: + ----- Method: CoInterpreterMT>>assertValidExternalStackPointers (in category 'debug support') ----- + assertValidExternalStackPointers + + "For use *ONLY* by routines coming in to the VM, + i.e. handleCallOrJumpSimulationTrap:. This is because it nils localFP as a side-effect, + and it does so so that the head frame can be determined reliably." + super assertValidExternalStackPointers. + self assertCStackPointersBelongToCurrentThread. + self assertProcessorStackPointersBelongToCurrentThread! Item was changed: ----- Method: CoInterpreterMT>>ownVM: (in category 'vm scheduling') ----- ownVM: threadIndexAndFlags "This is the entry-point for plugins and primitives that wish to reacquire the VM after having released it via disownVM or callbacks that want to acquire it without knowing their ownership status. This call will block until the VM is owned by the current thread or an error occurs. The argument should be the value answered by disownVM, or 0 for callbacks that don't know if they have disowned or not. This is both an optimization to avoid having to query thread- local storage for the current thread's index (since it can easily keep it in some local variable), and a record of when an unbound process becomes affined to a thread for the dynamic extent of some operation. Answer 0 if the current thread is known to the VM (and on return owns the VM). Answer 1 if the current thread is unknown to the VM and takes ownership. Answer -1 if the current thread is unknown to the VM and fails to take ownership." | threadIndex flags vmThread | threadIndexAndFlags = 0 ifTrue: [^self ownVMFromUnidentifiedThread]. threadIndex := threadIndexAndFlags bitAnd: ThreadIdMask. flags := threadIndexAndFlags >> DisownFlagsShift. (flags anyMask: DisownVMForProcessorRelinquish) ifTrue: ["Presumably we have nothing to do; this primitive is typically called from the background process. So we should /not/ try and activate any threads in the pool; they will waste cycles finding there is no runnable process, and will cause a VM abort if no runnable process is found. But we /do/ want to allow FFI calls that have completed, or callbacks a chance to get into the VM; they do have something to do. DisownVMForProcessorRelinquish indicates this." relinquishing := false. self sqLowLevelMFence]. (threadIndexAndFlags anyMask: LockGUIThreadFlag) ifTrue: [self assert: (noThreadingOfGUIThread and: [self inGUIThread]). self assert: disowningVMThread isNil. cogit recordEventTrace ifTrue: [self recordTrace: TraceOwnVM thing: ConstZero source: 0]. ^0]. vmThread := cogThreadManager acquireVMFor: threadIndex. disownCount := disownCount - 1. disowningVMThread ifNotNil: [vmThread = disowningVMThread ifTrue: + [self assert: (vmThread cFramePointer isNil + or: [CFramePointer = vmThread cFramePointer and: [CStackPointer = vmThread cStackPointer]]). - [self cCode: '' inSmalltalk: - [| range | range := self cStackRangeForThreadIndex: threadIndex. - self assert: ((range includes: CStackPointer) and: [range includes: CFramePointer])]. self assert: self successful. self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. disowningVMThread := nil. cogit recordEventTrace ifTrue: [self recordTrace: TraceOwnVM thing: ConstOne source: 0]. ^0]. "if not preempted we're done." self preemptDisowningThread]. "We've been preempted; we must restore state and update the threadId in our process, and may have to put the active process to sleep." self restoreVMStateFor: vmThread threadIndexAndFlags: threadIndexAndFlags. cogit recordEventTrace ifTrue: [self recordTrace: TraceOwnVM thing: ConstTwo source: 0]. ^threadIndexAndFlags bitAnd: OwnVMForeignThreadFlag! Item was changed: ----- Method: CogThreadManager>>acquireVMFor: (in category 'public api') ----- acquireVMFor: threadIndex "Attempt to acquire the VM, eventually blocking until it becomes available. Spin until the maxWaitingPriority has been updated if it is lower than this thread's priority." | vmThread | self assert: threadIndex = self ioGetThreadLocalThreadIndex. vmThread := self vmThreadAt: threadIndex. self assert: (vmThread state = CTMUnavailable or: [vmThread state = CTMWantingOwnership]). (self tryLockVMOwnerTo: threadIndex) ifFalse: [vmThread state: CTMWantingOwnership. [(self vmOwnerIs: threadIndex) or: [self tryLockVMOwnerTo: threadIndex]] whileFalse: [vmThread priority ifNotNil: [coInterpreter waitingPriorityIsAtLeast: vmThread priority]. (self vmOwnerIs: threadIndex) ifFalse: [self ioWaitOnOSSemaphore: (self addressOf: vmThread osSemaphore)]]]. + coInterpreter assertProcessorStackPointersBelongToCurrentThread. vmOSThread := vmThread osThread. vmThread state: CTMAssignableOrInVM. ^vmThread! Item was added: + ----- Method: CogVMSimulator>>assertValidExternalStackPointers (in category 'multi-threading simulation switch') ----- + assertValidExternalStackPointers + "This method includes or excludes CoInterpreterMT methods as required. + Auto-generated by CogVMSimulator>>ensureMultiThreadingOverridesAreUpToDate" + + ^self perform: #assertValidExternalStackPointers + withArguments: {} + inSuperclass: (cogThreadManager ifNil: [CoInterpreterPrimitives] ifNotNil: [CoInterpreterMT])! Item was changed: ----- Method: CogVMSimulator>>printRumpCStackForThread: (in category 'rump c stack') ----- printRumpCStackForThread: thread | range start coldTop | range := self cStackRangeForThreadIndex: thread index. start := range first bitClear: objectMemory tagMask. coldTop := range last. [start < coldTop and: [(objectMemory longAt: start) = 0]] whileTrue: [start := start + objectMemory wordSize]. (start = coldTop and: [(objectMemory longAt: start) = 0]) ifTrue: [^self]. start := start - (2 * objectMemory wordSize) max: range start. + transcript nextPutAll: 'thread '; print: thread index. + thread index = cogThreadManager getVMOwner ifTrue: [transcript nextPut: $*]. + transcript cr. - transcript nextPutAll: 'thread '; print: thread index; cr. self printRumpCStackFrom: start to: coldTop cfp: thread cFramePointer csp: thread cStackPointer. range first < start ifTrue: [self print: 'zeros...'; cr]! Item was changed: ----- Method: CogVMSimulator>>printRumpCStackFrom:to:cfp:csp: (in category 'rump c stack') ----- printRumpCStackFrom: start to: address cfp: cfp csp: csp address to: start by: objectMemory wordSize negated + do: [:addr| | ptrName value | - do: [:addr| | label | self printHex: addr. + addr = cogit processor sp ifTrue: [ptrName := ' sp']. + addr = cogit processor fp ifTrue: [ptrName := (ptrName ifNil: [''] ifNotNil: [ptrName, ',']), 'fp']. + addr = csp ifTrue: [ptrName := (ptrName ifNil: [''] ifNotNil: [ptrName, ',']), 'CSP']. + addr = cfp ifTrue: [ptrName := (ptrName ifNil: [''] ifNotNil: [ptrName, ',']), 'CFP']. + ptrName ifNil: [self tab] ifNotNil: [self print: ' ', ptrName, '->']. + self tab; printHex: (value := objectMemory longAt: addr). + (cogit lookupAddress: value) ifNotNil: + [:label| self print: ' ', label]. + self cr]! - addr = cogit processor sp ifTrue: [label := ' sp']. - addr = cogit processor fp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'fp']. - addr = csp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'CSP']. - addr = cfp ifTrue: [label := (label ifNil: [''] ifNotNil: [label, ',']), 'CFP']. - label ifNil: [self tab] ifNotNil: [self print: ' ', label, '->']. - self tab; printHex: (objectMemory longAt: addr); cr]! Item was changed: ----- Method: Cogit>>disassembleTrampolineFor: (in category 'disassembly') ----- disassembleTrampolineFor: pc + (self trampolineRangeFor: pc) ifNotNil: + [:range| self disassembleFrom: range first to: range last]! - | limit | - limit := methodZoneBase - 1. - pc > methodZoneBase ifTrue: [^self]. - trampolineTableIndex - 1 to: 0 by: -2 do: - [:i| | addr | - pc >= (addr := (trampolineAddresses at: i) asInteger) ifTrue: - [^self disassembleFrom: addr to: limit]. - limit := addr - 1]! Item was changed: ----- Method: Cogit>>lookupAddress: (in category 'disassembly') ----- lookupAddress: address address < methodZone freeStart ifTrue: + [^address >= methodZoneBase - [address >= methodZoneBase ifTrue: [(methodZone methodFor: address) ifNotNil: [:cogMethod| + ((cogMethod selector ~= objectMemory nilObject - ^((cogMethod selector ~= objectMemory nilObject and: [objectRepresentation couldBeObject: cogMethod selector]) ifTrue: [coInterpreter stringOf: cogMethod selector] ifFalse: [cogMethod asInteger hex]), '@', ((address - cogMethod asInteger) hex allButFirst: 3)]] ifFalse: + [(self trampolineRangeFor: address) ifNotNil: + [:range| + (self codeEntryNameFor: range first), (address = range first ifTrue: [''] ifFalse: [' + ', (address - range first) hex])]]]. - [^address = (self codeEntryFor: address) ifTrue: - [self codeEntryNameFor: address]]. - ^nil]. (simulatedTrampolines includesKey: address) ifTrue: [^self labelForSimulationAccessor: (simulatedTrampolines at: address)]. (simulatedVariableGetters includesKey: address) ifTrue: [^self labelForSimulationAccessor: (simulatedVariableGetters at: address)]. ^(coInterpreter lookupAddress: address) ifNil: [address = self cStackPointerAddress ifTrue: [#CStackPointer] ifFalse: [address = self cFramePointerAddress ifTrue: [#CFramePointer]]]! Item was added: + ----- Method: Cogit>>trampolineRangeFor: (in category 'disassembly') ----- + trampolineRangeFor: pc + + | limit | + limit := methodZoneBase - 1. + pc > methodZoneBase ifTrue: [^nil]. + trampolineTableIndex - 1 to: 0 by: -2 do: + [:i| | addr | + pc >= (addr := (trampolineAddresses at: i) asInteger) ifTrue: + [^addr to: limit]. + limit := addr - 1]. + ^nil! From commits at source.squeak.org Wed Nov 25 19:36:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Wed, 25 Nov 2020 19:36:03 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2898.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2898.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2898 Author: eem Time: 25 November 2020, 11:35:52.726014 am UUID: 3d8515f6-7807-4eca-9e5d-9b8f30bca350 Ancestors: VMMaker.oscog-eem.2897 Slang: Don't use forceNewFileNamed:. It is destructive in complex source configurations such as the one used in Terf where we overlay a repository over the opensmalltalk-vm one. =============== Diff against VMMaker.oscog-eem.2897 =============== Item was changed: ----- Method: CCodeGenerator>>storeCodeOnFile:doInlining:doAssertions: (in category 'public') ----- storeCodeOnFile: fileName doInlining: inlineFlag doAssertions: assertionFlag + "Store C code for this code base on the given file. + Try and reuse the file if it already exists." - "Store C code for this code base on the given file." | stream | + stream := VMMaker fileNamed: fileName. - stream := VMMaker forceNewFileNamed: fileName. stream ifNil: [Error signal: 'Could not open C code file: ', fileName]. + stream truncate. self emitCCodeOn: stream doInlining: inlineFlag doAssertions: assertionFlag. stream close! Item was added: + ----- Method: VMMaker class>>fileNamed: (in category 'file utilities') ----- + fileNamed: aFilename + "Always output files in unix lf format. + A single format is friendlier to e.g. external version control systems. + The Microsoft and old MacOS classic C compilers all accept lf format files." + + ^(MultiByteFileStream fileNamed: aFilename) + lineEndConvention: #lf; + yourself! From commits at source.squeak.org Thu Nov 26 03:36:48 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 26 Nov 2020 03:36:48 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2899.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2899.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2899 Author: eem Time: 25 November 2020, 7:36:40.903792 pm UUID: 977272e3-1e46-496a-ad49-a29453fce189 Ancestors: VMMaker.oscog-eem.2898 MTVM: Minor cleanup. In the simulator the REPL is able to compute 3+4, 3*4, 3<<4, 3 raisedTo: 4, etc, without error. =============== Diff against VMMaker.oscog-eem.2898 =============== Item was changed: ----- Method: CogThreadManager>>setVMOwner: (in category 'public api') ----- + setVMOwner: indexOrZero + "An ugly accessor used in only three cases: + 1. by ownVMFromUnidentifiedThread when the VM is first locked to the thread id + of the unidentified thread, and then, once identified, to the thread's index. + 2. by wakeVMThreadFor: used by the two-level scheduler to switch threads when + a Smalltalk process switch occurs to a process affined to another thread. + 3. to release the VM (set the owner to zero)" + + vmOwner := indexOrZero. - setVMOwner: index - - vmOwner := index. self sqLowLevelMFence! Item was changed: ----- Method: CogThreadManager>>startThreadSubsystem (in category 'public api') ----- startThreadSubsystem "Initialize the threading subsystem, aborting if there is an error." | vmThread | self assert: threads = nil. vmOSThread := self ioCurrentOSThread. numThreadsIncrement := (self ioNumProcessors max: 2) min: 16. (self growThreadInfosToAtLeast: numThreadsIncrement * 2) ifFalse: [self error: 'no memory to start thread system']. + vmThread := threads at: (vmOwner := 1). - vmThread := threads at: 1. vmThread state: CTMInitializing. self registerVMThread: vmThread. + vmThread state: CTMAssignableOrInVM! - vmThread state: CTMAssignableOrInVM. - self setVMOwner: 1! From commits at source.squeak.org Thu Nov 26 03:40:03 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Thu, 26 Nov 2020 03:40:03 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2900.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2900.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2900 Author: eem Time: 25 November 2020, 7:39:55.845446 pm UUID: 633a69a6-2981-41c3-bddf-2fa634ab65b3 Ancestors: VMMaker.oscog-eem.2899 MT generation convenience. =============== Diff against VMMaker.oscog-eem.2899 =============== Item was added: + ----- Method: VMMaker class>>generateAllMTConfigurationsUnderVersionControl (in category 'configurations') ----- + generateAllMTConfigurationsUnderVersionControl + self executeDisplayingProgress: + (OrderedDictionary new + add: 'Generate squeak spur cog multi-threaded 32bits' -> [ self generateSqueakSpurCogMTVM ]; + add: 'Generate squeak spur cog multi-threaded 64bits' -> [ self generateSqueakSpurCog64MTVM ]; + yourself)! From noreply at github.com Thu Nov 26 03:50:23 2020 From: noreply at github.com (Eliot Miranda) Date: Wed, 25 Nov 2020 19:50:23 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] fadfab: CogVM MT source as per Name: VMMaker.oscog-eem.2900 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: fadfabb546a3636a659dc371186530ab86814452 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/fadfabb546a3636a659dc371186530ab86814452 Author: Eliot Miranda Date: 2020-11-25 (Wed, 25 Nov 2020) Changed paths: M spur64src/vm/cointerpmt.c M spur64src/vm/cointerpmt.h M spur64src/vm/gcc3x-cointerpmt.c M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerpmt.c Log Message: ----------- CogVM MT source as per Name: VMMaker.oscog-eem.2900 MTVM: Minor cleanup. In the simulator the REPL is able to compute (in order) 3+4, 3*4, 3<<4, 3 raisedTo: 4, etc, without error. Simplify and correct checks and initialization of the processor's thread-specific stack pointers. From no-reply at appveyor.com Thu Nov 26 05:42:59 2020 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 26 Nov 2020 05:42:59 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2319 Message-ID: <20201126054259.1.52A1F95D59838881@appveyor.com> An HTML attachment was scrubbed... URL: From builds at travis-ci.org Thu Nov 26 07:44:42 2020 From: builds at travis-ci.org (Travis CI) Date: Thu, 26 Nov 2020 07:44:42 +0000 Subject: [Vm-dev] Still Failing: OpenSmalltalk/opensmalltalk-vm#2315 (Cog - fadfabb) In-Reply-To: Message-ID: <5fbf5ce887d38_13fce292acbc882369@travis-tasks-54cd76778-2r8bz.mail> Build Update for OpenSmalltalk/opensmalltalk-vm ------------------------------------- Build: #2315 Status: Still Failing Duration: 3 hrs, 45 mins, and 36 secs Commit: fadfabb (Cog) Author: Eliot Miranda Message: CogVM MT source as per Name: VMMaker.oscog-eem.2900 MTVM: Minor cleanup. In the simulator the REPL is able to compute (in order) 3+4, 3*4, 3<<4, 3 raisedTo: 4, etc, without error. Simplify and correct checks and initialization of the processor's thread-specific stack pointers. View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/dc384cdd1b3d...fadfabb546a3 View the full build log and details: https://travis-ci.org/github/OpenSmalltalk/opensmalltalk-vm/builds/746006889?utm_medium=notification&utm_source=email -- You can unsubscribe from build emails from the OpenSmalltalk/opensmalltalk-vm repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=8795279&utm_medium=notification&utm_source=email. Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email. Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at fniephaus.com Thu Nov 26 10:06:53 2020 From: lists at fniephaus.com (Fabio Niephaus) Date: Thu, 26 Nov 2020 11:06:53 +0100 Subject: [Vm-dev] [ANN] Migrating the opensmalltalk-vm repo from travis-ci.org to travis-ci.com Message-ID: Hi all, Travis CI wants all its open-source users to migrate their repositories from travis-ci.org to travis-ci.com (see [1]). A reason for this is that they want to sunset their .org instance and manage both open-source projects and private projects on the .com instance. Note that Travis CI also recently announced a new pricing model [2]. I've flipped the switch, so now the builds are happening at: https://travis-ci.com/OpenSmalltalk/opensmalltalk-vm Fabio [1] https://docs.travis-ci.com/user/migrate/open-source-repository-migration [2] https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at github.com Thu Nov 26 10:10:37 2020 From: noreply at github.com (Fabio Niephaus) Date: Thu, 26 Nov 2020 02:10:37 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 792adf: Update Travis CI badge [ci skip] Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 792adfd0b5116a7f65656db2b8fc412e6a40c195 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/792adfd0b5116a7f65656db2b8fc412e6a40c195 Author: Fabio Niephaus Date: 2020-11-26 (Thu, 26 Nov 2020) Changed paths: M README.md Log Message: ----------- Update Travis CI badge [ci skip] See http://forum.world.st/ANN-Migrating-the-opensmalltalk-vm-repo-from-travis-ci-org-to-travis-ci-com-td5124971.html From notifications at github.com Fri Nov 27 09:44:30 2020 From: notifications at github.com (Alisu) Date: Fri, 27 Nov 2020 01:44:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Primitive at put (#539) Message-ID: Try to remove context checking in at:put:. See if tests pass. You can view, comment on, or merge this pull request online at: https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/539 -- Commit Summary -- * Remove Cog-Boostrapping -> Cog * Fix c return register value following ABI * Fix bytecode PC validation: In Pharo some methods may not have trailer, so the last byte is the last bytecode * Remove halt * Adding a little test for validating the access to contexts. * Implement break instruction in ARMv8 * Rename some temporaries * Added primitive at tests for small integer receiver and arrays * Added at 64 bits indexable and fixed objects * add libtool dependency in readme * Merge 9789caa44d3a509a3568e56fbabff18e1f0c28e9 * Cleanups and refactorings * The win32 automatic manifest embedding by specifying the sources in cmake does not work under Cygwin. I changed the way this embedding works by using the resource script files. * Install missing dependencies with GitHub Actions for OS X with homebrew. * Fix the previous commit. * Do not catch all of the exceptions in Windows. This behavior breaks the OutputDebugString win32 APIs which should be a nop when the program is not attached to a debugger. * Adding tests for 16 and 8 bit indexables * Using LDRSH for MoveX32rRR * [Fix] CmpOpcode should be compared to the ARM opcode and not the RTL opcode * Add more tests for padding and getting slot size * Make tests green * Merge branch 'feature/addingPrimitiveNewPinned' of github.com:pharo-project/opensmalltalk-vm into feature/addingPrimitiveNewPinned * Merge branch 'feature/addingPrimitiveNewPinned' into headless * Merge branch 'aarch64' of github.com:pharo-project/opensmalltalk-vm into aarch64 * Reorganize tests * Add immediate at: tests * Cleanup: shiftAwaySmallIntegerTags and convertSmallIntegerToInteger are duplicated. Use one and remove the other. * Implement aarch64 multiplication with overflow and tests * Merge 400508cdb1d903c2ab734b2fbd8d7c0b86fbf270 * Using the max and min small integers depending on the platform * Fix API * Merge pull request #110 from ronsaldo/fix-win32-manifest-embedding * Adding tests for jitted bit and and bir or * Adding some primitives calling tests * Testing bitshift jitted primitive * Merging the changes * Merge 6771b2aed8717e33245dae721eed747cffc0893e * Fixing the worker * Merge remote-tracking branch 'origin/feature/addingPrimitiveNewPinned' into headless * First draft of a VM debugger * Implement JumpFull to correctly get the jump target from a literal * Fix management of literals in AndCqRR and AndCqR * Adding test for the calling of primitives * [WIP] Using a different register for stack pointer management in ARMv8 * Load C stack pointer and not Smalltalk stack pointer * Enhancements to the machine code debugger * Adding configuration to mimic the behavior of the stock VM * Remove testing code * Fixing the crappy text interpolation of groovy * - Exposing machine SP to the frontend * Having it with different names * Extract #prepareCall and fix enilopmart tests * Adding upload of packages * Merge 680543770670a3c7d6beed718ac356ed850b0bac * Fix merge * - fix and clean tests mapping this context * Adding upload to the server * Merge pull request #111 from tesonep/adding-build-with-non-headless * Fixing the upload * Changing version to 8.6.1 * Changing version * Adding tests for checking the alignment when calling C functions in the Smalltalk Stack. * Fixing the FFI tests * Floating point support * Fix register assignment for armv8 * Proper literal usage of SubCqR, TstCqR, PushCqR, PushCwR, SubCqR * Implement FMOV * Fix proper compilation of MoveRAb with the literal case * Fixes for debugging and simulating * Merge 2c25d75597f921b70a89c6d50c4ed951ea21c1f8 * Merge de5cd34dd3096c13936135573287c8ba524a7059 * Fixing the testing to check the C Stack * Merge a658003a8940c9301a47bc31b6b4f7315c04aa26 * Fixing test in IA32 * ARMv8 debugger support for new register selection * Proper oading of CStack pointers with double SP regime + tests * Better comment for LDR and using CMP for Cq=0 instead of CMN * Merge 2feb27d944c482d7d0ce41342953688061bf849f * Simulation of CWD * ARMv8: Pass on floating point point division, multiplication and substraction * Fis network simulation * Correcting type declarations for #encodeLogicalImmediate:registerSize:ifPossible:ifNotPossible: * Fix logical & => translation is not faithful to C semantics. * Adding JIT primitive size tests * Delegate the capture of CStack pointers to the backend to make better usage of registers * Adding tests for primitives * Merge 6d4d0ae4cb85184c7617988d7c3b979a76ddeffb * Handle SP as source register in MoveRAW * Added a second intra procedural scratch register for special SP management * Add proper simulation of FP usage * isCFramePointerInUse is now a getter * Merge 4f7ad7d04283bb1e558ed7dc3551a73954e901ed * Adding tests to primitive retry. * Merge 2b29bf042f40795735dd9ed1ae785987c8137740 * Adding test for primitiveFunctionPointer * Adding tests for primitiveFunctionPointer * Fixing the 64 bit indexable tests for 32bits machines * Proper (better?) simulation of sig jumps by restoring SP when jumping * Fix MoveCqR and MoveC32R to correctly compute instruction size and usage of literals * Merge abe017d9d1bc04fc781d13e0079b138e862dc042 * Merge 256df8c8b24da1addb07e812f18f2618f86b896d * Fix simulation of external primitive table * Fix MoveC32R to sign extend constants * Remove debugging code * Initial support for simulating different initial addresses * Fix several cases of CmpCqR: adding tests for several border cases * Fix CmpCqR literal calculation * Fix to support proper translation of MoveRAw * Merge ed7ec0d7faa0e788c09071c7ef0be31fd66e116c * Fix type annotation for integers in concretizeCmpCqR * Merge d0b8fcb46089d80968a0ade811e52d5f7d518d2c * Fix Merge * Adding profiling test for primitive calls * Merge d0b8fcb46089d80968a0ade811e52d5f7d518d2c * Adding accessor * Merge ee05c87d2cd82be732a6c3df726f861e569bc873 * Moving Slang to its own package * Merge bb2c768b94e46d46a63fb928dcbbff143945cbb4 * Add type annotations... * Merge bb2c768b94e46d46a63fb928dcbbff143945cbb4 * Fix blocks * Clean usages of block-using methods * Initialize external primitive array in simulator with 0s to work as in the real case (and be testable) * Merge 550184b2fe4fa1f46776f9fc2f8a2ef07253d3c1 * More work on cog method relocation * Relocating class tags * Moving more classes to independent package. * Fixing the method used as an example. * More tests in code compaction * Merge a03538d7b97be5fc3534c84ae1be695bd93e17e1 * More cleanups * Extracted constants into configuration * - Adding tests for the machine simulator * Merge e7ae7a45e6aaaf3c982673e81c691137d0a11b38 * Adding more tests and fixing other that have addresses outside the 32bits space * More killing of dependencies * Move Scanner to Slang * Add VMMaker-Slang to baseline * Adding tests and fixing the execution with the simulator to execute more of one instruction at the time. * Reverting default vmClass * - Fixing a missing accessor in the simulator. * Merge pull request #114 from pharo-project/improve-machine-simulator * Remove unnecessary extensions in Pharo9 * Changing the JIT to use the StackToRegisterMapping * Adding the step to record installed cygwin-packages * Fixing an error * Adding verbose mode to cmake, to improve the logs * Adding verbose mode to cmake, to improve the logs * Adding verbose mode to cmake, to improve the logs * Adding parameter to the config clone * Merge pull request #115 from tesonep/record-cygwin-versions * Adding an specific disassembler for ARM to handle the invalid instructions in the middle of the code (we are using them for literals) * Improving the machine code debugger * Extending the debugger. * Organizing the Export Macro * Fixing the build in unix * Fixing the build in OSX * Adding test for forwarders * Fixing the exporting of AccessorDepts * Split accessor depth calculation * Merge pull request #109 from VincentBlondeau/patch-1 * GIT_CONFIG should be the first parameter, to be ignored by old versions of CMAKE, if it is in the middle, it is taken as part of other commands * Merge pull request #116 from tesonep/organizing-export-macro * Fixing the type of the instruction * Adding tests for the frame creation * Merge 96e53ece60b4aef05b4ada5a381ac27dd9e4b356 * Adding missing instruction * Adding the do not generate * - Changing the halts to #notYetImplemented * Adding missing operations of SmallFloating points and adding tests. * Fixing the type of this temporary * Implementing * Fixing the concretize of MoveCqR to correctly handle big constants * Fixing encoding of OrCqR with large constants that cannot be shiffted * Fixing the MoveC32R for large negative constants. * More cutting * Hook Nil translation, return and argument default values * Pass on constant resolution and compile time options * default implicit return type should be default type * More fixes to default types * Fixing the instruction MoveRM16r and adding tests * [cleanup] use accessor for vmClass instead of direct ref * [improvement] removed dependency on vmClass from CCodeGenerator * [improvement] removed usage of vmMaker variable from cCodeGenerator * [improvement] fixing generation of stack interpreter * [fix] fix generation for CoInterpreter * Fixing the conversion of SMI to Floats. * The exception handle should be the last called, * Adding configuration to detect in which thread to show the exceptions * Adding filter for showing exceptions in windows. Many libraries handles the errors locally, and out handler is global * Merge pull request #122 from tesonep/improving-windows-error-reporting * Merge branch 'headless' into aarch64 * - Moving memory access primitives * Adding needed macros * Fixing the macro name * Moving the ManualSurface to the SurfacePlugin * Implementing more FFI primitives in the VM * Adding type information to variable that is expected to be used in comparison * Fixing the type of the argument before using it. * Adding a cast in the call to SQABS functions * Fixing flag declaration * [improvement] add test on type inference * [fix] integer wasn't big enough for a test, fix longPrintOop: type conflict * [improvement] add a activable error for type conflicts * Improving the generation MoveRMwr * [improvement] better name for instance variable * Removing unused methods in the implementation * [improvement] add accessor to set stopOnError * [fix] simple type fixing for the stackVM * [fix] fixing last StackInterpreter types conflict. This one might be dangerous. * Fixing missing case for MoveMbrR * Fixing instruction length and calculus of literal usage. * Adding tests and a new instruction * Fix superclass * Fix typing of fetchLong32: fieldIndex ofFloatObject: oop correctly * Moving stuff around to clean dependencies * Removing reverse dependency * Fixing Baseline * Cleanups * Organizing Slang in tags * More dependency cleanups, starting separating type inference * Adding tests for the memory access JIT primitives and fixing the missing instructions * Returning a value to comply with the translation to C * The machine implementatio of primitiveAt should not SignExtend the numbers. * Fixing encoding of instruction CmpCqR and adding tests. * Merge 3152f2f6734f5b3d01e2cbd04bd8ef0ba2f21852 * Merge CCode Generator * Fix obsolete reference * Making the build pass * Uncommenting Cogit generation * Restore sq.h * Recover inheritance rules of cogit and memory... * Do not check for bindingOf: in classes * Correct the control flow * Remove halt * Fix options * Restore preamble * Rely on Slang Type inference * Fix primitive compilation * Fix externalPrimitiveTable for simulation * Merge 8353b0f4b952c59c7a8d0ad4dfbd27fcb736d6f9 * Fix conflicting instance variable * Fixing last merge details * Moving CArray + friends to Slang * Fix broken global reference * Fix assertion warnings * Merge pull request #126 from pharo-project/enh/split-slang2 * Merge branch 'headless' into fix/assertion-warning * Merge pull request #128 from pharo-project/fix/assertion-warning * Remove context checking for at:put: -- File Changes -- A .gitattributes (1) A .github/workflows/continuous-integration-workflow.yaml (121) M CMakeLists.txt (205) M Jenkinsfile (107) M README.md (140) A docs/20200315-Statement about the VM.pdf (0) A docs/overview.md (53) A docs/vmArticle - 1.png (0) M extracted/plugins/BitBltPlugin/src/common/BitBltDispatch.c (14) M extracted/plugins/BitBltPlugin/src/common/BitBltGeneric.c (26) M extracted/plugins/FileAttributesPlugin/src/common/FileAttributesPlugin.c (9) M extracted/plugins/FileAttributesPlugin/src/win/faSupport.c (37) M extracted/plugins/FilePlugin/include/common/FilePlugin.h (2) D extracted/plugins/FilePlugin/src/common/FilePlugin.c (1883) M extracted/plugins/FilePlugin/src/common/sqFilePluginBasicPrims.c (76) M extracted/plugins/FilePlugin/src/osx/sqUnixFile.c (4) M extracted/plugins/FilePlugin/src/unix/sqUnixFile.c (4) M extracted/plugins/FilePlugin/src/win/sqWin32FilePrims.c (202) M extracted/plugins/IA32ABI/src/common/arm32abicc.c (9) M extracted/plugins/IA32ABI/src/common/arm64abicc.c (11) M extracted/plugins/IA32ABI/src/common/ia32abicc.c (9) M extracted/plugins/IA32ABI/src/common/ppc32abicc.c (9) M extracted/plugins/IA32ABI/src/common/x64sysvabicc.c (12) M extracted/plugins/IA32ABI/src/common/x64win64abicc.c (9) M extracted/plugins/JPEGReadWriter2Plugin/src/common/jerror.c (13) M extracted/plugins/JPEGReadWriter2Plugin/src/common/jmemmgr.c (9) M extracted/plugins/LargeIntegers/src/common/LargeIntegers.c (9) R extracted/plugins/SocketPlugin/src/common/SocketPluginImpl.c (631) D extracted/plugins/SocketPlugin/src/win/sqWin32NewNet.c (2667) M extracted/plugins/SqueakFFIPrims/src/common/ARM32FFIPlugin.c (55) M extracted/plugins/SqueakFFIPrims/src/common/ARM64FFIPlugin.c (56) M extracted/plugins/SqueakFFIPrims/src/common/IA32FFIPlugin.c (6) M extracted/plugins/SqueakFFIPrims/src/common/X64SysVFFIPlugin.c (56) M extracted/plugins/SqueakFFIPrims/src/common/X64Win64FFIPlugin.c (53) M extracted/plugins/SqueakFFIPrims/src/common/sqFFIPlugin.c (38) M extracted/plugins/SqueakFFIPrims/src/common/sqManualSurface.c (21) M extracted/plugins/SqueakFFIPrims/src/unix/any-libffi.c (4) D extracted/plugins/SqueakFFIPrims/src/unix/ffi-test-main.c (666) D extracted/plugins/SqueakFFIPrims/src/unix/ffi-test.c (155) M extracted/plugins/SqueakFFIPrims/src/unix/ppc-darwin.c (32) M extracted/plugins/SqueakFFIPrims/src/unix/ppc-sysv.c (22) M extracted/plugins/SqueakFFIPrims/src/unix/x86-sysv.c (56) M extracted/plugins/SqueakFFIPrims/src/win/sqWin32FFI.c (20) M extracted/plugins/SqueakSSL/include/unix/openssl_overlay.h (25) M extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c (94) M extracted/plugins/SqueakSSL/src/unix/sqUnixSSL.c (121) M extracted/plugins/SqueakSSL/src/win/sqWin32SSL.c (87) M extracted/plugins/SurfacePlugin/src/common/SurfacePlugin.c (107) A extracted/plugins/SurfacePlugin/src/common/sqManualSurface.c (168) M extracted/plugins/UnixOSProcessPlugin/src/common/UnixOSProcessPlugin.c (20) M extracted/vm/include/common/dispdbg.h (20) M extracted/vm/include/common/sq.h (113) M extracted/vm/include/common/sqAssert.h (23) M extracted/vm/include/common/sqMemoryAccess.h (2) M extracted/vm/include/common/sqVirtualMachine.h (10) R extracted/vm/include/common/sqaio.h (33) M extracted/vm/include/osx/sqPlatformSpecific.h (33) M extracted/vm/include/unix/sqPlatformSpecific.h (22) M extracted/vm/include/win/sqPlatformSpecific.h (53) M extracted/vm/include/win/sqWin32.h (20) M extracted/vm/include/win/sqWin32Alloc.h (11) R extracted/vm/src/common/heartbeat.c (138) M extracted/vm/src/common/sqExternalSemaphores.c (150) M extracted/vm/src/common/sqHeapMap.c (10) M extracted/vm/src/common/sqNamedPrims.c (92) M extracted/vm/src/common/sqVirtualMachine.c (25) A extracted/vm/src/osx/aioOSX.c (413) M extracted/vm/src/unix/aio.c (418) M extracted/vm/src/unix/sqUnixCharConv.c (43) A extracted/vm/src/win/aioWin.c (384) M extracted/vm/src/win/sqWin32Directory.c (4) D extracted/vm/src/win/sqWin32Heartbeat.c (493) M extracted/vm/src/win/sqWin32SpurAlloc.c (108) D include/aioWin.h (5) R include/pharovm/config.h.in (5) R include/pharovm/debug.h (22) R include/pharovm/errorCode.h (0) A include/pharovm/exportDefinition.h (13) R include/pharovm/fileDialog.h (0) A include/pharovm/imageAccess.h (43) A include/pharovm/interpreter.h (66) A include/pharovm/macros.h (71) A include/pharovm/pThreadedFFI/callbacks.h (52) A include/pharovm/pThreadedFFI/pThreadedFFI.h (32) A include/pharovm/pThreadedFFI/pThreadedFFIUtils.h (26) A include/pharovm/pThreadedFFI/worker.h (20) A include/pharovm/pThreadedFFI/workerTask.h (32) R include/pharovm/parameterVector.h (0) R include/pharovm/parameters.h (3) R include/pharovm/pathUtilities.h (0) R include/pharovm/pharo.h (15) R include/pharovm/pharoClient.h (2) A include/pharovm/semaphores/pSemaphore.h (11) A include/pharovm/semaphores/pharoSemaphore.h (9) A include/pharovm/semaphores/platformSemaphore.h (27) R include/pharovm/sqNamedPrims.h (0) R include/pharovm/stringUtilities.h (0) A include/pharovm/threadSafeQueue/threadSafeQueue.h (14) M macros.cmake (61) M osx.cmake (51) R packaging/linux/bin/launch.sh.in (23) R packaging/linux/launch.sh.in (24) M plugins.cmake (7) D plugins/SocketPlugin/win32/src/win32SocketPluginExtras.c (24) M plugins/UUIDPlugin/common/UUIDPlugin.c (2) M resources/mac/Info.plist.in (28) M resources/windows/Pharo.exe.manifest.in (5) M resources/windows/Pharo.rc.in (2) A resources/windows/PharoConsole.exe.manifest.in (31) A resources/windows/PharoConsole.rc.in (32) A scripts/installCygwin.ps1 (32) M scripts/installVMMaker.st (2) A scripts/runScriptInCygwinBash.ps1 (30) A scripts/runTests.sh (87) M smalltalksrc/BaselineOfVMMaker/BaselineOfVMMaker.class.st (91) D smalltalksrc/Cog-Bootstrapping/CommandLineLauncher.class.st (47) D smalltalksrc/Cog-Bootstrapping/InstructionStream.extension.st (9) D smalltalksrc/Cog-Bootstrapping/MessageNode.extension.st (50) D smalltalksrc/Cog-Bootstrapping/package.st (1) R smalltalksrc/Cog/BochsIA32Alien.class.st (0) R smalltalksrc/Cog/BochsIA32Alien64.class.st (0) R smalltalksrc/Cog/BochsIA32AlienTests.class.st (0) R smalltalksrc/Cog/BochsIA32Plugin.class.st (0) R smalltalksrc/Cog/BochsPlugin.class.st (0) R smalltalksrc/Cog/BochsX64Alien.class.st (0) R smalltalksrc/Cog/BochsX64Alien64.class.st (0) R smalltalksrc/Cog/BochsX64Plugin.class.st (0) R smalltalksrc/Cog/BytecodeEncoder.extension.st (0) R smalltalksrc/Cog/BytecodeEncoderPutschEditor.class.st (0) R smalltalksrc/Cog/ClassHierarchyDuplicator.class.st (0) R smalltalksrc/Cog/ClosureLabelsPrintEditor.class.st (0) R smalltalksrc/Cog/CogProcessorAlien.class.st (0) R smalltalksrc/Cog/CogScripts.class.st (0) R smalltalksrc/Cog/CogVMTests.class.st (0) R smalltalksrc/Cog/Context.extension.st (0) R smalltalksrc/Cog/CrashReportsMailer.class.st (0) R smalltalksrc/Cog/DominatorFinder.class.st (0) R smalltalksrc/Cog/ETC.class.st (0) R smalltalksrc/Cog/EncoderForSistaV1.extension.st (0) R smalltalksrc/Cog/EncoderForV3.extension.st (0) R smalltalksrc/Cog/GdbARMAlien.class.st (0) R smalltalksrc/Cog/GdbARMAlien64.class.st (0) R smalltalksrc/Cog/GdbARMAlienTests.class.st (0) R smalltalksrc/Cog/GdbARMPlugin.class.st (0) A smalltalksrc/Cog/InstructionStream.class.st (521) R smalltalksrc/Cog/MIPSDisassembler.class.st (0) R smalltalksrc/Cog/MIPSELSimulator.class.st (0) R smalltalksrc/Cog/MIPSELSimulatorTests.class.st (0) R smalltalksrc/Cog/MIPSInstruction.class.st (0) R smalltalksrc/Cog/MIPSSimulator.class.st (2) R smalltalksrc/Cog/MultiProcessor.class.st (0) R smalltalksrc/Cog/ProcessorSimulationTrap.class.st (0) R smalltalksrc/Cog/ProtoObject.extension.st (0) R smalltalksrc/Cog/Spur32BitPreen.class.st (0) R smalltalksrc/Cog/Spur32to64BitBootstrap.class.st (0) R smalltalksrc/Cog/String.extension.st (0) A smalltalksrc/Cog/package.st (1) A smalltalksrc/FileAttributesPlugin/FAPathPtr.class.st (97) A smalltalksrc/FileAttributesPlugin/FileAttributesPlugin.class.st (1098) A smalltalksrc/FileAttributesPlugin/FileAttributesPluginSimulator.class.st (829) A smalltalksrc/FileAttributesPlugin/package.st (1) R smalltalksrc/Melchor/CCodeGeneratorGlobalStructure.class.st (8) A smalltalksrc/Melchor/MLAccessorDepthCalculator.class.st (215) A smalltalksrc/Melchor/MLPluginAccessorDepthCalculator.class.st (61) A smalltalksrc/Melchor/MLVMCCodeGenerator.class.st (0) A smalltalksrc/Melchor/VMMaker.extension.st (0) R smalltalksrc/Melchor/VMPluginCodeGenerator.class.st (0) A smalltalksrc/Melchor/package.st (0) A smalltalksrc/Printf/Collection.extension.st (0) A smalltalksrc/Printf/Object.extension.st (0) A smalltalksrc/Printf/PrintStringFormatDescriptor.class.st (0) A smalltalksrc/Printf/PrintfCharacterFormatDescriptor.class.st (0) A smalltalksrc/Printf/PrintfFloatFormatDescriptor.class.st (0) A smalltalksrc/Printf/PrintfFormatDescriptor.class.st (0) A smalltalksrc/Printf/PrintfFormatString.class.st (0) A smalltalksrc/Printf/PrintfFormatStringTest.class.st (0) A smalltalksrc/Printf/PrintfNumberFormatDescriptor.class.st (0) A smalltalksrc/Printf/PrintfStringFormatDescriptor.class.st (0) A smalltalksrc/Printf/String.extension.st (0) A smalltalksrc/Printf/WriteStream.extension.st (0) A smalltalksrc/Printf/package.st (0) A smalltalksrc/Slang-Tests/MockConstantClass.class.st (0) A smalltalksrc/Slang-Tests/MockSlangClass.class.st (0) A smalltalksrc/Slang-Tests/SlangAbstractTestCase.class.st (0) A smalltalksrc/Slang-Tests/SlangBasicTypeInferenceTest.class.st (0) A smalltalksrc/Slang-Tests/SlangBasicTypeInferenceTestClass.class.st (0) A smalltalksrc/Slang-Tests/SlangCogitSubclass.class.st (0) A smalltalksrc/Slang-Tests/SlangCogitSuperclass.class.st (0) A smalltalksrc/Slang-Tests/SlangObjectMemorySubclass.class.st (0) A smalltalksrc/Slang-Tests/SlangObjectMemorySuperclass.class.st (0) A smalltalksrc/Slang-Tests/SlangOptionTest.class.st (0) A smalltalksrc/Slang-Tests/SlangTypeForArithmeticTest.class.st (0) A smalltalksrc/Slang-Tests/SlangTypeForDereferenceTest.class.st (0) A smalltalksrc/Slang-Tests/SlangTypeForDereferenceTestClass.class.st (0) A smalltalksrc/Slang-Tests/SlangTypePromotionTest.class.st (0) A smalltalksrc/Slang-Tests/package.st (0) R smalltalksrc/Slang/CArray.class.st (0) R smalltalksrc/Slang/CArrayAccessor.class.st (0) R smalltalksrc/Slang/CArrayOfLongsAccessor.class.st (0) R smalltalksrc/Slang/CCodeGenerator.class.st (0) R smalltalksrc/Slang/CCodeGeneratorAbsoluteInlineStrategy.class.st (0) R smalltalksrc/Slang/CCodeGeneratorInlineAlwaysStrategy.class.st (0) R smalltalksrc/Slang/CCodeGeneratorInlineAsSpecifiedOrQuickStrategy.class.st (0) R smalltalksrc/Slang/CCodeGeneratorInlineAsSpecifiedStrategy.class.st (0) R smalltalksrc/Slang/CCodeGeneratorInlineNeverStrategy.class.st (0) R smalltalksrc/Slang/CCodeGeneratorInlineStrategy.class.st (0) R smalltalksrc/Slang/CFloatArray.class.st (0) R smalltalksrc/Slang/CLiteralArray.class.st (0) R smalltalksrc/Slang/CObjectAccessor.class.st (0) R smalltalksrc/Slang/CPluggableAccessor.class.st (0) R smalltalksrc/Slang/Gnuifier.class.st (0) A smalltalksrc/Slang/ManifestVMMakerSlang.class.st (0) R smalltalksrc/Slang/Scanner.class.st (0) A smalltalksrc/Slang/SlangClass.class.st (0) A smalltalksrc/Slang/SlangStructType.class.st (0) A smalltalksrc/Slang/SlangTyper.class.st (0) R smalltalksrc/Slang/TAssignmentNode.class.st (0) R smalltalksrc/Slang/TBraceCaseNode.class.st (0) R smalltalksrc/Slang/TCaseStmtNode.class.st (0) R smalltalksrc/Slang/TConstantNode.class.st (0) R smalltalksrc/Slang/TDefineNode.class.st (0) R smalltalksrc/Slang/TGoToNode.class.st (0) R smalltalksrc/Slang/TInlineNode.class.st (0) R smalltalksrc/Slang/TLabeledCommentNode.class.st (0) R smalltalksrc/Slang/TMethod.class.st (0) R smalltalksrc/Slang/TParseNode.class.st (0) R smalltalksrc/Slang/TPrintfFormatStringNode.class.st (0) R smalltalksrc/Slang/TReturnNode.class.st (0) R smalltalksrc/Slang/TSendNode.class.st (0) R smalltalksrc/Slang/TStmtListNode.class.st (0) R smalltalksrc/Slang/TSwitchStmtNode.class.st (0) R smalltalksrc/Slang/TVariableNode.class.st (0) R smalltalksrc/Slang/VMMaker.class.st (0) R smalltalksrc/Slang/VMMakerException.class.st (0) A smalltalksrc/Slang/package.st (0) R smalltalksrc/VMMaker-MT-Tests/SpurMockMemory.class.st (0) R smalltalksrc/VMMaker-MT-Tests/SpurMockProcessorScheduler.class.st (0) R smalltalksrc/VMMaker-MT-Tests/StackMTInterpreterSimulatorForTest.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMLinkedList.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMTGenerationTests.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMTTests.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockArray.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockCogThreadManager.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockContext.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockObject.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockProcess.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockScheduler.class.st (0) R smalltalksrc/VMMaker-MT-Tests/VMMockSchedulerAssociation.class.st (0) A smalltalksrc/VMMaker-MT-Tests/package.st (0) R smalltalksrc/VMMaker-OriginalTests/AbstractInstructionTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/BitBltSimulationTest.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CCodeGeneratorTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CoInterpreterTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogARMCompilerForTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogARMCompilerTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogIA32CompilerForTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogIA32CompilerTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogMIPSELCompilerForTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogMIPSELCompilerTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogX64CompilerForTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/CogX64CompilerTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/FloatMathPluginTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/FullSimulationTest.class.st (0) R smalltalksrc/VMMaker-OriginalTests/HeapMapTest.class.st (0) R smalltalksrc/VMMaker-OriginalTests/IncludedMethodsTest.class.st (0) R smalltalksrc/VMMaker-OriginalTests/InterpreterPrimitivesTest.class.st (0) R smalltalksrc/VMMaker-OriginalTests/JPEGReadWriter2PluginTest.class.st (0) A smalltalksrc/VMMaker-OriginalTests/LargePositiveInteger.extension.st (0) R smalltalksrc/VMMaker-OriginalTests/MemoryTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/MiscPrimitivePluginTest.class.st (0) R smalltalksrc/VMMaker-OriginalTests/RegisterAllocatingCogitTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/SimulatorHarnessForTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/SpurImageSegmentTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/SpurImageTestResource.class.st (0) R smalltalksrc/VMMaker-OriginalTests/SpurPlanningCompactorTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/SpurTrunkImageTestResource.class.st (0) R smalltalksrc/VMMaker-OriginalTests/StackInterpreterSimulatorTests.class.st (0) A smalltalksrc/VMMaker-OriginalTests/StackInterpreterTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/StackToRegisterMappingCogitChecker.class.st (0) R smalltalksrc/VMMaker-OriginalTests/VMClassTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/VMInterfaceConsistencyTests.class.st (0) R smalltalksrc/VMMaker-OriginalTests/VMMakerIntegerTests.class.st (0) A smalltalksrc/VMMaker-OriginalTests/package.st (0) R smalltalksrc/VMMaker-Slang/CrossPlatformVMMaker.class.st (0) A smalltalksrc/VMMaker-Slang/VMMakerConfiguration.class.st (0) A smalltalksrc/VMMaker-Slang/package.st (0) A smalltalksrc/VMMaker-Tools/Integer.extension.st (0) R smalltalksrc/VMMaker-Tools/SimulatorEventTransformer.class.st (0) R smalltalksrc/VMMaker-Tools/SimulatorImageMorph.class.st (0) R smalltalksrc/VMMaker-Tools/SimulatorMorph.class.st (0) R smalltalksrc/VMMaker-Tools/SimulatorMorphicEventTests.class.st (0) R smalltalksrc/VMMaker-Tools/SimulatorMorphicModel.class.st (0) A smalltalksrc/VMMaker-Tools/SpurMemoryManager.extension.st (0) A smalltalksrc/VMMaker-Tools/StackInterpreter.extension.st (0) A smalltalksrc/VMMaker-Tools/VMBytecodeToIRMapping.class.st (0) A smalltalksrc/VMMaker-Tools/VMDebugger.class.st (0) A smalltalksrc/VMMaker-Tools/VMMachineCodeDebugger.class.st (0) A smalltalksrc/VMMaker-Tools/VMMachineCodeDebuggerInstruction.class.st (0) A smalltalksrc/VMMaker-Tools/VMMachineCodeDebuggerStackItem.class.st (0) A smalltalksrc/VMMaker-Tools/VMMethodBytecodeToIRMapping.class.st (0) -- Patch Links -- https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/539.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/539.diff -- 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/pull/539 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at github.com Fri Nov 27 10:00:03 2020 From: notifications at github.com (Alisu) Date: Fri, 27 Nov 2020 02:00:03 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Primitive at put (#539) In-Reply-To: References: Message-ID: Closed #539. -- 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/pull/539#event-4045418108 -------------- next part -------------- An HTML attachment was scrubbed... URL: From commits at source.squeak.org Sun Nov 29 06:54:36 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Sun, 29 Nov 2020 06:54:36 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2901.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2901.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2901 Author: eem Time: 28 November 2020, 10:54:27.351264 pm UUID: 62f5de98-d59e-4cdc-b4a5-1c0c2d987c71 Ancestors: VMMaker.oscog-eem.2900 MTVM: Eliminate some compiler warnings. Fix a slip in the assert in cogMethodContainng: In simulation get register state correct on proceeding from ioWaitOnOSSemaphore: =============== Diff against VMMaker.oscog-eem.2900 =============== Item was changed: ----- Method: CoInterpreter>>markActiveMethodsAndReferents (in category 'cog jit support') ----- markActiveMethodsAndReferents "If instructionPointer is referring to machine code, as it will be if a primitive is in progress (see isCodeCompactingPrimitiveIndex:) it may refer to a method, and if so that method must be retained." instructionPointer ~= 0 ifTrue: [(cogit cogMethodContaining: instructionPointer) ifNotNil: [:primCogMethod| + cogit markMethodAndReferents: (self cCoerceSimple: primCogMethod to: #'CogBlockMethod *')]]. - cogit markMethodAndReferents: primCogMethod]]. 0 to: numStackPages - 1 do: [:i| | thePage | thePage := stackPages stackPageAt: i. (stackPages isFree: thePage) ifFalse: [self markCogMethodsAndReferentsOnPage: thePage]]! Item was changed: ----- Method: CoInterpreterMT>>primitiveRelinquishProcessor (in category 'I/O primitives') ----- primitiveRelinquishProcessor "Relinquish the processor for up to the given number of microseconds. The exact behavior of this primitive is platform dependent. Override to check for waiting threads." | microSecs threadIndexAndFlags currentCStackPointer currentCFramePointer | + + - - microSecs := self stackTop. (objectMemory isIntegerObject: microSecs) ifFalse: [^self primitiveFail]. self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. self assert: relinquishing not. "DO NOT allow relinquishing the processor while we are profiling since this may skew the time base for our measures (it may reduce processor speed etc). Instead we go full speed, therefore measuring the precise time we spend in the inner idle loop as a busy loop." nextProfileTick = 0 ifTrue: "Presumably we have nothing to do; this primitive is typically called from the background process. So we should /not/ try and activate any threads in the pool; they will waste cycles finding there is no runnable process, and will cause a VM abort if no runnable process is found. But we /do/ want to allow FFI calls that have completed, or callbacks a chance to get into the VM; they do have something to do. DisownVMForProcessorRelinquish indicates this." [currentCStackPointer := CStackPointer. currentCFramePointer := CFramePointer. threadIndexAndFlags := self disownVM: DisownVMForProcessorRelinquish. self assert: relinquishing. self ioRelinquishProcessorForMicroseconds: (objectMemory integerValueOf: microSecs). self assert: relinquishing. self ownVM: threadIndexAndFlags. self assert: relinquishing not. self assert: cogThreadManager currentVMThread state = CTMAssignableOrInVM. self assert: currentCStackPointer = CStackPointer. self assert: currentCFramePointer = CFramePointer. "In simulation we allow ioRelinquishProcessorForMicroseconds: to fail so that + we can arrange that the simulator responds to input events promptly. This - we can arrange that the simulator responds to input events promply. This *DOES NOT HAPPEN* in the real vm." self cCode: [] inSmalltalk: [primFailCode ~= 0 ifTrue: [^self]]]. self assert: (objectMemory fetchPointer: MyListIndex ofObject: self activeProcess) = objectMemory nilObject. self pop: 1 "microSecs; leave rcvr on stack"! Item was changed: ----- Method: CogMethodZone>>cogMethodContaining: (in category 'jit - api') ----- cogMethodContaining: mcpc "Answer the method containing mcpc for the purposes of code zone compaction, where mcpc is actually the value of instructionPointer at the time of a compaction." | cogMethod prevMethod | mcpc > limitAddress ifTrue: [^nil]. mcpc < baseAddress ifTrue: [cogit assertMcpcIsPrimReturn: mcpc. ^nil]. self assert: mcpc < self limitZony. cogMethod := coInterpreter cCoerceSimple: baseAddress to: #'CogMethod *'. + [cogMethod asUnsignedInteger < mcpc] whileTrue: - [cogMethod < mcpc] whileTrue: [prevMethod := cogMethod. cogMethod := self methodAfter: cogMethod]. "Since mcpc is actually instructionPointer we expect that it is either at the stack check (normal code zone reclamation invoked through checkForEventsMayContextSwitch:) or is in a primitive, immediately following the call of the C primitive routine." self assert: (prevMethod notNil + and: [mcpc = (prevMethod asUnsignedInteger + prevMethod stackCheckOffset) - and: [mcpc = prevMethod asUnsignedInteger + prevMethod stackCheckOffset or: [(coInterpreter primitiveIndexOfMethod: prevMethod methodObject header: prevMethod methodHeader) > 0 and: [cogit backEnd isCallPrecedingReturnPC: mcpc]]]). ^prevMethod! Item was changed: ----- Method: CogThreadManager>>ioWaitOnOSSemaphore: (in category 'simulation') ----- ioWaitOnOSSemaphore: aSemaphorePtr "See platforms/Cross/vm/sq.h for the real definition." "Simulate the VM's heartbeat by calling checkVMOwnershipFromHeartbeat if the wait times-out." [aSemaphorePtr value waitTimeoutMSecs: 1000] whileTrue: + [coInterpreter checkVMOwnershipFromHeartbeat]. + self deny: vmOwner = 0. + cogit processor setRegisterState: (registerStates at: vmOwner + ifAbsentPut: + [self ensureInitializedProcessor: cogit processor forThreadIndex: vmOwner. + cogit processor registerState])! - [coInterpreter checkVMOwnershipFromHeartbeat]! Item was changed: ----- Method: CogVMThread class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') ----- instVarNamesAndTypesForTranslationDo: aBinaryBlock "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a CogVMThread struct." self allInstVarNames do: [:ivn| aBinaryBlock value: ivn value: (ivn caseOf: { ['awolProcesses'] -> [{#sqInt. '[', CogThreadManager awolProcessesIncrement printString, ']'}]. + ['cStackPointer'] -> [#usqIntptr_t]. + ['cFramePointer'] -> [#usqIntptr_t]. + ['primitiveFunctionPointer'] -> [#('static void (*' ')()')]. - ['cStackPointer'] -> [#'void *']. - ['cFramePointer'] -> [#'void *']. ['osSemaphore'] -> ['sqOSSemaphore']. + ['osThread'] -> ['sqOSThread']. + ['reenterInterpreter'] -> ['jmp_buf'] } - ['osThread'] -> ['sqOSThread']. - ['reenterInterpreter'] -> ['jmp_buf'] } otherwise: [#sqInt])]! Item was changed: ----- Method: StackInterpreter>>printCallStackOf: (in category 'debug printing') ----- printCallStackOf: aContextOrProcessOrFrame | context | (stackPages couldBeFramePointer: aContextOrProcessOrFrame) ifTrue: [^self printCallStackFP: (self cCoerceSimple: aContextOrProcessOrFrame to: #'char *')]. aContextOrProcessOrFrame = self activeProcess ifTrue: + [^self printCallStackOf: (self cCode: [framePointer asInteger] inSmalltalk: [self headFramePointer])]. - [^self printCallStackOf: (self cCode: [framePointer] inSmalltalk: [self headFramePointer])]. (self couldBeProcess: aContextOrProcessOrFrame) ifTrue: [^self printCallStackOf: (objectMemory fetchPointer: SuspendedContextIndex ofObject: aContextOrProcessOrFrame)]. context := aContextOrProcessOrFrame. [context = objectMemory nilObject] whileFalse: [(self isMarriedOrWidowedContext: context) ifTrue: [(self checkIsStillMarriedContext: context currentFP: framePointer) ifFalse: [self shortPrintContext: context. ^nil]. context := self shortReversePrintFrameAndCallers: (self frameOfMarriedContext: context)] ifFalse: [context := self printContextCallStackOf: context]]! From noreply at github.com Mon Nov 30 16:58:40 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 30 Nov 2020 08:58:40 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 3558c8: CogVM source as per VMMaker.oscog-eem.2901 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: 3558c8bbca17e7c70e990d4efa1412743a7e589e https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3558c8bbca17e7c70e990d4efa1412743a7e589e Author: Eliot Miranda Date: 2020-11-30 (Mon, 30 Nov 2020) Changed paths: M platforms/Cross/vm/sq.h M platforms/unix/vm/sqUnixMain.c M platforms/unix/vm/sqUnixThreads.c M platforms/win32/vm/sqWin32Main.c M spur64src/vm/cogit.h M spur64src/vm/cogitARMv8.c M spur64src/vm/cogitX64SysV.c M spur64src/vm/cogitX64WIN64.c M spur64src/vm/cointerpmt.c M spur64src/vm/cointerpmt.h M spur64src/vm/gcc3x-cointerpmt.c M spursrc/vm/cogit.h M spursrc/vm/cogitARMv5.c M spursrc/vm/cogitIA32.c M spursrc/vm/cogitMIPSEL.c M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerpmt.c Log Message: ----------- CogVM source as per VMMaker.oscog-eem.2901 MTVM: Eliminate some compiler warnings. Fix a slip in the assert in cogMethodContainng: From commits at source.squeak.org Mon Nov 30 17:57:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 30 Nov 2020 17:57:09 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2902.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2902.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2902 Author: eem Time: 30 November 2020, 9:57:00.399325 am UUID: 441f60b2-e29e-47d1-8486-d29b9a8c66d2 Ancestors: VMMaker.oscog-eem.2901 Oops; fix CogVMThread typedef. =============== Diff against VMMaker.oscog-eem.2901 =============== Item was changed: ----- Method: CogVMThread class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') ----- instVarNamesAndTypesForTranslationDo: aBinaryBlock "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a CogVMThread struct." self allInstVarNames do: [:ivn| aBinaryBlock value: ivn value: (ivn caseOf: { ['awolProcesses'] -> [{#sqInt. '[', CogThreadManager awolProcessesIncrement printString, ']'}]. ['cStackPointer'] -> [#usqIntptr_t]. ['cFramePointer'] -> [#usqIntptr_t]. + ['primitiveFunctionPointer'] -> [#('void (*' ')()')]. - ['primitiveFunctionPointer'] -> [#('static void (*' ')()')]. ['osSemaphore'] -> ['sqOSSemaphore']. ['osThread'] -> ['sqOSThread']. ['reenterInterpreter'] -> ['jmp_buf'] } otherwise: [#sqInt])]! From commits at source.squeak.org Mon Nov 30 17:59:09 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 30 Nov 2020 17:59:09 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2903.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2903.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2903 Author: eem Time: 30 November 2020, 9:59:01.198766 am UUID: 65fd7c54-a607-4603-b947-22a80ffeeb85 Ancestors: VMMaker.oscog-eem.2902 ...and reenterInterpreter is no longer an inst var of CogVMThread =============== Diff against VMMaker.oscog-eem.2902 =============== Item was changed: ----- Method: CogVMThread class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') ----- instVarNamesAndTypesForTranslationDo: aBinaryBlock "enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a CogVMThread struct." self allInstVarNames do: [:ivn| aBinaryBlock value: ivn value: (ivn caseOf: { ['awolProcesses'] -> [{#sqInt. '[', CogThreadManager awolProcessesIncrement printString, ']'}]. ['cStackPointer'] -> [#usqIntptr_t]. ['cFramePointer'] -> [#usqIntptr_t]. ['primitiveFunctionPointer'] -> [#('void (*' ')()')]. ['osSemaphore'] -> ['sqOSSemaphore']. + ['osThread'] -> ['sqOSThread'] } - ['osThread'] -> ['sqOSThread']. - ['reenterInterpreter'] -> ['jmp_buf'] } otherwise: [#sqInt])]! From noreply at github.com Mon Nov 30 18:03:37 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 30 Nov 2020 10:03:37 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f7aee4: VMMaker.oscog-eem.2903 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: f7aee44b3b3e38e432161cbeec1ea45ef105778b https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f7aee44b3b3e38e432161cbeec1ea45ef105778b Author: Eliot Miranda Date: 2020-11-30 (Mon, 30 Nov 2020) Changed paths: M spur64src/vm/cointerpmt.c M spur64src/vm/cointerpmt.h M spur64src/vm/gcc3x-cointerpmt.c M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerpmt.c Log Message: ----------- VMMaker.oscog-eem.2903 fix CogVMThread typedef. [ci skip] From no-reply at appveyor.com Mon Nov 30 19:06:40 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 30 Nov 2020 19:06:40 +0000 Subject: [Vm-dev] Build failed: opensmalltalk-vm 1.0.2320 Message-ID: <20201130190640.1.CC1A4B37AA8F80DF@appveyor.com> An HTML attachment was scrubbed... URL: From no-reply at appveyor.com Mon Nov 30 19:17:45 2020 From: no-reply at appveyor.com (AppVeyor) Date: Mon, 30 Nov 2020 19:17:45 +0000 Subject: [Vm-dev] Build completed: opensmalltalk-vm 1.0.2321 Message-ID: <20201130191745.1.BF0D97E7008EB441@appveyor.com> An HTML attachment was scrubbed... URL: From commits at source.squeak.org Mon Nov 30 20:09:15 2020 From: commits at source.squeak.org (commits at source.squeak.org) Date: Mon, 30 Nov 2020 20:09:15 0000 Subject: [Vm-dev] VM Maker: VMMaker.oscog-eem.2904.mcz Message-ID: Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2904.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2904 Author: eem Time: 30 November 2020, 12:09:05.818551 pm UUID: 8569e47f-67b4-4e80-9af6-303a01f7c2c3 Ancestors: VMMaker.oscog-eem.2903 MTVM: fix preemptDisowningThread; marryFrame:SP: expects top-of-stack to be the Smalltalk top-of-stack, not a pushed instructionPointer. =============== Diff against VMMaker.oscog-eem.2903 =============== Item was changed: ----- Method: CoInterpreterMT>>preemptDisowningThread (in category 'vm scheduling') ----- preemptDisowningThread "Set the relevant state for disowningVMThread so that it can resume after being preempted and set disowningVMThread to nil to indicate preemption. N.B. This should only be sent from checkPreemptionOfDisowningThread. There are essentially four things to do. a) save the VM's notion of the current C stack pointers; these are pointers into a thread's stack and must be saved and restored in thread switch. b) save the VM's notion of the current Smalltalk execution point. This is simply the suspend half of a process switch that saves the current context in the current process. c) add the process to the thread's set of AWOL processes so that the scheduler won't try to run the process while the thread has disowned the VM. d) save the in-primitive VM state, newMethod and argumentCount ownVM: will restore the VM context as of disownVM: from the above when it finds it has been preempted." | activeProc activeContext preemptedThread | self assert: disowningVMThread notNil. self assert: (disowningVMThread state = CTMUnavailable or: [disowningVMThread state = CTMWantingOwnership]). self assertCStackPointersBelongToDisowningThread. cogit recordEventTrace ifTrue: [self recordTrace: TracePreemptDisowningThread thing: (objectMemory integerObjectOf: disowningVMThread index) source: 0]. disowningVMThread cStackPointer: CStackPointer. disowningVMThread cFramePointer: CFramePointer. activeProc := self activeProcess. self assert: (objectMemory fetchPointer: MyListIndex ofObject: activeProc) = objectMemory nilObject. objectMemory storePointer: MyListIndex ofObject: activeProc withValue: (objectMemory splObj: ProcessInExternalCodeTag). + activeContext := self ensureFrameIsMarried: framePointer SP: stackPointer. + objectMemory + storePointer: SuspendedContextIndex + ofObject: activeProc + withValue: activeContext. "The instructionPointer must be pushed because the convention for inactive stack pages is that the instructionPointer is top of stack. We need to know if this primitive is called from machine code because the invariant that the return pc of an interpreter callee calling a machine code caller is ceReturnToInterpreterPC must be maintained." self push: instructionPointer. self externalWriteBackHeadFramePointers. - activeContext := self ensureFrameIsMarried: framePointer SP: stackPointer. - objectMemory - storePointer: SuspendedContextIndex - ofObject: activeProc - withValue: activeContext. "Since pushing the awol process may realloc disowningVMThread we need to reassign. But since we're going to nil disowningVMThread anyway we can assign to a local." preemptedThread := cogThreadManager pushAWOLProcess: activeProc on: disowningVMThread. disowningVMThread := nil. preemptedThread priority: (self quickFetchInteger: PriorityIndex ofObject: activeProc). (self ownerIndexOfProcess: activeProc) = 0 ifTrue: [self setOwnerIndexOfProcess: activeProc to: preemptedThread index bind: false] ifFalse: [self assert: (self ownerIndexOfProcess: activeProc) = preemptedThread index]. preemptedThread newMethodOrNull: newMethod; argumentCount: argumentCount; primitiveFunctionPointer: primitiveFunctionPointer; inMachineCode: instructionPointer asUnsignedInteger <= objectMemory startOfMemory! From noreply at github.com Mon Nov 30 20:13:30 2020 From: noreply at github.com (Eliot Miranda) Date: Mon, 30 Nov 2020 12:13:30 -0800 Subject: [Vm-dev] [OpenSmalltalk/opensmalltalk-vm] a78350: VMMaker.oscog-eem.2904 Message-ID: Branch: refs/heads/Cog Home: https://github.com/OpenSmalltalk/opensmalltalk-vm Commit: a783502b249c4a4fedc88b6e07837d405feab144 https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a783502b249c4a4fedc88b6e07837d405feab144 Author: Eliot Miranda Date: 2020-11-30 (Mon, 30 Nov 2020) Changed paths: M spur64src/vm/cointerpmt.c M spur64src/vm/cointerpmt.h M spur64src/vm/gcc3x-cointerpmt.c M spursrc/vm/cointerpmt.c M spursrc/vm/cointerpmt.h M spursrc/vm/gcc3x-cointerpmt.c Log Message: ----------- VMMaker.oscog-eem.2904 MTVM: fix preemptDisowningThread; marryFrame:SP: expects top-of-stack to be the Smalltalk top-of-stack, not a pushed instructionPointer. [ci skip]