23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "classfile/verifier.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "compiler/compileBroker.hpp"
31 #include "gc_implementation/shared/markSweep.inline.hpp"
32 #include "gc_interface/collectedHeap.inline.hpp"
33 #include "interpreter/oopMapCache.hpp"
34 #include "interpreter/rewriter.hpp"
35 #include "jvmtifiles/jvmti.h"
36 #include "memory/genOopClosures.inline.hpp"
37 #include "memory/heapInspection.hpp"
38 #include "memory/iterator.inline.hpp"
39 #include "memory/metadataFactory.hpp"
40 #include "memory/oopFactory.hpp"
41 #include "oops/fieldStreams.hpp"
42 #include "oops/instanceClassLoaderKlass.hpp"
43 #include "oops/instanceKlass.hpp"
44 #include "oops/instanceMirrorKlass.hpp"
45 #include "oops/instanceOop.hpp"
46 #include "oops/klass.inline.hpp"
47 #include "oops/method.hpp"
48 #include "oops/oop.inline.hpp"
49 #include "oops/symbol.hpp"
50 #include "prims/jvmtiExport.hpp"
51 #include "prims/jvmtiRedefineClassesTrace.hpp"
52 #include "prims/jvmtiRedefineClasses.hpp"
53 #include "prims/jvmtiThreadState.hpp"
54 #include "prims/methodComparator.hpp"
55 #include "runtime/atomic.inline.hpp"
56 #include "runtime/fieldDescriptor.hpp"
57 #include "runtime/handles.inline.hpp"
58 #include "runtime/javaCalls.hpp"
59 #include "runtime/mutexLocker.hpp"
60 #include "runtime/orderAccess.inline.hpp"
61 #include "runtime/thread.inline.hpp"
62 #include "services/classLoadingService.hpp"
63 #include "services/threadService.hpp"
1949
1950 bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
1951 nmethodBucket* b = _dependencies;
1952 while (b != NULL) {
1953 if (nm == b->get_nmethod()) {
1954 #ifdef ASSERT
1955 int count = b->count();
1956 assert(count >= 0, err_msg("count shouldn't be negative: %d", count));
1957 #endif
1958 return true;
1959 }
1960 b = b->next();
1961 }
1962 return false;
1963 }
1964 #endif //PRODUCT
1965
1966
1967 // Garbage collection
1968
1969 #ifdef ASSERT
1970 template <class T> void assert_is_in(T *p) {
1971 T heap_oop = oopDesc::load_heap_oop(p);
1972 if (!oopDesc::is_null(heap_oop)) {
1973 oop o = oopDesc::decode_heap_oop_not_null(heap_oop);
1974 assert(Universe::heap()->is_in(o), "should be in heap");
1975 }
1976 }
1977 template <class T> void assert_is_in_closed_subset(T *p) {
1978 T heap_oop = oopDesc::load_heap_oop(p);
1979 if (!oopDesc::is_null(heap_oop)) {
1980 oop o = oopDesc::decode_heap_oop_not_null(heap_oop);
1981 assert(Universe::heap()->is_in_closed_subset(o),
1982 err_msg("should be in closed *p " INTPTR_FORMAT " " INTPTR_FORMAT, (address)p, (address)o));
1983 }
1984 }
1985 template <class T> void assert_is_in_reserved(T *p) {
1986 T heap_oop = oopDesc::load_heap_oop(p);
1987 if (!oopDesc::is_null(heap_oop)) {
1988 oop o = oopDesc::decode_heap_oop_not_null(heap_oop);
1989 assert(Universe::heap()->is_in_reserved(o), "should be in reserved");
1990 }
1991 }
1992 template <class T> void assert_nothing(T *p) {}
1993
1994 #else
1995 template <class T> void assert_is_in(T *p) {}
1996 template <class T> void assert_is_in_closed_subset(T *p) {}
1997 template <class T> void assert_is_in_reserved(T *p) {}
1998 template <class T> void assert_nothing(T *p) {}
1999 #endif // ASSERT
2000
2001 //
2002 // Macros that iterate over areas of oops which are specialized on type of
2003 // oop pointer either narrow or wide, depending on UseCompressedOops
2004 //
2005 // Parameters are:
2006 // T - type of oop to point to (either oop or narrowOop)
2007 // start_p - starting pointer for region to iterate over
2008 // count - number of oops or narrowOops to iterate over
2009 // do_oop - action to perform on each oop (it's arbitrary C code which
2010 // makes it more efficient to put in a macro rather than making
2011 // it a template function)
2012 // assert_fn - assert function which is template function because performance
2013 // doesn't matter when enabled.
2014 #define InstanceKlass_SPECIALIZED_OOP_ITERATE( \
2015 T, start_p, count, do_oop, \
2016 assert_fn) \
2017 { \
2018 T* p = (T*)(start_p); \
2019 T* const end = p + (count); \
|
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "classfile/verifier.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "compiler/compileBroker.hpp"
31 #include "gc_implementation/shared/markSweep.inline.hpp"
32 #include "gc_interface/collectedHeap.inline.hpp"
33 #include "interpreter/oopMapCache.hpp"
34 #include "interpreter/rewriter.hpp"
35 #include "jvmtifiles/jvmti.h"
36 #include "memory/genOopClosures.inline.hpp"
37 #include "memory/heapInspection.hpp"
38 #include "memory/iterator.inline.hpp"
39 #include "memory/metadataFactory.hpp"
40 #include "memory/oopFactory.hpp"
41 #include "oops/fieldStreams.hpp"
42 #include "oops/instanceClassLoaderKlass.hpp"
43 #include "oops/instanceKlass.inline.hpp"
44 #include "oops/instanceMirrorKlass.hpp"
45 #include "oops/instanceOop.hpp"
46 #include "oops/klass.inline.hpp"
47 #include "oops/method.hpp"
48 #include "oops/oop.inline.hpp"
49 #include "oops/symbol.hpp"
50 #include "prims/jvmtiExport.hpp"
51 #include "prims/jvmtiRedefineClassesTrace.hpp"
52 #include "prims/jvmtiRedefineClasses.hpp"
53 #include "prims/jvmtiThreadState.hpp"
54 #include "prims/methodComparator.hpp"
55 #include "runtime/atomic.inline.hpp"
56 #include "runtime/fieldDescriptor.hpp"
57 #include "runtime/handles.inline.hpp"
58 #include "runtime/javaCalls.hpp"
59 #include "runtime/mutexLocker.hpp"
60 #include "runtime/orderAccess.inline.hpp"
61 #include "runtime/thread.inline.hpp"
62 #include "services/classLoadingService.hpp"
63 #include "services/threadService.hpp"
1949
1950 bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
1951 nmethodBucket* b = _dependencies;
1952 while (b != NULL) {
1953 if (nm == b->get_nmethod()) {
1954 #ifdef ASSERT
1955 int count = b->count();
1956 assert(count >= 0, err_msg("count shouldn't be negative: %d", count));
1957 #endif
1958 return true;
1959 }
1960 b = b->next();
1961 }
1962 return false;
1963 }
1964 #endif //PRODUCT
1965
1966
1967 // Garbage collection
1968
1969 int InstanceKlass::get_linear_oop_intervals(oop obj, OopInterval* &start, int &size) {
1970 assert(sizeof(OopMapBlock) == sizeof(OopInterval), "auto closure specialization assumes same data layout for speed");
1971 start = (OopInterval*)start_of_nonstatic_oop_maps();
1972 size = size_helper();
1973 return nonstatic_oop_map_count();
1974 }
1975
1976 //
1977 // Macros that iterate over areas of oops which are specialized on type of
1978 // oop pointer either narrow or wide, depending on UseCompressedOops
1979 //
1980 // Parameters are:
1981 // T - type of oop to point to (either oop or narrowOop)
1982 // start_p - starting pointer for region to iterate over
1983 // count - number of oops or narrowOops to iterate over
1984 // do_oop - action to perform on each oop (it's arbitrary C code which
1985 // makes it more efficient to put in a macro rather than making
1986 // it a template function)
1987 // assert_fn - assert function which is template function because performance
1988 // doesn't matter when enabled.
1989 #define InstanceKlass_SPECIALIZED_OOP_ITERATE( \
1990 T, start_p, count, do_oop, \
1991 assert_fn) \
1992 { \
1993 T* p = (T*)(start_p); \
1994 T* const end = p + (count); \
|