harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjwashb...@apache.org
Subject svn commit: r486200 [2/2] - in /harmony/enhanced/drlvm/trunk: build/make/components/vm/ vm/gc_gen/src/common/ vm/gc_gen/src/finalizer_weakref/ vm/gc_gen/src/gen/ vm/gc_gen/src/mark_compact/ vm/gc_gen/src/mark_sweep/ vm/gc_gen/src/thread/ vm/gc_gen/src/...
Date Tue, 12 Dec 2006 15:59:18 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp Tue Dec 12 07:59:15
2006
@@ -22,6 +22,8 @@
 
 #include "../gen/gen.h"
 
+#include "../finalizer_weakref/finalizer_weakref_metadata.h"
+
 /* classloader sometimes sets the bit for finalizible objects (?) */
 inline unsigned int get_instance_data_size (unsigned int encoded_size) 
 {    return (encoded_size & NEXT_TO_HIGH_BIT_CLEAR_MASK); }
@@ -37,15 +39,19 @@
   /* FIXME:: this is outdated actually */
   size = get_instance_data_size(size);
   
-  Allocator* allocator = (Allocator*)gc_get_tls();
+  Mutator* mutator = (Mutator*)gc_get_tls();
   
   if ( size > GC_OBJ_SIZE_THRESHOLD )
-    p_obj = (Managed_Object_Handle)los_alloc(size, allocator);
+    p_obj = (Managed_Object_Handle)los_alloc(size, (Allocator*)mutator);
   else
-    p_obj = (Managed_Object_Handle)nos_alloc(size, allocator);
+    p_obj = (Managed_Object_Handle)nos_alloc(size, (Allocator*)mutator);
   
-  assert(p_obj);
+  if( p_obj == NULL ) return NULL;
+    
   obj_set_vt((Partial_Reveal_Object*)p_obj, ah);
+  
+  if(type_has_finalizer((Partial_Reveal_VTable *)ah))
+    mutator_finalizer_add_entry(mutator, (Partial_Reveal_Object*)p_obj);
     
   return (Managed_Object_Handle)p_obj;
 }
@@ -56,6 +62,9 @@
   /* All requests for space should be multiples of 4 (IA32) or 8(IPF) */
   assert((size % GC_OBJECT_ALIGNMENT) == 0);
   assert(ah);
+  
+  if(type_has_finalizer((Partial_Reveal_VTable *)ah))
+    return NULL;
   
   /* object shoud be handled specially */
   if ( size > GC_OBJ_SIZE_THRESHOLD ) return NULL;

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_copy.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_copy.cpp?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_copy.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_copy.cpp Tue Dec
12 07:59:15 2006
@@ -22,6 +22,7 @@
 #include "../mark_compact/mspace.h"
 #include "../mark_sweep/lspace.h"
 #include "../thread/collector.h"
+#include "../finalizer_weakref/finalizer_weakref.h"
 
 static volatile Block_Header* current_copy_block;
 static volatile Block_Header* current_target_block;
@@ -179,6 +180,9 @@
     /* world for single thread, e.g., verification of last phase, and preparation of next
phase */
     current_copy_block = fspace_get_first_copy_block(fspace);
     current_target_block = mspace_get_first_target_block_for_nos(mspace);    
+    
+    collector_process_finalizer_weakref(collector);
+    
     /* let other collectors go */
     num_marking_collectors++; 
   }
@@ -203,6 +207,8 @@
   if( collector->thread_handle != 0 ) return;
   
   gc_update_repointed_refs(collector);
+  
+  gc_post_process_finalizer_weakref(gc);
 
   /* FIXME:: Pass 2 and 3 can be merged into one pass */
   /* Pass 3: copy live fspace object to new location */

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_forward.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_forward.cpp?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_forward.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_collect_forward.cpp Tue
Dec 12 07:59:15 2006
@@ -22,6 +22,7 @@
 #include "fspace.h"
 #include "../thread/collector.h"
 #include "../common/gc_metadata.h"
+#include "../finalizer_weakref/finalizer_weakref.h"
 
 static Boolean fspace_object_to_be_forwarded(Partial_Reveal_Object *p_obj, Fspace *fspace)
 {
@@ -71,6 +72,8 @@
     offset_scanner = offset_next_ref(offset_scanner);
   }
 
+  scan_weak_reference(collector, p_obj, scan_slot);
+  
   return;
 }
 
@@ -95,7 +98,7 @@
 
   /* Fastpath: object has already been forwarded, update the ref slot */
   if(obj_is_forwarded_in_vt(p_obj)) {
-    *p_ref = obj_get_forwarding_pointer_in_vt(p_obj);    
+    *p_ref = obj_get_forwarding_pointer_in_vt(p_obj);
     return;
   }
 
@@ -122,15 +125,11 @@
       is set in the atomic instruction, which requires to roll back the mos_alloced
       space. That is easy for thread local block allocation cancellation. */
   if( p_target_obj == NULL ){
-    Partial_Reveal_Object *forward_ptr = obj_get_forwarding_pointer_in_vt(p_obj);
-    while(forward_ptr == NULL) 
-      forward_ptr = obj_get_forwarding_pointer_in_vt(p_obj);  
-      
-    *p_ref = forward_ptr;
-     return;
+    *p_ref = obj_get_forwarding_pointer_in_vt(p_obj);
+    return;
   }  
   /* otherwise, we successfully forwarded */
-  *p_ref = p_target_obj;  
+  *p_ref = p_target_obj;
 
   /* we forwarded it, we need remember it for verification. */
   if(verify_live_heap) {
@@ -244,9 +243,60 @@
   /* the rest work is not enough for parallelization, so let only one thread go */
   if( collector->thread_handle != 0 ) return;
 
+  collector_process_finalizer_weakref(collector);
+  
   gc_update_repointed_refs(collector);
+  
+  gc_post_process_finalizer_weakref(gc);
+  
   reset_fspace_for_allocation(space);  
 
   return;
   
+}
+
+Boolean obj_is_dead_in_minor_forward_collection(Collector *collector, Partial_Reveal_Object
*p_obj)
+{
+  Space *space = collector->collect_space;
+  Boolean belong_to_nos = obj_belongs_to_space(p_obj, space);
+  
+  if(!belong_to_nos)
+    return FALSE;
+  
+  Boolean space_to_be_forwarded = fspace_object_to_be_forwarded(p_obj, (Fspace*)space);
+  Boolean forwarded = obj_is_forwarded_in_vt(p_obj);
+  Boolean marked = obj_is_marked_in_vt(p_obj);
+  
+  return (space_to_be_forwarded && !forwarded) || (!space_to_be_forwarded &&
!marked);
+}
+
+void resurrect_obj_tree_after_trace(Collector *collector, Partial_Reveal_Object **p_ref)
+{
+  GC *gc = collector->gc;
+  GC_Metadata* metadata = gc->metadata;
+  
+  collector->trace_stack = pool_get_entry(metadata->free_task_pool);
+  collector_tracestack_push(collector, p_ref);
+  pool_put_entry(metadata->mark_task_pool, collector->trace_stack);
+  
+//collector->rep_set = pool_get_entry(metadata->free_set_pool); /* has got collector->rep_set
in caller */
+  collector->trace_stack = pool_get_entry(metadata->free_task_pool);
+  Vector_Block* trace_task = pool_get_entry(metadata->mark_task_pool);
+  while(trace_task){    
+    unsigned int* iter = vector_block_iterator_init(trace_task);
+    while(!vector_block_iterator_end(trace_task,iter)){
+      Partial_Reveal_Object** p_ref = (Partial_Reveal_Object** )*iter;
+      iter = vector_block_iterator_advance(trace_task,iter);
+      assert(*p_ref);
+      trace_object(collector, p_ref);
+    }
+    vector_stack_clear(trace_task);
+    pool_put_entry(metadata->free_task_pool, trace_task);
+    trace_task = pool_get_entry(metadata->mark_task_pool);
+  }
+  
+  trace_task = (Vector_Block*)collector->trace_stack;
+  vector_stack_clear(trace_task);
+  pool_put_entry(metadata->free_task_pool, trace_task);   
+  collector->trace_stack = NULL;
 }

Added: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bidir_list.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bidir_list.h?view=auto&rev=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bidir_list.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bidir_list.h Tue Dec 12 07:59:15 2006
@@ -0,0 +1,46 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Ji Qi, 2006/10/05
+ */
+
+#ifndef _BIDIR_LIST_H_
+#define _BIDIR_LIST_H_
+
+typedef struct Bidir_List{
+  Bidir_List* next;
+  Bidir_List* prev;
+}Bidir_List;
+
+inline Bidir_List* bidir_list_add_item(Bidir_List* head, Bidir_List* item)
+{
+  item->next = head;
+  item->prev = head->prev;
+  head->prev->next = item;
+  head->prev = item;
+  return head;
+}
+
+inline Bidir_List* bidir_list_remove_item(Bidir_List* item)
+{
+  item->prev->next = item->next;
+  item->next->prev = item->prev;
+  item->next = item->prev = item;
+  return item;
+}
+
+#endif /* _BIDIR_LIST_H_ */

