< prev index next >
src/hotspot/share/opto/doCall.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 643,654 ****
Node* retnode = peek();
if (!retnode->is_ValueType()) {
pop();
assert(!cg->is_inline(), "should have ValueTypeNode result");
ciValueKlass* vk = _gvn.type(retnode)->value_klass();
! // We will deoptimize if the return value is null and then need to continue execution after the call
! ValueTypeNode* vt = ValueTypeNode::make_from_oop(this, retnode, vk, /* buffer_check */ false, /* null2default */ false, iter().next_bci());
push_node(T_VALUETYPE, vt);
}
}
if (Bytecodes::has_optional_appendix(iter().cur_bc_raw()) || is_signature_polymorphic) {
--- 643,653 ----
Node* retnode = peek();
if (!retnode->is_ValueType()) {
pop();
assert(!cg->is_inline(), "should have ValueTypeNode result");
ciValueKlass* vk = _gvn.type(retnode)->value_klass();
! ValueTypeNode* vt = ValueTypeNode::make_from_returned_oop(this, retnode, vk);
push_node(T_VALUETYPE, vt);
}
}
if (Bytecodes::has_optional_appendix(iter().cur_bc_raw()) || is_signature_polymorphic) {
*** 666,682 ****
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 || ct == T_VALUETYPE, "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());
if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
Node* retnode = pop();
Node* cast_obj = _gvn.transform(new CheckCastPPNode(control(), retnode, sig_type));
if (ct == T_VALUETYPE) {
! // We will deoptimize if the return value is null and then need to continue execution after the call
! cast_obj = ValueTypeNode::make_from_oop(this, cast_obj, ctype->as_value_klass(), /* buffer_check */ false, /* null2default */ false, iter().next_bci());
}
push(cast_obj);
}
}
} else if (rt == T_VALUETYPE) {
--- 665,680 ----
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 || ct == T_VALUETYPE, "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())->join_speculative(TypePtr::NOTNULL);
if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
Node* retnode = pop();
Node* cast_obj = _gvn.transform(new CheckCastPPNode(control(), retnode, sig_type));
if (ct == T_VALUETYPE) {
! cast_obj = ValueTypeNode::make_from_returned_oop(this, cast_obj, ctype->as_value_klass());
}
push(cast_obj);
}
}
} else if (rt == T_VALUETYPE) {
< prev index next >