--- old/src/share/vm/oops/instanceKlass.hpp 2015-06-27 04:11:11.000000000 +0300 +++ new/src/share/vm/oops/instanceKlass.hpp 2015-06-27 04:11:11.000000000 +0300 @@ -290,9 +290,15 @@ // have this embedded field. // + // TODO + bool _set_finals; + friend class SystemDictionary; public: + bool set_finals() { return _set_finals; } + void set_finals(bool b) { _set_finals = b; } + bool has_nonstatic_fields() const { return (_misc_flags & _misc_has_nonstatic_fields) != 0; } @@ -1260,6 +1266,36 @@ void verify(Klass* holder); }; +class nmethodBucketEntry : public CHeapObj { + friend class VMStructs; +private: + nmethod* _nmethod; + int _count; + nmethodBucketEntry* _next; +public: + nmethodBucketEntry(nmethod* nmethod, nmethodBucketEntry* next) { + _nmethod = nmethod; + _next = next; + _count = 1; + } + int count() { return _count; } + int increment() { _count += 1; return _count; } + int decrement(); + nmethodBucketEntry* next() { return _next; } + void set_next(nmethodBucketEntry* b) { _next = b; } + nmethod* get_nmethod() { return _nmethod; } + + static int mark_dependent_nmethods(nmethodBucketEntry* deps, DepChange& changes); + static nmethodBucketEntry* add_dependent_nmethod(nmethodBucketEntry* deps, nmethod* nm); + static bool remove_dependent_nmethod(nmethodBucketEntry* deps, nmethod* nm, bool& found); + static nmethodBucketEntry* clean_dependent_nmethods(nmethodBucketEntry* deps); + +#ifndef PRODUCT + static void verify(nmethodBucketEntry* deps); + static void print_dependent_nmethods(nmethodBucketEntry* deps, bool verbose); + static bool is_dependent_nmethod(nmethodBucketEntry* deps, nmethod* nm); +#endif //PRODUCT +}; // // nmethodBucket is used to record dependent nmethods for @@ -1274,28 +1310,32 @@ class nmethodBucket: public CHeapObj { friend class VMStructs; private: - nmethod* _nmethod; - int _count; - nmethodBucket* _next; + enum { + FIRST_Bucket = 0, + KlassBucket = FIRST_Bucket, + CallSiteBucket, + ConstantFieldBucket, + Bucket_LIMIT + }; - public: - nmethodBucket(nmethod* nmethod, nmethodBucket* next) { - _nmethod = nmethod; - _next = next; - _count = 1; + nmethodBucketEntry* _buckets[Bucket_LIMIT]; + + nmethodBucket() { + for (int i = FIRST_Bucket; i < Bucket_LIMIT; i++) { + _buckets[i] = NULL; + } } - int count() { return _count; } - int increment() { _count += 1; return _count; } - int decrement(); - nmethodBucket* next() { return _next; } - void set_next(nmethodBucket* b) { _next = b; } - nmethod* get_nmethod() { return _nmethod; } + static int bucket_index(DepChange& changes); + + public: static int mark_dependent_nmethods(nmethodBucket* deps, DepChange& changes); static nmethodBucket* add_dependent_nmethod(nmethodBucket* deps, nmethod* nm); static bool remove_dependent_nmethod(nmethodBucket* deps, nmethod* nm); static nmethodBucket* clean_dependent_nmethods(nmethodBucket* deps); + static int release(nmethodBucket* deps); #ifndef PRODUCT + static void verify(nmethodBucket* deps); static void print_dependent_nmethods(nmethodBucket* deps, bool verbose); static bool is_dependent_nmethod(nmethodBucket* deps, nmethod* nm); #endif //PRODUCT