Skip to content
Permalink
Browse files
8246453: TestClone crashes with "all collected exceptions must come f…
…rom the same place"

Set deoptimize_on_exception for slow paths.

Reviewed-by: neliasso
  • Loading branch information
TobiHartmann committed Jun 8, 2020
1 parent 35ceac0 commit a98bad2b2236f7336a2dbffcfb3cbc8aa4f7d134
Showing 4 changed files with 11 additions and 7 deletions.
@@ -77,11 +77,11 @@ ArrayCopyNode* ArrayCopyNode::make(GraphKit* kit, bool may_throw,
return ac;
}

void ArrayCopyNode::connect_outputs(GraphKit* kit) {
void ArrayCopyNode::connect_outputs(GraphKit* kit, bool deoptimize_on_exception) {
kit->set_all_memory_call(this, true);
kit->set_control(kit->gvn().transform(new ProjNode(this,TypeFunc::Control)));
kit->set_i_o(kit->gvn().transform(new ProjNode(this, TypeFunc::I_O)));
kit->make_slow_call_ex(this, kit->env()->Throwable_klass(), true);
kit->make_slow_call_ex(this, kit->env()->Throwable_klass(), true, deoptimize_on_exception);
kit->set_all_memory_call(this);
}

@@ -144,7 +144,7 @@ class ArrayCopyNode : public CallNode {
Node* src_klass = NULL, Node* dest_klass = NULL,
Node* src_length = NULL, Node* dest_length = NULL);

void connect_outputs(GraphKit* kit);
void connect_outputs(GraphKit* kit, bool deoptimize_on_exception = false);

bool is_arraycopy() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy; }
bool is_arraycopy_validated() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy && _arguments_validated; }
@@ -4327,7 +4327,7 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) {
set_control(array_ctl);
Node* obj_length = load_array_length(obj);
Node* obj_size = NULL;
Node* alloc_obj = new_array(obj_klass, obj_length, 0, &obj_size); // no arguments to push
Node* alloc_obj = new_array(obj_klass, obj_length, 0, &obj_size, /*deoptimize_on_exception=*/true);

BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
if (bs->array_copy_requires_gc_barriers(true, T_OBJECT, true, BarrierSetC2::Parsing)) {
@@ -4343,7 +4343,7 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) {
ac->set_clone_oop_array();
Node* n = _gvn.transform(ac);
assert(n == ac, "cannot disappear");
ac->connect_outputs(this);
ac->connect_outputs(this, /*deoptimize_on_exception=*/true);

result_reg->init_req(_objArray_path, control());
result_val->init_req(_objArray_path, alloc_obj);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, 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
@@ -23,14 +23,18 @@

/*
* @test
* @bug 8033626
* @bug 8033626 8246453
* @summary assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place
* @modules java.base/jdk.internal.misc
* @library /test/lib
*
* @run main/othervm -XX:-TieredCompilation -Xbatch
* -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestClone::test*
* compiler.intrinsics.object.TestClone
* @run main/othervm -XX:-TieredCompilation -Xbatch
* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressReflectiveCode
* -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestClone::test*
* compiler.intrinsics.object.TestClone
*/

package compiler.intrinsics.object;

0 comments on commit a98bad2

Please sign in to comment.