mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-24 04:54:40 +02:00
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:
parent
302540691b
commit
5ada196961
14 changed files with 73 additions and 42 deletions
|
@ -25,6 +25,7 @@
|
|||
#ifndef SHARE_VM_CODE_STUBS_HPP
|
||||
#define SHARE_VM_CODE_STUBS_HPP
|
||||
|
||||
#include "asm/codeBuffer.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#ifdef TARGET_OS_FAMILY_linux
|
||||
# include "os_linux.inline.hpp"
|
||||
|
@ -71,7 +72,8 @@
|
|||
class Stub VALUE_OBJ_CLASS_SPEC {
|
||||
public:
|
||||
// Initialization/finalization
|
||||
void initialize(int size) { ShouldNotCallThis(); } // called to initialize/specify the stub's size
|
||||
void initialize(int size,
|
||||
CodeComments& comments) { ShouldNotCallThis(); } // called to initialize/specify the stub's size
|
||||
void finalize() { ShouldNotCallThis(); } // called before the stub is deallocated
|
||||
|
||||
// General info/converters
|
||||
|
@ -104,7 +106,8 @@ class Stub VALUE_OBJ_CLASS_SPEC {
|
|||
class StubInterface: public CHeapObj<mtCode> {
|
||||
public:
|
||||
// Initialization/finalization
|
||||
virtual void initialize(Stub* self, int size) = 0; // called after creation (called twice if allocated via (request, commit))
|
||||
virtual void initialize(Stub* self, int size,
|
||||
CodeComments& comments) = 0; // called after creation (called twice if allocated via (request, commit))
|
||||
virtual void finalize(Stub* self) = 0; // called before deallocation
|
||||
|
||||
// General info/converters
|
||||
|
@ -132,7 +135,8 @@ class StubInterface: public CHeapObj<mtCode> {
|
|||
\
|
||||
public: \
|
||||
/* Initialization/finalization */ \
|
||||
virtual void initialize(Stub* self, int size) { cast(self)->initialize(size); } \
|
||||
virtual void initialize(Stub* self, int size, \
|
||||
CodeComments& comments) { cast(self)->initialize(size, comments); } \
|
||||
virtual void finalize(Stub* self) { cast(self)->finalize(); } \
|
||||
\
|
||||
/* General info */ \
|
||||
|
@ -171,7 +175,8 @@ class StubQueue: public CHeapObj<mtCode> {
|
|||
Stub* current_stub() const { return stub_at(_queue_end); }
|
||||
|
||||
// Stub functionality accessed via interface
|
||||
void stub_initialize(Stub* s, int size) { assert(size % CodeEntryAlignment == 0, "size not aligned"); _stub_interface->initialize(s, size); }
|
||||
void stub_initialize(Stub* s, int size,
|
||||
CodeComments& comments) { assert(size % CodeEntryAlignment == 0, "size not aligned"); _stub_interface->initialize(s, size, comments); }
|
||||
void stub_finalize(Stub* s) { _stub_interface->finalize(s); }
|
||||
int stub_size(Stub* s) const { return _stub_interface->size(s); }
|
||||
bool stub_contains(Stub* s, address pc) const { return _stub_interface->code_begin(s) <= pc && pc < _stub_interface->code_end(s); }
|
||||
|
@ -200,7 +205,8 @@ class StubQueue: public CHeapObj<mtCode> {
|
|||
// Stub allocation (atomic transactions)
|
||||
Stub* request_committed(int code_size); // request a stub that provides exactly code_size space for code
|
||||
Stub* request(int requested_code_size); // request a stub with a (maximum) code space - locks the queue
|
||||
void commit (int committed_code_size); // commit the previously requested stub - unlocks the queue
|
||||
void commit (int committed_code_size,
|
||||
CodeComments& comments); // commit the previously requested stub - unlocks the queue
|
||||
|
||||
// Stub deallocation
|
||||
void remove_first(); // remove the first stub in the queue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue