Another tip for people maybe, byte code generation is quite tedious to follow. One way to make it a lot easier to understand imho, is by naming the labels with meaningful names. Just using the generated l0, l1, l2, ... doesn't really help. Using label names like 'labelAfterFinally', 'labelEqualityCheckFailed', ... can really help when re-reading byte code generation instructions later on. What do you think?
On 02 Oct 2007, at 18:30, Alex Miller wrote: > I've been removing the line number instructions from code generated > by the bytecode plugin when I move it into our code. I think it's > a good idea as those numbers are not meaningful and actually > confusing for debuggers, etc as you say. > > ----- Original Message ----- > From: "Geert Bevin" <[EMAIL PROTECTED]> > To: [email protected] > Sent: Tuesday, October 2, 2007 11:10:10 AM (GMT-0600) America/Chicago > Subject: [tc-dev] Line numbers in generated code? > > Hi everyone, > > while reading through the code for the ConcurrentHashMap support I > ran into a lot of code that seems to be straight copy-pastes of Java > code that was converted to ASM using the Eclipse plugin. For > instance, look at JavaUtilConcurrentHashMapAdapter and for instance > the method createWrapperMethod(). This is an instrumentation that is > using to create a wrapper method around existing methods, yet it uses > line numbers. This means that the same line numbers are present in > the byte code at different locations and for different method names. > Almost all the other generated methods in this class to the same > thing. > > I think it's a good practice to remove the line numbers of generated > byte code since I think that this could result into maybe unwanted > behavior with debuggers / profilers / etc. > > What do you think? Should I removed the line numbers that are in > those classes now? > > Geert -- Geert Bevin Terracotta - http://www.terracotta.org Uwyn "Use what you need" - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com _______________________________________________ tc-dev mailing list [email protected] http://lists.terracotta.org/mailman/listinfo/tc-dev
