Re: No Label.equals() method
Eugene Kuleshov <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <CADFjdoUp9Mn2W8bZtLOaMBqU01wf0ooQCaoR_he8N3fuduZVzQ@mail.gmail.com> |
I was referring to transformations within the same visitor's chain, Well, the ASM's Label is basically a marker somewhere in the bytecode. The only significant part of that is its location. So, you have two options. Either store location of the marker or renumerate them using some kind of reproducible algorithm, e.g. based on the first occurrence (see, for example, TraceMethodVisitor implementation). Of course neither of those will survive intermediate transformations and you'll have to renumerate Labels after each transformation. regards, Eugene On Sun, Jul 10, 2011 at 5:26 PM, Prashant Deva <[email protected]> wrote: > Well the problem I have is (which i previously posted before as a thread), > the Instrumentation.retransformClasses() method of the JVM has a bug. > It does not pass in the LocalVariableTable. > Thus I need to run a transformer during the initial load of each class and > store the local variable info from there, which can then be used by the > other transformers while 'retransforming'. > Of course this means saving the Label information along with local variable > info, to determine the scope of each local var. > In this case, how do I do the 'preservation of original labels' which you > are talking about, since new label objects will be created when the > retransform method is called? > Prashant > > > On Sun, Jul 10, 2011 at 2:22 PM, Eugene Kuleshov <[email protected]> > wrote: >> >> A short answer - you can't and generally don't need to. However you can >> change your transformation to keep the original labels. >> >> regards, >> Eugene >> >> On 2011-07-10 5:07 PM, "Prashant Deva" <[email protected]> wrote: >> > Yes, but if you need to store the labels as in my case, the identity >> > wont be >> > preserved since new Label objects will be created when the 2nd >> > transformer >> > is running. >> > Thats why I need to know how to do the equals without the identity. >> > Prashant >> > >> > >> > On Sun, Jul 10, 2011 at 2:05 PM, Eugene Kuleshov >> > <[email protected]>wrote: >> > >> >> The Label class relies on default implementation of equals() and >> >> hashcode() >> >> methods. Comparison of two labels should be done by identity. >> >> >> >> regards, >> >> Eugene >> >> On 2011-07-10 4:54 PM, "Prashant Deva" <[email protected]> wrote: >> >> > I noticed that the Label class does not have a equals() method. >> >> > I need to store the Label info for a local var across multiple >> >> transformers. >> >> > >> >> > This means I need a equals() method for the Label class. >> >> > >> >> > Can somebody tell what kind of checks should a Label.equals() method >> >> > contain? >> >> > >> >> > Prashant >> >> > >
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws