8209833: C2 compilation fails with "assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place"

Deoptimize if exception is thrown in _clone intrinsic.

Reviewed-by: kvn
This commit is contained in:
Tobias Hartmann 2018-08-24 08:17:23 +02:00
parent aad3230b1d
commit a494a819eb
4 changed files with 94 additions and 15 deletions

View file

@ -4386,7 +4386,8 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) {
if (!stopped()) {
PreserveJVMState pjvms(this);
CallJavaNode* slow_call = generate_method_call(vmIntrinsics::_clone, is_virtual);
Node* slow_result = set_results_for_java_call(slow_call);
// We need to deoptimize on exception (see comment above)
Node* slow_result = set_results_for_java_call(slow_call, false, /* deoptimize */ true);
// this->control() comes from set_results_for_java_call
result_reg->init_req(_slow_path, control());
result_val->init_req(_slow_path, slow_result);