--- old/src/share/vm/opto/memnode.cpp 2015-10-14 13:54:23.523664471 +0200 +++ new/src/share/vm/opto/memnode.cpp 2015-10-14 13:54:23.429666743 +0200 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "compiler/compileLog.hpp" +#include "gc/shenandoah/brooksPointer.hpp" #include "memory/allocation.inline.hpp" #include "oops/objArrayKlass.hpp" #include "opto/addnode.hpp" @@ -41,6 +42,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 +1002,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 +1606,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 != BrooksPointer::BYTE_OFFSET || !UseShenandoahGC) && ((uint)off >= (uint)min_base_off); // Try to constant-fold a stable array element. if (FoldStableValues && ary->is_stable() && ary->const_oop() != NULL) {