Mercurial > hg > graal-jvmci-8
comparison src/share/vm/compiler/compileBroker.cpp @ 17937:78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas
8043164: Format warning in traceStream.hpp
Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings
Reviewed-by: kvn, coleenp, iveresov, twisti
author | drchase |
---|---|
date | Thu, 22 May 2014 15:52:41 -0400 |
parents | a9becfeecd1b |
children | f73af4455d7d |
comparison
equal
deleted
inserted
replaced
17935:7384f6a12fc1 | 17937:78bbf4d43a14 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
204 } | 204 } |
205 | 205 |
206 void log_nmethod(JavaThread* thread, nmethod* nm) { | 206 void log_nmethod(JavaThread* thread, nmethod* nm) { |
207 log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]", | 207 log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]", |
208 nm->compile_id(), nm->is_osr_method() ? "%" : "", | 208 nm->compile_id(), nm->is_osr_method() ? "%" : "", |
209 nm, nm->code_begin(), nm->code_end()); | 209 p2i(nm), p2i(nm->code_begin()), p2i(nm->code_end())); |
210 } | 210 } |
211 | 211 |
212 void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) { | 212 void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) { |
213 StringLogMessage lm; | 213 StringLogMessage lm; |
214 lm.print("%4d COMPILE SKIPPED: %s", task->compile_id(), reason); | 214 lm.print("%4d COMPILE SKIPPED: %s", task->compile_id(), reason); |
1789 thread->init_log(log); | 1789 thread->init_log(log); |
1790 | 1790 |
1791 if (xtty != NULL) { | 1791 if (xtty != NULL) { |
1792 ttyLocker ttyl; | 1792 ttyLocker ttyl; |
1793 // Record any per thread log files | 1793 // Record any per thread log files |
1794 xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file_name); | 1794 xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name); |
1795 } | 1795 } |
1796 return; | 1796 return; |
1797 } | 1797 } |
1798 } | 1798 } |
1799 warning("Cannot open log file: %s", file_name); | 1799 warning("Cannot open log file: %s", file_name); |
1820 // Call this from the compiler at convenient points, to poll for _should_block. | 1820 // Call this from the compiler at convenient points, to poll for _should_block. |
1821 void CompileBroker::maybe_block() { | 1821 void CompileBroker::maybe_block() { |
1822 if (_should_block) { | 1822 if (_should_block) { |
1823 #ifndef PRODUCT | 1823 #ifndef PRODUCT |
1824 if (PrintCompilation && (Verbose || WizardMode)) | 1824 if (PrintCompilation && (Verbose || WizardMode)) |
1825 tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", Thread::current()); | 1825 tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current())); |
1826 #endif | 1826 #endif |
1827 ThreadInVMfromNative tivfn(JavaThread::current()); | 1827 ThreadInVMfromNative tivfn(JavaThread::current()); |
1828 } | 1828 } |
1829 } | 1829 } |
1830 | 1830 |
1837 { | 1837 { |
1838 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 1838 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
1839 CodeCache::print_summary(&s, detailed); | 1839 CodeCache::print_summary(&s, detailed); |
1840 } | 1840 } |
1841 ttyLocker ttyl; | 1841 ttyLocker ttyl; |
1842 tty->print(s.as_string()); | 1842 tty->print("%s", s.as_string()); |
1843 } | 1843 } |
1844 | 1844 |
1845 // ------------------------------------------------------------------ | 1845 // ------------------------------------------------------------------ |
1846 // CompileBroker::invoke_compiler_on_method | 1846 // CompileBroker::invoke_compiler_on_method |
1847 // | 1847 // |
2042 // because log_state() will use locks causing lock conflicts. | 2042 // because log_state() will use locks causing lock conflicts. |
2043 CodeCache::log_state(&s); | 2043 CodeCache::log_state(&s); |
2044 // Lock to prevent tearing | 2044 // Lock to prevent tearing |
2045 ttyLocker ttyl; | 2045 ttyLocker ttyl; |
2046 xtty->begin_elem("code_cache_full"); | 2046 xtty->begin_elem("code_cache_full"); |
2047 xtty->print(s.as_string()); | 2047 xtty->print("%s", s.as_string()); |
2048 xtty->stamp(); | 2048 xtty->stamp(); |
2049 xtty->end_elem(); | 2049 xtty->end_elem(); |
2050 } | 2050 } |
2051 | 2051 |
2052 CodeCache::report_codemem_full(); | 2052 CodeCache::report_codemem_full(); |