tag:forum.world.st,2006:forum-134485Nabble - Squeak - VM2024-03-29T08:10:55ZSqueak Virtual Machine Developmenttag:forum.world.st,2006:post-134816Fwd: vm-dev moving to lists.squeakfoundation.org2006-07-20T03:01:00Z2006-07-20T03:01:00ZBert Freudenberg-3
Forwarded on behalf of Marcus The List Admin:
<br/><br/><div class='shrinkable-quote'><br/>> From: Marcus Denker <<a href="/user/SendEmail.jtp?type=node&node=134816&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/>> Date: 19. Juli 2006 23:11:31 GMT+02:00
<br/>>
<br/>> Hi,
<br/>>
<br/>> The list "vm-dev" is moving to Mailman.
<br/>>
<br/>> new adress: <a href="/user/SendEmail.jtp?type=node&node=134816&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>
<br/>>
<br/>> Please subscribe to the new list:
<br/>> <a href="http://lists.squeakfoundation.org/mailman/listinfo/vm-dev" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/mailman/listinfo/vm-dev</a><br/>>
<br/>> Existing substriptions are *not* moved over, you need to re-subsribe!
<br/>> (The archives have been moved over).
<br/>>
<br/>> Posting to the old discuss list will be possible till tommorow,
<br/>> then it will be
<br/>> de-activated.
<br/>>
<br/>> Marcus
<br/>>
<br/>>
</div><br/><br/>
tag:forum.world.st,2006:post-134815One-click plugin development2006-07-10T04:34:19Z2006-07-10T04:34:19ZBert Freudenberg-3
I found myself doing this a gazillion times over the last days: click
<br/>the VMMaker's "generate plugin" button, switch to XCode, invoke the
<br/>plugin build, switch back to Squeak, unload the plugin to test the
<br/>new one.
<br/><br/>No more.
<br/><br/>A few lines of code automate all of this:
<br/><br/>VMMaker>>generateExternalPlugins
<br/> ...
<br/> externalPlugins size = 1 ifTrue: [
<br/> | result |
<br/> logger show: 'XCode: building ', externalPlugins first, ' ... '.
<br/> result := Applescript doIt: 'tell application "XCode" to build'.
<br/> logger show: result; cr.
<br/> (result beginsWith: '"Build succeeded')
<br/> ifTrue: [Smalltalk unloadModule: externalPlugins first]
<br/> ifFalse: [Applescript doIt: 'tell application "XCode" to activate']].
<br/><br/>Now I just click "generate plugin" and debug on. Life is bright
<br/>again. Except for the occasional crash, of course :)
<br/><br/>- Bert -
<br/><br/>
tag:forum.world.st,2006:post-134814Re: Mac build setup?2006-07-07T17:49:28Z2006-07-07T17:49:28ZAndreas.Raab
Thanks John. Just what I was looking for.
<br/><br/>Cheers,
<br/> - Andreas
<br/><br/>John M McIntosh wrote:
<div class='shrinkable-quote'><br/>> Download the SVN tree, there is a readme document in the mac document
<br/>> folder that explains how to build
<br/>> we try to keep it current, so start with that and let me know if problem.
<br/>>
<br/>>
<br/>> final test of course is if bytecode/send rate is same as published vm
<br/>>
<br/>> On 7-Jul-06, at 3:41 PM, Andreas Raab wrote:
<br/>>
<br/>>> Hi John -
<br/>>>
<br/>>> I need to do a bit of work with a custom Mac VM and I was wondering
<br/>>> what setup you use these days to build VMs. Is there any document
<br/>>> somewhere that describes your setup, steps to take etc. to build a Mac
<br/>>> VM?
<br/>>>
<br/>>> Thanks,
<br/>>> - Andreas
<br/>>
<br/>> --
<br/>> ===========================================================================
<br/>> John M. McIntosh <<a href="/user/SendEmail.jtp?type=node&node=134814&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> 1-800-477-2659
<br/>> Corporate Smalltalk Consulting Ltd. <a href="http://www.smalltalkconsulting.com" target="_top" rel="nofollow" link="external">http://www.smalltalkconsulting.com</a><br/>> ===========================================================================
<br/>>
<br/>>
<br/></div>
tag:forum.world.st,2006:post-134813Re: Mac build setup?2006-07-07T17:20:10Z2006-07-07T17:20:10Zjohnmci
Download the SVN tree, there is a readme document in the mac document
<br/>folder that explains how to build
<br/>we try to keep it current, so start with that and let me know if
<br/>problem.
<br/><br/><br/>final test of course is if bytecode/send rate is same as published vm
<br/><br/>On 7-Jul-06, at 3:41 PM, Andreas Raab wrote:
<br/><br/>> Hi John -
<br/>>
<br/>> I need to do a bit of work with a custom Mac VM and I was wondering
<br/>> what setup you use these days to build VMs. Is there any document
<br/>> somewhere that describes your setup, steps to take etc. to build a
<br/>> Mac VM?
<br/>>
<br/>> Thanks,
<br/>> - Andreas
<br/><br/>--
<br/>========================================================================
<br/>===
<br/>John M. McIntosh <<a href="/user/SendEmail.jtp?type=node&node=134813&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> 1-800-477-2659
<br/>Corporate Smalltalk Consulting Ltd. <a href="http://www.smalltalkconsulting.com" target="_top" rel="nofollow" link="external">http://www.smalltalkconsulting.com</a><br/>========================================================================
<br/>===
<br/><br/>
tag:forum.world.st,2006:post-134812Mac build setup?2006-07-07T16:41:57Z2006-07-07T16:41:57ZAndreas.Raab
Hi John -
<br/><br/>I need to do a bit of work with a custom Mac VM and I was wondering what
<br/>setup you use these days to build VMs. Is there any document somewhere
<br/>that describes your setup, steps to take etc. to build a Mac VM?
<br/><br/>Thanks,
<br/> - Andreas
<br/>
tag:forum.world.st,2006:post-134811Re: [FIX] lockSurfaces2006-07-07T02:09:54Z2006-07-07T02:09:54ZAndreas.Raab
Yup. Small but important fix - if this ever hits you you're dead in the
<br/>water. Thanks for finding it!
<br/><br/>Cheers,
<br/> - Andreas
<br/><br/>Bert Freudenberg wrote:
<div class='shrinkable-quote'><br/>> There is a wrong condition in an almost never-taken branch of
<br/>> BitBltSimulation>>lockSurfaces (when src=dst):
<br/>>
<br/>> isWarping ifFalse:[
<br/>> "When warping we always need the entire surface for
<br/>> the source"
<br/>> sourceBits _ self cCode:'fn(sourceHandle,
<br/>> &sourcePitch, 0,0, sourceWidth, sourceHeight)'.
<br/>> ] ifTrue:[
<br/>> "Otherwise use overlapping area"
<br/>> l _ sx min: dx. r _ (sx max: dx) + bbW.
<br/>> t _ sy min: dy. b _ (sy max: sy) + bbH.
<br/>> sourceBits _ self cCode:'fn(sourceHandle,
<br/>> &sourcePitch, l, t, r-l, b-t)'.
<br/>> ].
<br/>>
<br/>> As the comments indicate, the condition is reversed. Please include
<br/>> attached fix in VMMaker.
<br/>>
<br/>> - Bert -
<br/>>
<br/>>
<br/></div>
tag:forum.world.st,2006:post-134810[FIX] lockSurfaces2006-07-07T02:08:26Z2006-07-07T02:08:26ZBert Freudenberg-3
There is a wrong condition in an almost never-taken branch of
<br/>BitBltSimulation>>lockSurfaces (when src=dst):
<br/><br/> isWarping ifFalse:[
<br/> "When warping we always need the entire surface
<br/>for the source"
<br/> sourceBits _ self cCode:'fn(sourceHandle,
<br/>&sourcePitch, 0,0, sourceWidth, sourceHeight)'.
<br/> ] ifTrue:[
<br/> "Otherwise use overlapping area"
<br/> l _ sx min: dx. r _ (sx max: dx) + bbW.
<br/> t _ sy min: dy. b _ (sy max: sy) + bbH.
<br/> sourceBits _ self cCode:'fn(sourceHandle,
<br/>&sourcePitch, l, t, r-l, b-t)'.
<br/> ].
<br/><br/>As the comments indicate, the condition is reversed. Please include
<br/>attached fix in VMMaker.
<br/><br/>- Bert -
<br/><br/><br /><br/><!--start-attachments--><div class="small"><br/><img src="https://forum.world.st/images/icon_attachment.gif" > <strong>bltBltLockFix-bf.1.cs.gz</strong> (2K) <a href="https://forum.world.st/attachment/134810/0/bltBltLockFix-bf.1.cs.gz" target="_top" rel="nofollow" link="external">Download Attachment</a></div><!--end-attachments-->
tag:forum.world.st,2006:post-134808Re: Re: newbie trouble building Squeak VM on Mac2006-07-03T14:08:37Z2006-07-03T14:08:37ZMichael Haupt-3
Hi Ian,
<br/><br/>On 7/3/06, Ian Piumarta <<a href="/user/SendEmail.jtp?type=node&node=134808&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:
<br/>> The usual reason for confusion about gl.h availability is that the
<br/>> build cannot find the xmkmf program. If you do have the X11 SDK
<br/>> installed then make absolutely sure /usr/X11R6/bin is in your PATH
<br/>> before you try to build the VM.
<br/><br/>thank you very much! Indeed, the X11 bin directory is not in the path,
<br/>so I'll try it once more with that. (Even though it works fine with
<br/>the --without-x option...)
<br/><br/>Best,
<br/><br/>Michael
<br/>
tag:forum.world.st,2006:post-134807Re: newbie trouble building Squeak VM on Mac2006-07-03T14:05:02Z2006-07-03T14:05:02ZIan Piumarta
Hi Michael,
<br/><br/>> /Users/haupt/squeakvm/squeak-svn/platforms/unix/plugins/
<br/>> B3DAcceleratorPlugin/sqUnixOpenGL.h:26:7:
<br/>> error: #error *** cannot find gl.h
<br/>>
<br/>> Huh. Apparently the configure script thought there was OpenGL on the
<br/>> machine, didn't it? Anyway, where / how can I obtain that file
<br/><br/>If you're building vm-display-X11 then gl.h is /usr/X11R6/include/GL/
<br/>gl.h. It comes with the X11 SDK.
<br/><br/>For vm-display-Quartz the file is part of the OpenGL framework: /Sys/
<br/>Lib/Frameworks/OpenGL.framework/Headers/gl.h. It comes with Mac OS X.
<br/><br/>The usual reason for confusion about gl.h availability is that the
<br/>build cannot find the xmkmf program. If you do have the X11 SDK
<br/>installed then make absolutely sure /usr/X11R6/bin is in your PATH
<br/>before you try to build the VM.
<br/><br/>Cheers,
<br/>Ian
<br/><br/>
tag:forum.world.st,2006:post-134809Re: newbie trouble building Squeak VM on Mac2006-07-03T14:01:43Z2006-07-03T14:01:43ZMichael Haupt-3
Hi again,
<br/><br/>On 7/3/06, Michael Haupt <<a href="/user/SendEmail.jtp?type=node&node=134809&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:
<br/>> I have checked out the latest VM sources from svn today, run the
<br/>> configure script (for the unix platform - I have a G4 PowerBook
<br/>> running Mac OS X 10.4.7), and issued "make Squeak.app".
<br/>>
<br/>> Eventually, the build stops with an error:
<br/>>
<br/>> /Users/haupt/squeakvm/squeak-svn/platforms/unix/plugins/B3DAcceleratorPlugin/sqUnixOpenGL.h:26:7:
<br/>> error: #error *** cannot find gl.h
<br/><br/>now that was a stupid question. :-)
<br/><br/>Running configure with the --without-x option did the trick. Quite obviously so.
<br/><br/>Best,
<br/><br/>Michael
<br/>
tag:forum.world.st,2006:post-134806newbie trouble building Squeak VM on Mac2006-07-03T10:24:09Z2006-07-03T10:24:09ZMichael Haupt-3
Hi,
<br/><br/>it's my first attempt ever to actually build a Squeak VM, hence the
<br/>crosspost to both the beginners' and VM dev lists.
<br/><br/>I have checked out the latest VM sources from svn today, run the
<br/>configure script (for the unix platform - I have a G4 PowerBook
<br/>running Mac OS X 10.4.7), and issued "make Squeak.app".
<br/><br/>Eventually, the build stops with an error:
<br/><br/>/Users/haupt/squeakvm/squeak-svn/platforms/unix/plugins/B3DAcceleratorPlugin/sqUnixOpenGL.h:26:7:
<br/>error: #error *** cannot find gl.h
<br/><br/>Huh. Apparently the configure script thought there was OpenGL on the
<br/>machine, didn't it? Anyway, where / how can I obtain that file or
<br/>exclude OpenGL support?
<br/><br/>Thanks in advance,
<br/><br/>Michael
<br/>
tag:forum.world.st,2006:post-134805Re: InterpreterSimulator and friends2006-06-24T23:04:34Z2006-06-24T23:04:34ZMichael van der Gulik
Thanks for the quick reply!
<br/><br/>It might be useful adding the following information to SqueakVM.org:
<br/><br/>- How to find the Squeak-VM mailing list.
<br/><br/>- Where the code is and how to get it (i.e. svn://squeakvm.org/... and
<br/>SqueakMap).
<br/><br/>- How to contribute changes.
<br/><br/>Cheers,
<br/>Mikevdg.
<br/><br/>tim Rowledge wrote:
<br/><div class='shrinkable-quote'><br/>>
<br/>> On 23-Jun-06, at 8:49 PM, Michael van der Gulik wrote:
<br/>>
<br/>>> Hi all.
<br/>>>
<br/>>> Where is the latest stable version of VMMaker? Is it
<br/>>> VMMaker-3.8b6.mcz from SqueakMap
<br/>>
<br/>> Yes
<br/>>
<br/>>> , or VMMaker-tpr-5.mcz (which seems old) from SqueakSource.com?
<br/>>
<br/>> No - after a few attempts with squeaksource a long time ago I gave
<br/>> up; not particularly because of any fault but it simply didn't suit
<br/>> my working habits.
<br/>>
<br/>>> Or somewhere else?
<br/>>
<br/>> Nope. SM is it.
<br/>>
<br/>>>
<br/>>> I see that squeakvm.org has an SVN server, but where do you keep
<br/>>> your Monticello files?
<br/>>
<br/>> When the swiki is running (I can't access it right now) search for
<br/>> VMMaker and you should find all the documentation you need. If you
<br/>> don't, let us know what you think it missing and it has a chance of
<br/>> getting improved!
<br/>> I don't keep all the MC files publically accessible because
<br/>> intermediate states are normally not usable. Releases on SM are known
<br/>> to have built working VMs on at least two OSs.
<br/>>
<br/>>>
<br/>>> I've got a bug, probably in my code but maybe in the VM, involving
<br/>>> becomeForward:copyHash:. The primitive is failing for no apparant
<br/>>> reason. I plan to try running this code in the InterpreterSimulator
<br/>>> to find exactly why primitive 239 is failing.
<br/>>
<br/>> The immediate things I can think of involve some checks early in the
<br/>> prim that protect you against catastrophe.
<br/>> Comment from ObjectMemory>prepareForwardingTableForBecoming: array1
<br/>> with: array2 twoWay: twoWayFlag
<br/>> "Important note on multiple references to same object - since
<br/>> the preparation of
<br/>> fwdBlocks is NOT idempotent we get VM crashes if the same object
<br/>> is referenced more
<br/>> than once in such a way as to require multiple fwdBlocks.
<br/>> oop1 forwardBecome: oop1 is ok since only a single fwdBlock is
<br/>> needed.
<br/>> oop1 become: oop1 would fail because the second fwdBlock woudl
<br/>> not have the actual object
<br/>> header but rather the mutated ref to the first fwdBlock.
<br/>> Further problems can arise with an array1 or array2 that refer
<br/>> multiply to the same
<br/>> object. This would notbe expected input for programmer writen
<br/>> code but might arise from
<br/>> automatic usage such as in ImageSegment loading.
<br/>> To avoid the simple and rather common case of oop1 become*: oop1,
<br/>> we skip such pairs
<br/>> and simply avoid making fwdBlocks - it is redundant anyway"
<br/>>
<br/>>>
<br/>>> Currently I've tried both VMMaker-tpr.58.mcz and VMMaker-3.8b6.mcz,
<br/>>> but the InterpreterSimulator doesn't want to work.
<br/>>
<br/>>
<br/>> I make no guarantee on the state of InterpreterSimulator. I was under
<br/>> the impression that it was functional in the current version, mostly
<br/>> because of a lot of work Craig did to support his Spoon project. I
<br/>> simply don't have enough spare time to do all the work and the
<br/>> simulator is one area I have to leave for others to worry about.
<br/>>
<br/>>> I get a DNU, which I fixed, but then I get another DNU, which I
<br/>>> fixed, but then I got another, so I threw the whole thing away in
<br/>>> disgust. I have a bog standard 32-bit AMD-based PC running Ubuntu.
<br/>>
<br/>> Sometimes you just have to keep bashing those balrogs.
<br/>>
<br/>> tim
<br/>> --
<br/>> tim Rowledge; <a href="/user/SendEmail.jtp?type=node&node=134805&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>; <a href="http://www.rowledge.org/tim" target="_top" rel="nofollow" link="external">http://www.rowledge.org/tim</a><br/>> Press [ESC] to detonate or any other key to explode.
<br/>>
<br/>>
<br/>>
<br/>>
<br/>>
</div><br/>
tag:forum.world.st,2006:post-134803Re: ObjectiveCPlugin, VMMaker usage2006-06-24T21:02:31Z2006-06-24T21:02:31ZDamien Pollet
OK, following Goran's instructions at <a href="http://goran.krampe.se/blog" target="_top" rel="nofollow" link="external">http://goran.krampe.se/blog</a>, I
<br/>can now build a VM. But when I add a plugin (ObjC or GTK) I get
<br/>strange compile errors...
<br/><br/>for the ObjC plugin:
<br/><br/>In file included from Squeak-3.9-7/build/config.h:184,
<br/> from Squeak-3.9-7/platforms/Cross/vm/sqMemoryAccess.h:19,
<br/> from Squeak-3.9-7/platforms/Cross/vm/sqVirtualMachine.h:15,
<br/> from
<br/>Squeak-3.9-7/platforms/unix/plugins/ObjectiveCPlugin/sqUnixObjC.m:2:
<br/>Squeak-3.9-7/platforms/unix/vm/glibc.h:6: error: syntax error before 'c'
<br/>Squeak-3.9-7/platforms/unix/vm/glibc.h:6: error: syntax error before '&' token
<br/>Squeak-3.9-7/platforms/unix/vm/glibc.h:7: error: syntax error before 'c'
<br/>[...]
<br/><br/>is it a compiler problem, or some preprocessor stuff that the objc
<br/>compiler doesn't like ?
<br/><br/>for the GtkPlugin:
<br/><br/>Squeak-3.9-7/platforms/unix/plugins/GtkPlugin/sqUnixGtkPrims.c: In
<br/>function 'GenericCallback':
<br/>Squeak-3.9-7/platforms/unix/plugins/GtkPlugin/sqUnixGtkPrims.c:123:
<br/>error: 'struct VirtualMachine' has no member named 'callbackEnter'
<br/>Squeak-3.9-7/platforms/unix/plugins/GtkPlugin/sqUnixGtkPrims.c: In
<br/>function 'gReturnFromCallback':
<br/>Squeak-3.9-7/platforms/unix/plugins/GtkPlugin/sqUnixGtkPrims.c:149:
<br/>error: 'struct VirtualMachine' has no member named 'callbackLeave'
<br/><br/>This one is really funny because I grepped the sources (both 3.9-7 and
<br/>svn) and these identifiers appear nowhere else...
<br/><br/>I'm on Linux x86, using GNUstep for the Foundation libs. Any idea?
<br/><br/>--
<br/> Damien Pollet
<br/> type less, do more
<br/>
tag:forum.world.st,2006:post-134804InterpreterSimulator and friends2006-06-23T21:49:34Z2006-06-23T21:49:34ZMichael van der Gulik
Hi all.
<br/><br/>Where is the latest stable version of VMMaker? Is it VMMaker-3.8b6.mcz
<br/>from SqueakMap, or VMMaker-tpr-5.mcz (which seems old) from
<br/>SqueakSource.com? Or somewhere else?
<br/><br/>I see that squeakvm.org has an SVN server, but where do you keep your
<br/>Monticello files?
<br/><br/>I've got a bug, probably in my code but maybe in the VM, involving
<br/>becomeForward:copyHash:. The primitive is failing for no apparant
<br/>reason. I plan to try running this code in the InterpreterSimulator to
<br/>find exactly why primitive 239 is failing.
<br/><br/>Currently I've tried both VMMaker-tpr.58.mcz and VMMaker-3.8b6.mcz, but
<br/>the InterpreterSimulator doesn't want to work. I get a DNU, which I
<br/>fixed, but then I get another DNU, which I fixed, but then I got
<br/>another, so I threw the whole thing away in disgust. I have a bog
<br/>standard 32-bit AMD-based PC running Ubuntu.
<br/><br/>Mikevdg.
<br/><br/>
tag:forum.world.st,2006:post-134802ObjectiveCPlugin, VMMaker usage2006-06-16T16:53:23Z2006-06-16T16:53:23ZDamien Pollet
Hi,
<br/><br/>tonight I've been trying without success to build Alain's ObjectiveCPlugin:
<br/> <a href="http://lists.apple.com/archives/objc-language/2004/Apr/msg00002.html" target="_top" rel="nofollow" link="external">http://lists.apple.com/archives/objc-language/2004/Apr/msg00002.html</a><br/>I'm using the latest tarball of the VM source, VMMaker from SqueakMap,
<br/>and a 3.9 7033 image.
<br/><br/>I got VMM to generate an ObjectiveCPlugin.c file, but the build system
<br/>doesn't seem to see it, even after running make in unix/config,
<br/>re-configuring, and RTFMing:
<br/> <a href="http://squeakvm.org/unix/devel.html#html/devel.m4.3.1" target="_top" rel="nofollow" link="external">http://squeakvm.org/unix/devel.html#html/devel.m4.3.1</a><br/> <a href="http://minnow.cc.gatech.edu/squeak/VMMaker" target="_top" rel="nofollow" link="external">http://minnow.cc.gatech.edu/squeak/VMMaker</a><br/><br/>That's my first attempt at this kind of stunt, and I would welcome
<br/>pointers and suggestions :-)
<br/><br/>--
<br/> Damien Pollet
<br/> type less, do more
<br/>
tag:forum.world.st,2006:post-134799Re: VM (callback+variables) changes2006-06-13T23:11:16Z2006-06-13T23:11:16ZAndreas.Raab
Hi Rob -
<br/><br/>Rob Gayvert wrote:
<br/>> My callback usage is intense but of limited variety, so the callback ids
<br/>> are not much of a burden. Without an id, there would be no way to check
<br/>> whether the callbacks were being exited in the proper order. For some
<br/>> cases that might not be important, but it might also result in some
<br/>> nasty bugs. How about making it optional by passing a null value?
<br/><br/>Well, in this case let's just leave it the way it is. There is nothing
<br/>worse than somebody else (who is not using the interface) screwing up
<br/>your callback return ;-)
<br/><br/>> On the process management question, I'm afraid I don't understand this
<br/>> area well enough. Is your concern as aesthetic one, or are there
<br/>> performance or correctness issues with your current implementation?
<br/><br/>Well, I just kinda dislike the idea of an array holding onto a bunch of
<br/>processes without a way about reflecting about them. At some point this
<br/>is going to get us into trouble when somebody wonders why the heck this
<br/>process doesn't get garbage collected. It would be better if there were
<br/>an explicit reference to it somewhere. So I guess it ain't critical (and
<br/>requires some image-side support too).
<br/><br/>Cheers,
<br/> - Andreas
<br/>
tag:forum.world.st,2006:post-134798Re: VM (callback+variables) changes2006-06-13T13:29:52Z2006-06-13T13:29:52ZRob Gayvert
My callback usage is intense but of limited variety, so the callback ids
<br/>are not much of a burden. Without an id, there would be no way to check
<br/>whether the callbacks were being exited in the proper order. For some
<br/>cases that might not be important, but it might also result in some
<br/>nasty bugs. How about making it optional by passing a null value?
<br/><br/>On the process management question, I'm afraid I don't understand this
<br/>area well enough. Is your concern as aesthetic one, or are there
<br/>performance or correctness issues with your current implementation?
<br/><br/>.. Rob
<br/><br/><br/>Andreas Raab wrote:
<div class='shrinkable-quote'><br/>> Hi Rob -
<br/>>
<br/>> Good to hear it works. There are two things that bothers me slightly and
<br/>> I'd like to get some feedback from someone who's been in that area
<br/>> before: First, the callback identifier. While it seems a good safeguard
<br/>> at first it gets into ones way pretty quickly (like in the example
<br/>> plugin where the absence of callback-id management makes it impossible
<br/>> to have more than one callback). So... do you think it's worthwhile to
<br/>> keep it and force people to go through the hoops of maintaining it?
<br/>>
<br/>> Second, I'm somewhat unhappy about the management of the suspended
<br/>> processs. I am wondering if we shouldn't use a semaphore in the
<br/>> splObjects for this purpose and link/unlink properly. This has the
<br/>> disadvantage that some image-side changes are required but it might be
<br/>> worth it for better house-keeping.
<br/>>
<br/>> Comments welcome!
<br/>> - Andreas
<br/>>
<br/>> Rob Gayvert wrote:
<br/>>
<br/>>> Andreas,
<br/>>>
<br/>>> This looks great. I tried this out with a fresh 3.9-7033 image and
<br/>>> latest Win32 VM source, and your example worked as advertised. It also
<br/>>> works fine as a replacement for my wxSqueak setjmp/longjmp calls, and
<br/>>> removes the need for an extra semaphore on the calling process. Thanks!
<br/>>>
<br/>>> .. Rob
<br/>>>
<br/>>>
<br/>>> Andreas Raab wrote:
<br/>>>
<br/>>>> Hi Folks -
<br/>>>>
<br/>>>> Attached my proposed changes for both, the variable tracking as well
<br/>>>> as the callback support. I'll respond in the individual threads about
<br/>>>> more specific issues; let's leave this one to discuss the more
<br/>>>> "mechanical" issues if there are any. Included files:
<br/>>>>
<br/>>>> - ExtraGCRoots.cs: The change set for tracking variables in plugins
<br/>>>> - Callbacks.cs: The change set for VM callback support
<br/>>>> - ExampleCallbacks.cs: An example plugin making use of both of the
<br/>>>> above features
<br/>>>> - sqVirtualMachine[.h|.c]: The (updated) VM proxy
<br/>>>>
<br/>>>> If you install all of the above and build a complete VM you should be
<br/>>>> able to execute the ExampleCallbackPlugin's exampleCallback and
<br/>>>> successfully compute 3+4 using a callback.
<br/>>>>
<br/>>>> Let me know if you have any problems.
<br/>>>>
<br/>>>> Cheers,
<br/>>>> - Andreas
<br/>>>>
<br/>>>>
<br/>>>
<br/>>>
<br/>>>
<br/>>
</div><br/><br/>
tag:forum.world.st,2006:post-134797Re: VM (callback+variables) changes2006-06-12T14:36:57Z2006-06-12T14:36:57ZAndreas.Raab
Hi Rob -
<br/><br/>Good to hear it works. There are two things that bothers me slightly and
<br/>I'd like to get some feedback from someone who's been in that area
<br/>before: First, the callback identifier. While it seems a good safeguard
<br/>at first it gets into ones way pretty quickly (like in the example
<br/>plugin where the absence of callback-id management makes it impossible
<br/>to have more than one callback). So... do you think it's worthwhile to
<br/>keep it and force people to go through the hoops of maintaining it?
<br/><br/>Second, I'm somewhat unhappy about the management of the suspended
<br/>processs. I am wondering if we shouldn't use a semaphore in the
<br/>splObjects for this purpose and link/unlink properly. This has the
<br/>disadvantage that some image-side changes are required but it might be
<br/>worth it for better house-keeping.
<br/><br/>Comments welcome!
<br/> - Andreas
<br/><br/>Rob Gayvert wrote:
<div class='shrinkable-quote'><br/>> Andreas,
<br/>>
<br/>> This looks great. I tried this out with a fresh 3.9-7033 image and
<br/>> latest Win32 VM source, and your example worked as advertised. It also
<br/>> works fine as a replacement for my wxSqueak setjmp/longjmp calls, and
<br/>> removes the need for an extra semaphore on the calling process. Thanks!
<br/>>
<br/>> .. Rob
<br/>>
<br/>>
<br/>> Andreas Raab wrote:
<br/>>> Hi Folks -
<br/>>>
<br/>>> Attached my proposed changes for both, the variable tracking as well
<br/>>> as the callback support. I'll respond in the individual threads about
<br/>>> more specific issues; let's leave this one to discuss the more
<br/>>> "mechanical" issues if there are any. Included files:
<br/>>>
<br/>>> - ExtraGCRoots.cs: The change set for tracking variables in plugins
<br/>>> - Callbacks.cs: The change set for VM callback support
<br/>>> - ExampleCallbacks.cs: An example plugin making use of both of the
<br/>>> above features
<br/>>> - sqVirtualMachine[.h|.c]: The (updated) VM proxy
<br/>>>
<br/>>> If you install all of the above and build a complete VM you should be
<br/>>> able to execute the ExampleCallbackPlugin's exampleCallback and
<br/>>> successfully compute 3+4 using a callback.
<br/>>>
<br/>>> Let me know if you have any problems.
<br/>>>
<br/>>> Cheers,
<br/>>> - Andreas
<br/>>>
<br/>>>
<br/>>
<br/>>
<br/>>
<br/></div>
tag:forum.world.st,2006:post-134796Re: VM (callback+variables) changes2006-06-12T07:14:30Z2006-06-12T07:14:30ZRob Gayvert
Andreas,
<br/><br/>This looks great. I tried this out with a fresh 3.9-7033 image and
<br/>latest Win32 VM source, and your example worked as advertised. It also
<br/>works fine as a replacement for my wxSqueak setjmp/longjmp calls, and
<br/>removes the need for an extra semaphore on the calling process. Thanks!
<br/><br/>.. Rob
<br/><br/><br/>Andreas Raab wrote:
<div class='shrinkable-quote'><br/>> Hi Folks -
<br/>>
<br/>> Attached my proposed changes for both, the variable tracking as well as
<br/>> the callback support. I'll respond in the individual threads about more
<br/>> specific issues; let's leave this one to discuss the more "mechanical"
<br/>> issues if there are any. Included files:
<br/>>
<br/>> - ExtraGCRoots.cs: The change set for tracking variables in plugins
<br/>> - Callbacks.cs: The change set for VM callback support
<br/>> - ExampleCallbacks.cs: An example plugin making use of both of the above
<br/>> features
<br/>> - sqVirtualMachine[.h|.c]: The (updated) VM proxy
<br/>>
<br/>> If you install all of the above and build a complete VM you should be
<br/>> able to execute the ExampleCallbackPlugin's exampleCallback and
<br/>> successfully compute 3+4 using a callback.
<br/>>
<br/>> Let me know if you have any problems.
<br/>>
<br/>> Cheers,
<br/>> - Andreas
<br/>>
<br/>>
</div><br/><br/>
tag:forum.world.st,2006:post-134801Re: Squeak port to Amiga progress 6-102006-06-10T21:48:24Z2006-06-10T21:48:24ZTim Johnson-6
<br/>On Jun 10, 2006, at 6:44 PM, Tim Johnson wrote:
<br/><br/>> A sticking point right now is noticeable on the current screenshot.
<br/>> After the image has loaded with its initial project setup, any
<br/>> newly-opened windows (browser, transcript, or zooming any of the Play
<br/>> With Me's) causes two window gadgets to appear, but no actual window.
<br/>> Nicely, PopUpMenus work great. I am at a loss.
<br/><br/>Whoops! Fixed this... changed a few #defines in sqConfig.h and deleted
<br/>old object files... *blush*
<br/><br/>> Also I have not yet dug deeply into the file code. I have a feeling
<br/>> my directory delineators will not work, as the Amiga uses a
<br/>> combination of :'s and /'s; i.e. "DH0:Development/Squeak/SqueakVM".
<br/>> Why this would keep a browser from opening, I am not sure.
<br/><br/>Thanks to a tip from Mr. Rowledge, I'll be able to whip up some file
<br/>directory support...
<br/><br/>Cheers,
<br/>Tim
<br/><br/>
tag:forum.world.st,2006:post-134800Squeak port to Amiga progress 6-102006-06-10T17:44:10Z2006-06-10T17:44:10ZTim Johnson-6
Hello Everyone,
<br/><br/>As of today I have speedy bitmap display working correctly, through the
<br/>use of the Amiga system's native WriteChunkyPixels() function and
<br/>built-in clipping functionality of the layers library. Mouse clicking
<br/>works and windows can be moved around successfully, scroll-bars scroll,
<br/>text can be selected.
<br/><br/><a href="http://metaphorse.com/amiga/squeak/" target="_top" rel="nofollow" link="external">http://metaphorse.com/amiga/squeak/</a><br/><br/>Alas, the colors are wrong, as I have not yet done any color mapping.
<br/>I also seem to be stuck to 8-bit depths with this 2.3 VM, which is
<br/>strange, but may make my life easier right now. (I believe that the
<br/>Amiga's graphics system will automatically handle writing different
<br/>bit-depths to any depth screen, which would be nice. I am crossing my
<br/>fingers. I have been able to use this 8-bit display on 8-bit and
<br/>15-bit displays with no changed code).
<br/><br/>A sticking point right now is noticeable on the current screenshot.
<br/>After the image has loaded with its initial project setup, any
<br/>newly-opened windows (browser, transcript, or zooming any of the Play
<br/>With Me's) causes two window gadgets to appear, but no actual window.
<br/>Nicely, PopUpMenus work great. I am at a loss.
<br/><br/>Also I have not yet dug deeply into the file code. I have a feeling my
<br/>directory delineators will not work, as the Amiga uses a combination of
<br/>:'s and /'s; i.e. "DH0:Development/Squeak/SqueakVM". Why this would
<br/>keep a browser from opening, I am not sure.
<br/><br/>Thanks everyone for your help so far. This is turning out to be quite
<br/>the adventure.
<br/><br/>Cheers,
<br/>Tim J.
<br/><br/>
tag:forum.world.st,2006:post-134790Re: [Fwd: Re: Keeping oops across primitives]2006-06-09T16:29:18Z2006-06-09T16:29:18ZAndreas.Raab
Tony Garnock-Jones wrote:
<br/>> Andreas Raab wrote:
<br/>>> Actually, this is an interesting thought. I have the need for managing a
<br/>>> dynamic array of roots but this could be handled just as easily by
<br/>>> tracking a variable pointing to a Squeak array.
<br/>>
<br/>> A variable in C is more-or-less a one-place array, so perhaps supporting
<br/>> arrays is the simpler option?
<br/><br/>Turns out not. The code is much simpler supporting just individual oop
<br/>locations (variables) so I decided to go with the following interface:
<br/><br/>sqInt oopVar; /* declare a global that we wish to track */
<br/><br/>{
<br/> ...
<br/> oopVar = vm->nilObject(); /* don't forget to initialize it !!! */
<br/> vm->addGCRoot(&oopVar); /* update it */
<br/> ...
<br/>}
<br/><br/>and to undo that
<br/><br/>{
<br/> ...
<br/> vm->removeGCRoot(&oopVar);
<br/> ...
<br/>}
<br/><br/>Cheers,
<br/> - Andreas
<br/>
tag:forum.world.st,2006:post-134783Re: Callbacks, simplified.2006-06-09T16:27:01Z2006-06-09T16:27:01ZAndreas.Raab
Hi Rob -
<br/><br/>Rob Gayvert wrote:
<div class='shrinkable-quote'><br/>> Andreas Raab wrote:
<br/>>> > Do you have any thoughts on how this could be handled better?
<br/>>>
<br/>>> How about we just suspend the currently active process when we
<br/>>> re-enter the interpreter? As long as the callback is synchronous (it
<br/>>> better be) this should work just fine, right?
<br/>>
<br/>> Yes, that should do the trick. I tried doing something like this awhile
<br/>> back, but couldn't get it to work reliably. I suspect the problem was
<br/>> that the process oop might move during a callback, in which case trying
<br/>> to resume it would cause a crash. It sounds like your other changes to
<br/>> keep oops across primitives would solve this.
</div><br/>Yes, although (if you look at the changes) I decided to keep this
<br/>internal in the VM because it is also necessary to ensure proper
<br/>resumption upon callback return (otherwise the return value will be
<br/>inaccurate). So the ultimate solution goes like this:
<br/><br/>Upon entering the callback, suspend the active process forcefully. Upon
<br/>returning from the callback resume the active process forcefully(!) so
<br/>that the "returning primitive" (e.g., the primitive which invoked the
<br/>callback) can set the proper return value.
<br/><br/>As far as I am aware that solves the trick completely (check out the
<br/>code) at the cost of requiring that callbacks are only entered during
<br/>the execution of primitives (meaning that the interpreter's state is
<br/>externalized).
<br/><br/>Cheers,
<br/> - Andreas
<br/>
tag:forum.world.st,2006:post-134795VM (callback+variables) changes2006-06-09T16:22:39Z2006-06-09T16:22:39ZAndreas.Raab
Hi Folks -
<br/><br/>Attached my proposed changes for both, the variable tracking as well as
<br/>the callback support. I'll respond in the individual threads about more
<br/>specific issues; let's leave this one to discuss the more "mechanical"
<br/>issues if there are any. Included files:
<br/><br/>- ExtraGCRoots.cs: The change set for tracking variables in plugins
<br/>- Callbacks.cs: The change set for VM callback support
<br/>- ExampleCallbacks.cs: An example plugin making use of both of the above
<br/>features
<br/>- sqVirtualMachine[.h|.c]: The (updated) VM proxy
<br/><br/>If you install all of the above and build a complete VM you should be
<br/>able to execute the ExampleCallbackPlugin's exampleCallback and
<br/>successfully compute 3+4 using a callback.
<br/><br/>Let me know if you have any problems.
<br/><br/>Cheers,
<br/> - Andreas
<br/><!--start-attachments--><div class="small"><br/><img src="https://forum.world.st/images/icon_attachment.gif" > <strong>ExtraGCRoots.cs.gz</strong> (5K) <a href="https://forum.world.st/attachment/134795/0/ExtraGCRoots.cs.gz" target="_top" rel="nofollow" link="external">Download Attachment</a><br/><img src="https://forum.world.st/images/icon_attachment.gif" > <strong>Callbacks.cs.gz</strong> (10K) <a href="https://forum.world.st/attachment/134795/1/Callbacks.cs.gz" target="_top" rel="nofollow" link="external">Download Attachment</a><br/><img src="https://forum.world.st/images/icon_attachment.gif" > <strong>ExampleCallbacks.cs.gz</strong> (2K) <a href="https://forum.world.st/attachment/134795/2/ExampleCallbacks.cs.gz" target="_top" rel="nofollow" link="external">Download Attachment</a><br/><img src="https://forum.world.st/images/icon_attachment.gif" > <strong>sqVirtualMachine.c</strong> (11K) <a href="https://forum.world.st/attachment/134795/3/sqVirtualMachine.c" target="_top" rel="nofollow" link="external">Download Attachment</a><br/><img src="https://forum.world.st/images/icon_attachment.gif" > <strong>sqVirtualMachine.h</strong> (8K) <a href="https://forum.world.st/attachment/134795/4/sqVirtualMachine.h" target="_top" rel="nofollow" link="external">Download Attachment</a></div><!--end-attachments-->
tag:forum.world.st,2006:post-134794Re: Inliner strangeness2006-06-09T11:15:44Z2006-06-09T11:15:44Zjohnmci
Actually I think I've seen
<br/><br/>self touch: foo
<br/><br/>which is removed by the CCodeGenerator, mind I've not check this to
<br/>see when it's removed in relationship to the inliner logic.
<br/><br/><br/>On 9-Jun-06, at 1:08 AM, Bert Freudenberg wrote:
<br/><div class='shrinkable-quote'><br/>> The pattern to avoid this inlining "strangeness" would be
<br/>>
<br/>> Interpreter>>getFoo
<br/>> ^self cCode: 'foo' inSmalltalk: [foo]
<br/>>
<br/>> so the inliner sees the second access.
<br/>>
<br/>> - Bert -
<br/>>
<br/>> Am 09.06.2006 um 00:47 schrieb John M McIntosh:
<br/>>
<br/>>> This was done on purpose years ago to inline all the variables in
<br/>>> the GC logic.
<br/>>>
<br/>>> If you have one accessor and one usage of the variable in another
<br/>>> routine and say not to inline the accessor,
<br/>>> then the inliner won't fold the global into a local variable.
<br/>>> Your code example follows the rules nicely because you've only
<br/>>> one usage of the foo variable we can see and why make it a global...
<br/>>>
<br/>>>
<br/>>> On 8-Jun-06, at 1:53 PM, Andreas Raab wrote:
<br/>>>
<br/>>>> Hi -
<br/>>>>
<br/>>>> I don't know if this behavior has been in the CCode inliner
<br/>>>> before but I just noticed that the inliner will forcefully
<br/>>>> convert iVars to temps if that iVar is only explicitly referred
<br/>>>> to in a single method. Like, for example here:
<br/>>>>
<br/>>>> Interpreter>>getFoo
<br/>>>> ^self cCode: 'foo'
<br/>>>>
<br/>>>> Interpreter>>setFoo: fooValue
<br/>>>> foo := fooValue.
<br/>>>>
<br/>>>> The above will cause the inliner to remove foo from the regular
<br/>>>> interpreter variables (even if declared via #declareCVarsIn:) and
<br/>>>> move it into #setFoo:. With the foreseeable result of creating
<br/>>>> total and utter nonsense in the resulting C code.
<br/>>>>
<br/>>>> Has anyone seen that before?
<br/>>>>
<br/>>>> Cheers,
<br/>>>> - Andreas
<br/>>
<br/>>
</div><br/>--
<br/>========================================================================
<br/>===
<br/>John M. McIntosh <<a href="/user/SendEmail.jtp?type=node&node=134794&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> 1-800-477-2659
<br/>Corporate Smalltalk Consulting Ltd. <a href="http://www.smalltalkconsulting.com" target="_top" rel="nofollow" link="external">http://www.smalltalkconsulting.com</a><br/>========================================================================
<br/>===
<br/><br/>
tag:forum.world.st,2006:post-134789Re: [Fwd: Re: Keeping oops across primitives]2006-06-09T03:01:32Z2006-06-09T03:01:32ZTony Garnock-Jones-2
Andreas Raab wrote:
<br/>> Actually, this is an interesting thought. I have the need for managing a
<br/>> dynamic array of roots but this could be handled just as easily by
<br/>> tracking a variable pointing to a Squeak array.
<br/><br/>A variable in C is more-or-less a one-place array, so perhaps supporting
<br/>arrays is the simpler option?
<br/><br/>{
<br/> sqInt myRoot = ...;
<br/> vm->addToVmRoots(&myRoot, 1, NULL);
<br/> ...
<br/> vm->addToVmRoots(NULL, 0, &myRoot);
<br/>}
<br/><br/><br/><br/>#define WITH_ROOT(vm, var, blk) \
<br/> { (vm)->addToVmRoots(&(var), 1, NULL); \
<br/> blk; \
<br/> (vm)->addToVmRoots(NULL, 0, &(var)); }
<br/><br/>{
<br/> sqInt myRoot2 = ...;
<br/> WITH_ROOT(vm, myRoot2, {
<br/> ...
<br/> });
<br/>}
<br/><br/>
tag:forum.world.st,2006:post-134793Re: Inliner strangeness2006-06-09T02:08:13Z2006-06-09T02:08:13ZBert Freudenberg-3
The pattern to avoid this inlining "strangeness" would be
<br/><br/>Interpreter>>getFoo
<br/> ^self cCode: 'foo' inSmalltalk: [foo]
<br/><br/>so the inliner sees the second access.
<br/><br/>- Bert -
<br/><br/>Am 09.06.2006 um 00:47 schrieb John M McIntosh:
<br/><div class='shrinkable-quote'><br/>> This was done on purpose years ago to inline all the variables in
<br/>> the GC logic.
<br/>>
<br/>> If you have one accessor and one usage of the variable in another
<br/>> routine and say not to inline the accessor,
<br/>> then the inliner won't fold the global into a local variable. Your
<br/>> code example follows the rules nicely because you've only
<br/>> one usage of the foo variable we can see and why make it a global...
<br/>>
<br/>>
<br/>> On 8-Jun-06, at 1:53 PM, Andreas Raab wrote:
<br/>>
<br/>>> Hi -
<br/>>>
<br/>>> I don't know if this behavior has been in the CCode inliner before
<br/>>> but I just noticed that the inliner will forcefully convert iVars
<br/>>> to temps if that iVar is only explicitly referred to in a single
<br/>>> method. Like, for example here:
<br/>>>
<br/>>> Interpreter>>getFoo
<br/>>> ^self cCode: 'foo'
<br/>>>
<br/>>> Interpreter>>setFoo: fooValue
<br/>>> foo := fooValue.
<br/>>>
<br/>>> The above will cause the inliner to remove foo from the regular
<br/>>> interpreter variables (even if declared via #declareCVarsIn:) and
<br/>>> move it into #setFoo:. With the foreseeable result of creating
<br/>>> total and utter nonsense in the resulting C code.
<br/>>>
<br/>>> Has anyone seen that before?
<br/>>>
<br/>>> Cheers,
<br/>>> - Andreas
</div><br/><br/>
tag:forum.world.st,2006:post-134792Re: Inliner strangeness2006-06-08T16:47:37Z2006-06-08T16:47:37Zjohnmci
This was done on purpose years ago to inline all the variables in the
<br/>GC logic.
<br/><br/>If you have one accessor and one usage of the variable in another
<br/>routine and say not to inline the accessor,
<br/>then the inliner won't fold the global into a local variable. Your
<br/>code example follows the rules nicely because you've only
<br/>one usage of the foo variable we can see and why make it a global...
<br/><br/><br/>On 8-Jun-06, at 1:53 PM, Andreas Raab wrote:
<br/><div class='shrinkable-quote'><br/>> Hi -
<br/>>
<br/>> I don't know if this behavior has been in the CCode inliner before
<br/>> but I just noticed that the inliner will forcefully convert iVars
<br/>> to temps if that iVar is only explicitly referred to in a single
<br/>> method. Like, for example here:
<br/>>
<br/>> Interpreter>>getFoo
<br/>> ^self cCode: 'foo'
<br/>>
<br/>> Interpreter>>setFoo: fooValue
<br/>> foo := fooValue.
<br/>>
<br/>> The above will cause the inliner to remove foo from the regular
<br/>> interpreter variables (even if declared via #declareCVarsIn:) and
<br/>> move it into #setFoo:. With the foreseeable result of creating
<br/>> total and utter nonsense in the resulting C code.
<br/>>
<br/>> Has anyone seen that before?
<br/>>
<br/>> Cheers,
<br/>> - Andreas
</div><br/>--
<br/>========================================================================
<br/>===
<br/>John M. McIntosh <<a href="/user/SendEmail.jtp?type=node&node=134792&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> 1-800-477-2659
<br/>Corporate Smalltalk Consulting Ltd. <a href="http://www.smalltalkconsulting.com" target="_top" rel="nofollow" link="external">http://www.smalltalkconsulting.com</a><br/>========================================================================
<br/>===
<br/><br/>
tag:forum.world.st,2006:post-134782Re: Callbacks, simplified.2006-06-08T14:57:18Z2006-06-08T14:57:18ZRob Gayvert
Andreas Raab wrote:
<br/>> > Do you have any thoughts on how this could be handled better?
<br/>>
<br/>> How about we just suspend the currently active process when we re-enter
<br/>> the interpreter? As long as the callback is synchronous (it better be)
<br/>> this should work just fine, right?
<br/><br/>Yes, that should do the trick. I tried doing something like this awhile
<br/>back, but couldn't get it to work reliably. I suspect the problem was
<br/>that the process oop might move during a callback, in which case trying
<br/>to resume it would cause a crash. It sounds like your other changes to
<br/>keep oops across primitives would solve this.
<br/><br/>.. Rob
<br/><br/><div class='shrinkable-quote'><br/>>
<br/>> Cheers,
<br/>> - Andreas
<br/>>
<br/>> Rob Gayvert wrote:
<br/>>
<br/>>> tim Rowledge wrote:
<br/>>>
<br/>>>>
<br/>>>> On 6-Jun-06, at 5:00 PM, Andreas Raab wrote:
<br/>>>>
<br/>>>>> tim Rowledge wrote:
<br/>>>>>
<br/>>>>>> How are you proposing to deal with the callback at the higher
<br/>>>>>> levels? Is the plugin going to be allowed to cons up a message and
<br/>>>>>> 'send' it? Or.....?
<br/>>>>>
<br/>>>>>
<br/>>>>>
<br/>>>>> This should be up to the plugin. I can't think of a good interface
<br/>>>>> right now given that we don't have enough examples to look at and
<br/>>>>> learn from. Personally, I'm just signaling a semaphore before the
<br/>>>>> callback and have the image "pull up" the arguments via primitives.
<br/>>>>> This avoids the need to do too much at the primitive level.
<br/>>>>
<br/>>>>
<br/>>>>
<br/>>>> So would simply using the normal semaphore signalling be ok? We
<br/>>>> already have external semaphore capability so it would certainly be
<br/>>>> simple to provide! If we implemented callbacks by taking a block (or
<br/>>>> a MessageSend?), making a Process that will use it, make the process
<br/>>>> wait on a Semaphore and pass the semaphore index down to the
<br/>>>> plugin, then signalling the semaphore would run the block/whatever
<br/>>>> and presumably ask the plugin for relevant arguments. As long as it
<br/>>>> can be non-synchronous that should work for a lot of cases, surely?
<br/>>>>
<br/>>>
<br/>>> Hi guys,
<br/>>>
<br/>>> This is basically what I'm currently doing in wxSqueak. I have two
<br/>>> different flavors of callbacks, one for event loops and another for
<br/>>> other callbacks. The only real difference between these two is that
<br/>>> the non-event callbacks have to handle a variety of arguments. In both
<br/>>> cases the callbacks must appear to be handled synchronously from the
<br/>>> viewpoint of the (wx) calling routine. The only serious difficulty
<br/>>> I've encountered with this scheme is with nested callbacks. I have a
<br/>>> number of cases where a callback handler triggers another callback.
<br/>>> The problem is that when the second callback is handled, the process
<br/>>> in which the first primitive was called may resume prematurely,
<br/>>> causing the first primitive to get an incorrect return value.
<br/>>>
<br/>>> The only way I found to reliably handle this scenario is to have the
<br/>>> first primitive pass in another semaphore and a pointer in which to
<br/>>> store the return value, and have the primitive signal the semphore
<br/>>> when it's done. It's a bit ugly, but it does work. It would be much
<br/>>> better if the processes involved could be controlled by the framework.
<br/>>>
<br/>>> Do you have any thoughts on how this could be handled better?
<br/>>>
<br/>>> .. Rob
<br/>>>
<br/>>>
<br/>>>
<br/>>>
<br/>>>
<br/>>>
<br/>>
</div><br/>
tag:forum.world.st,2006:post-134791Inliner strangeness2006-06-08T14:53:33Z2006-06-08T14:53:33ZAndreas.Raab
Hi -
<br/><br/>I don't know if this behavior has been in the CCode inliner before but I
<br/>just noticed that the inliner will forcefully convert iVars to temps if
<br/>that iVar is only explicitly referred to in a single method. Like, for
<br/>example here:
<br/><br/>Interpreter>>getFoo
<br/> ^self cCode: 'foo'
<br/><br/>Interpreter>>setFoo: fooValue
<br/> foo := fooValue.
<br/><br/>The above will cause the inliner to remove foo from the regular
<br/>interpreter variables (even if declared via #declareCVarsIn:) and move
<br/>it into #setFoo:. With the foreseeable result of creating total and
<br/>utter nonsense in the resulting C code.
<br/><br/>Has anyone seen that before?
<br/><br/>Cheers,
<br/> - Andreas
<br/>
tag:forum.world.st,2006:post-134788[Fwd: Re: Keeping oops across primitives]2006-06-08T13:33:30Z2006-06-08T13:33:30ZAndreas.Raab
Oops, I sent this accidentally only to Bryce...
<br/><br/>-------- Original Message --------
<br/>Subject: Re: Keeping oops across primitives
<br/>Date: Thu, 08 Jun 2006 10:50:54 -0700
<br/>From: Andreas Raab <<a href="/user/SendEmail.jtp?type=node&node=134788&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/>To: Bryce Kampjes <<a href="/user/SendEmail.jtp?type=node&node=134788&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/>References: <<a href="/user/SendEmail.jtp?type=node&node=134788&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/><<a href="/user/SendEmail.jtp?type=node&node=134788&i=3" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/><br/>Hi Bryce -
<br/><div class='shrinkable-quote'><br/>> > Question: Does anyone see a serious problem with the above proposal? I'm
<br/>> > about to implement this right away so if you see an issue with it,
<br/>> > please let me know.
<br/>>
<br/>> Your solution sounds fine. I'd prefer to be able to register variables
<br/>> as roots rather than having to place things in arrays for my use. But
<br/>> then I'm just tracking entry points rather than individual objects (a
<br/>> dictionary that maps classes and selectors to natively compiled
<br/>> methods and an array of objects so natively compiled code can access
<br/>> objects).
</div><br/>Actually, this is an interesting thought. I have the need for managing a
<br/>dynamic array of roots but this could be handled just as easily by
<br/>tracking a variable pointing to a Squeak array.
<br/><br/>So, does anyone feel strongly about going either way?
<br/><br/>Cheers,
<br/> - Andreas
<br/><br/>
tag:forum.world.st,2006:post-134781Re: Callbacks, simplified.2006-06-08T12:03:12Z2006-06-08T12:03:12ZAndreas.Raab
> Do you have any thoughts on how this could be handled better?
<br/><br/>How about we just suspend the currently active process when we re-enter
<br/>the interpreter? As long as the callback is synchronous (it better be)
<br/>this should work just fine, right?
<br/><br/>Cheers,
<br/> - Andreas
<br/><br/>Rob Gayvert wrote:
<div class='shrinkable-quote'><br/>> tim Rowledge wrote:
<br/>>>
<br/>>> On 6-Jun-06, at 5:00 PM, Andreas Raab wrote:
<br/>>>
<br/>>>> tim Rowledge wrote:
<br/>>>>
<br/>>>>> How are you proposing to deal with the callback at the higher
<br/>>>>> levels? Is the plugin going to be allowed to cons up a message and
<br/>>>>> 'send' it? Or.....?
<br/>>>>
<br/>>>>
<br/>>>> This should be up to the plugin. I can't think of a good interface
<br/>>>> right now given that we don't have enough examples to look at and
<br/>>>> learn from. Personally, I'm just signaling a semaphore before the
<br/>>>> callback and have the image "pull up" the arguments via primitives.
<br/>>>> This avoids the need to do too much at the primitive level.
<br/>>>
<br/>>>
<br/>>> So would simply using the normal semaphore signalling be ok? We
<br/>>> already have external semaphore capability so it would certainly be
<br/>>> simple to provide! If we implemented callbacks by taking a block (or
<br/>>> a MessageSend?), making a Process that will use it, make the process
<br/>>> wait on a Semaphore and pass the semaphore index down to the plugin,
<br/>>> then signalling the semaphore would run the block/whatever and
<br/>>> presumably ask the plugin for relevant arguments. As long as it can
<br/>>> be non-synchronous that should work for a lot of cases, surely?
<br/>>>
<br/>>
<br/>> Hi guys,
<br/>>
<br/>> This is basically what I'm currently doing in wxSqueak. I have two
<br/>> different flavors of callbacks, one for event loops and another for
<br/>> other callbacks. The only real difference between these two is that the
<br/>> non-event callbacks have to handle a variety of arguments. In both cases
<br/>> the callbacks must appear to be handled synchronously from the viewpoint
<br/>> of the (wx) calling routine. The only serious difficulty I've
<br/>> encountered with this scheme is with nested callbacks. I have a number
<br/>> of cases where a callback handler triggers another callback. The problem
<br/>> is that when the second callback is handled, the process in which the
<br/>> first primitive was called may resume prematurely, causing the first
<br/>> primitive to get an incorrect return value.
<br/>>
<br/>> The only way I found to reliably handle this scenario is to have the
<br/>> first primitive pass in another semaphore and a pointer in which to
<br/>> store the return value, and have the primitive signal the semphore when
<br/>> it's done. It's a bit ugly, but it does work. It would be much better if
<br/>> the processes involved could be controlled by the framework.
<br/>>
<br/>> Do you have any thoughts on how this could be handled better?
<br/>>
<br/>> .. Rob
<br/>>
<br/>>
<br/>>
<br/>>
<br/>>
<br/>>
<br/></div>
tag:forum.world.st,2006:post-134786Re: InterpreterProxy>>signed64BitIntegerFor: badly broken2006-06-07T23:02:40Z2006-06-07T23:02:40Ztimrowledge
<br/>On 7-Jun-06, at 6:58 PM, Andreas Raab wrote:
<br/><div class='shrinkable-quote'><br/>> Hi Guys -
<br/>>
<br/>> I don't know if you ever used the above method but it's horribly,
<br/>> horribly broken. I wrote a little test primitive (see below) that
<br/>> simply used signed64BitIntegerFor(signed64BitValueOf(oop)) and then
<br/>> a loop like here:
<br/>>
<br/>> 0 to: 63 do:[:i|
<br/>> n := 1 bitShift: i.
<br/>> (self test64BitInt: n) = n ifFalse:[self halt: i].
<br/>> ].
<br/>>
<br/>> Starting from i = 31 Every. Last. Result. Is Wrong. Can you imagine?
<br/>>
<br/>> It gets even better, since it's broken in different ways: For i=31
<br/>> the result is negated, for everything beyound 31 the resulting
<br/>> large integer is non-normalized (and therefore not comparing
<br/>> correctly).
<br/>>
<br/>> Any ideas?
</div><br/>Well for starters the signed64BitIntegerFor: code assumes an 8 byte
<br/>large integer no matter what the value being converted so that's
<br/>going to cause your non-normalized problem. I'm fairly sure you can
<br/>work out how to fix that bit quickly enough.
<br/><br/>I'm not absolutely sure(and I can't be bothered to look it up right
<br/>now) but wouldn't 1<<31 be a negative value when treated as a 32 bit
<br/>word? It looks to me as if signed32BitInteger might be the wrong
<br/>thing to use in signed64itInteger, with positive32BitInteger a bit
<br/>more plausible.
<br/><br/>I have vague memories of when this code was written, mostly of it
<br/>being related to long file pointers in OSs I wasn't running at that
<br/>time. Thus I would have relied upon testing by involved parties and
<br/>taken their word as to the viability of the code. I guess that once
<br/>again the value of good tests is demonstrated.
<br/><br/>tim
<br/>--
<br/>tim Rowledge; <a href="/user/SendEmail.jtp?type=node&node=134786&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>; <a href="http://www.rowledge.org/tim" target="_top" rel="nofollow" link="external">http://www.rowledge.org/tim</a><br/>Strange OpCodes: VMB: Verify, then Make Bad
<br/><br/><br/>
tag:forum.world.st,2006:post-134787Re: InterpreterProxy>>signed64BitIntegerFor: badly broken2006-06-07T20:00:07Z2006-06-07T20:00:07ZAndreas.Raab
PS. Once we fix that, let's increase the VM_Proxy's minor version. I
<br/>need that function to work correctly.
<br/><br/>Cheers,
<br/> - Andreas
<br/><br/>Andreas Raab wrote:
<div class='shrinkable-quote'><br/>> Hi Guys -
<br/>>
<br/>> I don't know if you ever used the above method but it's horribly,
<br/>> horribly broken. I wrote a little test primitive (see below) that simply
<br/>> used signed64BitIntegerFor(signed64BitValueOf(oop)) and then a loop like
<br/>> here:
<br/>>
<br/>> 0 to: 63 do:[:i|
<br/>> n := 1 bitShift: i.
<br/>> (self test64BitInt: n) = n ifFalse:[self halt: i].
<br/>> ].
<br/>>
<br/>> Starting from i = 31 Every. Last. Result. Is Wrong. Can you imagine?
<br/>>
<br/>> It gets even better, since it's broken in different ways: For i=31 the
<br/>> result is negated, for everything beyound 31 the resulting large integer
<br/>> is non-normalized (and therefore not comparing correctly).
<br/>>
<br/>> Any ideas?
<br/>>
<br/>> - Andreas
<br/>>
<br/>> PS. The primitive:
<br/>>
<br/>> TestPlugin>>testSigned64BitInt
<br/>> | oop |
<br/>> self export: true.
<br/>> interpreterProxy methodArgumentCount = 1
<br/>> ifFalse:[^interpreterProxy primitiveFail].
<br/>> oop := interpreterProxy stackValue: 0.
<br/>> oop := interpreterProxy signed64BitIntegerFor: (interpreterProxy
<br/>> signed64BitValueOf: oop).
<br/>> interpreterProxy failed ifFalse:[
<br/>> interpreterProxy pop: 2 thenPush: oop.
<br/>> ].
<br/>>
<br/>>
<br/></div>
tag:forum.world.st,2006:post-134785InterpreterProxy>>signed64BitIntegerFor: badly broken2006-06-07T19:58:00Z2006-06-07T19:58:00ZAndreas.Raab
Hi Guys -
<br/><br/>I don't know if you ever used the above method but it's horribly,
<br/>horribly broken. I wrote a little test primitive (see below) that simply
<br/>used signed64BitIntegerFor(signed64BitValueOf(oop)) and then a loop like
<br/>here:
<br/><br/> 0 to: 63 do:[:i|
<br/> n := 1 bitShift: i.
<br/> (self test64BitInt: n) = n ifFalse:[self halt: i].
<br/> ].
<br/><br/>Starting from i = 31 Every. Last. Result. Is Wrong. Can you imagine?
<br/><br/>It gets even better, since it's broken in different ways: For i=31 the
<br/>result is negated, for everything beyound 31 the resulting large integer
<br/>is non-normalized (and therefore not comparing correctly).
<br/><br/>Any ideas?
<br/><br/> - Andreas
<br/><br/>PS. The primitive:
<br/><br/>TestPlugin>>testSigned64BitInt
<br/> | oop |
<br/> self export: true.
<br/> interpreterProxy methodArgumentCount = 1
<br/> ifFalse:[^interpreterProxy primitiveFail].
<br/> oop := interpreterProxy stackValue: 0.
<br/> oop := interpreterProxy signed64BitIntegerFor: (interpreterProxy
<br/>signed64BitValueOf: oop).
<br/> interpreterProxy failed ifFalse:[
<br/> interpreterProxy pop: 2 thenPush: oop.
<br/> ].
<br/>