24
24
25
25
#include " precompiled.hpp"
26
26
#include " gc/serial/cardTableRS.hpp"
27
- #include " gc/serial/defNewGeneration.inline.hpp"
28
27
#include " gc/serial/serialGcRefProcProxyTask.hpp"
29
28
#include " gc/serial/serialHeap.inline.hpp"
30
29
#include " gc/serial/serialStringDedup.inline.hpp"
@@ -678,19 +677,13 @@ void DefNewGeneration::collect(bool full,
678
677
// The preserved marks should be empty at the start of the GC.
679
678
_preserved_marks_set.init (1 );
680
679
681
- assert (heap->no_allocs_since_save_marks (),
682
- " save marks have not been newly set." );
683
-
684
680
YoungGenScanClosure young_gen_cl (this );
685
681
OldGenScanClosure old_gen_cl (this );
686
682
687
683
FastEvacuateFollowersClosure evacuate_followers (heap,
688
684
&young_gen_cl,
689
685
&old_gen_cl);
690
686
691
- assert (heap->no_allocs_since_save_marks (),
692
- " save marks have not been newly set." );
693
-
694
687
{
695
688
StrongRootsScope srs (0 );
696
689
RootScanClosure root_cl{this };
@@ -700,13 +693,14 @@ void DefNewGeneration::collect(bool full,
700
693
NMethodToOopClosure::FixRelocations,
701
694
false /* keepalive_nmethods */ );
702
695
696
+ HeapWord* saved_top_in_old_gen = _old_gen->space ()->top ();
703
697
heap->process_roots (SerialHeap::SO_ScavengeCodeCache,
704
698
&root_cl,
705
699
&cld_cl,
706
700
&cld_cl,
707
701
&code_cl);
708
702
709
- _old_gen->scan_old_to_young_refs ();
703
+ _old_gen->scan_old_to_young_refs (saved_top_in_old_gen );
710
704
}
711
705
712
706
// "evacuate followers".
@@ -723,16 +717,12 @@ void DefNewGeneration::collect(bool full,
723
717
_gc_tracer->report_tenuring_threshold (tenuring_threshold ());
724
718
pt.print_all_references ();
725
719
}
726
- assert (heap->no_allocs_since_save_marks (), " save marks have not been newly set." );
727
720
728
721
{
729
722
AdjustWeakRootClosure cl{this };
730
723
WeakProcessor::weak_oops_do (&is_alive, &cl);
731
724
}
732
725
733
- // Verify that the usage of keep_alive didn't copy any objects.
734
- assert (heap->no_allocs_since_save_marks (), " save marks have not been newly set." );
735
-
736
726
_string_dedup_requests.flush ();
737
727
738
728
if (!_promotion_failed) {
@@ -892,15 +882,6 @@ void DefNewGeneration::drain_promo_failure_scan_stack() {
892
882
}
893
883
}
894
884
895
- void DefNewGeneration::save_marks () {
896
- set_saved_mark_word ();
897
- }
898
-
899
-
900
- bool DefNewGeneration::no_allocs_since_save_marks () {
901
- return saved_mark_at_top ();
902
- }
903
-
904
885
void DefNewGeneration::contribute_scratch (void *& scratch, size_t & num_words) {
905
886
if (_promotion_failed) {
906
887
return ;
0 commit comments