7200163: add CodeComments functionality to assember stubs

Pass the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments.

Reviewed-by: jrose, kvn, twisti
This commit is contained in:
Goetz Lindenmaier 2012-09-24 10:30:14 -07:00 committed by Vladimir Kozlov
parent 302540691b
commit 5ada196961
14 changed files with 73 additions and 42 deletions

View file

@ -101,7 +101,8 @@ Stub* StubQueue::stub_containing(address pc) const {
Stub* StubQueue::request_committed(int code_size) {
Stub* s = request(code_size);
if (s != NULL) commit(code_size);
CodeComments comments;
if (s != NULL) commit(code_size, comments);
return s;
}
@ -118,7 +119,8 @@ Stub* StubQueue::request(int requested_code_size) {
assert(_buffer_limit == _buffer_size, "buffer must be fully usable");
if (_queue_end + requested_size <= _buffer_size) {
// code fits in at the end => nothing to do
stub_initialize(s, requested_size);
CodeComments comments;
stub_initialize(s, requested_size, comments);
return s;
} else {
// stub doesn't fit in at the queue end
@ -135,7 +137,8 @@ Stub* StubQueue::request(int requested_code_size) {
// Queue: |XXX|.......|XXXXXXX|.......|
// ^0 ^end ^begin ^limit ^size
s = current_stub();
stub_initialize(s, requested_size);
CodeComments comments;
stub_initialize(s, requested_size, comments);
return s;
}
// Not enough space left
@ -144,12 +147,12 @@ Stub* StubQueue::request(int requested_code_size) {
}
void StubQueue::commit(int committed_code_size) {
void StubQueue::commit(int committed_code_size, CodeComments& comments) {
assert(committed_code_size > 0, "committed_code_size must be > 0");
int committed_size = round_to(stub_code_size_to_size(committed_code_size), CodeEntryAlignment);
Stub* s = current_stub();
assert(committed_size <= stub_size(s), "committed size must not exceed requested size");
stub_initialize(s, committed_size);
stub_initialize(s, committed_size, comments);
_queue_end += committed_size;
_number_of_stubs++;
if (_mutex != NULL) _mutex->unlock();