< prev index next >

src/hotspot/share/oops/compressedOops.inline.hpp

Print this page
@@ -111,52 +111,6 @@
    // Ensure no bits lost in conversion to uint32_t.
    assert(i == static_cast<T>(narrow_value), "narrowOop overflow");
    return static_cast<narrowOop>(narrow_value);
  }
  
- static inline bool check_alignment(Klass* v) {
-   return (intptr_t)v % KlassAlignmentInBytes == 0;
- }
- 
- inline Klass* CompressedKlassPointers::decode_raw(narrowKlass v) {
-   return decode_raw(v, base());
- }
- 
- inline Klass* CompressedKlassPointers::decode_raw(narrowKlass v, address narrow_base) {
-   return (Klass*)(void*)((uintptr_t)narrow_base +((uintptr_t)v << shift()));
- }
- 
- inline Klass* CompressedKlassPointers::decode_not_null(narrowKlass v) {
-   return decode_not_null(v, base());
- }
- 
- inline Klass* CompressedKlassPointers::decode_not_null(narrowKlass v, address narrow_base) {
-   assert(!is_null(v), "narrow klass value can never be zero");
-   Klass* result = decode_raw(v, narrow_base);
-   assert(check_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result));
-   return result;
- }
- 
- inline Klass* CompressedKlassPointers::decode(narrowKlass v) {
-   return is_null(v) ? (Klass*)NULL : decode_not_null(v);
- }
- 
- inline narrowKlass CompressedKlassPointers::encode_not_null(Klass* v) {
-   return encode_not_null(v, base());
- }
- 
- inline narrowKlass CompressedKlassPointers::encode_not_null(Klass* v, address narrow_base) {
-   assert(!is_null(v), "klass value can never be zero");
-   assert(check_alignment(v), "Address not aligned");
-   uint64_t pd = (uint64_t)(pointer_delta((void*)v, narrow_base, 1));
-   assert(KlassEncodingMetaspaceMax > pd, "change encoding max if new encoding");
-   uint64_t result = pd >> shift();
-   assert((result & CONST64(0xffffffff00000000)) == 0, "narrow klass pointer overflow");
-   assert(decode_not_null(result, narrow_base) == v, "reversibility");
-   return (narrowKlass)result;
- }
- 
- inline narrowKlass CompressedKlassPointers::encode(Klass* v) {
-   return is_null(v) ? (narrowKlass)0 : encode_not_null(v);
- }
- 
  #endif // SHARE_OOPS_COMPRESSEDOOPS_INLINE_HPP
< prev index next >