--- a/hotspot/src/share/vm/opto/library_call.cpp Wed Feb 15 11:14:45 2017 +0100
+++ b/hotspot/src/share/vm/opto/library_call.cpp Wed Feb 15 17:26:37 2017 -0800
@@ -277,7 +277,8 @@
AllocateArrayNode* tightly_coupled_allocation(Node* ptr,
RegionNode* slow_region);
JVMState* arraycopy_restore_alloc_state(AllocateArrayNode* alloc, int& saved_reexecute_sp);
- void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp);
+ void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp,
+ uint new_idx);
typedef enum { LS_get_add, LS_get_set, LS_cmp_swap, LS_cmp_swap_weak, LS_cmp_exchange } LoadStoreKind;
MemNode::MemOrd access_kind_to_memord_LS(AccessKind access_kind, bool is_store);
@@ -4882,7 +4883,8 @@
// deoptimize. This is possible because tightly_coupled_allocation()
// guarantees there's no observer of the allocated array at this point
// and the control flow is simple enough.
-void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp) {
+void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms,
+ int saved_reexecute_sp, uint new_idx) {
if (saved_jvms != NULL && !stopped()) {
assert(alloc != NULL, "only with a tightly coupled allocation");
// restore JVM state to the state at the arraycopy
@@ -4891,7 +4893,7 @@
assert(saved_jvms->map()->i_o() == map()->i_o(), "IO state changed?");
// If we've improved the types of some nodes (null check) while
// emitting the guards, propagate them to the current state
- map()->replaced_nodes().apply(saved_jvms->map());
+ map()->replaced_nodes().apply(saved_jvms->map(), new_idx);
set_jvms(saved_jvms);
_reexecute_sp = saved_reexecute_sp;
@@ -4949,6 +4951,7 @@
Node* dest_offset = argument(3); // type: int
Node* length = argument(4); // type: int
+ uint new_idx = C->unique();
// Check for allocation before we add nodes that would confuse
// tightly_coupled_allocation()
@@ -5164,7 +5167,7 @@
}
}
- arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp);
+ arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp, new_idx);
if (stopped()) {
return true;