mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8140594: Various minor code improvements (compiler)
Various minor code improvements (compiler) Reviewed-by: thartmann, kvn
This commit is contained in:
parent
96c4dc3210
commit
1e4b00b1dc
19 changed files with 77 additions and 56 deletions
|
@ -2392,10 +2392,9 @@ void CompileBroker::print_times(bool per_compiler, bool aggregate) {
|
|||
|
||||
// Debugging output for failure
|
||||
void CompileBroker::print_last_compile() {
|
||||
if ( _last_compile_level != CompLevel_none &&
|
||||
compiler(_last_compile_level) != NULL &&
|
||||
_last_method_compiled != NULL &&
|
||||
_last_compile_type != no_compile) {
|
||||
if (_last_compile_level != CompLevel_none &&
|
||||
compiler(_last_compile_level) != NULL &&
|
||||
_last_compile_type != no_compile) {
|
||||
if (_last_compile_type == osr_compile) {
|
||||
tty->print_cr("Last parse: [osr]%d+++(%d) %s",
|
||||
_osr_compilation_id, _last_compile_level, _last_method_compiled);
|
||||
|
|
|
@ -231,7 +231,8 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen)
|
|||
// Copy any remaining data inside a quote:
|
||||
bool saw_slop = false;
|
||||
int end_cdata = 0; // state machine [0..2] watching for too many "]]"
|
||||
while ((nr = read(partial_fd, buf, buflen)) > 0) {
|
||||
while ((nr = read(partial_fd, buf, buflen-1)) > 0) {
|
||||
buf[buflen-1] = '\0';
|
||||
if (!saw_slop) {
|
||||
file->print_raw_cr("<fragment>");
|
||||
file->print_raw_cr("<![CDATA[");
|
||||
|
|
|
@ -99,7 +99,7 @@ bool Disassembler::load_library() {
|
|||
const char* p = strrchr(buf, *os::file_separator());
|
||||
if (p != NULL) lib_offset = p - base + 1;
|
||||
p = strstr(p ? p : base, "jvm");
|
||||
if (p != NULL) jvm_offset = p - base;
|
||||
if (p != NULL) jvm_offset = p - base;
|
||||
}
|
||||
#endif
|
||||
// Find the disassembler shared library.
|
||||
|
@ -113,13 +113,13 @@ bool Disassembler::load_library() {
|
|||
strcpy(&buf[jvm_offset], hsdis_library_name);
|
||||
strcat(&buf[jvm_offset], os::dll_file_extension());
|
||||
_library = os::dll_load(buf, ebuf, sizeof ebuf);
|
||||
if (_library == NULL) {
|
||||
if (_library == NULL && lib_offset >= 0) {
|
||||
// 2. <home>/jre/lib/<arch>/<vm>/hsdis-<arch>.so
|
||||
strcpy(&buf[lib_offset], hsdis_library_name);
|
||||
strcat(&buf[lib_offset], os::dll_file_extension());
|
||||
_library = os::dll_load(buf, ebuf, sizeof ebuf);
|
||||
}
|
||||
if (_library == NULL) {
|
||||
if (_library == NULL && lib_offset > 0) {
|
||||
// 3. <home>/jre/lib/<arch>/hsdis-<arch>.so
|
||||
buf[lib_offset - 1] = '\0';
|
||||
const char* p = strrchr(buf, *os::file_separator());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue