Mercurial > hg > truffle
comparison src/share/vm/memory/sharedHeap.hpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | 10c424c5a362 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 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. |
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_terminiation to decide if work should be done in | 95 // Some code uses _n_termination 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_CodeCache = 0x8 | 224 SO_AllCodeCache = 0x8, |
225 SO_ScavengeCodeCache = 0x10 | |
225 }; | 226 }; |
226 | 227 |
227 FlexibleWorkGang* workers() const { return _workers; } | 228 FlexibleWorkGang* workers() const { return _workers; } |
228 | 229 |
229 // Invoke the "do_oop" method the closure "roots" on all root locations. | 230 // Invoke the "do_oop" method the closure "roots" on all root locations. |
230 // The "so" argument determines which roots the closure is applied to: | 231 // The "so" argument determines which roots the closure is applied to: |
231 // "SO_None" does none; | 232 // "SO_None" does none; |
232 // "SO_AllClasses" applies the closure to all entries in the SystemDictionary; | 233 // "SO_AllClasses" applies the closure to all entries in the SystemDictionary; |
233 // "SO_SystemClasses" to all the "system" classes and loaders; | 234 // "SO_SystemClasses" to all the "system" classes and loaders; |
234 // "SO_Strings" applies the closure to all entries in StringTable; | 235 // "SO_Strings" applies the closure to all entries in StringTable; |
235 // "SO_CodeCache" applies the closure to all elements of the CodeCache. | 236 // "SO_AllCodeCache" 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. | |
236 void process_strong_roots(bool activate_scope, | 238 void process_strong_roots(bool activate_scope, |
237 bool is_scavenging, | |
238 ScanningOption so, | 239 ScanningOption so, |
239 OopClosure* roots, | 240 OopClosure* roots, |
240 CodeBlobClosure* code_roots, | |
241 KlassClosure* klass_closure); | 241 KlassClosure* klass_closure); |
242 | 242 |
243 // Apply "blk" to all the weak roots of the system. These include | 243 // Apply "root_closure" to the JNI weak roots.. |
244 // JNI weak roots, the code cache, system dictionary, symbol table, | 244 void process_weak_roots(OopClosure* root_closure); |
245 // string table. | |
246 void process_weak_roots(OopClosure* root_closure, | |
247 CodeBlobClosure* code_roots); | |
248 | 245 |
249 // The functions below are helper functions that a subclass of | 246 // The functions below are helper functions that a subclass of |
250 // "SharedHeap" can use in the implementation of its virtual | 247 // "SharedHeap" can use in the implementation of its virtual |
251 // functions. | 248 // functions. |
252 | 249 |
272 size_t bytes_before, | 269 size_t bytes_before, |
273 size_t bytes_after, | 270 size_t bytes_after, |
274 size_t capacity); | 271 size_t capacity); |
275 }; | 272 }; |
276 | 273 |
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 | |
277 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP | 278 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP |