1.1 --- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Fri Apr 09 13:08:34 2010 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Tue Apr 13 13:52:10 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 2001-2010 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -31,6 +31,12 @@ 1.11 bool clear_all_softrefs) { 1.12 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); 1.13 1.14 + SharedHeap* sh = SharedHeap::heap(); 1.15 +#ifdef ASSERT 1.16 + if (sh->collector_policy()->should_clear_all_soft_refs()) { 1.17 + assert(clear_all_softrefs, "Policy should have been checked earler"); 1.18 + } 1.19 +#endif 1.20 // hook up weak ref data so it can be used during Mark-Sweep 1.21 assert(GenMarkSweep::ref_processor() == NULL, "no stomping"); 1.22 assert(rp != NULL, "should be non-NULL"); 1.23 @@ -44,7 +50,6 @@ 1.24 1.25 // Increment the invocation count for the permanent generation, since it is 1.26 // implicitly collected whenever we do a full mark sweep collection. 1.27 - SharedHeap* sh = SharedHeap::heap(); 1.28 sh->perm_gen()->stat_record()->invocations++; 1.29 1.30 bool marked_for_unloading = false;