vm_gc.h File Reference


Detailed Description

These are the functions that a GC built as a DLL may call.


Defines

#define CL_PROP_ALIGNMENT_MASK   0x00FFF
 
See also:
class_properties

#define CL_PROP_NON_REF_ARRAY_MASK   0x01000
 
See also:
class_properties

#define CL_PROP_ARRAY_MASK   0x02000
 
See also:
class_properties

#define CL_PROP_PINNED_MASK   0x04000
 
See also:
class_properties

#define CL_PROP_FINALIZABLE_MASK   0x08000
 
See also:
class_properties

#define P_RECURSION_BYTE(x)   ( (uint8 *)(((x)->get_obj_info_addr())) + 1 )
 extract the recursion counter from object lockword.

Enumerations

enum  safepoint_state { nill = 0, enumerate_the_universe, java_suspend_one_thread, java_debugger }
 thread state as concerns root set enumeration. More...
enum  WeakReferenceType { NOT_REFERENCE = 0, WEAK_REFERENCE, SOFT_REFERENCE, PHANTOM_REFERENCE }

Functions

VMEXPORT size_t vm_number_of_gc_bytes_in_vtable ()
 
Returns:
The number of bytes allocated by VM in VTable for use by GC.

VMEXPORT size_t vm_number_of_gc_bytes_in_thread_local ()
 
Returns:
The number of bytes allocated by VM in thread-local storage for use by GC.

VMEXPORT void * vm_get_gc_thread_local ()
 
Returns:
The pointer to thread-local area of current thread.

VMEXPORT void vm_gc_lock_init ()
 Initializes the lock that guards all GC-related operations in the VM.
VMEXPORT void vm_gc_lock_enum ()
 Acquire the lock that guards all GC-related operations in the VM.
VMEXPORT void vm_gc_unlock_enum ()
 Release the system-wide lock acquired by vm_gc_lock_enum().
VMEXPORT void vm_enumerate_root_set_all_threads ()
 GC calls this function to command VM to start root set enumeration.
VMEXPORT void vm_resume_threads_after ()
 GC calls this function to restart managed threads after root set enumeration is complete.
VMEXPORT void vm_classloader_iterate_objects (void *iterator)
 GC calls this function in stop the world state when all live objects are marked.
VMEXPORT bool vm_iterate_object (Managed_Object_Handle object)
 GC calls this function during heap iteration to iterate one object.
VMEXPORT void vm_notify_live_object_class (Class_Handle)
 GC calls this function for each live object it finds in heap.
VMEXPORT void vm_hint_finalize ()
 GC calls this function to hint VM that finalizers may need to be run and references enqueued.
VMEXPORT bool is_it_finalize_thread ()
VMEXPORT Boolean verify_object_header (void *ptr)
 
Returns:
TRUE if no apparent trash was found in the object.

VMEXPORT void vm_notify_obj_alive (void *)
 Routines to support lifecycle management of resources associated with a java object.
VMEXPORT void vm_reclaim_native_objs ()
VMEXPORT void vm_enqueue_reference (Managed_Object_Handle p_obj)
 GC should call this function when an phantom reference object is to be enqueued, i.e.
VMEXPORT void set_native_ref_enqueue_thread_flag (Boolean flag)
VMEXPORT WeakReferenceType class_is_reference (Class_Handle clss)
 Returns non-zero value if the class represented by Class_Handle is a descendant of java.lang.ref.Reference.
VMEXPORT Class_Handle vtable_get_class (VTable_Handle vh)
VMEXPORT int class_get_referent_offset (Class_Handle clss)
 Returns the offset of the referent field in the java.lang.ref.Reference object.
VMEXPORT void vm_finalize_object (Managed_Object_Handle p_obj)
 GC should call this function when an object becomes "f-reachable, finalizable" The VM later finalizes those objects in a way that is not part of this interface.
VMEXPORT void set_native_finalizer_thread_flag (Boolean flag)
 GC should call this function when an object becomes "f-reachable, finalizable" The VM later finalizes those objects in a way that is not part of this interface.
VMEXPORT void vm_heavy_finalizer_block_mutator (void)
 GC should call this function when an object becomes "f-reachable, finalizable" The VM later finalizes those objects in a way that is not part of this interface.


Define Documentation

#define CL_PROP_ALIGNMENT_MASK   0x00FFF

See also:
class_properties

#define CL_PROP_NON_REF_ARRAY_MASK   0x01000

See also:
class_properties

#define CL_PROP_ARRAY_MASK   0x02000

See also:
class_properties

#define CL_PROP_PINNED_MASK   0x04000

See also:
class_properties

#define CL_PROP_FINALIZABLE_MASK   0x08000

See also:
class_properties

#define P_RECURSION_BYTE (  )     ( (uint8 *)(((x)->get_obj_info_addr())) + 1 )

extract the recursion counter from object lockword.


Enumeration Type Documentation

enum safepoint_state

thread state as concerns root set enumeration.

Enumerator:
nill 
enumerate_the_universe  Thread is stopped for root set enumeration, as is the whole world (all managed threads).
java_suspend_one_thread  Thread is stopped for root set enumeration.
java_debugger  Thread is stopped by java debugger.

