Package jdk.graal.compiler.graphio
Interface GraphElements<M,F,S,P>
- Type Parameters:
M
- type representing methodsF
- type representing fieldsS
- type representing signatureP
- type representing source code location
public interface GraphElements<M,F,S,P>
Representation of methods, fields, their signatures and code locations.
-
Method Summary
Modifier and TypeMethodDescriptionRecognizes a field.fieldDeclaringClass
(F field) Field's declaring class.int
fieldModifiers
(F field) Field modifiers.Name of a field.fieldTypeName
(F field) Type name of the field.Recognize method.byte[]
methodCode
(M method) Bytecode for a method.methodDeclaringClass
(M method) Method's declaring class.int
methodModifiers
(M method) Method modifiers.methodName
(M method) Method name.methodSignature
(M method) Method's signature.methodStackTraceElement
(M method, int bci, P pos) Stack trace element for a method, index and position.nodeSourcePosition
(Object object) Recognize a source position.int
nodeSourcePositionBCI
(P pos) Byte code index of a position.Caller of a position.Method for a position.Recognizes signature.int
signatureParameterCount
(S signature) Number of parameters of a signature.signatureParameterTypeName
(S signature, int index) Type name of a signature parameter.signatureReturnTypeName
(S signature) Type name of a return type.
-
Method Details
-
method
Recognize method. Can the object be seen as a method?- Parameters:
obj
- the object to check- Returns:
null
if the object isn't a method, non-null value otherwise
-
methodCode
Bytecode for a method.- Parameters:
method
- the method- Returns:
- bytecode of the method
-
methodModifiers
Method modifiers.- Parameters:
method
- the method- Returns:
- its modifiers
-
methodSignature
Method's signature.- Parameters:
method
- the method- Returns:
- signature of the method
-
methodName
Method name.- Parameters:
method
- the method- Returns:
- name of the method
-
methodDeclaringClass
Method's declaring class. The returned object shall be aClass
or be recognizable byGraphTypes.typeName(java.lang.Object)
method.- Parameters:
method
- the method- Returns:
- object representing class that defined the method
-
field
Recognizes a field. Can the object be seen as a field?- Parameters:
object
- the object to check- Returns:
null
if the object isn't a field, non-null value otherwise
-
fieldModifiers
Field modifiers.- Parameters:
field
- the field- Returns:
- field modifiers
-
fieldTypeName
Type name of the field.- Parameters:
field
- the field- Returns:
- the name of the field's type
-
fieldName
Name of a field.- Parameters:
field
- the field- Returns:
- the name of the field
-
fieldDeclaringClass
Field's declaring class. The returned object shall be aClass
or be recognizable byGraphTypes.typeName(java.lang.Object)
method.- Parameters:
field
- the field- Returns:
- object representing class that defined the field
-
signature
Recognizes signature. Can the object be seen as a signature?- Parameters:
object
- the object to check- Returns:
null
if the object isn't a signature, non-null value otherwise
-
signatureParameterCount
Number of parameters of a signature.- Parameters:
signature
- the signature- Returns:
- number of parameters
-
signatureParameterTypeName
Type name of a signature parameter.- Parameters:
signature
- the signatureindex
- index from 0 tosignatureParameterCount(java.lang.Object)
- 1- Returns:
- the type name
-
signatureReturnTypeName
Type name of a return type.- Parameters:
signature
- the signature- Returns:
- the type name
-
nodeSourcePosition
Recognize a source position. Can the object be seen as a position?- Parameters:
object
- the object to check- Returns:
null
if the object isn't a position, non-null otherwise
-
nodeSourcePositionMethod
Method for a position.- Parameters:
pos
- the position- Returns:
- the method at the position
-
nodeSourcePositionCaller
Caller of a position.- Parameters:
pos
- the position- Returns:
null
or another position
-
nodeSourcePositionBCI
Byte code index of a position.- Parameters:
pos
- the position- Returns:
- the BCI of the position
-
methodStackTraceElement
Stack trace element for a method, index and position. This is the basic version of the method that works withStackTraceElement
and is suitable for Java-like languages. Should you need to provide more details about the location of multiple strata, seeGraphLocations
interface that gives more control over the provided location data.- Parameters:
method
- the methodbci
- the indexpos
- the position- Returns:
- stack trace element for the method, index and position
-