8230505: Replace JVM type comparisons to T_OBJECT and T_ARRAY with call to is_reference_type

Consistently use is_reference_type when comparing type for T_OBJECT or T_ARRAY.

Co-authored-by: John Rose <john.r.rose@oracle.com>
Reviewed-by: dlong, coleenp, hseigel
This commit is contained in:
Lois Foltan 2019-09-23 14:49:04 -04:00
parent c080a4a4d5
commit 0c507f3180
67 changed files with 183 additions and 183 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -45,7 +45,7 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
Register reg2 = r_2->as_Register();
assert(reg2 == reg, "must be same register");
opr = as_long_opr(reg);
} else if (type == T_OBJECT || type == T_ARRAY) {
} else if (is_reference_type(type)) {
opr = as_oop_opr(reg);
} else if (type == T_METADATA) {
opr = as_metadata_opr(reg);

View File

@ -728,7 +728,7 @@ void LIR_Assembler::reg2reg(LIR_Opr src, LIR_Opr dest) {
move_regs(src->as_register(), dest->as_register());
} else if (dest->is_double_cpu()) {
if (src->type() == T_OBJECT || src->type() == T_ARRAY) {
if (is_reference_type(src->type()) {
// Surprising to me but we can see move of a long to t_object
__ verify_oop(src->as_register());
move_regs(src->as_register(), dest->as_register_lo());
@ -756,7 +756,7 @@ void LIR_Assembler::reg2reg(LIR_Opr src, LIR_Opr dest) {
void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool pop_fpu_stack) {
if (src->is_single_cpu()) {
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix()));
__ verify_oop(src->as_register());
} else if (type == T_METADATA || type == T_DOUBLE) {
@ -794,7 +794,7 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
return;
}
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ verify_oop(src->as_register());
if (UseCompressedOops && !wide) {
@ -869,7 +869,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
assert(dest->is_register(), "should not call otherwise");
if (dest->is_single_cpu()) {
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
__ verify_oop(dest->as_register());
} else if (type == T_METADATA) {
@ -1019,7 +1019,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
ShouldNotReachHere();
}
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
if (UseCompressedOops && !wide) {
__ decode_heap_oop(dest->as_register());
}
@ -1227,8 +1227,8 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
__ uxtw(len, len);
if (UseSlowPath ||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
(!UseFastNewObjectArray && is_reference_type(op->type())) ||
(!UseFastNewTypeArray && !is_reference_type(op->type()))) {
__ b(*op->stub()->entry());
} else {
Register tmp1 = op->tmp1()->as_register();
@ -1948,10 +1948,10 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
if (opr2->is_single_cpu()) {
// cpu register - cpu register
Register reg2 = opr2->as_register();
if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
if (is_reference_type(opr1->type())) {
__ cmpoop(reg1, reg2);
} else {
assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY, "cmp int, oop?");
assert(!is_reference_type(opr2->type()), "cmp int, oop?");
__ cmpw(reg1, reg2);
}
return;
@ -2243,7 +2243,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
CodeStub* stub = op->stub();
int flags = op->flags();
BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
if (basic_type == T_ARRAY) basic_type = T_OBJECT;
if (is_reference_type(basic_type)) basic_type = T_OBJECT;
// if we don't know anything, just go through the generic arraycopy
if (default_type == NULL // || basic_type == T_OBJECT
@ -3131,7 +3131,7 @@ void LIR_Assembler::peephole(LIR_List *lir) {
void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp_op) {
Address addr = as_Address(src->as_address_ptr());
BasicType type = src->type();
bool is_oop = type == T_OBJECT || type == T_ARRAY;
bool is_oop = is_reference_type(type);
void (MacroAssembler::* add)(Register prev, RegisterOrConstant incr, Register addr);
void (MacroAssembler::* xchg)(Register prev, Register newv, Register addr);

View File

@ -733,7 +733,7 @@ LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_
new_value.load_item();
cmp_value.load_item();
LIR_Opr result = new_register(T_INT);
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
__ cas_obj(addr, cmp_value.result(), new_value.result(), new_register(T_INT), new_register(T_INT), result);
} else if (type == T_INT) {
__ cas_int(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), ill, ill);
@ -748,7 +748,7 @@ LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_
}
LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
bool is_oop = type == T_OBJECT || type == T_ARRAY;
bool is_oop = is_reference_type(type);
LIR_Opr result = new_register(type);
value.load_item();
assert(type == T_INT || is_oop LP64_ONLY( || type == T_LONG ), "unexpected type");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -251,7 +251,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Register dst, Address src, Register tmp1, Register tmp_thread) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
bool on_reference = on_weak || on_phantom;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -46,7 +46,7 @@ void ModRefBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Decorat
void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Address dst, Register val, Register tmp1, Register tmp2) {
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
oop_store_at(masm, decorators, type, dst, val, tmp1, tmp2);
} else {
BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
@ -94,7 +94,7 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt
value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
}
assert(type == T_INT || type == T_OBJECT || type == T_ARRAY LP64_ONLY( || type == T_LONG ), "unexpected type");
assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
LIR_Opr tmp = gen->new_register(T_INT);
__ xchg(access.resolved_addr(), value_opr, result, tmp);

View File

@ -317,7 +317,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Register dst, Address src, Register tmp1, Register tmp_thread) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
bool not_in_heap = (decorators & IN_NATIVE) != 0;
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
@ -352,7 +352,7 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Address dst, Register val, Register tmp1, Register tmp2) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
if (!on_oop) {
BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2);
return;

View File

@ -127,7 +127,7 @@ void ZBarrierSetAssembler::store_at(MacroAssembler* masm,
Register tmp1,
Register tmp2) {
// Verify value
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
// Note that src could be noreg, which means we
// are storing null and can skip verification.
if (val != noreg) {

View File

@ -1952,7 +1952,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
__ reset_last_Java_frame(false);
// Unbox oop result, e.g. JNIHandles::resolve result.
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
if (is_reference_type(ret_type)) {
__ resolve_jobject(r0, rthread, rscratch2);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -51,7 +51,7 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) {
}
if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
opr = as_long_opr(reg);
} else if (type == T_OBJECT || type == T_ARRAY) {
} else if (is_reference_type(type)) {
opr = as_oop_opr(reg);
} else if (type == T_METADATA) {
opr = as_metadata_opr(reg);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -107,8 +107,8 @@ bool LIR_Assembler::is_single_instruction(LIR_Op* op) {
}
if (UseCompressedOops) {
if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false;
if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
if (dst->is_address() && !dst->is_stack() && is_reference_type(dst->type())) return false;
if (src->is_address() && !src->is_stack() && is_reference_type(src->type())) return false;
}
if (UseCompressedClassPointers) {
@ -728,7 +728,7 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType
__ set(offset, O7);
store_offset = store(from_reg, base, O7, type, wide);
} else {
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ verify_oop(from_reg->as_register());
}
store_offset = code_offset();
@ -789,7 +789,7 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType
int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) {
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ verify_oop(from_reg->as_register());
}
int store_offset = code_offset();
@ -889,7 +889,7 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
}
default : ShouldNotReachHere();
}
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ verify_oop(to_reg->as_register());
}
}
@ -924,7 +924,7 @@ int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType
break;
default : ShouldNotReachHere();
}
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ verify_oop(to_reg->as_register());
}
return load_offset;
@ -1359,7 +1359,7 @@ void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) {
} else {
ShouldNotReachHere();
}
if (to_reg->type() == T_OBJECT || to_reg->type() == T_ARRAY) {
if (is_reference_type(to_reg->type())) {
__ verify_oop(to_reg->as_register());
}
}
@ -2295,8 +2295,8 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
__ signx(op->len()->as_register());
if (UseSlowPath ||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
(!UseFastNewObjectArray && is_reference_type(op->type())) ||
(!UseFastNewTypeArray && !is_reference_type(op->type()))) {
__ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
__ delayed()->nop();
} else {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -568,7 +568,7 @@ LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_
LIR_Opr t2 = FrameMap::G3_opr;
cmp_value.load_item();
new_value.load_item();
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
__ cas_obj(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), t1, t2);
} else if (type == T_INT) {
__ cas_int(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), t1, t2);
@ -583,7 +583,7 @@ LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_
}
LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
bool is_obj = type == T_OBJECT || type == T_ARRAY;
bool is_obj = is_reference_type(type);
LIR_Opr result = new_register(type);
LIR_Opr tmp = LIR_OprFact::illegalOpr;

