harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r495813 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/ src/init/ src/kernel_classes/javasrc/java/lang/ src/kernel_classes/native/
Date Sat, 13 Jan 2007 01:27:32 GMT
Author: gshimansky
Date: Fri Jan 12 17:27:31 2007
New Revision: 495813

URL: http://svn.apache.org/viewvc?view=rev&rev=495813
Log:
Applied HARMONY-2988 [DRLVM] Finalization native turn off flag support.

build tests passed on Ubuntu6 x86, Windows XP x86 and SuSE9 x86_x64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/FinalizerThread.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_FinalizerThread.h

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=495813&r1=495812&r2=495813
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalize.h Fri Jan 12 17:27:31 2007
@@ -41,6 +41,7 @@
 void vm_run_pending_finalizers();
 int vm_do_finalization(int quantity);
 int vm_get_finalizable_objects_quantity();
+bool vm_finalization_is_enabled();
 
 #ifndef USE_GC_STATIC
 VMEXPORT

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=495813&r1=495812&r2=495813
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp Fri Jan 12 17:27:31 2007
@@ -526,7 +526,12 @@
 {
     return objects_to_finalize.getLength();
 }
-// -- Code to deal with Reference Queues that need to be notified.
+
+/* returns true if finalization system is turned on, and false otherwise */
+bool vm_finalization_is_enabled()
+{
+    return VM_Global_State::loader_env->finalizer_thread != NULL;
+}// -- Code to deal with Reference Queues that need to be notified.
 
 static References_To_Enqueue references_to_enqueue;
 

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=495813&r1=495812&r2=495813
==============================================================================
--- 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
Fri Jan 12 17:27:31 2007
@@ -78,10 +78,9 @@
 
         String p = System.getProperty("vm.finalize");
         processorsQuantity = getProcessorsQuantity();
-        
-        // -Dvm.finalize=0 disables the finalizer thread
-        if ("0".equalsIgnoreCase(p) || "off".equalsIgnoreCase(p)
-                || "no".equalsIgnoreCase(p) || "false".equalsIgnoreCase(p)) {
+
+        // -XDvm.finalize=0 disables the finalizer thread
+        if (! isNativePartEnabled()) {
             warn("finalizer thread have not been created");
         } else {
             (new FinalizerThread(true)).start();
@@ -198,7 +197,13 @@
     private static native int doFinalization(int quantity);
     
     private static native void fillFinalizationQueueOnExit();
-    
+
+    /**
+     * Returns true if native part of finalization system is
+     * turned on, and false otherwise.
+     */
+    private static native boolean isNativePartEnabled();
+
     /**
      * Returns true if current thread is finalizer thread
      */

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=495813&r1=495812&r2=495813
==============================================================================
--- 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
Fri Jan 12 17:27:31 2007
@@ -130,4 +130,14 @@
 {
     finalizer_shutdown(value);
 }
+/*
+ * Class:     java_lang_FinalizerThread
+ * Method:    isNativePartEnabled
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_java_lang_FinalizerThread_isNativePartEnabled
+  (JNIEnv *, jclass)
+{
+    return (jboolean) vm_finalization_is_enabled();
+}
 /* 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=495813&r1=495812&r2=495813
==============================================================================
--- 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
Fri Jan 12 17:27:31 2007
@@ -102,6 +102,11 @@
 /* END: These three methods are added for NATIVE FINALIZER THREAD */
 
 
+/*
+ * Method: java_lang_FinalizerThread.isNativePartEnabled()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_lang_FinalizerThread_isNativePartEnabled(JNIEnv *, jclass);
 #ifdef __cplusplus
 }
 #endif



Mime
View raw message