--- a/hotspot/src/share/vm/opto/node.cpp Mon Jan 18 08:34:14 2016 +0100
+++ b/hotspot/src/share/vm/opto/node.cpp Mon Jan 18 08:40:25 2016 +0100
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/allocation.inline.hpp"
+#include "opto/castnode.hpp"
#include "opto/cfgnode.hpp"
#include "opto/connode.hpp"
#include "opto/loopnode.hpp"
@@ -516,6 +517,11 @@
C->add_macro_node(n);
if (is_expensive())
C->add_expensive_node(n);
+ // If the cloned node is a range check dependent CastII, add it to the list.
+ CastIINode* cast = n->isa_CastII();
+ if (cast != NULL && cast->has_range_check()) {
+ C->add_range_check_cast(cast);
+ }
n->set_idx(C->next_unique()); // Get new unique index as well
debug_only( n->verify_construction() );
@@ -644,6 +650,11 @@
if (is_expensive()) {
compile->remove_expensive_node(this);
}
+ CastIINode* cast = isa_CastII();
+ if (cast != NULL && cast->has_range_check()) {
+ compile->remove_range_check_cast(cast);
+ }
+
if (is_SafePoint()) {
as_SafePoint()->delete_replaced_nodes();
}
@@ -1379,6 +1390,10 @@
if (dead->is_expensive()) {
igvn->C->remove_expensive_node(dead);
}
+ CastIINode* cast = dead->isa_CastII();
+ if (cast != NULL && cast->has_range_check()) {
+ igvn->C->remove_range_check_cast(cast);
+ }
igvn->C->record_dead_node(dead->_idx);
// Kill all inputs to the dead guy
for (uint i=0; i < dead->req(); i++) {