| 226 | } |
| 227 | |
| 228 | uint64_t getFunctionAotHash ( Function * fun ) { |
| 229 | if ( fun->aotHash != 0 ) return fun->aotHash; // cached |
| 230 | DependencyCollector collector; |
| 231 | collector.collect(fun); |
| 232 | auto vec = collector.getStableDependencies(); |
| 233 | vector<uint64_t> uvec; |
| 234 | uvec.reserve(vec.size() + 1); |
| 235 | debug_aot_hash("HASH %s %" PRIx64 "\n", fun->getMangledName().c_str(), fun->hash); |
| 236 | uvec.push_back(fun->hash); |
| 237 | for ( const auto & fn : vec ) { |
| 238 | if ( !fn.first->noAot &&!fn.first->builtIn ) { |
| 239 | DAS_ASSERTF(fn.first->hash,"%s has dependency on %s, which hash hash of 0", |
| 240 | fun->getMangledName().c_str(), fn.first->getMangledName().c_str()); |
| 241 | uvec.push_back(fn.first->hash); |
| 242 | debug_aot_hash("\t%s %" PRIx64 "\n", fn.second.c_str(), fn.first->hash); |
| 243 | } |
| 244 | } |
| 245 | uint64_t res = hash_block64((const uint8_t *)uvec.data(), uint32_t(uvec.size()*sizeof(uint64_t))); |
| 246 | debug_aot_hash("AOT HASH %" PRIx64 "\n", res); |
| 247 | fun->aotHash = res; |
| 248 | return res; |
| 249 | } |
| 250 | |
| 251 | string getAotHashComment ( const Function * fun ) { |
| 252 | DependencyCollector collector; |
no test coverage detected