// ciConstantPoolCache // // This class caches indexed constant pool lookups.
// ------------------------------------------------------------------ // ciConstantPoolCache::ciConstantPoolCache
ciConstantPoolCache::ciConstantPoolCache(Arena* arena, int expected_size) {
_elements = new (arena) GrowableArray<void*>(arena, expected_size, 0, 0);
_keys = new (arena) GrowableArray<int>(arena, expected_size, 0, 0);
}
int ciConstantPoolCache::key_compare(constint& key, constint& elt) { if (key < elt) return -1; elseif (key > elt) return1; elsereturn0;
}
// ------------------------------------------------------------------ // ciConstantPoolCache::get // // Get the entry at some index void* ciConstantPoolCache::get(int index) {
ASSERT_IN_VM; bool found = false; int pos = _keys->find_sorted<int, ciConstantPoolCache::key_compare>(index, found); if (!found) { // This element is not present in the cache. return NULL;
} return _elements->at(pos);
}
// ------------------------------------------------------------------ // ciConstantPoolCache::insert // // Insert a ciObject into the table at some index. void ciConstantPoolCache::insert(int index, void* elem) { bool found = false; int pos = _keys->find_sorted<int, ciConstantPoolCache::key_compare>(index, found);
assert(!found, "duplicate");
_keys->insert_before(pos, index);
_elements->insert_before(pos, elem);
}
// ------------------------------------------------------------------ // ciConstantPoolCache::print // // Print debugging information about the cache. void ciConstantPoolCache::print() {
Unimplemented();
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.