// Implementation of StubQueue // // Standard wrap-around queue implementation; the queue dimensions // are specified by the _queue_begin & _queue_end indices. The queue // can be in two states (transparent to the outside): // // a) contiguous state: all queue entries in one block (or empty) // // Queue: |...|XXXXXXX|...............| // ^0 ^begin ^end ^size = limit // |_______| // one block // // b) non-contiguous state: queue entries in two blocks // // Queue: |XXX|.......|XXXXXXX|.......| // ^0 ^end ^begin ^limit ^size // |___| |_______| // 1st block 2nd block // // In the non-contiguous state, the wrap-around point is // indicated via the _buffer_limit index since the last // queue entry may not fill up the queue completely in // which case we need to know where the 2nd block's end // is to do the proper wrap-around. When removing the // last entry of the 2nd block, _buffer_limit is reset // to _buffer_size. // // CAUTION: DO NOT MESS WITH THIS CODE IF YOU CANNOT PROVE // ITS CORRECTNESS! THIS CODE IS MORE SUBTLE THAN IT LOOKS!
StubQueue::~StubQueue() { // Note: Currently StubQueues are never destroyed so nothing needs to be done here. // If we want to implement the destructor, we need to release the BufferBlob // allocated in the constructor (i.e., we need to keep it around or look it // up via CodeCache::find_blob(...).
Unimplemented();
}
void StubQueue::deallocate_unused_tail() {
CodeBlob* blob = CodeCache::find_blob((void*)_stub_buffer);
CodeCache::free_unused_tail(blob, used_space()); // Update the limits to the new, trimmed CodeBlob size
_buffer_size = blob->content_size();
_buffer_limit = blob->content_size();
}
Stub* StubQueue::stub_containing(address pc) const { if (contains(pc)) { for (Stub* s = first(); s != NULL; s = next(s)) { if (stub_contains(s, pc)) return s;
}
} return NULL;
}
Stub* StubQueue::request_committed(int code_size) {
Stub* s = request(code_size); if (s != NULL) commit(code_size); return s;
}
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.