Retested the FFI stuff.. All tests are green and my ODBC stuff works again! Thanks to all! Un gros merci à tous! Benoit St-Jean Yahoo! Messenger: bstjean Blog: lamneth.wordpress.com A standpoint is an intellectual horizon of radius zero. (Albert Einstein) From: Mariano Martinez Peck <[hidden email]> To: [hidden email] Sent: Tuesday, July 7, 2009 6:52:22 PM Subject: Re: [Pharo-project] FFI problem Ok, now you can close http://code.google.com/p/pharo/issues/detail?id=908 in 10372 On Tue, Jul 7, 2009 at 6:26 PM, Stéphane Ducasse <[hidden email]> wrote:
The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Mariano Martinez Peck
The reason that ifNil: is not found is that it is inlined. If you view
the bytecode representation of an ifNil: send, you see that this message is never sent. The search looks for symbols in the literal frame of compiled methods and hence does not find this special case. Cheers, Adrian On Jul 8, 2009, at 05:52 , Mariano Martinez Peck wrote: > 2009/7/7 Cameron Sanders <[hidden email]> > >> On Jul 7, 2009, at 7:39 PM, Mariano Martinez Peck wrote (below my >> original >> text): >> >> can you give us a concrete example? >> >> In my opinion, if you have a symbol with that text, it must be >> found by >> "senders of it". In VAST it is like that. >> So, if you have #ifNil: for me it is correct to be found. >> >> best, >> >> Mariano >> >> >> What you say makes sense for performance reasons. I just picked >> through >> those 10 methods more carefully, and they each contain the symbol >> #ifNil:, >> so the one error I thought I was seeing (of a match for a pattern of >> xxxIfNil:) is not what is causing them to be found. So, I'm glad >> you asked, >> as that forced me to recheck that aspect. Should it be called >> "search->methods referencing symbol (n)" or something -- I don't >> care about >> pesky details like that. >> > > You are welcome. > > > >> >> What matters to me is the failure to find my references/sends: >> >> My broken method (FaTableAccessor>>columnAt:) is just one of *many* >> places >> I have used #ifNil:, and is NOT being found. >> >> The search is only finding 10 methods in the entire system (in the >> classes >> Decompiler, MessageNode, MethodFinder, OCompletionTable, PSUIManager, >> RBMessageNode, RBProgramNode) that reference the symbol #ifNil:. >> >> Previously, this feature has worked for me as expected (to the best >> of my >> knowledge). But I can't guarantee that I have ever searched for >> #ifNil:. >> >> I just searched for collect:, and that turned up a more reasonable >> 1092 >> methods, some of which are mine. I am surprised there are not more >> uses of >> it, but at least it is a more credible number than "10". So maybe >> it is just >> something weird for the symbol ifNil:, which I can live with; that >> would >> make this a low priority issue, assuming it is working for most other >> symbols pretty well. >> > > Perhaps a lot of people does isNil ifTrue: instead of ifNil: hahaha > > >> >> Recap: I am selecting "ifNil:" (without the quotes) in a workspace, >> and >> using "extended search"->"senders of it (n)"; this is failing to find >> methods of mine that include the symbol (as a selector). >> > > Can you give me an example of your code that containg ifNil: and > that's is > not being found ? just to test it here. > > cheers, > > Mariano > > >> Happy Hunting, >> Cam >> >> >> >> On Tue, Jul 7, 2009 at 6:32 PM, Cameron Sanders < >> [hidden email]> wrote: >> >>> Having made some bozo statements lately, I am hesitant to even >>> inquire >>> (because I am probably doing something dumb), but... >>> >>> I noted an error in my code that read xxx isNumber ifNil: [...] and >>> figured that when I imported in from VisualWorks, I must have >>> "fixed" >>> things too hastily. Wondering where else I may have made this >>> error I >>> did the following on an iMac using the 10371web image recently >>> posted: >>> >>> In a workspace I typed and highlighted "ifNil:" --without the quotes >>> of course-- and selected "extended search...". >>> Then I selected "senders of it (n)", and to my surprise, not my >>> erroneous method was not displayed in the results. Ten (10) methods >>> turn up in the results, and some of them are not actually senders of >>> it; the non-senders may include the pattern in an array, or as a >>> substring of some symbol. >> >> >> >> >> >> >> >>> >>> >>> Is this a known defect? Previously (from images two months ago and >>> less) this searching worked as expected. >>> >>> A search of the defect db, using only the word "senders", gave me >>> this >>> (semi-related) issue: >>> >>> http://code.google.com/p/pharo/issues/detail?id=261&q=sendeifNilrs&colspec=ID%20Type%20Status%20Summary%20Milestone >>> <http://code.google.com/p/pharo/issues/detail?id=261&q=senders&colspec=ID%20Type%20Status%20Summary%20Milestone >>> > >>> >>> Thanks in advance, >>> Cam >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Thank you, that is informative! So, if a guy, a semi-newbie at that,
were to want to write his own search method to look for particular byte-code patterns (suggestive of an inlined ifNil:) ... what would be some useful examples or a good place to start learning? MethodFinder, or is there a better example? And, on a related note, if I more generally wanted to write a module to eject/translate-to Objective-C instead of C, where would be a good place to get started on that learning curve? (Are the classes that *once* ejected C code for the VM still functional? Are they in Pharo?) Thanks in advance, Cam On Jul 8, 2009, at 1:43 AM, Adrian Lienhard wrote: > The reason that ifNil: is not found is that it is inlined. If you view > the bytecode representation of an ifNil: send, you see that this > message is never sent. The search looks for symbols in the literal > frame of compiled methods and hence does not find this special case. > > Cheers, > Adrian > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
1) What classes should I look at to learn about the byte-code
generation? 2) What are good examples of code that handles/manipulates/processes the byte-code? e.g. like the code used for searching for symbol references in the byte-code, what is that called? (Is that MethodFinder stuff?) 2.b) And what is the name (& path) of the C module that actually implements the VM case statement (or whatever dispatch is used)? 3. Once upon a time there was some code that processed Slang ... but I have no idea whether that code is in Pharo, or completely antiquated in all versions. (And if gone from Pharo, what should I look for and in which version of Squeak?) A list of a few classes (in current use) would be greatly appreciated. Thanks in advance, Cam PS: reading through list archives can be painful, as they often either build on known information, or if you back up too far, the material - you later learn- is completely antiquated. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/7/8 Cameron Sanders <[hidden email]>:
> 1) What classes should I look at to learn about the byte-code > generation? > I think you'd better look at NewCompiler. Don't look at compiler implementation in its current state :) > 2) What are good examples of code that handles/manipulates/processes > the byte-code? e.g. like the code used for searching for symbol > references in the byte-code, what is that called? (Is that > MethodFinder stuff?) > There is InstructionStream, and of course see CompiledMethod itself. > 2.b) And what is the name (& path) of the C module that actually > implements the VM case statement (or whatever dispatch is used)? > VMMaker is _smalltalk_ package which implements such dispatch, and then translated to C & compiled to get a VM binary. Look for VMMaker package at squeaksource.com > 3. Once upon a time there was some code that processed Slang ... but I > have no idea whether that code is in Pharo, or completely antiquated > in all versions. (And if gone from Pharo, what should I look for and > in which version of Squeak?) > > A list of a few classes (in current use) would be greatly appreciated. > VMMaker: Interpreter, ObjectMemory Image: Compiler/Parser (but better look a NewCompiler) InstructionStream, ContextPart, CompiledMethod > Thanks in advance, > Cam > PS: reading through list archives can be painful, as they often either > build on known information, or if you back up too far, the material - > you later learn- is completely antiquated. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Awesome, thanks for the leads!
-Cam On Jul 8, 2009, at 3:43 PM, Igor Stasenko wrote: ... > VMMaker is _smalltalk_ package which implements such dispatch, and > then translated to C & compiled to get a VM binary. > Look for VMMaker package at squeaksource.com ... _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Igor Stasenko
BTW we should make sure that it is easy to load VMMaker
the last time I got a problem with Genie plugin. stef On Jul 8, 2009, at 9:43 PM, Igor Stasenko wrote: > 2009/7/8 Cameron Sanders <[hidden email]>: >> 1) What classes should I look at to learn about the byte-code >> generation? >> > I think you'd better look at NewCompiler. > Don't look at compiler implementation in its current state :) > >> 2) What are good examples of code that handles/manipulates/processes >> the byte-code? e.g. like the code used for searching for symbol >> references in the byte-code, what is that called? (Is that >> MethodFinder stuff?) >> > There is InstructionStream, and of course see CompiledMethod itself. > >> 2.b) And what is the name (& path) of the C module that >> actually >> implements the VM case statement (or whatever dispatch is used)? >> > VMMaker is _smalltalk_ package which implements such dispatch, and > then translated to C & compiled to get a VM binary. > Look for VMMaker package at squeaksource.com > >> 3. Once upon a time there was some code that processed Slang ... >> but I >> have no idea whether that code is in Pharo, or completely antiquated >> in all versions. (And if gone from Pharo, what should I look for and >> in which version of Squeak?) >> >> A list of a few classes (in current use) would be greatly >> appreciated. >> > VMMaker: Interpreter, ObjectMemory > Image: Compiler/Parser (but better look a NewCompiler) > InstructionStream, ContextPart, CompiledMethod > >> Thanks in advance, >> Cam >> PS: reading through list archives can be painful, as they often >> either >> build on known information, or if you back up too far, the material - >> you later learn- is completely antiquated. >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > > -- > Best regards, > Igor Stasenko AKA sig. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Cameron Sanders-3
On 08.07.2009, at 20:45, Cameron Sanders wrote: > 1) What classes should I look at to learn about the byte-code > generation? > These slides give an introduction: http://marcusdenker.de/talks/07SCGSmalltalk/11Bytecode.pdf > 2) What are good examples of code that handles/manipulates/processes > the byte-code? There are multiple parts of the system dealing with bytecode: 1) VM. This is SLANG, compiled to C, compiled to a Binary. 2) Compiler. Generates Bytecode. Here the old one is very strange (to me at least). Anthony's newcompiler is much easier to understand, This has a backend called "IR Builder" that can be used to generate bytecode easily. (Or to modify code on the level of bytecode abstraction, see http://scg.unibe.ch/research/bytesurgeon ) 3) Debugger / Simulator. This is in class ContextPart. A bytecode interpreter written in Smalltalk that the Debugger uses for stepping. > e.g. like the code used for searching for symbol > references in the byte-code, what is that called? (Is that > MethodFinder stuff?) > No. Check SystemNavigation, method #allCallsOn: Marcus -- Marcus Denker - http://marcusdenker.de PLEIAD Lab - Computer Science Department (DCC) - University of Chile _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Cameron Sanders-3
On Wed, Jul 08, 2009 at 04:44:16PM -0400, Cameron Sanders wrote:
> > On Jul 8, 2009, at 3:43 PM, Igor Stasenko wrote: > ... > > VMMaker is _smalltalk_ package which implements such dispatch, and > > then translated to C & compiled to get a VM binary. > > Look for VMMaker package at squeaksource.com > ... > > Awesome, thanks for the leads! > > -Cam > The VMMaker package is really a fundamental part of the original Squeak, but is now split out and maintained as a separate package. For background, read the "Back to the Future" paper as well as some of Tim Rowledge's writings (Stef's "free books" web site should have most of this, also search the Squeak swiki). You were mentioning Slang translation in your question - this is sort of a "late optimization" in which the interpreter, which is written in Smalltalk and which can be run in Smalltalk, is translated to C and linked to external support code for performance. But the VM itself, including the bytecode interpreter, is written in Smalltalk, and you can run it in Smalltalk (using InterpreterSimulator), and use the debugger to look at the actual bytecode interpretation as it happens. Dave _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Cameron Sanders-3
Hi Cameron,
2009/7/8 Cameron Sanders <[hidden email]> 2.b) And what is the name (& path) of the C module that actually I think the switch you're asking for is in the files interp.c and/or gnu-interp.c, in the function interpret(void). Cheers, Hernán _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |