45 // only cares about the latest version of the Method*. This cache safely 46 // interacts with the RedefineClasses API. 47 48 class LatestMethodCache : public CHeapObj<mtClass> { 49 // We save the Klass* and the idnum of Method* in order to get 50 // the current cached Method*. 51 private: 52 Klass* _klass; 53 int _method_idnum; 54 55 public: 56 LatestMethodCache() { _klass = NULL; _method_idnum = -1; } 57 ~LatestMethodCache() { _klass = NULL; _method_idnum = -1; } 58 59 void init(Klass* k, Method* m); 60 Klass* klass() const { return _klass; } 61 int method_idnum() const { return _method_idnum; } 62 63 Method* get_method(); 64 65 // Enhanced Class Redefinition support 66 void classes_do(void f(Klass*)) { 67 f(_klass); 68 } 69 70 // CDS support. Replace the klass in this with the archive version 71 // could use this for Enhanced Class Redefinition also. 72 void serialize(SerializeClosure* f) { 73 f->do_ptr((void**)&_klass); 74 } 75 }; 76 77 78 // For UseCompressedOops. 79 struct NarrowPtrStruct { 80 // Base address for oop-within-java-object materialization. 81 // NULL if using wide oops or zero based narrow oops. 82 address _base; 83 // Number of shift bits for encoding/decoding narrow ptrs. 84 // 0 if using wide ptrs or zero based unscaled narrow ptrs, 85 // LogMinObjAlignmentInBytes/LogKlassAlignmentInBytes otherwise. 86 int _shift; 87 // Generate code with implicit null checks for narrow ptrs. 88 bool _use_implicit_null_checks; 89 }; | 45 // only cares about the latest version of the Method*. This cache safely 46 // interacts with the RedefineClasses API. 47 48 class LatestMethodCache : public CHeapObj<mtClass> { 49 // We save the Klass* and the idnum of Method* in order to get 50 // the current cached Method*. 51 private: 52 Klass* _klass; 53 int _method_idnum; 54 55 public: 56 LatestMethodCache() { _klass = NULL; _method_idnum = -1; } 57 ~LatestMethodCache() { _klass = NULL; _method_idnum = -1; } 58 59 void init(Klass* k, Method* m); 60 Klass* klass() const { return _klass; } 61 int method_idnum() const { return _method_idnum; } 62 63 Method* get_method(); 64 65 // CDS support. Replace the klass in this with the archive version 66 // could use this for Enhanced Class Redefinition also. 67 void serialize(SerializeClosure* f) { 68 f->do_ptr((void**)&_klass); 69 } 70 }; 71 72 73 // For UseCompressedOops. 74 struct NarrowPtrStruct { 75 // Base address for oop-within-java-object materialization. 76 // NULL if using wide oops or zero based narrow oops. 77 address _base; 78 // Number of shift bits for encoding/decoding narrow ptrs. 79 // 0 if using wide ptrs or zero based unscaled narrow ptrs, 80 // LogMinObjAlignmentInBytes/LogKlassAlignmentInBytes otherwise. 81 int _shift; 82 // Generate code with implicit null checks for narrow ptrs. 83 bool _use_implicit_null_checks; 84 }; |