[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-dev
Subject:    Re: [squeak-dev] Request for feedback: mirrors
From:       Igor Stasenko <siguctua () gmail ! com>
Date:       2012-05-24 1:13:06
Message-ID: CAEYrNzCq3vz-iS6iY=FnQmnWFFa9NzcyJeKrJchOFuQ7FjKnEA () mail ! gmail ! com
[Download RAW message or body]

On 24 May 2012 02:34, Colin Putney <colin@wiresong.com> wrote:
> On Wed, May 23, 2012 at 5:13 PM, Igor Stasenko <siguctua@gmail.com> wrote:
>> ok, i checked your implementation and now i see where you doing lookup
>
> [snip]
>
>> ObjectVmMirror>>fixedAt: anInteger
>>            ^ self execute: GetFixedSlotMethod
>>                        arguments: {anInteger}
>>
>> where GetFixedSlotMethod is a class variable holding an appropriate
>> CompiledMethod instance,
>> which you can initialize just once at class initialization (and
>> reinitialize if it changes).
>>
>> and #execute:arguments: is method which using prim 188 for executing
>> given method
>> with object as receiver.
>
> Sure, that would be cleaner and a bit faster. I'll make that change, thanks.
>
> I don't think it'll please Eliot though - we still have to get the
> CompiledMethod from *somewhere* even if it's a class variable.
>

i like the concept. it is quite elegant, to my look:
 - things like GetFixedSlotMethod & others is actually a VM contracts
which language side must know about
to properly reflect the objects without sending any message to them
(same as VM does).

So you end up with things like

GetObjectBehaviorMethod
GetObjectVarSizeMethod

GetBehaviorSuperclassMethod
GetBehaviorMDMethod
GetBehaviorFormatMethod
etc


i would even create a separate class for that.. which will hold all
those contracts.
So it can be useful for educational purposes too.

> Colin


-- 
Best regards,
Igor Stasenko.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic