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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_sweeper.cpp.incl" 27 28 long NMethodSweeper::_traversals = 0; // No. of stack traversals performed 29 nmethod* NMethodSweeper::_current = NULL; // Current nmethod 30 int NMethodSweeper::_seen = 0 ; // No. of nmethods we have currently processed in current pass of CodeCache 31 32 volatile int NMethodSweeper::_invocations = 0; // No. of invocations left until we are completed with this pass 33 volatile int NMethodSweeper::_sweep_started = 0; // Whether a sweep is in progress. 34 35 jint NMethodSweeper::_locked_seen = 0; 36 jint NMethodSweeper::_not_entrant_seen_on_stack = 0; 37 bool NMethodSweeper::_rescan = false; 38 bool NMethodSweeper::_do_sweep = false; 39 bool NMethodSweeper::_was_full = false; 40 jint NMethodSweeper::_advise_to_sweep = 0; 41 jlong NMethodSweeper::_last_was_full = 0; 42 uint NMethodSweeper::_highest_marked = 0; 43 long NMethodSweeper::_was_full_traversal = 0; 44 45 class MarkActivationClosure: public CodeBlobClosure { 46 public: | 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "code/codeCache.hpp" 27 #include "code/nmethod.hpp" 28 #include "compiler/compileBroker.hpp" 29 #include "memory/resourceArea.hpp" 30 #include "oops/methodOop.hpp" 31 #include "runtime/atomic.hpp" 32 #include "runtime/compilationPolicy.hpp" 33 #include "runtime/mutexLocker.hpp" 34 #include "runtime/os.hpp" 35 #include "runtime/sweeper.hpp" 36 #include "runtime/vm_operations.hpp" 37 #include "utilities/events.hpp" 38 #include "utilities/xmlstream.hpp" 39 40 long NMethodSweeper::_traversals = 0; // No. of stack traversals performed 41 nmethod* NMethodSweeper::_current = NULL; // Current nmethod 42 int NMethodSweeper::_seen = 0 ; // No. of nmethods we have currently processed in current pass of CodeCache 43 44 volatile int NMethodSweeper::_invocations = 0; // No. of invocations left until we are completed with this pass 45 volatile int NMethodSweeper::_sweep_started = 0; // Whether a sweep is in progress. 46 47 jint NMethodSweeper::_locked_seen = 0; 48 jint NMethodSweeper::_not_entrant_seen_on_stack = 0; 49 bool NMethodSweeper::_rescan = false; 50 bool NMethodSweeper::_do_sweep = false; 51 bool NMethodSweeper::_was_full = false; 52 jint NMethodSweeper::_advise_to_sweep = 0; 53 jlong NMethodSweeper::_last_was_full = 0; 54 uint NMethodSweeper::_highest_marked = 0; 55 long NMethodSweeper::_was_full_traversal = 0; 56 57 class MarkActivationClosure: public CodeBlobClosure { 58 public: |