5 #include "src/wasm/signature-map.h" 7 #include "src/signature.h" 13 uint32_t SignatureMap::FindOrInsert(
const FunctionSig& sig) {
15 auto pos = map_.find(sig);
16 if (pos != map_.end())
return pos->second;
18 CHECK_GE(kMaxInt, map_.size());
20 map_.insert(std::make_pair(sig, index));
24 int32_t SignatureMap::Find(
const FunctionSig& sig)
const {
25 auto pos = map_.find(sig);
26 if (pos == map_.end())
return -1;
27 return static_cast<int32_t
>(pos->second);