comparison src/share/vm/memory/sharedHeap.hpp @ 14909:4ca6dc0799b6

Backout jdk9 merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 01 Apr 2014 13:57:07 +0200
parents 10c424c5a362
children 89152779163c
comparison
equal deleted inserted replaced
14908:8db6e76cb658 14909:4ca6dc0799b6
1 /* 1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2012, 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.
90 // to a value > 1 before a task that you would like executed in parallel 90 // to a value > 1 before a task that you would like executed in parallel
91 // and then to set it to 0 after that task has completed. A value of 91 // and then to set it to 0 after that task has completed. A value of
92 // 0 is a "special" value in set_n_threads() which translates to 92 // 0 is a "special" value in set_n_threads() which translates to
93 // setting _n_threads to 1. 93 // setting _n_threads to 1.
94 // 94 //
95 // Some code uses _n_termination to decide if work should be done in 95 // Some code uses _n_terminiation to decide if work should be done in
96 // parallel. The notorious possibly_parallel_oops_do() in threads.cpp 96 // parallel. The notorious possibly_parallel_oops_do() in threads.cpp
97 // is an example of such code. Look for variable "is_par" for other 97 // is an example of such code. Look for variable "is_par" for other
98 // examples. 98 // examples.
99 // 99 //
100 // The active_workers is not reset to 0 after a parallel phase. It's 100 // The active_workers is not reset to 0 after a parallel phase. It's
219 enum ScanningOption { 219 enum ScanningOption {
220 SO_None = 0x0, 220 SO_None = 0x0,
221 SO_AllClasses = 0x1, 221 SO_AllClasses = 0x1,
222 SO_SystemClasses = 0x2, 222 SO_SystemClasses = 0x2,
223 SO_Strings = 0x4, 223 SO_Strings = 0x4,
224 SO_AllCodeCache = 0x8, 224 SO_CodeCache = 0x8
225 SO_ScavengeCodeCache = 0x10
226 }; 225 };
227 226
228 FlexibleWorkGang* workers() const { return _workers; } 227 FlexibleWorkGang* workers() const { return _workers; }
229 228
230 // Invoke the "do_oop" method the closure "roots" on all root locations. 229 // Invoke the "do_oop" method the closure "roots" on all root locations.
231 // The "so" argument determines which roots the closure is applied to: 230 // The "so" argument determines which roots the closure is applied to:
232 // "SO_None" does none; 231 // "SO_None" does none;
233 // "SO_AllClasses" applies the closure to all entries in the SystemDictionary; 232 // "SO_AllClasses" applies the closure to all entries in the SystemDictionary;
234 // "SO_SystemClasses" to all the "system" classes and loaders; 233 // "SO_SystemClasses" to all the "system" classes and loaders;
235 // "SO_Strings" applies the closure to all entries in StringTable; 234 // "SO_Strings" applies the closure to all entries in StringTable;
236 // "SO_AllCodeCache" applies the closure to all elements of the CodeCache. 235 // "SO_CodeCache" applies the closure to all elements of the CodeCache.
237 // "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache.
238 void process_strong_roots(bool activate_scope, 236 void process_strong_roots(bool activate_scope,
237 bool is_scavenging,
239 ScanningOption so, 238 ScanningOption so,
240 OopClosure* roots, 239 OopClosure* roots,
240 CodeBlobClosure* code_roots,
241 KlassClosure* klass_closure); 241 KlassClosure* klass_closure);
242 242
243 // Apply "root_closure" to the JNI weak roots.. 243 // Apply "blk" to all the weak roots of the system. These include
244 void process_weak_roots(OopClosure* root_closure); 244 // JNI weak roots, the code cache, system dictionary, symbol table,
245 // string table.
246 void process_weak_roots(OopClosure* root_closure,
247 CodeBlobClosure* code_roots);
245 248
246 // The functions below are helper functions that a subclass of 249 // The functions below are helper functions that a subclass of
247 // "SharedHeap" can use in the implementation of its virtual 250 // "SharedHeap" can use in the implementation of its virtual
248 // functions. 251 // functions.
249 252
269 size_t bytes_before, 272 size_t bytes_before,
270 size_t bytes_after, 273 size_t bytes_after,
271 size_t capacity); 274 size_t capacity);
272 }; 275 };
273 276
274 inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) {
275 return static_cast<SharedHeap::ScanningOption>(static_cast<int>(so0) | static_cast<int>(so1));
276 }
277
278 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP 277 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP