Mercurial > hg > truffle
comparison src/share/vm/code/codeCache.cpp @ 1644:2a47bd84841f
6965184: possible races in make_not_entrant_or_zombie
Reviewed-by: kvn
author | never |
---|---|
date | Thu, 08 Jul 2010 14:29:44 -0700 |
parents | e9ff18c4ace7 |
children | 3e8fbc61cee8 |
comparison
equal
deleted
inserted
replaced
1635:a693e51ac197 | 1644:2a47bd84841f |
---|---|
91 | 91 |
92 // CodeCache implementation | 92 // CodeCache implementation |
93 | 93 |
94 CodeHeap * CodeCache::_heap = new CodeHeap(); | 94 CodeHeap * CodeCache::_heap = new CodeHeap(); |
95 int CodeCache::_number_of_blobs = 0; | 95 int CodeCache::_number_of_blobs = 0; |
96 int CodeCache::_number_of_adapters = 0; | |
97 int CodeCache::_number_of_nmethods = 0; | |
96 int CodeCache::_number_of_nmethods_with_dependencies = 0; | 98 int CodeCache::_number_of_nmethods_with_dependencies = 0; |
97 bool CodeCache::_needs_cache_clean = false; | 99 bool CodeCache::_needs_cache_clean = false; |
98 nmethod* CodeCache::_scavenge_root_nmethods = NULL; | 100 nmethod* CodeCache::_scavenge_root_nmethods = NULL; |
99 nmethod* CodeCache::_saved_nmethods = NULL; | 101 nmethod* CodeCache::_saved_nmethods = NULL; |
100 | 102 |
174 void CodeCache::free(CodeBlob* cb) { | 176 void CodeCache::free(CodeBlob* cb) { |
175 assert_locked_or_safepoint(CodeCache_lock); | 177 assert_locked_or_safepoint(CodeCache_lock); |
176 verify_if_often(); | 178 verify_if_often(); |
177 | 179 |
178 print_trace("free", cb); | 180 print_trace("free", cb); |
179 if (cb->is_nmethod() && ((nmethod *)cb)->has_dependencies()) { | 181 if (cb->is_nmethod()) { |
180 _number_of_nmethods_with_dependencies--; | 182 _number_of_nmethods--; |
183 if (((nmethod *)cb)->has_dependencies()) { | |
184 _number_of_nmethods_with_dependencies--; | |
185 } | |
186 } | |
187 if (cb->is_adapter_blob()) { | |
188 _number_of_adapters--; | |
181 } | 189 } |
182 _number_of_blobs--; | 190 _number_of_blobs--; |
183 | 191 |
184 _heap->deallocate(cb); | 192 _heap->deallocate(cb); |
185 | 193 |
189 | 197 |
190 | 198 |
191 void CodeCache::commit(CodeBlob* cb) { | 199 void CodeCache::commit(CodeBlob* cb) { |
192 // this is called by nmethod::nmethod, which must already own CodeCache_lock | 200 // this is called by nmethod::nmethod, which must already own CodeCache_lock |
193 assert_locked_or_safepoint(CodeCache_lock); | 201 assert_locked_or_safepoint(CodeCache_lock); |
194 if (cb->is_nmethod() && ((nmethod *)cb)->has_dependencies()) { | 202 if (cb->is_nmethod()) { |
195 _number_of_nmethods_with_dependencies++; | 203 _number_of_nmethods++; |
196 } | 204 if (((nmethod *)cb)->has_dependencies()) { |
205 _number_of_nmethods_with_dependencies++; | |
206 } | |
207 } | |
208 if (cb->is_adapter_blob()) { | |
209 _number_of_adapters++; | |
210 } | |
211 | |
197 // flush the hardware I-cache | 212 // flush the hardware I-cache |
198 ICache::invalidate_range(cb->instructions_begin(), cb->instructions_size()); | 213 ICache::invalidate_range(cb->instructions_begin(), cb->instructions_size()); |
199 } | 214 } |
200 | 215 |
201 | 216 |