Index: trunk/vm/include/component_manager.h
===================================================================
--- trunk/vm/include/component_manager.h (revision 487512)
+++ trunk/vm/include/component_manager.h (working copy)
@@ -1,10 +1,10 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Intel, Alexei Fedotov
- * @version $Revision: 1.1.2.2.4.3 $
- */
#ifndef _VM_COMPONENT_MANAGER_H
#define _VM_COMPONENT_MANAGER_H
@@ -34,9 +30,10 @@
*
* This function is safe to call from multiple threads.
*
- * @param[out] p_cm on return, points to a component manager
- * interface handle
- * @return APR_SUCCESS if successful, or a non-zero error code
+ * @param[out] p_cm - on return, points to a component manager
+ * interface handle
+ *
+ * @return APR_SUCCESS if successful, or a non-zero error code.
*/
int CmAcquire(OpenComponentManagerHandle* p_cm);
@@ -46,19 +43,19 @@
*
* This function is safe to call from multiple threads.
*
- * @return APR_SUCCESS if successful, or a non-zero error code
+ * @return APR_SUCCESS if successful, or a non-zero error code.
*/
int CmRelease();
/**
* Register a buitin component in a component manager.
- * @param init_func initializer function which
- * provides a default and private interfaces for the
- * component
*
+ * @param init_func - initializer function which provides a default
+ * and private interfaces for the component
+ *
* This function is safe to call from multiple threads.
*
- * @return APR_SUCCESS if successful, or a non-zero error code
+ * @return APR_SUCCESS if successful, or a non-zero error code.
*/
int CmAddComponent(OpenComponentInitializer init_func);
@@ -69,27 +66,25 @@
*
* This function is safe to call from multiple threads.
*
- * @param path path to DLL which contains a component
- * @param initializer_function_name a name of a function
- * of OpenComponentInitializer type
- * that registers a component in a component manager
- * @return APR_SUCCESS if successful, or a non-zero error code
+ * @param path - path to DLL which contains a component
+ * @param initializer_function_name - a name of a function of OpenComponentInitializer
+ * type that registers a component in a component manager
+ *
+ * @return APR_SUCCESS if successful, or a non-zero error code.
*/
int CmLoadComponent(const char* path,
const char* initializer_function_name);
/**
- * Deallocate all instances of a given component,
- * unregister a component in a component manager,
- * and free all component resources using
- * Free function. If the component
- * is loaded from a dynamic library and no
- * components are using the library, then unload
+ * Deallocate all instances of a given component, unregister a component in a
+ * component manager, and free all component resources using
+ * Free function. If the component is loaded from a dynamic
+ * library and no components are using the library, then unload
* the dynamic library.
*
* This function is safe to call from multiple threads.
*
- * @return APR_SUCCESS if successful, or a non-zero error code
+ * @return APR_SUCCESS if successful, or a non-zero error code.
*/
int CmFreeComponent(const char* component_name);
Index: trunk/vm/include/jvmti.h
===================================================================
--- trunk/vm/include/jvmti.h (revision 487512)
+++ trunk/vm/include/jvmti.h (working copy)
@@ -1,10 +1,10 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,10 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Gregory Shimansky
- * @version $Revision: 1.1.2.1.4.4 $
- */
+
#ifndef _JVMTI_H_
#define _JVMTI_H_
@@ -61,7 +58,7 @@
#endif
/**
- * Agent Start-Up
+ * Agent Start-Up.
* The library must export a start-up function with the following
* prototype:
*/
@@ -69,7 +66,7 @@
Agent_OnLoad(JavaVM * vm, char *options, void *reserved);
/**
- * Agent Shutdown
+ * Agent Shutdown.
* The library may optionally export a shutdown function with the
* following prototype:
*/
Index: trunk/vm/include/open/em_profile_access.h
===================================================================
--- trunk/vm/include/open/em_profile_access.h (revision 487512)
+++ trunk/vm/include/open/em_profile_access.h (working copy)
@@ -1,10 +1,10 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,10 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Mikhail Y. Fursov
- * @version $Revision: 1.1.2.2.4.4 $
- */
+
#ifndef _EM_PROFILE_ACCESS_H_
#define _EM_PROFILE_ACCESS_H_
@@ -29,62 +26,78 @@
#endif
/**
- * Known profiler types. Each of the profilers
- * is represented with separate interface to
- * create and to access to profiles.
- */
+ * Known profiler types. Each of the profilers
+ * is represented with separate interface to
+ * create and to access to profiles.
+ */
enum EM_PCTYPE {
- /** Entry-backedge profiler
- * Collects number execution counts for
- * methods entries and backedges if present.
- */
+
+/**
+ * Entry-backedge profiler.
+ * Collects number execution counts for
+ * methods entries and backedges if present.
+ */
EM_PCTYPE_ENTRY_BACKEDGE=1,
- /** Edge profiler.
- * Collects profile for method entry and
- * all edges in IR Control Flow Graph
- */
+/**
+ * Edge profiler.
+ * Collects profile for method entry and
+ * all edges in IR Control Flow Graph.
+ */
EM_PCTYPE_EDGE=2,
- /** Value profiler
- * Collects profile for each given instruction
- */
+
+/**
+ * Value profiler.
+ * Collects profile for each given instruction.
+ */
EM_PCTYPE_VALUE=3
};
-/** A EM interface used to access to profile collectors*/
+/**
+ * A EM interface used to access to profile collectors.
+ */
typedef struct EM_ProfileAccessInterface {
- /** Request profile collector typ for specified profile collector handle
- * @param _this - EM instance profile collector belongs to
- * @param pc - profile collector handle we interested in
- * @return - the type of profile collector
- */
+/**
+ * Request profile collector type for specified profile collector handle.
+ *
+ * @param _this - EM instance profile collector belongs to
+ * @param pc - profile collector handle we interested in
+ *
+ * @return The type of profile collector.
+ */
EM_PCTYPE (*get_pc_type) (
EM_Handle _this,
PC_Handle pc
);
- /** Request method profile from profile collector
- * @param _this - EM instance profile collector belongs to
- * @param pc - profile collector used to collect profile
- * @param mh - method we asking profile for
- * @return - method profile handle, that can be used to access
- * to custom method profile properties with
- * specialized profile collector interface
- */
+/**
+ * Request method profile from profile collector.
+ *
+ * @param _this - EM instance profile collector belongs to
+ * @param pc - profile collector used to collect profile
+ * @param mh - method we asking profile for
+ *
+ * @return Method profile handle, that can be used to access
+ * to custom method profile properties with specialized
+ * profile collector interface.
+ */
Method_Profile_Handle (*get_method_profile)(
EM_Handle _this,
PC_Handle pc,
Method_Handle mh
);
- /** Request profile collector of specified type and role for a JIT
- * @param _this - EM instance profile collector belongs to
- * @param profile_type - the type of profile collector
- * @param jh - handle to JIT, profile collector created for.
- * @param jit_role - the role of JIT: the user or supplier of profile
- * @return - the handle to profile collector instance
- */
+ /**
+ * Request profile collector of specified type and role for a JIT.
+ *
+ * @param _this - EM instance profile collector belongs to
+ * @param profile_type - the type of profile collector
+ * @param jh - handle to JIT, profile collector created for
+ * @param jit_role - the role of JIT: the user or supplier of profile
+ *
+ * @return The handle to profile collector instance.
+ */
PC_Handle (*get_pc)(
EM_Handle _this,
@@ -99,108 +112,138 @@
// All methods below could be moved into separate EB and Edge
// profiler collectors specific files.
- /** Create new entry-backedge profile for a method
- * Only one profile per method can be created for a single
- * profile collector instance
- */
+/**
+ * Create new entry-backedge profile for a method.
+ * Only one profile per method can be created for a single
+ * profile collector instance.
+ */
Method_Profile_Handle (*eb_profiler_create_profile) (PC_Handle ph, Method_Handle mh);
- /** Request the address of entry counter
- * JIT configured to generate entry-backedge profile must
- * emit the code to increment this counter every time a method called
- */
+/**
+ * Request the address of entry counter.
+ * JIT configured to generate entry-backedge profile must
+ * emit the code to increment this counter every time a method called.
+ */
void* (*eb_profiler_get_entry_counter_addr)(Method_Profile_Handle mph);
- /** Request the address of backedge counter
- * JIT configured to generate entry-backedge profile must
- * emit the code to increment this counter every time any backedge in
- * a method is called
- */
+/**
+ * Request the address of backedge counter.
+ * JIT configured to generate entry-backedge profile must
+ * emit the code to increment this counter every time any backedge in
+ * a method is called.
+ */
void* (*eb_profiler_get_backedge_counter_addr)(Method_Profile_Handle mph);
- /** Check if entry-backedge profiler is configured to work in synchronous mode
- * In synchronous mode JIT is responsible to emit checks that counter's limit
- * is reached for both entry and backedge counters. If limit is reached
- * eb_profiler_sync_mode_callback must be called directly from managed code
- * In asynchronous mode counters checks are done by profile collector in a
- * separate thread.
- * @see eb_profiler_sync_mode_callback()
- */
+/**
+ * Check if entry-backedge profiler is configured to work in synchronous mode
+ * In synchronous mode JIT is responsible to emit checks that counter's limit
+ * is reached for both entry and backedge counters. If limit is reached
+ * eb_profiler_sync_mode_callback must be called directly from
+ * managed code.
+ * In asynchronous mode counters checks are done by profile collector in a
+ * separate thread.
+ *
+ * @sa eb_profiler_sync_mode_callback()
+ */
char (*eb_profiler_is_in_sync_mode)(PC_Handle pch);
- /** If profile collector is in 'sync' mode (@see eb_profiler_is_in_sync_mode())
- * JIT must call this method every time the counter limit is reached
- */
+/**
+ * If profile collector is in sync mode
+ * JIT must call this method every time the counter limit is reached.
+ *
+ * @sa eb_profiler_is_in_sync_mode()
+ */
void (*eb_profiler_sync_mode_callback)(Method_Profile_Handle mph);
- /** Return the counter's limit for entry threshold for a given
- * profile collector
- */
+/**
+ * @return The counter's limit for entry threshold for a given
+ * profile collector.
+ */
uint32 (*eb_profiler_get_entry_threshold)(PC_Handle pch);
- /** Return the counter's limit for backedge threshold for a given
- * profile collector
- */
+/**
+ * @return The counter's limit for backedge threshold for a given
+ * profile collector.
+ */
uint32 (*eb_profiler_get_backedge_threshold)(PC_Handle pch);
//EDGE profiler interface
- /** Create an edge profile for a method.
- * Only one profile per method can be created for a single
- * profile collector instance
- * @param ph - edge profile collector handle
- * @param mh - method handle to create profile for
- * @param numEdgeCounters - number of edge counters in a method
- * @param counterKeys - the keys, or numbers, will be associated with
- * each counter. The key must be used to access to
- * counter value
- * @param checksum - profile checksum
- * @return - a handle to access method profile data
- */
+ /**
+ * Create an edge profile for a method.
+ * Only one profile per method can be created for a single
+ * profile collector instance.
+ *
+ * @param ph - edge profile collector handle
+ * @param mh - method handle to create profile for
+ * @param numEdgeCounters - number of edge counters in a method
+ * @param counterKeys - the keys, or numbers, will be associated with
+ * each counter. The key must be used to access to
+ * counter value
+ * @param checksum - profile checksum
+ *
+ * @return A handle to access method profile data.
+ */
Method_Profile_Handle (*edge_profiler_create_profile) (PC_Handle ph, Method_Handle mh, uint32 numEdgeCounters, uint32* counterKeys, uint32 checkSum);
- /** Return number of edge counters in profile */
+ /**
+ * Return number of edge counters in profile.
+ */
uint32 (*edge_profiler_get_num_counters)(Method_Profile_Handle mph);
- /** Return profile checksum*/
+ /**
+ * Return profile checksum.
+ */
uint32 (*edge_profiler_get_checksum)(Method_Profile_Handle mph);
- /** Return the address of counter associated with key*/
+ /**
+ * Return the address of counter associated with key.
+ */
void* (*edge_profiler_get_counter_addr)(Method_Profile_Handle mph, uint32 key);
- /** Return the address of entry counter*/
+ /**
+ * Return the address of entry counter.
+ */
void* (*edge_profiler_get_entry_counter_addr)(Method_Profile_Handle mph);
- /** Return the entry threshold for profile collector
- */
+ /**
+ * Return the entry threshold for profile collector.
+ */
uint32 (*edge_profiler_get_entry_threshold)(PC_Handle pch);
- /** Return the edge threshold for profile collector
- */
+ /**
+ * Return the edge threshold for profile collector.
+ */
+
uint32 (*edge_profiler_get_backedge_threshold)(PC_Handle pch);
- // Value profiler interface
+
+ // Value profiler interface
- /** Create an value profile for a method.
- * Only one profile per method can be created for a single
- * profile collector instance
- * @param pch - value profile collector handle
- * @param mh - method handle to create profile for
- * @param numKeys - number of instructions to be profiled
- * @param keys - the keys, or numbers, will be associated with
- * each instruction. The key must be used to access to
- * instruction value
- */
+ /**
+ * Create an value profile for a method.
+ * Only one profile per method can be created for a single
+ * profile collector instance.
+ *
+ * @param pch - value profile collector handle
+ * @param mh - method handle to create profile for
+ * @param numKeys - number of instructions to be profiled
+ * @param keys - the keys, or numbers, will be associated with
+ * each instruction. The key must be used to access to
+ * instruction value
+ */
Method_Profile_Handle (*value_profiler_create_profile) (PC_Handle pch, Method_Handle mh, uint32 numKeys, uint32* keys);
- /** Update frequency or insert the new value of given instruction.
- */
+ /**
+ * Update frequency or insert the new value of given instruction.
+ */
void (*value_profiler_add_value)(Method_Profile_Handle mph, uint32 instructionKey, POINTER_SIZE_INT valueToAdd);
- /** Return the maximum value(by frequency) of give instruction.
- */
+ /**
+ * @return The maximum value(by frequency) of give instruction.
+ */
POINTER_SIZE_INT (*value_profiler_get_top_value) (Method_Profile_Handle mph, uint32 instructionKey);
Index: trunk/vm/include/open/gc.h
===================================================================
--- trunk/vm/include/open/gc.h (revision 487512)
+++ trunk/vm/include/open/gc.h (working copy)
@@ -1,10 +1,10 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Intel, Salikh Zakirov
- * @version $Revision: 1.1.2.1.4.3 $
- */
#ifndef _OPEN_GC_H
#define _OPEN_GC_H
@@ -31,9 +27,9 @@
*
* This is a global include file which provides to the VM an interface to the
* GC. This interface is the only supported interface that the VM should call
- * to talk to the GC. All routines in this C interface will begin with "gc_"
+ * to talk to the GC. All routines in this C interface will begin with gc_.
*
- * The GC expects that there is a vm_gc.h file holding the only
+ * The GC expects that there is a vm_gc.h file holding the only
* interface that the GC will use to talk to the VM.
*
* In order to eliminate dependency on certain types such as (VTable *) we
@@ -53,7 +49,7 @@
/**
- * GCExport is used to declare functions exported by GC.
+ * GCExport is used to declare functions exported by GC.
*/
#ifndef PLATFORM_POSIX
#ifdef BUILDING_VM
@@ -79,13 +75,10 @@
#if defined(USE_GC_STATIC) || defined(BUILDING_GC)
-/*
- * *****
- * *
- * * Routines to support the initialization and termination of GC.
- * *
- * *****
+/**
+ * @name Routines to support the initialization and termination of GC
*/
+//@{
/**
* Is called by VM to start GC initialization sequence.
@@ -97,10 +90,8 @@
*/
GCExport void gc_init();
-
-
/**
- * may be called at various points the VM decides are GC-safe.
+ * May be called at various points the VM decides are GC-safe.
* The GC may ignore this, or it may force a root set enumeration, or it may
* execute a full GC.
*
@@ -114,16 +105,13 @@
/**
* If the GC supports a "bump-the-pointer" style allocation, where the GC's
* thread-local information contains a "current" pointer and a "limit" pointer,
- * then it should return TRUE, and it should set *offset_of_current to be the
- * offset into the GC thread block of the "current" pointer, and similar for
- * *offset_of_limit and the "limit" pointer. If not, then it should return
- * FALSE.
+ * then it should return TRUE, and it should set *offset_of_current
+ * to be the offset into the GC thread block of the "current" pointer, and similar for
+ * *offset_of_limit and the "limit" pointer. If not, then it should return
+ * FALSE.
*/
GCExport Boolean gc_supports_frontier_allocation(unsigned *offset_of_current, unsigned *offset_of_limit);
-
-
-
/**
* This API is used by the VM to notify the GC that the
* VM has completed bootstrapping and initialization, and
@@ -131,21 +119,19 @@
* live references.
*
* Prior to this function being called the GC might see some
- * strange sights such as NULL or incomplete vtables. The GC will
+ * strange sights such as NULL or incomplete vtables. The GC will
* need to consider these as normal and work with the VM to ensure
* that bootstrapping works. This means that the GC will make few
* demands on the VM prior to this routine being called.
*
* However, once called the GC will feel free to do
* stop-the-world collections and will assume that the entire
- * gc_import.h interface is available and fully functioning.
+ * gc_import.h interface is available and fully functioning.
*
* If this routine is called twice the result is undefined.
*/
GCExport void gc_vm_initialized();
-
-
/**
* This is called once the VM has no use for the heap or the
* garbage collector data structures. The assumption is that the
@@ -154,21 +140,19 @@
* After this routine has been called the VM can not relie on any
* data structures created by the GC.
*
- * Errors: If gc_enumerate_finalizable_objects has been called and
- * gc_wrapup gc discovers an object that has not had it
+ * Errors: If gc_enumerate_finalizable_objects has been called and
+ * gc_wrapup gc discovers an object that has not had it
* finalizer run then it will attempt to report an error.
*/
GCExport void gc_wrapup();
-
-
/**
* Is called by the VM to enumerate the root reference.
*/
GCExport void gc_add_root_set_entry(Managed_Object_Handle *ref, Boolean is_pinned);
/**
- * Resembles gc_add_root_set_entry() but is passed the address of a slot
+ * Resembles gc_add_root_set_entry() but is passed the address of a slot
* containing a compressed reference.
*/
GCExport void gc_add_compressed_root_set_entry(uint32 *ref, Boolean is_pinned);
@@ -176,20 +160,20 @@
/**
* Is called by the VM to enumerate weak root reference.
*
- * @param slot An pointer to the slot, containing the weak root
- * @param is_pinned TRUE denotes that object pointed-to from this slot
- * should not be moved during garbage collection.
- * @param is_short_weak TRUE means that the weak root must be cleared
- * before object becomes eligible for finalization.
+ * @param slot - a pointer to the slot, containing the weak root
+ * @param is_pinned - TRUE denotes that object pointed-to from this slot
+ * should not be moved during garbage collection
+ * @param is_short_weak - TRUE means that the weak root must be cleared
+ * before object becomes eligible for finalization
*/
GCExport void gc_add_weak_root_set_entry(Managed_Object_Handle *slot,
Boolean is_pinned, Boolean is_short_weak);
-/*
+/**
* Enumerate a managed pointer.
- * The pointer can be declared as pinned. The pointer can
+ * The pointer can be declared as pinned. The pointer can
* point to the managed heap or any other area where data can be stored: stack
- * or static fields. It is the responsibility of the GC to ignore pointers
+ * or static fields. It is the responsibility of the GC to ignore pointers
* that are not in the managed heap.
*
* @note Is this function needed for Java? -salikh
@@ -197,22 +181,20 @@
GCExport void gc_add_root_set_entry_managed_pointer(void **slot,
Boolean is_pinned);
-
-
/**
- * Call from the VM to the gc to enumerate an interior pointer. **ref is a
+ * Call from the VM to the gc to enumerate an interior pointer. **ref is a
* slot holding a pointer into the interior of an object. The base of the
- * object is located at *ref - offset. The strategy employed is to place the
- * slot, the object base and the offset into a slot_base_offset table. We then
- * call gc_add_root_set_entry with the slot in the table holding the base of
+ * object is located at *ref - offset. The strategy employed is to place the
+ * slot, the object base and the offset into a slot_base_offset table. We then
+ * call gc_add_root_set_entry with the slot in the table holding the base of
* the object. Upon completion of the garbage collection the routine
- * fixup_interior_pointers is called and the slot_base_offset table is
+ * fixup_interior_pointers is called and the slot_base_offset table is
* traversed and the new interior pointer is calculated by adding the base of
- * the object and the offset. This new interior pointer value is then placed
+ * the object and the offset. This new interior pointer value is then placed
* into the slot.
*
* This routine can be called multiple times with the same interiour pointer
- * without any problems. The offset is checked to make sure it is positive but
+ * without any problems. The offset is checked to make sure it is positive but
* the logic is not dependent on this fact.
*
* @note Optional function, never called by Java virtual machine.
@@ -270,20 +252,20 @@
* pointer to the object. If it is not able to allocate the object
* without invoking a GC then it returns NULL.
*
- * @param size - the size of the object to allocate. If the high bit
- * set then various constraints as described above are
- * placed on the allocation of this object.
- * @param type - a pointer to the vtable of the class being
- * allocated. This routine will place this value
- * in the appropriate slot of the new object.
- * @param thread_pointer - a pointer to the GC's thread-local space.
+ * @param size - the size of the object to allocate. If the high bit
+ * set then various constraints as described above are
+ * placed on the allocation of this object.
+ * @param type - a pointer to the vtable of the class being
+ * allocated. This routine will place this value
+ * in the appropriate slot of the new object.
+ * @param thread_pointer - a pointer to the GC's thread-local space
*
- * This is like gc_malloc_or_null, except that it passes a pointer to
- * the thread's GC-specific space as a third argument. This prevents
- * the GC from having to immediately call vm_get_thread_curr_alloc_block()
+ * This is like gc_malloc_or_null, except that it passes a pointer to
+ * the thread's GC-specific space as a third argument. This prevents
+ * the GC from having to immediately call vm_get_thread_curr_alloc_block()
* as its first task.
*
- * @note rename of gc_malloc_with_thread_pointer()
+ * @note Rename of gc_malloc_with_thread_pointer().
*/
GCExport Managed_Object_Handle gc_alloc_fast(unsigned size,
Allocation_Handle type,
@@ -293,15 +275,15 @@
* This routine is used to allocate an object. See the above
* discussion on the overloading of size. {link allocation}
*
- * @param size - the size of the object to allocate. If the high bit
- * set then various constraints as described above are
- * placed on the allocation of this object.
- * @param type - a pointer to the vtable of the class being allocated.
- * This routine will place this value in the
- * appropriate slot of the new object.
- * @param thread_pointer - a pointer to the GC's thread-local space.
+ * @param size - the size of the object to allocate. If the high bit
+ * set then various constraints as described above are
+ * placed on the allocation of this object.
+ * @param type - a pointer to the vtable of the class being allocated.
+ * This routine will place this value in the
+ * appropriate slot of the new object.
+ * @param thread_pointer - a pointer to the GC's thread-local space
*
- * @note rename of gc_malloc_or_null_with_thread_pointer()
+ * @note Rename of gc_malloc_or_null_with_thread_pointer().
*/
GCExport Managed_Object_Handle gc_alloc(unsigned size,
Allocation_Handle type,
@@ -311,18 +293,19 @@
/**
* For bootstrapping situations, when we still don't have
* a class for the object. This routine is only available prior to
- * a call to the call gc_vm_initialized. If it is called after
- * the call to gc_vm_initialized then the results are undefined.
- * The GC places NULL in the vtable slot of the newly allocated
+ * a call to the call gc_vm_initialized. If it is called after
+ * the call to gc_vm_initialized then the results are undefined.
+ * The GC places NULL in the vtable slot of the newly allocated
* object.
*
* The object allocated will be pinned, not finalizable and not an array.
*
* @param size - the size of the object to allocate. The high bit
* will never be set on this argument.
- * @return The newly allocated object
*
- * @note Will be renamed to gc_alloc_pinned_noclass() to comply with
+ * @return The newly allocated object.
+ *
+ * @note Will be renamed to gc_alloc_pinned_noclass() to comply with
* accepted naming conventions.
*/
GCExport Managed_Object_Handle gc_pinned_malloc_noclass(unsigned size);
@@ -335,45 +318,34 @@
GCExport Managed_Object_Handle gc_alloc_pinned(unsigned size, Allocation_Handle type, void *thread_pointer);
-
-
-/*
- * *****
- * *
- * * Routines to support write barriers.
- * *
- * *****
+//@}
+/** @name Routines to support write barriers
*/
+//@{
+
/**
- * Returns TRUE if the GC requires write barriers before every store to
- * a field of a reference tpe.
+ * @return TRUE if the GC requires write barriers before every store to
+ * a field of a reference type.
*/
GCExport Boolean gc_requires_barriers();
-
-
-/*
- * *****
- * *
- * * Routines to support threads.
- * *
- * *****
+//@}
+/** @name Routines to support threads
*/
+//@{
+
/**
* This routine is called during thread startup to set
* an initial nursery for the thread.
*
- * @note gc_thread_init and gc_thread_kill assume that
- * the current thread is the one we are interested in
- * If we passed in the thread then these things could be
- * cross inited and cross killed.
+ * @note gc_thread_init and gc_thread_kill assume that
+ * the current thread is the one we are interested in. If we passed in the
+ * thread then these things could be cross inited and cross killed.
*/
GCExport void gc_thread_init(void *gc_information);
-
-
/**
* This is called just before the thread is reclaimed.
*/
@@ -389,7 +361,7 @@
* This function signals VM to obtain thread lock and start thread iteration.
*
* \li vm obtains thread lock
- * \li vm repeatedly calls gc_iterate_thread(thread)
+ * \li vm repeatedly calls gc_iterate_thread(thread)
* \li vm releases thread lock
*
* @note Not implemented.
@@ -398,15 +370,15 @@
/**
* VM calls this method repeatedly to iterate over the list of java threads,
- * initiated earlier by calling vm_iterate_threads()
+ * initiated earlier by calling vm_iterate_threads().
*
* Thread creation and termination is locked during this iteration.
*
* gc may do one of the following:
* 1. store thread handle for later use
* 2. enumerate thread right now, while
- * holding thread lock (using vm_suspend_thread(thread) and
- * vm_enumerate_thread_root_set(thread)).
+ * holding thread lock (using vm_suspend_thread(thread) and
+ * vm_enumerate_thread_root_set(thread)).
*
* @note Not implemented.
*/
@@ -425,13 +397,13 @@
*
* GC calls this VM function when it wants a thread
* to be suspended for stack enumeration or
- * read/write barrier change
+ * read/write barrier change.
*
- * blocks until synchronously call gc_thread_suspended(thread)
+ * blocks until synchronously call gc_thread_suspended(thread)
* or asynchronously delegate enumeration to thread
* (self-enumeration)
*
- * @note we need a way to signal that process of thread suspension
+ * @note We need a way to signal that process of thread suspension
* is complete.
*
* @note Not implemented.
@@ -442,19 +414,19 @@
* VM calls this GC callback when it's accomplished the requested
* operation of suspending a thread in gc-safe point
*
- * may be called synchronously from the same context
- * as vm_suspend_thread() in case of cross-enumeration, or
+ * May be called synchronously from the same context
+ * as vm_suspend_thread() in case of cross-enumeration, or
* may be called asynchronously from the specified
- * thread context in case of self-enumeration
+ * thread context in case of self-enumeration.
*
- * after this function completes,
- * the thread is resumed automatically
+ * After this function completes,
+ * the thread is resumed automatically.
*
* GC is expected to call a limited subset
* of GC-VM interface functions from this callback:
- * \li vm_enumerate_thread_root_set(thread)
- * \li vm_install_write_barrier(...)
- * (hypothetical, not designed yet)
+ * \li vm_enumerate_thread_root_set(thread)
+ * \li vm_install_write_barrier(...)
+ * (hypothetical, not designed yet)
* \li make a thread stack snapshot for later analysis
*
* @note Not implemented.
@@ -463,9 +435,9 @@
/**
* GC calls this function to command VM to enumerate a thread,
- * which was earlier suspenden using vm_suspend_thread().
+ * which was earlier suspenden using vm_suspend_thread().
*
- * In response to this call, VM repeatedly calls gc_add_root_set_entry() to
+ * In response to this call, VM repeatedly calls gc_add_root_set_entry() to
* enumerate thread stacks and local handles
*
* @note Not implemented.
@@ -475,7 +447,7 @@
/**
* GC calls this function to command VM to enumerate global slots.
*
- * during enumeration of global root set, either all threads need
+ * During enumeration of global root set, either all threads need
* to be suspended, or write barrier installed.
*
* Apparently some operations should be blocked in VM, like class loading,
@@ -484,25 +456,20 @@
* this function or introduce new system-wide lock on operations that
* change the number of global reference slots.
*
- * this function calls gc_add_root_set_entry() for all global reference
+ * This function calls gc_add_root_set_entry() for all global reference
* slots.
*
* @note Not implemented.
*/
VMEXPORT void vm_enumerate_global_root_set();
-
-
-/*
- * *****
- * *
- * * Routines to support the functionality required by the Java language specification.
- * *
- * *****
+//@}
+/** @name Routines to support the functionality required by the Java language specification
*/
+//@{
/**
* API for the VM to force a GC, typically in response to a call to
- * java.lang.Runtime.gc
+ * java.lang.Runtime.gc.
*/
GCExport void gc_force_gc();
@@ -510,26 +477,27 @@
/**
* API for the VM to determine the current GC heap size, typically in response to a
- * call to java.lang.Runtime.totalMemory
+ * call to java.lang.Runtime.totalMemory.
*/
GCExport int64 gc_total_memory();
/**
* API for the VM to determine the maximum GC heap size, typically in response to a
- * call to java.lang.Runtime.maxMemory
+ * call to java.lang.Runtime.maxMemory.
*/
GCExport int64 gc_max_memory();
/**
* API for the VM to get an approximate view of the free space,
- * typically in response to a call to java.lang.Runtime.freeMemory
+ * typically in response to a call to java.lang.Runtime.freeMemory.
*/
GCExport int64 gc_free_memory();
/**
- * returns TRUE if the object is pinned.
+ * @return TRUE if the object is pinned.
+ *
* Routine to support the functionality required by JNI to see if an object is pinned.
*/
GCExport Boolean gc_is_object_pinned (Managed_Object_Handle obj);
@@ -555,8 +523,8 @@
#else /* #if defined(USE_GC_STATIC) || defined(BUILDING_GC) */
-/*
- * the below variables are used in the runtime dynamic linking of
+/**
+ * The below variables are used in the runtime dynamic linking of
* garbage collector with virtual machine executable.
*/
@@ -604,11 +572,11 @@
/**
- * granularity of object alignment.
+ * Granularity of object alignment.
*
* Objects are aligned on 4 or 8 bytes. If they are aligned on 8 bytes then
* Arrays will be required to start on the indicated alignement. This means that
- * for 8 byte alignment on the IA32 the header will look like this
+ * for 8 byte alignment on the IA32 the header will look like this:
*
* uint32 gc_header_lock_hash
* VTable *vt
@@ -627,7 +595,7 @@
#if !defined(USE_GC_STATIC) && !defined(BUILDING_GC)
/*
- * the below variables are used in the runtime dynamic linking of
+ * The below variables are used in the runtime dynamic linking of
* garbage collector with virtual machine executable.
*/
@@ -650,7 +618,7 @@
/*
* The variables below are exported by the VM so other DLLs modules
- * may use them. dll_gc.cpp initializes them to the addresses exported
+ * may use them. dll_gc.cpp initializes them to the addresses exported
* by GC DLL.
*/
@@ -661,25 +629,20 @@
#else // USE_GC_STATIC
-
-/*
- * *****
- * *
- * * Routines to support various write barriers.
- * *
- * *****
+//@}
+/** @name Routines to support various write barriers
*/
+//@{
-
/**
- * Returns TRUE if references within objects and vector elements are to be
- * treated as offsets rather than raw pointers.
+ * @return TRUE if references within objects and vector
+ * elements are to be treated as offsets rather than raw pointers.
*/
GCExport Boolean gc_supports_compressed_references();
/**
* These interfaces are marked for replacement for the IPF by the following
- * gc_heap_write_mumble interface.
+ * gc_heap_write_mumble interface.
*
* @deprecated Will be removed soon.
*/
@@ -695,7 +658,7 @@
/**
- * by calling this function VM notifies GC that a heap reference was written to
+ * By calling this function VM notifies GC that a heap reference was written to
* global slot.
*
* There are some global slots that are shared by different threads. Write
@@ -753,8 +716,8 @@
GCExport int32 gc_get_hashcode (Managed_Object_Handle object);
/**
- * * Get object hashcode
- * */
+ * Get object hashcode.
+ */
GCExport int32 gc_get_hashcode (Managed_Object_Handle p_object);
/**
@@ -765,12 +728,12 @@
/**
* Iterates all objects in the heap.
- * This function calls vm_iterate_object() for each
+ * This function calls vm_iterate_object() for each
* iterated object.
* Used for JVMTI Heap Iteration.
* Should be called only in stop-the-world setting
*
- * @see vm_gc.h#vm_iterate_object()
+ * @see vm_gc.h#vm_iterate_object()
*/
GCExport void gc_iterate_heap();
@@ -780,30 +743,28 @@
GCExport void gc_finalize_on_exit();
-/*
- * *****
- * *
- * * Routines to support soft, weak, and phantom reference objects.
- * *
- * *****
+//@}
+/** @name Routines to support soft, weak, and phantom reference objects
*/
+//@{
+
// XXX move this elsewhere -salikh
#ifdef JNIEXPORT
/**
* reference - the reference object to register.
* referent - the referent of the reference object that is to be
- * retrieved with the get method.
+ * retrieved with the get method.
*
* The weak reference code written in Java and the support code provide by the
- * VM must agree on what the layout of a Java.lang.ref.Reference object looks
+ * VM must agree on what the layout of a Java.lang.ref.Reference object looks
* like and agree that any subclassing will only append fields to the agreed
- * upon layout. This seems reasonable.
+ * upon layout. This seems reasonable.
*
* In addition the support code will have exclusive knowledge and control of a
- * single field (called the_referent) which holds the reference to the target
- * object. The java code will assume that this field is a read only integer
- * and should not be traced by the gc. The Java.lang.ref.ReferenceQueue layout
+ * single field (called the_referent) which holds the reference to the target
+ * object. The java code will assume that this field is a read only integer
+ * and should not be traced by the gc. The Java.lang.ref.ReferenceQueue layout
* needs to also be known by the supporting code so that it can move reference
* objects onto the queues at the appropriate times. The Java code uses normal
* mechanisms to load the Reference classes and to create a reference.
@@ -811,9 +772,10 @@
* The constructor code however needs to call the appropriate register function
* listed below based upon whether we have a soft, weak, or phantom reference.
* The VM support code will fill in the referent field. The routine
- * gc_get_referent will return the value in this field. Note that the phantom
- * reference method get will not use the gc_get_referent but instead just
- * return NULL as required by the spec.
+ * gc_get_referent will return the value in this field.
+ *
+ * @note The phantom reference method get will not use the gc_get_referent
+ * but instead just return NULL as required by the spec.
*
* @note XXX Why are they in gc_export.h? -salikh
*/
@@ -849,14 +811,14 @@
GCExport unsigned int gc_time_since_last_gc();
/**
- * @return the base address of the heap.
+ * @return The base address of the heap.
*
- * API for VM to determine the starting and ending adddresses of the heap
+ * API for VM to determine the starting and ending adddresses of the heap.
*/
GCExport void *gc_heap_base_address();
/**
- * @return the top address of the heap.
+ * @return The top address of the heap.
*/
GCExport void *gc_heap_ceiling_address();
@@ -870,9 +832,6 @@
/**
* \page gc_finalization_and_weak_refs Finalization and weak references design in GC
*
- * @author Salikh Zakirov
- * @version written on 2005-05-31
- *
* \section gc_finalization Finalization
*
* According to the JVM specification, VM must call non-trivial finalization methods
@@ -884,11 +843,12 @@
* phantom reference strengh, however, without requiring any particular interaction
* from them. (In the code we sometimes refer to weak references as short weak
* references, and call JNI weak global references long weak references.
- * See gc_add_weak_root_set_entry() for more details).
*
+ * @sa gc_add_weak_root_set_entry() for more details
+ *
* The requirements described above can be met using following algorithm.
* \li All weak reference classes can be identified on the stage of class preparation,
- * when VM calls gc_class_prepared() callback.
+ * when VM calls gc_class_prepared() callback.
* \li We start marking with regular (strong) roots, and traverse only strong references.
* During the process of marking all objects of the reference classes are collected
* to the reference lists. As we traverse only strong references, only strongly reachable
@@ -920,7 +880,7 @@
* \li Long weak roots are handled in exactly the same way as short weak roots.
* \li Note, that as the references are cleared, they are also added to the list
* of references to be enqueued. This list is later transferred to the VM
- * using vm_enqueue_reference() function.
+ * using vm_enqueue_reference() function.
* \li Weak reference objects require special handling of their referent field,
* because it needs to be reported as an updatable slot before compaction.
* This is performed as a last step, when we have a guarantee that all
@@ -931,40 +891,37 @@
* Current implementation of weak references places the following requirements
* \li All reference objects must have exactly one non-regulur object reference,
* and this reference must be at the same offset for references of all types.
- * GC calls class_is_reference() to find out whether the class represents
+ * GC calls class_is_reference() to find out whether the class represents
* weak reference and finds out the referent offset by calling VM function
- * class_get_referent_offset(). Note, that referent offset being constant
+ * class_get_referent_offset(). Note, that referent offset being constant
* for all kinds of references is not enforced by this interface.
- * \li VM must not enqueue references during call of vm_enqueue_reference()
+ * \li VM must not enqueue references during call of vm_enqueue_reference()
* because this may lead to deadlocks on reference queue monitors due
- * to the fact that vm_enqueue_reference() is called during stop-the-world
+ * to the fact that vm_enqueue_reference() is called during stop-the-world
* phase of garbage collection.
*/
/**
-\page gc_vm_interface GC-VM interface
+ * \page gc_vm_interface GC-VM interface
+ *
+ * The interface between garbage collector and virtual machine is
+ * bidirectional:
+ *
+ * - gc.h contains functions, which GC exports for use in VM.
+ *
vm_gc.h contains VM functions which are available to GC during its
+ * operation.
+ *
+ *
+ * A number of conventions exist, which are not easily expressed as C++ header
+ * files. These include:
+ *
+ * - Thread local nurseries, see gc_supports_frontier_allocation().
+ *
- Read and Write barrier interface, gc_heap_write_ref() and others.
+ *
+ *
+ * The conceptual overview of the interface is given in @link guide GC Writers'
+ * guide @endlink
+ */
-@author Salikh Zakirov
-@version 2005-05-31
-
-The interface between garbage collector and virtual machine is
-bidirectional:
-
-- gc.h contains functions, which GC exports for use in VM.
-
- vm_gc.h contains VM functions which are available to GC during its
-operation.
-
-
-A number of conventions exist, which are not easily expressed as C++ header
-files. These include:
-
-- Thread local nurseries, see gc_supports_frontier_allocation().
-
- Read and Write barrier interface, gc_heap_write_ref() and others.
-
-
-The conceptual overview of the interface is given in @link guide GC Writers'
-guide @endlink
-*/
-
#endif // _OPEN_GC_H
Index: trunk/vm/include/open/hythread_ext.h
===================================================================
--- trunk/vm/include/open/hythread_ext.h (revision 487512)
+++ trunk/vm/include/open/hythread_ext.h (working copy)
@@ -1,10 +1,10 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -296,11 +296,12 @@
int VMCALL hythread_is_daemon(hythread_t thread) ;
-/**
- * //@}
- * TM Thread states constants. They are compatible with JVMTI.
- * //@{
- */
+ //@}
+ /**
+ * TM Thread states constants. They are compatible with JVMTI.
+ */
+//@{
+
#define TM_THREAD_STATE_ALIVE JVMTI_THREAD_STATE_ALIVE // 0x0001 Thread is alive. Zero if thread is new (not started) or terminated.
#define TM_THREAD_STATE_TERMINATED JVMTI_THREAD_STATE_TERMINATED // 0x0002Thread has completed execution.
#define TM_THREAD_STATE_RUNNABLE JVMTI_THREAD_STATE_RUNNABLE // 0x0004 Thread is runnable.
Index: trunk/vm/include/open/thread_externals.h
===================================================================
--- trunk/vm/include/open/thread_externals.h (revision 487512)
+++ trunk/vm/include/open/thread_externals.h (working copy)
@@ -1,9 +1,9 @@
/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-/*
- * @author Artem Aliev
- * @version $Revision$
- */
#ifndef OPEN_THREAD_EXTERNALS_H
#define OPEN_THREAD_EXTERNALS_H
@@ -32,50 +28,50 @@
/**
- * Returns the address of the memory chunk in the object which can be used by the
- * Thread Manager for synchronization purposes.
+ * @param[in] obj - jobject those address needs to be given
*
- * @param[in] obj jobject those address needs to be given
- * @return
+ * @return The address of the memory chunk in the object which can be used by the
+ * Thread Manager for synchronization purposes.
*/
VMEXPORT void *vm_object_get_lockword_addr(jobject obj);
/**
- * Returns the size of the memory chunk in the object that can be used by
- * Thread Manager for synchronization purposes.
+ * @return The size of the memory chunk in the object that can be used by
+ * Thread Manager for synchronization purposes.
*
* The returned size must be equal for all Java objets and is constant over time.
- * It should be possible to call this method during initialization time.
- *
- * @return the size
+ * It should be possible to call this method during initialization time.
*/
VMEXPORT size_t vm_object_get_lockword_size();
/**
- * Stores a pointer to TM-specific data in the java.lang.Thread object.
+ * Stores a pointer to TM-specific data in the java.lang.Thread object.
*
* A typical implementation may store a pointer within a private
* non-static field of Thread.
*
- * @param[in] thread a java.lang.Thread object those private field is going to be used for data storage
- * @param[in] data_ptr a pointer to data to be stored
+ * @param[in] thread - a java.lang.Thread object those private field
+ * is going to be used for data storage
+ * @param[in] data_ptr - a pointer to data to be stored
*/
VMEXPORT void vm_jthread_set_tm_data(jthread thread, void *data_ptr);
/**
- * Retrieves TM-specific data from the java.lang.Thread object
+ * Retrieves TM-specific data from the java.lang.Thread object.
*
- * @param[in] thread a thread
- * @return TM-specific data previously stored, or NULL if there are none.
+ * @param[in] thread - a thread
+ *
+ * @return TM-specific data previously stored, or NULL,
+ * if there are none.
*/
VMEXPORT void *vm_jthread_get_tm_data(jthread thread);
/**
- * Registrates current thread in VM, so it could execute Java
+ * Registrates current thread in VM, so it could execute Java.
*
- * @param[in] java_vm current thread will be attached to the specified VM
- * @param[out] p_jni_env will point to JNI environment assocciated with the thread
+ * @param[in] java_vm - current thread will be attached to the specified VM
+ * @param[out] p_jni_env - will point to JNI environment assocciated with the thread
*/
VMEXPORT jint vm_attach(JavaVM * java_vm, JNIEnv ** p_jni_env);
@@ -85,17 +81,19 @@
VMEXPORT jint vm_detach(jthread java_thread);
/**
- * creates exception object using given class name and message and throws it
- * using jthread_throw_exception method;
- * @param[in] name char* -name
- * @param[in] message char* -message
- * @return int.
+ * Creates exception object using given class name and message and throws it
+ * using jthread_throw_exception method.
+ *
+ * @param[in] name - char* name
+ * @param[in] message - char* message
+ *
+ * @return int
*/
VMEXPORT IDATA jthread_throw_exception(char* name, char* message);
/**
- * Throws given exception object; Desides whether current thread is unwindable
- * and throws it, raises exception otherwise;
+ * Throws given exception object. Desides whether current thread is unwindable
+ * and throws it, raises exception otherwise.
*/
VMEXPORT IDATA jthread_throw_exception_object(jobject object);
@@ -106,16 +104,18 @@
VMEXPORT void jvmti_send_wait_monitor_event(jobject obj, jlong timeout);
/**
- * vm_objects_are_equal
- * obj1 jobject
- * obj2 jobject
- * @return int
+ * vm_objects_are_equal
+ * obj1 jobject
+ * obj2 jobject
+ *
+ * @return int
*/
VMEXPORT int vm_objects_are_equal(jobject obj1, jobject obj2);
/**
- * ti is enabled
- * @return int
+ * ti is enabled
+ *
+ * @return int
*/
VMEXPORT int ti_is_enabled();
Index: trunk/vm/include/open/thread_helpers.h
===================================================================
--- trunk/vm/include/open/thread_helpers.h (revision 487512)
+++ trunk/vm/include/open/thread_helpers.h (working copy)
@@ -1,6 +1,6 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
@@ -14,11 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Artem Aliev
- * @version $Revision$
- */
+
#ifndef OPEN_THREAD_HELPERS_H
#define OPEN_THREAD_HELPERS_H
@@ -26,7 +23,7 @@
* @file
* @brief Provides optimized assambly code generators for common monitor functions.
*
- * For more detailes see thread manager component documentation located at vm/thread/doc/ThreadManager.htm
+ * @sa Thread manager component documentation located at vm/thread/doc/ThreadManager.htm
*/
#include "open/types.h"
Index: trunk/vm/include/open/ti_thread.h
===================================================================
--- trunk/vm/include/open/ti_thread.h (revision 487512)
+++ trunk/vm/include/open/ti_thread.h (working copy)
@@ -1,10 +1,10 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,11 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Andrey Chernyshev
- * @version $Revision$
- */
+
#ifndef OPEN_THREAD_TI_H
#define OPEN_THREAD_TI_H
@@ -27,8 +24,9 @@
* @brief JVMTI support
* @details
* TI part of the Java threading interface.
- * The TI part is mostly targeted to address the needs of JVMTI and java.lang.management classes needs.
- * All functions start with jthread_* prefix.
+ * The TI part is mostly targeted to address the needs of JVMTI and
+ * java.lang.management classes needs.
+ * All functions start with jthread_* prefix.
*/
#include "jvmti_types.h"
@@ -40,7 +38,7 @@
#endif /* __cplusplus */
/**
- * JVM TI local storage structure
+ * JVM TI local storage structure.
*
* @param[in] thread
*/
Index: trunk/vm/include/open/types.h
===================================================================
--- trunk/vm/include/open/types.h (revision 487512)
+++ trunk/vm/include/open/types.h (working copy)
@@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Intel, Alexei Fedotov
- * @version $Revision: 1.1.2.1.4.3 $
- */
#ifndef _VM_TYPES_H_
#define _VM_TYPES_H_
@@ -25,10 +21,9 @@
#include "common.h"
#define MAX_UINT32 0xffffffff
-
-//////////////////////////////////////////////////////////////////////////
-// DLL stuff
-
+/**
+ * DLL stuff
+ */
#if defined(PLATFORM_POSIX) || (defined(USE_STATIC_GC) && defined(BUILDING_GC))
#define VMEXPORT
@@ -52,8 +47,9 @@
#endif // !PLATFORM_POSIX
-//////////////////////////////////////////////////////////////////////////
-// Various Numeric Types
+/**
+ * Various Numeric Types
+ */
// Boolean, uint8, int8, uint16, int16, uint32, int32, uint64, int64,
// POINTER_SIZED_INT
@@ -123,10 +119,12 @@
#endif //!PLATFORM_POSIX
-// The integer datatype on the platform that can hold a pointer.
-// ? 02/7/25: addded POINTER_SIZE_SINT, since in some cases
-// a pointer-size integer has to be signed (for example, when specifying LIL offsets)
-#ifdef POINTER64
+/**
+ * The integer datatype on the platform that can hold a pointer.
+ * ? 02/7/25: addded POINTER_SIZE_SINT, since in some cases
+ * a pointer-size integer has to be signed (for example, when specifying LIL offsets)
+ */
+ #ifdef POINTER64
#define POINTER_SIZE_INT uint64
#define POINTER_SIZE_SINT int64
#ifdef PLATFORM_NT
@@ -140,8 +138,9 @@
#define PI_FMT ""
#endif // POINTER64
-//////////////////////////////////////////////////////////////////////////
-// VM_Data_Type
+/**
+ * VM_Data_Type
+ */
typedef
enum VM_Data_Type {
@@ -172,8 +171,10 @@
VM_DATA_TYPE_END = ')' // For the iterator
} VM_Data_Type; //VM_Data_Type
-// (? 20030317) These defines are deprecated.
-// Use VM_Data_Type in all new code.
+/**
+ * (? 20030317) These defines are deprecated.
+ * Use VM_Data_Type in all new code.
+ */
#define Java_Type VM_Data_Type
#define JAVA_TYPE_BYTE VM_DATA_TYPE_INT8
#define JAVA_TYPE_CHAR VM_DATA_TYPE_CHAR
@@ -190,12 +191,12 @@
#define JAVA_TYPE_INVALID VM_DATA_TYPE_INVALID
#define JAVA_TYPE_END VM_DATA_TYPE_END
-//////////////////////////////////////////////////////////////////////////
-// Handles for Various VM Structures
-
-// This header file is also used in pure C sources,
-// thus we use struct instead of classes
-
+/**
+ * Handles for Various VM Structures.
+ *
+ * This header file is also used in pure C sources,
+ * thus we use struct instead of classes.
+ */
typedef struct Class *Class_Handle;
typedef struct VTable *VTable_Handle;
typedef struct Field *Field_Handle;
@@ -203,31 +204,37 @@
typedef struct Method_Signature *Method_Signature_Handle;
typedef struct TypeDesc *Type_Info_Handle;
typedef POINTER_SIZE_INT Allocation_Handle;
+typedef POINTER_SIZE_INT Runtime_Type_Handle;
typedef void* NativeCodePtr;
typedef struct ClassLoader* ClassLoaderHandle;
typedef struct ManagedObject* ManagedPointer;
-// Fields of these types are not directly accessible from the core VM.
-// typedef struct ManagedObject Java_java_lang_Class;
-// typedef ManagedObject Java_java_lang_System;
+/**
+ * Fields of these types are not directly accessible from the core VM.
+ */
+ typedef struct ManagedObject Java_java_lang_Class;
+typedef ManagedObject Java_java_lang_System;
typedef struct ManagedObject Java_java_lang_Throwable;
typedef struct ManagedObject Java_java_lang_Thread;
typedef struct ManagedObject Java_java_io_FileInputStream;
typedef struct ManagedObject Java_java_lang_String;
-// Used for opaques accesses to managed arrays. This handle points
-// to an array in the managed heap, so handling must be careful to account
-// for the possiblity of a moving GC.
-typedef void *Vector_Handle;
+/**
+ * Used for opaques accesses to managed arrays. This handle points
+ * to an array in the managed heap, so handling must be careful to account
+ * for the possiblity of a moving GC.
+ */
+ typedef void *Vector_Handle;
typedef void *Managed_Object_Handle;
typedef void *GC_Enumeration_Handle;
-//For disable warnings in release version.
-//warning type: warning: unused variable
+/**
+ * For disable warnings in release version.
+ * warning type: warning: unused variable
+ */
-//////////////////////////////////////////////////////////////////////////
#endif //!_VM_TYPES_H_
Index: trunk/vm/include/open/vm_gc.h
===================================================================
--- trunk/vm/include/open/vm_gc.h (revision 487512)
+++ trunk/vm/include/open/vm_gc.h (working copy)
@@ -14,11 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Intel, Salikh Zakirov
- * @version $Revision: 1.1.2.1.4.3 $
- */
+
#ifndef _OPEN_VM_GC_H
#define _OPEN_VM_GC_H
@@ -38,25 +35,23 @@
/**
- * @return the number of bytes allocated by VM in VTable
+ * @return The number of bytes allocated by VM in VTable
* for use by GC.
*/
VMEXPORT size_t vm_number_of_gc_bytes_in_vtable();
/**
- * @return the number of bytes allocated by VM in thread-local
+ * @return The number of bytes allocated by VM in thread-local
* storage for use by GC.
*/
VMEXPORT size_t vm_number_of_gc_bytes_in_thread_local();
/**
- * @return the pointer to thread-local area of current thread.
+ * @return The pointer to thread-local area of current thread.
*/
VMEXPORT void *vm_get_gc_thread_local();
-VMEXPORT size_t vm_get_gc_thread_local_offset();
-
/**
* 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.
@@ -67,7 +62,7 @@
/**
- * Release the system-wide lock acquired by vm_gc_lock_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_gc_unlock_enum();
@@ -94,7 +89,8 @@
* 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)
+ *
+ * @sa gc interface functions: gc_get_next_live_object(void *iterator)
*/
VMEXPORT void vm_classloader_iterate_objects(void *iterator);
@@ -103,12 +99,20 @@
* one object. The GC aborts heap iteration if this function
* returns false.
*
- * @return true to continue heap iteration, false to abort
- * @see gc.h#gc_iterate_heap()
+ * @return TRUE to continue heap iteration, FALSE to abort
+ *
+ * @sa gc.h#gc_iterate_heap()
*/
VMEXPORT bool vm_iterate_object(Managed_Object_Handle object);
/**
+ * 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_notify_live_object_class(Class_Handle);
+
+/**
* 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.
@@ -127,29 +131,29 @@
nill = 0,
/**
- * thread is stopped for root set enumeration,
+ * Thread is stopped for root set enumeration,
* as is the whole world (all managed threads).
*/
enumerate_the_universe,
/**
- * thread is stopped for root set enumeration
+ * Thread is stopped for root set enumeration
*/
java_suspend_one_thread,
/**
- * thread is stopped by java debugger.
+ * Thread is stopped by java debugger.
*/
java_debugger
};
/**
- * @return thread safepoint state.
+ * @return Thread safepoint state.
*/
VMEXPORT enum safepoint_state get_global_safepoint_status();
/**
- * @return TRUE if no apparent trash was found in the object.
+ * @return TRUE if no apparent trash was found in the object.
*
* Used for debugging.
*/
@@ -176,16 +180,12 @@
*/
VMEXPORT void vm_finalize_object(Managed_Object_Handle p_obj);
-VMEXPORT void set_native_finalizer_thread_flag(Boolean flag);
-
/**
* 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 vm_enqueue_reference(Managed_Object_Handle p_obj);
-VMEXPORT void set_native_ref_enqueue_thread_flag(Boolean flag);
-
enum WeakReferenceType {
NOT_REFERENCE = 0,
WEAK_REFERENCE,
@@ -203,39 +203,42 @@
/*
* Returns handle of a class for a specified vtable
+ *
* @param vh - handle of vtable to retrieve class for
+ *
* @return class handle for a specified vtable
*/
VMEXPORT Class_Handle vtable_get_class(VTable_Handle vh);
/**
* Notifies VM that live object of this class was found in the heap
+ *
* @param clss - class of live object in Java heap
- **/
+ */
VMEXPORT void vm_notify_live_object_class(Class_Handle clss);
/**
* Returns the offset of the referent field
- * in the java.lang.ref.Reference object.
+ * 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,
+ * @note The returned value is most probably a constant,
* and is not dependent on the clss.
*
- * @note this interface allows only one non-strong (i.e. weak
+ * @note This interface allows only one non-strong (i.e. weak
* soft or phantom) reference per object.
* It seems to be sufficient for JVM Spec.
*/
VMEXPORT int class_get_referent_offset(Class_Handle clss);
-#define CL_PROP_ALIGNMENT_MASK 0x00FFF ///< @see class_properties
-#define CL_PROP_NON_REF_ARRAY_MASK 0x01000 ///< @see class_properties
-#define CL_PROP_ARRAY_MASK 0x02000 ///< @see class_properties
-#define CL_PROP_PINNED_MASK 0x04000 ///< @see class_properties
-#define CL_PROP_FINALIZABLE_MASK 0x08000 ///< @see class_properties
+#define CL_PROP_ALIGNMENT_MASK 0x00FFF ///< @sa class_properties
+#define CL_PROP_NON_REF_ARRAY_MASK 0x01000 ///< @sa class_properties
+#define CL_PROP_ARRAY_MASK 0x02000 ///< @sa class_properties
+#define CL_PROP_PINNED_MASK 0x04000 ///< @sa class_properties
+#define CL_PROP_FINALIZABLE_MASK 0x08000 ///< @sa class_properties
/**
Index: trunk/vm/vmcore/include/mon_enter_exit.h
===================================================================
--- trunk/vm/vmcore/include/mon_enter_exit.h (revision 487512)
+++ trunk/vm/vmcore/include/mon_enter_exit.h (working copy)
@@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- * @author Andrey Chernyshev
- * @version $Revision: 1.1.2.1.4.4 $
- */
#ifndef MON_ENTER_EXIT_HEADER
@@ -35,17 +31,23 @@
#define P_HASH_CONTENTION_BYTE(x) ( (uint8 *)(x->get_obj_info_addr()) )
#define P_HASH_CONTENTION(x) ((POINTER_SIZE_INT)P_HASH_CONTENTION_BYTE(x))
-// This is called once at startup, before any classes are loaded,
-// and after arguments are parsed. It should set function pointers
-// to the appropriate values.
-void vm_monitor_init();
+/**
+ * This is called once at startup, before any classes are loaded,
+ * and after arguments are parsed. It should set function pointers
+ * to the appropriate values.
+ */
+ void vm_monitor_init();
-// monitor exit from synchronized method
-struct StackIterator;
+/**
+ * Monitor exit from synchronized method
+ */
+ struct StackIterator;
void vm_monitor_exit_synchronized_method(StackIterator *si);
-// Does a monitorexit operation.
-extern void (*vm_monitor_exit)(ManagedObject *p_obj);
+/**
+ * Does a monitorexit operation.
+ */
+ extern void (*vm_monitor_exit)(ManagedObject *p_obj);
extern void (*vm_monitor_enter)(ManagedObject *p_obj);
extern uint32 (*vm_monitor_try_enter)(ManagedObject *p_obj);
extern uint32 (*vm_monitor_try_exit)(ManagedObject *p_obj);