1691 {
1692 if (!mappings_scanned_) {
1693 ScanMetadataMappings();
1694 mappings_scanned_ = true;
1695 }
1696
1697 if (mappings_num_ == 0) {
1698 return -1;
1699 }
1700
1702
1703
1704
1705 if (node_offset < last_node_offset_) {
1707 }
1708
1709 intptr_t index = last_mapping_index_;
1710 intptr_t mapping_node_offset = 0;
1711 intptr_t mapping_md_offset = -1;
1712
1713 Reader reader(
H.metadata_mappings());
1715 reader.set_offset(mappings_offset_ + index * 2 *
kUInt32Size);
1716
1717 for (; index < mappings_num_; ++index) {
1718 mapping_node_offset = reader.ReadUInt32();
1719 mapping_md_offset = reader.ReadUInt32();
1720
1721 if (mapping_node_offset >= node_offset) {
1722 break;
1723 }
1724 }
1725
1726 last_mapping_index_ = index;
1727 last_node_offset_ = node_offset;
1728
1729 if ((index < mappings_num_) && (mapping_node_offset == node_offset)) {
1730 ASSERT(mapping_md_offset >= 0);
1731 return mapping_md_offset;
1732 } else {
1733 return -1;
1734 }
1735}