Soot reads the following attributes: SourceFile ConstantValue Code Exceptions LineNumberTable LocalVariableTable However, only LineNumberTable has a corresponding Tag implementation allowing it to be represented as a Soot attribute. If you need to preserve anything else, you need to implement a Tag to represent it, and a TagAggregator to convert it from a Soot attribute into a bytecode attribute. Ondrej On Sun, Mar 16, 2003 at 09:54:27PM -0500, Chris Pickett wrote:From the Soot tutorials ... Known shortcomings: Soot cannot currently preserve existing attributes in a class file when transforming and annotating it. In the foo example, any debug information from javac would be lost after annotation. ==== Is this still the case? Chris
Operation
fork speculative thread at bytecode offset specified
Format
impdep1 branchbyte1 branchbyte2
Forms
impdep1 = 254 (0xfe)
Operand Stack
... ...
Description
The unsigned branchbyte1 and branchbyte2 are used to construct a signed 16-bit offset, where the offset is calculated to be (branchbyte1 << 8) | branchbyte2.
If there is an available processor for speculative multithreading, then execution proceeds in a new speculative thread at that offset from the address of the opcode of this impdep1 instruction. The target address must be that of an opcode of an instruction within the method that contains this impdep1 instruction. The opcode preceding the target address will be a nop instruction, and if a speculative thread is successfully started, should be patched with an impdep2 instruction with a count of 1. If the preceding instruction is already an impdep2 instruction, then its use count is incremented by 1. The use count is the first operand of the impdep2 instruction.
Otherwise, a new speculative thread is not started. In either case, execution proceeds at the address of the instruction following this impdep1 instruction.
Linking Exceptions
This needs to be determined. For now, there are none.
Runtime Exceptions
This needs to be determined. For now, there are none.
Notes
This instruction works in conjunction with the impdep2 instruction. The two implementation dependent instructions are used so that a static compiler can
determine the fork and join points for speculative execution. However, this impdep2 opcode might foreseeably be replaced by another internal SableVM instruction, as it is not strictly needed by static analysis under the current design.
The design / implementation is not complete. For now, this bytecode will actually cause the current thread to switch into a speculative execution mode, and the target address will not be used. Commit will occur at a GC checkpoint. Also, this design may change in the future such that the target instruction need not be inside the current method.
Operation
join a speculative thread forked by the current thread
Format
impdep2 count
Forms
impdep2 = 255 (0xff)
Operand Stack
... ...
Description
The current thread first checks if it has forked a speculative thread at the address of the opcode that follows this impdep2 instruction. If it has, then it replaces the count operand in the bytecode (not on the operand stack) with count - 1. If this results in count == 0, then the opcode is replaced with a nop instruction.
Then the current thread asks the speculative thread to validate and commit the results of its execution. If the commit is successful, then non-speculative execution continues at the next bytecode of the speculative thread. If the commit operation fails, then the speculative thread aborts and execution continues at the address of the opcode that follows this impdep2 instruction.
Otherwise, if the current thread has not forked a speculative thread, then execution also proceeds at the address of the instruction following this impdep2 instruction.
Linking Exceptions
This needs to be determined. For now, there are none.
Runtime Exceptions
This needs to be determined. For now, there are none.
Notes
This instruction works in conjunction with the impdep1 instruction. The two implementation dependent instructions are used so that a static compiler can
determine the fork and join points for speculative execution. However, this impdep2 opcode might foreseeably be replaced by another internal SableVM instruction, as it is not strictly needed by static analysis under the current design.
The design / implementation is not complete. For now, this bytecode will actually cause the current thread to switch into a non-speculative execution mode. Commit may also occur at a GC checkpoint. Furthermore, it has not been determined whether the speculative thread or the non-speculative thread starts executing at the next bytecode in the event of a successful commit operation, nor what happens to the thread objects.