// All the basic framework for stub code generation/debugging/printing.
// A StubCodeDesc describes a piece of generated code (usually stubs). // This information is mainly useful for debugging and printing. // Currently, code descriptors are simply chained in a linked list, // this may have to change if searching becomes too slow.
class StubCodeDesc: public CHeapObj<mtCode> { private: static StubCodeDesc* _list; // the list of all descriptors staticbool _frozen; // determines whether _list modifications are allowed
StubCodeDesc* _next; // the next element in the linked list const char* _group; // the group to which the stub code belongs const char* _name; // the name assigned to the stub code
address _begin; // points to the first byte of the stub code (included)
address _end; // points to the first byte after the stub code (excluded)
uint _disp; // Displacement relative base address in buffer.
friend class StubCodeMark;
friend class StubCodeGenerator;
void set_begin(address begin) {
assert(begin >= _begin, "begin may not decrease");
assert(_end == NULL || begin <= _end, "begin & end not properly ordered");
_begin = begin;
}
void set_end(address end) {
assert(_begin <= end, "begin & end not properly ordered");
_end = end;
}
virtualvoid stub_prolog(StubCodeDesc* cdesc); // called by StubCodeMark constructor virtualvoid stub_epilog(StubCodeDesc* cdesc); // called by StubCodeMark destructor
};
// Stack-allocated helper class used to associate a stub code with a name. // All stub code generating functions that use a StubCodeMark will be registered // in the global StubCodeDesc list and the generated stub code can be identified // later via an address pointing into it.
class StubCodeMark: public StackObj { private:
StubCodeGenerator* _cgen;
StubCodeDesc* _cdesc;
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.