< prev index next >

src/hotspot/share/gc/cms/freeChunk.hpp

Print this page

        

*** 24,34 **** #ifndef SHARE_GC_CMS_FREECHUNK_HPP #define SHARE_GC_CMS_FREECHUNK_HPP #include "memory/memRegion.hpp" ! #include "oops/markWord.hpp" #include "runtime/mutex.hpp" #include "runtime/orderAccess.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" --- 24,34 ---- #ifndef SHARE_GC_CMS_FREECHUNK_HPP #define SHARE_GC_CMS_FREECHUNK_HPP #include "memory/memRegion.hpp" ! #include "oops/markOop.hpp" #include "runtime/mutex.hpp" #include "runtime/orderAccess.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp"
*** 54,71 **** // but are not part of the free list and should not be coalesced into larger // free blocks. These free blocks have their two LSB's set. class FreeChunk { friend class VMStructs; ! // For 64 bit compressed oops, the markWord encodes both the size and the // indication that this is a FreeChunk and not an object. volatile size_t _size; FreeChunk* _prev; FreeChunk* _next; ! markWord mark() const volatile { return markWord((uintptr_t)_size); } ! void set_mark(markWord m) { _size = (size_t)m.value(); } public: NOT_PRODUCT(static const size_t header_size();) // Returns "true" if the address indicates that the block represents --- 54,71 ---- // but are not part of the free list and should not be coalesced into larger // free blocks. These free blocks have their two LSB's set. class FreeChunk { friend class VMStructs; ! // For 64 bit compressed oops, the markOop encodes both the size and the // indication that this is a FreeChunk and not an object. volatile size_t _size; FreeChunk* _prev; FreeChunk* _next; ! markOop mark() const volatile { return (markOop)_size; } ! void set_mark(markOop m) { _size = (size_t)m; } public: NOT_PRODUCT(static const size_t header_size();) // Returns "true" if the address indicates that the block represents
*** 77,87 **** // compilation errors. return ((volatile FreeChunk*)addr)->is_free(); } bool is_free() const volatile { ! LP64_ONLY(if (UseCompressedOops) return mark().is_cms_free_chunk(); else) return (((intptr_t)_prev) & 0x1) == 0x1; } bool cantCoalesce() const { assert(is_free(), "can't get coalesce bit on not free"); return (((intptr_t)_prev) & 0x2) == 0x2; --- 77,87 ---- // compilation errors. return ((volatile FreeChunk*)addr)->is_free(); } bool is_free() const volatile { ! LP64_ONLY(if (UseCompressedOops) return mark()->is_cms_free_chunk(); else) return (((intptr_t)_prev) & 0x1) == 0x1; } bool cantCoalesce() const { assert(is_free(), "can't get coalesce bit on not free"); return (((intptr_t)_prev) & 0x2) == 0x2;
*** 98,112 **** debug_only(void* prev_addr() const { return (void*)&_prev; }) debug_only(void* next_addr() const { return (void*)&_next; }) debug_only(void* size_addr() const { return (void*)&_size; }) size_t size() const volatile { ! LP64_ONLY(if (UseCompressedOops) return mark().get_size(); else ) return _size; } void set_size(size_t sz) { ! LP64_ONLY(if (UseCompressedOops) set_mark(markWord::set_size_and_free(sz)); else ) _size = sz; } FreeChunk* next() const { return _next; } --- 98,112 ---- debug_only(void* prev_addr() const { return (void*)&_prev; }) debug_only(void* next_addr() const { return (void*)&_next; }) debug_only(void* size_addr() const { return (void*)&_size; }) size_t size() const volatile { ! LP64_ONLY(if (UseCompressedOops) return mark()->get_size(); else ) return _size; } void set_size(size_t sz) { ! LP64_ONLY(if (UseCompressedOops) set_mark(markOopDesc::set_size_and_free(sz)); else ) _size = sz; } FreeChunk* next() const { return _next; }
*** 124,134 **** // Set _prev (klass) to null before (if) clearing the mark word below _prev = NULL; #ifdef _LP64 if (UseCompressedOops) { OrderAccess::storestore(); ! set_mark(markWord::prototype()); } #endif assert(!is_free(), "Error"); } --- 124,134 ---- // Set _prev (klass) to null before (if) clearing the mark word below _prev = NULL; #ifdef _LP64 if (UseCompressedOops) { OrderAccess::storestore(); ! set_mark(markOopDesc::prototype()); } #endif assert(!is_free(), "Error"); }
< prev index next >