Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.cpp @ 14704:b51e29501f30
Merged with jdk9/dev/hotspot changeset 9486a41de3b7
author | twisti |
---|---|
date | Tue, 18 Mar 2014 20:19:10 -0700 |
parents | b6aa8c4972aa 3c6ae9109a86 |
children | 92aa6797d639 |
comparison
equal
deleted
inserted
replaced
14647:8f483e200405 | 14704:b51e29501f30 |
---|---|
37 #include "oops/methodData.hpp" | 37 #include "oops/methodData.hpp" |
38 #include "prims/jvmtiRedefineClassesTrace.hpp" | 38 #include "prims/jvmtiRedefineClassesTrace.hpp" |
39 #include "prims/jvmtiImpl.hpp" | 39 #include "prims/jvmtiImpl.hpp" |
40 #include "runtime/sharedRuntime.hpp" | 40 #include "runtime/sharedRuntime.hpp" |
41 #include "runtime/sweeper.hpp" | 41 #include "runtime/sweeper.hpp" |
42 #include "utilities/resourceHash.hpp" | |
42 #include "utilities/dtrace.hpp" | 43 #include "utilities/dtrace.hpp" |
43 #include "utilities/events.hpp" | 44 #include "utilities/events.hpp" |
44 #include "utilities/xmlstream.hpp" | 45 #include "utilities/xmlstream.hpp" |
45 #ifdef SHARK | 46 #ifdef SHARK |
46 #include "shark/sharkCompiler.hpp" | 47 #include "shark/sharkCompiler.hpp" |
2266 ResourceMark rm; | 2267 ResourceMark rm; |
2267 | 2268 |
2268 // Turn off dependency tracing while actually testing dependencies. | 2269 // Turn off dependency tracing while actually testing dependencies. |
2269 NOT_PRODUCT( FlagSetting fs(TraceDependencies, false) ); | 2270 NOT_PRODUCT( FlagSetting fs(TraceDependencies, false) ); |
2270 | 2271 |
2271 GenericHashtable<DependencySignature, ResourceObj>* table = new GenericHashtable<DependencySignature, ResourceObj>(11027); | 2272 typedef ResourceHashtable<DependencySignature, int, &DependencySignature::hash, |
2273 &DependencySignature::equals, 11027> DepTable; | |
2274 | |
2275 DepTable* table = new DepTable(); | |
2276 | |
2272 // Iterate over live nmethods and check dependencies of all nmethods that are not | 2277 // Iterate over live nmethods and check dependencies of all nmethods that are not |
2273 // marked for deoptimization. A particular dependency is only checked once. | 2278 // marked for deoptimization. A particular dependency is only checked once. |
2274 for(nmethod* nm = CodeCache::alive_nmethod(CodeCache::first()); nm != NULL; nm = CodeCache::alive_nmethod(CodeCache::next(nm))) { | 2279 for(nmethod* nm = CodeCache::alive_nmethod(CodeCache::first()); nm != NULL; nm = CodeCache::alive_nmethod(CodeCache::next(nm))) { |
2275 if (!nm->is_marked_for_deoptimization()) { | 2280 if (!nm->is_marked_for_deoptimization()) { |
2276 for (Dependencies::DepStream deps(nm); deps.next(); ) { | 2281 for (Dependencies::DepStream deps(nm); deps.next(); ) { |
2277 // Construct abstraction of a dependency. | 2282 // Construct abstraction of a dependency. |
2278 DependencySignature* current_sig = new DependencySignature(deps); | 2283 DependencySignature* current_sig = new DependencySignature(deps); |
2279 // Determine if 'deps' is already checked. table->add() returns | 2284 |
2280 // 'true' if the dependency was added (i.e., was not in the hashtable). | 2285 // Determine if dependency is already checked. table->put(...) returns |
2281 if (table->add(current_sig)) { | 2286 // 'true' if the dependency is added (i.e., was not in the hashtable). |
2287 if (table->put(*current_sig, 1)) { | |
2282 if (deps.check_dependency() != NULL) { | 2288 if (deps.check_dependency() != NULL) { |
2283 // Dependency checking failed. Print out information about the failed | 2289 // Dependency checking failed. Print out information about the failed |
2284 // dependency and finally fail with an assert. We can fail here, since | 2290 // dependency and finally fail with an assert. We can fail here, since |
2285 // dependency checking is never done in a product build. | 2291 // dependency checking is never done in a product build. |
2286 changes.print(); | 2292 changes.print(); |