"

2013 FRC Java API

"

com.sun.squawk
Class MethodBody

java.lang.Object
  extended by com.sun.squawk.MethodBody

public final class MethodBody
extends Object

An instance of MethodBody represents the Squawk bytecode for a method as well as all the other information related to the bytecode such as exception handler tables, oop map for the activation frame etc.


Field Summary
static boolean ENABLE_RELOCATION_TABLES
          This was sketched out, but not used.
static boolean ENABLE_SPECIFIC_TYPE_TABLES
          The method info is capable of encoding the types of the parameters and locals, but this is currently only used for debugging when using the CheneyCollector (see checkActivationForAddresses()).
static boolean FORCE_LARGE_FORMAT
          Debug LARGE format.
static boolean LOCAL_LONG_ORDER_NORMAL
          Configuration option.
 
Constructor Summary
MethodBody(Method definingMethod, int maxStack, Klass[] locals, ExceptionHandler[] exceptionTable, int[] lnt, ScopedLocalVariable[] lvt, byte[] code, byte[] typeMap, boolean reverseParameters, boolean inlinedSuperConstructor)
          Creates a MethodBody representing the implementation details of a method.
 
Method Summary
 byte[] getCode()
          Gets the bytecode.
 Klass getDefiningClass()
          Gets the class that defined this method.
 Method getDefiningMethod()
          Gets the class that defined this method.
 ExceptionHandler[] getExceptionTable()
          Get the exception table.
 boolean getInlinedSuperConstructor()
          True IFF this is a constructor that inlined java.lang.Object..
 int getMaxStack()
          Get the number of stack words needed.
 MethodMetadata getMetadata()
          Gets the debug information (if any) pertaining to this method body.
 int getParametersCount()
          Get the number of parameters.
 Klass[] getTypes()
          Get the type map.
static boolean isInterpreterInvoked(Object oop)
          Determines if a given method is only invoked from the interpreter
 String toString()
          Produce String for debugging
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCAL_LONG_ORDER_NORMAL

public static final boolean LOCAL_LONG_ORDER_NORMAL
Configuration option.

If set true then a long or double local variable will be referenced as slot+0. If set false then it is addressed as slot+1.

Setting this false is will produce the correct offsets when the locals are allocated at a negative offset from the frame pointer (which is common for virtually all C ABIs).

See Also:
Constant Field Values

ENABLE_SPECIFIC_TYPE_TABLES

public static final boolean ENABLE_SPECIFIC_TYPE_TABLES
The method info is capable of encoding the types of the parameters and locals, but this is currently only used for debugging when using the CheneyCollector (see checkActivationForAddresses()). Since the LARGE format can impose a 5% penalty on method calls (complicating extend and return), only generate type tables when asserts are on.

See Also:
Constant Field Values

ENABLE_RELOCATION_TABLES

public static final boolean ENABLE_RELOCATION_TABLES
This was sketched out, but not used. Optimize away in the mean time...

See Also:
Constant Field Values

FORCE_LARGE_FORMAT

public static final boolean FORCE_LARGE_FORMAT
Debug LARGE format.

See Also:
Constant Field Values
Constructor Detail

MethodBody

public MethodBody(Method definingMethod,
                  int maxStack,
                  Klass[] locals,
                  ExceptionHandler[] exceptionTable,
                  int[] lnt,
                  ScopedLocalVariable[] lvt,
                  byte[] code,
                  byte[] typeMap,
                  boolean reverseParameters,
                  boolean inlinedSuperConstructor)
Creates a MethodBody representing the implementation details of a method.

Parameters:
definingMethod - the method in which the method body was defined
maxStack - the maximum size in words of the operand stack
locals - the types of the local variables (excludes parameters)
exceptionTable - the exception handler table
lnt - the table mapping instruction addresses to the source line numbers that start at the addresses. The table is encoded as an int array where the high 16-bits of each element is an instruction address and the low 16-bits is the corresponding source line
lvt - the table describing the symbolic information for the local variables in the method
code - the Squawk bytecode
typeMap - the type map describing the type of the value (if any) written to memory by each instruction in 'code'
reverseParameters - true if the parameters are pushed right-to-left
inlinedSuperConstructor - True IFF this is a constructor that inlined java.lang.Object..
Method Detail

toString

public String toString()
Produce String for debugging

Overrides:
toString in class Object
Returns:
the string

getCode

public byte[] getCode()
Gets the bytecode.

Returns:
the bytecode

getTypes

public Klass[] getTypes()
Get the type map.

Returns:
the type map

getDefiningMethod

public Method getDefiningMethod()
Gets the class that defined this method.

Returns:
the class that defined this method

getDefiningClass

public Klass getDefiningClass()
Gets the class that defined this method.

Returns:
the class that defined this method

getParametersCount

public int getParametersCount()
Get the number of parameters.

Returns:
the number

getExceptionTable

public ExceptionHandler[] getExceptionTable()
Get the exception table.

Returns:
the number

getMaxStack

public int getMaxStack()
Get the number of stack words needed.

Returns:
the number

getMetadata

public MethodMetadata getMetadata()
Gets the debug information (if any) pertaining to this method body.

Returns:
the debug information pertaining to this method body or null if there isn't any

getInlinedSuperConstructor

public boolean getInlinedSuperConstructor()
True IFF this is a constructor that inlined java.lang.Object.. Used by squawk verifier.


isInterpreterInvoked

public static boolean isInterpreterInvoked(Object oop)
Determines if a given method is only invoked from the interpreter

Parameters:
oop - the pointer to the method
Returns:
true if oop is an intrepreter invoked only method

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"