< prev index next >

src/hotspot/share/gc/z/zUtils.inline.hpp

Print this page

29 #include "gc/z/zOop.inline.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "utilities/align.hpp"
32 #include "utilities/copy.hpp"
33 #include "utilities/debug.hpp"
34 #include "utilities/globalDefinitions.hpp"
35 
36 inline size_t ZUtils::bytes_to_words(size_t size_in_bytes) {
37   assert(is_aligned(size_in_bytes, BytesPerWord), "Size not word aligned");
38   return size_in_bytes >> LogBytesPerWord;
39 }
40 
41 inline size_t ZUtils::words_to_bytes(size_t size_in_words) {
42   return size_in_words << LogBytesPerWord;
43 }
44 
45 inline size_t ZUtils::object_size(uintptr_t addr) {
46   return words_to_bytes(ZOop::from_address(addr)->size());
47 }
48 




49 inline void ZUtils::object_copy_disjoint(uintptr_t from, uintptr_t to, size_t size) {
50   Copy::aligned_disjoint_words((HeapWord*)from, (HeapWord*)to, bytes_to_words(size));
51 }
52 
53 inline void ZUtils::object_copy_conjoint(uintptr_t from, uintptr_t to, size_t size) {
54   if (from != to) {
55     Copy::aligned_conjoint_words((HeapWord*)from, (HeapWord*)to, bytes_to_words(size));










56   }
57 }
58 
59 #endif // SHARE_GC_Z_ZUTILS_INLINE_HPP

29 #include "gc/z/zOop.inline.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "utilities/align.hpp"
32 #include "utilities/copy.hpp"
33 #include "utilities/debug.hpp"
34 #include "utilities/globalDefinitions.hpp"
35 
36 inline size_t ZUtils::bytes_to_words(size_t size_in_bytes) {
37   assert(is_aligned(size_in_bytes, BytesPerWord), "Size not word aligned");
38   return size_in_bytes >> LogBytesPerWord;
39 }
40 
41 inline size_t ZUtils::words_to_bytes(size_t size_in_words) {
42   return size_in_words << LogBytesPerWord;
43 }
44 
45 inline size_t ZUtils::object_size(uintptr_t addr) {
46   return words_to_bytes(ZOop::from_address(addr)->size());
47 }
48 
49 inline size_t ZUtils::object_compact_size(uintptr_t addr) {
50   return words_to_bytes(ZOop::from_address(addr)->compact_size());
51 }
52 
53 inline void ZUtils::object_copy_disjoint(uintptr_t from, uintptr_t to, size_t size) {
54   ZOop::from_address(from)->copy_disjoint((HeapWord*)to, bytes_to_words(size));
55 }
56 
57 inline void ZUtils::object_copy_conjoint(uintptr_t from, uintptr_t to, size_t size) {
58   if (from != to) {
59     ZOop::from_address(from)->copy_conjoint((HeapWord*)to, bytes_to_words(size));
60   }
61 }
62 
63 inline void ZUtils::object_copy_disjoint_compact(uintptr_t from, uintptr_t to, size_t size) {
64   ZOop::from_address(from)->copy_disjoint_compact((HeapWord*)to, bytes_to_words(size));
65 }
66 
67 inline void ZUtils::object_copy_conjoint_compact(uintptr_t from, uintptr_t to, size_t size) {
68   if (from != to) {
69     ZOop::from_address(from)->copy_conjoint_compact((HeapWord*)to, bytes_to_words(size));
70   }
71 }
72 
73 #endif // SHARE_GC_Z_ZUTILS_INLINE_HPP
< prev index next >