122 static inline oop decode_raw_not_null(narrowOop v);
123 static inline oop decode_raw(narrowOop v);
124 static inline oop decode_not_null(narrowOop v);
125 static inline oop decode(narrowOop v);
126 static inline narrowOop encode_not_null(oop v);
127 static inline narrowOop encode(oop v);
128
129 // No conversions needed for these overloads
130 static inline oop decode_not_null(oop v);
131 static inline oop decode(oop v);
132 static inline narrowOop encode_not_null(narrowOop v);
133 static inline narrowOop encode(narrowOop v);
134
135 static inline uint32_t narrow_oop_value(oop o);
136 static inline uint32_t narrow_oop_value(narrowOop o);
137
138 template<typename T>
139 static inline narrowOop narrow_oop_cast(T i);
140 };
141
142 // For UseCompressedClassPointers.
143 class CompressedKlassPointers : public AllStatic {
144 friend class VMStructs;
145
146 static NarrowPtrStruct _narrow_klass;
147
148 // Together with base, this defines the address range within which Klass
149 // structures will be located: [base, base+range). While the maximal
150 // possible encoding range is 4|32G for shift 0|3, if we know beforehand
151 // the expected range of Klass* pointers will be smaller, a platform
152 // could use this info to optimize encoding.
153 static size_t _range;
154
155 static void set_base(address base);
156 static void set_range(size_t range);
157
158 public:
159
160 static void set_shift(int shift);
161
162
163 // Given an address p, return true if p can be used as an encoding base.
164 // (Some platforms have restrictions of what constitutes a valid base
165 // address).
166 static bool is_valid_base(address p);
167
168 // Given an address range [addr, addr+len) which the encoding is supposed to
169 // cover, choose base, shift and range.
170 // The address range is the expected range of uncompressed Klass pointers we
171 // will encounter (and the implicit promise that there will be no Klass
172 // structures outside this range).
173 static void initialize(address addr, size_t len);
174
175 static void print_mode(outputStream* st);
176
177 static address base() { return _narrow_klass._base; }
178 static size_t range() { return _range; }
179 static int shift() { return _narrow_klass._shift; }
180
181 static bool is_null(Klass* v) { return v == NULL; }
182 static bool is_null(narrowKlass v) { return v == 0; }
183
184 static inline Klass* decode_raw(narrowKlass v, address base);
185 static inline Klass* decode_raw(narrowKlass v);
186 static inline Klass* decode_not_null(narrowKlass v);
187 static inline Klass* decode_not_null(narrowKlass v, address base);
188 static inline Klass* decode(narrowKlass v);
189 static inline narrowKlass encode_not_null(Klass* v);
190 static inline narrowKlass encode_not_null(Klass* v, address base);
191 static inline narrowKlass encode(Klass* v);
192
193 };
194
195 #endif // SHARE_OOPS_COMPRESSEDOOPS_HPP
|
122 static inline oop decode_raw_not_null(narrowOop v);
123 static inline oop decode_raw(narrowOop v);
124 static inline oop decode_not_null(narrowOop v);
125 static inline oop decode(narrowOop v);
126 static inline narrowOop encode_not_null(oop v);
127 static inline narrowOop encode(oop v);
128
129 // No conversions needed for these overloads
130 static inline oop decode_not_null(oop v);
131 static inline oop decode(oop v);
132 static inline narrowOop encode_not_null(narrowOop v);
133 static inline narrowOop encode(narrowOop v);
134
135 static inline uint32_t narrow_oop_value(oop o);
136 static inline uint32_t narrow_oop_value(narrowOop o);
137
138 template<typename T>
139 static inline narrowOop narrow_oop_cast(T i);
140 };
141
142 #endif // SHARE_OOPS_COMPRESSEDOOPS_HPP
|