--- old/src/share/vm/opto/memnode.cpp 2015-10-08 22:15:52.942178037 +0200 +++ new/src/share/vm/opto/memnode.cpp 2015-10-08 22:15:52.885179398 +0200 @@ -41,6 +41,7 @@ #include "opto/narrowptrnode.hpp" #include "opto/phaseX.hpp" #include "opto/regmask.hpp" +#include "opto/shenandoahSupport.hpp" #include "utilities/copy.hpp" // Portions of code courtesy of Clifford Click @@ -1000,6 +1001,7 @@ (tp != NULL) && tp->is_ptr_to_boxed_value()) { intptr_t ignore = 0; Node* base = AddPNode::Ideal_base_and_offset(ld_adr, phase, ignore); + base = ShenandoahBarrierNode::skip_through_barrier(base); if (base != NULL && base->is_Proj() && base->as_Proj()->_con == TypeFunc::Parms && base->in(0)->is_CallStaticJava() && @@ -1603,7 +1605,7 @@ // as to alignment, which will therefore produce the smallest // possible base offset. const int min_base_off = arrayOopDesc::base_offset_in_bytes(T_BYTE); - const bool off_beyond_header = ((uint)off >= (uint)min_base_off); + const bool off_beyond_header = (off != -8 || !UseShenandoahGC) && ((uint)off >= (uint)min_base_off); // Try to constant-fold a stable array element. if (FoldStableValues && ary->is_stable() && ary->const_oop() != NULL) {