APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.jvm.hotspot.runtime

public abstract Class Frame

Additional top-level classes in compilation unit: InterpreterFrameClosure, ArgumentOopFinder.

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Known Direct Subclasses
sun.jvm.hotspot.runtime.aarch64.AARCH64Frame, sun.jvm.hotspot.runtime.amd64.AMD64Frame, sun.jvm.hotspot.runtime.ppc64.PPC64Frame, sun.jvm.hotspot.runtime.riscv64.RISCV64Frame
Imports
java.io.*, java.util.*, sun.jvm.hotspot.code.*, sun.jvm.hotspot.compiler.*, sun.jvm.hotspot.debugger.*, sun.jvm.hotspot.interpreter.*, sun.jvm.hotspot.oops.*, sun.jvm.hotspot.types.*, sun.jvm.hotspot.utilities.*, .Observable, .Observer

A frame represents a physical stack frame (an activation). Frames can be C or Java frames, and the Java frames can be interpreted or compiled. In contrast, vframes represent source-level activations, so that one physical frame can correspond to multiple source level frames because of inlining.

NOTE that this is not a VMObject and does not wrap an Address -- this is an actual port of the VM's Frame code to Java.

NOTE also that this is incomplete -- just trying to get reading of interpreted frames working for now, so all non-core and setter methods are removed for now. (FIXME)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static long
ConstMethodSize

Size of ConstMethod for computing BCI from BCP (FIXME: hack)

protected boolean
protected Address
pc

Program counter (the next instruction after the call)

private static int
protected Address
raw_sp

A raw stack pointer.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Address
addressOfInterpreterFrameCPCache()

Constant pool cache

public abstract Address
addressOfInterpreterFrameExpressionStack()

Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is not setup)

public Address
public Address
public abstract Address
public abstract Address
public abstract Address
addressOfInterpreterFrameTOS()

Top of expression stack

public abstract Address
addressOfInterpreterFrameTOSAt(int slot)

Expression stack from top down

protected abstract Address
protected abstract Address
public Address
addressOfStackSlot(int slot)

Returns the address of the requested "slot" on the stack.

protected void
protected int
protected int
public boolean
canBeDeoptimized()

tells whether this frame can be deoptimized

public CodeBlob
cb()

public abstract Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public boolean
entryFrameIsFirst()

Tells whether there is another chunk of Delta stack above

public abstract boolean
equals(Object arg)

Overrides java.lang.Object.equals.

testers -- platform dependent

public abstract long
frameSize()

returns the frame size in stack slots

public abstract JavaCallWrapper
public abstract Address
public abstract Address
public int
getIntAt(int slot)

Fetches the (Java) int at the requested slot

public abstract int
getInterpreterFrameBCI()

Byte code index.

public ConstantPoolCache
getInterpreterFrameCPCache()

Constant pool cache

public abstract int
public int
getInterpreterFrameExpressionStackSize()

FIXME: is this portable?

public Method
getInterpreterFrameMethod()

Current method

public abstract Address
public OopHandle
getOopHandleAt(int slot)

Fetches the OopHandle at the requested slot

public Address
getPC()

pc: Returns the pc at which this frame will continue normally.

public OopHandle
public OopHandle
public abstract Address
getSenderPC()

Return address

public abstract Address
getSenderSP()

Returns the stack pointer of the calling frame

public abstract String
getSignalNameDbg()

If this is a signal handler frame (again, on a platform with a notion of signals), get the name of the signal.

public abstract int
getSignalNumberDbg()

If this is a signal handler frame (again, on a platform with a notion of signals), get the signal number.

public abstract Address
public abstract Address
getUnextendedSP()

The frame's original SP, before any extension by an interpreted callee; used for packing debug info into vframeArray objects and vframeArray lookup.

protected abstract boolean
hasSenderPD()

Platform-dependent query indicating whether this frame has a sender.

private static synchronized void
public abstract BasicObjectLock
public abstract BasicObjectLock
public abstract int
interpreterFrameMonitorSize()

