8145628: hotspot metadata classes shouldn't use HeapWordSize or heap related macros like align_object_size

Use align_metadata_size, align_metadata_offset and is_metadata_aligned for metadata rather than align_object_size, etc.  Use wordSize rather than HeapWordSize for metadata.  Use align_ptr_up rather than align_pointer_up (all the related functions are ptr).

Reviewed-by: hseigel, jmasa, cjplummer
This commit is contained in:
Coleen Phillimore 2016-01-30 11:02:29 -05:00
parent ec7fb4ee2b
commit 97e169ac77
36 changed files with 108 additions and 106 deletions

View file

@ -94,10 +94,10 @@ class OopMapBlock VALUE_OBJ_CLASS_SPEC {
uint count() const { return _count; }
void set_count(uint count) { _count = count; }
// sizeof(OopMapBlock) in HeapWords.
// sizeof(OopMapBlock) in words.
static const int size_in_words() {
return align_size_up(int(sizeof(OopMapBlock)), HeapWordSize) >>
LogHeapWordSize;
return align_size_up(int(sizeof(OopMapBlock)), wordSize) >>
LogBytesPerWord;
}
private:
@ -927,17 +927,17 @@ public:
}
// Sizing (in words)
static int header_size() { return sizeof(InstanceKlass)/HeapWordSize; }
static int header_size() { return sizeof(InstanceKlass)/wordSize; }
static int size(int vtable_length, int itable_length,
int nonstatic_oop_map_size,
bool is_interface, bool is_anonymous) {
return align_object_size(header_size() +
return align_metadata_size(header_size() +
vtable_length +
itable_length +
nonstatic_oop_map_size +
(is_interface ? (int)sizeof(Klass*)/HeapWordSize : 0) +
(is_anonymous ? (int)sizeof(Klass*)/HeapWordSize : 0));
(is_interface ? (int)sizeof(Klass*)/wordSize : 0) +
(is_anonymous ? (int)sizeof(Klass*)/wordSize : 0));
}
int size() const { return size(vtable_length(),
itable_length(),