< prev index next >

src/hotspot/share/adlc/formssel.cpp

Print this page

        

*** 1352,1362 **** if (nopnds > 0) { // Allocate index array. Worst case we're mapping from each // 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); for (i = 0; i < _uniq_idx_length; i++) { uniq_idx[i] = i; } } // Do it only if there is a match rule and no expand rule. With an --- 1352,1362 ---- if (nopnds > 0) { // Allocate index array. Worst case we're mapping from each // 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*) AllocateHeap(sizeof(uint) * _uniq_idx_length); for (i = 0; i < _uniq_idx_length; i++) { uniq_idx[i] = i; } } // Do it only if there is a match rule and no expand rule. With an
*** 3447,3457 **** lstr = (_lChild) ? ((_lChild->_internalop) ? _lChild->_internalop : _lChild->_opType) : ""; rstr = (_rChild) ? ((_rChild->_internalop) ? _rChild->_internalop : _rChild->_opType) : ""; len += (int)strlen(lstr) + (int)strlen(rstr); ! subtree = (char *)malloc(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]; // Else create a unique name, and add it to the hash table if (iop == NULL) { --- 3447,3457 ---- lstr = (_lChild) ? ((_lChild->_internalop) ? _lChild->_internalop : _lChild->_opType) : ""; rstr = (_rChild) ? ((_rChild->_internalop) ? _rChild->_internalop : _rChild->_opType) : ""; len += (int)strlen(lstr) + (int)strlen(rstr); ! 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]; // Else create a unique name, and add it to the hash table if (iop == NULL) {
*** 3861,3871 **** assert(match_rules_cnt < 100," too many match rule clones"); // Clone 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); sprintf(buf, "%s_%d", instr_ident, match_rules_cnt++); clone->_result = buf; clone->_next = this->_next; this-> _next = clone; --- 3861,3871 ---- assert(match_rules_cnt < 100," too many match rule clones"); // Clone MatchRule* clone = new MatchRule(_AD, this); // Swap operands of commutative operation ((MatchNode*)clone)->swap_commutative_op(true, count); ! char* buf = (char*) AllocateHeap(strlen(instr_ident) + 4); sprintf(buf, "%s_%d", instr_ident, match_rules_cnt++); clone->_result = buf; clone->_next = this->_next; this-> _next = clone;
< prev index next >