Skip to content
Permalink
Browse files
8258653: CallJavaNode::_bci is not in use
Reviewed-by: kvn, vlivanov
  • Loading branch information
Xin Liu authored and Vladimir Ivanov committed Dec 21, 2020
1 parent 12297a0 commit 30b9ff660f07433f918b279b9098ab38a466da93
@@ -3583,7 +3583,6 @@ encode %{
call->_method_handle_invoke = _method_handle_invoke;
call->_vtable_index = _vtable_index;
call->_method = _method;
call->_bci = _bci;
call->_optimized_virtual = _optimized_virtual;
call->_tf = _tf;
call->_entry_point = _entry_point;
@@ -151,7 +151,7 @@ JVMState* DirectCallGenerator::generate(JVMState* jvms) {
kit.C->log()->elem("direct_call bci='%d'", jvms->bci());
}

CallStaticJavaNode *call = new CallStaticJavaNode(kit.C, tf(), target, method(), kit.bci());
CallStaticJavaNode* call = new CallStaticJavaNode(kit.C, tf(), target, method());
if (is_inlined_method_handle_intrinsic(jvms, method())) {
// To be able to issue a direct call and skip a call to MH.linkTo*/invokeBasic adapter,
// additional information about the method being invoked should be attached
@@ -265,7 +265,7 @@ JVMState* VirtualCallGenerator::generate(JVMState* jvms) {
"no vtable calls if +UseInlineCaches ");
address target = SharedRuntime::get_resolve_virtual_call_stub();
// Normal inline cache used for call
CallDynamicJavaNode *call = new CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci());
CallDynamicJavaNode* call = new CallDynamicJavaNode(tf(), target, method(), _vtable_index);
if (is_inlined_method_handle_intrinsic(jvms, method())) {
// To be able to issue a direct call (optimized virtual or virtual)
// and skip a call to MH.linkTo*/invokeBasic adapter, additional information
@@ -1013,7 +1013,7 @@ bool CallJavaNode::validate_symbolic_info() const {
if (method() == NULL) {
return true; // call into runtime or uncommon trap
}
ciMethod* symbolic_info = jvms()->method()->get_method_at_bci(_bci);
ciMethod* symbolic_info = jvms()->method()->get_method_at_bci(jvms()->bci());
ciMethod* callee = method();
if (symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic()) {
assert(override_symbolic_info(), "should be set");
@@ -671,14 +671,13 @@ class CallJavaNode : public CallNode {
ciMethod* _method; // Method being direct called
bool _arg_escape; // ArgEscape in parameter list
public:
const int _bci; // Byte Code Index of call byte code
CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci)
CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method)
: CallNode(tf, addr, TypePtr::BOTTOM),
_optimized_virtual(false),
_method_handle_invoke(false),
_override_symbolic_info(false),
_method(method),
_arg_escape(false), _bci(bci)
_arg_escape(false)
{
init_class_id(Class_CallJava);
}
@@ -712,17 +711,16 @@ class CallStaticJavaNode : public CallJavaNode {
virtual bool cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
public:
CallStaticJavaNode(Compile* C, const TypeFunc* tf, address addr, ciMethod* method, int bci)
: CallJavaNode(tf, addr, method, bci) {
CallStaticJavaNode(Compile* C, const TypeFunc* tf, address addr, ciMethod* method)
: CallJavaNode(tf, addr, method) {
init_class_id(Class_CallStaticJava);
if (C->eliminate_boxing() && (method != NULL) && method->is_boxing_method()) {
init_flags(Flag_is_macro);
C->add_macro_node(this);
}
}
CallStaticJavaNode(const TypeFunc* tf, address addr, const char* name, int bci,
const TypePtr* adr_type)
: CallJavaNode(tf, addr, NULL, bci) {
CallStaticJavaNode(const TypeFunc* tf, address addr, const char* name, const TypePtr* adr_type)
: CallJavaNode(tf, addr, NULL) {
init_class_id(Class_CallStaticJava);
// This node calls a runtime stub, which often has narrow memory effects.
_adr_type = adr_type;
@@ -760,7 +758,8 @@ class CallDynamicJavaNode : public CallJavaNode {
virtual bool cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
public:
CallDynamicJavaNode( const TypeFunc *tf , address addr, ciMethod* method, int vtable_index, int bci ) : CallJavaNode(tf,addr,method,bci), _vtable_index(vtable_index) {
CallDynamicJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int vtable_index)
: CallJavaNode(tf,addr,method), _vtable_index(vtable_index) {
init_class_id(Class_CallDynamicJava);
}

@@ -2495,8 +2495,7 @@ Node* GraphKit::make_runtime_call(int flags,
}
CallNode* call;
if (!is_leaf) {
call = new CallStaticJavaNode(call_type, call_addr, call_name,
bci(), adr_type);
call = new CallStaticJavaNode(call_type, call_addr, call_name, adr_type);
} else if (flags & RC_NO_FP) {
call = new CallLeafNoFPNode(call_type, call_addr, call_name, adr_type);
} else {
@@ -3588,8 +3588,7 @@ LibraryCallKit::generate_method_call(vmIntrinsics::ID method_id, bool is_virtual
if (is_static) {
assert(!is_virtual, "");
slow_call = new CallStaticJavaNode(C, tf,
SharedRuntime::get_resolve_static_call_stub(),
method, bci());
SharedRuntime::get_resolve_static_call_stub(), method);
} else if (is_virtual) {
null_check_receiver();
int vtable_index = Method::invalid_vtable_index;
@@ -3605,12 +3604,11 @@ LibraryCallKit::generate_method_call(vmIntrinsics::ID method_id, bool is_virtual
}
slow_call = new CallDynamicJavaNode(tf,
SharedRuntime::get_resolve_virtual_call_stub(),
method, vtable_index, bci());
method, vtable_index);
} else { // neither virtual nor static: opt_virtual
null_check_receiver();
slow_call = new CallStaticJavaNode(C, tf,
SharedRuntime::get_resolve_opt_virtual_call_stub(),
method, bci());
SharedRuntime::get_resolve_opt_virtual_call_stub(), method);
slow_call->set_optimized_virtual(true);
}
if (CallGenerator::is_inlined_method_handle_intrinsic(this->method(), bci(), callee())) {
@@ -568,7 +568,7 @@ void PhaseIdealLoop::add_empty_predicate(Deoptimization::DeoptReason reason, Nod
const TypePtr* no_memory_effects = NULL;
JVMState* jvms = sfpt->jvms();
CallNode* unc = new CallStaticJavaNode(OptoRuntime::uncommon_trap_Type(), call_addr, "uncommon_trap",
jvms->bci(), no_memory_effects);
no_memory_effects);

Node* mem = NULL;
Node* i_o = NULL;
@@ -925,7 +925,6 @@ class MachCallJavaNode : public MachCallNode {
public:
ciMethod* _method; // Method being direct called
bool _override_symbolic_info; // Override symbolic call site info from bytecode
int _bci; // Byte Code index of call byte code
bool _optimized_virtual; // Tells if node is a static call or an optimized virtual
bool _method_handle_invoke; // Tells if the call has to preserve SP
bool _arg_escape; // ArgEscape in parameter list
@@ -140,7 +140,7 @@ CallNode* PhaseMacroExpand::make_slow_call(CallNode *oldcall, const TypeFunc* sl
// Slow-path call
CallNode *call = leaf_name
? (CallNode*)new CallLeafNode ( slow_call_type, slow_call, leaf_name, TypeRawPtr::BOTTOM )
: (CallNode*)new CallStaticJavaNode( slow_call_type, slow_call, OptoRuntime::stub_name(slow_call), oldcall->jvms()->bci(), TypeRawPtr::BOTTOM );
: (CallNode*)new CallStaticJavaNode( slow_call_type, slow_call, OptoRuntime::stub_name(slow_call), TypeRawPtr::BOTTOM );

// Slow path call has no side-effects, uses few values
copy_predefined_input_for_runtime_call(slow_path, oldcall, call );
@@ -1424,7 +1424,6 @@ void PhaseMacroExpand::expand_allocate_common(
// Generate slow-path call
CallNode *call = new CallStaticJavaNode(slow_call_type, slow_call_address,
OptoRuntime::stub_name(slow_call_address),
alloc->jvms()->bci(),
TypePtr::BOTTOM);
call->init_req(TypeFunc::Control, slow_region);
call->init_req(TypeFunc::I_O, top()); // does no i/o
@@ -1046,8 +1046,7 @@ MergeMemNode* PhaseMacroExpand::generate_slow_arraycopy(ArrayCopyNode *ac,

const TypeFunc* call_type = OptoRuntime::slow_arraycopy_Type();
CallNode* call = new CallStaticJavaNode(call_type, OptoRuntime::slow_arraycopy_Java(),
"slow_arraycopy",
ac->jvms()->bci(), TypePtr::BOTTOM);
"slow_arraycopy", TypePtr::BOTTOM);

call->init_req(TypeFunc::Control, *ctrl);
call->init_req(TypeFunc::I_O , *io);
@@ -1247,7 +1247,6 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
assert(call_java->validate_symbolic_info(), "inconsistent info");
method = call_java->method();
mcall_java->_method = method;
mcall_java->_bci = call_java->_bci;
mcall_java->_optimized_virtual = call_java->is_optimized_virtual();
is_method_handle_invoke = call_java->is_method_handle_invoke();
mcall_java->_method_handle_invoke = is_method_handle_invoke;
@@ -233,7 +233,7 @@ class StringConcat : public ResourceObj {
const TypePtr* no_memory_effects = NULL;
Compile* C = _stringopts->C;
CallStaticJavaNode* call = new CallStaticJavaNode(call_type, call_addr, "uncommon_trap",
jvms->bci(), no_memory_effects);
no_memory_effects);
for (int e = 0; e < TypeFunc::Parms; e++) {
call->init_req(e, uct->in(e));
}
@@ -1339,7 +1339,7 @@ class VectorBoxNode : public Node {
class VectorBoxAllocateNode : public CallStaticJavaNode {
public:
VectorBoxAllocateNode(Compile* C, const TypeInstPtr* vbox_type)
: CallStaticJavaNode(C, VectorBoxNode::vec_box_type(vbox_type), NULL, NULL, -1) {
: CallStaticJavaNode(C, VectorBoxNode::vec_box_type(vbox_type), NULL, NULL) {
init_flags(Flag_is_macro);
C->add_macro_node(this);
}
@@ -960,7 +960,6 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
c2_nonstatic_field(CallStaticJavaNode, _name, const char*) \
\
c2_nonstatic_field(MachCallJavaNode, _method, ciMethod*) \
c2_nonstatic_field(MachCallJavaNode, _bci, int) \
\
c2_nonstatic_field(MachCallStaticJavaNode, _name, const char*) \
\

1 comment on commit 30b9ff6

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 30b9ff6 Dec 21, 2020

Please sign in to comment.