mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 01:30:10 +00:00
Merge
This commit is contained in:
commit
d8037e4c8d
@ -45,7 +45,7 @@ public class InstanceClassLoaderKlass extends InstanceKlass {
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
|
||||
// Just make sure it's there for now
|
||||
Type type = db.lookupType("instanceClassLoaderKlass");
|
||||
Type type = db.lookupType("InstanceClassLoaderKlass");
|
||||
}
|
||||
|
||||
public InstanceClassLoaderKlass(Address addr) {
|
||||
|
||||
@ -45,7 +45,7 @@ public class InstanceMirrorKlass extends InstanceKlass {
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
|
||||
// Just make sure it's there for now
|
||||
Type type = db.lookupType("instanceMirrorKlass");
|
||||
Type type = db.lookupType("InstanceMirrorKlass");
|
||||
}
|
||||
|
||||
public InstanceMirrorKlass(Address addr) {
|
||||
|
||||
@ -45,7 +45,7 @@ public class InstanceRefKlass extends InstanceKlass {
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
|
||||
// Just make sure it's there for now
|
||||
Type type = db.lookupType("instanceRefKlass");
|
||||
Type type = db.lookupType("InstanceRefKlass");
|
||||
}
|
||||
|
||||
public InstanceRefKlass(Address addr) {
|
||||
|
||||
@ -52,9 +52,9 @@ abstract public class Metadata extends VMObject {
|
||||
metadataConstructor.addMapping("Metadata", Metadata.class);
|
||||
metadataConstructor.addMapping("Klass", Klass.class);
|
||||
metadataConstructor.addMapping("InstanceKlass", InstanceKlass.class);
|
||||
metadataConstructor.addMapping("instanceMirrorKlass", InstanceMirrorKlass.class);
|
||||
metadataConstructor.addMapping("instanceRefKlass", InstanceRefKlass.class);
|
||||
metadataConstructor.addMapping("instanceClassLoaderKlass", InstanceClassLoaderKlass.class);
|
||||
metadataConstructor.addMapping("InstanceMirrorKlass", InstanceMirrorKlass.class);
|
||||
metadataConstructor.addMapping("InstanceRefKlass", InstanceRefKlass.class);
|
||||
metadataConstructor.addMapping("InstanceClassLoaderKlass", InstanceClassLoaderKlass.class);
|
||||
metadataConstructor.addMapping("typeArrayKlass", TypeArrayKlass.class);
|
||||
metadataConstructor.addMapping("objArrayKlass", ObjArrayKlass.class);
|
||||
metadataConstructor.addMapping("Method", Method.class);
|
||||
|
||||
@ -41,9 +41,6 @@ ifeq ($(COMPILER_REV_NUMERIC), 510)
|
||||
OPT_CFLAGS/simpleThresholdPolicy.o = $(OPT_CFLAGS/DEFAULT) $(OPT_CCFLAGS/NO_TAIL_CALL_OPT)
|
||||
# CC 5.10 has bug XXXXX with -xO4
|
||||
OPT_CFLAGS/jvmtiClassFileReconstituter.o = $(OPT_CFLAGS/SLOWER)
|
||||
# jvm98 crashes on solaris-i586-fastdebug and solaris-sparc-fastdebug with stack overflow
|
||||
OPT_CFLAGS/escape.o = $(OPT_CFLAGS) -xspace
|
||||
OPT_CFLAGS/matcher.o = $(OPT_CFLAGS) -xspace
|
||||
endif # COMPILER_REV_NUMERIC == 510
|
||||
|
||||
ifeq ($(COMPILER_REV_NUMERIC), 509)
|
||||
|
||||
@ -147,6 +147,39 @@ LIR_Opr FrameMap::I5_oop_opr;
|
||||
LIR_Opr FrameMap::I6_oop_opr;
|
||||
LIR_Opr FrameMap::I7_oop_opr;
|
||||
|
||||
LIR_Opr FrameMap::G0_metadata_opr;
|
||||
LIR_Opr FrameMap::G1_metadata_opr;
|
||||
LIR_Opr FrameMap::G2_metadata_opr;
|
||||
LIR_Opr FrameMap::G3_metadata_opr;
|
||||
LIR_Opr FrameMap::G4_metadata_opr;
|
||||
LIR_Opr FrameMap::G5_metadata_opr;
|
||||
LIR_Opr FrameMap::G6_metadata_opr;
|
||||
LIR_Opr FrameMap::G7_metadata_opr;
|
||||
LIR_Opr FrameMap::O0_metadata_opr;
|
||||
LIR_Opr FrameMap::O1_metadata_opr;
|
||||
LIR_Opr FrameMap::O2_metadata_opr;
|
||||
LIR_Opr FrameMap::O3_metadata_opr;
|
||||
LIR_Opr FrameMap::O4_metadata_opr;
|
||||
LIR_Opr FrameMap::O5_metadata_opr;
|
||||
LIR_Opr FrameMap::O6_metadata_opr;
|
||||
LIR_Opr FrameMap::O7_metadata_opr;
|
||||
LIR_Opr FrameMap::L0_metadata_opr;
|
||||
LIR_Opr FrameMap::L1_metadata_opr;
|
||||
LIR_Opr FrameMap::L2_metadata_opr;
|
||||
LIR_Opr FrameMap::L3_metadata_opr;
|
||||
LIR_Opr FrameMap::L4_metadata_opr;
|
||||
LIR_Opr FrameMap::L5_metadata_opr;
|
||||
LIR_Opr FrameMap::L6_metadata_opr;
|
||||
LIR_Opr FrameMap::L7_metadata_opr;
|
||||
LIR_Opr FrameMap::I0_metadata_opr;
|
||||
LIR_Opr FrameMap::I1_metadata_opr;
|
||||
LIR_Opr FrameMap::I2_metadata_opr;
|
||||
LIR_Opr FrameMap::I3_metadata_opr;
|
||||
LIR_Opr FrameMap::I4_metadata_opr;
|
||||
LIR_Opr FrameMap::I5_metadata_opr;
|
||||
LIR_Opr FrameMap::I6_metadata_opr;
|
||||
LIR_Opr FrameMap::I7_metadata_opr;
|
||||
|
||||
LIR_Opr FrameMap::SP_opr;
|
||||
LIR_Opr FrameMap::FP_opr;
|
||||
|
||||
@ -310,6 +343,39 @@ void FrameMap::initialize() {
|
||||
I6_oop_opr = as_oop_opr(I6);
|
||||
I7_oop_opr = as_oop_opr(I7);
|
||||
|
||||
G0_metadata_opr = as_metadata_opr(G0);
|
||||
G1_metadata_opr = as_metadata_opr(G1);
|
||||
G2_metadata_opr = as_metadata_opr(G2);
|
||||
G3_metadata_opr = as_metadata_opr(G3);
|
||||
G4_metadata_opr = as_metadata_opr(G4);
|
||||
G5_metadata_opr = as_metadata_opr(G5);
|
||||
G6_metadata_opr = as_metadata_opr(G6);
|
||||
G7_metadata_opr = as_metadata_opr(G7);
|
||||
O0_metadata_opr = as_metadata_opr(O0);
|
||||
O1_metadata_opr = as_metadata_opr(O1);
|
||||
O2_metadata_opr = as_metadata_opr(O2);
|
||||
O3_metadata_opr = as_metadata_opr(O3);
|
||||
O4_metadata_opr = as_metadata_opr(O4);
|
||||
O5_metadata_opr = as_metadata_opr(O5);
|
||||
O6_metadata_opr = as_metadata_opr(O6);
|
||||
O7_metadata_opr = as_metadata_opr(O7);
|
||||
L0_metadata_opr = as_metadata_opr(L0);
|
||||
L1_metadata_opr = as_metadata_opr(L1);
|
||||
L2_metadata_opr = as_metadata_opr(L2);
|
||||
L3_metadata_opr = as_metadata_opr(L3);
|
||||
L4_metadata_opr = as_metadata_opr(L4);
|
||||
L5_metadata_opr = as_metadata_opr(L5);
|
||||
L6_metadata_opr = as_metadata_opr(L6);
|
||||
L7_metadata_opr = as_metadata_opr(L7);
|
||||
I0_metadata_opr = as_metadata_opr(I0);
|
||||
I1_metadata_opr = as_metadata_opr(I1);
|
||||
I2_metadata_opr = as_metadata_opr(I2);
|
||||
I3_metadata_opr = as_metadata_opr(I3);
|
||||
I4_metadata_opr = as_metadata_opr(I4);
|
||||
I5_metadata_opr = as_metadata_opr(I5);
|
||||
I6_metadata_opr = as_metadata_opr(I6);
|
||||
I7_metadata_opr = as_metadata_opr(I7);
|
||||
|
||||
FP_opr = as_pointer_opr(FP);
|
||||
SP_opr = as_pointer_opr(SP);
|
||||
|
||||
|
||||
@ -104,6 +104,39 @@
|
||||
static LIR_Opr I6_oop_opr;
|
||||
static LIR_Opr I7_oop_opr;
|
||||
|
||||
static LIR_Opr G0_metadata_opr;
|
||||
static LIR_Opr G1_metadata_opr;
|
||||
static LIR_Opr G2_metadata_opr;
|
||||
static LIR_Opr G3_metadata_opr;
|
||||
static LIR_Opr G4_metadata_opr;
|
||||
static LIR_Opr G5_metadata_opr;
|
||||
static LIR_Opr G6_metadata_opr;
|
||||
static LIR_Opr G7_metadata_opr;
|
||||
static LIR_Opr O0_metadata_opr;
|
||||
static LIR_Opr O1_metadata_opr;
|
||||
static LIR_Opr O2_metadata_opr;
|
||||
static LIR_Opr O3_metadata_opr;
|
||||
static LIR_Opr O4_metadata_opr;
|
||||
static LIR_Opr O5_metadata_opr;
|
||||
static LIR_Opr O6_metadata_opr;
|
||||
static LIR_Opr O7_metadata_opr;
|
||||
static LIR_Opr L0_metadata_opr;
|
||||
static LIR_Opr L1_metadata_opr;
|
||||
static LIR_Opr L2_metadata_opr;
|
||||
static LIR_Opr L3_metadata_opr;
|
||||
static LIR_Opr L4_metadata_opr;
|
||||
static LIR_Opr L5_metadata_opr;
|
||||
static LIR_Opr L6_metadata_opr;
|
||||
static LIR_Opr L7_metadata_opr;
|
||||
static LIR_Opr I0_metadata_opr;
|
||||
static LIR_Opr I1_metadata_opr;
|
||||
static LIR_Opr I2_metadata_opr;
|
||||
static LIR_Opr I3_metadata_opr;
|
||||
static LIR_Opr I4_metadata_opr;
|
||||
static LIR_Opr I5_metadata_opr;
|
||||
static LIR_Opr I6_metadata_opr;
|
||||
static LIR_Opr I7_metadata_opr;
|
||||
|
||||
static LIR_Opr in_long_opr;
|
||||
static LIR_Opr out_long_opr;
|
||||
static LIR_Opr g1_long_single_opr;
|
||||
|
||||
@ -447,9 +447,12 @@ int LIR_Assembler::emit_unwind_handler() {
|
||||
|
||||
if (compilation()->env()->dtrace_method_probes()) {
|
||||
__ mov(G2_thread, O0);
|
||||
__ save_thread(I1); // need to preserve thread in G2 across
|
||||
// runtime call
|
||||
metadata2reg(method()->constant_encoding(), O1);
|
||||
__ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), relocInfo::runtime_call_type);
|
||||
__ delayed()->nop();
|
||||
__ restore_thread(I1);
|
||||
}
|
||||
|
||||
if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
|
||||
@ -843,6 +846,7 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType
|
||||
#endif
|
||||
break;
|
||||
case T_ADDRESS:
|
||||
case T_METADATA:
|
||||
__ st_ptr(from_reg->as_register(), base, offset);
|
||||
break;
|
||||
case T_ARRAY : // fall through
|
||||
@ -965,6 +969,7 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case T_METADATA:
|
||||
case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break;
|
||||
case T_ARRAY : // fall through
|
||||
case T_OBJECT:
|
||||
@ -1366,6 +1371,7 @@ Address LIR_Assembler::as_Address_lo(LIR_Address* addr) {
|
||||
void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type,
|
||||
LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) {
|
||||
|
||||
assert(type != T_METADATA, "load of metadata ptr not supported");
|
||||
LIR_Address* addr = src_opr->as_address_ptr();
|
||||
LIR_Opr to_reg = dest;
|
||||
|
||||
@ -1513,6 +1519,7 @@ void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) {
|
||||
void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
|
||||
LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack,
|
||||
bool wide, bool unaligned) {
|
||||
assert(type != T_METADATA, "store of metadata ptr not supported");
|
||||
LIR_Address* addr = dest->as_address_ptr();
|
||||
|
||||
Register src = addr->base()->as_pointer_register();
|
||||
|
||||
@ -884,7 +884,7 @@ void LIRGenerator::do_NewInstance(NewInstance* x) {
|
||||
LIR_Opr tmp2 = FrameMap::G3_oop_opr;
|
||||
LIR_Opr tmp3 = FrameMap::G4_oop_opr;
|
||||
LIR_Opr tmp4 = FrameMap::O1_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::G5_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::G5_metadata_opr;
|
||||
new_instance(reg, x->klass(), tmp1, tmp2, tmp3, tmp4, klass_reg, info);
|
||||
LIR_Opr result = rlock_result(x);
|
||||
__ move(reg, result);
|
||||
@ -903,11 +903,11 @@ void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
|
||||
LIR_Opr tmp2 = FrameMap::G3_oop_opr;
|
||||
LIR_Opr tmp3 = FrameMap::G4_oop_opr;
|
||||
LIR_Opr tmp4 = FrameMap::O1_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::G5_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::G5_metadata_opr;
|
||||
LIR_Opr len = length.result();
|
||||
BasicType elem_type = x->elt_type();
|
||||
|
||||
__ oop2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg);
|
||||
__ metadata2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg);
|
||||
|
||||
CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info);
|
||||
__ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path);
|
||||
@ -935,7 +935,7 @@ void LIRGenerator::do_NewObjectArray(NewObjectArray* x) {
|
||||
LIR_Opr tmp2 = FrameMap::G3_oop_opr;
|
||||
LIR_Opr tmp3 = FrameMap::G4_oop_opr;
|
||||
LIR_Opr tmp4 = FrameMap::O1_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::G5_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::G5_metadata_opr;
|
||||
LIR_Opr len = length.result();
|
||||
|
||||
CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info);
|
||||
@ -985,8 +985,8 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
|
||||
// This instruction can be deoptimized in the slow path : use
|
||||
// O0 as result register.
|
||||
const LIR_Opr reg = result_register_for(x->type());
|
||||
klass2reg_with_patching(reg, x->klass(), patching_info);
|
||||
const LIR_Opr klass_reg = FrameMap::O0_metadata_opr;
|
||||
klass2reg_with_patching(klass_reg, x->klass(), patching_info);
|
||||
LIR_Opr rank = FrameMap::O1_opr;
|
||||
__ move(LIR_OprFact::intConst(x->rank()), rank);
|
||||
LIR_Opr varargs = FrameMap::as_pointer_opr(O2);
|
||||
@ -995,9 +995,10 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
LIR_OprFact::intptrConst(offset_from_sp),
|
||||
varargs);
|
||||
LIR_OprList* args = new LIR_OprList(3);
|
||||
args->append(reg);
|
||||
args->append(klass_reg);
|
||||
args->append(rank);
|
||||
args->append(varargs);
|
||||
const LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id),
|
||||
LIR_OprFact::illegalOpr,
|
||||
reg, args, info);
|
||||
|
||||
@ -1340,6 +1340,7 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
|
||||
case T_ADDRESS: // raw pointers, like current thread, for VM calls
|
||||
case T_ARRAY:
|
||||
case T_OBJECT:
|
||||
case T_METADATA:
|
||||
regs[i].set2( int_stk_helper( j ) );
|
||||
break;
|
||||
case T_FLOAT:
|
||||
@ -1388,6 +1389,7 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
|
||||
case T_FLOAT:
|
||||
case T_INT:
|
||||
case T_OBJECT:
|
||||
case T_METADATA:
|
||||
case T_SHORT:
|
||||
regs[i].set1( int_stk_helper( i ) );
|
||||
break;
|
||||
|
||||
@ -96,6 +96,13 @@ LIR_Opr FrameMap::rax_oop_opr;
|
||||
LIR_Opr FrameMap::rdx_oop_opr;
|
||||
LIR_Opr FrameMap::rcx_oop_opr;
|
||||
|
||||
LIR_Opr FrameMap::rsi_metadata_opr;
|
||||
LIR_Opr FrameMap::rdi_metadata_opr;
|
||||
LIR_Opr FrameMap::rbx_metadata_opr;
|
||||
LIR_Opr FrameMap::rax_metadata_opr;
|
||||
LIR_Opr FrameMap::rdx_metadata_opr;
|
||||
LIR_Opr FrameMap::rcx_metadata_opr;
|
||||
|
||||
LIR_Opr FrameMap::long0_opr;
|
||||
LIR_Opr FrameMap::long1_opr;
|
||||
LIR_Opr FrameMap::fpu0_float_opr;
|
||||
@ -122,6 +129,13 @@ LIR_Opr FrameMap::r11_oop_opr;
|
||||
LIR_Opr FrameMap::r12_oop_opr;
|
||||
LIR_Opr FrameMap::r13_oop_opr;
|
||||
LIR_Opr FrameMap::r14_oop_opr;
|
||||
|
||||
LIR_Opr FrameMap::r8_metadata_opr;
|
||||
LIR_Opr FrameMap::r9_metadata_opr;
|
||||
LIR_Opr FrameMap::r11_metadata_opr;
|
||||
LIR_Opr FrameMap::r12_metadata_opr;
|
||||
LIR_Opr FrameMap::r13_metadata_opr;
|
||||
LIR_Opr FrameMap::r14_metadata_opr;
|
||||
#endif // _LP64
|
||||
|
||||
LIR_Opr FrameMap::_caller_save_cpu_regs[] = { 0, };
|
||||
@ -236,6 +250,13 @@ void FrameMap::initialize() {
|
||||
rdx_oop_opr = as_oop_opr(rdx);
|
||||
rcx_oop_opr = as_oop_opr(rcx);
|
||||
|
||||
rsi_metadata_opr = as_metadata_opr(rsi);
|
||||
rdi_metadata_opr = as_metadata_opr(rdi);
|
||||
rbx_metadata_opr = as_metadata_opr(rbx);
|
||||
rax_metadata_opr = as_metadata_opr(rax);
|
||||
rdx_metadata_opr = as_metadata_opr(rdx);
|
||||
rcx_metadata_opr = as_metadata_opr(rcx);
|
||||
|
||||
rsp_opr = as_pointer_opr(rsp);
|
||||
rbp_opr = as_pointer_opr(rbp);
|
||||
|
||||
@ -246,6 +267,13 @@ void FrameMap::initialize() {
|
||||
r12_oop_opr = as_oop_opr(r12);
|
||||
r13_oop_opr = as_oop_opr(r13);
|
||||
r14_oop_opr = as_oop_opr(r14);
|
||||
|
||||
r8_metadata_opr = as_metadata_opr(r8);
|
||||
r9_metadata_opr = as_metadata_opr(r9);
|
||||
r11_metadata_opr = as_metadata_opr(r11);
|
||||
r12_metadata_opr = as_metadata_opr(r12);
|
||||
r13_metadata_opr = as_metadata_opr(r13);
|
||||
r14_metadata_opr = as_metadata_opr(r14);
|
||||
#endif // _LP64
|
||||
|
||||
VMRegPair regs;
|
||||
|
||||
@ -73,6 +73,14 @@
|
||||
static LIR_Opr rax_oop_opr;
|
||||
static LIR_Opr rdx_oop_opr;
|
||||
static LIR_Opr rcx_oop_opr;
|
||||
|
||||
static LIR_Opr rsi_metadata_opr;
|
||||
static LIR_Opr rdi_metadata_opr;
|
||||
static LIR_Opr rbx_metadata_opr;
|
||||
static LIR_Opr rax_metadata_opr;
|
||||
static LIR_Opr rdx_metadata_opr;
|
||||
static LIR_Opr rcx_metadata_opr;
|
||||
|
||||
#ifdef _LP64
|
||||
|
||||
static LIR_Opr r8_opr;
|
||||
@ -92,6 +100,14 @@
|
||||
static LIR_Opr r13_oop_opr;
|
||||
static LIR_Opr r14_oop_opr;
|
||||
|
||||
static LIR_Opr r8_metadata_opr;
|
||||
static LIR_Opr r9_metadata_opr;
|
||||
|
||||
static LIR_Opr r11_metadata_opr;
|
||||
static LIR_Opr r12_metadata_opr;
|
||||
static LIR_Opr r13_metadata_opr;
|
||||
static LIR_Opr r14_metadata_opr;
|
||||
|
||||
#endif // _LP64
|
||||
|
||||
static LIR_Opr long0_opr;
|
||||
|
||||
@ -950,6 +950,8 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po
|
||||
if (type == T_OBJECT || type == T_ARRAY) {
|
||||
__ verify_oop(src->as_register());
|
||||
__ movptr (dst, src->as_register());
|
||||
} else if (type == T_METADATA) {
|
||||
__ movptr (dst, src->as_register());
|
||||
} else {
|
||||
__ movl (dst, src->as_register());
|
||||
}
|
||||
@ -1041,6 +1043,14 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
|
||||
__ movptr(as_Address(to_addr), src->as_register());
|
||||
}
|
||||
break;
|
||||
case T_METADATA:
|
||||
// We get here to store a method pointer to the stack to pass to
|
||||
// a dtrace runtime call. This can't work on 64 bit with
|
||||
// compressed klass ptrs: T_METADATA can be a compressed klass
|
||||
// ptr or a 64 bit method pointer.
|
||||
LP64_ONLY(ShouldNotReachHere());
|
||||
__ movptr(as_Address(to_addr), src->as_register());
|
||||
break;
|
||||
case T_ADDRESS:
|
||||
__ movptr(as_Address(to_addr), src->as_register());
|
||||
break;
|
||||
@ -1118,6 +1128,8 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
|
||||
if (type == T_ARRAY || type == T_OBJECT) {
|
||||
__ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
__ verify_oop(dest->as_register());
|
||||
} else if (type == T_METADATA) {
|
||||
__ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
} else {
|
||||
__ movl(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
|
||||
}
|
||||
|
||||
@ -1002,13 +1002,12 @@ void LIRGenerator::do_NewInstance(NewInstance* x) {
|
||||
#endif
|
||||
CodeEmitInfo* info = state_for(x, x->state());
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
LIR_Opr klass_reg = new_register(objectType);
|
||||
new_instance(reg, x->klass(),
|
||||
FrameMap::rcx_oop_opr,
|
||||
FrameMap::rdi_oop_opr,
|
||||
FrameMap::rsi_oop_opr,
|
||||
LIR_OprFact::illegalOpr,
|
||||
FrameMap::rdx_oop_opr, info);
|
||||
FrameMap::rdx_metadata_opr, info);
|
||||
LIR_Opr result = rlock_result(x);
|
||||
__ move(reg, result);
|
||||
}
|
||||
@ -1025,11 +1024,11 @@ void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
|
||||
LIR_Opr tmp2 = FrameMap::rsi_oop_opr;
|
||||
LIR_Opr tmp3 = FrameMap::rdi_oop_opr;
|
||||
LIR_Opr tmp4 = reg;
|
||||
LIR_Opr klass_reg = FrameMap::rdx_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::rdx_metadata_opr;
|
||||
LIR_Opr len = length.result();
|
||||
BasicType elem_type = x->elt_type();
|
||||
|
||||
__ oop2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg);
|
||||
__ metadata2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg);
|
||||
|
||||
CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info);
|
||||
__ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path);
|
||||
@ -1055,7 +1054,7 @@ void LIRGenerator::do_NewObjectArray(NewObjectArray* x) {
|
||||
LIR_Opr tmp2 = FrameMap::rsi_oop_opr;
|
||||
LIR_Opr tmp3 = FrameMap::rdi_oop_opr;
|
||||
LIR_Opr tmp4 = reg;
|
||||
LIR_Opr klass_reg = FrameMap::rdx_oop_opr;
|
||||
LIR_Opr klass_reg = FrameMap::rdx_metadata_opr;
|
||||
|
||||
length.load_item_force(FrameMap::rbx_opr);
|
||||
LIR_Opr len = length.result();
|
||||
@ -1103,17 +1102,18 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
|
||||
store_stack_parameter(size->result(), in_ByteSize(i*4));
|
||||
}
|
||||
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
klass2reg_with_patching(reg, x->klass(), patching_info);
|
||||
LIR_Opr klass_reg = FrameMap::rax_metadata_opr;
|
||||
klass2reg_with_patching(klass_reg, x->klass(), patching_info);
|
||||
|
||||
LIR_Opr rank = FrameMap::rbx_opr;
|
||||
__ move(LIR_OprFact::intConst(x->rank()), rank);
|
||||
LIR_Opr varargs = FrameMap::rcx_opr;
|
||||
__ move(FrameMap::rsp_opr, varargs);
|
||||
LIR_OprList* args = new LIR_OprList(3);
|
||||
args->append(reg);
|
||||
args->append(klass_reg);
|
||||
args->append(rank);
|
||||
args->append(varargs);
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id),
|
||||
LIR_OprFact::illegalOpr,
|
||||
reg, args, info);
|
||||
|
||||
@ -938,6 +938,7 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
|
||||
case T_OBJECT:
|
||||
case T_ARRAY:
|
||||
case T_ADDRESS:
|
||||
case T_METADATA:
|
||||
regs[i].set1(VMRegImpl::stack2reg(stack++));
|
||||
break;
|
||||
case T_LONG:
|
||||
|
||||
@ -903,6 +903,7 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
|
||||
case T_OBJECT:
|
||||
case T_ARRAY:
|
||||
case T_ADDRESS:
|
||||
case T_METADATA:
|
||||
if (int_args < Argument::n_int_register_parameters_c) {
|
||||
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
|
||||
#ifdef _WIN64
|
||||
|
||||
@ -194,6 +194,10 @@ class FrameMap : public CompilationResourceObj {
|
||||
return LIR_OprFact::single_cpu_oop(cpu_reg2rnr(r));
|
||||
}
|
||||
|
||||
static LIR_Opr as_metadata_opr(Register r) {
|
||||
return LIR_OprFact::single_cpu_metadata(cpu_reg2rnr(r));
|
||||
}
|
||||
|
||||
FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size);
|
||||
bool finalize_frame(int nof_slots);
|
||||
|
||||
|
||||
@ -89,8 +89,12 @@ LIR_Opr LIR_OprFact::value_type(ValueType* type) {
|
||||
ClassConstant* c = type->as_ClassConstant();
|
||||
if (c != NULL && !c->value()->is_loaded()) {
|
||||
return LIR_OprFact::metadataConst(NULL);
|
||||
} else {
|
||||
} else if (c != NULL) {
|
||||
return LIR_OprFact::metadataConst(c->value()->constant_encoding());
|
||||
} else {
|
||||
MethodConstant* m = type->as_MethodConstant();
|
||||
assert (m != NULL, "not a class or a method?");
|
||||
return LIR_OprFact::metadataConst(m->value()->constant_encoding());
|
||||
}
|
||||
}
|
||||
case objectTag : {
|
||||
@ -1166,10 +1170,12 @@ void LIR_List::append(LIR_InsertionBuffer* buffer) {
|
||||
|
||||
|
||||
void LIR_List::oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info) {
|
||||
assert(reg->type() == T_OBJECT, "bad reg");
|
||||
append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg, T_OBJECT, lir_patch_normal, info));
|
||||
}
|
||||
|
||||
void LIR_List::klass2reg_patch(Metadata* o, LIR_Opr reg, CodeEmitInfo* info) {
|
||||
assert(reg->type() == T_METADATA, "bad reg");
|
||||
append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg, T_METADATA, lir_patch_normal, info));
|
||||
}
|
||||
|
||||
|
||||
@ -299,6 +299,7 @@ class LIR_OprDesc: public CompilationResourceObj {
|
||||
, address_type = 4 << type_shift
|
||||
, float_type = 5 << type_shift
|
||||
, double_type = 6 << type_shift
|
||||
, metadata_type = 7 << type_shift
|
||||
};
|
||||
friend OprType as_OprType(BasicType t);
|
||||
friend BasicType as_BasicType(OprType t);
|
||||
@ -322,6 +323,7 @@ class LIR_OprDesc: public CompilationResourceObj {
|
||||
case T_ADDRESS:
|
||||
case T_OBJECT:
|
||||
case T_ARRAY:
|
||||
case T_METADATA:
|
||||
return single_size;
|
||||
break;
|
||||
|
||||
@ -474,6 +476,7 @@ inline LIR_OprDesc::OprType as_OprType(BasicType type) {
|
||||
case T_OBJECT:
|
||||
case T_ARRAY: return LIR_OprDesc::object_type;
|
||||
case T_ADDRESS: return LIR_OprDesc::address_type;
|
||||
case T_METADATA: return LIR_OprDesc::metadata_type;
|
||||
case T_ILLEGAL: // fall through
|
||||
default: ShouldNotReachHere(); return LIR_OprDesc::unknown_type;
|
||||
}
|
||||
@ -487,6 +490,7 @@ inline BasicType as_BasicType(LIR_OprDesc::OprType t) {
|
||||
case LIR_OprDesc::double_type: return T_DOUBLE;
|
||||
case LIR_OprDesc::object_type: return T_OBJECT;
|
||||
case LIR_OprDesc::address_type: return T_ADDRESS;
|
||||
case LIR_OprDesc::metadata_type:return T_METADATA;
|
||||
case LIR_OprDesc::unknown_type: // fall through
|
||||
default: ShouldNotReachHere(); return T_ILLEGAL;
|
||||
}
|
||||
@ -587,6 +591,12 @@ class LIR_OprFact: public AllStatic {
|
||||
LIR_OprDesc::cpu_register |
|
||||
LIR_OprDesc::single_size);
|
||||
}
|
||||
static LIR_Opr single_cpu_metadata(int reg) {
|
||||
return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
|
||||
LIR_OprDesc::metadata_type |
|
||||
LIR_OprDesc::cpu_register |
|
||||
LIR_OprDesc::single_size);
|
||||
}
|
||||
static LIR_Opr double_cpu(int reg1, int reg2) {
|
||||
LP64_ONLY(assert(reg1 == reg2, "must be identical"));
|
||||
return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
|
||||
@ -660,6 +670,14 @@ class LIR_OprFact: public AllStatic {
|
||||
LIR_OprDesc::virtual_mask);
|
||||
break;
|
||||
|
||||
case T_METADATA:
|
||||
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
|
||||
LIR_OprDesc::metadata_type|
|
||||
LIR_OprDesc::cpu_register |
|
||||
LIR_OprDesc::single_size |
|
||||
LIR_OprDesc::virtual_mask);
|
||||
break;
|
||||
|
||||
case T_INT:
|
||||
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
|
||||
LIR_OprDesc::int_type |
|
||||
@ -757,6 +775,12 @@ class LIR_OprFact: public AllStatic {
|
||||
LIR_OprDesc::single_size);
|
||||
break;
|
||||
|
||||
case T_METADATA:
|
||||
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
|
||||
LIR_OprDesc::metadata_type |
|
||||
LIR_OprDesc::stack_value |
|
||||
LIR_OprDesc::single_size);
|
||||
break;
|
||||
case T_INT:
|
||||
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
|
||||
LIR_OprDesc::int_type |
|
||||
@ -2006,10 +2030,10 @@ class LIR_List: public CompilationResourceObj {
|
||||
}
|
||||
void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); }
|
||||
|
||||
void oop2reg (jobject o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); }
|
||||
void oop2reg (jobject o, LIR_Opr reg) { assert(reg->type() == T_OBJECT, "bad reg"); append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); }
|
||||
void oop2reg_patch(jobject o, LIR_Opr reg, CodeEmitInfo* info);
|
||||
|
||||
void oop2reg (Metadata* o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg)); }
|
||||
void metadata2reg (Metadata* o, LIR_Opr reg) { assert(reg->type() == T_METADATA, "bad reg"); append(new LIR_Op1(lir_move, LIR_OprFact::metadataConst(o), reg)); }
|
||||
void klass2reg_patch(Metadata* o, LIR_Opr reg, CodeEmitInfo* info);
|
||||
|
||||
void return_op(LIR_Opr result) { append(new LIR_Op1(lir_return, result)); }
|
||||
|
||||
@ -467,7 +467,7 @@ void LIRGenerator::klass2reg_with_patching(LIR_Opr r, ciMetadata* obj, CodeEmitI
|
||||
__ klass2reg_patch(NULL, r, info);
|
||||
} else {
|
||||
// no patching needed
|
||||
__ oop2reg(obj->constant_encoding(), r);
|
||||
__ metadata2reg(obj->constant_encoding(), r);
|
||||
}
|
||||
}
|
||||
|
||||
@ -955,8 +955,8 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) {
|
||||
not_taken_count_offset = t;
|
||||
}
|
||||
|
||||
LIR_Opr md_reg = new_register(T_OBJECT);
|
||||
__ oop2reg(md->constant_encoding(), md_reg);
|
||||
LIR_Opr md_reg = new_register(T_METADATA);
|
||||
__ metadata2reg(md->constant_encoding(), md_reg);
|
||||
|
||||
LIR_Opr data_offset_reg = new_pointer_register();
|
||||
__ cmove(lir_cond(cond),
|
||||
@ -1192,8 +1192,8 @@ void LIRGenerator::do_Return(Return* x) {
|
||||
signature.append(T_OBJECT); // Method*
|
||||
LIR_OprList* args = new LIR_OprList();
|
||||
args->append(getThreadPointer());
|
||||
LIR_Opr meth = new_register(T_OBJECT);
|
||||
__ oop2reg(method()->constant_encoding(), meth);
|
||||
LIR_Opr meth = new_register(T_METADATA);
|
||||
__ metadata2reg(method()->constant_encoding(), meth);
|
||||
args->append(meth);
|
||||
call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL);
|
||||
}
|
||||
@ -2292,7 +2292,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) {
|
||||
if (gen_type_check) {
|
||||
// We have determined that offset == referent_offset && src != null.
|
||||
// if (src->_klass->_reference_type == REF_NONE) -> continue
|
||||
__ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), T_OBJECT), src_klass);
|
||||
__ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), UseCompressedKlassPointers ? T_OBJECT : T_ADDRESS), src_klass);
|
||||
LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE);
|
||||
LIR_Opr reference_type = new_register(T_INT);
|
||||
__ move(reference_type_addr, reference_type);
|
||||
@ -2553,8 +2553,8 @@ void LIRGenerator::do_Goto(Goto* x) {
|
||||
assert(data->is_JumpData(), "need JumpData for branches");
|
||||
offset = md->byte_offset_of_slot(data, JumpData::taken_offset());
|
||||
}
|
||||
LIR_Opr md_reg = new_register(T_OBJECT);
|
||||
__ oop2reg(md->constant_encoding(), md_reg);
|
||||
LIR_Opr md_reg = new_register(T_METADATA);
|
||||
__ metadata2reg(md->constant_encoding(), md_reg);
|
||||
|
||||
increment_counter(new LIR_Address(md_reg, offset,
|
||||
NOT_LP64(T_INT) LP64_ONLY(T_LONG)), DataLayout::counter_increment);
|
||||
@ -2611,8 +2611,8 @@ void LIRGenerator::do_Base(Base* x) {
|
||||
signature.append(T_OBJECT); // Method*
|
||||
LIR_OprList* args = new LIR_OprList();
|
||||
args->append(getThreadPointer());
|
||||
LIR_Opr meth = new_register(T_OBJECT);
|
||||
__ oop2reg(method()->constant_encoding(), meth);
|
||||
LIR_Opr meth = new_register(T_METADATA);
|
||||
__ metadata2reg(method()->constant_encoding(), meth);
|
||||
args->append(meth);
|
||||
call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), voidType, NULL);
|
||||
}
|
||||
@ -3032,21 +3032,21 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
|
||||
assert(level > CompLevel_simple, "Shouldn't be here");
|
||||
|
||||
int offset = -1;
|
||||
LIR_Opr counter_holder = new_register(T_OBJECT);
|
||||
LIR_Opr counter_holder = new_register(T_METADATA);
|
||||
LIR_Opr meth;
|
||||
if (level == CompLevel_limited_profile) {
|
||||
offset = in_bytes(backedge ? Method::backedge_counter_offset() :
|
||||
Method::invocation_counter_offset());
|
||||
__ oop2reg(method->constant_encoding(), counter_holder);
|
||||
__ metadata2reg(method->constant_encoding(), counter_holder);
|
||||
meth = counter_holder;
|
||||
} else if (level == CompLevel_full_profile) {
|
||||
offset = in_bytes(backedge ? MethodData::backedge_counter_offset() :
|
||||
MethodData::invocation_counter_offset());
|
||||
ciMethodData* md = method->method_data_or_null();
|
||||
assert(md != NULL, "Sanity");
|
||||
__ oop2reg(md->constant_encoding(), counter_holder);
|
||||
meth = new_register(T_OBJECT);
|
||||
__ oop2reg(method->constant_encoding(), meth);
|
||||
__ metadata2reg(md->constant_encoding(), counter_holder);
|
||||
meth = new_register(T_METADATA);
|
||||
__ metadata2reg(method->constant_encoding(), meth);
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
@ -2067,6 +2067,12 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
|
||||
return LIR_OprFact::single_cpu_address(assigned_reg);
|
||||
}
|
||||
|
||||
case T_METADATA: {
|
||||
assert(assigned_reg >= pd_first_cpu_reg && assigned_reg <= pd_last_cpu_reg, "no cpu register");
|
||||
assert(interval->assigned_regHi() == any_reg, "must not have hi register");
|
||||
return LIR_OprFact::single_cpu_metadata(assigned_reg);
|
||||
}
|
||||
|
||||
#ifdef __SOFTFP__
|
||||
case T_FLOAT: // fall through
|
||||
#endif // __SOFTFP__
|
||||
|
||||
@ -168,6 +168,7 @@ BasicType as_BasicType(ValueType* type) {
|
||||
case floatTag: return T_FLOAT;
|
||||
case doubleTag: return T_DOUBLE;
|
||||
case objectTag: return T_OBJECT;
|
||||
case metaDataTag:return T_METADATA;
|
||||
case addressTag: return T_ADDRESS;
|
||||
case illegalTag: return T_ILLEGAL;
|
||||
}
|
||||
|
||||
@ -3271,7 +3271,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
int next_nonstatic_field_offset;
|
||||
|
||||
// Calculate the starting byte offsets
|
||||
next_static_oop_offset = instanceMirrorKlass::offset_of_static_fields();
|
||||
next_static_oop_offset = InstanceMirrorKlass::offset_of_static_fields();
|
||||
next_static_double_offset = next_static_oop_offset +
|
||||
(fac.count[STATIC_OOP] * heapOopSize);
|
||||
if ( fac.count[STATIC_DOUBLE] &&
|
||||
|
||||
@ -500,7 +500,7 @@ static void initialize_static_field(fieldDescriptor* fd, TRAPS) {
|
||||
|
||||
|
||||
void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
|
||||
assert(instanceMirrorKlass::offset_of_static_fields() != 0, "must have been computed already");
|
||||
assert(InstanceMirrorKlass::offset_of_static_fields() != 0, "must have been computed already");
|
||||
|
||||
// If the offset was read from the shared archive, it was fixed up already
|
||||
if (!k->is_shared()) {
|
||||
@ -510,7 +510,7 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
|
||||
// update all the static field offsets to included the size.
|
||||
for (JavaFieldStream fs(InstanceKlass::cast(k())); !fs.done(); fs.next()) {
|
||||
if (fs.access_flags().is_static()) {
|
||||
int real_offset = fs.offset() + instanceMirrorKlass::offset_of_static_fields();
|
||||
int real_offset = fs.offset() + InstanceMirrorKlass::offset_of_static_fields();
|
||||
fs.set_offset(real_offset);
|
||||
}
|
||||
}
|
||||
@ -531,9 +531,9 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) {
|
||||
// the mirror.
|
||||
if (SystemDictionary::Class_klass_loaded()) {
|
||||
// Allocate mirror (java.lang.Class instance)
|
||||
Handle mirror = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK_0);
|
||||
Handle mirror = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK_0);
|
||||
|
||||
instanceMirrorKlass* mk = instanceMirrorKlass::cast(mirror->klass());
|
||||
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(mirror->klass());
|
||||
java_lang_Class::set_static_oop_field_count(mirror(), mk->compute_static_oop_field_count(mirror()));
|
||||
|
||||
// It might also have a component mirror. This mirror must already exist.
|
||||
@ -592,14 +592,14 @@ void java_lang_Class::set_static_oop_field_count(oop java_class, int size) {
|
||||
oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
|
||||
// This should be improved by adding a field at the Java level or by
|
||||
// introducing a new VM klass (see comment in ClassFileParser)
|
||||
oop java_class = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(NULL, CHECK_0);
|
||||
oop java_class = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(NULL, CHECK_0);
|
||||
if (type != T_VOID) {
|
||||
Klass* aklass = Universe::typeArrayKlassObj(type);
|
||||
assert(aklass != NULL, "correct bootstrap");
|
||||
set_array_klass(java_class, aklass);
|
||||
}
|
||||
#ifdef ASSERT
|
||||
instanceMirrorKlass* mk = instanceMirrorKlass::cast(SystemDictionary::Class_klass());
|
||||
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(SystemDictionary::Class_klass());
|
||||
assert(java_lang_Class::static_oop_field_count(java_class) == 0, "should have been zeroed by allocation");
|
||||
#endif
|
||||
return java_class;
|
||||
@ -2835,17 +2835,17 @@ oop java_lang_ClassLoader::non_reflection_class_loader(oop loader) {
|
||||
|
||||
// Support for java_lang_System
|
||||
int java_lang_System::in_offset_in_bytes() {
|
||||
return (instanceMirrorKlass::offset_of_static_fields() + static_in_offset);
|
||||
return (InstanceMirrorKlass::offset_of_static_fields() + static_in_offset);
|
||||
}
|
||||
|
||||
|
||||
int java_lang_System::out_offset_in_bytes() {
|
||||
return (instanceMirrorKlass::offset_of_static_fields() + static_out_offset);
|
||||
return (InstanceMirrorKlass::offset_of_static_fields() + static_out_offset);
|
||||
}
|
||||
|
||||
|
||||
int java_lang_System::err_offset_in_bytes() {
|
||||
return (instanceMirrorKlass::offset_of_static_fields() + static_err_offset);
|
||||
return (InstanceMirrorKlass::offset_of_static_fields() + static_err_offset);
|
||||
}
|
||||
|
||||
|
||||
@ -3124,10 +3124,10 @@ bool JavaClasses::check_static_offset(const char *klass_name, int hardcoded_offs
|
||||
tty->print_cr("Static field %s.%s appears to be nonstatic", klass_name, field_name);
|
||||
return false;
|
||||
}
|
||||
if (fd.offset() == hardcoded_offset + instanceMirrorKlass::offset_of_static_fields()) {
|
||||
if (fd.offset() == hardcoded_offset + InstanceMirrorKlass::offset_of_static_fields()) {
|
||||
return true;
|
||||
} else {
|
||||
tty->print_cr("Offset of static field %s.%s is hardcoded as %d but should really be %d.", klass_name, field_name, hardcoded_offset, fd.offset() - instanceMirrorKlass::offset_of_static_fields());
|
||||
tty->print_cr("Offset of static field %s.%s is hardcoded as %d but should really be %d.", klass_name, field_name, hardcoded_offset, fd.offset() - InstanceMirrorKlass::offset_of_static_fields());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1953,7 +1953,7 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) {
|
||||
// Initialize the constant pool for the Object_class
|
||||
InstanceKlass* ik = InstanceKlass::cast(Object_klass());
|
||||
ik->constants()->restore_unshareable_info(CHECK);
|
||||
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
|
||||
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
|
||||
} else {
|
||||
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
|
||||
}
|
||||
@ -1976,7 +1976,7 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) {
|
||||
|
||||
// Preload ref klasses and set reference types
|
||||
InstanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER);
|
||||
instanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass));
|
||||
InstanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass));
|
||||
|
||||
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK);
|
||||
InstanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT);
|
||||
|
||||
@ -1108,7 +1108,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
||||
// the pending list lock or a 3-way deadlock may occur
|
||||
// between the reference handler thread, a GC (instigated
|
||||
// by a compiler thread), and compiled method registration.
|
||||
if (instanceRefKlass::owns_pending_list_lock(JavaThread::current())) {
|
||||
if (InstanceRefKlass::owns_pending_list_lock(JavaThread::current())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1440,7 +1440,7 @@ uint CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
|
||||
// Should the current thread be blocked until this compilation request
|
||||
// has been fulfilled?
|
||||
bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) {
|
||||
assert(!instanceRefKlass::owns_pending_list_lock(JavaThread::current()), "possible deadlock");
|
||||
assert(!InstanceRefKlass::owns_pending_list_lock(JavaThread::current()), "possible deadlock");
|
||||
return !BackgroundCompilation;
|
||||
}
|
||||
|
||||
|
||||
@ -839,7 +839,7 @@ class PSParallelCompact : AllStatic {
|
||||
friend class AdjustKlassClosure;
|
||||
friend class FollowKlassClosure;
|
||||
friend class FollowRootClosure;
|
||||
friend class instanceClassLoaderKlass;
|
||||
friend class InstanceClassLoaderKlass;
|
||||
friend class RefProcTaskProxy;
|
||||
|
||||
private:
|
||||
|
||||
@ -255,13 +255,13 @@ void SurrogateLockerThread::loop() {
|
||||
}
|
||||
switch(msg) {
|
||||
case acquirePLL: {
|
||||
instanceRefKlass::acquire_pending_list_lock(&pll_basic_lock);
|
||||
InstanceRefKlass::acquire_pending_list_lock(&pll_basic_lock);
|
||||
debug_only(owned++;)
|
||||
break;
|
||||
}
|
||||
case releaseAndNotifyPLL: {
|
||||
assert(owned > 0, "Don't have PLL");
|
||||
instanceRefKlass::release_and_notify_pending_list_lock(&pll_basic_lock);
|
||||
InstanceRefKlass::release_and_notify_pending_list_lock(&pll_basic_lock);
|
||||
debug_only(owned--;)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -70,13 +70,13 @@ void VM_GC_Operation::notify_gc_end() {
|
||||
|
||||
void VM_GC_Operation::acquire_pending_list_lock() {
|
||||
// we may enter this with pending exception set
|
||||
instanceRefKlass::acquire_pending_list_lock(&_pending_list_basic_lock);
|
||||
InstanceRefKlass::acquire_pending_list_lock(&_pending_list_basic_lock);
|
||||
}
|
||||
|
||||
|
||||
void VM_GC_Operation::release_and_notify_pending_list_lock() {
|
||||
|
||||
instanceRefKlass::release_and_notify_pending_list_lock(&_pending_list_basic_lock);
|
||||
InstanceRefKlass::release_and_notify_pending_list_lock(&_pending_list_basic_lock);
|
||||
}
|
||||
|
||||
// Allocations may fail in several threads at about the same time,
|
||||
|
||||
@ -516,7 +516,7 @@ oop CollectedHeap::Class_obj_allocate(KlassHandle klass, int size, KlassHandle r
|
||||
real_klass->set_java_mirror(mirror);
|
||||
}
|
||||
|
||||
instanceMirrorKlass* mk = instanceMirrorKlass::cast(mirror->klass());
|
||||
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(mirror->klass());
|
||||
assert(size == mk->instance_size(real_klass), "should have been set");
|
||||
|
||||
// notify jvmti and dtrace
|
||||
|
||||
@ -734,6 +734,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokehandle(JavaThread* thread)) {
|
||||
} // end JvmtiHideSingleStepping
|
||||
|
||||
cache_entry(thread)->set_method_handle(
|
||||
pool,
|
||||
info.resolved_method(),
|
||||
info.resolved_appendix(),
|
||||
pool->resolved_references());
|
||||
@ -761,6 +762,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
|
||||
|
||||
ConstantPoolCacheEntry* cp_cache_entry = pool->invokedynamic_cp_cache_entry_at(index);
|
||||
cp_cache_entry->set_dynamic_call(
|
||||
pool,
|
||||
info.resolved_method(),
|
||||
info.resolved_appendix(),
|
||||
pool->resolved_references());
|
||||
|
||||
@ -26,6 +26,10 @@
|
||||
#include "memory/iterator.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
void KlassToOopClosure::do_klass(Klass* k) {
|
||||
k->oops_do(_oop_closure);
|
||||
}
|
||||
|
||||
void ObjectToOopClosure::do_object(oop obj) {
|
||||
obj->oop_iterate(_cl);
|
||||
}
|
||||
|
||||
@ -128,6 +128,13 @@ class KlassClosure : public Closure {
|
||||
virtual void do_klass(Klass* k) = 0;
|
||||
};
|
||||
|
||||
class KlassToOopClosure : public KlassClosure {
|
||||
OopClosure* _oop_closure;
|
||||
public:
|
||||
KlassToOopClosure(OopClosure* oop_closure) : _oop_closure(oop_closure) {}
|
||||
virtual void do_klass(Klass* k);
|
||||
};
|
||||
|
||||
// ObjectClosure is used for iterating through an object space
|
||||
|
||||
class ObjectClosure : public Closure {
|
||||
|
||||
@ -2541,41 +2541,14 @@ void SpaceManager::mangle_freed_chunks() {
|
||||
|
||||
// MetaspaceAux
|
||||
|
||||
size_t MetaspaceAux::used_in_bytes_unsafe(Metaspace::MetadataType mdtype) {
|
||||
size_t used = 0;
|
||||
ClassLoaderDataGraphMetaspaceIterator iter;
|
||||
while (iter.repeat()) {
|
||||
Metaspace* msp = iter.get_next();
|
||||
// Sum allocation_total for each metaspace
|
||||
if (msp != NULL) {
|
||||
used += msp->used_words(mdtype);
|
||||
}
|
||||
}
|
||||
return used * BytesPerWord;
|
||||
}
|
||||
|
||||
size_t MetaspaceAux::used_in_bytes(Metaspace::MetadataType mdtype) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(),
|
||||
"Consistency checks require being at a safepoint");
|
||||
size_t used = 0;
|
||||
#ifdef ASSERT
|
||||
size_t free = 0;
|
||||
size_t capacity = 0;
|
||||
#endif
|
||||
ClassLoaderDataGraphMetaspaceIterator iter;
|
||||
while (iter.repeat()) {
|
||||
Metaspace* msp = iter.get_next();
|
||||
// Sum allocation_total for each metaspace
|
||||
if (msp != NULL) {
|
||||
used += msp->used_words(mdtype);
|
||||
#ifdef ASSERT
|
||||
free += msp->free_words(mdtype);
|
||||
capacity += msp->capacity_words(mdtype);
|
||||
assert(used + free == capacity,
|
||||
err_msg("Accounting is wrong used " SIZE_FORMAT
|
||||
" free " SIZE_FORMAT " capacity " SIZE_FORMAT,
|
||||
used, free, capacity));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return used * BytesPerWord;
|
||||
@ -2661,15 +2634,15 @@ void MetaspaceAux::print_on(outputStream* out) {
|
||||
out->print_cr(" Metaspace total "
|
||||
SIZE_FORMAT "K, used " SIZE_FORMAT "K,"
|
||||
" reserved " SIZE_FORMAT "K",
|
||||
capacity_in_bytes()/K, used_in_bytes_unsafe()/K, reserved_in_bytes()/K);
|
||||
capacity_in_bytes()/K, used_in_bytes()/K, reserved_in_bytes()/K);
|
||||
out->print_cr(" data space "
|
||||
SIZE_FORMAT "K, used " SIZE_FORMAT "K,"
|
||||
" reserved " SIZE_FORMAT "K",
|
||||
capacity_in_bytes(nct)/K, used_in_bytes_unsafe(nct)/K, reserved_in_bytes(nct)/K);
|
||||
capacity_in_bytes(nct)/K, used_in_bytes(nct)/K, reserved_in_bytes(nct)/K);
|
||||
out->print_cr(" class space "
|
||||
SIZE_FORMAT "K, used " SIZE_FORMAT "K,"
|
||||
" reserved " SIZE_FORMAT "K",
|
||||
capacity_in_bytes(ct)/K, used_in_bytes_unsafe(ct)/K, reserved_in_bytes(ct)/K);
|
||||
capacity_in_bytes(ct)/K, used_in_bytes(ct)/K, reserved_in_bytes(ct)/K);
|
||||
}
|
||||
|
||||
// Print information for class space and data space separately.
|
||||
@ -2806,19 +2779,22 @@ void Metaspace::initialize_class_space(ReservedSpace rs) {
|
||||
_class_space_list = new VirtualSpaceList(rs);
|
||||
}
|
||||
|
||||
// Class space probably needs a lot less than data space
|
||||
const int class_space_divisor = 4;
|
||||
|
||||
void Metaspace::initialize(Mutex* lock, size_t initial_size) {
|
||||
// Use SmallChunk size if not specified, adjust class to smaller size if so.
|
||||
// Use SmallChunk size if not specified. If specified, use this size for
|
||||
// the data metaspace.
|
||||
size_t word_size;
|
||||
size_t class_word_size;
|
||||
if (initial_size == 0) {
|
||||
word_size = (size_t) SpaceManager::SmallChunk;
|
||||
class_word_size = word_size;
|
||||
class_word_size = (size_t) SpaceManager::SmallChunk;
|
||||
} else {
|
||||
word_size = initial_size;
|
||||
class_word_size = initial_size/class_space_divisor;
|
||||
// Make the first class chunk bigger than a medium chunk so it's not put
|
||||
// on the medium chunk list. The next chunk will be small and progress
|
||||
// from there. This size calculated by -version.
|
||||
class_word_size = MIN2((size_t)SpaceManager::MediumChunk*5,
|
||||
(ClassMetaspaceSize/BytesPerWord)*2);
|
||||
}
|
||||
|
||||
assert(space_list() != NULL,
|
||||
|
||||
@ -149,10 +149,6 @@ class MetaspaceAux : AllStatic {
|
||||
|
||||
// Statistics for class space and data space in metaspace.
|
||||
static size_t used_in_bytes(Metaspace::MetadataType mdtype);
|
||||
// Same as used_in_bytes() without the consistency checking.
|
||||
// Use this version if not at a safepoint (so consistency is
|
||||
// not necessarily expected).
|
||||
static size_t used_in_bytes_unsafe(Metaspace::MetadataType mdtype);
|
||||
static size_t free_in_bytes(Metaspace::MetadataType mdtype);
|
||||
static size_t capacity_in_bytes(Metaspace::MetadataType mdtype);
|
||||
static size_t reserved_in_bytes(Metaspace::MetadataType mdtype);
|
||||
@ -167,11 +163,6 @@ class MetaspaceAux : AllStatic {
|
||||
used_in_bytes(Metaspace::NonClassType);
|
||||
}
|
||||
|
||||
static size_t used_in_bytes_unsafe() {
|
||||
return used_in_bytes_unsafe(Metaspace::ClassType) +
|
||||
used_in_bytes_unsafe(Metaspace::NonClassType);
|
||||
}
|
||||
|
||||
// Total of available space in all Metaspaces
|
||||
// Total of capacity allocated to all Metaspaces. This includes
|
||||
// space in Metachunks not yet allocated and in the Metachunk
|
||||
|
||||
@ -35,7 +35,7 @@ MetaspaceCounters::MetaspaceCounters() {
|
||||
size_t min_capacity = MetaspaceAux::min_chunk_size();
|
||||
size_t max_capacity = MetaspaceAux::reserved_in_bytes();
|
||||
size_t curr_capacity = MetaspaceAux::capacity_in_bytes();
|
||||
size_t used = MetaspaceAux::used_in_bytes_unsafe();
|
||||
size_t used = MetaspaceAux::used_in_bytes();
|
||||
|
||||
initialize(min_capacity, max_capacity, curr_capacity, used);
|
||||
}
|
||||
@ -131,7 +131,7 @@ void MetaspaceCounters::update_capacity() {
|
||||
|
||||
void MetaspaceCounters::update_used() {
|
||||
assert(UsePerfData, "Should not be called unless being used");
|
||||
size_t used_in_bytes = MetaspaceAux::used_in_bytes_unsafe();
|
||||
size_t used_in_bytes = MetaspaceAux::used_in_bytes();
|
||||
_used->set_value(used_in_bytes);
|
||||
}
|
||||
|
||||
|
||||
@ -153,9 +153,9 @@ static void calculate_fingerprints() {
|
||||
//
|
||||
// Execution time:
|
||||
// First virtual method call for any object of these metadata types:
|
||||
// 1. object->klass->klass_part
|
||||
// 2. vtable entry for that klass_part points to the jump table entries
|
||||
// 3. branches to common_code with %O0/klass_part, %L0: Klass index <<8 + method index
|
||||
// 1. object->klass
|
||||
// 2. vtable entry for that klass points to the jump table entries
|
||||
// 3. branches to common_code with %O0/klass, %L0: Klass index <<8 + method index
|
||||
// 4. common_code:
|
||||
// Get address of new vtbl pointer for this Klass from updated table
|
||||
// Update new vtbl pointer in the Klass: future virtual calls go direct
|
||||
|
||||
@ -1036,7 +1036,7 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
|
||||
list = &_discoveredPhantomRefs[id];
|
||||
break;
|
||||
case REF_NONE:
|
||||
// we should not reach here if we are an instanceRefKlass
|
||||
// we should not reach here if we are an InstanceRefKlass
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ class SpecializationStats {
|
||||
public:
|
||||
enum Kind {
|
||||
ik, // InstanceKlass
|
||||
irk, // instanceRefKlass
|
||||
irk, // InstanceRefKlass
|
||||
oa, // objArrayKlass
|
||||
NUM_Kinds
|
||||
};
|
||||
|
||||
@ -435,9 +435,9 @@ static inline void add_vtable(void** list, int* n, void* o, int count) {
|
||||
void Universe::init_self_patching_vtbl_list(void** list, int count) {
|
||||
int n = 0;
|
||||
{ InstanceKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ instanceClassLoaderKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ instanceMirrorKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ instanceRefKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ InstanceClassLoaderKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ InstanceMirrorKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ InstanceRefKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ typeArrayKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ objArrayKlass o; add_vtable(list, &n, &o, count); }
|
||||
{ Method o; add_vtable(list, &n, &o, count); }
|
||||
@ -486,7 +486,7 @@ void Universe::fixup_mirrors(TRAPS) {
|
||||
assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded");
|
||||
HandleMark hm(THREAD);
|
||||
// Cache the start of the static fields
|
||||
instanceMirrorKlass::init_offset_of_static_fields();
|
||||
InstanceMirrorKlass::init_offset_of_static_fields();
|
||||
|
||||
GrowableArray <Klass*>* list = java_lang_Class::fixup_mirror_list();
|
||||
int list_length = list->length();
|
||||
@ -858,7 +858,7 @@ jint Universe::initialize_heap() {
|
||||
ReservedSpace Universe::reserve_heap(size_t heap_size, size_t alignment) {
|
||||
// Add in the class metaspace area so the classes in the headers can
|
||||
// be compressed the same as instances.
|
||||
size_t total_reserved = heap_size + ClassMetaspaceSize;
|
||||
size_t total_reserved = align_size_up(heap_size + ClassMetaspaceSize, alignment);
|
||||
char* addr = Universe::preferred_heap_base(total_reserved, Universe::UnscaledNarrowOop);
|
||||
|
||||
ReservedHeapSpace total_rs(total_reserved, alignment, UseLargePages, addr);
|
||||
|
||||
@ -152,6 +152,10 @@ void ConstantPool::initialize_resolved_references(ClassLoaderData* loader_data,
|
||||
|
||||
// CDS support. Create a new resolved_references array.
|
||||
void ConstantPool::restore_unshareable_info(TRAPS) {
|
||||
|
||||
// restore the C++ vtable from the shared archive
|
||||
restore_vtable();
|
||||
|
||||
if (SystemDictionary::Object_klass_loaded()) {
|
||||
// Recreate the object array and add to ClassLoaderData.
|
||||
int map_length = resolved_reference_length();
|
||||
|
||||
@ -643,6 +643,11 @@ class ConstantPool : public Metadata {
|
||||
void remove_unshareable_info();
|
||||
void restore_unshareable_info(TRAPS);
|
||||
bool resolve_class_constants(TRAPS);
|
||||
// The ConstantPool vtable is restored by this call when the ConstantPool is
|
||||
// in the shared archive. See patch_klass_vtables() in metaspaceShared.cpp for
|
||||
// all the gory details. SA, dtrace and pstack helpers distinguish metadata
|
||||
// by their vtable.
|
||||
void restore_vtable() { guarantee(is_constantPool(), "vtable restored by this call"); }
|
||||
|
||||
private:
|
||||
enum { _no_index_sentinel = -1, _possible_index_sentinel = -2 };
|
||||
|
||||
@ -243,17 +243,20 @@ void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index)
|
||||
}
|
||||
|
||||
|
||||
void ConstantPoolCacheEntry::set_method_handle(methodHandle adapter, Handle appendix,
|
||||
void ConstantPoolCacheEntry::set_method_handle(constantPoolHandle cpool,
|
||||
methodHandle adapter, Handle appendix,
|
||||
objArrayHandle resolved_references) {
|
||||
set_method_handle_common(Bytecodes::_invokehandle, adapter, appendix, resolved_references);
|
||||
set_method_handle_common(cpool, Bytecodes::_invokehandle, adapter, appendix, resolved_references);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(methodHandle adapter, Handle appendix,
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(constantPoolHandle cpool,
|
||||
methodHandle adapter, Handle appendix,
|
||||
objArrayHandle resolved_references) {
|
||||
set_method_handle_common(Bytecodes::_invokedynamic, adapter, appendix, resolved_references);
|
||||
set_method_handle_common(cpool, Bytecodes::_invokedynamic, adapter, appendix, resolved_references);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_method_handle_common(Bytecodes::Code invoke_code,
|
||||
void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
Bytecodes::Code invoke_code,
|
||||
methodHandle adapter,
|
||||
Handle appendix,
|
||||
objArrayHandle resolved_references) {
|
||||
@ -261,28 +264,23 @@ void ConstantPoolCacheEntry::set_method_handle_common(Bytecodes::Code invoke_cod
|
||||
// There are three words to update: flags, refs[f2], f1 (in that order).
|
||||
// Writers must store all other values before f1.
|
||||
// Readers must test f1 first for non-null before reading other fields.
|
||||
// Competing writers must acquire exclusive access on the first
|
||||
// write, to flags, using a compare/exchange.
|
||||
// A losing writer to flags must spin until the winner writes f1,
|
||||
// so that when he returns, he can use the linked cache entry.
|
||||
// Competing writers must acquire exclusive access via a lock.
|
||||
// A losing writer waits on the lock until the winner writes f1 and leaves
|
||||
// the lock, so that when the losing writer returns, he can use the linked
|
||||
// cache entry.
|
||||
|
||||
MonitorLockerEx ml(cpool->lock());
|
||||
if (!is_f1_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool has_appendix = appendix.not_null();
|
||||
|
||||
// Write the flags.
|
||||
bool owner =
|
||||
init_method_flags_atomic(as_TosState(adapter->result_type()),
|
||||
set_method_flags(as_TosState(adapter->result_type()),
|
||||
((has_appendix ? 1 : 0) << has_appendix_shift) |
|
||||
( 1 << is_final_shift),
|
||||
adapter->size_of_parameters());
|
||||
if (!owner) {
|
||||
// Somebody else is working on the same CPCE. Let them proceed.
|
||||
while (is_f1_null()) {
|
||||
// Pause momentarily on a low-level lock, to allow racing thread to win.
|
||||
MutexLockerEx mu(Patching_lock, Mutex::_no_safepoint_check_flag);
|
||||
os::yield();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (TraceInvokeDynamic) {
|
||||
tty->print_cr("set_method_handle bc=%d appendix="PTR_FORMAT"%s method="PTR_FORMAT" ",
|
||||
|
||||
@ -221,12 +221,14 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
);
|
||||
|
||||
void set_method_handle(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
methodHandle method, // adapter for invokeExact, etc.
|
||||
Handle appendix, // stored in refs[f2]; could be a java.lang.invoke.MethodType
|
||||
objArrayHandle resolved_references
|
||||
);
|
||||
|
||||
void set_dynamic_call(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
methodHandle method, // adapter for this call site
|
||||
Handle appendix, // stored in refs[f2]; could be a java.lang.invoke.CallSite
|
||||
objArrayHandle resolved_references
|
||||
@ -248,6 +250,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
// resolution logic needs to make slightly different assessments about the
|
||||
// number and types of arguments.
|
||||
void set_method_handle_common(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
Bytecodes::Code invoke_code, // _invokehandle or _invokedynamic
|
||||
methodHandle adapter, // invoker method (f1)
|
||||
Handle appendix, // appendix such as CallSite, MethodType, etc. (refs[f2])
|
||||
|
||||
@ -49,14 +49,14 @@
|
||||
"Inconsistency in do_metadata"); \
|
||||
if (closure->do_metadata##nv_suffix())
|
||||
|
||||
// Macro to define instanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for
|
||||
// Macro to define InstanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for
|
||||
// all closures. Macros calling macros above for each oop size.
|
||||
// Since ClassLoader objects have only a pointer to the loader_data, they are not
|
||||
// compressed nor does the pointer move.
|
||||
|
||||
#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)\
|
||||
\
|
||||
int instanceClassLoaderKlass:: \
|
||||
int InstanceClassLoaderKlass:: \
|
||||
oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* Get size before changing pointers */ \
|
||||
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
|
||||
@ -76,7 +76,7 @@ oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
|
||||
#ifndef SERIALGC
|
||||
#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceClassLoaderKlass:: \
|
||||
int InstanceClassLoaderKlass:: \
|
||||
oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* Get size before changing pointers */ \
|
||||
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
|
||||
@ -88,7 +88,7 @@ oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {
|
||||
|
||||
#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceClassLoaderKlass:: \
|
||||
int InstanceClassLoaderKlass:: \
|
||||
oop_oop_iterate##nv_suffix##_m(oop obj, \
|
||||
OopClosureType* closure, \
|
||||
MemRegion mr) { \
|
||||
@ -118,7 +118,7 @@ ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARD
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m)
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m)
|
||||
|
||||
void instanceClassLoaderKlass::oop_follow_contents(oop obj) {
|
||||
void InstanceClassLoaderKlass::oop_follow_contents(oop obj) {
|
||||
InstanceKlass::oop_follow_contents(obj);
|
||||
ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj);
|
||||
|
||||
@ -130,7 +130,7 @@ void instanceClassLoaderKlass::oop_follow_contents(oop obj) {
|
||||
}
|
||||
|
||||
#ifndef SERIALGC
|
||||
void instanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
void InstanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
oop obj) {
|
||||
InstanceKlass::oop_follow_contents(cm, obj);
|
||||
ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj);
|
||||
@ -139,7 +139,7 @@ void instanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
}
|
||||
}
|
||||
|
||||
void instanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
void InstanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
InstanceKlass::oop_push_contents(pm, obj);
|
||||
|
||||
// This is called by the young collector. It will already have taken care of
|
||||
@ -147,7 +147,7 @@ void instanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj
|
||||
// class loader data link.
|
||||
}
|
||||
|
||||
int instanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
int InstanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
InstanceKlass::oop_update_pointers(cm, obj);
|
||||
ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj);
|
||||
if (loader_data != NULL) {
|
||||
|
||||
@ -27,24 +27,24 @@
|
||||
|
||||
#include "oops/instanceKlass.hpp"
|
||||
|
||||
// An instanceClassLoaderKlass is a specialization of the InstanceKlass. It does
|
||||
// An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does
|
||||
// not add any field. It is added to walk the dependencies for the class loader
|
||||
// key that this class loader points to. This is how the loader_data graph is
|
||||
// walked and dependant class loaders are kept alive. I thought we walked
|
||||
// the list later?
|
||||
|
||||
class instanceClassLoaderKlass: public InstanceKlass {
|
||||
class InstanceClassLoaderKlass: public InstanceKlass {
|
||||
friend class VMStructs;
|
||||
friend class InstanceKlass;
|
||||
|
||||
// Constructor
|
||||
instanceClassLoaderKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
|
||||
InstanceClassLoaderKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
|
||||
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {}
|
||||
|
||||
public:
|
||||
virtual bool oop_is_instanceClassLoader() const { return true; }
|
||||
|
||||
instanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
|
||||
// Iterators
|
||||
int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) {
|
||||
|
||||
@ -191,14 +191,14 @@ Klass* InstanceKlass::allocate_instance_klass(ClassLoaderData* loader_data,
|
||||
InstanceKlass* ik;
|
||||
if (rt == REF_NONE) {
|
||||
if (name == vmSymbols::java_lang_Class()) {
|
||||
ik = new (loader_data, size, THREAD) instanceMirrorKlass(
|
||||
ik = new (loader_data, size, THREAD) InstanceMirrorKlass(
|
||||
vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt,
|
||||
access_flags, !host_klass.is_null());
|
||||
} else if (name == vmSymbols::java_lang_ClassLoader() ||
|
||||
(SystemDictionary::ClassLoader_klass_loaded() &&
|
||||
super_klass != NULL &&
|
||||
super_klass->is_subtype_of(SystemDictionary::ClassLoader_klass()))) {
|
||||
ik = new (loader_data, size, THREAD) instanceClassLoaderKlass(
|
||||
ik = new (loader_data, size, THREAD) InstanceClassLoaderKlass(
|
||||
vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt,
|
||||
access_flags, !host_klass.is_null());
|
||||
} else {
|
||||
@ -209,7 +209,7 @@ Klass* InstanceKlass::allocate_instance_klass(ClassLoaderData* loader_data,
|
||||
}
|
||||
} else {
|
||||
// reference klass
|
||||
ik = new (loader_data, size, THREAD) instanceRefKlass(
|
||||
ik = new (loader_data, size, THREAD) InstanceRefKlass(
|
||||
vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt,
|
||||
access_flags, !host_klass.is_null());
|
||||
}
|
||||
@ -2165,6 +2165,8 @@ void InstanceKlass::restore_unshareable_info(TRAPS) {
|
||||
for (int index2 = 0; index2 < num_methods; ++index2) {
|
||||
methodHandle m(THREAD, methods->at(index2));
|
||||
m()->link_method(m, CHECK);
|
||||
// restore method's vtable by calling a virtual function
|
||||
m->restore_vtable();
|
||||
}
|
||||
if (JvmtiExport::has_redefined_a_class()) {
|
||||
// Reinitialize vtable because RedefineClasses may have changed some
|
||||
@ -2282,7 +2284,7 @@ void InstanceKlass::set_source_debug_extension(char* array, int length) {
|
||||
}
|
||||
|
||||
address InstanceKlass::static_field_addr(int offset) {
|
||||
return (address)(offset + instanceMirrorKlass::offset_of_static_fields() + (intptr_t)java_mirror());
|
||||
return (address)(offset + InstanceMirrorKlass::offset_of_static_fields() + (intptr_t)java_mirror());
|
||||
}
|
||||
|
||||
|
||||
@ -3071,7 +3073,7 @@ void JNIid::deallocate(JNIid* current) {
|
||||
|
||||
|
||||
void JNIid::verify(Klass* holder) {
|
||||
int first_field_offset = instanceMirrorKlass::offset_of_static_fields();
|
||||
int first_field_offset = InstanceMirrorKlass::offset_of_static_fields();
|
||||
int end_field_offset;
|
||||
end_field_offset = first_field_offset + (InstanceKlass::cast(holder)->static_field_size() * wordSize);
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
#include "oops/oop.pcgc.inline.hpp"
|
||||
#endif
|
||||
|
||||
int instanceMirrorKlass::_offset_of_static_fields = 0;
|
||||
int InstanceMirrorKlass::_offset_of_static_fields = 0;
|
||||
|
||||
#ifdef ASSERT
|
||||
template <class T> void assert_is_in(T *p) {
|
||||
@ -148,7 +148,7 @@ template <class T> void assert_nothing(T *p) {}
|
||||
}
|
||||
|
||||
|
||||
void instanceMirrorKlass::oop_follow_contents(oop obj) {
|
||||
void InstanceMirrorKlass::oop_follow_contents(oop obj) {
|
||||
InstanceKlass::oop_follow_contents(obj);
|
||||
|
||||
// Follow the klass field in the mirror.
|
||||
@ -169,7 +169,7 @@ void instanceMirrorKlass::oop_follow_contents(oop obj) {
|
||||
}
|
||||
|
||||
#ifndef SERIALGC
|
||||
void instanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
oop obj) {
|
||||
InstanceKlass::oop_follow_contents(cm, obj);
|
||||
|
||||
@ -191,7 +191,7 @@ void instanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
}
|
||||
#endif // SERIALGC
|
||||
|
||||
int instanceMirrorKlass::oop_adjust_pointers(oop obj) {
|
||||
int InstanceMirrorKlass::oop_adjust_pointers(oop obj) {
|
||||
int size = oop_size(obj);
|
||||
InstanceKlass::oop_adjust_pointers(obj);
|
||||
|
||||
@ -235,12 +235,12 @@ int instanceMirrorKlass::oop_adjust_pointers(oop obj) {
|
||||
"Inconsistency in do_metadata"); \
|
||||
if (closure->do_metadata##nv_suffix())
|
||||
|
||||
// Macro to define instanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for
|
||||
// Macro to define InstanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for
|
||||
// all closures. Macros calling macros above for each oop size.
|
||||
|
||||
#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceMirrorKlass:: \
|
||||
int InstanceMirrorKlass:: \
|
||||
oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* Get size before changing pointers */ \
|
||||
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \
|
||||
@ -265,7 +265,7 @@ oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
|
||||
#ifndef SERIALGC
|
||||
#define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceMirrorKlass:: \
|
||||
int InstanceMirrorKlass:: \
|
||||
oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* Get size before changing pointers */ \
|
||||
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \
|
||||
@ -283,7 +283,7 @@ oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {
|
||||
|
||||
#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceMirrorKlass:: \
|
||||
int InstanceMirrorKlass:: \
|
||||
oop_oop_iterate##nv_suffix##_m(oop obj, \
|
||||
OopClosureType* closure, \
|
||||
MemRegion mr) { \
|
||||
@ -318,7 +318,7 @@ ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m)
|
||||
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m)
|
||||
|
||||
#ifndef SERIALGC
|
||||
void instanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
void InstanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
// Note that we don't have to follow the mirror -> klass pointer, since all
|
||||
// klasses that are dirty will be scavenged when we iterate over the
|
||||
// ClassLoaderData objects.
|
||||
@ -332,7 +332,7 @@ void instanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
assert_nothing )
|
||||
}
|
||||
|
||||
int instanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
int InstanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
int size = oop_size(obj);
|
||||
InstanceKlass::oop_update_pointers(cm, obj);
|
||||
|
||||
@ -355,14 +355,14 @@ int instanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj)
|
||||
}
|
||||
#endif // SERIALGC
|
||||
|
||||
int instanceMirrorKlass::instance_size(KlassHandle k) {
|
||||
int InstanceMirrorKlass::instance_size(KlassHandle k) {
|
||||
if (k() != NULL && k->oop_is_instance()) {
|
||||
return align_object_size(size_helper() + InstanceKlass::cast(k())->static_field_size());
|
||||
}
|
||||
return size_helper();
|
||||
}
|
||||
|
||||
instanceOop instanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
|
||||
instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
|
||||
// Query before forming handle.
|
||||
int size = instance_size(k);
|
||||
KlassHandle h_k(THREAD, this);
|
||||
@ -370,11 +370,11 @@ instanceOop instanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
|
||||
return i;
|
||||
}
|
||||
|
||||
int instanceMirrorKlass::oop_size(oop obj) const {
|
||||
int InstanceMirrorKlass::oop_size(oop obj) const {
|
||||
return java_lang_Class::oop_size(obj);
|
||||
}
|
||||
|
||||
int instanceMirrorKlass::compute_static_oop_field_count(oop obj) {
|
||||
int InstanceMirrorKlass::compute_static_oop_field_count(oop obj) {
|
||||
Klass* k = java_lang_Class::as_Klass(obj);
|
||||
if (k != NULL && k->oop_is_instance()) {
|
||||
return InstanceKlass::cast(k)->static_oop_field_count();
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include "oops/instanceKlass.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
|
||||
// An instanceMirrorKlass is a specialized InstanceKlass for
|
||||
// An InstanceMirrorKlass is a specialized InstanceKlass for
|
||||
// java.lang.Class instances. These instances are special because
|
||||
// they contain the static fields of the class in addition to the
|
||||
// normal fields of Class. This means they are variable sized
|
||||
@ -37,7 +37,7 @@
|
||||
// iteration of their oops.
|
||||
|
||||
|
||||
class instanceMirrorKlass: public InstanceKlass {
|
||||
class InstanceMirrorKlass: public InstanceKlass {
|
||||
friend class VMStructs;
|
||||
friend class InstanceKlass;
|
||||
|
||||
@ -45,18 +45,18 @@ class instanceMirrorKlass: public InstanceKlass {
|
||||
static int _offset_of_static_fields;
|
||||
|
||||
// Constructor
|
||||
instanceMirrorKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
|
||||
InstanceMirrorKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
|
||||
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {}
|
||||
|
||||
public:
|
||||
instanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
InstanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
// Type testing
|
||||
bool oop_is_instanceMirror() const { return true; }
|
||||
|
||||
// Casting from Klass*
|
||||
static instanceMirrorKlass* cast(Klass* k) {
|
||||
assert(k->oop_is_instanceMirror(), "cast to instanceMirrorKlass");
|
||||
return (instanceMirrorKlass*) k;
|
||||
static InstanceMirrorKlass* cast(Klass* k) {
|
||||
assert(k->oop_is_instanceMirror(), "cast to InstanceMirrorKlass");
|
||||
return (InstanceMirrorKlass*) k;
|
||||
}
|
||||
|
||||
// Returns the size of the instance including the extra static fields.
|
||||
@ -71,7 +71,7 @@ class instanceMirrorKlass: public InstanceKlass {
|
||||
static void init_offset_of_static_fields() {
|
||||
// Cache the offset of the static fields in the Class instance
|
||||
assert(_offset_of_static_fields == 0, "once");
|
||||
_offset_of_static_fields = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize;
|
||||
_offset_of_static_fields = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize;
|
||||
}
|
||||
|
||||
static int offset_of_static_fields() {
|
||||
|
||||
@ -45,12 +45,12 @@
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
|
||||
void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
|
||||
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
|
||||
T heap_oop = oopDesc::load_heap_oop(referent_addr);
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr("instanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
|
||||
}
|
||||
)
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
@ -112,7 +112,7 @@ void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
|
||||
ref->InstanceKlass::oop_follow_contents(obj);
|
||||
}
|
||||
|
||||
void instanceRefKlass::oop_follow_contents(oop obj) {
|
||||
void InstanceRefKlass::oop_follow_contents(oop obj) {
|
||||
if (UseCompressedOops) {
|
||||
specialized_oop_follow_contents<narrowOop>(this, obj);
|
||||
} else {
|
||||
@ -122,14 +122,14 @@ void instanceRefKlass::oop_follow_contents(oop obj) {
|
||||
|
||||
#ifndef SERIALGC
|
||||
template <class T>
|
||||
void specialized_oop_follow_contents(instanceRefKlass* ref,
|
||||
void specialized_oop_follow_contents(InstanceRefKlass* ref,
|
||||
ParCompactionManager* cm,
|
||||
oop obj) {
|
||||
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
|
||||
T heap_oop = oopDesc::load_heap_oop(referent_addr);
|
||||
debug_only(
|
||||
if(TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr("instanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
|
||||
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
|
||||
}
|
||||
)
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
@ -186,7 +186,7 @@ void specialized_oop_follow_contents(instanceRefKlass* ref,
|
||||
ref->InstanceKlass::oop_follow_contents(cm, obj);
|
||||
}
|
||||
|
||||
void instanceRefKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
void InstanceRefKlass::oop_follow_contents(ParCompactionManager* cm,
|
||||
oop obj) {
|
||||
if (UseCompressedOops) {
|
||||
specialized_oop_follow_contents<narrowOop>(this, cm, obj);
|
||||
@ -218,18 +218,18 @@ template <class T> void trace_reference_gc(const char *s, oop obj,
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T> void specialized_oop_adjust_pointers(instanceRefKlass *ref, oop obj) {
|
||||
template <class T> void specialized_oop_adjust_pointers(InstanceRefKlass *ref, oop obj) {
|
||||
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
|
||||
MarkSweep::adjust_pointer(referent_addr);
|
||||
T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj);
|
||||
MarkSweep::adjust_pointer(next_addr);
|
||||
T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
|
||||
MarkSweep::adjust_pointer(discovered_addr);
|
||||
debug_only(trace_reference_gc("instanceRefKlass::oop_adjust_pointers", obj,
|
||||
debug_only(trace_reference_gc("InstanceRefKlass::oop_adjust_pointers", obj,
|
||||
referent_addr, next_addr, discovered_addr);)
|
||||
}
|
||||
|
||||
int instanceRefKlass::oop_adjust_pointers(oop obj) {
|
||||
int InstanceRefKlass::oop_adjust_pointers(oop obj) {
|
||||
int size = size_helper();
|
||||
InstanceKlass::oop_adjust_pointers(obj);
|
||||
|
||||
@ -298,12 +298,12 @@ int instanceRefKlass::oop_adjust_pointers(oop obj) {
|
||||
|
||||
template <class T> bool contains(T *t) { return true; }
|
||||
|
||||
// Macro to define instanceRefKlass::oop_oop_iterate for virtual/nonvirtual for
|
||||
// Macro to define InstanceRefKlass::oop_oop_iterate for virtual/nonvirtual for
|
||||
// all closures. Macros calling macros above for each oop size.
|
||||
|
||||
#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceRefKlass:: \
|
||||
int InstanceRefKlass:: \
|
||||
oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* Get size before changing pointers */ \
|
||||
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
|
||||
@ -320,7 +320,7 @@ oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
|
||||
#ifndef SERIALGC
|
||||
#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceRefKlass:: \
|
||||
int InstanceRefKlass:: \
|
||||
oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* Get size before changing pointers */ \
|
||||
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
|
||||
@ -338,7 +338,7 @@ oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {
|
||||
|
||||
#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
|
||||
\
|
||||
int instanceRefKlass:: \
|
||||
int InstanceRefKlass:: \
|
||||
oop_oop_iterate##nv_suffix##_m(oop obj, \
|
||||
OopClosureType* closure, \
|
||||
MemRegion mr) { \
|
||||
@ -363,7 +363,7 @@ ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m)
|
||||
|
||||
#ifndef SERIALGC
|
||||
template <class T>
|
||||
void specialized_oop_push_contents(instanceRefKlass *ref,
|
||||
void specialized_oop_push_contents(InstanceRefKlass *ref,
|
||||
PSPromotionManager* pm, oop obj) {
|
||||
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
|
||||
if (PSScavenge::should_scavenge(referent_addr)) {
|
||||
@ -414,7 +414,7 @@ void specialized_oop_push_contents(instanceRefKlass *ref,
|
||||
ref->InstanceKlass::oop_push_contents(pm, obj);
|
||||
}
|
||||
|
||||
void instanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
void InstanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
if (UseCompressedOops) {
|
||||
specialized_oop_push_contents<narrowOop>(this, pm, obj);
|
||||
} else {
|
||||
@ -423,7 +423,7 @@ void instanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void specialized_oop_update_pointers(instanceRefKlass *ref,
|
||||
void specialized_oop_update_pointers(InstanceRefKlass *ref,
|
||||
ParCompactionManager* cm, oop obj) {
|
||||
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
|
||||
PSParallelCompact::adjust_pointer(referent_addr);
|
||||
@ -431,11 +431,11 @@ void specialized_oop_update_pointers(instanceRefKlass *ref,
|
||||
PSParallelCompact::adjust_pointer(next_addr);
|
||||
T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
|
||||
PSParallelCompact::adjust_pointer(discovered_addr);
|
||||
debug_only(trace_reference_gc("instanceRefKlass::oop_update_ptrs", obj,
|
||||
debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj,
|
||||
referent_addr, next_addr, discovered_addr);)
|
||||
}
|
||||
|
||||
int instanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
int InstanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
InstanceKlass::oop_update_pointers(cm, obj);
|
||||
if (UseCompressedOops) {
|
||||
specialized_oop_update_pointers<narrowOop>(this, cm, obj);
|
||||
@ -446,7 +446,7 @@ int instanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||
}
|
||||
#endif // SERIALGC
|
||||
|
||||
void instanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
|
||||
void InstanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
|
||||
// Clear the nonstatic oop-map entries corresponding to referent
|
||||
// and nextPending field. They are treated specially by the
|
||||
// garbage collector.
|
||||
@ -485,7 +485,7 @@ void instanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
|
||||
|
||||
// Verification
|
||||
|
||||
void instanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
|
||||
void InstanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
|
||||
InstanceKlass::oop_verify_on(obj, st);
|
||||
// Verify referent field
|
||||
oop referent = java_lang_ref_Reference::referent(obj);
|
||||
@ -506,13 +506,13 @@ void instanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
|
||||
}
|
||||
}
|
||||
|
||||
bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
|
||||
bool InstanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
|
||||
if (java_lang_ref_Reference::pending_list_lock() == NULL) return false;
|
||||
Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock());
|
||||
return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock);
|
||||
}
|
||||
|
||||
void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) {
|
||||
void InstanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) {
|
||||
// we may enter this with pending exception set
|
||||
PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument
|
||||
|
||||
@ -529,7 +529,7 @@ void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_l
|
||||
if (HAS_PENDING_EXCEPTION) CLEAR_PENDING_EXCEPTION;
|
||||
}
|
||||
|
||||
void instanceRefKlass::release_and_notify_pending_list_lock(
|
||||
void InstanceRefKlass::release_and_notify_pending_list_lock(
|
||||
BasicLock *pending_list_basic_lock) {
|
||||
// we may enter this with pending exception set
|
||||
PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
#include "oops/instanceKlass.hpp"
|
||||
|
||||
// An instanceRefKlass is a specialized InstanceKlass for Java
|
||||
// An InstanceRefKlass is a specialized InstanceKlass for Java
|
||||
// classes that are subclasses of java/lang/ref/Reference.
|
||||
//
|
||||
// These classes are used to implement soft/weak/final/phantom
|
||||
@ -44,22 +44,22 @@
|
||||
// and the pending list lock object in the same class is notified.
|
||||
|
||||
|
||||
class instanceRefKlass: public InstanceKlass {
|
||||
class InstanceRefKlass: public InstanceKlass {
|
||||
friend class InstanceKlass;
|
||||
|
||||
// Constructor
|
||||
instanceRefKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
|
||||
InstanceRefKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
|
||||
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {}
|
||||
|
||||
public:
|
||||
instanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
InstanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
// Type testing
|
||||
bool oop_is_instanceRef() const { return true; }
|
||||
|
||||
// Casting from Klass*
|
||||
static instanceRefKlass* cast(Klass* k) {
|
||||
assert(k->oop_is_instanceRef(), "cast to instanceRefKlass");
|
||||
return (instanceRefKlass*) k;
|
||||
static InstanceRefKlass* cast(Klass* k) {
|
||||
assert(k->oop_is_instanceRef(), "cast to InstanceRefKlass");
|
||||
return (InstanceRefKlass*) k;
|
||||
}
|
||||
|
||||
// Garbage collection
|
||||
|
||||
@ -376,7 +376,7 @@ void Method::print_invocation_count() {
|
||||
void Method::build_interpreter_method_data(methodHandle method, TRAPS) {
|
||||
// Do not profile method if current thread holds the pending list lock,
|
||||
// which avoids deadlock for acquiring the MethodData_lock.
|
||||
if (instanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
|
||||
if (InstanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -168,9 +168,16 @@ class Method : public Metadata {
|
||||
TRAPS);
|
||||
|
||||
Method() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
|
||||
|
||||
// The Method vtable is restored by this call when the Method is in the
|
||||
// shared archive. See patch_klass_vtables() in metaspaceShared.cpp for
|
||||
// all the gory details. SA, dtrace and pstack helpers distinguish metadata
|
||||
// by their vtable.
|
||||
void restore_vtable() { guarantee(is_method(), "vtable restored by this call"); }
|
||||
bool is_method() const volatile { return true; }
|
||||
|
||||
// accessors for instance variables
|
||||
|
||||
ConstMethod* constMethod() const { return _constMethod; }
|
||||
void set_constMethod(ConstMethod* xconst) { _constMethod = xconst; }
|
||||
|
||||
|
||||
@ -169,9 +169,9 @@ class CompiledICHolder;
|
||||
|
||||
class Klass;
|
||||
class InstanceKlass;
|
||||
class instanceMirrorKlass;
|
||||
class instanceClassLoaderKlass;
|
||||
class instanceRefKlass;
|
||||
class InstanceMirrorKlass;
|
||||
class InstanceClassLoaderKlass;
|
||||
class InstanceRefKlass;
|
||||
class arrayKlass;
|
||||
class objArrayKlass;
|
||||
class typeArrayKlass;
|
||||
|
||||
@ -1148,7 +1148,7 @@ const TypeFunc *OptoRuntime::dtrace_method_entry_exit_Type() {
|
||||
// create input type (domain)
|
||||
const Type **fields = TypeTuple::fields(2);
|
||||
fields[TypeFunc::Parms+0] = TypeRawPtr::BOTTOM; // Thread-local storage
|
||||
fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL; // Method*; Method we are entering
|
||||
fields[TypeFunc::Parms+1] = TypeMetadataPtr::BOTTOM; // Method*; Method we are entering
|
||||
const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
|
||||
|
||||
// create result type (range)
|
||||
|
||||
@ -2380,7 +2380,7 @@ TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int
|
||||
assert(this->isa_instptr(), "must be an instance ptr.");
|
||||
_is_ptr_to_narrowoop = false;
|
||||
} else if (klass() == ciEnv::current()->Class_klass() &&
|
||||
_offset >= instanceMirrorKlass::offset_of_static_fields()) {
|
||||
_offset >= InstanceMirrorKlass::offset_of_static_fields()) {
|
||||
// Static fields
|
||||
assert(o != NULL, "must be constant");
|
||||
ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
|
||||
|
||||
@ -2552,15 +2552,17 @@ class SimpleRootsClosure : public OopClosure {
|
||||
return;
|
||||
}
|
||||
|
||||
jvmtiHeapReferenceKind kind = root_kind();
|
||||
|
||||
assert(Universe::heap()->is_in_reserved(o), "should be impossible");
|
||||
|
||||
jvmtiHeapReferenceKind kind = root_kind();
|
||||
if (kind == JVMTI_HEAP_REFERENCE_SYSTEM_CLASS) {
|
||||
// SystemDictionary::always_strong_oops_do reports the application
|
||||
// class loader as a root. We want this root to be reported as
|
||||
// a root kind of "OTHER" rather than "SYSTEM_CLASS".
|
||||
if (o->is_instance() && root_kind() == JVMTI_HEAP_REFERENCE_SYSTEM_CLASS) {
|
||||
if (!o->is_instanceMirror()) {
|
||||
kind = JVMTI_HEAP_REFERENCE_OTHER;
|
||||
}
|
||||
}
|
||||
|
||||
// some objects are ignored - in the case of simple
|
||||
// roots it's mostly Symbol*s that we are skipping
|
||||
@ -2790,7 +2792,7 @@ inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
|
||||
static inline bool verify_static_oop(InstanceKlass* ik,
|
||||
oop mirror, int offset) {
|
||||
address obj_p = (address)mirror + offset;
|
||||
address start = (address)instanceMirrorKlass::start_of_static_fields(mirror);
|
||||
address start = (address)InstanceMirrorKlass::start_of_static_fields(mirror);
|
||||
address end = start + (java_lang_Class::static_oop_field_count(mirror) * heapOopSize);
|
||||
assert(end >= start, "sanity check");
|
||||
|
||||
@ -2991,7 +2993,8 @@ inline bool VM_HeapWalkOperation::collect_simple_roots() {
|
||||
// Preloaded classes and loader from the system dictionary
|
||||
blk.set_kind(JVMTI_HEAP_REFERENCE_SYSTEM_CLASS);
|
||||
SystemDictionary::always_strong_oops_do(&blk);
|
||||
ClassLoaderDataGraph::always_strong_oops_do(&blk, NULL, false);
|
||||
KlassToOopClosure klass_blk(&blk);
|
||||
ClassLoaderDataGraph::always_strong_oops_do(&blk, &klass_blk, false);
|
||||
if (blk.stopped()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1427,6 +1427,16 @@ void Arguments::set_ergonomics_flags() {
|
||||
// if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
|
||||
// FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
|
||||
// }
|
||||
// Set the ClassMetaspaceSize to something that will not need to be
|
||||
// expanded, since it cannot be expanded.
|
||||
if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
|
||||
// 100,000 classes seems like a good size, so 100M assumes around 1K
|
||||
// per klass. The vtable and oopMap is embedded so we don't have a fixed
|
||||
// size per klass. Eventually, this will be parameterized because it
|
||||
// would also be useful to determine the optimal size of the
|
||||
// systemDictionary.
|
||||
FLAG_SET_ERGO(uintx, ClassMetaspaceSize, 100*M);
|
||||
}
|
||||
}
|
||||
// Also checks that certain machines are slower with compressed oops
|
||||
// in vm_version initialization code.
|
||||
@ -1965,6 +1975,9 @@ bool Arguments::check_vm_args_consistency() {
|
||||
|
||||
status = status && verify_object_alignment();
|
||||
|
||||
status = status && verify_min_value(ClassMetaspaceSize, 1*M,
|
||||
"ClassMetaspaceSize");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -2916,7 +2929,7 @@ void Arguments::set_shared_spaces_flags() {
|
||||
(UseLargePages && FLAG_IS_CMDLINE(UseLargePages));
|
||||
if (cannot_share) {
|
||||
if (must_share) {
|
||||
warning("disabling large pages%s"
|
||||
warning("disabling large pages %s"
|
||||
"because of %s", "" LP64_ONLY("and compressed oops "),
|
||||
DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
|
||||
FLAG_SET_CMDLINE(bool, UseLargePages, false);
|
||||
|
||||
@ -2993,7 +2993,7 @@ class CommandLineFlags {
|
||||
product(uintx, MaxMetaspaceSize, max_uintx, \
|
||||
"Maximum size of Metaspaces (in bytes)") \
|
||||
\
|
||||
product(uintx, ClassMetaspaceSize, NOT_LP64(1*M) LP64_ONLY(512*M), \
|
||||
product(uintx, ClassMetaspaceSize, 2*M, \
|
||||
"Maximum size of InstanceKlass area in Metaspace used for " \
|
||||
"UseCompressedKlassPointers") \
|
||||
\
|
||||
|
||||
@ -1374,9 +1374,9 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
|
||||
declare_type(objArrayKlass, arrayKlass) \
|
||||
declare_type(typeArrayKlass, arrayKlass) \
|
||||
declare_type(InstanceKlass, Klass) \
|
||||
declare_type(instanceClassLoaderKlass, InstanceKlass) \
|
||||
declare_type(instanceMirrorKlass, InstanceKlass) \
|
||||
declare_type(instanceRefKlass, InstanceKlass) \
|
||||
declare_type(InstanceClassLoaderKlass, InstanceKlass) \
|
||||
declare_type(InstanceMirrorKlass, InstanceKlass) \
|
||||
declare_type(InstanceRefKlass, InstanceKlass) \
|
||||
declare_type(ConstantPool, Metadata) \
|
||||
declare_type(ConstantPoolCache, MetaspaceObj) \
|
||||
declare_type(MethodData, Metadata) \
|
||||
|
||||
@ -213,7 +213,7 @@ BasicType name2type(const char* name) {
|
||||
|
||||
|
||||
// Map BasicType to size in words
|
||||
int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, -1};
|
||||
int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, -1};
|
||||
|
||||
BasicType type2field[T_CONFLICT+1] = {
|
||||
(BasicType)0, // 0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user