For instance, classes contain methods, methods contain code, and code contains bytecode instructions. One such instruction is the new instruction which creates an object. In the standard class file representation the bytecode is followed by two other bytes, which together form an index into the constantpool, where a string can be found with the name of the class. To attach a certain property to this target class (like a creation site), one first needs to find the class through some kind of repository. This process is complicated, repetitive, and error-prone.
In JikesBT, classes still have methods, methods still have code, and code still has instructions. But these instructions are represented by objects, and the object representing the new instruction does not have a number to index into the constantpool anymore. Instead, a direct Java reference to the target class is provided. Adding properties to the class is a simple matter of following the link. As a matter of fact, a class’s constantpool is optionally removed after the class is loaded, and the constant pool is transparently regenerated when the class is saved. Users will never even see the constantpool unless they want to.
Summarizing, JikesBT provides a logical representation of the class file, whereas most bytecode representation packages give a more direct, more detailed, and more low-level, physical representation.
JikesBT’s model is quite rich, and provides a number of relationships, such as an easy way to find each instruction where a given class is allocated, where a given method is invoked, and where a given field is accessed. It records which methods override which others, which will be inherited from other classes, and even which method implements a method declared in a given interface even if via inheritance. There’s an extraInformation reference field in the major objects which is available for use by the user, and even a way to subclass some of JikesBT’s classes with user-written classes to provide additional or altered functionality.
When a class is being written, JikesBT chooses the proper opcode depending on the size of an inline constant or the placement of an item in the constant pool. JikesBT can even do peep-hole optimization.
Also included with JikesBT are examples such as javaSpy which is an easily extended tool which adds instrumentation to an application which allows the application’s execution to be observed.
available on the web at:
optional Replicator mirror
Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : . If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, especially when sending an ad-hominem attack, a rant composed mainly of obscenities or a death threat, please quote the offending passage and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. I can’t very well fix erroneous or ambiguous text if I can’t find it.
Your face IP:[220.127.116.11]
|Feedback||You are visitor number 9,568.|