Mercurial > hg > truffle
diff src/share/vm/code/dependencies.hpp @ 14505:524b54a7f1b5
8034839: jvm hangs with gc/gctests/LoadUnloadGC test
Summary: Provide fast lookup of checked dependencies via hashmap
Reviewed-by: kvn, roland
author | anoll |
---|---|
date | Wed, 26 Feb 2014 11:29:47 +0100 |
parents | 3aaa4b9966f6 |
children | d8041d695d19 3c6ae9109a86 |
line wrap: on
line diff
--- a/src/share/vm/code/dependencies.hpp Wed Feb 19 14:03:09 2014 -0800 +++ b/src/share/vm/code/dependencies.hpp Wed Feb 26 11:29:47 2014 +0100 @@ -32,6 +32,7 @@ #include "code/compressedStream.hpp" #include "code/nmethod.hpp" #include "utilities/growableArray.hpp" +#include "utilities/hashtable.hpp" //** Dependencies represent assertions (approximate invariants) within // the runtime system, e.g. class hierarchy changes. An example is an @@ -526,13 +527,12 @@ }; -class DependencySignature : public ResourceObj { +class DependencySignature : public GenericHashtableEntry<DependencySignature, ResourceObj> { private: int _args_count; uintptr_t _argument_hash[Dependencies::max_arg_count]; Dependencies::DepType _type; - public: DependencySignature(Dependencies::DepStream& dep) { _args_count = dep.argument_count(); @@ -542,21 +542,14 @@ } } - bool equals(const DependencySignature& sig) const; + bool equals(DependencySignature* sig) const; + uintptr_t key() const { return _argument_hash[0] >> 2; } int args_count() const { return _args_count; } uintptr_t arg(int idx) const { return _argument_hash[idx]; } Dependencies::DepType type() const { return _type; } }; -class DependencySignatureBuffer : public StackObj { - private: - GrowableArray<DependencySignature*>** _signatures; - - public: - DependencySignatureBuffer(); - bool add_if_missing(const DependencySignature& sig); -}; // Every particular DepChange is a sub-class of this class. class DepChange : public StackObj {