enum WeakReferenceType

Enumerator:
NOT_REFERENCE 
WEAK_REFERENCE 
SOFT_REFERENCE 
PHANTOM_REFERENCE 


Function Documentation

VMEXPORT size_t vm_number_of_gc_bytes_in_vtable (  ) 

Returns:
The number of bytes allocated by VM in VTable for use by GC.

VMEXPORT size_t vm_number_of_gc_bytes_in_thread_local (  ) 

Returns:
The number of bytes allocated by VM in thread-local storage for use by GC.

VMEXPORT void* vm_get_gc_thread_local (  ) 

Returns:
The pointer to thread-local area of current thread.

VMEXPORT void vm_gc_lock_init (  ) 

Initializes the lock that guards all GC-related operations in the VM.

VMEXPORT void vm_gc_lock_enum (  ) 

Acquire the lock that guards all GC-related operations in the VM.

If the lock can't be acquired the thread waits until the lock is available. This operation marks the current thread as being safe for root set enumeration.

VMEXPORT void vm_gc_unlock_enum (  ) 

Release the system-wide lock acquired by vm_gc_lock_enum().

The thread is marked as unsafe for root set enumeration.

VMEXPORT void vm_enumerate_root_set_all_threads (  ) 

GC calls this function to command VM to start root set enumeration.

Root set enumeration for all managed threads.

VMEXPORT void vm_resume_threads_after (  ) 

GC calls this function to restart managed threads after root set enumeration is complete.

This function resumes all threads suspended by vm_enumerate_root_set_all_threads()

VMEXPORT void vm_classloader_iterate_objects ( void *  iterator  ) 

GC calls this function in stop the world state when all live objects are marked.

This is the callback to classloader allowing it to gather needed statics for class unloading.

See also:
gc interface functions: gc_get_next_live_object(void *iterator)

VMEXPORT bool vm_iterate_object ( Managed_Object_Handle  object  ) 

GC calls this function during heap iteration to iterate one object.

The GC aborts heap iteration if this function returns false.

Returns:
TRUE to continue heap iteration, FALSE to abort
See also:
gc.h.gc_iterate_heap()

VMEXPORT void vm_notify_live_object_class ( Class_Handle   ) 

GC calls this function for each live object it finds in heap.

This is used for finding unreferenced class loaders for class unloading.

VMEXPORT void vm_hint_finalize (  ) 

GC calls this function to hint VM that finalizers may need to be run and references enqueued.

This method is guaranteed not to hold global GC lock.

Note:
The function introduced as a workaround for running finalizers until a complete solution with finalizer thread is implemented.

VMEXPORT bool is_it_finalize_thread (  ) 

VMEXPORT Boolean verify_object_header ( void *  ptr  ) 

Returns:
TRUE if no apparent trash was found in the object.

Used for debugging.

VMEXPORT void vm_notify_obj_alive ( void *   ) 

Routines to support lifecycle management of resources associated with a java object.

VMEXPORT void vm_reclaim_native_objs (  ) 

VMEXPORT void vm_finalize_object ( Managed_Object_Handle  p_obj  ) 

GC should call this function when an object becomes "f-reachable, finalizable" The VM later finalizes those objects in a way that is not part of this interface.

VM must not call finalizer immediately to prevent deadlocks in user code, because this functions may be called during the stop-the-world phase.

VMEXPORT void set_native_finalizer_thread_flag ( Boolean  flag  ) 

GC should call this function when an object becomes "f-reachable, finalizable" The VM later finalizes those objects in a way that is not part of this interface.

VM must not call finalizer immediately to prevent deadlocks in user code, because this functions may be called during the stop-the-world phase.

VMEXPORT void vm_heavy_finalizer_block_mutator ( void   ) 

GC should call this function when an object becomes "f-reachable, finalizable" The VM later finalizes those objects in a way that is not part of this interface.

VM must not call finalizer immediately to prevent deadlocks in user code, because this functions may be called during the stop-the-world phase.

VMEXPORT void vm_enqueue_reference ( Managed_Object_Handle  p_obj  ) 

GC should call this function when an phantom reference object is to be enqueued, i.e.

when the reference is not reachable anymore.

VMEXPORT void set_native_ref_enqueue_thread_flag ( Boolean  flag  ) 

VMEXPORT WeakReferenceType class_is_reference ( Class_Handle  clss  ) 

Returns non-zero value if the class represented by Class_Handle is a descendant of java.lang.ref.Reference.

The particular type of reference (weak, soft or phantom) is encoded by the return value of WeakReferenceType.

VMEXPORT Class_Handle vtable_get_class ( VTable_Handle  vh  ) 

VMEXPORT int class_get_referent_offset ( Class_Handle  clss  ) 

Returns the offset of the referent field in the java.lang.ref.Reference object.

clss is assumed to represent the reference object, i.e. class_is_reference() returned non-zero value.

Note:
The returned value is most probably a constant, and is not dependent on the clss.

This interface allows only one non-strong (i.e. weak soft or phantom) reference per object. It seems to be sufficient for JVM Spec.


Genereated on Tue Mar 11 19:25:23 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.