hotspot/src/share/vm/opto/graphKit.cpp
changeset 29362 4188dc7f05a8
parent 29193 3ede621e9262
parent 29361 ae2aef8d8ab9
child 29580 a67a581cfe11
child 29695 7f733c2a8db4
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 20:23:32 2017 +0200
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Fri Mar 06 04:58:52 2015 -0800
@@ -1660,22 +1660,7 @@
 
   // must be correct type for alignment purposes
   Node* base  = basic_plus_adr(ary, header);
-#ifdef _LP64
-  // The scaled index operand to AddP must be a clean 64-bit value.
-  // Java allows a 32-bit int to be incremented to a negative
-  // value, which appears in a 64-bit register as a large
-  // positive number.  Using that large positive number as an
-  // operand in pointer arithmetic has bad consequences.
-  // On the other hand, 32-bit overflow is rare, and the possibility
-  // can often be excluded, if we annotate the ConvI2L node with
-  // a type assertion that its value is known to be a small positive
-  // number.  (The prior range check has ensured this.)
-  // This assertion is used by ConvI2LNode::Ideal.
-  int index_max = max_jint - 1;  // array size is max_jint, index is one less
-  if (sizetype != NULL)  index_max = sizetype->_hi - 1;
-  const TypeLong* lidxtype = TypeLong::make(CONST64(0), index_max, Type::WidenMax);
-  idx = _gvn.transform( new ConvI2LNode(idx, lidxtype) );
-#endif
+  idx = Compile::conv_I2X_index(&_gvn, idx, sizetype);
   Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) );
   return basic_plus_adr(ary, base, scale);
 }
@@ -3759,7 +3744,8 @@
 
 Node* GraphKit::byte_map_base_node() {
   // Get base of card map
-  CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
+  CardTableModRefBS* ct =
+    barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
   assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
   if (ct->byte_map_base != NULL) {
     return makecon(TypeRawPtr::make((address)ct->byte_map_base));