--- old/src/hotspot/share/opto/graphKit.cpp 2018-09-27 10:49:45.692008056 +0200 +++ new/src/hotspot/share/opto/graphKit.cpp 2018-09-27 10:49:37.688991230 +0200 @@ -1722,9 +1722,9 @@ } } -void GraphKit::access_clone(Node* ctl, Node* src, Node* dst, Node* size, bool is_array) { +void GraphKit::access_clone(Node* ctl, Node* src_base, Node* dst_base, Node* countx, bool is_array) { set_control(ctl); - return _barrier_set->clone(this, src, dst, size, is_array); + return _barrier_set->clone(this, src_base, dst_base, countx, is_array); } //-------------------------array_element_address------------------------- @@ -3347,7 +3347,7 @@ } // Deoptimize if 'ary' is flattened or if 'obj' is null and 'ary' is a value type array -void GraphKit::gen_value_type_array_guard(Node* ary, Node* obj, Node* elem_klass) { +void GraphKit::gen_value_type_array_guard(Node* ary, Node* obj, Node* elem_klass, int nargs) { assert(EnableValhalla, "should only be used if value types are enabled"); if (elem_klass == NULL) { // Load array element klass @@ -3367,27 +3367,24 @@ Node* bol = _gvn.transform(new BoolNode(cmp, BoolTest::eq)); { BuildCutout unless(this, bol, PROB_MAX); // TODO just deoptimize for now if we store null to a value type array + inc_sp(nargs); uncommon_trap(Deoptimization::Reason_array_check, Deoptimization::Action_none); } } else { - // Check if array is flattened or if we are storing null to a value type array - // TODO can we merge these checks? - gen_flattened_array_guard(ary); - if (objtype->meet(TypePtr::NULL_PTR) == objtype) { - // Check if (is_value_elem && obj_is_null) <=> (!is_value_elem | !obj_is_null == 0) - // TODO what if we later figure out that obj is never null? - Node* not_value = _gvn.transform(new XorINode(is_value_elem, intcon(JVM_ACC_VALUE))); - not_value = _gvn.transform(new ConvI2LNode(not_value)); - Node* not_null = _gvn.transform(new CastP2XNode(NULL, obj)); - Node* both = _gvn.transform(new OrLNode(not_null, not_value)); - Node* cmp = _gvn.transform(new CmpLNode(both, longcon(0))); - Node* bol = _gvn.transform(new BoolNode(cmp, BoolTest::ne)); - { BuildCutout unless(this, bol, PROB_MAX); - // TODO just deoptimize for now if we store null to a value type array - uncommon_trap(Deoptimization::Reason_array_check, - Deoptimization::Action_none); - } + // Check if (is_value_elem && obj_is_null) <=> (!is_value_elem | !obj_is_null == 0) + // TODO what if we later figure out that obj is never null? + Node* not_value = _gvn.transform(new XorINode(is_value_elem, intcon(JVM_ACC_VALUE))); + not_value = _gvn.transform(new ConvI2LNode(not_value)); + Node* not_null = _gvn.transform(new CastP2XNode(NULL, obj)); + Node* both = _gvn.transform(new OrLNode(not_null, not_value)); + Node* cmp = _gvn.transform(new CmpLNode(both, longcon(0))); + Node* bol = _gvn.transform(new BoolNode(cmp, BoolTest::ne)); + { BuildCutout unless(this, bol, PROB_MAX); + // TODO just deoptimize for now if we store null to a value type array + inc_sp(nargs); + uncommon_trap(Deoptimization::Reason_array_check, + Deoptimization::Action_none); } } }