I while ago, while studying Eliot's factorial copy example I made the mistake of assuming that since the sender of the MethodContext was the UndefinedObject (which is the Nil object) that that was why the sender was nil. Eliot corrected me, writing:
I spent some time trying to figure out exactly where that happens and I believe I have followed it to "system space" where I would like to leave things for now. If I am in fact correct. Following the code of Eliot's factorial copy example, The DoIt travels through user space, to the Compiler's Compiler >> evaluate: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock logged: logFlag and ends up at <primitive:188> in Object >>withArgs: argArray executeMethod: compiledMethod {A whole bunch of stuff happens in System Space that I am do not know how to trace yet--but eventually, the return must happen....so..} In the BlueBook on page 608, There is a section on Return Bytecodes where bytecode 123 does set the sender nil. Which exists on Squeak's Interpreter and is mapped to instance method Interpreter >> returnNil. and finally, Interpreter >> commonReturn that seems the most possible path to me. Conversely, any possibility of the sender being nilled in User Space would have to call ContextPart>>privSender: aContext Browsing the senders of that method paired with no apparent semaphores in the Compiler method, leads me to conclude it happens in system space. Does that sound like its in the ballpark? Details are not neccessary as my goal was to just account for every variable we see in a Context. thx tty _______________________________________________ VM-beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners |
On 10.01.2014, at 14:31, gettimothy <[hidden email]> wrote:
Yep: thisCntx := activeContext. [thisCntx = localCntx] whileFalse: ["climb up stack to localCntx" contextOfCaller := objectMemory fetchPointer: SenderIndex ofObject: thisCntx. "zap exited contexts so any future attempted use will be caught" objectMemory storePointerUnchecked: SenderIndex ofObject: thisCntx withValue: nilOop. objectMemory storePointerUnchecked: InstructionPointerIndex ofObject: thisCntx withValue: nilOop. reclaimableContextCount > 0 ifTrue: ["try to recycle this context" reclaimableContextCount := reclaimableContextCount - 1. objectMemory recycleContextIfPossible: thisCntx]. thisCntx := contextOfCaller]. - Bert - _______________________________________________ VM-beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners smime.p7s (5K) Download Attachment |
Free forum by Nabble | Edit this page |