Skip to content

Commit c3f10e8

Browse files
enothumTobiHartmann
authored andcommitted
8307625: Redundant receiver null check in LibraryCallKit::generate_method_call
Reviewed-by: thartmann, chagedorn
1 parent 39c104d commit c3f10e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hotspot/share/opto/library_call.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -3982,6 +3982,7 @@ bool LibraryCallKit::inline_unsafe_newArray(bool uninitialized) {
39823982
Node* mirror;
39833983
Node* count_val;
39843984
if (uninitialized) {
3985+
null_check_receiver();
39853986
mirror = argument(1);
39863987
count_val = argument(2);
39873988
} else {
@@ -4278,7 +4279,7 @@ LibraryCallKit::generate_method_call(vmIntrinsics::ID method_id, bool is_virtual
42784279
slow_call = new CallStaticJavaNode(C, tf,
42794280
SharedRuntime::get_resolve_static_call_stub(), method);
42804281
} else if (is_virtual) {
4281-
null_check_receiver();
4282+
assert(!gvn().type(argument(0))->maybe_null(), "should not be null");
42824283
int vtable_index = Method::invalid_vtable_index;
42834284
if (UseInlineCaches) {
42844285
// Suppress the vtable call
@@ -4294,7 +4295,7 @@ LibraryCallKit::generate_method_call(vmIntrinsics::ID method_id, bool is_virtual
42944295
SharedRuntime::get_resolve_virtual_call_stub(),
42954296
method, vtable_index);
42964297
} else { // neither virtual nor static: opt_virtual
4297-
null_check_receiver();
4298+
assert(!gvn().type(argument(0))->maybe_null(), "should not be null");
42984299
slow_call = new CallStaticJavaNode(C, tf,
42994300
SharedRuntime::get_resolve_opt_virtual_call_stub(), method);
43004301
slow_call->set_optimized_virtual(true);

0 commit comments

Comments
 (0)