Note

this returns a size in BYTES in this system!

public void
public boolean
public boolean
public boolean
isEntryFrame()

Java frame called from C?

public boolean
isFirstFrame()

oldest frame?

public boolean
isFirstJavaFrame()

same for Java frame

public boolean
isInterpretedFrame()

type testers

public abstract boolean
isInterpretedFrameValid()

performs sanity checks on interpreted frames.

public boolean
public boolean
public boolean
public abstract boolean
isSignalHandlerFrameDbg()

This is an addition for debugging purposes on platforms which have the notion of signals.

public BasicObjectLock
public Address
oopMapRegToLocation(VMReg reg, RegisterMap regMap)

Conversion from an VMReg::Name to physical stack location

private void
public void
private void
public void
oopsInterpretedArgumentsDo(Symbol signature, boolean isStatic, AddressVisitor f)

private void
public static int
public BasicObjectLock
public void
public void
public void
public Frame
realSender(RegisterMap map)

returns the sender, but skips conversion frames

public abstract Frame
sender(RegisterMap map, CodeBlob nm)

returns the sending frame

public Frame
sender(RegisterMap map)

equivalent to sender(map, null)

public void
setPC(Address newpc)

public abstract void
setSP(Address newSP)

public boolean
shouldBeDeoptimized()

tells whether this frame is marked for deoptimization

Inherited from java.lang.Object:
finalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ConstMethodSizeback to summary
private static long ConstMethodSize

Size of ConstMethod for computing BCI from BCP (FIXME: hack)

deoptimizedback to summary
protected boolean deoptimized
pcback to summary
protected Address pc

Program counter (the next instruction after the call)

pcReturnOffsetback to summary
private static int pcReturnOffset
raw_spback to summary
protected Address raw_sp

A raw stack pointer. The accessor getSP() will return a real (usable) stack pointer (e.g. from Thread::last_Java_sp)

Constructor Detail

Frameback to summary
public Frame()

Method Detail

addressOfInterpreterFrameCPCacheback to summary
public abstract Address addressOfInterpreterFrameCPCache()

Constant pool cache

addressOfInterpreterFrameExpressionStackback to summary
public abstract Address addressOfInterpreterFrameExpressionStack()

Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is not setup)

addressOfInterpreterFrameExpressionStackSlotback to summary
public Address addressOfInterpreterFrameExpressionStackSlot(int slot)
addressOfInterpreterFrameLocalback to summary
public Address addressOfInterpreterFrameLocal(int slot)
addressOfInterpreterFrameLocalsback to summary
public abstract Address addressOfInterpreterFrameLocals()
addressOfInterpreterFrameMethodback to summary
public abstract Address addressOfInterpreterFrameMethod()

Current method

addressOfInterpreterFrameTOSback to summary
public abstract Address addressOfInterpreterFrameTOS()

Top of expression stack

addressOfInterpreterFrameTOSAtback to summary
public abstract Address addressOfInterpreterFrameTOSAt(int slot)

Expression stack from top down

addressOfSavedOopResultback to summary
protected abstract Address addressOfSavedOopResult()
addressOfSavedReceiverback to summary
protected abstract Address addressOfSavedReceiver()
addressOfStackSlotback to summary
public Address addressOfStackSlot(int slot)

Returns the address of the requested "slot" on the stack. Slots are as wide as addresses, so are 32 bits wide on a 32-bit machine and 64 bits wide on a 64-bit machine.

adjustForDeoptback to summary
protected void adjustForDeopt()
bcpToBciback to summary
protected int bcpToBci(Address bcp, ConstMethod cm)
bcpToBciback to summary
protected int bcpToBci(Address bcp, Method m)
canBeDeoptimizedback to summary
public boolean canBeDeoptimized()

tells whether this frame can be deoptimized

cbback to summary
public CodeBlob cb()
cloneback to summary
public abstract Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

entryFrameIsFirstback to summary
public boolean entryFrameIsFirst()

