MAPID valueMap::containsValue(JS::Value v) { // VALUEMAPIT it = mMap.begin(); // for (; it != mMap.end(); it++) // { // if (v == it->second.heapValue.get()) // return it->first; // // } VMAPIT vit = vmap_find(v.asRawBits()); if (vit_valid(vit)) { VALUEMAPIT it = mmap_find(vit_v(vit)); Assert(mit_valid(it) && mit_v(it).heapValue.get().asRawBits() == v.asRawBits()); return mit_k(it); } return 0; }
MAPID valueMap::containsValue(JS::Value v) { // VALUEMAPIT it = mMap.begin(); // for (; it != mMap.end(); it++) // { // if (v == it->second.heapValue.get()) // return it->first; // // } VMAP::iterator vit = VMap.find(v.asRawBits()); if (vit != VMap.end()) { VALUEMAPIT it = mMap.find(vit->second); Assert(it != mMap.end()); return it->first; } return 0; }