Skip to content

Commit 3e48244

Browse files
Hui ShiDamonFool
authored andcommitted
8268301: Closed test: compiler/c2/6371167/Test.java fails after JDK-8267904
Reviewed-by: kvn, dlong
1 parent 204b492 commit 3e48244

File tree

4 files changed

+3
-98
lines changed

4 files changed

+3
-98
lines changed

src/hotspot/share/opto/callnode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ Node *AllocateArrayNode::make_ideal_length(const TypeOopPtr* oop_type, PhaseTran
17581758
InitializeNode* init = initialization();
17591759
assert(init != NULL, "initialization not found");
17601760
length = new CastIINode(length, narrow_length_type);
1761-
length->set_req(TypeFunc::Control, init->proj_out_or_null(TypeFunc::Control));
1761+
length->set_req(0, init->proj_out_or_null(0));
17621762
}
17631763
}
17641764

src/hotspot/share/opto/graphKit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3971,7 +3971,8 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
39713971
if (map()->find_edge(length) >= 0) {
39723972
Node* ccast = alloc->make_ideal_length(ary_type, &_gvn);
39733973
if (ccast != length) {
3974-
ccast = _gvn.transform(ccast);
3974+
_gvn.set_type_bottom(ccast);
3975+
record_for_igvn(ccast);
39753976
replace_in_map(length, ccast);
39763977
}
39773978
}

src/hotspot/share/opto/library_call.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4443,30 +4443,6 @@ void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, No
44434443
Node* alloc_mem = alloc->in(TypeFunc::Memory);
44444444
C->gvn_replace_by(callprojs.fallthrough_ioproj, alloc->in(TypeFunc::I_O));
44454445
C->gvn_replace_by(init->proj_out(TypeFunc::Memory), alloc_mem);
4446-
4447-
// The CastIINode created in GraphKit::new_array (in AllocateArrayNode::make_ideal_length) must stay below
4448-
// the allocation (i.e. is only valid if the allocation succeeds):
4449-
// 1) replace CastIINode with AllocateArrayNode's length here
4450-
// 2) Create CastIINode again once allocation has moved (see below) at the end of this method
4451-
Node* init_control = init->proj_out(TypeFunc::Control);
4452-
Node* alloc_length = alloc->Ideal_length();
4453-
#ifdef ASSERT
4454-
Node* prev_cast = NULL;
4455-
#endif
4456-
for (uint i = 0; i < init_control->outcnt(); i++) {
4457-
Node *init_out = init_control->raw_out(i);
4458-
if (init_out->is_CastII() && init_out->in(0) == init_control && init_out->in(1) == alloc_length) {
4459-
#ifdef ASSERT
4460-
if (prev_cast == NULL) {
4461-
prev_cast = init_out;
4462-
assert(_gvn.hash_find(prev_cast) != NULL, "not found");
4463-
} else {
4464-
assert(_gvn.hash_find(prev_cast) == _gvn.hash_find(init_out), "not equal CastIINode");
4465-
}
4466-
#endif
4467-
C->gvn_replace_by(init_out, alloc_length);
4468-
}
4469-
}
44704446
C->gvn_replace_by(init->proj_out(TypeFunc::Control), alloc->in(0));
44714447

44724448
// move the allocation here (after the guards)
@@ -4498,18 +4474,6 @@ void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, No
44984474
dest->set_req(0, control());
44994475
Node* destx = _gvn.transform(dest);
45004476
assert(destx == dest, "where has the allocation result gone?");
4501-
4502-
// Cast length on remaining path to be as narrow as possible
4503-
// previous CastNode inserted when creating AllocateArrayNode
4504-
// is removed in early step in LibraryCallKit::inline_arraycopy
4505-
Node* length = alloc->in(AllocateNode::ALength);
4506-
if (map()->find_edge(length) >= 0) {
4507-
Node* ccast = alloc->make_ideal_length(ary_type, &_gvn);
4508-
if (ccast != length) {
4509-
ccast = _gvn.transform(ccast);
4510-
replace_in_map(length, ccast);
4511-
}
4512-
}
45134477
}
45144478
}
45154479

test/hotspot/jtreg/compiler/c2/TestNegativeArrayCopyAfterLoop.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)