Top Description Fields Constructors Methods
jdk.vm.ci.code

public Class BytecodePosition

extends Object
Class Inheritance
Known Direct Subclasses
jdk.vm.ci.code.BytecodeFrame
Imports
java.util.Objects, jdk.vm.ci.meta.ResolvedJavaMethod

Represents a code position, that is, a chain of inlined methods with bytecode locations, that is communicated from the compiler to the runtime system. A code position can be used by the runtime system to reconstruct a source-level stack trace for exceptions and to create frames for deoptimization.

Field Summary

Modifier and TypeField and Description
private final int
private final BytecodePosition
private final ResolvedJavaMethod

Constructor Summary

AccessConstructor and Description
public
BytecodePosition(BytecodePosition
the parent position
caller
,
ResolvedJavaMethod
the method
method
,
int
a BCI such that method.codeSize() == 0 || bci < method.getCodeSize(). That is, if code size is 0 then allow any value, otherwise the bci must be less than the code size.
bci
)

Constructs a new object representing a given parent/caller, a given method, and a given BCI.

Method Summary

Modifier and TypeMethod and Description
public BytecodePosition
addCaller(BytecodePosition link)

Adds a caller to the current position returning the new position.

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Deep equality test.

public int

Returns:

The location within the method, as a bytecode index. The constant -1 may be used to indicate the location is unknown, for example within code synthesized by the compiler.
getBCI
()

public BytecodePosition
getCaller()

The position where this position has been called, null if none.

public ResolvedJavaMethod

Returns:

The runtime interface method for this position.
getMethod
()

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String

Returns:

a string representation of this code position
toString
()

Overrides java.lang.Object.toString.

Converts this code position to a string representation.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

bciback to summary
private final int bci
callerback to summary
private final BytecodePosition caller
methodback to summary
private final ResolvedJavaMethod method

Constructor Detail

BytecodePositionback to summary
public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci)

Constructs a new object representing a given parent/caller, a given method, and a given BCI.

Parameters
caller:BytecodePosition

the parent position

method:ResolvedJavaMethod

the method

bci:int

a BCI such that method.codeSize() == 0 || bci < method.getCodeSize(). That is, if code size is 0 then allow any value, otherwise the bci must be less than the code size.

Method Detail

addCallerback to summary
public BytecodePosition addCaller(BytecodePosition link)

Adds a caller to the current position returning the new position.

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Deep equality test.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getBCIback to summary
public int getBCI()
Returns:int

The location within the method, as a bytecode index. The constant -1 may be used to indicate the location is unknown, for example within code synthesized by the compiler.

getCallerback to summary
public BytecodePosition getCaller()

The position where this position has been called, null if none.

getMethodback to summary
public ResolvedJavaMethod getMethod()
Returns:ResolvedJavaMethod

The runtime interface method for this position.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Converts this code position to a string representation.

Returns:String

a string representation of this code position

Annotations
@Override