| 178 | } |
| 179 | |
| 180 | void CostModel::RecordSize(const Node* node, int slot, Bytes bytes) { |
| 181 | const int id = Id(node); |
| 182 | if (id < 0) return; |
| 183 | CHECK_LT(id, slot_bytes_.size()); |
| 184 | auto perslot = &slot_bytes_[id]; |
| 185 | CHECK_LT(slot, perslot->size()); |
| 186 | auto v = &(*perslot)[slot]; |
| 187 | if (*v >= 0) { |
| 188 | *v += bytes; |
| 189 | } else { |
| 190 | *v = bytes; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | Bytes CostModel::TotalBytes(const Node* node, int slot) const { |
| 195 | const int id = Id(node); |
no test coverage detected