8015107: NPG: Use consistent naming for metaspace concepts
Reviewed-by: coleenp, mgerdin, hseigel
This commit is contained in:
parent
7e04c1775c
commit
30f059b5fc
@ -792,7 +792,7 @@ public class VM {
|
||||
|
||||
public boolean isCompressedKlassPointersEnabled() {
|
||||
if (compressedKlassPointersEnabled == null) {
|
||||
Flag flag = getCommandLineFlag("UseCompressedKlassPointers");
|
||||
Flag flag = getCommandLineFlag("UseCompressedClassPointers");
|
||||
compressedKlassPointersEnabled = (flag == null) ? Boolean.FALSE:
|
||||
(flag.getBool()? Boolean.TRUE: Boolean.FALSE);
|
||||
}
|
||||
|
@ -66,18 +66,18 @@ public class HeapSummary extends Tool {
|
||||
printGCAlgorithm(flagMap);
|
||||
System.out.println();
|
||||
System.out.println("Heap Configuration:");
|
||||
printValue("MinHeapFreeRatio = ", getFlagValue("MinHeapFreeRatio", flagMap));
|
||||
printValue("MaxHeapFreeRatio = ", getFlagValue("MaxHeapFreeRatio", flagMap));
|
||||
printValMB("MaxHeapSize = ", getFlagValue("MaxHeapSize", flagMap));
|
||||
printValMB("NewSize = ", getFlagValue("NewSize", flagMap));
|
||||
printValMB("MaxNewSize = ", getFlagValue("MaxNewSize", flagMap));
|
||||
printValMB("OldSize = ", getFlagValue("OldSize", flagMap));
|
||||
printValue("NewRatio = ", getFlagValue("NewRatio", flagMap));
|
||||
printValue("SurvivorRatio = ", getFlagValue("SurvivorRatio", flagMap));
|
||||
printValMB("MetaspaceSize = ", getFlagValue("MetaspaceSize", flagMap));
|
||||
printValMB("ClassMetaspaceSize = ", getFlagValue("ClassMetaspaceSize", flagMap));
|
||||
printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap));
|
||||
printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes());
|
||||
printValue("MinHeapFreeRatio = ", getFlagValue("MinHeapFreeRatio", flagMap));
|
||||
printValue("MaxHeapFreeRatio = ", getFlagValue("MaxHeapFreeRatio", flagMap));
|
||||
printValMB("MaxHeapSize = ", getFlagValue("MaxHeapSize", flagMap));
|
||||
printValMB("NewSize = ", getFlagValue("NewSize", flagMap));
|
||||
printValMB("MaxNewSize = ", getFlagValue("MaxNewSize", flagMap));
|
||||
printValMB("OldSize = ", getFlagValue("OldSize", flagMap));
|
||||
printValue("NewRatio = ", getFlagValue("NewRatio", flagMap));
|
||||
printValue("SurvivorRatio = ", getFlagValue("SurvivorRatio", flagMap));
|
||||
printValMB("MetaspaceSize = ", getFlagValue("MetaspaceSize", flagMap));
|
||||
printValMB("CompressedClassSpaceSize = ", getFlagValue("CompressedClassSpaceSize", flagMap));
|
||||
printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap));
|
||||
printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes());
|
||||
|
||||
System.out.println();
|
||||
System.out.println("Heap Usage:");
|
||||
|
@ -105,7 +105,7 @@ bool LIR_Assembler::is_single_instruction(LIR_Op* op) {
|
||||
if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
|
||||
}
|
||||
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
if (src->is_address() && !src->is_stack() && src->type() == T_ADDRESS &&
|
||||
src->as_address_ptr()->disp() == oopDesc::klass_offset_in_bytes()) return false;
|
||||
}
|
||||
@ -963,7 +963,7 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
|
||||
case T_METADATA: __ ld_ptr(base, offset, to_reg->as_register()); break;
|
||||
case T_ADDRESS:
|
||||
#ifdef _LP64
|
||||
if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedKlassPointers) {
|
||||
if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedClassPointers) {
|
||||
__ lduw(base, offset, to_reg->as_register());
|
||||
__ decode_klass_not_null(to_reg->as_register());
|
||||
} else
|
||||
@ -2208,7 +2208,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
// We don't know the array types are compatible
|
||||
if (basic_type != T_OBJECT) {
|
||||
// Simple test for basic type arrays
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
// We don't need decode because we just need to compare
|
||||
__ lduw(src, oopDesc::klass_offset_in_bytes(), tmp);
|
||||
__ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
|
||||
@ -2342,7 +2342,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
// but not necessarily exactly of type default_type.
|
||||
Label known_ok, halt;
|
||||
metadata2reg(op->expected_type()->constant_encoding(), tmp);
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
// tmp holds the default type. It currently comes uncompressed after the
|
||||
// load of a constant, so encode it.
|
||||
__ encode_klass_not_null(tmp);
|
||||
|
@ -186,7 +186,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
|
||||
set((intx)markOopDesc::prototype(), t1);
|
||||
}
|
||||
st_ptr(t1, obj, oopDesc::mark_offset_in_bytes());
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
// Save klass
|
||||
mov(klass, t1);
|
||||
encode_klass_not_null(t1);
|
||||
@ -196,7 +196,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
|
||||
}
|
||||
if (len->is_valid()) {
|
||||
st(len, obj, arrayOopDesc::length_offset_in_bytes());
|
||||
} else if (UseCompressedKlassPointers) {
|
||||
} else if (UseCompressedClassPointers) {
|
||||
// otherwise length is in the class gap
|
||||
store_klass_gap(G0, obj);
|
||||
}
|
||||
|
@ -3911,7 +3911,7 @@ void MacroAssembler::load_klass(Register src_oop, Register klass) {
|
||||
// The number of bytes in this code is used by
|
||||
// MachCallDynamicJavaNode::ret_addr_offset()
|
||||
// if this changes, change that.
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
lduw(src_oop, oopDesc::klass_offset_in_bytes(), klass);
|
||||
decode_klass_not_null(klass);
|
||||
} else {
|
||||
@ -3920,7 +3920,7 @@ void MacroAssembler::load_klass(Register src_oop, Register klass) {
|
||||
}
|
||||
|
||||
void MacroAssembler::store_klass(Register klass, Register dst_oop) {
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
assert(dst_oop != klass, "not enough registers");
|
||||
encode_klass_not_null(klass);
|
||||
st(klass, dst_oop, oopDesc::klass_offset_in_bytes());
|
||||
@ -3930,7 +3930,7 @@ void MacroAssembler::store_klass(Register klass, Register dst_oop) {
|
||||
}
|
||||
|
||||
void MacroAssembler::store_klass_gap(Register s, Register d) {
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
assert(s != d, "not enough registers");
|
||||
st(s, d, oopDesc::klass_gap_offset_in_bytes());
|
||||
}
|
||||
@ -4089,7 +4089,7 @@ void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) {
|
||||
}
|
||||
|
||||
void MacroAssembler::encode_klass_not_null(Register r) {
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (UseCompressedClassPointers, "must be compressed");
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
assert(r != G6_heapbase, "bad register choice");
|
||||
set((intptr_t)Universe::narrow_klass_base(), G6_heapbase);
|
||||
@ -4105,7 +4105,7 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) {
|
||||
if (src == dst) {
|
||||
encode_klass_not_null(src);
|
||||
} else {
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (UseCompressedClassPointers, "must be compressed");
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
set((intptr_t)Universe::narrow_klass_base(), dst);
|
||||
sub(src, dst, dst);
|
||||
@ -4119,7 +4119,7 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) {
|
||||
// generated by decode_klass_not_null() and reinit_heapbase(). Hence, if
|
||||
// the instructions they generate change, then this method needs to be updated.
|
||||
int MacroAssembler::instr_size_for_decode_klass_not_null() {
|
||||
assert (UseCompressedKlassPointers, "only for compressed klass ptrs");
|
||||
assert (UseCompressedClassPointers, "only for compressed klass ptrs");
|
||||
// set + add + set
|
||||
int num_instrs = insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + 1 +
|
||||
insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base());
|
||||
@ -4135,7 +4135,7 @@ int MacroAssembler::instr_size_for_decode_klass_not_null() {
|
||||
void MacroAssembler::decode_klass_not_null(Register r) {
|
||||
// Do not add assert code to this unless you change vtableStubs_sparc.cpp
|
||||
// pd_code_size_limit.
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (UseCompressedClassPointers, "must be compressed");
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
assert(r != G6_heapbase, "bad register choice");
|
||||
set((intptr_t)Universe::narrow_klass_base(), G6_heapbase);
|
||||
@ -4151,7 +4151,7 @@ void MacroAssembler::decode_klass_not_null(Register src, Register dst) {
|
||||
} else {
|
||||
// Do not add assert code to this unless you change vtableStubs_sparc.cpp
|
||||
// pd_code_size_limit.
|
||||
assert (UseCompressedKlassPointers, "must be compressed");
|
||||
assert (UseCompressedClassPointers, "must be compressed");
|
||||
assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized");
|
||||
if (Universe::narrow_klass_shift() != 0) {
|
||||
assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice");
|
||||
@ -4167,7 +4167,7 @@ void MacroAssembler::decode_klass_not_null(Register src, Register dst) {
|
||||
}
|
||||
|
||||
void MacroAssembler::reinit_heapbase() {
|
||||
if (UseCompressedOops || UseCompressedKlassPointers) {
|
||||
if (UseCompressedOops || UseCompressedClassPointers) {
|
||||
if (Universe::heap() != NULL) {
|
||||
set((intptr_t)Universe::narrow_ptrs_base(), G6_heapbase);
|
||||
} else {
|
||||
|
@ -557,7 +557,7 @@ int MachCallDynamicJavaNode::ret_addr_offset() {
|
||||
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
|
||||
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
|
||||
int klass_load_size;
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||
klass_load_size = MacroAssembler::instr_size_for_decode_klass_not_null() + 1*BytesPerInstWord;
|
||||
} else {
|
||||
@ -1657,7 +1657,7 @@ uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
|
||||
void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
|
||||
st->print_cr("\nUEP:");
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||
st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass");
|
||||
st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base");
|
||||
@ -1897,7 +1897,7 @@ bool Matcher::narrow_oop_use_complex_address() {
|
||||
|
||||
bool Matcher::narrow_klass_use_complex_address() {
|
||||
NOT_LP64(ShouldNotCallThis());
|
||||
assert(UseCompressedKlassPointers, "only for compressed klass code");
|
||||
assert(UseCompressedClassPointers, "only for compressed klass code");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2561,7 +2561,7 @@ encode %{
|
||||
int off = __ offset();
|
||||
__ load_klass(O0, G3_scratch);
|
||||
int klass_load_size;
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||
klass_load_size = MacroAssembler::instr_size_for_decode_klass_not_null() + 1*BytesPerInstWord;
|
||||
} else {
|
||||
|
@ -2945,7 +2945,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
BLOCK_COMMENT("arraycopy argument klass checks");
|
||||
// get src->klass()
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ delayed()->nop(); // ??? not good
|
||||
__ load_klass(src, G3_src_klass);
|
||||
} else {
|
||||
@ -2980,7 +2980,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Load 32-bits signed value. Use br() instruction with it to check icc.
|
||||
__ lduw(G3_src_klass, lh_offset, G5_lh);
|
||||
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ load_klass(dst, G4_dst_klass);
|
||||
}
|
||||
// Handle objArrays completely differently...
|
||||
@ -2988,7 +2988,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ set(objArray_lh, O5_temp);
|
||||
__ cmp(G5_lh, O5_temp);
|
||||
__ br(Assembler::equal, false, Assembler::pt, L_objArray);
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ delayed()->nop();
|
||||
} else {
|
||||
__ delayed()->ld_ptr(dst, oopDesc::klass_offset_in_bytes(), G4_dst_klass);
|
||||
|
@ -218,13 +218,13 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
|
||||
// ld;ld;ld,jmp,nop
|
||||
const int basic = 5*BytesPerInstWord +
|
||||
// shift;add for load_klass (only shift with zero heap based)
|
||||
(UseCompressedKlassPointers ?
|
||||
(UseCompressedClassPointers ?
|
||||
MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
return basic + slop;
|
||||
} else {
|
||||
const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord +
|
||||
// shift;add for load_klass (only shift with zero heap based)
|
||||
(UseCompressedKlassPointers ?
|
||||
(UseCompressedClassPointers ?
|
||||
MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
return (basic + slop);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@
|
||||
|
||||
static int adjust_reg_range(int range) {
|
||||
// Reduce the number of available regs (to free r12) in case of compressed oops
|
||||
if (UseCompressedOops || UseCompressedKlassPointers) return range - 1;
|
||||
if (UseCompressedOops || UseCompressedClassPointers) return range - 1;
|
||||
return range;
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ int LIR_Assembler::check_icache() {
|
||||
Register receiver = FrameMap::receiver_opr->as_register();
|
||||
Register ic_klass = IC_Klass;
|
||||
const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
|
||||
const bool do_post_padding = VerifyOops || UseCompressedKlassPointers;
|
||||
const bool do_post_padding = VerifyOops || UseCompressedClassPointers;
|
||||
if (!do_post_padding) {
|
||||
// insert some nops so that the verified entry point is aligned on CodeEntryAlignment
|
||||
while ((__ offset() + ic_cmp_size) % CodeEntryAlignment != 0) {
|
||||
@ -1263,7 +1263,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
|
||||
break;
|
||||
|
||||
case T_ADDRESS:
|
||||
if (UseCompressedKlassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) {
|
||||
if (UseCompressedClassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) {
|
||||
__ movl(dest->as_register(), from_addr);
|
||||
} else {
|
||||
__ movptr(dest->as_register(), from_addr);
|
||||
@ -1371,7 +1371,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
|
||||
__ verify_oop(dest->as_register());
|
||||
} else if (type == T_ADDRESS && addr->disp() == oopDesc::klass_offset_in_bytes()) {
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ decode_klass_not_null(dest->as_register());
|
||||
}
|
||||
#endif
|
||||
@ -1716,7 +1716,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
} else if (obj == klass_RInfo) {
|
||||
klass_RInfo = dst;
|
||||
}
|
||||
if (k->is_loaded() && !UseCompressedKlassPointers) {
|
||||
if (k->is_loaded() && !UseCompressedClassPointers) {
|
||||
select_different_registers(obj, dst, k_RInfo, klass_RInfo);
|
||||
} else {
|
||||
Rtmp1 = op->tmp3()->as_register();
|
||||
@ -1754,7 +1754,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
// get object class
|
||||
// not a safepoint as obj null check happens earlier
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ load_klass(Rtmp1, obj);
|
||||
__ cmpptr(k_RInfo, Rtmp1);
|
||||
} else {
|
||||
@ -3294,7 +3294,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
// We don't know the array types are compatible
|
||||
if (basic_type != T_OBJECT) {
|
||||
// Simple test for basic type arrays
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ movl(tmp, src_klass_addr);
|
||||
__ cmpl(tmp, dst_klass_addr);
|
||||
} else {
|
||||
@ -3456,21 +3456,21 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
Label known_ok, halt;
|
||||
__ mov_metadata(tmp, default_type->constant_encoding());
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
__ encode_klass_not_null(tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (basic_type != T_OBJECT) {
|
||||
|
||||
if (UseCompressedKlassPointers) __ cmpl(tmp, dst_klass_addr);
|
||||
if (UseCompressedClassPointers) __ cmpl(tmp, dst_klass_addr);
|
||||
else __ cmpptr(tmp, dst_klass_addr);
|
||||
__ jcc(Assembler::notEqual, halt);
|
||||
if (UseCompressedKlassPointers) __ cmpl(tmp, src_klass_addr);
|
||||
if (UseCompressedClassPointers) __ cmpl(tmp, src_klass_addr);
|
||||
else __ cmpptr(tmp, src_klass_addr);
|
||||
__ jcc(Assembler::equal, known_ok);
|
||||
} else {
|
||||
if (UseCompressedKlassPointers) __ cmpl(tmp, dst_klass_addr);
|
||||
if (UseCompressedClassPointers) __ cmpl(tmp, dst_klass_addr);
|
||||
else __ cmpptr(tmp, dst_klass_addr);
|
||||
__ jcc(Assembler::equal, known_ok);
|
||||
__ cmpptr(src, dst);
|
||||
|
@ -1239,7 +1239,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
|
||||
}
|
||||
LIR_Opr reg = rlock_result(x);
|
||||
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
|
||||
if (!x->klass()->is_loaded() || UseCompressedKlassPointers) {
|
||||
if (!x->klass()->is_loaded() || UseCompressedClassPointers) {
|
||||
tmp3 = new_register(objectType);
|
||||
}
|
||||
__ checkcast(reg, obj.result(), x->klass(),
|
||||
@ -1261,7 +1261,7 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) {
|
||||
}
|
||||
obj.load_item();
|
||||
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
|
||||
if (!x->klass()->is_loaded() || UseCompressedKlassPointers) {
|
||||
if (!x->klass()->is_loaded() || UseCompressedClassPointers) {
|
||||
tmp3 = new_register(objectType);
|
||||
}
|
||||
__ instanceof(reg, obj.result(), x->klass(),
|
||||
|
@ -157,7 +157,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
|
||||
movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype());
|
||||
}
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) { // Take care not to kill klass
|
||||
if (UseCompressedClassPointers) { // Take care not to kill klass
|
||||
movptr(t1, klass);
|
||||
encode_klass_not_null(t1);
|
||||
movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
|
||||
@ -171,7 +171,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
|
||||
movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len);
|
||||
}
|
||||
#ifdef _LP64
|
||||
else if (UseCompressedKlassPointers) {
|
||||
else if (UseCompressedClassPointers) {
|
||||
xorptr(t1, t1);
|
||||
store_klass_gap(obj, t1);
|
||||
}
|
||||
@ -334,7 +334,7 @@ void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
|
||||
assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check");
|
||||
int start_offset = offset();
|
||||
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
load_klass(rscratch1, receiver);
|
||||
cmpptr(rscratch1, iCache);
|
||||
} else {
|
||||
@ -345,7 +345,7 @@ void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
|
||||
jump_cc(Assembler::notEqual,
|
||||
RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
|
||||
const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
|
||||
assert(UseCompressedKlassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
|
||||
assert(UseCompressedClassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1635,7 +1635,7 @@ void MacroAssembler::call_VM_base(Register oop_result,
|
||||
#ifdef ASSERT
|
||||
// TraceBytecodes does not use r12 but saves it over the call, so don't verify
|
||||
// r12 is the heapbase.
|
||||
LP64_ONLY(if ((UseCompressedOops || UseCompressedKlassPointers) && !TraceBytecodes) verify_heapbase("call_VM_base: heap base corrupted?");)
|
||||
LP64_ONLY(if ((UseCompressedOops || UseCompressedClassPointers) && !TraceBytecodes) verify_heapbase("call_VM_base: heap base corrupted?");)
|
||||
#endif // ASSERT
|
||||
|
||||
assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result");
|
||||
@ -4802,7 +4802,7 @@ void MacroAssembler::restore_cpu_control_state_after_jni() {
|
||||
|
||||
void MacroAssembler::load_klass(Register dst, Register src) {
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
decode_klass_not_null(dst);
|
||||
} else
|
||||
@ -4817,7 +4817,7 @@ void MacroAssembler::load_prototype_header(Register dst, Register src) {
|
||||
|
||||
void MacroAssembler::store_klass(Register dst, Register src) {
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
encode_klass_not_null(src);
|
||||
movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);
|
||||
} else
|
||||
@ -4892,7 +4892,7 @@ void MacroAssembler::store_heap_oop_null(Address dst) {
|
||||
|
||||
#ifdef _LP64
|
||||
void MacroAssembler::store_klass_gap(Register dst, Register src) {
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
// Store to klass gap in destination
|
||||
movl(Address(dst, oopDesc::klass_gap_offset_in_bytes()), src);
|
||||
}
|
||||
@ -5075,7 +5075,7 @@ void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
|
||||
// when (Universe::heap() != NULL). Hence, if the instructions they
|
||||
// generate change, then this method needs to be updated.
|
||||
int MacroAssembler::instr_size_for_decode_klass_not_null() {
|
||||
assert (UseCompressedKlassPointers, "only for compressed klass ptrs");
|
||||
assert (UseCompressedClassPointers, "only for compressed klass ptrs");
|
||||
// mov64 + addq + shlq? + mov64 (for reinit_heapbase()).
|
||||
return (Universe::narrow_klass_shift() == 0 ? 20 : 24);
|
||||
}
|
||||
@ -5085,7 +5085,7 @@ int MacroAssembler::instr_size_for_decode_klass_not_null() {
|
||||
void MacroAssembler::decode_klass_not_null(Register r) {
|
||||
// Note: it will change flags
|
||||
assert(Universe::narrow_klass_base() != NULL, "Base should be initialized");
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert (UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
assert(r != r12_heapbase, "Decoding a klass in r12");
|
||||
// Cannot assert, unverified entry point counts instructions (see .ad file)
|
||||
// vtableStubs also counts instructions in pd_code_size_limit.
|
||||
@ -5103,7 +5103,7 @@ void MacroAssembler::decode_klass_not_null(Register r) {
|
||||
void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
|
||||
// Note: it will change flags
|
||||
assert(Universe::narrow_klass_base() != NULL, "Base should be initialized");
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert (UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
if (dst == src) {
|
||||
decode_klass_not_null(dst);
|
||||
} else {
|
||||
@ -5141,7 +5141,7 @@ void MacroAssembler::set_narrow_oop(Address dst, jobject obj) {
|
||||
}
|
||||
|
||||
void MacroAssembler::set_narrow_klass(Register dst, Klass* k) {
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert (UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
@ -5149,7 +5149,7 @@ void MacroAssembler::set_narrow_klass(Register dst, Klass* k) {
|
||||
}
|
||||
|
||||
void MacroAssembler::set_narrow_klass(Address dst, Klass* k) {
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert (UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
@ -5175,7 +5175,7 @@ void MacroAssembler::cmp_narrow_oop(Address dst, jobject obj) {
|
||||
}
|
||||
|
||||
void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) {
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert (UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
@ -5183,7 +5183,7 @@ void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) {
|
||||
}
|
||||
|
||||
void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) {
|
||||
assert (UseCompressedKlassPointers, "should only be used for compressed headers");
|
||||
assert (UseCompressedClassPointers, "should only be used for compressed headers");
|
||||
assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
|
||||
int klass_index = oop_recorder()->find_index(k);
|
||||
RelocationHolder rspec = metadata_Relocation::spec(klass_index);
|
||||
@ -5191,7 +5191,7 @@ void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) {
|
||||
}
|
||||
|
||||
void MacroAssembler::reinit_heapbase() {
|
||||
if (UseCompressedOops || UseCompressedKlassPointers) {
|
||||
if (UseCompressedOops || UseCompressedClassPointers) {
|
||||
if (Universe::heap() != NULL) {
|
||||
if (Universe::narrow_oop_base() == NULL) {
|
||||
MacroAssembler::xorptr(r12_heapbase, r12_heapbase);
|
||||
|
@ -211,11 +211,11 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
|
||||
if (is_vtable_stub) {
|
||||
// Vtable stub size
|
||||
return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
|
||||
(UseCompressedKlassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
(UseCompressedClassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
} else {
|
||||
// Itable stub size
|
||||
return (DebugVtables ? 512 : 74) + (CountCompiledCalls ? 13 : 0) +
|
||||
(UseCompressedKlassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
(UseCompressedClassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
|
||||
}
|
||||
// In order to tune these parameters, run the JVM with VM options
|
||||
// +PrintMiscellaneous and +WizardMode to see information about
|
||||
|
@ -1391,7 +1391,7 @@ uint BoxLockNode::size(PhaseRegAlloc *ra_) const
|
||||
#ifndef PRODUCT
|
||||
void MachUEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
|
||||
{
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
st->print_cr("movl rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
|
||||
st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
|
||||
st->print_cr("\tcmpq rax, rscratch1\t # Inline cache check");
|
||||
@ -1408,7 +1408,7 @@ void MachUEPNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
||||
{
|
||||
MacroAssembler masm(&cbuf);
|
||||
uint insts_size = cbuf.insts_size();
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
masm.load_klass(rscratch1, j_rarg0);
|
||||
masm.cmpptr(rax, rscratch1);
|
||||
} else {
|
||||
@ -1557,7 +1557,7 @@ bool Matcher::narrow_oop_use_complex_address() {
|
||||
}
|
||||
|
||||
bool Matcher::narrow_klass_use_complex_address() {
|
||||
assert(UseCompressedKlassPointers, "only for compressed klass code");
|
||||
assert(UseCompressedClassPointers, "only for compressed klass code");
|
||||
return (LogKlassAlignmentInBytes <= 3);
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
|
||||
// depends on this property.
|
||||
debug_only(
|
||||
FreeChunk* junk = NULL;
|
||||
assert(UseCompressedKlassPointers ||
|
||||
assert(UseCompressedClassPointers ||
|
||||
junk->prev_addr() == (void*)(oop(junk)->klass_addr()),
|
||||
"Offset of FreeChunk::_prev within FreeChunk must match"
|
||||
" that of OopDesc::_klass within OopDesc");
|
||||
@ -1407,7 +1407,7 @@ ConcurrentMarkSweepGeneration::par_promote(int thread_num,
|
||||
assert(!((FreeChunk*)obj_ptr)->is_free(), "Error, block will look free but show wrong size");
|
||||
OrderAccess::storestore();
|
||||
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
// Copy gap missed by (aligned) header size calculation below
|
||||
obj->set_klass_gap(old->klass_gap());
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ class VirtualSpaceList : public CHeapObj<mtClass> {
|
||||
// Can this virtual list allocate >1 spaces? Also, used to determine
|
||||
// whether to allocate unlimited small chunks in this virtual space
|
||||
bool _is_class;
|
||||
bool can_grow() const { return !is_class() || !UseCompressedKlassPointers; }
|
||||
bool can_grow() const { return !is_class() || !UseCompressedClassPointers; }
|
||||
|
||||
// Sum of space in all virtual spaces and number of virtual spaces
|
||||
size_t _virtual_space_total;
|
||||
@ -2836,7 +2836,7 @@ void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address
|
||||
// to work with compressed klass pointers.
|
||||
bool Metaspace::can_use_cds_with_metaspace_addr(char* metaspace_base, address cds_base) {
|
||||
assert(cds_base != 0 && UseSharedSpaces, "Only use with CDS");
|
||||
assert(UseCompressedKlassPointers, "Only use with CompressedKlassPtrs");
|
||||
assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs");
|
||||
address lower_base = MIN2((address)metaspace_base, cds_base);
|
||||
address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()),
|
||||
(address)(metaspace_base + class_metaspace_size()));
|
||||
@ -2846,7 +2846,7 @@ bool Metaspace::can_use_cds_with_metaspace_addr(char* metaspace_base, address cd
|
||||
// Try to allocate the metaspace at the requested addr.
|
||||
void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base) {
|
||||
assert(using_class_space(), "called improperly");
|
||||
assert(UseCompressedKlassPointers, "Only use with CompressedKlassPtrs");
|
||||
assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs");
|
||||
assert(class_metaspace_size() < KlassEncodingMetaspaceMax,
|
||||
"Metaspace size is too big");
|
||||
|
||||
@ -2869,9 +2869,9 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a
|
||||
|
||||
// If no successful allocation then try to allocate the space anywhere. If
|
||||
// that fails then OOM doom. At this point we cannot try allocating the
|
||||
// metaspace as if UseCompressedKlassPointers is off because too much
|
||||
// initialization has happened that depends on UseCompressedKlassPointers.
|
||||
// So, UseCompressedKlassPointers cannot be turned off at this point.
|
||||
// metaspace as if UseCompressedClassPointers is off because too much
|
||||
// initialization has happened that depends on UseCompressedClassPointers.
|
||||
// So, UseCompressedClassPointers cannot be turned off at this point.
|
||||
if (!metaspace_rs.is_reserved()) {
|
||||
metaspace_rs = ReservedSpace(class_metaspace_size(),
|
||||
os::vm_allocation_granularity(), false);
|
||||
@ -2904,12 +2904,12 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a
|
||||
}
|
||||
}
|
||||
|
||||
// For UseCompressedKlassPointers the class space is reserved above the top of
|
||||
// For UseCompressedClassPointers the class space is reserved above the top of
|
||||
// the Java heap. The argument passed in is at the base of the compressed space.
|
||||
void Metaspace::initialize_class_space(ReservedSpace rs) {
|
||||
// The reserved space size may be bigger because of alignment, esp with UseLargePages
|
||||
assert(rs.size() >= ClassMetaspaceSize,
|
||||
err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), ClassMetaspaceSize));
|
||||
assert(rs.size() >= CompressedClassSpaceSize,
|
||||
err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), CompressedClassSpaceSize));
|
||||
assert(using_class_space(), "Must be using class space");
|
||||
_class_space_list = new VirtualSpaceList(rs);
|
||||
}
|
||||
@ -2921,7 +2921,7 @@ void Metaspace::global_initialize() {
|
||||
int max_alignment = os::vm_page_size();
|
||||
size_t cds_total = 0;
|
||||
|
||||
set_class_metaspace_size(align_size_up(ClassMetaspaceSize,
|
||||
set_class_metaspace_size(align_size_up(CompressedClassSpaceSize,
|
||||
os::vm_allocation_granularity()));
|
||||
|
||||
MetaspaceShared::set_max_alignment(max_alignment);
|
||||
@ -2941,8 +2941,8 @@ void Metaspace::global_initialize() {
|
||||
#ifdef _LP64
|
||||
// Set the compressed klass pointer base so that decoding of these pointers works
|
||||
// properly when creating the shared archive.
|
||||
assert(UseCompressedOops && UseCompressedKlassPointers,
|
||||
"UseCompressedOops and UseCompressedKlassPointers must be set");
|
||||
assert(UseCompressedOops && UseCompressedClassPointers,
|
||||
"UseCompressedOops and UseCompressedClassPointers must be set");
|
||||
Universe::set_narrow_klass_base((address)_space_list->current_virtual_space()->bottom());
|
||||
if (TraceMetavirtualspaceAllocation && Verbose) {
|
||||
gclog_or_tty->print_cr("Setting_narrow_klass_base to Address: " PTR_FORMAT,
|
||||
@ -2979,7 +2979,7 @@ void Metaspace::global_initialize() {
|
||||
}
|
||||
|
||||
#ifdef _LP64
|
||||
// If UseCompressedKlassPointers is set then allocate the metaspace area
|
||||
// If UseCompressedClassPointers is set then allocate the metaspace area
|
||||
// above the heap and above the CDS area (if it exists).
|
||||
if (using_class_space()) {
|
||||
if (UseSharedSpaces) {
|
||||
@ -2997,7 +2997,7 @@ void Metaspace::global_initialize() {
|
||||
// on the medium chunk list. The next chunk will be small and progress
|
||||
// from there. This size calculated by -version.
|
||||
_first_class_chunk_word_size = MIN2((size_t)MediumChunk*6,
|
||||
(ClassMetaspaceSize/BytesPerWord)*2);
|
||||
(CompressedClassSpaceSize/BytesPerWord)*2);
|
||||
_first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size);
|
||||
// Arbitrarily set the initial virtual space to a multiple
|
||||
// of the boot class loader size.
|
||||
@ -3064,7 +3064,7 @@ size_t Metaspace::align_word_size_up(size_t word_size) {
|
||||
|
||||
MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) {
|
||||
// DumpSharedSpaces doesn't use class metadata area (yet)
|
||||
// Also, don't use class_vsm() unless UseCompressedKlassPointers is true.
|
||||
// Also, don't use class_vsm() unless UseCompressedClassPointers is true.
|
||||
if (mdtype == ClassType && using_class_space()) {
|
||||
return class_vsm()->allocate(word_size);
|
||||
} else {
|
||||
@ -3213,7 +3213,7 @@ Metablock* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
|
||||
MetaspaceAux::dump(gclog_or_tty);
|
||||
}
|
||||
// -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
|
||||
const char* space_string = (mdtype == ClassType) ? "Class Metadata space" :
|
||||
const char* space_string = (mdtype == ClassType) ? "Compressed class space" :
|
||||
"Metadata space";
|
||||
report_java_out_of_memory(space_string);
|
||||
|
||||
|
@ -213,9 +213,9 @@ class Metaspace : public CHeapObj<mtClass> {
|
||||
|
||||
void iterate(AllocRecordClosure *closure);
|
||||
|
||||
// Return TRUE only if UseCompressedKlassPointers is True and DumpSharedSpaces is False.
|
||||
// Return TRUE only if UseCompressedClassPointers is True and DumpSharedSpaces is False.
|
||||
static bool using_class_space() {
|
||||
return NOT_LP64(false) LP64_ONLY(UseCompressedKlassPointers && !DumpSharedSpaces);
|
||||
return NOT_LP64(false) LP64_ONLY(UseCompressedClassPointers && !DumpSharedSpaces);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ size_t CompressedClassSpaceCounters::calculate_capacity() {
|
||||
}
|
||||
|
||||
void CompressedClassSpaceCounters::update_performance_counters() {
|
||||
if (UsePerfData && UseCompressedKlassPointers) {
|
||||
if (UsePerfData && UseCompressedClassPointers) {
|
||||
assert(_perf_counters != NULL, "Should be initialized");
|
||||
|
||||
size_t capacity = calculate_capacity();
|
||||
@ -125,7 +125,7 @@ void CompressedClassSpaceCounters::initialize_performance_counters() {
|
||||
assert(_perf_counters == NULL, "Should only be initialized once");
|
||||
const char* ns = "compressedclassspace";
|
||||
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
size_t min_capacity = MetaspaceAux::min_chunk_size();
|
||||
size_t capacity = calculate_capacity();
|
||||
size_t max_capacity = MetaspaceAux::reserved_in_bytes(_class_type);
|
||||
|
@ -1028,7 +1028,7 @@ bool universe_post_init() {
|
||||
|
||||
msg = java_lang_String::create_from_str("Metadata space", CHECK_false);
|
||||
java_lang_Throwable::set_message(Universe::_out_of_memory_error_metaspace, msg());
|
||||
msg = java_lang_String::create_from_str("Class Metadata space", CHECK_false);
|
||||
msg = java_lang_String::create_from_str("Compressed class space", CHECK_false);
|
||||
java_lang_Throwable::set_message(Universe::_out_of_memory_error_class_metaspace, msg());
|
||||
|
||||
msg = java_lang_String::create_from_str("Requested array size exceeds VM limit", CHECK_false);
|
||||
|
@ -181,7 +181,7 @@ class Universe: AllStatic {
|
||||
|
||||
// For UseCompressedOops.
|
||||
static struct NarrowPtrStruct _narrow_oop;
|
||||
// For UseCompressedKlassPointers.
|
||||
// For UseCompressedClassPointers.
|
||||
static struct NarrowPtrStruct _narrow_klass;
|
||||
static address _narrow_ptrs_base;
|
||||
|
||||
@ -229,7 +229,7 @@ class Universe: AllStatic {
|
||||
_narrow_oop._base = base;
|
||||
}
|
||||
static void set_narrow_klass_base(address base) {
|
||||
assert(UseCompressedKlassPointers, "no compressed klass ptrs?");
|
||||
assert(UseCompressedClassPointers, "no compressed klass ptrs?");
|
||||
_narrow_klass._base = base;
|
||||
}
|
||||
static void set_narrow_oop_use_implicit_null_checks(bool use) {
|
||||
@ -353,7 +353,7 @@ class Universe: AllStatic {
|
||||
static int narrow_oop_shift() { return _narrow_oop._shift; }
|
||||
static bool narrow_oop_use_implicit_null_checks() { return _narrow_oop._use_implicit_null_checks; }
|
||||
|
||||
// For UseCompressedKlassPointers
|
||||
// For UseCompressedClassPointers
|
||||
static address narrow_klass_base() { return _narrow_klass._base; }
|
||||
static bool is_narrow_klass_base(void* addr) { return (narrow_klass_base() == (address)addr); }
|
||||
static int narrow_klass_shift() { return _narrow_klass._shift; }
|
||||
|
@ -65,7 +65,7 @@ class arrayOopDesc : public oopDesc {
|
||||
// declared nonstatic fields in arrayOopDesc if not compressed, otherwise
|
||||
// it occupies the second half of the _klass field in oopDesc.
|
||||
static int length_offset_in_bytes() {
|
||||
return UseCompressedKlassPointers ? klass_gap_offset_in_bytes() :
|
||||
return UseCompressedClassPointers ? klass_gap_offset_in_bytes() :
|
||||
sizeof(arrayOopDesc);
|
||||
}
|
||||
|
||||
|
@ -37,9 +37,9 @@ class instanceOopDesc : public oopDesc {
|
||||
|
||||
// If compressed, the offset of the fields of the instance may not be aligned.
|
||||
static int base_offset_in_bytes() {
|
||||
// offset computation code breaks if UseCompressedKlassPointers
|
||||
// offset computation code breaks if UseCompressedClassPointers
|
||||
// only is true
|
||||
return (UseCompressedOops && UseCompressedKlassPointers) ?
|
||||
return (UseCompressedOops && UseCompressedClassPointers) ?
|
||||
klass_gap_offset_in_bytes() :
|
||||
sizeof(instanceOopDesc);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
|
||||
}
|
||||
|
||||
inline Klass* oopDesc::klass() const {
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
return Klass::decode_klass_not_null(_metadata._compressed_klass);
|
||||
} else {
|
||||
return _metadata._klass;
|
||||
@ -78,7 +78,7 @@ inline Klass* oopDesc::klass() const {
|
||||
|
||||
inline Klass* oopDesc::klass_or_null() const volatile {
|
||||
// can be NULL in CMS
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
return Klass::decode_klass(_metadata._compressed_klass);
|
||||
} else {
|
||||
return _metadata._klass;
|
||||
@ -86,19 +86,19 @@ inline Klass* oopDesc::klass_or_null() const volatile {
|
||||
}
|
||||
|
||||
inline int oopDesc::klass_gap_offset_in_bytes() {
|
||||
assert(UseCompressedKlassPointers, "only applicable to compressed klass pointers");
|
||||
assert(UseCompressedClassPointers, "only applicable to compressed klass pointers");
|
||||
return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass);
|
||||
}
|
||||
|
||||
inline Klass** oopDesc::klass_addr() {
|
||||
// Only used internally and with CMS and will not work with
|
||||
// UseCompressedOops
|
||||
assert(!UseCompressedKlassPointers, "only supported with uncompressed klass pointers");
|
||||
assert(!UseCompressedClassPointers, "only supported with uncompressed klass pointers");
|
||||
return (Klass**) &_metadata._klass;
|
||||
}
|
||||
|
||||
inline narrowKlass* oopDesc::compressed_klass_addr() {
|
||||
assert(UseCompressedKlassPointers, "only called by compressed klass pointers");
|
||||
assert(UseCompressedClassPointers, "only called by compressed klass pointers");
|
||||
return &_metadata._compressed_klass;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ inline void oopDesc::set_klass(Klass* k) {
|
||||
// since klasses are promoted no store check is needed
|
||||
assert(Universe::is_bootstrapping() || k != NULL, "must be a real Klass*");
|
||||
assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass*");
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
*compressed_klass_addr() = Klass::encode_klass_not_null(k);
|
||||
} else {
|
||||
*klass_addr() = k;
|
||||
@ -118,7 +118,7 @@ inline int oopDesc::klass_gap() const {
|
||||
}
|
||||
|
||||
inline void oopDesc::set_klass_gap(int v) {
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
*(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v;
|
||||
}
|
||||
}
|
||||
@ -126,7 +126,7 @@ inline void oopDesc::set_klass_gap(int v) {
|
||||
inline void oopDesc::set_klass_to_list_ptr(oop k) {
|
||||
// This is only to be used during GC, for from-space objects, so no
|
||||
// barrier is needed.
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
_metadata._compressed_klass = (narrowKlass)encode_heap_oop(k); // may be null (parnew overflow handling)
|
||||
} else {
|
||||
_metadata._klass = (Klass*)(address)k;
|
||||
@ -135,7 +135,7 @@ inline void oopDesc::set_klass_to_list_ptr(oop k) {
|
||||
|
||||
inline oop oopDesc::list_ptr_from_klass() {
|
||||
// This is only to be used during GC, for from-space objects.
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
return decode_heap_oop((narrowOop)_metadata._compressed_klass);
|
||||
} else {
|
||||
// Special case for GC
|
||||
|
@ -1932,7 +1932,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
|
||||
#ifdef _LP64
|
||||
// Push DecodeN/DecodeNKlass down through phi.
|
||||
// The rest of phi graph will transform by split EncodeP node though phis up.
|
||||
if ((UseCompressedOops || UseCompressedKlassPointers) && can_reshape && progress == NULL) {
|
||||
if ((UseCompressedOops || UseCompressedClassPointers) && can_reshape && progress == NULL) {
|
||||
bool may_push = true;
|
||||
bool has_decodeN = false;
|
||||
bool is_decodeN = false;
|
||||
|
@ -2631,7 +2631,7 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
|
||||
addp->in(AddPNode::Base) == n->in(AddPNode::Base),
|
||||
"Base pointers must match" );
|
||||
#ifdef _LP64
|
||||
if ((UseCompressedOops || UseCompressedKlassPointers) &&
|
||||
if ((UseCompressedOops || UseCompressedClassPointers) &&
|
||||
addp->Opcode() == Op_ConP &&
|
||||
addp == n->in(AddPNode::Base) &&
|
||||
n->in(AddPNode::Offset)->is_Con()) {
|
||||
@ -3018,7 +3018,7 @@ void Compile::final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_
|
||||
|
||||
// Skip next transformation if compressed oops are not used.
|
||||
if ((UseCompressedOops && !Matcher::gen_narrow_oop_implicit_null_checks()) ||
|
||||
(!UseCompressedOops && !UseCompressedKlassPointers))
|
||||
(!UseCompressedOops && !UseCompressedClassPointers))
|
||||
return;
|
||||
|
||||
// Go over safepoints nodes to skip DecodeN/DecodeNKlass nodes for debug edges.
|
||||
|
@ -630,7 +630,7 @@ const Type *EncodePKlassNode::Value( PhaseTransform *phase ) const {
|
||||
if (t == Type::TOP) return Type::TOP;
|
||||
assert (t != TypePtr::NULL_PTR, "null klass?");
|
||||
|
||||
assert(UseCompressedKlassPointers && t->isa_klassptr(), "only klass ptr here");
|
||||
assert(UseCompressedClassPointers && t->isa_klassptr(), "only klass ptr here");
|
||||
return t->make_narrowklass();
|
||||
}
|
||||
|
||||
|
@ -4199,7 +4199,7 @@ void LibraryCallKit::copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, b
|
||||
// 12 - 64-bit VM, compressed klass
|
||||
// 16 - 64-bit VM, normal klass
|
||||
if (base_off % BytesPerLong != 0) {
|
||||
assert(UseCompressedKlassPointers, "");
|
||||
assert(UseCompressedClassPointers, "");
|
||||
if (is_array) {
|
||||
// Exclude length to copy by 8 bytes words.
|
||||
base_off += sizeof(int);
|
||||
|
@ -321,7 +321,7 @@ void PhaseChaitin::verify_base_ptrs( ResourceArea *a ) const {
|
||||
#ifdef _LP64
|
||||
UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_CastPP ||
|
||||
UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_DecodeN ||
|
||||
UseCompressedKlassPointers && check->as_Mach()->ideal_Opcode() == Op_DecodeNKlass ||
|
||||
UseCompressedClassPointers && check->as_Mach()->ideal_Opcode() == Op_DecodeNKlass ||
|
||||
#endif
|
||||
check->as_Mach()->ideal_Opcode() == Op_LoadP ||
|
||||
check->as_Mach()->ideal_Opcode() == Op_LoadKlass)) {
|
||||
|
@ -2191,7 +2191,7 @@ void PhaseMacroExpand::expand_lock_node(LockNode *lock) {
|
||||
Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
|
||||
klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );
|
||||
#ifdef _LP64
|
||||
if (UseCompressedKlassPointers && klass_node->is_DecodeNKlass()) {
|
||||
if (UseCompressedClassPointers && klass_node->is_DecodeNKlass()) {
|
||||
assert(klass_node->in(1)->Opcode() == Op_LoadNKlass, "sanity");
|
||||
klass_node->in(1)->init_req(0, ctrl);
|
||||
} else
|
||||
|
@ -1971,7 +1971,7 @@ Node *LoadKlassNode::make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* a
|
||||
assert(adr_type != NULL, "expecting TypeKlassPtr");
|
||||
#ifdef _LP64
|
||||
if (adr_type->is_ptr_to_narrowklass()) {
|
||||
assert(UseCompressedKlassPointers, "no compressed klasses");
|
||||
assert(UseCompressedClassPointers, "no compressed klasses");
|
||||
Node* load_klass = gvn.transform(new (C) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowklass()));
|
||||
return new (C) DecodeNKlassNode(load_klass, load_klass->bottom_type()->make_ptr());
|
||||
}
|
||||
@ -2309,7 +2309,7 @@ StoreNode* StoreNode::make( PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, cons
|
||||
val = gvn.transform(new (C) EncodePNode(val, val->bottom_type()->make_narrowoop()));
|
||||
return new (C) StoreNNode(ctl, mem, adr, adr_type, val);
|
||||
} else if (adr->bottom_type()->is_ptr_to_narrowklass() ||
|
||||
(UseCompressedKlassPointers && val->bottom_type()->isa_klassptr() &&
|
||||
(UseCompressedClassPointers && val->bottom_type()->isa_klassptr() &&
|
||||
adr->bottom_type()->isa_rawptr())) {
|
||||
val = gvn.transform(new (C) EncodePKlassNode(val, val->bottom_type()->make_narrowklass()));
|
||||
return new (C) StoreNKlassNode(ctl, mem, adr, adr_type, val);
|
||||
|
@ -2381,7 +2381,7 @@ TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int
|
||||
#ifdef _LP64
|
||||
if (_offset != 0) {
|
||||
if (_offset == oopDesc::klass_offset_in_bytes()) {
|
||||
_is_ptr_to_narrowklass = UseCompressedKlassPointers;
|
||||
_is_ptr_to_narrowklass = UseCompressedClassPointers;
|
||||
} else if (klass() == NULL) {
|
||||
// Array with unknown body type
|
||||
assert(this->isa_aryptr(), "only arrays without klass");
|
||||
|
@ -1439,7 +1439,7 @@ void Arguments::set_use_compressed_oops() {
|
||||
if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
|
||||
warning("Max heap size too large for Compressed Oops");
|
||||
FLAG_SET_DEFAULT(UseCompressedOops, false);
|
||||
FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
|
||||
FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
|
||||
}
|
||||
}
|
||||
#endif // _LP64
|
||||
@ -1452,22 +1452,22 @@ void Arguments::set_use_compressed_oops() {
|
||||
void Arguments::set_use_compressed_klass_ptrs() {
|
||||
#ifndef ZERO
|
||||
#ifdef _LP64
|
||||
// UseCompressedOops must be on for UseCompressedKlassPointers to be on.
|
||||
// UseCompressedOops must be on for UseCompressedClassPointers to be on.
|
||||
if (!UseCompressedOops) {
|
||||
if (UseCompressedKlassPointers) {
|
||||
warning("UseCompressedKlassPointers requires UseCompressedOops");
|
||||
if (UseCompressedClassPointers) {
|
||||
warning("UseCompressedClassPointers requires UseCompressedOops");
|
||||
}
|
||||
FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
|
||||
FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
|
||||
} else {
|
||||
// Turn on UseCompressedKlassPointers too
|
||||
if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
|
||||
FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
|
||||
// Turn on UseCompressedClassPointers too
|
||||
if (FLAG_IS_DEFAULT(UseCompressedClassPointers)) {
|
||||
FLAG_SET_ERGO(bool, UseCompressedClassPointers, true);
|
||||
}
|
||||
// Check the ClassMetaspaceSize to make sure we use compressed klass ptrs.
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (ClassMetaspaceSize > KlassEncodingMetaspaceMax) {
|
||||
warning("Class metaspace size is too large for UseCompressedKlassPointers");
|
||||
FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
|
||||
// Check the CompressedClassSpaceSize to make sure we use compressed klass ptrs.
|
||||
if (UseCompressedClassPointers) {
|
||||
if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
|
||||
warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
|
||||
FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2148,8 +2148,8 @@ bool Arguments::check_vm_args_consistency() {
|
||||
|
||||
status = status && verify_object_alignment();
|
||||
|
||||
status = status && verify_interval(ClassMetaspaceSize, 1*M, 3*G,
|
||||
"ClassMetaspaceSize");
|
||||
status = status && verify_interval(CompressedClassSpaceSize, 1*M, 3*G,
|
||||
"CompressedClassSpaceSize");
|
||||
|
||||
status = status && verify_interval(MarkStackSizeMax,
|
||||
1, (max_jint - 1), "MarkStackSizeMax");
|
||||
@ -3274,13 +3274,13 @@ void Arguments::set_shared_spaces_flags() {
|
||||
}
|
||||
UseSharedSpaces = false;
|
||||
#ifdef _LP64
|
||||
if (!UseCompressedOops || !UseCompressedKlassPointers) {
|
||||
if (!UseCompressedOops || !UseCompressedClassPointers) {
|
||||
vm_exit_during_initialization(
|
||||
"Cannot dump shared archive when UseCompressedOops or UseCompressedKlassPointers is off.", NULL);
|
||||
"Cannot dump shared archive when UseCompressedOops or UseCompressedClassPointers is off.", NULL);
|
||||
}
|
||||
} else {
|
||||
// UseCompressedOops and UseCompressedKlassPointers must be on for UseSharedSpaces.
|
||||
if (!UseCompressedOops || !UseCompressedKlassPointers) {
|
||||
// UseCompressedOops and UseCompressedClassPointers must be on for UseSharedSpaces.
|
||||
if (!UseCompressedOops || !UseCompressedClassPointers) {
|
||||
no_shared_spaces();
|
||||
}
|
||||
#endif
|
||||
@ -3581,7 +3581,7 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
|
||||
FLAG_SET_DEFAULT(ProfileInterpreter, false);
|
||||
FLAG_SET_DEFAULT(UseBiasedLocking, false);
|
||||
LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
|
||||
LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedKlassPointers, false));
|
||||
LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false));
|
||||
#endif // CC_INTERP
|
||||
|
||||
#ifdef COMPILER2
|
||||
@ -3610,6 +3610,10 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
|
||||
DebugNonSafepoints = true;
|
||||
}
|
||||
|
||||
if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
|
||||
warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (CompileTheWorld) {
|
||||
// Force NmethodSweeper to sweep whole CodeCache each time.
|
||||
|
@ -443,8 +443,8 @@ class CommandLineFlags {
|
||||
"Use 32-bit object references in 64-bit VM " \
|
||||
"lp64_product means flag is always constant in 32 bit VM") \
|
||||
\
|
||||
lp64_product(bool, UseCompressedKlassPointers, false, \
|
||||
"Use 32-bit klass pointers in 64-bit VM " \
|
||||
lp64_product(bool, UseCompressedClassPointers, false, \
|
||||
"Use 32-bit class pointers in 64-bit VM " \
|
||||
"lp64_product means flag is always constant in 32 bit VM") \
|
||||
\
|
||||
notproduct(bool, CheckCompressedOops, true, \
|
||||
@ -3039,9 +3039,9 @@ class CommandLineFlags {
|
||||
product(uintx, MaxMetaspaceSize, max_uintx, \
|
||||
"Maximum size of Metaspaces (in bytes)") \
|
||||
\
|
||||
product(uintx, ClassMetaspaceSize, 1*G, \
|
||||
"Maximum size of InstanceKlass area in Metaspace used for " \
|
||||
"UseCompressedKlassPointers") \
|
||||
product(uintx, CompressedClassSpaceSize, 1*G, \
|
||||
"Maximum size of class area in Metaspace when compressed " \
|
||||
"class pointers are used") \
|
||||
\
|
||||
product(uintx, MinHeapFreeRatio, 40, \
|
||||
"Min percentage of heap free after GC to avoid expansion") \
|
||||
|
@ -280,7 +280,7 @@ size_t MetaspacePool::calculate_max_size() const {
|
||||
}
|
||||
|
||||
CompressedKlassSpacePool::CompressedKlassSpacePool() :
|
||||
MemoryPool("Compressed Class Space", NonHeap, capacity_in_bytes(), ClassMetaspaceSize, true, false) { }
|
||||
MemoryPool("Compressed Class Space", NonHeap, capacity_in_bytes(), CompressedClassSpaceSize, true, false) { }
|
||||
|
||||
size_t CompressedKlassSpacePool::used_in_bytes() {
|
||||
return MetaspaceAux::allocated_used_bytes(Metaspace::ClassType);
|
||||
|
@ -409,7 +409,7 @@ void MemoryService::add_metaspace_memory_pools() {
|
||||
mgr->add_pool(_metaspace_pool);
|
||||
_pools_list->append(_metaspace_pool);
|
||||
|
||||
if (UseCompressedKlassPointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
_compressed_class_pool = new CompressedKlassSpacePool();
|
||||
mgr->add_pool(_compressed_class_pool);
|
||||
_pools_list->append(_compressed_class_pool);
|
||||
|
49
hotspot/test/gc/arguments/TestCompressedClassFlags.java
Normal file
49
hotspot/test/gc/arguments/TestCompressedClassFlags.java
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import com.oracle.java.testlibrary.*;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8015107
|
||||
* @summary Tests that VM prints a warning when -XX:CompressedClassSpaceSize
|
||||
* is used together with -XX:-UseCompressedClassPointers
|
||||
* @library /testlibrary
|
||||
*/
|
||||
public class TestCompressedClassFlags {
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (Platform.is64bit()) {
|
||||
OutputAnalyzer output = runJava("-XX:CompressedClassSpaceSize=1g",
|
||||
"-XX:-UseCompressedClassPointers",
|
||||
"-version");
|
||||
output.shouldContain("warning");
|
||||
output.shouldNotContain("error");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
private static OutputAnalyzer runJava(String ... args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
|
||||
return new OutputAnalyzer(pb.start());
|
||||
}
|
||||
}
|
@ -22,11 +22,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test ClassMetaspaceSizeInJmapHeap
|
||||
* @test CompressedClassSpaceSizeInJmapHeap
|
||||
* @bug 8004924
|
||||
* @summary Checks that jmap -heap contains the flag ClassMetaspaceSize
|
||||
* @summary Checks that jmap -heap contains the flag CompressedClassSpaceSize
|
||||
* @library /testlibrary
|
||||
* @run main/othervm -XX:ClassMetaspaceSize=50m ClassMetaspaceSizeInJmapHeap
|
||||
* @run main/othervm -XX:CompressedClassSpaceSize=50m CompressedClassSpaceSizeInJmapHeap
|
||||
*/
|
||||
|
||||
import com.oracle.java.testlibrary.*;
|
||||
@ -35,7 +35,7 @@ import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
public class ClassMetaspaceSizeInJmapHeap {
|
||||
public class CompressedClassSpaceSizeInJmapHeap {
|
||||
public static void main(String[] args) throws Exception {
|
||||
String pid = Integer.toString(ProcessTools.getProcessId());
|
||||
|
||||
@ -44,16 +44,16 @@ public class ClassMetaspaceSizeInJmapHeap {
|
||||
.addToolArg(pid);
|
||||
ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
|
||||
|
||||
File out = new File("ClassMetaspaceSizeInJmapHeap.stdout.txt");
|
||||
File out = new File("CompressedClassSpaceSizeInJmapHeap.stdout.txt");
|
||||
pb.redirectOutput(out);
|
||||
|
||||
File err = new File("ClassMetaspaceSizeInJmapHeap.stderr.txt");
|
||||
File err = new File("CompressedClassSpaceSizeInJmapHeap.stderr.txt");
|
||||
pb.redirectError(err);
|
||||
|
||||
run(pb);
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(read(out));
|
||||
output.shouldContain("ClassMetaspaceSize = 52428800 (50.0MB)");
|
||||
output.shouldContain("CompressedClassSpaceSize = 52428800 (50.0MB)");
|
||||
out.delete();
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ import java.lang.management.ManagementFactory;
|
||||
* MemoryManagerMXBean is created.
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m TestMetaspaceMemoryPool
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers TestMetaspaceMemoryPool
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:ClassMetaspaceSize=60m TestMetaspaceMemoryPool
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers TestMetaspaceMemoryPool
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m TestMetaspaceMemoryPool
|
||||
*/
|
||||
public class TestMetaspaceMemoryPool {
|
||||
public static void main(String[] args) {
|
||||
|
@ -33,13 +33,13 @@ import static com.oracle.java.testlibrary.Asserts.*;
|
||||
* @summary Tests that performance counters for metaspace and compressed class
|
||||
* space exists and works.
|
||||
*
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
|
||||
*
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
|
||||
*/
|
||||
public class TestMetaspacePerfCounters {
|
||||
public static Class fooClass = null;
|
||||
@ -99,6 +99,6 @@ public class TestMetaspacePerfCounters {
|
||||
}
|
||||
|
||||
private static boolean isUsingCompressedClassPointers() {
|
||||
return Platform.is64bit() && InputArguments.contains("-XX:+UseCompressedKlassPointers");
|
||||
return Platform.is64bit() && InputArguments.contains("-XX:+UseCompressedClassPointers");
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8003424
|
||||
* @summary Testing UseCompressedKlassPointers with CDS
|
||||
* @summary Testing UseCompressedClassPointers with CDS
|
||||
* @library /testlibrary
|
||||
* @run main CDSCompressedKPtrs
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public class CDSCompressedKPtrs {
|
||||
ProcessBuilder pb;
|
||||
if (Platform.is64bit()) {
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UseCompressedKlassPointers", "-XX:+UseCompressedOops",
|
||||
"-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops",
|
||||
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
try {
|
||||
@ -44,7 +44,7 @@ public class CDSCompressedKPtrs {
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UseCompressedKlassPointers", "-XX:+UseCompressedOops",
|
||||
"-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops",
|
||||
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("sharing");
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8003424
|
||||
* @summary Test that cannot use CDS if UseCompressedKlassPointers is turned off.
|
||||
* @summary Test that cannot use CDS if UseCompressedClassPointers is turned off.
|
||||
* @library /testlibrary
|
||||
* @run main CDSCompressedKPtrsError
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public class CDSCompressedKPtrsError {
|
||||
ProcessBuilder pb;
|
||||
if (Platform.is64bit()) {
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UseCompressedOops", "-XX:+UseCompressedKlassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
try {
|
||||
@ -44,21 +44,21 @@ public class CDSCompressedKPtrsError {
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:-UseCompressedKlassPointers", "-XX:-UseCompressedOops",
|
||||
"-XX:-UseCompressedClassPointers", "-XX:-UseCompressedOops",
|
||||
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Unable to use shared archive");
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:-UseCompressedKlassPointers", "-XX:+UseCompressedOops",
|
||||
"-XX:-UseCompressedClassPointers", "-XX:+UseCompressedOops",
|
||||
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Unable to use shared archive");
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UseCompressedKlassPointers", "-XX:-UseCompressedOops",
|
||||
"-XX:+UseCompressedClassPointers", "-XX:-UseCompressedOops",
|
||||
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Unable to use shared archive");
|
||||
@ -71,19 +71,19 @@ public class CDSCompressedKPtrsError {
|
||||
|
||||
// Test bad options with -Xshare:dump.
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:-UseCompressedOops", "-XX:+UseCompressedKlassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Cannot dump shared archive");
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UseCompressedOops", "-XX:-UseCompressedKlassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+UseCompressedOops", "-XX:-UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Cannot dump shared archive");
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:-UseCompressedOops", "-XX:-UseCompressedKlassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:-UseCompressedOops", "-XX:-UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Cannot dump shared archive");
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8000968
|
||||
* @key regression
|
||||
* @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
|
||||
* @summary NPG: UseCompressedClassPointers asserts with ObjectAlignmentInBytes=32
|
||||
* @library /testlibrary
|
||||
*/
|
||||
|
||||
@ -52,7 +52,7 @@ public class CompressedKlassPointerAndOops {
|
||||
OutputAnalyzer output;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UseCompressedKlassPointers",
|
||||
"-XX:+UseCompressedClassPointers",
|
||||
"-XX:+UseCompressedOops",
|
||||
"-XX:ObjectAlignmentInBytes=" + alignment,
|
||||
"-version");
|
||||
|
Loading…
x
Reference in New Issue
Block a user