Skip to content

Commit 8b8b1f9

Browse files
committedJan 14, 2021
8259706: C2 compilation fails with assert(vtable_index == Method::invalid_vtable_index) failed: correct sentinel value
Reviewed-by: lucy, chagedorn
1 parent ae9187d commit 8b8b1f9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎src/hotspot/share/opto/library_call.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -3328,8 +3328,13 @@ bool LibraryCallKit::inline_unsafe_newArray(bool uninitialized) {
33283328
// ensuing call will throw an exception, or else it
33293329
// will cache the array klass for next time.
33303330
PreserveJVMState pjvms(this);
3331-
CallJavaNode* slow_call = uninitialized ? generate_method_call_virtual(vmIntrinsics::_allocateUninitializedArray) :
3332-
generate_method_call_static(vmIntrinsics::_newArray);
3331+
CallJavaNode* slow_call = NULL;
3332+
if (uninitialized) {
3333+
// Generate optimized virtual call (holder class 'Unsafe' is final)
3334+
slow_call = generate_method_call(vmIntrinsics::_allocateUninitializedArray, false, false);
3335+
} else {
3336+
slow_call = generate_method_call_static(vmIntrinsics::_newArray);
3337+
}
33333338
Node* slow_result = set_results_for_java_call(slow_call);
33343339
// this->control() comes from set_results_for_java_call
33353340
result_reg->set_req(_slow_path, control());

0 commit comments

Comments
 (0)
Please sign in to comment.