--- old/src/hotspot/share/adlc/formssel.cpp 2018-11-15 07:49:20.194884611 -0800 +++ new/src/hotspot/share/adlc/formssel.cpp 2018-11-15 07:49:19.744842748 -0800 @@ -1354,7 +1354,7 @@ // component back to an index and any DEF always goes at 0 so the // length of the array has to be the number of components + 1. _uniq_idx_length = _components.count() + 1; - uniq_idx = (uint*) malloc(sizeof(uint) * _uniq_idx_length); + uniq_idx = (uint*) AllocateHeap(sizeof(uint) * _uniq_idx_length); for (i = 0; i < _uniq_idx_length; i++) { uniq_idx[i] = i; } @@ -3449,7 +3449,7 @@ rstr = (_rChild) ? ((_rChild->_internalop) ? _rChild->_internalop : _rChild->_opType) : ""; len += (int)strlen(lstr) + (int)strlen(rstr); - subtree = (char *)malloc(len); + subtree = (char *)AllocateHeap(len); sprintf(subtree,"_%s_%s_%s", _opType, lstr, rstr); // Hash the subtree string in _internalOps; if a name exists, use it iop = (char *)_AD._internalOps[subtree]; @@ -3863,7 +3863,7 @@ MatchRule* clone = new MatchRule(_AD, this); // Swap operands of commutative operation ((MatchNode*)clone)->swap_commutative_op(true, count); - char* buf = (char*) malloc(strlen(instr_ident) + 4); + char* buf = (char*) AllocateHeap(strlen(instr_ident) + 4); sprintf(buf, "%s_%d", instr_ident, match_rules_cnt++); clone->_result = buf;