1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, 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. |
62 |
62 |
63 static void mark_scavenge_root_nmethods() PRODUCT_RETURN; |
63 static void mark_scavenge_root_nmethods() PRODUCT_RETURN; |
64 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN; |
64 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN; |
65 |
65 |
66 static int _codemem_full_count; |
66 static int _codemem_full_count; |
|
67 |
|
68 static void set_scavenge_root_nmethods(nmethod* nm) { _scavenge_root_nmethods = nm; } |
|
69 static void prune_scavenge_root_nmethods(); |
|
70 static void unlink_scavenge_root_nmethod(nmethod* nm, nmethod* prev); |
67 |
71 |
68 public: |
72 public: |
69 |
73 |
70 // Initialization |
74 // Initialization |
71 static void initialize(); |
75 static void initialize(); |
133 // If "unloading_occurred" is true, then unloads (i.e., breaks root links |
137 // If "unloading_occurred" is true, then unloads (i.e., breaks root links |
134 // to) any unmarked codeBlobs in the cache. Sets "marked_for_unloading" |
138 // to) any unmarked codeBlobs in the cache. Sets "marked_for_unloading" |
135 // to "true" iff some code got unloaded. |
139 // to "true" iff some code got unloaded. |
136 static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred); |
140 static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred); |
137 static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN; |
141 static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN; |
138 static void scavenge_root_nmethods_do(CodeBlobClosure* f); |
142 |
|
143 // Apply f to every live code blob in scavengable nmethods. Prune nmethods |
|
144 // from the list of scavengable nmethods if f->fix_relocations() and a nmethod |
|
145 // no longer has scavengable oops. If f->fix_relocations(), then f must copy |
|
146 // objects to their new location immediately to avoid fixing nmethods on the |
|
147 // basis of the old object locations. |
|
148 static void scavenge_root_nmethods_do(CodeBlobToOopClosure* f); |
139 |
149 |
140 static nmethod* scavenge_root_nmethods() { return _scavenge_root_nmethods; } |
150 static nmethod* scavenge_root_nmethods() { return _scavenge_root_nmethods; } |
141 static void set_scavenge_root_nmethods(nmethod* nm) { _scavenge_root_nmethods = nm; } |
|
142 static void add_scavenge_root_nmethod(nmethod* nm); |
151 static void add_scavenge_root_nmethod(nmethod* nm); |
143 static void drop_scavenge_root_nmethod(nmethod* nm); |
152 static void drop_scavenge_root_nmethod(nmethod* nm); |
144 static void prune_scavenge_root_nmethods(); |
|
145 |
153 |
146 // Printing/debugging |
154 // Printing/debugging |
147 static void print(); // prints summary |
155 static void print(); // prints summary |
148 static void print_internals(); |
156 static void print_internals(); |
149 static void verify(); // verifies the code cache |
157 static void verify(); // verifies the code cache |