Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 18192 invoked from network); 15 Oct 2006 02:34:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Oct 2006 02:34:14 -0000 Received: (qmail 98425 invoked by uid 500); 15 Oct 2006 02:34:14 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 98384 invoked by uid 500); 15 Oct 2006 02:34:13 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 98367 invoked by uid 99); 15 Oct 2006 02:34:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Oct 2006 19:34:13 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Oct 2006 19:34:12 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 0AC7E1A981A; Sat, 14 Oct 2006 19:33:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r464099 - in /incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src: collect.cpp collect.h collect_slide_compact.cpp Date: Sun, 15 Oct 2006 02:33:51 -0000 To: harmony-commits@incubator.apache.org From: geirm@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061015023352.0AC7E1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: geirm Date: Sat Oct 14 19:33:49 2006 New Revision: 464099 URL: http://svn.apache.org/viewvc?view=rev&rev=464099 Log: HARMONY-1762 Weak references processing is splited into 2 phases on compaction algorithm. 1 phase: check reachability of referent, remember the reference or referent for update during compaction. 2 phase: vm_enqueue_reference() if the referent is not reachable. Algorithm of enumeration is the following: enumerate world enumerate (phase1) process weak and soft references enumerate finalizible objects. compaction enqueue weak and soft references .... Enumeration of finalizible objects may add more weak references which was not enumerated, but which will be enqueued. This is the enumeration problem. Ubuntu 6 - smoke, c-unit, ~kernel, testcase Modified: incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.cpp incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.h incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect_slide_compact.cpp Modified: incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.cpp URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.cpp?view=diff&rev=464099&r1=464098&r2=464099 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.cpp (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.cpp Sat Oct 14 19:33:49 2006 @@ -216,6 +216,7 @@ TRACE2("gc.ref", "process_special_references: reference enquequed"); vm_enqueue_reference((Managed_Object_Handle)ref); } + array.clear(); } // scan only finalizible object, without enqueue @@ -230,9 +231,9 @@ notify_gc_start(); object_count = 0; - soft_references.clear(); - weak_references.clear(); - phantom_references.clear(); + assert (soft_references.empty()); + assert (weak_references.empty()); + assert (phantom_references.empty()); soft_refs = weak_refs = phantom_refs = 0; } @@ -276,13 +277,13 @@ gc_slide_process_special_references(weak_references); process_finalizable_objects(); } + gc_slide_process_special_references(soft_references); + gc_slide_process_special_references(weak_references); gc_slide_process_special_references(phantom_references); TIME(gc_slide_move_all,()); roots_update(); - gc_slide_postprocess_special_references(soft_references); - gc_slide_postprocess_special_references(weak_references); - gc_slide_postprocess_special_references(phantom_references); + gc_slide_postprocess_special_references(); gc_deallocate_mark_bits(); finalize_objects(); @@ -345,6 +346,8 @@ heap.Tcopy = (float) gc_time.dt(); return res; } + process_special_references(soft_references); + process_special_references(weak_references); process_special_references(phantom_references); roots_update(); finalize_objects(); @@ -374,6 +377,8 @@ TIME(process_special_references,(soft_references)); TIME(process_special_references,(weak_references)); TIME(process_finalizable_objects,()); + TIME(process_special_references,(soft_references)); + TIME(process_special_references,(weak_references)); TIME(process_special_references,(phantom_references)); roots_update(); TIME(finalize_objects,()); Modified: incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.h URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.h?view=diff&rev=464099&r1=464098&r2=464099 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.h (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect.h Sat Oct 14 19:33:49 2006 @@ -77,7 +77,7 @@ void gc_slide_add_root_set_entry(Slot slot); void gc_slide_move_all(); void gc_slide_process_special_references(reference_vector& array); -void gc_slide_postprocess_special_references(reference_vector& array); +void gc_slide_postprocess_special_references(); void transition_copy_to_sliding_compaction(fast_list& slots); void gc_slide_process_transitional_slots(fast_list& slots); Modified: incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect_slide_compact.cpp URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect_slide_compact.cpp?view=diff&rev=464099&r1=464098&r2=464099 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect_slide_compact.cpp (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/collect_slide_compact.cpp Sat Oct 14 19:33:49 2006 @@ -32,6 +32,7 @@ unsigned char *mark_bits; int mark_bits_size; fast_list objects; +reference_vector references_to_enqueue; static inline bool is_compaction_object(Partial_Reveal_Object *refobj) { @@ -603,7 +604,8 @@ // object not marked, clear reference slot.write((Partial_Reveal_Object*) heap_null); - Slot root = make_direct_root(&*i); + references_to_enqueue.push_back(obj); + Slot root = make_direct_root(&references_to_enqueue.back()); if (is_forwarded_object(obj)) { update_forwarded_reference(obj, root); @@ -611,16 +613,18 @@ enqueue_reference(obj, root); } } + array.clear(); } -void gc_slide_postprocess_special_references(reference_vector& array) { - for(reference_vector::iterator i = array.begin(); - i != array.end(); ++i) { +void gc_slide_postprocess_special_references() { + for(reference_vector::iterator i = references_to_enqueue.begin(); + i != references_to_enqueue.end(); ++i) { Partial_Reveal_Object *obj = *i; - if (obj == heap_null) continue; + assert (obj != heap_null); vm_enqueue_reference((Managed_Object_Handle)obj); } + references_to_enqueue.clear(); } // transition from coping collector code