Added: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h?view=auto&rev=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h Tue Dec 12 07:59:15 2006
@@ -0,0 +1,117 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Ji, Qi, 2006/10/25
+ */
+ 
+#ifndef _BIT_OPS_H_
+#define _BIT_OPS_H_
+
+#include "../common/gc_common.h"
+
+inline unsigned int word_get_first_set_lsb(unsigned int target_word)
+{
+  assert(target_word != 0);
+  unsigned int bit_offset;
+
+#ifdef _EM64T_
+
+#else /* ifdef _EM64T_*/
+#ifdef PLATFORM_POSIX  /* POSIX Platform*/
+  __asm__ __volatile__(
+    "bsf %1,%0\n"
+    :"=r"(bit_offset)
+    :"m"(target_word)
+  );
+#else /*WIN32 Platform*/
+  __asm{
+    bsf eax, target_word
+    mov bit_offset, eax
+  }
+#endif /* ifdef PLATFORM_POSIX else*/
+#endif /* ifdef _EM64T_ else */
+  return bit_offset;
+
+}
+
+inline unsigned int words_get_next_set_lsb(unsigned int* words, unsigned int count, unsigned
int start_idx)
+{
+  unsigned int bit_offset;
+  
+  assert((start_idx >= 0) && (start_idx < 128));
+  
+  unsigned int start_word_index = start_idx >> BIT_SHIFT_TO_BITS_PER_WORD;
+  unsigned int start_bit_offset = start_idx & BIT_MASK_TO_BITS_PER_WORD;
+  
+  bit_offset = start_idx - start_bit_offset;
+  for(unsigned int i = start_word_index; i < count; i ++ ){
+    unsigned int cur_word = *(words + i);
+    
+    if(start_word_index == i){
+      unsigned int mask = ~((1 << start_bit_offset) - 1);
+      cur_word = cur_word & mask;
+    }
+  
+     if(cur_word != 0){
+       bit_offset += word_get_first_set_lsb(cur_word);
+       return bit_offset;
+     }
+     
+     bit_offset += 32;
+   }
+  
+  return bit_offset;
+}
+
+inline void words_set_bit(unsigned int* words, unsigned int count, unsigned int start_idx)
+{
+  assert((start_idx >= 0) && (start_idx < 128));
+  
+  unsigned int word_index = start_idx >> BIT_SHIFT_TO_BITS_PER_WORD;	
+  unsigned int bit_offset = start_idx & BIT_MASK_TO_BITS_PER_WORD;
+  
+  if(word_index >= count) return;
+  
+  unsigned int* p_word = words + word_index;
+  unsigned int old_value = *p_word;
+  unsigned int mask = 1 << bit_offset;
+  unsigned int new_value = old_value|mask;
+  
+  *p_word = new_value;
+  
+  return;
+}
+
+inline void words_clear_bit(unsigned int* words, unsigned int count, unsigned int start_idx)
+{
+  assert((start_idx >= 0) && (start_idx < 128));
+  
+  unsigned int word_index = start_idx >> BIT_SHIFT_TO_BITS_PER_WORD;
+  unsigned int bit_offset = start_idx & BIT_MASK_TO_BITS_PER_WORD;
+  
+  if(word_index >= count) return;
+  
+  unsigned int* p_word = words + word_index;
+  unsigned int old_value = *p_word;
+  unsigned int mask = ~(1 << bit_offset);
+  unsigned int new_value = old_value & mask;
+  
+  *p_word = new_value;
+  
+  return;
+}
+#endif

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm_gc.h Tue Dec 12 07:59:15 2006
@@ -176,11 +176,15 @@
  */
 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,

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h Tue Dec 12 07:59:15 2006
@@ -50,5 +50,8 @@
 
 
 void vm_enqueue_references();
