hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
changeset 18025 b7bcf7497f93
parent 17625 3e91c67ddece
child 21916 4977554a0c5e
equal deleted inserted replaced
18024:f9e300086063 18025:b7bcf7497f93
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    34 #include "utilities/stack.hpp"
    34 #include "utilities/stack.hpp"
    35 #include "utilities/taskqueue.hpp"
    35 #include "utilities/taskqueue.hpp"
    36 
    36 
    37 class ReferenceProcessor;
    37 class ReferenceProcessor;
    38 class DataLayout;
    38 class DataLayout;
       
    39 class SerialOldTracer;
       
    40 class STWGCTimer;
    39 
    41 
    40 // MarkSweep takes care of global mark-compact garbage collection for a
    42 // MarkSweep takes care of global mark-compact garbage collection for a
    41 // GenCollectedHeap using a four-phase pointer forwarding algorithm.  All
    43 // GenCollectedHeap using a four-phase pointer forwarding algorithm.  All
    42 // generations are assumed to support marking; those that can also support
    44 // generations are assumed to support marking; those that can also support
    43 // compaction.
    45 // compaction.
   125   static size_t                          _preserved_count_max;
   127   static size_t                          _preserved_count_max;
   126   static PreservedMark*                  _preserved_marks;
   128   static PreservedMark*                  _preserved_marks;
   127 
   129 
   128   // Reference processing (used in ...follow_contents)
   130   // Reference processing (used in ...follow_contents)
   129   static ReferenceProcessor*             _ref_processor;
   131   static ReferenceProcessor*             _ref_processor;
       
   132 
       
   133   static STWGCTimer*                     _gc_timer;
       
   134   static SerialOldTracer*                _gc_tracer;
   130 
   135 
   131   // Non public closures
   136   // Non public closures
   132   static KeepAliveClosure keep_alive;
   137   static KeepAliveClosure keep_alive;
   133 
   138 
   134   // Debugging
   139   // Debugging
   149   static uint total_invocations() { return _total_invocations; }
   154   static uint total_invocations() { return _total_invocations; }
   150 
   155 
   151   // Reference Processing
   156   // Reference Processing
   152   static ReferenceProcessor* const ref_processor() { return _ref_processor; }
   157   static ReferenceProcessor* const ref_processor() { return _ref_processor; }
   153 
   158 
       
   159   static STWGCTimer* gc_timer() { return _gc_timer; }
       
   160   static SerialOldTracer* gc_tracer() { return _gc_tracer; }
       
   161 
   154   // Call backs for marking
   162   // Call backs for marking
   155   static void mark_object(oop obj);
   163   static void mark_object(oop obj);
   156   // Mark pointer and follow contents.  Empty marking stack afterwards.
   164   // Mark pointer and follow contents.  Empty marking stack afterwards.
   157   template <class T> static inline void follow_root(T* p);
   165   template <class T> static inline void follow_root(T* p);
   158 
   166