Mercurial > hg > truffle
comparison src/share/vm/code/codeCache.hpp @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | 4a7dc38ae96b f2110083203d |
children | f22cbff51c12 |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
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. |
55 static int _number_of_adapters; | 55 static int _number_of_adapters; |
56 static int _number_of_nmethods; | 56 static int _number_of_nmethods; |
57 static int _number_of_nmethods_with_dependencies; | 57 static int _number_of_nmethods_with_dependencies; |
58 static bool _needs_cache_clean; | 58 static bool _needs_cache_clean; |
59 static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link() | 59 static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link() |
60 static nmethod* _saved_nmethods; // linked via nm->saved_nmethod_look() | 60 static nmethod* _saved_nmethods; // Linked list of speculatively disconnected nmethods. |
61 | 61 |
62 static void verify_if_often() PRODUCT_RETURN; | 62 static void verify_if_often() PRODUCT_RETURN; |
63 | 63 |
64 static void mark_scavenge_root_nmethods() PRODUCT_RETURN; | 64 static void mark_scavenge_root_nmethods() PRODUCT_RETURN; |
65 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN; | 65 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN; |
66 | 66 |
67 static int _codemem_full_count; | |
68 | |
67 public: | 69 public: |
68 | 70 |
69 // Initialization | 71 // Initialization |
70 static void initialize(); | 72 static void initialize(); |
71 | 73 |
74 static void report_codemem_full(); | |
75 | |
72 // Allocation/administration | 76 // Allocation/administration |
73 static CodeBlob* allocate(int size); // allocates a new CodeBlob | 77 static CodeBlob* allocate(int size, bool is_critical = false); // allocates a new CodeBlob |
74 static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled | 78 static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled |
75 static int alignment_unit(); // guaranteed alignment of all CodeBlobs | 79 static int alignment_unit(); // guaranteed alignment of all CodeBlobs |
76 static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header) | 80 static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header) |
77 static void free(CodeBlob* cb); // frees a CodeBlob | 81 static void free(CodeBlob* cb); // frees a CodeBlob |
78 static void flush(); // flushes all CodeBlobs | 82 static void flush(); // flushes all CodeBlobs |
158 static void log_state(outputStream* st); | 162 static void log_state(outputStream* st); |
159 | 163 |
160 // The full limits of the codeCache | 164 // The full limits of the codeCache |
161 static address low_bound() { return (address) _heap->low_boundary(); } | 165 static address low_bound() { return (address) _heap->low_boundary(); } |
162 static address high_bound() { return (address) _heap->high_boundary(); } | 166 static address high_bound() { return (address) _heap->high_boundary(); } |
163 | 167 static address high() { return (address) _heap->high(); } |
164 static bool has_space(int size) { | |
165 // Always leave some room in the CodeCache for I2C/C2I adapters | |
166 return largest_free_block() > (CodeCacheMinimumFreeSpace + size); | |
167 } | |
168 | 168 |
169 // Profiling | 169 // Profiling |
170 static address first_address(); // first address used for CodeBlobs | 170 static address first_address(); // first address used for CodeBlobs |
171 static address last_address(); // last address used for CodeBlobs | 171 static address last_address(); // last address used for CodeBlobs |
172 static size_t capacity() { return _heap->capacity(); } | 172 static size_t capacity() { return _heap->capacity(); } |
173 static size_t max_capacity() { return _heap->max_capacity(); } | 173 static size_t max_capacity() { return _heap->max_capacity(); } |
174 static size_t unallocated_capacity() { return _heap->unallocated_capacity(); } | 174 static size_t unallocated_capacity() { return _heap->unallocated_capacity(); } |
175 static size_t largest_free_block(); | 175 static bool needs_flushing() { return unallocated_capacity() < CodeCacheFlushingMinimumFreeSpace; } |
176 static bool needs_flushing() { return largest_free_block() < CodeCacheFlushingMinimumFreeSpace; } | 176 static double reverse_free_ratio(); |
177 | 177 |
178 static bool needs_cache_clean() { return _needs_cache_clean; } | 178 static bool needs_cache_clean() { return _needs_cache_clean; } |
179 static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; } | 179 static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; } |
180 static void clear_inline_caches(); // clear all inline caches | 180 static void clear_inline_caches(); // clear all inline caches |
181 | 181 |
182 static nmethod* find_and_remove_saved_code(Method* m); | 182 static nmethod* reanimate_saved_code(Method* m); |
183 static void remove_saved_code(nmethod* nm); | 183 static void remove_saved_code(nmethod* nm); |
184 static void speculatively_disconnect(nmethod* nm); | 184 static void speculatively_disconnect(nmethod* nm); |
185 | 185 |
186 // Deoptimization | 186 // Deoptimization |
187 static int mark_for_deoptimization(DepChange& changes); | 187 static int mark_for_deoptimization(DepChange& changes); |
194 static void make_marked_nmethods_zombies(); | 194 static void make_marked_nmethods_zombies(); |
195 static void make_marked_nmethods_not_entrant(); | 195 static void make_marked_nmethods_not_entrant(); |
196 | 196 |
197 // tells how many nmethods have dependencies | 197 // tells how many nmethods have dependencies |
198 static int number_of_nmethods_with_dependencies(); | 198 static int number_of_nmethods_with_dependencies(); |
199 | |
200 static int get_codemem_full_count() { return _codemem_full_count; } | |
199 }; | 201 }; |
200 | 202 |
201 #endif // SHARE_VM_CODE_CODECACHE_HPP | 203 #endif // SHARE_VM_CODE_CODECACHE_HPP |