Mercurial > hg > truffle
comparison src/share/vm/code/nmethod.cpp @ 14726:92aa6797d639
Backed out merge changeset: b51e29501f30
Backed out merge revision to its first parent (8f483e200405)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 24 Mar 2014 21:30:43 +0100 |
parents | b51e29501f30 |
children | b10e42998d01 |
comparison
equal
deleted
inserted
replaced
14719:0bdd0d157040 | 14726:92aa6797d639 |
---|---|
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" | |
43 #include "utilities/dtrace.hpp" | 42 #include "utilities/dtrace.hpp" |
44 #include "utilities/events.hpp" | 43 #include "utilities/events.hpp" |
45 #include "utilities/xmlstream.hpp" | 44 #include "utilities/xmlstream.hpp" |
46 #ifdef SHARK | 45 #ifdef SHARK |
47 #include "shark/sharkCompiler.hpp" | 46 #include "shark/sharkCompiler.hpp" |
2267 ResourceMark rm; | 2266 ResourceMark rm; |
2268 | 2267 |
2269 // Turn off dependency tracing while actually testing dependencies. | 2268 // Turn off dependency tracing while actually testing dependencies. |
2270 NOT_PRODUCT( FlagSetting fs(TraceDependencies, false) ); | 2269 NOT_PRODUCT( FlagSetting fs(TraceDependencies, false) ); |
2271 | 2270 |
2272 typedef ResourceHashtable<DependencySignature, int, &DependencySignature::hash, | 2271 GenericHashtable<DependencySignature, ResourceObj>* table = new GenericHashtable<DependencySignature, ResourceObj>(11027); |
2273 &DependencySignature::equals, 11027> DepTable; | |
2274 | |
2275 DepTable* table = new DepTable(); | |
2276 | |
2277 // Iterate over live nmethods and check dependencies of all nmethods that are not | 2272 // Iterate over live nmethods and check dependencies of all nmethods that are not |
2278 // marked for deoptimization. A particular dependency is only checked once. | 2273 // marked for deoptimization. A particular dependency is only checked once. |
2279 for(nmethod* nm = CodeCache::alive_nmethod(CodeCache::first()); nm != NULL; nm = CodeCache::alive_nmethod(CodeCache::next(nm))) { | 2274 for(nmethod* nm = CodeCache::alive_nmethod(CodeCache::first()); nm != NULL; nm = CodeCache::alive_nmethod(CodeCache::next(nm))) { |
2280 if (!nm->is_marked_for_deoptimization()) { | 2275 if (!nm->is_marked_for_deoptimization()) { |
2281 for (Dependencies::DepStream deps(nm); deps.next(); ) { | 2276 for (Dependencies::DepStream deps(nm); deps.next(); ) { |
2282 // Construct abstraction of a dependency. | 2277 // Construct abstraction of a dependency. |
2283 DependencySignature* current_sig = new DependencySignature(deps); | 2278 DependencySignature* current_sig = new DependencySignature(deps); |
2284 | 2279 // Determine if 'deps' is already checked. table->add() returns |
2285 // Determine if dependency is already checked. table->put(...) returns | 2280 // 'true' if the dependency was added (i.e., was not in the hashtable). |
2286 // 'true' if the dependency is added (i.e., was not in the hashtable). | 2281 if (table->add(current_sig)) { |
2287 if (table->put(*current_sig, 1)) { | |
2288 if (deps.check_dependency() != NULL) { | 2282 if (deps.check_dependency() != NULL) { |
2289 // Dependency checking failed. Print out information about the failed | 2283 // Dependency checking failed. Print out information about the failed |
2290 // dependency and finally fail with an assert. We can fail here, since | 2284 // dependency and finally fail with an assert. We can fail here, since |
2291 // dependency checking is never done in a product build. | 2285 // dependency checking is never done in a product build. |
2292 changes.print(); | 2286 changes.print(); |