org.jikesrvm.classloader
Class SpecializedMethod

java.lang.Object
  extended by org.jikesrvm.classloader.SpecializedMethod
Direct Known Subclasses:
SpecializedScanMethod

public abstract class SpecializedMethod
extends Object

A method that is specialized across all reference types.

In general as there may not be a 1-1 mapping between objects and the specialized methods this class is responsible for performing the mapping.

Specialized methods must have a static 'invoke' method that matches the given signature and return type.


Field Summary
protected  int id
          This specialized method's id
 
Constructor Summary
protected SpecializedMethod(int id)
          Constructor.
 
Method Summary
protected  CompiledMethod compileSpecializedMethod(RVMMethod template, TypeReference[] specializedParams)
          Compile a specialized version of a template method.
abstract  TypeReference getReturnType()
           
abstract  TypeReference[] getSignature()
           
abstract  ArchitectureSpecific.CodeArray specializeMethod(RVMType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected final int id
This specialized method's id

Constructor Detail

SpecializedMethod

protected SpecializedMethod(int id)
Constructor.

Method Detail

specializeMethod

public abstract ArchitectureSpecific.CodeArray specializeMethod(RVMType type)
Returns:
the specialized method for the given type.

getSignature

public abstract TypeReference[] getSignature()
Returns:
the method signature of the specialized method's invoke.

getReturnType

public abstract TypeReference getReturnType()
Returns:
the return type of the specialized method's invoke

compileSpecializedMethod

protected CompiledMethod compileSpecializedMethod(RVMMethod template,
                                                  TypeReference[] specializedParams)
Compile a specialized version of a template method. The template must be a method that matches the signature of this specialized method class. The specialized types are the set of types to tell the compiler to use during specialized compilation. This array must match the length of the array returned from getSignature.

Parameters:
template - The method to use as a template
specializedParams - The known types of the parameters, possibly more refined than in the template
Returns:
The compiled code array.