Hi Ken,<br><br><div class="gmail_quote">On Thu, Jul 16, 2009 at 1:58 PM, Ken Causey <span dir="ltr"><<a href="mailto:ken@kencausey.com">ken@kencausey.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What '3.9 final image' are you referring to? I see none of these<br>
methods in 3.9-7067. Why are we talking about 3.9 anyway?</blockquote><div><br></div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>You reported a failure in trying to load the closure configuration in an image that was equipped with traits, specifically an MNU for variablesAndOffsetsDo:. I took the nearest traits-equipped image I have to hand, which is Squeak3.9-final-7067.image and looked. I was then able to explain that this method and a couple of others could be copied from Behavior & ClassDescription into TraitBehavior and TraitDescription to fix the problem.</div>
<div><br></div><div>Does that help?</div><div><br></div><div>best</div></span><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Eliot</span></div><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "></span> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<font color="#888888"><br>
Ken<br>
</font><div><div></div><div class="h5"><br>
On Thu, 2009-07-16 at 12:31 -0700, Eliot Miranda wrote:<br>
> So someone needs to implement variablesAndOffsetsDo: for TraitBehavior<br>
> analogous to Behavior>> variablesAndOffsetsDo:.<br>
> variablesAndOffsetsDo: is the interface I added between the compiler<br>
> and the class its compiling in to abstract away from instance<br>
> variable/slot implementation. See Encoder>>init:context:notifying:<br>
> ...<br>
> class variablesAndOffsetsDo:<br>
> [:variable "<String|CFieldDefinition>" :offset "<Integer|nil>" |<br>
> offset isNil<br>
> ifTrue: [scopeTable at: variable name put: (FieldNode new<br>
> fieldDefinition: variable)]<br>
> ifFalse: [scopeTable<br>
> at: variable<br>
> put: (offset >= 0<br>
> ifTrue: [InstanceVariableNode new<br>
> name: variable index: offset]<br>
> ifFalse: [MaybeContextInstanceVariableNode new<br>
> name: variable index: offset negated])]].<br>
> ...<br>
><br>
><br>
> FieldNode is the Tweak compiler extension that compiles Tweak property<br>
> access as message sends to slot accessors. The negative offset hack<br>
> allows ContextPart (actually InstructionStream and subclasses) to<br>
> access its instance variables specially, allowing the VM to hide<br>
> context-to-sack mapping and make contexts appear like normal objects<br>
> even though inside the VM they may actually be proxies for stack<br>
> frames.<br>
><br>
><br>
> Quickly looking at the 3.9 final image I'd say that you'd do the<br>
> following copies:<br>
> Behavior variablesAndOffsetsDo: => TraitBehavior<br>
> Behavior instVarNamesAndOffsetsDo: -> TraitBehavior<br>
> ClassDescription instVarNamesAndOffsetsDo: -> TraitDescription<br>
><br>
><br>
> and then things have a good chance of working.<br>
><br>
><br>
> HTH<br>
> Eliot<br>
><br>
> On Thu, Jul 16, 2009 at 10:47 AM, Ken Causey <<a href="mailto:ken@kencausey.com">ken@kencausey.com</a>><br>
> wrote:<br>
> So I decided I would try to run all the tests and almost<br>
> immediately I<br>
> got a debugger. This is with an image built using the<br>
> directions<br>
> running on 32-bit linux with exupery 0.15.1 VM. The failure<br>
> seems to be<br>
> in the setup of TraitsResource<br>
><br>
> Ken<br>
><br>
> SecurityManager state:<br>
> Restricted: false<br>
> FileAccess: true<br>
> SocketAccess: true<br>
> Working Dir /home/ken/projects/squeak/ncdm<br>
> Trusted Dir /home/ken/projects/squeak/ncdm/secure<br>
> Untrusted Dir /home/ken/projects/squeak/ncdm/My Squeak<br>
><br>
> ClassTrait(Object)>>doesNotUnderstand: #variablesAndOffsetsDo:<br>
> Receiver: T2 classTrait<br>
> Arguments and temporary variables:<br>
> aMessage: variablesAndOffsetsDo:<br>
> [closure] in<br>
> EncoderForV3PlusClosures(Encoder)...etc...<br>
> Receiver's instance variables:<br>
> methodDict: a MethodDictionary()<br>
> traitComposition: {}<br>
> localSelectors: nil<br>
> users: an IdentitySet()<br>
> organization: nil<br>
> baseTrait: T2<br>
><br>
> EncoderForV3PlusClosures(Encoder)>>init:context:notifying:<br>
> Receiver: {an EncoderForV3PlusClosures}<br>
> Arguments and temporary variables:<br>
> aClass: T2 classTrait<br>
> aContext: nil<br>
> req: a Parser<br>
> homeNode: nil<br>
> Receiver's instance variables:<br>
> comment: nil<br>
> pc: nil<br>
> scopeTable: a Dictionary('false'->{false}<br>
> 'nil'->{nil} 'self'->{self}<br>
> 'super'->...etc...<br>
> nTemps: 0<br>
> supered: false<br>
> requestor: a Parser<br>
> class: T2 classTrait<br>
> selector: nil<br>
> literalStream: a WriteStream #()<br>
> selectorSet: a Dictionary(#*->{*} #+->{+}<br>
> #-->{-} #/->{/} #'//'->{//}<br>
> #<->{<} #...etc...<br>
> litIndSet: a Dictionary()<br>
> litSet: a LiteralDictionary(-1->{-1}<br>
> 0->{0} 1->{1} 2->{2} )<br>
> sourceRanges: nil<br>
> globalSourceRanges: nil<br>
> stream: nil<br>
> position: nil<br>
> rootNode: nil<br>
> blockExtentsToLocals: nil<br>
><br>
> [] in<br>
> Parser>>parse:class:category:noPattern:context:notifying:ifFail:<br>
> Receiver: a Parser<br>
> Arguments and temporary variables:<br>
> <<error during printing><br>
> Receiver's instance variables:<br>
> source: a ReadStream 'm2ClassSide: a<br>
> ^a'<br>
> mark: 14<br>
> hereChar: Character space<br>
> aheadChar: $^<br>
> token: 'a'<br>
> tokenType: #word<br>
> currentComment: nil<br>
> buffer: a WriteStream 'a'<br>
> typeTable: #(#xBinary #xBinary #xBinary<br>
> #xBinary #xBinary #xBinary<br>
> #xBinary #xB...etc...<br>
> here: 'm2ClassSide:'<br>
> hereType: #keyword<br>
> hereMark: 1<br>
> hereEnd: 12<br>
> prevMark: 1<br>
> prevEnd: nil<br>
> encoder: {an EncoderForV3PlusClosures}<br>
> requestor: nil<br>
> parseNode: nil<br>
> failBlock: [closure] in<br>
> Compiler>>translate:noPattern:ifFail:<br>
> requestorOffset: 0<br>
> tempsMark: nil<br>
> doitFlag: false<br>
> properties: nil<br>
> category: #'as yet unclassified'<br>
><br>
> BlockClosure>>on:do:<br>
> Receiver: [closure] in<br>
> Parser>>parse:class:category:noPattern:context:notifying:ifFail:<br>
> Arguments and temporary variables:<br>
> exception: ReparseAfterSourceEditing<br>
> handlerAction: [closure] in<br>
> Parser>>parse:class:category:noPattern:context:noti...etc...<br>
> handlerActive: true<br>
> Receiver's instance variables:<br>
> outerContext:<br>
> Parser>>parse:class:category:noPattern:context:notifying:ifFail:<br>
> startpc: 131<br>
> numArgs: 0<br>
><br>
><br>
> --- The full stack ---<br>
> ClassTrait(Object)>>doesNotUnderstand: #variablesAndOffsetsDo:<br>
> EncoderForV3PlusClosures(Encoder)>>init:context:notifying:<br>
> [] in<br>
> Parser>>parse:class:category:noPattern:context:notifying:ifFail:<br>
> BlockClosure>>on:do:<br>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>
> - -<br>
> Parser>>parse:class:category:noPattern:context:notifying:ifFail:<br>
> Compiler>>translate:noPattern:ifFail:<br>
> Compiler>>compile:in:classified:notifying:ifFail:<br>
> ClassTrait(TraitBehavior)>>compile:classified:notifying:trailer:ifFail:<br>
> ClassTrait(TraitDescription)>>compile:classified:withStamp:notifying:logSource:<br>
> ClassTrait>>compile:classified:withStamp:notifying:logSource:<br>
> ClassTrait(TraitDescription)>>compile:classified:withStamp:notifying:<br>
> ClassTrait(TraitDescription)>>compile:classified:notifying:<br>
> ClassTrait(TraitDescription)>>compile:notifying:<br>
> ClassTrait(TraitBehavior)>>compile:<br>
> [] in TraitsResource>>setUp<br>
> [] in SystemChangeNotifier>>doSilently:<br>
> BlockClosure>>ensure:<br>
> SystemChangeNotifier>>doSilently:<br>
> TraitsResource>>setUp<br>
> TraitsResource(TestResource)>>initialize<br>
> TraitsResource class(Behavior)>>new<br>
> TraitsResource class(TestResource class)>>current<br>
> TraitsResource class(TestResource class)>>isAvailable<br>
> [] in TestRunner>>basicSetUpSuite:<br>
> Set>>do:<br>
> TestRunner>>basicSetUpSuite:<br>
> TestRunner>>basicRunSuite:do:<br>
> TestRunner>>runSuite:<br>
> TestRunner>>runAll<br>
> PluggableButtonMorphPlus(PluggableButtonMorph)>>performAction<br>
> PluggableButtonMorphPlus>>performAction<br>
> [] in PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp:<br>
> ...etc...<br>
><br>
><br>
><br>
><br>
><br>
><br>
</div></div></blockquote></div><br>