+void vm_ref_enqueue_func(void);   // added for NATIVE REFERENCE ENQUEUE THREAD
+
+Boolean get_native_finalizer_thread_flag(); // added for NATIVE FINALIZER THREAD
 
 #endif

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalizer_thread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalizer_thread.h?view=auto&rev=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalizer_thread.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalizer_thread.h Tue Dec 12 07:59:15
2006
@@ -0,0 +1,88 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Li-Gang Wang, 2006/11/15
+ */
+
+#ifndef _FINALIZER_THREAD_H_
+#define _FINALIZER_THREAD_H_
+
+#include "jni_types.h"
+#include "open/hythread_ext.h"
+#include <assert.h>
+#include "open/types.h"
+#include <apr_atomic.h>
+
+#ifndef _FINALIZER_WEAKREF_PLATFORM_
+#define _FINALIZER_WEAKREF_PLATFORM_
+
+#define VmEventHandle   hysem_t
+
+inline int vm_wait_event(VmEventHandle event)
+{
+    IDATA stat = hysem_wait(event);
+    assert(stat == TM_ERROR_NONE); return stat;
+}
+inline int vm_set_event(VmEventHandle event, IDATA count)
+{
+    IDATA stat = hysem_set(event, count);
+    assert(stat == TM_ERROR_NONE); return stat;
+}
+inline int vm_post_event(VmEventHandle event)
+{
+    IDATA stat = hysem_set(event, 1);
+    assert(stat == TM_ERROR_NONE); return stat;
+}
+inline int vm_create_event(VmEventHandle* event, unsigned int initial_count, unsigned int
max_count)
+{
+    return hysem_create(event, initial_count, max_count);
+}
+
+
+typedef volatile unsigned int SpinLock;
+enum Lock_State{
+  FREE_LOCK,
+  LOCKED
+};
+
+#define gc_try_lock(x) (!apr_atomic_cas32(&(x), LOCKED, FREE_LOCK))
+#define gc_lock(x) while( !gc_try_lock(x)){ while( x==LOCKED );}
+#define gc_unlock(x) do{ x = FREE_LOCK;}while(0)
+
+#endif
+
+#define FINALIZER_THREAD_PRIORITY (HYTHREAD_PRIORITY_USER_MAX - 3)
+
+struct finalizer_thread_info {
+    SpinLock lock;
+    int thread_num;
+    int working_thread_num;
+    Boolean shutdown;
+    Boolean on_exit;
+    VmEventHandle finalizer_pending_event;
+    VmEventHandle finalization_end_event;
+};
+
+
+extern Boolean get_finalizer_shutdown_flag();
+extern Boolean get_finalizer_on_exit_flag();
+extern void finalizer_threads_init(JavaVM *java_vm, JNIEnv *jni_env);
+extern void finalizer_shutdown(Boolean start_finalization_on_exit);
+extern void activate_finalizer_threads(Boolean wait);
+extern void vmmemory_manager_runfinalization(void);
+
+#endif // _FINALIZER_THREAD_H_

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/include/ref_enqueue_thread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/ref_enqueue_thread.h?view=auto&rev=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/ref_enqueue_thread.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/ref_enqueue_thread.h Tue Dec 12 07:59:15
2006
@@ -0,0 +1,81 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Li-Gang Wang, 2006/11/15
+ */
+
+#ifndef _REF_ENQUEUE_THREAD_H_
+#define _REF_ENQUEUE_THREAD_H_
+
+#include "jni_types.h"
+#include "open/hythread_ext.h"
+#include <assert.h>
+#include "open/types.h"
+#include <apr_atomic.h>
+
+#ifndef _FINALIZER_WEAKREF_PLATFORM_
+#define _FINALIZER_WEAKREF_PLATFORM_
+
+#define VmEventHandle   hysem_t
+
+inline int vm_wait_event(VmEventHandle event)
+{
+    IDATA stat = hysem_wait(event);
+    assert(stat == TM_ERROR_NONE); return stat;
+}
+inline int vm_set_event(VmEventHandle event, IDATA count)
+{
+    IDATA stat = hysem_set(event, count);
+    assert(stat == TM_ERROR_NONE); return stat;
+}
+inline int vm_post_event(VmEventHandle event)
+{
+    IDATA stat = hysem_set(event, 1);
+    assert(stat == TM_ERROR_NONE); return stat;
+}
+inline int vm_create_event(VmEventHandle* event, unsigned int initial_count, unsigned int
max_count)
+{
+    return hysem_create(event, initial_count, max_count);
+}
+
+
+typedef volatile unsigned int SpinLock;
+enum Lock_State{
+  FREE_LOCK,
+  LOCKED
+};
+
+#define gc_try_lock(x) (!apr_atomic_cas32(&(x), LOCKED, FREE_LOCK))
+#define gc_lock(x) while( !gc_try_lock(x)){ while( x==LOCKED );}
+#define gc_unlock(x) do{ x = FREE_LOCK;}while(0)
+
+#endif
+
+#define REF_ENQUEUE_THREAD_PRIORITY (HYTHREAD_PRIORITY_USER_MAX - 1)
+
+struct ref_enqueue_thread_info {
+    SpinLock lock;
+    VmEventHandle reference_pending_event;
+    Boolean shutdown;
+};
+
+extern Boolean get_native_ref_enqueue_thread_flag();
+extern void ref_enqueue_thread_init(JavaVM *java_vm, JNIEnv *jni_env);
+extern void ref_enqueue_shutdown(void);
+extern void activate_ref_enqueue_thread(void);
+
+#endif // _REF_ENQUEUE_THREAD_H_

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp Tue Dec 12 07:59:15 2006
@@ -37,6 +37,9 @@
 #include "jit_runtime_support.h"
 #include "finalize.h"
 
+#include "finalizer_thread.h"     /* added for NATIVE FINALIZER THREAD */
+#include "ref_enqueue_thread.h"   /* added for NATIVE REFERENCE ENQUEUE THREAD */
+
 
 #define LOG_DOMAIN "vm.object_queue"
 #include "classloader.h"
