On 27 March 2011 19:46, Toon Verwaest <[email protected]> wrote:
> Does anybody know what I'm supposed to transform accesses to removed
> instance variables into? Updating indexes of instance variables already
> works.
>
I guess  it would be cool to transform it to message like

'self undefinedVariableAccess: #varName'
and:
'self undefinedVariableAccess: #varName value: val'
for assignments.

Then later, when given method will run, it will trigger an error and
developer can fix it in debugger.

(Unless, of course you simply raise an error during (re)compilation
when given ivar removed from class).

> And what data do I have to copy over to the new method so that it keeps a
> pointer to the original source, the class pointer and the selector?
>

If you create a copy of method, copy the method's trailer.


trailer := oldMethod trailer.

newMethod := CompiledMethod newBytes: ... trailerBytes: ***trailer***
nArgs: ... nTemps: .. nStack: ... nLits: ... primitive: ...


> cheers,
> Toon
>
> On 03/27/2011 07:33 PM, Igor Stasenko wrote:
>>
>> On 27 March 2011 19:14, Toon Verwaest<[email protected]>  wrote:
>>>
>>> For whoever might care: I rewrote / fixed the Opal decompiler.
>>>
>>> Sorry about me being a bit bad... my only test is this:
>>>
>>> CompiledMethod allInstances collect: [ :m |
>>>    (OCBytecodeDecompiler new decompile: m) compiledMethod ]
>>>
>>> At least on the helvetia image that doesn't give any errors :)
>>>
>>> On to hooking it in with my new classbuilder and MethodModification model
>>> to
>>> apply bytecode rewriting for hyperfast class changes.
>>
>>  I'll be back in an hour ;P
>>
>> and bring a new compiler/decompiler for us this time :)
>>
>>> cheers,
>>> Toon
>>>
>>>
>>
>>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.

Reply via email to