private void writeCallSites(DexDataWriter writer) throws IOException { callSiteSectionOffset = writer.getPosition(); List<Map.Entry<? extends CallSiteKey, Integer>> callSiteEntries = Lists.newArrayList(callSiteSection.getItems()); Collections.sort(callSiteEntries, callSiteComparator); int index = 0; for (Map.Entry<? extends CallSiteKey, Integer> callSite: callSiteEntries) { callSite.setValue(index++); writer.writeInt(encodedArraySection.getItemOffset(callSiteSection.getEncodedCallSite(callSite.getKey()))); } }
numItems++; if (callSiteSection.getItems().size() > 0) { numItems++;
writeMapItem(writer, ItemType.METHOD_ID_ITEM, methodSection.getItems().size(), methodSectionOffset); writeMapItem(writer, ItemType.CLASS_DEF_ITEM, classSection.getItems().size(), classIndexSectionOffset); writeMapItem(writer, ItemType.CALL_SITE_ID_ITEM, callSiteSection.getItems().size(), callSiteSectionOffset); writeMapItem(writer, ItemType.METHOD_HANDLE_ITEM, methodHandleSection.getItems().size(), methodHandleSectionOffset);
private void writeCallSites(DexDataWriter writer) throws IOException { callSiteSectionOffset = writer.getPosition(); List<Map.Entry<? extends CallSiteKey, Integer>> callSiteEntries = Lists.newArrayList(callSiteSection.getItems()); Collections.sort(callSiteEntries, callSiteComparator); int index = 0; for (Map.Entry<? extends CallSiteKey, Integer> callSite: callSiteEntries) { callSite.setValue(index++); writer.writeInt(encodedArraySection.getItemOffset(callSiteSection.getEncodedCallSite(callSite.getKey()))); } }
numItems++; if (callSiteSection.getItems().size() > 0) { numItems++;
writeMapItem(writer, ItemType.METHOD_ID_ITEM, methodSection.getItems().size(), methodSectionOffset); writeMapItem(writer, ItemType.CLASS_DEF_ITEM, classSection.getItems().size(), classIndexSectionOffset); writeMapItem(writer, ItemType.CALL_SITE_ID_ITEM, callSiteSection.getItems().size(), callSiteSectionOffset); writeMapItem(writer, ItemType.METHOD_HANDLE_ITEM, methodHandleSection.getItems().size(), methodHandleSectionOffset);