@@ -343,8 +346,14 @@
 } //Objects_To_Finalize::run_finalizers
 
 int Objects_To_Finalize::do_finalization(int quantity) {
+    /* BEGIN: added for NATIVE FINALIZER THREAD */
+    Boolean native_finalizer_thread_flag = get_native_finalizer_thread_flag();
+    Boolean native_finalizer_shutdown, native_finalizer_on_exit;
+    /* END: added for NATIVE FINALIZER THREAD */
+    
     //SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_HIGHEST);
-    p_TLS_vmthread->finalize_thread_flags = FINALIZER_THREAD;
+    if(!native_finalizer_thread_flag)    // added for NATIVE FINALIZER THREAD
+        p_TLS_vmthread->finalize_thread_flags = FINALIZER_THREAD;
 
     int i;
     tmn_suspend_disable();
@@ -353,18 +362,28 @@
     jvalue args[1];
     args[0].l = (jobject) handle;
 
-    assert(VM_Global_State::loader_env->finalizer_thread);
-    jboolean* finalizer_shutdown = VM_Global_State::loader_env->finalizer_shutdown;
-    assert(finalizer_shutdown);
-    jboolean* finalizer_on_exit = VM_Global_State::loader_env->finalizer_on_exit;
-    assert(finalizer_on_exit);
+    /* BEGIN: modified for NATIVE FINALIZER THREAD */
+    jboolean *finalizer_shutdown, *finalizer_on_exit;
+    if(!native_finalizer_thread_flag){
+        assert(VM_Global_State::loader_env->finalizer_thread);
+        finalizer_shutdown = VM_Global_State::loader_env->finalizer_shutdown;
+        assert(finalizer_shutdown);
+        finalizer_on_exit = VM_Global_State::loader_env->finalizer_on_exit;
+        assert(finalizer_on_exit);
+        native_finalizer_shutdown = (Boolean)*finalizer_shutdown;
+        native_finalizer_on_exit = (Boolean)*finalizer_on_exit;
+    }
+    /* END: modified for NATIVE FINALIZER THREAD */
 
     for (i=0; ((i<quantity)||(0==quantity)); i++) {
     
         // shutdown flag in FinalizerThread set after finalization on exit is completed
-        if (*finalizer_shutdown) {
+        /* BEGIN: modified for NATIVE FINALIZER THREAD */
+        if(native_finalizer_thread_flag)
+            native_finalizer_shutdown = get_finalizer_shutdown_flag();
+        if(native_finalizer_shutdown)
             return i;
-        }
+        /* END: modified for NATIVE FINALIZER THREAD */
 
         tmn_suspend_disable();
         ManagedObject* object = remove_object();
@@ -380,10 +399,14 @@
         Class *clss = handle->object->vt()->clss;
         assert(clss);
         
-        if ((*finalizer_on_exit)  && is_class_ignored(clss)) {
+        /* BEGIN: modified for NATIVE FINALIZER THREAD */
+        if(native_finalizer_thread_flag)
+            native_finalizer_on_exit = get_finalizer_on_exit_flag();
+        if (native_finalizer_on_exit  && is_class_ignored(clss)) {
             tmn_suspend_enable();
             continue;
         }
+        /* END: modified for NATIVE FINALIZER THREAD */
         
         Method *finalize = class_lookup_method_recursive(clss,
             VM_Global_State::loader_env->FinalizeName_String,
@@ -467,7 +490,12 @@
 {
     NativeObjectHandles nhs;
     assert(hythread_is_suspend_enabled());
-    objects_to_finalize.run_finalizers();
+    /* BEGIN: modified for NATIVE FINALIZER THREAD */
+    if(get_native_finalizer_thread_flag())
+        activate_finalizer_threads(FALSE);
+    else
+        objects_to_finalize.run_finalizers();
+    /* END: modified for NATIVE FINALIZER THREAD */
 } //vm_run_pending_finalizers
 
 int vm_do_finalization(int quantity)
@@ -510,5 +538,16 @@
 
 void vm_enqueue_references()
 { 
-    references_to_enqueue.enqueue_references();
+    /* BEGIN: modified for NATIVE REFERENCE ENQUEUE THREAD */
+    if(get_native_ref_enqueue_thread_flag())
+        activate_ref_enqueue_thread();
+    else
+        references_to_enqueue.enqueue_references();
+    /* END: modified for NATIVE REFERENCE ENQUEUE THREAD */
 } //vm_enqueue_references
+
+/* added for NATIVE REFERENCE ENQUEUE THREAD */
+void vm_ref_enqueue_func(void)
+{
+    references_to_enqueue.enqueue_references();
+}

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalizer_thread.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalizer_thread.cpp?view=auto&rev=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalizer_thread.cpp (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalizer_thread.cpp Tue Dec 12 07:59:15
2006
@@ -0,0 +1,180 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Li-Gang Wang, 2006/11/15
+ */
+
+#include "finalizer_thread.h"
+#include "ref_enqueue_thread.h"
+#include "open/gc.h"
+#include "port_sysinfo.h"
+#include "finalize.h"
+#include "vm_threads.h"
+#include "../../../thread/src/thread_private.h"
+
+static Boolean native_finalizer_thread_flag = FALSE;
+static struct finalizer_thread_info *finalizer_thread_info = NULL;
+
+
+Boolean get_native_finalizer_thread_flag()
+{
+  return native_finalizer_thread_flag;
+}
+
+void set_native_finalizer_thread_flag(Boolean flag)
+{
+  native_finalizer_thread_flag = flag;
+}
+
+Boolean get_finalizer_shutdown_flag()
+{
+  return finalizer_thread_info->shutdown;
+}
+
+Boolean get_finalizer_on_exit_flag()
+{
+  return finalizer_thread_info->on_exit;
+}
+
+static int finalizer_thread_func(void **args);
+
+void finalizer_threads_init(JavaVM *java_vm, JNIEnv *jni_env)
+{
+    if(!native_finalizer_thread_flag)
+        return;
+    
+    finalizer_thread_info = (struct finalizer_thread_info *)STD_MALLOC(sizeof(struct finalizer_thread_info));
+    finalizer_thread_info->lock = FREE_LOCK;
+    finalizer_thread_info->thread_num = port_CPUs_number();
+    finalizer_thread_info->working_thread_num = 0;
+    finalizer_thread_info->shutdown = FALSE;
+    finalizer_thread_info->on_exit = FALSE;
+    
+    int status = vm_create_event(&finalizer_thread_info->finalizer_pending_event,
0, finalizer_thread_info->thread_num);
+    assert(status == TM_ERROR_NONE);
+    status = vm_create_event(&finalizer_thread_info->finalization_end_event, 0, 1);
+    assert(status == TM_ERROR_NONE);
+    
+    void **args = (void **)STD_MALLOC(sizeof(void *)*2);
+    args[0] = (void *)java_vm;
+    args[1] = (void *)jni_env;
+    for(int i = 0; i < finalizer_thread_info->thread_num; i++){
+        status = (unsigned int)hythread_create(NULL, 0, 0, 0, (hythread_entrypoint_t)finalizer_thread_func,
args);
+        assert(status == TM_ERROR_NONE);
+    }
+}
+
+void finalizer_shutdown(Boolean start_finalization_on_exit)
+{
+    if(start_finalization_on_exit){
+        tmn_suspend_disable();
+        gc_force_gc();      
+        tmn_suspend_enable();
+        activate_finalizer_threads(TRUE);
+        tmn_suspend_disable();
+        gc_finalize_on_exit();
+        tmn_suspend_enable();
+        gc_lock(finalizer_thread_info->lock);
+        finalizer_thread_info->on_exit = TRUE;
+        gc_unlock(finalizer_thread_info->lock);
+        activate_finalizer_threads(TRUE);
+    }
+    gc_lock(finalizer_thread_info->lock);
+    finalizer_thread_info->shutdown = TRUE;
+    gc_unlock(finalizer_thread_info->lock);
+    ref_enqueue_shutdown();
+    activate_finalizer_threads(FALSE);
+}
+
+static void wait_finalization_end(void)
+{
+    vm_wait_event(finalizer_thread_info->finalization_end_event);
+}
+
+void activate_finalizer_threads(Boolean wait)
+{
+    gc_lock(finalizer_thread_info->lock);
+    vm_set_event(finalizer_thread_info->finalizer_pending_event,
+                    finalizer_thread_info->thread_num - finalizer_thread_info->working_thread_num);
+    gc_unlock(finalizer_thread_info->lock);
+    
+    if(wait)
+        wait_finalization_end();
+}
+
+void vmmemory_manager_runfinalization(void)
+{
+    activate_finalizer_threads(TRUE);
+}
+
+
+static int do_finalization_func(void)
+{
+    return vm_do_finalization(0);
+}
+
+static void wait_pending_finalizer(void)
+{
+    vm_wait_event(finalizer_thread_info->finalizer_pending_event);
+}
+
+static void notify_finalization_end(void)
+{
+    vm_post_event(finalizer_thread_info->finalization_end_event);
+}
+
+static void finalizer_notify_work_done(void)
+{
+    gc_lock(finalizer_thread_info->lock);
+    --finalizer_thread_info->working_thread_num;
+    if(finalizer_thread_info->working_thread_num == 0)
+        notify_finalization_end();
+    gc_unlock(finalizer_thread_info->lock);
+}
+
+static int finalizer_thread_func(void **args)
+{
+    JavaVM *java_vm = (JavaVM *)args[0];
+    JNIEnv *jni_env = (JNIEnv *)args[1];
+    
+    IDATA status = vm_attach(java_vm, &jni_env);
+    if(status != TM_ERROR_NONE)
+        return status;
+    
+    while(true){
+        /* Waiting for pending finalizers */
+        wait_pending_finalizer();
+        
+        gc_lock(finalizer_thread_info->lock);
+        ++finalizer_thread_info->working_thread_num;
+        gc_unlock(finalizer_thread_info->lock);
+        
+        /* do the real finalization work */
+        do_finalization_func();
+        
+        finalizer_notify_work_done();
+        
+        gc_lock(finalizer_thread_info->lock);
+        if(finalizer_thread_info->shutdown){
+            gc_unlock(finalizer_thread_info->lock);
+            break;
+        }
+        gc_unlock(finalizer_thread_info->lock);
+    }
+
+    return TM_ERROR_NONE;
+}

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/ref_enqueue_thread.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/ref_enqueue_thread.cpp?view=auto&rev=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/ref_enqueue_thread.cpp (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/ref_enqueue_thread.cpp Tue Dec 12 07:59:15
2006
@@ -0,0 +1,112 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Li-Gang Wang, 2006/11/15
+ */
+
+#include "ref_enqueue_thread.h"
+#include "finalize.h"
+#include "vm_threads.h"
+#include "../../../thread/src/thread_private.h"
+
+static Boolean native_ref_enqueue_thread_flag = FALSE;
+static struct ref_enqueue_thread_info *ref_enqueue_thread_info = NULL;
+
+
+Boolean get_native_ref_enqueue_thread_flag()
+{
+  return native_ref_enqueue_thread_flag;
+}
+
+void set_native_ref_enqueue_thread_flag(Boolean flag)
+{
+  native_ref_enqueue_thread_flag = flag;
+}
+
+static int ref_enqueue_thread_func(void **args);
+
+void ref_enqueue_thread_init(JavaVM *java_vm, JNIEnv *jni_env)
+{
+    if(!get_native_ref_enqueue_thread_flag())
+        return;
+    
+    ref_enqueue_thread_info = (struct ref_enqueue_thread_info *)STD_MALLOC(sizeof(struct
ref_enqueue_thread_info));
+    ref_enqueue_thread_info->lock = FREE_LOCK;
+    ref_enqueue_thread_info->shutdown = FALSE;
+    
+    int status = vm_create_event(&ref_enqueue_thread_info->reference_pending_event,
0, 1);
+    assert(status == TM_ERROR_NONE);
+    
+    void **args = (void **)STD_MALLOC(sizeof(void *)*2);
+    args[0] = (void *)java_vm;
+    args[1] = (void *)jni_env;
+    status = (unsigned int)hythread_create(NULL, 0, REF_ENQUEUE_THREAD_PRIORITY, 0, (hythread_entrypoint_t)ref_enqueue_thread_func,
args);
+    assert(status == TM_ERROR_NONE);
+}
+
+void ref_enqueue_shutdown(void)
+{
+    gc_lock(ref_enqueue_thread_info->lock);
+    ref_enqueue_thread_info->shutdown = TRUE;
+    gc_unlock(ref_enqueue_thread_info->lock);
+    activate_ref_enqueue_thread();
+}
+
+void activate_ref_enqueue_thread(void)
+{
+    vm_post_event(ref_enqueue_thread_info->reference_pending_event);
+}
+
+
+static int ref_enqueue_func(void)
+{
+    vm_ref_enqueue_func();
+    return 0;
+}
+
+static void wait_pending_reference(void)
+{
+    vm_wait_event(ref_enqueue_thread_info->reference_pending_event);
+}
+
+
+static int ref_enqueue_thread_func(void **args)
+{
+    JavaVM *java_vm = (JavaVM *)args[0];
+    JNIEnv *jni_env = (JNIEnv *)args[1];
+    
+    IDATA status = vm_attach(java_vm, &jni_env);
+    if(status != TM_ERROR_NONE)
+        return status;
+    
+    while(true){
+        /* Waiting for pending weak references */
+        wait_pending_reference();
+        
+        /* do the real reference enqueue work */
+        ref_enqueue_func();
+                
+        gc_lock(ref_enqueue_thread_info->lock);
+        if(ref_enqueue_thread_info->shutdown){
+            gc_unlock(ref_enqueue_thread_info->lock);
+            break;
+        }
+        gc_unlock(ref_enqueue_thread_info->lock);
+    }
+
+    return TM_ERROR_NONE;
+}

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp Tue Dec 12 07:59:15 2006
@@ -46,6 +46,8 @@
 #include "vm_strings.h"
 #include "slot.h"
 #include "classpath_const.h"
+#include "finalizer_thread.h"   /* added for NATIVE FINALIZER THREAD */
+#include "ref_enqueue_thread.h" /* added for NATIVE REFERENCE ENQUEUE THREAD */
 
 #ifdef PLATFORM_NT
 // 20040427 Used to turn on heap checking on every allocation
@@ -675,6 +677,9 @@
 
     status = vm_attach(java_vm, &jni_env);
     if (status != JNI_OK) return status;
+    
+    finalizer_threads_init(java_vm, jni_env);   /* added for NATIVE FINALIZER THREAD */
+    ref_enqueue_thread_init(java_vm, jni_env);  /* added for NATIVE REFERENCE ENQUEUE THREAD
*/
     
     // "Tool Interface" initialization
     status = vm_env->TI->Init(java_vm);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/FinalizerThread.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/FinalizerThread.java?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/FinalizerThread.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/FinalizerThread.java
Tue Dec 12 07:59:15 2006
@@ -51,7 +51,12 @@
      * VM calls this thread from Runtime.runFinalization().
      */
     public static void runFinalization() {
-        startFinalization(true);
+        /* BEGIN: added for NATIVE FINALIZER THREAD */
+        if(NATIVE_FINALIZER_THREAD)
+            runFinalizationInNativeFinalizerThreads();
+        else
+        /* END: added for NATIVE FINALIZER THREAD */
+            startFinalization(true);
     }
 
     /*
@@ -62,6 +67,11 @@
      * Initializes finalization system. Starts permanent thread.
      */
     static void initialize() {
+        /* BEGIN: added for NATIVE FINALIZER THREAD */
+        if (NATIVE_FINALIZER_THREAD)
+            return;
+        /* END: added for NATIVE FINALIZER THREAD */
+        
         if (TRACE) {
             trace("FinalizerThread: static initialization started");
         }
@@ -87,6 +97,12 @@
      * VM calls this method to request finalizer thread shutdown.
      */
     static void shutdown(boolean startFinalizationOnExit) {
+        /* BEGIN: added for NATIVE FINALIZER THREAD */
+        if(NATIVE_FINALIZER_THREAD) {
+            finalizerShutDown(startFinalizationOnExit);
+            return;
+        }
+        /* END: added for NATIVE FINALIZER THREAD */
         if (TRACE) {
             trace("shutting down finalizer thread");
         }
@@ -101,6 +117,29 @@
         }
     }
 
+    /* added for NATIVE FINALIZER THREAD
+     * A flag to indicate whether the finalizer threads are native threads or Java threads.
+     */
+    private static final boolean NATIVE_FINALIZER_THREAD = getNativeFinalizerThreadFlagFromVM();
+
+    /* BEGIN: These three methods are added for NATIVE FINALIZER THREAD */
+    /**
+     * This method gets the flag that indicates
+     * whether VM uses native finalizer threads or Java finalizer threads.
+     */
+    private static native boolean getNativeFinalizerThreadFlagFromVM();
+    
+    /**
+     * This method implements runFinalization() method in native finalizer threads.
+     */
+    private static native void runFinalizationInNativeFinalizerThreads();
+    
+    /**
+     * This method does finalization work related to VM shutdown in native finalizer threads.
+     */
+    private static native void finalizerShutDown(boolean finalizeOnExit);
+    /* END: These three methods are added for NATIVE FINALIZER THREAD */
+    
     /*
      * Staic private part
      */

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.cpp?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.cpp
Tue Dec 12 07:59:15 2006
@@ -34,6 +34,9 @@
 #include "port_sysinfo.h"
 #include "vm_threads.h"
 
+/* added for NATIVE FINALIZER THREAD */
+#include "finalizer_thread.h"
+
 /**
  * Implements getObject(..) method.
  * For details see kernel classes component documentation.
@@ -90,3 +93,41 @@
     gc_finalize_on_exit();
     tmn_suspend_enable();
 }
+
+/* BEGIN: These three methods are added for NATIVE FINALIZER THREAD */
+/*
+ * Class:     java_lang_FinalizerThread
+ * Method:    getNativeFinalizerThreadFlagFromVM
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_java_lang_FinalizerThread_getNativeFinalizerThreadFlagFromVM
+  (JNIEnv *, jclass)
+{
+    return (jboolean)get_native_finalizer_thread_flag();
+}
+
+/*
+ * Class:     java_lang_FinalizerThread
+ * Method:    runFinalizationInNativeFinalizerThreads
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_lang_FinalizerThread_runFinalizationInNativeFinalizerThreads
+  (JNIEnv *, jclass)
+{
+    vm_enqueue_references();
+    
+    // Do finalization in dedicated native finalizer threads.
+    vmmemory_manager_runfinalization();
+}
+
+/*
+ * Class:     java_lang_FinalizerThread
+ * Method:    finalizerShutDown
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_lang_FinalizerThread_finalizerShutDown
+  (JNIEnv *, jclass, jboolean value)
+{
+    finalizer_shutdown(value);
+}
+/* END: These three methods are added for NATIVE FINALIZER THREAD */

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.h?view=diff&rev=486200&r1=486199&r2=486200
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.h
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.h
Tue Dec 12 07:59:15 2006
@@ -81,6 +81,26 @@
 JNIEXPORT void JNICALL
 Java_java_lang_FinalizerThread_fillFinalizationQueueOnExit(JNIEnv *, jclass);
 
+/* BEGIN: These three methods are added for NATIVE FINALIZER THREAD */
+/*
+ * Method: java.lang.FinalizerThread.getNativeFinalizerThreadFlagFromVM()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_lang_FinalizerThread_getNativeFinalizerThreadFlagFromVM(JNIEnv *, jclass);
+
+/*
+ * Method: java_lang_FinalizerThread.runFinalizationInNativeFinalizerThreads()V
+ */
+JNIEXPORT void JNICALL
+Java_java_lang_FinalizerThread_runFinalizationInNativeFinalizerThreads(JNIEnv *, jclass);
+
+/*
+ * Method: java_lang_FinalizerThread.finalizerShutDown()V
+ */
+JNIEXPORT void JNICALL
+Java_java_lang_FinalizerThread_finalizerShutDown(JNIEnv *, jclass, jboolean);
+/* END: These three methods are added for NATIVE FINALIZER THREAD */
+
 
 #ifdef __cplusplus
 }



Mime
View raw message