harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r545727 - in /harmony/enhanced/drlvm/trunk: build/make/ build/make/excludes/ vm/tests/smoke/stress/ vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/
Date Sat, 09 Jun 2007 10:47:18 GMT
Author: gshimansky
Date: Sat Jun  9 03:47:17 2007
New Revision: 545727

URL: http://svn.apache.org/viewvc?view=rev&rev=545727
Log:
Applied additional patch for garbage collectable interned strings from HARMONY-4105
Fix for Make interned string collectable by GC.
Excluded stress.Intern for interpreter because it is very slow.


Modified:
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.ia64.int
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.int
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
    harmony/enhanced/drlvm/trunk/build/make/lnx.properties
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Intern.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/InternMap.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/VM.java

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.ia64.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.ia64.int?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.ia64.int (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.ia64.int Sat
Jun  9 03:47:17 2007
@@ -21,3 +21,6 @@
 # HARMONY-3639
 thread/ManyThreadsTest.java
 
+# This stress test is very slow on interpreter
+stress/Intern.java
+

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.int?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.int (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.int Sat
Jun  9 03:47:17 2007
@@ -18,3 +18,6 @@
 # HARMONY-3639
 thread/ManyThreadsTest.java
 
+# This stress test is very slow on interpreter
+stress/Intern.java
+

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int
Sat Jun  9 03:47:17 2007
@@ -20,3 +20,6 @@
 # HARMONY-3639
 thread/ManyThreadsTest.java
 
+# This stress test is very slow on interpreter
+stress/Intern.java
+

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int Sat
Jun  9 03:47:17 2007
@@ -10,3 +10,7 @@
 # HARMONY-3917
 gc/PhantomReferenceTest.java
 gc/WeakReferenceTest.java
+
+# This stress test is very slow on interpreter
+stress/Intern.java
+

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
Sat Jun  9 03:47:17 2007
@@ -10,3 +10,7 @@
 # HARMONY-3917
 gc/PhantomReferenceTest.java
 gc/WeakReferenceTest.java
+
+# This stress test is very slow on interpreter
+stress/Intern.java
+

Modified: harmony/enhanced/drlvm/trunk/build/make/lnx.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/lnx.properties?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/lnx.properties (original)
+++ harmony/enhanced/drlvm/trunk/build/make/lnx.properties Sat Jun  9 03:47:17 2007
@@ -72,7 +72,7 @@
 
 
 # ANother Tool for Language Recognition
-remote.ANTLR.archive=https://issues.apache.org/jira/secure/attachment/12358381/antlr-2.7.5.jar
+remote.ANTLR.archive=http://issues.apache.org/jira/secure/attachment/12358381/antlr-2.7.5.jar
 remote.ANTLR.archive.type=asis
 
 # org.vmmagic unboxed package. Used to enable address arithmetic in Java

Modified: harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Intern.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Intern.java?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Intern.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Intern.java Sat Jun  9 03:47:17 2007
@@ -17,16 +17,19 @@
 
 /**
  * Tests the correctness of string interning.
- *
- * @keyword XXX_stress
  */
 public class Intern {
     public static void main(String[] args) {
         String s = "abc";
-        for (int i = 0; i < 100000; i++) {
-            s = (s + i + s).intern();
-            if (s.length() > 65536) s = "abc" + i;
-            if (i % 1000 == 0) trace(".");
+        try {
+            for (int i = 0; i < 100000; i++) {
+                s = (s + i + s).intern();
+                if (s.length() > 65536) s = "abc" + i;
+                if (i % 1000 == 0) trace(".");
+            }
+            System.out.println("\nPASSED");
+        } catch (OutOfMemoryError oome) {
+            System.out.println("\nFAILED");
         }
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/InternMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/InternMap.java?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/InternMap.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/InternMap.java
Sat Jun  9 03:47:17 2007
@@ -25,7 +25,7 @@
  */
 public class InternMap {
 
-    private final ReferenceQueue referenceQueue;
+    private final ReferenceQueue<String> referenceQueue;
 
     int elementCount;
 
@@ -40,13 +40,11 @@
         return new Entry[size];
     }
 
-    private static final class Entry/* extends WeakReference*/ {
+    private static final class Entry extends WeakReference<String> {
         int hash;
         Entry next;
-        String key;
-        Entry(String key, ReferenceQueue queue) {
-            //super(key, queue);
-            this.key = key;
+        Entry(String key, ReferenceQueue<String> queue) {
+            super(key, queue);
             hash = key.hashCode();
         }
     }
@@ -57,7 +55,7 @@
             elementData = newEntryArray(capacity == 0 ? 1 : capacity);
             loadFactor = 7500; // Default load factor of 0.75
             computeMaxSize();
-            referenceQueue = new ReferenceQueue();
+            referenceQueue = new ReferenceQueue<String>();
         } else {
             throw new IllegalArgumentException();
         }
@@ -69,12 +67,10 @@
 
     void poll()
     {
-        /*
         Entry toRemove;
         while ((toRemove = (Entry)referenceQueue.poll()) != null) {
                 removeEntry(toRemove);
         }
-        */
     }
 
     void removeEntry(Entry toRemove)
@@ -110,7 +106,7 @@
         int length = elementData.length;
         index = (hash & 0x7FFFFFFF) % length;
         entry = elementData[index];
-        while (entry != null && !key.equals(interned = (String)entry.key/*get()*/))
{
+        while (entry != null && !key.equals(interned = (String)entry.get())) {
             entry = entry.next;
         }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/VM.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/VM.java?view=diff&rev=545727&r1=545726&r2=545727
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/VM.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/vm/VM.java
Sat Jun  9 03:47:17 2007
@@ -22,8 +22,6 @@
 package org.apache.harmony.kernel.vm;
 
 import org.apache.harmony.vm.VMStack;
-import java.lang.ref.WeakReference;
-import java.util.WeakHashMap;
 
 public final class VM {
 
@@ -115,8 +113,6 @@
     /**
      * Invokes native string interning service.
      */
-    private static native String intern0(String s);
-
     private static InternMap internedStrings;
 
     static {



Mime
View raw message