View File

@ -450,7 +450,7 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet deco
void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Address src, Register dst, Register tmp) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
bool on_reference = on_weak || on_phantom;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -58,7 +58,7 @@ void ModRefBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Decorat
void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Register val, Address dst, Register tmp) {
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
oop_store_at(masm, decorators, type, val, dst, tmp);
} else {
BarrierSetAssembler::store_at(masm, decorators, type, val, dst, tmp);

View File

@ -561,7 +561,7 @@ void AdapterGenerator::gen_c2i_adapter(
if (r_1->is_Register()) {
Register r = r_1->as_Register()->after_restore();
if (sig_bt[i] == T_OBJECT || sig_bt[i] == T_ARRAY) {
if (is_reference_type(sig_bt[i])) {
store_c2i_object(r, base, st_off);
} else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) {
store_c2i_long(r, base, st_off, r_2->is_stack());
@ -1637,8 +1637,7 @@ static void verify_oop_args(MacroAssembler* masm,
Register temp_reg = G5_method; // not part of any compiled calling seq
if (VerifyOops) {
for (int i = 0; i < method->size_of_parameters(); i++) {
if (sig_bt[i] == T_OBJECT ||
sig_bt[i] == T_ARRAY) {
if (is_reference_type(sig_bt[i])) {
VMReg r = regs[i].first();
assert(r->is_valid(), "bad oop arg");
if (r->is_stack()) {
@ -2507,7 +2506,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
__ reset_last_Java_frame();
// Unbox oop result, e.g. JNIHandles::resolve value in I0.
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
if (is_reference_type(ret_type)) {
__ resolve_jobject(I0, G3_scratch);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,7 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
#else
opr = as_long_opr(reg2, reg);
#endif // _LP64
} else if (type == T_OBJECT || type == T_ARRAY) {
} else if (is_reference_type(type)) {
opr = as_oop_opr(reg);
} else if (type == T_METADATA) {
opr = as_metadata_opr(reg);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -861,7 +861,7 @@ void LIR_Assembler::reg2reg(LIR_Opr src, LIR_Opr dest) {
} else if (dest->is_double_cpu()) {
#ifdef _LP64
if (src->type() == T_OBJECT || src->type() == T_ARRAY) {
if (is_reference_type(src->type())) {
// Surprising to me but we can see move of a long to t_object
__ verify_oop(src->as_register());
move_regs(src->as_register(), dest->as_register_lo());
@ -932,7 +932,7 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po
if (src->is_single_cpu()) {
Address dst = frame_map()->address_for_slot(dest->single_stack_ix());
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
__ verify_oop(src->as_register());
__ movptr (dst, src->as_register());
} else if (type == T_METADATA) {
@ -978,7 +978,7 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
PatchingStub* patch = NULL;
Register compressed_src = rscratch1;
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ verify_oop(src->as_register());
#ifdef _LP64
if (UseCompressedOops && !wide) {
@ -1113,7 +1113,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
assert(dest->is_register(), "should not call otherwise");
if (dest->is_single_cpu()) {
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
__ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
__ verify_oop(dest->as_register());
} else if (type == T_METADATA) {
@ -1154,7 +1154,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) {
if (src->is_single_stack()) {
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
__ pushptr(frame_map()->address_for_slot(src ->single_stack_ix()));
__ popptr (frame_map()->address_for_slot(dest->single_stack_ix()));
} else {
@ -1355,7 +1355,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
patching_epilog(patch, patch_code, addr->base()->as_register(), info);
}
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
#ifdef _LP64
if (UseCompressedOops && !wide) {
__ decode_heap_oop(dest->as_register());
@ -1593,8 +1593,8 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
LP64_ONLY( __ movslq(len, len); )
if (UseSlowPath ||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
(!UseFastNewObjectArray && is_reference_type(op->type())) ||
(!UseFastNewTypeArray && !is_reference_type(op->type()))) {
__ jmp(*op->stub()->entry());
} else {
Register tmp1 = op->tmp1()->as_register();
@ -2510,7 +2510,7 @@ void LIR_Assembler::logic_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
} else {
#ifdef _LP64
Register r_lo;
if (right->type() == T_OBJECT || right->type() == T_ARRAY) {
if (is_reference_type(right->type())) {
r_lo = right->as_register();
} else {
r_lo = right->as_register_lo();
@ -2623,15 +2623,15 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
Register reg1 = opr1->as_register();
if (opr2->is_single_cpu()) {
// cpu register - cpu register
if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
if (is_reference_type(opr1->type())) {
__ cmpoop(reg1, opr2->as_register());
} else {
assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY, "cmp int, oop?");
assert(!is_reference_type(opr2->type()), "cmp int, oop?");
__ cmpl(reg1, opr2->as_register());
}
} else if (opr2->is_stack()) {
// cpu register - stack
if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
if (is_reference_type(opr1->type())) {
__ cmpoop(reg1, frame_map()->address_for_slot(opr2->single_stack_ix()));
} else {
__ cmpl(reg1, frame_map()->address_for_slot(opr2->single_stack_ix()));
@ -2641,7 +2641,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
LIR_Const* c = opr2->as_constant_ptr();
if (c->type() == T_INT) {
__ cmpl(reg1, c->as_jint());
} else if (c->type() == T_OBJECT || c->type() == T_ARRAY) {
} else if (is_reference_type(c->type())) {
// In 64bit oops are single register
jobject o = c->as_jobject();
if (o == NULL) {
@ -2741,7 +2741,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
} else if (opr1->is_address() && opr2->is_constant()) {
LIR_Const* c = opr2->as_constant_ptr();
#ifdef _LP64
if (c->type() == T_OBJECT || c->type() == T_ARRAY) {
if (is_reference_type(c->type())) {
assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "need to reverse");
__ movoop(rscratch1, c->as_jobject());
}
@ -2753,7 +2753,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
LIR_Address* addr = opr1->as_address_ptr();
if (c->type() == T_INT) {
__ cmpl(as_Address(addr), c->as_jint());
} else if (c->type() == T_OBJECT || c->type() == T_ARRAY) {
} else if (is_reference_type(c->type())) {
#ifdef _LP64
// %%% Make this explode if addr isn't reachable until we figure out a
// better strategy by giving noreg as the temp for as_Address
@ -3052,7 +3052,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
CodeStub* stub = op->stub();
int flags = op->flags();
BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
if (basic_type == T_ARRAY) basic_type = T_OBJECT;
if (is_reference_type(basic_type)) basic_type = T_OBJECT;
// if we don't know anything, just go through the generic arraycopy
if (default_type == NULL) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -671,7 +671,7 @@ void LIRGenerator::do_CompareOp(CompareOp* x) {
LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_value, LIRItem& new_value) {
LIR_Opr ill = LIR_OprFact::illegalOpr; // for convenience
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
cmp_value.load_item_force(FrameMap::rax_oop_opr);
new_value.load_item();
__ cas_obj(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), ill, ill);
@ -693,7 +693,7 @@ LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_
}
LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
bool is_oop = type == T_OBJECT || type == T_ARRAY;
bool is_oop = is_reference_type(type);
LIR_Opr result = new_register(type);
value.load_item();
// Because we want a 2-arg form of xchg and xadd

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -118,7 +118,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas
void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Register dst, Address src, Register tmp1, Register tmp_thread) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
bool on_reference = on_weak || on_phantom;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,7 @@ void ModRefBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Decorat
bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0;
bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
#ifdef _LP64
if (!checkcast) {
if (!obj_int) {
@ -61,7 +61,7 @@ void ModRefBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Decorat
bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);
Register tmp = rax;
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
#ifdef _LP64
if (!checkcast) {
if (!obj_int) {
@ -85,7 +85,7 @@ void ModRefBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Decorat
void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Address dst, Register val, Register tmp1, Register tmp2) {
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
oop_store_at(masm, decorators, type, dst, val, tmp1, tmp2);
} else {
BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
@ -106,7 +106,7 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt
// Because we want a 2-arg form of xchg and xadd
__ move(value_opr, result);
assert(type == T_INT || type == T_OBJECT || type == T_ARRAY LP64_ONLY( || type == T_LONG ), "unexpected type");
assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
__ xchg(access.resolved_addr(), result, result, LIR_OprFact::illegalOpr);
if (access.is_oop()) {

View File

@ -49,7 +49,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
if ((ShenandoahSATBBarrier && !dest_uninitialized) || ShenandoahLoadRefBarrier) {
#ifdef _LP64
@ -461,7 +461,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Register dst, Address src, Register tmp1, Register tmp_thread) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
bool not_in_heap = (decorators & IN_NATIVE) != 0;
@ -497,7 +497,7 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Address dst, Register val, Register tmp1, Register tmp2) {
bool on_oop = type == T_OBJECT || type == T_ARRAY;
bool on_oop = is_reference_type(type);
bool in_heap = (decorators & IN_HEAP) != 0;
bool as_normal = (decorators & AS_NORMAL) != 0;
if (on_oop && in_heap) {

View File

@ -198,7 +198,7 @@ void ZBarrierSetAssembler::store_at(MacroAssembler* masm,
BLOCK_COMMENT("ZBarrierSetAssembler::store_at {");
// Verify oop store
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
// Note that src could be noreg, which means we
// are storing null and can skip verification.
if (src != noreg) {

View File

@ -1416,8 +1416,7 @@ static void verify_oop_args(MacroAssembler* masm,
Register temp_reg = rbx; // not part of any compiled calling seq
if (VerifyOops) {
for (int i = 0; i < method->size_of_parameters(); i++) {
if (sig_bt[i] == T_OBJECT ||
sig_bt[i] == T_ARRAY) {
if (is_reference_type(sig_bt[i])) {
VMReg r = regs[i].first();
assert(r->is_valid(), "bad oop arg");
if (r->is_stack()) {
@ -2218,7 +2217,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
__ reset_last_Java_frame(thread, false);
// Unbox oop result, e.g. JNIHandles::resolve value.
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
if (is_reference_type(ret_type)) {
__ resolve_jobject(rax /* value */,
thread /* thread */,
rcx /* tmp */);

View File

@ -1816,8 +1816,7 @@ static void verify_oop_args(MacroAssembler* masm,
Register temp_reg = rbx; // not part of any compiled calling seq
if (VerifyOops) {
for (int i = 0; i < method->size_of_parameters(); i++) {
if (sig_bt[i] == T_OBJECT ||
sig_bt[i] == T_ARRAY) {
if (is_reference_type(sig_bt[i])) {
VMReg r = regs[i].first();
assert(r->is_valid(), "bad oop arg");
if (r->is_stack()) {
@ -2717,7 +2716,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
__ reset_last_Java_frame(false);
// Unbox oop result, e.g. JNIHandles::resolve value.
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
if (is_reference_type(ret_type)) {
__ resolve_jobject(rax /* value */,
r15_thread /* thread */,
rcx /* tmp */);

View File

@ -3168,7 +3168,7 @@ ValueStack* GraphBuilder::state_at_entry() {
ciType* type = sig->type_at(i);
BasicType basic_type = type->basic_type();
// don't allow T_ARRAY to propagate into locals types
if (basic_type == T_ARRAY) basic_type = T_OBJECT;
if (is_reference_type(basic_type)) basic_type = T_OBJECT;
ValueType* vt = as_ValueType(basic_type);
state->store_local(idx, new Local(type, vt, idx, false));
idx += type->size();

View File

@ -1546,7 +1546,7 @@ void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
assert(x->is_pinned(),"");
bool needs_range_check = x->compute_needs_range_check();
bool use_length = x->length() != NULL;
bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
bool obj_store = is_reference_type(x->elt_type());
bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
!get_jobject_constant(x->value())->is_null_object() ||
x->should_profile());
@ -2163,7 +2163,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) {
if (type == T_BOOLEAN) {
decorators |= C1_MASK_BOOLEAN;
}
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
decorators |= ON_UNKNOWN_OOP_REF;
}
@ -2190,7 +2190,7 @@ void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) {
set_no_result(x);
DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS;
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
decorators |= ON_UNKNOWN_OOP_REF;
}
if (x->is_volatile()) {
@ -2207,7 +2207,7 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS | MO_SEQ_CST;
if (type == T_ARRAY || type == T_OBJECT) {
if (is_reference_type(type)) {
decorators |= ON_UNKNOWN_OOP_REF;
}
@ -2600,7 +2600,7 @@ void LIRGenerator::profile_parameters(Base* x) {
LIR_Opr src = args->at(i);
assert(!src->is_illegal(), "check");
BasicType t = src->type();
if (t == T_OBJECT || t == T_ARRAY) {
if (is_reference_type(t)) {
intptr_t profiled_k = parameters->type(j);
Local* local = x->state()->local_at(java_index)->as_Local();
ciKlass* exact = profile_type(md, md->byte_offset_of_slot(parameters_type_data, ParametersTypeData::type_offset(0)),

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -868,7 +868,7 @@ void NullCheckEliminator::handle_AccessField(AccessField* x) {
if (field->is_constant()) {
ciConstant field_val = field->constant_value();
BasicType field_type = field_val.basic_type();
if (field_type == T_OBJECT || field_type == T_ARRAY) {
if (is_reference_type(field_type)) {
ciObject* obj_val = field_val.as_object();
if (!obj_val->is_null_object()) {
if (PrintNullCheckElimination) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -859,7 +859,7 @@ void BCEscapeAnalyzer::iterate_one_block(ciBlock *blk, StateInfo &state, Growabl
if (s.cur_bc() != Bytecodes::_getstatic) {
set_method_escape(state.apop());
}
if (field_type == T_OBJECT || field_type == T_ARRAY) {
if (is_reference_type(field_type)) {
state.apush(unknown_obj);
} else if (type2size[field_type] == 1) {
state.spush();
@ -873,7 +873,7 @@ void BCEscapeAnalyzer::iterate_one_block(ciBlock *blk, StateInfo &state, Growabl
{ bool will_link;
ciField* field = s.get_field(will_link);
BasicType field_type = field->type()->basic_type();
if (field_type == T_OBJECT || field_type == T_ARRAY) {
if (is_reference_type(field_type)) {
set_global_escape(state.apop());
} else if (type2size[field_type] == 1) {
state.spop();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,7 +37,7 @@
// This class represents an arrayOop in the HotSpot virtual
// machine.
static BasicType fixup_element_type(BasicType bt) {
if (bt == T_ARRAY) return T_OBJECT;
if (is_reference_type(bt)) return T_OBJECT;
if (bt == T_BOOLEAN) return T_BYTE;
return bt;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -56,12 +56,12 @@ void ciConstant::print() {
case T_DOUBLE:
tty->print("%lf", _value._double);
break;
case T_OBJECT:
case T_ARRAY:
_value._object->print();
break;
default:
tty->print("ILLEGAL");
if (is_reference_type(basic_type())) {
_value._object->print();
} else {
tty->print("ILLEGAL");
}
break;
}
tty->print(">");

View File

@ -106,7 +106,7 @@ public:
return _value._double;
}
ciObject* as_object() const {
assert(basic_type() == T_OBJECT || basic_type() == T_ARRAY, "wrong type");
assert(is_reference_type(basic_type()), "wrong type");
return _value._object;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -90,7 +90,7 @@ ciField::ciField(ciInstanceKlass* klass, int index) :
// If the field is a pointer type, get the klass of the
// field.
if (field_type == T_OBJECT || field_type == T_ARRAY) {
if (is_reference_type(field_type)) {
bool ignore;
// This is not really a class reference; the index always refers to the
// field's type signature, as a symbol. Linkage checks do not apply.
@ -199,7 +199,7 @@ ciField::ciField(fieldDescriptor *fd) :
// If the field is a pointer type, get the klass of the
// field.
if (field_type == T_OBJECT || field_type == T_ARRAY) {
if (is_reference_type(field_type)) {
_type = NULL; // must call compute_type on first access
} else {
_type = ciType::make(field_type);

View File

@ -1454,8 +1454,8 @@ void ciMethod::print_impl(outputStream* st) {
// ------------------------------------------------------------------
static BasicType erase_to_word_type(BasicType bt) {
if (is_subword_type(bt)) return T_INT;
if (bt == T_ARRAY) return T_OBJECT;
if (is_subword_type(bt)) return T_INT;
if (is_reference_type(bt)) return T_OBJECT;
return bt;
}

View File

@ -149,7 +149,8 @@ void ciObjectFactory::init_shared_objects() {
for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
BasicType t = (BasicType)i;
if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY && t != T_NARROWOOP && t != T_NARROWKLASS) {
if (type2name(t) != NULL && !is_reference_type(t) &&
t != T_NARROWOOP && t != T_NARROWKLASS) {
ciType::_basic_types[t] = new (_arena) ciType(t);
init_ident_of(ciType::_basic_types[t]);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,8 +35,7 @@ ciType* ciType::_basic_types[T_CONFLICT+1];
// ciType
//
// This class represents either a class (T_OBJECT), array (T_ARRAY),
// or one of the primitive types such as T_INT.
// This class represents a Java reference or primitive type.
// ------------------------------------------------------------------
// ciType::ciType

View File

@ -29,8 +29,8 @@
// ciType
//
// This class represents either a class (T_OBJECT), array (T_ARRAY),
// or one of the primitive types such as T_INT.
// This class represents a Java reference or primitive type.
class ciType : public ciMetadata {
CI_PACKAGE_ACCESS
friend class ciKlass;
@ -67,7 +67,7 @@ public:
ciKlass* box_klass();
// Returns true if this is not a klass or array (i.e., not a reference type).
bool is_primitive_type() const { return basic_type() != T_OBJECT && basic_type() != T_ARRAY; }
bool is_primitive_type() const { return !is_reference_type(basic_type()); }
int size() const { return type2size[basic_type()]; }
bool is_void() const { return basic_type() == T_VOID; }
bool is_one_word() const { return size() == 1; }

View File

@ -729,7 +729,7 @@ void ciTypeFlow::StateVector::do_ldc(ciBytecodeStream* str) {
outer()->record_failure("ldc did not link");
return;
}
if (basic_type == T_OBJECT || basic_type == T_ARRAY) {
if (is_reference_type(basic_type)) {
ciObject* obj = con.as_object();
if (obj->is_null_object()) {
push_null();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -187,9 +187,11 @@ void BytecodeAssembler::load(BasicType bt, u4 index) {
case T_FLOAT: fload(index); break;
case T_DOUBLE: dload(index); break;
case T_LONG: lload(index); break;
case T_OBJECT:
case T_ARRAY: aload(index); break;
default:
if (is_reference_type(bt)) {
aload(index);
break;
}
ShouldNotReachHere();
}
}
@ -254,10 +256,12 @@ void BytecodeAssembler::_return(BasicType bt) {
case T_FLOAT: freturn(); break;
case T_DOUBLE: dreturn(); break;
case T_LONG: lreturn(); break;
case T_OBJECT:
case T_ARRAY: areturn(); break;
case T_VOID: _return(); break;
default:
if (is_reference_type(bt)) {
areturn();
break;
}
ShouldNotReachHere();
}
}

View File

@ -100,7 +100,7 @@ public:
BasicType type() const { return _type; }
LIR_Opr resolved_addr() const { return _resolved_addr; }
void set_resolved_addr(LIR_Opr addr) { _resolved_addr = addr; }
bool is_oop() const { return _type == T_ARRAY || _type == T_OBJECT; }
bool is_oop() const { return is_reference_type(_type); }
DecoratorSet decorators() const { return _decorators; }
void clear_decorators(DecoratorSet ds) { _decorators &= ~ds; }
bool is_raw() const { return (_decorators & AS_RAW) != 0; }

View File

@ -120,7 +120,7 @@ public:
Node* base() const { return _base; }
C2AccessValuePtr& addr() const { return _addr; }
BasicType type() const { return _type; }
bool is_oop() const { return _type == T_OBJECT || _type == T_ARRAY; }
bool is_oop() const { return is_reference_type(_type); }
bool is_raw() const { return (_decorators & AS_RAW) != 0; }
Node* raw_access() const { return _raw_access; }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -187,6 +187,6 @@ void CardTableBarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node*
}
bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
bool is_oop = type == T_OBJECT || type == T_ARRAY;
bool is_oop = is_reference_type(type);
return is_oop && (!tightly_coupled_alloc || !use_ReduceInitialCardMarks());
}

View File

@ -754,7 +754,7 @@ bool ShenandoahBarrierSetC2::optimize_loops(PhaseIdealLoop* phase, LoopOptsMode
}
bool ShenandoahBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
bool is_oop = type == T_OBJECT || type == T_ARRAY;
bool is_oop = is_reference_type(type);
if (!is_oop) {
return false;
}
@ -787,7 +787,7 @@ bool ShenandoahBarrierSetC2::clone_needs_barrier(Node* src, PhaseGVN& gvn) {
}
} else if (src_type->isa_aryptr()) {
BasicType src_elem = src_type->klass()->as_array_klass()->element_type()->basic_type();
if (src_elem == T_OBJECT || src_elem == T_ARRAY) {
if (is_reference_type(src_elem)) {
return true;
}
} else {

View File

@ -660,7 +660,7 @@ Node* ZBarrierSetC2::step_over_gc_barrier_ctrl(Node* c) const {
}
bool ZBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
return type == T_OBJECT || type == T_ARRAY;
return is_reference_type(type);
}
bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n, uint opcode) const {
@ -1367,7 +1367,7 @@ void ZBarrierSetC2::insert_barriers_on_unsafe(PhaseIdealLoop* phase) const {
LoadStoreNode* lsn = n->as_LoadStore();
if (lsn->has_barrier()) {
BasicType bt = lsn->in(MemNode::Address)->bottom_type()->basic_type();
assert ((bt == T_OBJECT || bt == T_ARRAY), "Sanity test");
assert (is_reference_type(bt), "Sanity test");
insert_barrier_before_unsafe(phase, lsn);
}
}

View File

@ -66,7 +66,7 @@ bool ZBarrierSet::barrier_needed(DecoratorSet decorators, BasicType type) {
assert((decorators & AS_NO_KEEPALIVE) == 0, "Unexpected decorator");
//assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Unexpected decorator");
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
assert((decorators & (IN_HEAP | IN_NATIVE)) != 0, "Where is reference?");
// Barrier needed even when IN_NATIVE, to allow concurrent scanning.
return true;

View File

@ -449,7 +449,7 @@ void BytecodePrinter::print_attributes(int bci, outputStream* st) {
case Bytecodes::_newarray: {
BasicType atype = (BasicType)get_index_u1();
const char* str = type2name(atype);
if (str == NULL || atype == T_OBJECT || atype == T_ARRAY) {
if (str == NULL || is_reference_type(atype)) {
assert(false, "Unidentified basic type");
}
st->print_cr(" %s", str);

View File

@ -1034,7 +1034,7 @@ C2V_VMENTRY_NULL(jobject, executeHotSpotNmethod, (JNIEnv* env, jobject, jobject
if (jap.get_ret_type() == T_VOID) {
return NULL;
} else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) {
} else if (is_reference_type(jap.get_ret_type())) {
return JNIHandles::make_local((oop) result.get_jobject());
} else {
jvalue *value = (jvalue *) result.get_value_addr();

View File

@ -583,7 +583,7 @@ void HeapShared::check_closed_archive_heap_region_object(InstanceKlass* k,
for (JavaFieldStream fs(k); !fs.done(); fs.next()) {
if (!fs.access_flags().is_static()) {
BasicType ft = fs.field_descriptor().field_type();
if (!fs.access_flags().is_final() && (ft == T_ARRAY || ft == T_OBJECT)) {
if (!fs.access_flags().is_final() && is_reference_type(ft)) {
ResourceMark rm(THREAD);
log_warning(cds, heap)(
"Please check reference field in %s instance in closed archive heap region: %s %s",
@ -871,7 +871,7 @@ public:
virtual void do_field(fieldDescriptor* fd) {
if (fd->name() == _field_name) {
assert(!_found, "fields cannot be overloaded");
assert(fd->field_type() == T_OBJECT || fd->field_type() == T_ARRAY, "can archive only obj or array fields");
assert(is_reference_type(fd->field_type()), "can archive only fields that are references");
_found = true;
_offset = fd->offset();
}

View File

@ -603,7 +603,7 @@ public:
void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments)
Symbol* klass_name() const; // returns the name of the method holder
BasicType result_type() const; // type of the method result
bool is_returning_oop() const { BasicType r = result_type(); return (r == T_OBJECT || r == T_ARRAY); }
bool is_returning_oop() const { BasicType r = result_type(); return is_reference_type(r); }
bool is_returning_fp() const { BasicType r = result_type(); return (r == T_FLOAT || r == T_DOUBLE); }
// Checked exceptions thrown by this method (resolved to mirrors)

View File

@ -216,7 +216,7 @@ int TypeEntriesAtCall::compute_cell_count(BytecodeStream* stream) {
args_cell = TypeStackSlotEntries::compute_cell_count(inv.signature(), false, TypeProfileArgsLimit);
}
int ret_cell = 0;
if (MethodData::profile_return_for_invoke(m, bci) && (inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY)) {
if (MethodData::profile_return_for_invoke(m, bci) && is_reference_type(inv.result_type())) {
ret_cell = ReturnTypeEntry::static_cell_count();
}
int header_cell = 0;
@ -289,7 +289,7 @@ void CallTypeData::post_initialize(BytecodeStream* stream, MethodData* mdo) {
}
if (has_return()) {
assert(inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY, "room for a ret type but doesn't return obj?");
assert(is_reference_type(inv.result_type()), "room for a ret type but doesn't return obj?");
_ret.post_initialize();
}
}
@ -310,7 +310,7 @@ void VirtualCallTypeData::post_initialize(BytecodeStream* stream, MethodData* md
}
if (has_return()) {
assert(inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY, "room for a ret type but doesn't return obj?");
assert(is_reference_type(inv.result_type()), "room for a ret type but doesn't return obj?");
_ret.post_initialize();
}
}

View File

@ -268,8 +268,8 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
BasicType src_elem = ary_src->klass()->as_array_klass()->element_type()->basic_type();
BasicType dest_elem = ary_dest->klass()->as_array_klass()->element_type()->basic_type();
if (src_elem == T_ARRAY) src_elem = T_OBJECT;
if (dest_elem == T_ARRAY) dest_elem = T_OBJECT;
if (is_reference_type(src_elem)) src_elem = T_OBJECT;
if (is_reference_type(dest_elem)) dest_elem = T_OBJECT;
if (src_elem != dest_elem || dest_elem == T_VOID) {
// We don't know if arguments are arrays of the same type
@ -328,7 +328,7 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
assert(phase->type(src->in(AddPNode::Offset))->is_intptr_t()->get_con() == phase->type(dest->in(AddPNode::Offset))->is_intptr_t()->get_con(), "same start offset?");
BasicType elem = ary_src->klass()->as_array_klass()->element_type()->basic_type();
if (elem == T_ARRAY) elem = T_OBJECT;
if (is_reference_type(elem)) elem = T_OBJECT;
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
if (bs->array_copy_requires_gc_barriers(true, elem, true, BarrierSetC2::Optimization)) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -702,8 +702,8 @@ void Parse::do_call() {
} else if (rt == T_INT || is_subword_type(rt)) {
// Nothing. These cases are handled in lambda form bytecode.
assert(ct == T_INT || is_subword_type(ct), "must match: rt=%s, ct=%s", type2name(rt), type2name(ct));
} else if (rt == T_OBJECT || rt == T_ARRAY) {
assert(ct == T_OBJECT || ct == T_ARRAY, "rt=%s, ct=%s", type2name(rt), type2name(ct));
} else if (is_reference_type(rt)) {
assert(is_reference_type(ct), "rt=%s, ct=%s", type2name(rt), type2name(ct));
if (ctype->is_loaded()) {
const TypeOopPtr* arg_type = TypeOopPtr::make_from_klass(rtype->as_klass());
const Type* sig_type = TypeOopPtr::make_from_klass(ctype->as_klass());
@ -750,7 +750,7 @@ void Parse::do_call() {
set_bci(iter().cur_bci()); // put it back
}
BasicType ct = ctype->basic_type();
if (ct == T_OBJECT || ct == T_ARRAY) {
if (is_reference_type(ct)) {
record_profiled_return_for_speculation();
}
}

View File

@ -2113,7 +2113,8 @@ bool ConnectionGraph::is_oop_field(Node* n, int offset, bool* unsafe) {
}
}
}
return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY);
// Note: T_NARROWOOP is not classed as a real reference type
return (is_reference_type(bt) || bt == T_NARROWOOP);
}
// Returns unique pointed java object or NULL.

View File

@ -2276,7 +2276,7 @@ void GraphKit::record_profiled_arguments_for_speculation(ciMethod* dest_method,
int skip = Bytecodes::has_receiver(bc) ? 1 : 0;
for (int j = skip, i = 0; j < nargs && i < TypeProfileArgsLimit; j++) {
const Type *targ = tf->domain()->field_at(j + TypeFunc::Parms);
if (targ->basic_type() == T_OBJECT || targ->basic_type() == T_ARRAY) {
if (is_reference_type(targ->basic_type())) {
ProfilePtrKind ptr_kind = ProfileMaybeNull;
ciKlass* better_type = NULL;
if (method()->argument_profiled_type(bci(), i, better_type, ptr_kind)) {

View File

@ -2382,7 +2382,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
guarantee( is_store || kind != Release, "Release accesses can be produced only for stores");
assert(type != T_OBJECT || !unaligned, "unaligned access not supported with object type");
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
decorators |= ON_UNKNOWN_OOP_REF;
}
@ -2730,7 +2730,7 @@ bool LibraryCallKit::inline_unsafe_load_store(const BasicType type, const LoadSt
Compile::AliasType* alias_type = C->alias_type(adr_type);
BasicType bt = alias_type->basic_type();
if (bt != T_ILLEGAL &&
((bt == T_OBJECT || bt == T_ARRAY) != (type == T_OBJECT))) {
(is_reference_type(bt) != (type == T_OBJECT))) {
// Don't intrinsify mismatched object accesses.
return false;
}
@ -2767,7 +2767,7 @@ bool LibraryCallKit::inline_unsafe_load_store(const BasicType type, const LoadSt
int alias_idx = C->get_alias_index(adr_type);
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
decorators |= IN_HEAP | ON_UNKNOWN_OOP_REF;
// Transformation of a value which could be NULL pointer (CastPP #NULL)
@ -4817,8 +4817,8 @@ bool LibraryCallKit::inline_arraycopy() {
if (has_src && has_dest && can_emit_guards) {
BasicType src_elem = top_src->klass()->as_array_klass()->element_type()->basic_type();
BasicType dest_elem = top_dest->klass()->as_array_klass()->element_type()->basic_type();
if (src_elem == T_ARRAY) src_elem = T_OBJECT;
if (dest_elem == T_ARRAY) dest_elem = T_OBJECT;
if (is_reference_type(src_elem)) src_elem = T_OBJECT;
if (is_reference_type(dest_elem)) dest_elem = T_OBJECT;
if (src_elem == dest_elem && src_elem == T_OBJECT) {
// If both arrays are object arrays then having the exact types

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -791,7 +791,7 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray <Sa
const Type *field_type;
// The next code is taken from Parse::do_get_xxx().
if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) {
if (is_reference_type(basic_elem_type)) {
if (!elem_type->is_loaded()) {
field_type = TypeInstPtr::BOTTOM;
} else if (field != NULL && field->is_static_constant()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1149,8 +1149,8 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
if (top_src != NULL && top_src->klass() != NULL) {
src_elem = top_src->klass()->as_array_klass()->element_type()->basic_type();
}
if (src_elem == T_ARRAY) src_elem = T_OBJECT;
if (dest_elem == T_ARRAY) dest_elem = T_OBJECT;
if (is_reference_type(src_elem)) src_elem = T_OBJECT;
if (is_reference_type(dest_elem)) dest_elem = T_OBJECT;
if (ac->is_arraycopy_validated() &&
dest_elem != T_CONFLICT &&

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -139,7 +139,7 @@ void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
DecoratorSet decorators = IN_HEAP;
decorators |= is_vol ? MO_SEQ_CST : MO_UNORDERED;
bool is_obj = bt == T_OBJECT || bt == T_ARRAY;
bool is_obj = is_reference_type(bt);
if (is_obj) {
if (!field->type()->is_loaded()) {
@ -210,7 +210,7 @@ void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {
DecoratorSet decorators = IN_HEAP;
decorators |= is_vol ? MO_SEQ_CST : MO_UNORDERED;
bool is_obj = bt == T_OBJECT || bt == T_ARRAY;
bool is_obj = is_reference_type(bt);
// Store the value.
const Type* field_type;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -3004,15 +3004,13 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int o
ciField* field = k->get_field_by_offset(_offset, true);
assert(field != NULL, "missing field");
BasicType basic_elem_type = field->layout_type();
_is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
basic_elem_type == T_ARRAY);
_is_ptr_to_narrowoop = UseCompressedOops && is_reference_type(basic_elem_type);
} else {
// Instance fields which contains a compressed oop references.
field = ik->get_field_by_offset(_offset, false);
if (field != NULL) {
BasicType basic_elem_type = field->layout_type();
_is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
basic_elem_type == T_ARRAY);
_is_ptr_to_narrowoop = UseCompressedOops && is_reference_type(basic_elem_type);
} else if (klass()->equals(ciEnv::current()->Object_klass())) {
// Compile::find_alias_type() cast exactness on all types to verify
// that it does not affect alias type.

View File

@ -1104,7 +1104,7 @@ static void jni_invoke_static(JNIEnv *env, JavaValue* result, jobject receiver,
JavaCalls::call(result, method, &java_args, CHECK);
// Convert result
if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
if (is_reference_type(result->get_type())) {
result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
}
}
@ -1167,7 +1167,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive
JavaCalls::call(result, method, &java_args, CHECK);
// Convert result
if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
if (is_reference_type(result->get_type())) {
result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
}
}

View File

@ -773,7 +773,7 @@ JVM_ENTRY(jclass, JVM_FindPrimitiveClass(JNIEnv* env, const char* utf))
JVMWrapper("JVM_FindPrimitiveClass");
oop mirror = NULL;
BasicType t = name2type(utf);
if (t != T_ILLEGAL && t != T_OBJECT && t != T_ARRAY) {
if (t != T_ILLEGAL && !is_reference_type(t)) {
mirror = Universe::java_mirror(t);
}
if (mirror == NULL) {

View File

@ -1589,7 +1589,7 @@ void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame cur
if (!exception_exit) {
oop oop_result;
BasicType type = current_frame.interpreter_frame_result(&oop_result, &value);
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
result = Handle(thread, oop_result);
}
}

View File

@ -573,7 +573,7 @@ Symbol* MethodHandles::lookup_basic_type_signature(Symbol* sig, bool keep_last_a
if (is_subword_type(bt)) {
bsig = vmSymbols::int_signature();
} else {
assert(bt == T_OBJECT || bt == T_ARRAY, "is_basic_type_signature was false");
assert(is_reference_type(bt), "is_basic_type_signature was false");
bsig = vmSymbols::object_signature();
}
} else {
@ -592,7 +592,7 @@ Symbol* MethodHandles::lookup_basic_type_signature(Symbol* sig, bool keep_last_a
if (arg_pos == keep_arg_pos) {
buffer.write((char*) ss.raw_bytes(),
(int) ss.raw_length());
} else if (bt == T_OBJECT || bt == T_ARRAY) {
} else if (is_reference_type(bt)) {
buffer.write(OBJ_SIG, OBJ_SIG_LEN);
} else {
if (is_subword_type(bt))

View File

@ -212,7 +212,7 @@ void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
// Print a hint as to the underlying integer representation. This can be wrong for
// pointers on an LP64 machine
#ifdef _LP64
if ((ft == T_OBJECT || ft == T_ARRAY) && UseCompressedOops) {
if (is_reference_type(ft) && UseCompressedOops) {
st->print(" (%x)", obj->int_field(offset()));
}
else // <- intended

View File

@ -723,7 +723,7 @@ class InterpretedArgumentOopFinder: public SignatureInfo {
void set(int size, BasicType type) {
_offset -= size;
if (type == T_OBJECT || type == T_ARRAY) oop_offset_do();
if (is_reference_type(type)) oop_offset_do();
}
void oop_offset_do() {
@ -776,7 +776,7 @@ class EntryFrameOopFinder: public SignatureInfo {
void set(int size, BasicType type) {
assert (_offset >= 0, "illegal offset");
if (type == T_OBJECT || type == T_ARRAY) oop_at_offset_do(_offset);
if (is_reference_type(type)) oop_at_offset_do(_offset);
_offset -= size;
}
@ -927,7 +927,7 @@ class CompiledArgumentOopFinder: public SignatureInfo {
VMRegPair* _regs; // VMReg list of arguments
void set(int size, BasicType type) {
if (type == T_OBJECT || type == T_ARRAY) handle_oop_offset();
if (is_reference_type(type)) handle_oop_offset();
_offset += size;
}

View File

@ -390,7 +390,7 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC
// Figure out if the result value is an oop or not (Note: This is a different value
// than result_type. result_type will be T_INT of oops. (it is about size)
BasicType result_type = runtime_type_from(result);
bool oop_result_flag = (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY);
bool oop_result_flag = is_reference_type(result->get_type());
// Find receiver
Handle receiver = (!method->is_static()) ? args->receiver() : Handle();
@ -619,7 +619,7 @@ void JavaCallArguments::verify(const methodHandle& method, BasicType return_type
guarantee(method->size_of_parameters() == size_of_parameters(), "wrong no. of arguments pushed");
// Treat T_OBJECT and T_ARRAY as the same
if (return_type == T_ARRAY) return_type = T_OBJECT;
if (is_reference_type(return_type)) return_type = T_OBJECT;
// Check that oop information is correct
Symbol* signature = method->signature();

View File

@ -92,7 +92,7 @@ oop Reflection::box(jvalue* value, BasicType type, TRAPS) {
if (type == T_VOID) {
return NULL;
}
if (type == T_OBJECT || type == T_ARRAY) {
if (is_reference_type(type)) {
// regular objects are not boxed
return (oop) value->l;
}
@ -756,7 +756,7 @@ static oop get_mirror_from_signature(const methodHandle& method,
TRAPS) {
if (T_OBJECT == ss->type() || T_ARRAY == ss->type()) {
if (is_reference_type(ss->type())) {
Symbol* name = ss->as_symbol();
oop loader = method->method_holder()->class_loader();
oop protection_domain = method->method_holder()->protection_domain();