alt.jiapi.util
Class HotSpot

java.lang.Object
  extended by alt.jiapi.util.HotSpot

public class HotSpot
extends java.lang.Object

HotSpot.

HotSpot is defined as being an interesting Instruction, and all the Instructions before it, that has a total stack usage of 0.

If the interesting Instruction has a positive or zero stack usage, HotSpot is defined as being that single Instruction.

NOTE: We might change this definition to be exactly zero stack usage

For invocation, this would be

  1. Object reference of target (if invokevirtual)
  2. All the Instructions, that push arguments into stack
  3. Actual method invoke

Author:
Mika Riekkinen

Constructor Summary
HotSpot(InstructionList il, Instruction ins)
          Create new hotspot for a single Instruction.
HotSpot(InstructionList il, Instruction start, Instruction end)
          Create new hotspot.
 
Method Summary
 InstructionList getArgumentList()
          Get the InstructionList that represents arguments of this hotspot.
 Instruction getHotSpotInstruction()
          Get the Instruction, that was used to trigger creation of this HotSpot.
 InstructionList getInstructionList()
          Get the InstructionList that represents this hotspot.
 java.lang.String getName()
          Gets the name of this HotSpot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HotSpot

public HotSpot(InstructionList il,
               Instruction ins)
Create new hotspot for a single Instruction.

Parameters:
il - InstructionList that contains hotspot
ins - An Instruction, that makes up this hotspot

HotSpot

public HotSpot(InstructionList il,
               Instruction start,
               Instruction end)
Create new hotspot.

Parameters:
il - InstructionList that contains hotspot.
start - First instruction of the hotspot
end - Last instruction of the hotspot
Method Detail

getArgumentList

public InstructionList getArgumentList()
Get the InstructionList that represents arguments of this hotspot. Arguments of the HotSpot is defined as being all the instructions returned by getInstructionList(), except the one returned by getHotSpotInstruction().

InstructionList returned is a view to underlying list. All the modifications made to view, is reflected back to underlying list.

Returns:
a view of the hotspot

getHotSpotInstruction

public Instruction getHotSpotInstruction()
Get the Instruction, that was used to trigger creation of this HotSpot. By definition, hotspot-instruction is allways the last instruction of the hotspot. So this method is a shortcut to getInstructionList().get(il.size() - 1);

Returns:
Instruction

getInstructionList

public InstructionList getInstructionList()
Get the InstructionList that represents this hotspot. InstructionList returned is a view to underlying list. All the modifications made to view, is reflected back to underlying list.

Returns:
a view of the hotspot

getName

public java.lang.String getName()
Gets the name of this HotSpot. For invocations, name of the hotspot is constructed like this:
ret-type class-name.method-name(param1,param2,...)

For example, for
invokevirtual java.io.PrintStream.println(Ljava/lang/String;)V
void java.io.PrintStream.println(java.lang.String) is returned

For field accesses, name of the hotspot is
class-name.field-name

For the rest of the hotspots, an empty String is returned.

Returns:
Name of the hotspot


Copyright © 2001. Documenation generated August 26 2011.