public class RuntimeCodeInfoMemory extends Object
CodeInfo
structures of runtime-compiled methods (including invalidated and
not yet freed ones) and releases their memory on tear-down.
Implementation: linear probing hash table adapted from OpenJDK IdentityHashMap
.
All methods in here need to be either uninterruptible or it must be ensured that they are only called by the GC. This is necessary because the GC can invalidate code as well. So, it must be guaranteed that none of these methods is executed when a GC is triggered as we would end up with races between the application and the GC otherwise.
Modifier and Type | Method and Description |
---|---|
void |
add(CodeInfo info) |
int |
getCount() |
boolean |
remove(CodeInfo info) |
boolean |
removeDuringGC(CodeInfo info) |
static RuntimeCodeInfoMemory |
singleton() |
void |
tearDown() |
boolean |
walkRuntimeMethodsDuringGC(RuntimeCodeCache.CodeInfoVisitor visitor) |
boolean |
walkRuntimeMethodsUninterruptibly(RuntimeCodeCache.CodeInfoVisitor visitor) |
public static RuntimeCodeInfoMemory singleton()
public int getCount()
public void add(CodeInfo info)
public boolean remove(CodeInfo info)
public boolean removeDuringGC(CodeInfo info)
public boolean walkRuntimeMethodsDuringGC(RuntimeCodeCache.CodeInfoVisitor visitor)
public boolean walkRuntimeMethodsUninterruptibly(RuntimeCodeCache.CodeInfoVisitor visitor)
public void tearDown()