79 int ai = (*((StubCodeDesc**) void_a))->index();
80 int bi = (*((StubCodeDesc**) void_b))->index();
81 return ai - bi;
82 }
83 }
84
85 StubCodeGenerator::~StubCodeGenerator() {
86 if (PrintStubCode || _print_code) {
87 CodeBuffer* cbuf = _masm->code();
88 CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
89 if (blob != NULL) {
90 blob->set_strings(cbuf->strings());
91 }
92 bool saw_first = false;
93 StubCodeDesc* toprint[1000];
94 int toprint_len = 0;
95 for (StubCodeDesc* cdesc = _last_stub; cdesc != NULL; cdesc = cdesc->_next) {
96 toprint[toprint_len++] = cdesc;
97 if (cdesc == _first_stub) { saw_first = true; break; }
98 }
99 assert(saw_first, "must get both first & last");
100 // Print in reverse order:
101 qsort(toprint, toprint_len, sizeof(toprint[0]), compare_cdesc);
102 for (int i = 0; i < toprint_len; i++) {
103 StubCodeDesc* cdesc = toprint[i];
104 cdesc->print();
105 tty->cr();
106 Disassembler::decode(cdesc->begin(), cdesc->end());
107 tty->cr();
108 }
109 }
110 }
111
112
113 void StubCodeGenerator::stub_prolog(StubCodeDesc* cdesc) {
114 // default implementation - do nothing
115 }
116
117
118 void StubCodeGenerator::stub_epilog(StubCodeDesc* cdesc) {
119 // default implementation - record the cdesc
|
79 int ai = (*((StubCodeDesc**) void_a))->index();
80 int bi = (*((StubCodeDesc**) void_b))->index();
81 return ai - bi;
82 }
83 }
84
85 StubCodeGenerator::~StubCodeGenerator() {
86 if (PrintStubCode || _print_code) {
87 CodeBuffer* cbuf = _masm->code();
88 CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
89 if (blob != NULL) {
90 blob->set_strings(cbuf->strings());
91 }
92 bool saw_first = false;
93 StubCodeDesc* toprint[1000];
94 int toprint_len = 0;
95 for (StubCodeDesc* cdesc = _last_stub; cdesc != NULL; cdesc = cdesc->_next) {
96 toprint[toprint_len++] = cdesc;
97 if (cdesc == _first_stub) { saw_first = true; break; }
98 }
99 assert(toprint_len == 0 || saw_first, "must get both first & last");
100 // Print in reverse order:
101 qsort(toprint, toprint_len, sizeof(toprint[0]), compare_cdesc);
102 for (int i = 0; i < toprint_len; i++) {
103 StubCodeDesc* cdesc = toprint[i];
104 cdesc->print();
105 tty->cr();
106 Disassembler::decode(cdesc->begin(), cdesc->end());
107 tty->cr();
108 }
109 }
110 }
111
112
113 void StubCodeGenerator::stub_prolog(StubCodeDesc* cdesc) {
114 // default implementation - do nothing
115 }
116
117
118 void StubCodeGenerator::stub_epilog(StubCodeDesc* cdesc) {
119 // default implementation - record the cdesc
|