Tells whether there is another chunk of Delta stack above

equalsback to summary
public abstract boolean equals(Object arg)

Overrides java.lang.Object.equals.

testers -- platform dependent

frameSizeback to summary
public abstract long frameSize()

returns the frame size in stack slots

getEntryFrameCallWrapperback to summary
public abstract JavaCallWrapper getEntryFrameCallWrapper()
getFPback to summary
public abstract Address getFP()
getIDback to summary
public abstract Address getID()
getIntAtback to summary
public int getIntAt(int slot)

Fetches the (Java) int at the requested slot

getInterpreterFrameBCIback to summary
public abstract int getInterpreterFrameBCI()

Byte code index. In the underlying frame, what is actually stored is a byte code pointer (BCP), which is converted to a BCI and back by the GC when methods are moved. In this system, interior pointers are not allowed, so we must make the access to the interpreter frame's BCI atomic with respect to GC. This may mean implementation with an underlying call through native code into the VM or a magic sequence in the compiler. (FIXME)

getInterpreterFrameCPCacheback to summary
public ConstantPoolCache getInterpreterFrameCPCache()

Constant pool cache

getInterpreterFrameExpressionStackDirectionback to summary
public abstract int getInterpreterFrameExpressionStackDirection()
getInterpreterFrameExpressionStackSizeback to summary
public int getInterpreterFrameExpressionStackSize()

FIXME: is this portable?

getInterpreterFrameMethodback to summary
public Method getInterpreterFrameMethod()

Current method

getInterpreterFrameSenderSPback to summary
public abstract Address getInterpreterFrameSenderSP()
getOopHandleAtback to summary
public OopHandle getOopHandleAt(int slot)

Fetches the OopHandle at the requested slot

getPCback to summary
public Address getPC()

pc: Returns the pc at which this frame will continue normally. It must point at the beginning of the next instruction to execute.

getSavedOopResultback to summary
public OopHandle getSavedOopResult()
getSavedReceiverback to summary
public OopHandle getSavedReceiver()
getSenderPCback to summary
public abstract Address getSenderPC()

Return address

getSenderSPback to summary
public abstract Address getSenderSP()

Returns the stack pointer of the calling frame

getSignalNameDbgback to summary
public abstract String getSignalNameDbg()

If this is a signal handler frame (again, on a platform with a notion of signals), get the name of the signal.

getSignalNumberDbgback to summary
public abstract int getSignalNumberDbg()

If this is a signal handler frame (again, on a platform with a notion of signals), get the signal number.

getSPback to summary
public abstract Address getSP()
getUnextendedSPback to summary
public abstract Address getUnextendedSP()

The frame's original SP, before any extension by an interpreted callee; used for packing debug info into vframeArray objects and vframeArray lookup.

hasSenderPDback to summary
protected abstract boolean hasSenderPD()

Platform-dependent query indicating whether this frame has a sender. Should return true if it is possible to call sender() at all on this frame. (This is currently only needed for the debugging system, if a stack trace is attempted for a Java thread which has no Java frames, i.e., the signal thread; we have to know to stop traversal at the bottom frame.)

initializeback to summary
private static synchronized void initialize(TypeDataBase db)
interpreterFrameMonitorBeginback to summary
public abstract BasicObjectLock interpreterFrameMonitorBegin()
interpreterFrameMonitorEndback to summary
public abstract BasicObjectLock interpreterFrameMonitorEnd()
interpreterFrameMonitorSizeback to summary
public abstract int interpreterFrameMonitorSize()

Note

this returns a size in BYTES in this system!

interpreterFramePrintOnback to summary
public void interpreterFramePrintOn(PrintStream tty)
isCompiledFrameback to summary
public boolean isCompiledFrame()
isDeoptimizedback to summary
public boolean isDeoptimized()
isEntryFrameback to summary
public boolean isEntryFrame()

Java frame called from C?

isFirstFrameback to summary
public boolean isFirstFrame()

