< prev index next >

src/hotspot/share/oops/oopHandle.hpp

Print this page

49 
50   OopHandle& operator=(const OopHandle& copy) {
51     // Allow "this" to be junk if copy is empty; needed by initialization of
52     // raw memory in hashtables.
53     assert(is_empty() || copy.is_empty(), "can only copy if empty");
54     _obj = copy._obj;
55     return *this;
56   }
57 
58   inline oop resolve() const;
59   inline oop peek() const;
60 
61   bool is_empty() const { return _obj == NULL; }
62 
63   inline void release(OopStorage* storage);
64 
65   inline void replace(oop obj);
66 
67   inline oop xchg(oop new_value);
68 
69   // Used only for removing handle.
70   oop* ptr_raw() const { return _obj; }
71 };
72 
73 // Convert OopHandle to oop*
74 
75 template<>
76 struct PrimitiveConversions::Translate<OopHandle> : public TrueType {
77   typedef OopHandle Value;
78   typedef oop* Decayed;
79 
80   static Decayed decay(Value x) { return x.ptr_raw(); }
81   static Value recover(Decayed x) { return OopHandle(x); }
82 };
83 
84 #endif // SHARE_OOPS_OOPHANDLE_HPP

49 
50   OopHandle& operator=(const OopHandle& copy) {
51     // Allow "this" to be junk if copy is empty; needed by initialization of
52     // raw memory in hashtables.
53     assert(is_empty() || copy.is_empty(), "can only copy if empty");
54     _obj = copy._obj;
55     return *this;
56   }
57 
58   inline oop resolve() const;
59   inline oop peek() const;
60 
61   bool is_empty() const { return _obj == NULL; }
62 
63   inline void release(OopStorage* storage);
64 
65   inline void replace(oop obj);
66 
67   inline oop xchg(oop new_value);
68 

69   oop* ptr_raw() const { return _obj; }
70 };
71 
72 // Convert OopHandle to oop*
73 
74 template<>
75 struct PrimitiveConversions::Translate<OopHandle> : public TrueType {
76   typedef OopHandle Value;
77   typedef oop* Decayed;
78 
79   static Decayed decay(Value x) { return x.ptr_raw(); }
80   static Value recover(Decayed x) { return OopHandle(x); }
81 };
82 
83 #endif // SHARE_OOPS_OOPHANDLE_HPP
< prev index next >