On Sun, Mar 27, 2011 at 10:46 AM, 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. > In the current model it should convert into a reference to an entry in Undeclared. i.e. it should do exactly what removing an inst var from a class def does. The sequence is delete an inst var from a class, reshape the instances of the class without the inst var, recompile the methods of the class. In the last step any references to the inst var name in source will not be resolved in the class definition and will hence result in being compiled as undeclared var refs. There are edge-cases. If the inst var name was masking an inst var of the same name in a superclass it would get resolved to that inst var. But the current class builder (rightly) disallows this and so it can be discounted. If the inst var name was masking a global of the same name in a class pool or shared pool it would get resolved to that. So the correct approach is to bind names with the same semantics that the compiler uses to binds names. best, Eliot > 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? > > 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 >>> >>> >>> >> >> > >