oldest frame? (has no sender) FIXME: this is modified from the C++ code to handle the debugging situation where we try to traverse the stack for, for example, the signal thread, and don't find any valid Java frames. Would really like to put the second half of the conditional in some sort of debugging-only if statement.

isFirstJavaFrameback to summary
public boolean isFirstJavaFrame()

same for Java frame

isInterpretedFrameback to summary
public boolean isInterpretedFrame()

type testers

isInterpretedFrameValidback to summary
public abstract boolean isInterpretedFrameValid()

performs sanity checks on interpreted frames.

isJavaFrameback to summary
public boolean isJavaFrame()
isNativeFrameback to summary
public boolean isNativeFrame()
isRuntimeFrameback to summary
public boolean isRuntimeFrame()
isSignalHandlerFrameDbgback to summary
public abstract boolean isSignalHandlerFrameDbg()

This is an addition for debugging purposes on platforms which have the notion of signals.

nextMonitorInInterpreterFrameback to summary
public BasicObjectLock nextMonitorInInterpreterFrame(BasicObjectLock cur)
oopMapRegToLocationback to summary
public Address oopMapRegToLocation(VMReg reg, RegisterMap regMap)

Conversion from an VMReg::Name to physical stack location

oopsCodeBlobDoback to summary
private void oopsCodeBlobDo(AddressVisitor oopVisitor, RegisterMap regMap)
oopsDoback to summary
public void oopsDo(AddressVisitor oopVisitor, RegisterMap map)
oopsEntryDoback to summary
private void oopsEntryDo(AddressVisitor oopVisitor, RegisterMap regMap)
oopsInterpretedArgumentsDoback to summary
public void oopsInterpretedArgumentsDo(Symbol signature, boolean isStatic, AddressVisitor f)
oopsInterpretedDoback to summary
private void oopsInterpretedDo(AddressVisitor oopVisitor, RegisterMap map)
pcReturnOffsetback to summary
public static int pcReturnOffset()
previousMonitorInInterpreterFrameback to summary
public BasicObjectLock previousMonitorInInterpreterFrame(BasicObjectLock cur)
printOnback to summary
public void printOn(PrintStream tty)
printValueback to summary
public void printValue()
printValueOnback to summary
public void printValueOn(PrintStream tty)
realSenderback to summary
public Frame realSender(RegisterMap map)

returns the sender, but skips conversion frames

senderback to summary
public abstract Frame sender(RegisterMap map, CodeBlob nm)

returns the sending frame

senderback to summary
public Frame sender(RegisterMap map)

equivalent to sender(map, null)

setPCback to summary
public void setPC(Address newpc)
setSPback to summary
public abstract void setSP(Address newSP)
shouldBeDeoptimizedback to summary
public boolean shouldBeDeoptimized()

tells whether this frame is marked for deoptimization

sun.jvm.hotspot.runtime back to summary

private Class Frame.InterpVisitor

extends Object
implements OopMapVisitor
Class Inheritance
All Implemented Interfaces
sun.jvm.hotspot.compiler.OopMapVisitor

Field Summary

Modifier and TypeField and Description
private AddressVisitor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addressVisitorback to summary
private AddressVisitor addressVisitor

Constructor Detail

InterpVisitorback to summary
public InterpVisitor(AddressVisitor oopVisitor)

Method Detail

setAddressVisitorback to summary
public void setAddressVisitor(AddressVisitor addressVisitor)
visitDerivedOopLocationback to summary
public void visitDerivedOopLocation(Address baseOopAddr, Address derivedOopAddr)

Implements sun.jvm.hotspot.compiler.OopMapVisitor.visitDerivedOopLocation.

visitNarrowOopLocationback to summary
public void visitNarrowOopLocation(Address compOopAddr)

Implements sun.jvm.hotspot.compiler.OopMapVisitor.visitNarrowOopLocation.

visitOopLocationback to summary
public void visitOopLocation(Address oopAddr)

Implements sun.jvm.hotspot.compiler.OopMapVisitor.visitOopLocation.