APIdia Launch Partner
Top Fields Constructors Methods
sun.jvm.hotspot.debugger

public Class PageCache

extends Object
Class Inheritance
Imports
sun.jvm.hotspot.utilities.*

Field Summary

Modifier and TypeField and Description
private LongHashMap
private boolean
private PageFetcher
private Page
private long
private long
private long
private long

Constructor Summary

AccessConstructor and Description
public
PageCache(long pageSize, long maxNumPages, PageFetcher fetcher)

The pageSize must be a power of two and implicitly specifies the alignment of pages.

Method Summary

Modifier and TypeMethod and Description
private void
private Page
checkPage(Page page, long startAddress)

private void
checkPageInfo(long pageSize, long maxNumPages)

Ensure that page size fits within 32 bits and is a power of two, and that maxNumPages > 0

public synchronized void
clear(long startAddress, long numBytes)

A mechanism for clearing cached data covering the given region

public synchronized void
clear()

A mechanism for clearing out the cache is necessary to handle detaching and reattaching

private int
public synchronized void
disable()

Disables the page cache; no further pages will be added to the cache and all existing pages will be flushed.

public synchronized void
enable()

Enables the page cache; fetched pages will be added to the cache.

private void
flushPage(long pageBaseAddress)

public synchronized boolean
getBoolean(long address)

public synchronized byte
getByte(long address)

public synchronized char
getChar(long address, boolean bigEndian)

public synchronized byte[]
getData(long startAddress, long numBytes)

This handles fetches which span multiple pages by virtue of the presence of the PageFetcher.

public synchronized double
getDouble(long address, boolean bigEndian)

public synchronized float
getFloat(long address, boolean bigEndian)

public synchronized int
getInt(long address, boolean bigEndian)

public synchronized long
getLong(long address, boolean bigEndian)

private Page
getPage(long pageBaseAddress)

Page fetcher plus LRU functionality

public synchronized short
getShort(long address, boolean bigEndian)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addressToPageMapback to summary
private LongHashMap addressToPageMap
enabledback to summary
private boolean enabled
fetcherback to summary
private PageFetcher fetcher
lruListback to summary
private Page lruList
maxNumPagesback to summary
private long maxNumPages
numPagesback to summary
private long numPages
pageMaskback to summary
private long pageMask
pageSizeback to summary
private long pageSize

Constructor Detail

PageCacheback to summary
public PageCache(long pageSize, long maxNumPages, PageFetcher fetcher)

The pageSize must be a power of two and implicitly specifies the alignment of pages. numPages specifies how many pages should be cached.

Method Detail

addPageToListback to summary
private void addPageToList(Page page)
checkPageback to summary
private Page checkPage(Page page, long startAddress)
checkPageInfoback to summary
private void checkPageInfo(long pageSize, long maxNumPages)

Ensure that page size fits within 32 bits and is a power of two, and that maxNumPages > 0

clearback to summary
public synchronized void clear(long startAddress, long numBytes)

A mechanism for clearing cached data covering the given region

clearback to summary
public synchronized void clear()

A mechanism for clearing out the cache is necessary to handle detaching and reattaching

countPagesback to summary
private int countPages()
disableback to summary
public synchronized void disable()

Disables the page cache; no further pages will be added to the cache and all existing pages will be flushed. Call this when the target process has been resumed.

enableback to summary
public synchronized void enable()

Enables the page cache; fetched pages will be added to the cache. Call this when the target process has been suspended.

flushPageback to summary
private void flushPage(long pageBaseAddress)
getBooleanback to summary
public synchronized boolean getBoolean(long address)
getByteback to summary
public synchronized byte getByte(long address)
getCharback to summary
public synchronized char getChar(long address, boolean bigEndian)
getDataback to summary
public synchronized byte[] getData(long startAddress, long numBytes) throws UnmappedAddressException

This handles fetches which span multiple pages by virtue of the presence of the PageFetcher. Throws UnmappedAddressException if a page on which data was requested was unmapped. This can not really handle numBytes > 32 bits.

getDoubleback to summary
public synchronized double getDouble(long address, boolean bigEndian)
getFloatback to summary
public synchronized float getFloat(long address, boolean bigEndian)
getIntback to summary
public synchronized int getInt(long address, boolean bigEndian)
getLongback to summary
public synchronized long getLong(long address, boolean bigEndian)
getPageback to summary
private Page getPage(long pageBaseAddress)

Page fetcher plus LRU functionality

getShortback to summary
public synchronized short getShort(long address, boolean bigEndian)
removePageFromListback to summary
private void removePageFromList(Page page)