Skip to content

Commit

Permalink
8268301: Closed test: compiler/c2/6371167/Test.java fails after JDK-8…
Browse files Browse the repository at this point in the history
…267904

Reviewed-by: kvn, dlong
  • Loading branch information
Hui Shi authored and DamonFool committed Jun 7, 2021
1 parent 204b492 commit 3e48244
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 98 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/callnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ Node *AllocateArrayNode::make_ideal_length(const TypeOopPtr* oop_type, PhaseTran
InitializeNode* init = initialization();
assert(init != NULL, "initialization not found");
length = new CastIINode(length, narrow_length_type);
length->set_req(TypeFunc::Control, init->proj_out_or_null(TypeFunc::Control));
length->set_req(0, init->proj_out_or_null(0));
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/graphKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3971,7 +3971,8 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
if (map()->find_edge(length) >= 0) {
Node* ccast = alloc->make_ideal_length(ary_type, &_gvn);
if (ccast != length) {
ccast = _gvn.transform(ccast);
_gvn.set_type_bottom(ccast);
record_for_igvn(ccast);
replace_in_map(length, ccast);
}
}
Expand Down
36 changes: 0 additions & 36 deletions src/hotspot/share/opto/library_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4443,30 +4443,6 @@ void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, No
Node* alloc_mem = alloc->in(TypeFunc::Memory);
C->gvn_replace_by(callprojs.fallthrough_ioproj, alloc->in(TypeFunc::I_O));
C->gvn_replace_by(init->proj_out(TypeFunc::Memory), alloc_mem);

// The CastIINode created in GraphKit::new_array (in AllocateArrayNode::make_ideal_length) must stay below
// the allocation (i.e. is only valid if the allocation succeeds):
// 1) replace CastIINode with AllocateArrayNode's length here
// 2) Create CastIINode again once allocation has moved (see below) at the end of this method
Node* init_control = init->proj_out(TypeFunc::Control);
Node* alloc_length = alloc->Ideal_length();
#ifdef ASSERT
Node* prev_cast = NULL;
#endif
for (uint i = 0; i < init_control->outcnt(); i++) {
Node *init_out = init_control->raw_out(i);
if (init_out->is_CastII() && init_out->in(0) == init_control && init_out->in(1) == alloc_length) {
#ifdef ASSERT
if (prev_cast == NULL) {
prev_cast = init_out;
assert(_gvn.hash_find(prev_cast) != NULL, "not found");
} else {
assert(_gvn.hash_find(prev_cast) == _gvn.hash_find(init_out), "not equal CastIINode");
}
#endif
C->gvn_replace_by(init_out, alloc_length);
}
}
C->gvn_replace_by(init->proj_out(TypeFunc::Control), alloc->in(0));

// move the allocation here (after the guards)
Expand Down Expand Up @@ -4498,18 +4474,6 @@ void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, No
dest->set_req(0, control());
Node* destx = _gvn.transform(dest);
assert(destx == dest, "where has the allocation result gone?");

// Cast length on remaining path to be as narrow as possible
// previous CastNode inserted when creating AllocateArrayNode
// is removed in early step in LibraryCallKit::inline_arraycopy
Node* length = alloc->in(AllocateNode::ALength);
if (map()->find_edge(length) >= 0) {
Node* ccast = alloc->make_ideal_length(ary_type, &_gvn);
if (ccast != length) {
ccast = _gvn.transform(ccast);
replace_in_map(length, ccast);
}
}
}
}

Expand Down
60 changes: 0 additions & 60 deletions test/hotspot/jtreg/compiler/c2/TestNegativeArrayCopyAfterLoop.java

This file was deleted.

0 comments on commit 3e48244

Please sign in to comment.