869 return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset :
870 value_offset;
871 }
872
873 // Debugging
874 friend class JavaClasses;
875 };
876
877
878
879 // Interface to java.lang.ref.Reference objects
880
881 class java_lang_ref_Reference: AllStatic {
882 public:
883 enum {
884 hc_referent_offset = 0,
885 hc_queue_offset = 1,
886 hc_next_offset = 2,
887 hc_discovered_offset = 3 // Is not last, see SoftRefs.
888 };
889 enum {
890 hc_static_lock_offset = 0,
891 hc_static_pending_offset = 1
892 };
893
894 static int referent_offset;
895 static int queue_offset;
896 static int next_offset;
897 static int discovered_offset;
898 static int static_lock_offset;
899 static int static_pending_offset;
900 static int number_of_fake_oop_fields;
901
902 // Accessors
903 static inline oop referent(oop ref);
904 static inline void set_referent(oop ref, oop value);
905 static inline void set_referent_raw(oop ref, oop value);
906 static inline HeapWord* referent_addr(oop ref);
907 static inline oop next(oop ref);
908 static inline void set_next(oop ref, oop value);
909 static inline void set_next_raw(oop ref, oop value);
910 static inline HeapWord* next_addr(oop ref);
911 static inline oop discovered(oop ref);
912 static inline void set_discovered(oop ref, oop value);
913 static inline void set_discovered_raw(oop ref, oop value);
914 static inline HeapWord* discovered_addr(oop ref);
915
916 // Accessors for statics
917 static oop pending_list_lock();
918 static oop pending_list();
919
920 static HeapWord* pending_list_lock_addr();
921 static HeapWord* pending_list_addr();
922 };
923
924
925 // Interface to java.lang.ref.SoftReference objects
926
927 class java_lang_ref_SoftReference: public java_lang_ref_Reference {
928 public:
929 enum {
930 // The timestamp is a long field and may need to be adjusted for alignment.
931 hc_timestamp_offset = hc_discovered_offset + 1
932 };
933 enum {
934 hc_static_clock_offset = 0
935 };
936
937 static int timestamp_offset;
938 static int static_clock_offset;
939
940 // Accessors
941 static jlong timestamp(oop ref);
|
869 return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset :
870 value_offset;
871 }
872
873 // Debugging
874 friend class JavaClasses;
875 };
876
877
878
879 // Interface to java.lang.ref.Reference objects
880
881 class java_lang_ref_Reference: AllStatic {
882 public:
883 enum {
884 hc_referent_offset = 0,
885 hc_queue_offset = 1,
886 hc_next_offset = 2,
887 hc_discovered_offset = 3 // Is not last, see SoftRefs.
888 };
889
890 static int referent_offset;
891 static int queue_offset;
892 static int next_offset;
893 static int discovered_offset;
894 static int number_of_fake_oop_fields;
895
896 // Accessors
897 static inline oop referent(oop ref);
898 static inline void set_referent(oop ref, oop value);
899 static inline void set_referent_raw(oop ref, oop value);
900 static inline HeapWord* referent_addr(oop ref);
901 static inline oop next(oop ref);
902 static inline void set_next(oop ref, oop value);
903 static inline void set_next_raw(oop ref, oop value);
904 static inline HeapWord* next_addr(oop ref);
905 static inline oop discovered(oop ref);
906 static inline void set_discovered(oop ref, oop value);
907 static inline void set_discovered_raw(oop ref, oop value);
908 static inline HeapWord* discovered_addr(oop ref);
909 };
910
911
912 // Interface to java.lang.ref.SoftReference objects
913
914 class java_lang_ref_SoftReference: public java_lang_ref_Reference {
915 public:
916 enum {
917 // The timestamp is a long field and may need to be adjusted for alignment.
918 hc_timestamp_offset = hc_discovered_offset + 1
919 };
920 enum {
921 hc_static_clock_offset = 0
922 };
923
924 static int timestamp_offset;
925 static int static_clock_offset;
926
927 // Accessors
928 static jlong timestamp(oop ref);
|