comparison src/share/vm/compiler/compileBroker.cpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents a31028282e3e cc81b9c09bbb
children feb590a8497f
comparison
equal deleted inserted replaced
3737:9dc19b7d89a3 4137:04b9a2566eec
57 57
58 #ifdef DTRACE_ENABLED 58 #ifdef DTRACE_ENABLED
59 59
60 // Only bother with this argument setup if dtrace is available 60 // Only bother with this argument setup if dtrace is available
61 61
62 #ifndef USDT2
62 HS_DTRACE_PROBE_DECL8(hotspot, method__compile__begin, 63 HS_DTRACE_PROBE_DECL8(hotspot, method__compile__begin,
63 char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t); 64 char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t);
64 HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end, 65 HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
65 char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool); 66 char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool);
66 67
87 comp_name, strlen(comp_name), \ 88 comp_name, strlen(comp_name), \
88 klass_name->bytes(), klass_name->utf8_length(), \ 89 klass_name->bytes(), klass_name->utf8_length(), \
89 name->bytes(), name->utf8_length(), \ 90 name->bytes(), name->utf8_length(), \
90 signature->bytes(), signature->utf8_length(), (success)); \ 91 signature->bytes(), signature->utf8_length(), (success)); \
91 } 92 }
93
94 #else /* USDT2 */
95
96 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method) \
97 { \
98 char* comp_name = (char*)(compiler)->name(); \
99 Symbol* klass_name = (method)->klass_name(); \
100 Symbol* name = (method)->name(); \
101 Symbol* signature = (method)->signature(); \
102 HOTSPOT_METHOD_COMPILE_BEGIN( \
103 comp_name, strlen(comp_name), \
104 (char *) klass_name->bytes(), klass_name->utf8_length(), \
105 (char *) name->bytes(), name->utf8_length(), \
106 (char *) signature->bytes(), signature->utf8_length()); \
107 }
108
109 #define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success) \
110 { \
111 char* comp_name = (char*)(compiler)->name(); \
112 Symbol* klass_name = (method)->klass_name(); \
113 Symbol* name = (method)->name(); \
114 Symbol* signature = (method)->signature(); \
115 HOTSPOT_METHOD_COMPILE_END( \
116 comp_name, strlen(comp_name), \
117 (char *) klass_name->bytes(), klass_name->utf8_length(), \
118 (char *) name->bytes(), name->utf8_length(), \
119 (char *) signature->bytes(), signature->utf8_length(), (success)); \
120 }
121 #endif /* USDT2 */
92 122
93 #else // ndef DTRACE_ENABLED 123 #else // ndef DTRACE_ENABLED
94 124
95 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method) 125 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method)
96 #define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success) 126 #define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success)
1754 // Copy this bit to the enclosing block: 1784 // Copy this bit to the enclosing block:
1755 compilable = ci_env.compilable(); 1785 compilable = ci_env.compilable();
1756 if (PrintCompilation) { 1786 if (PrintCompilation) {
1757 const char* reason = ci_env.failure_reason(); 1787 const char* reason = ci_env.failure_reason();
1758 if (compilable == ciEnv::MethodCompilable_not_at_tier) { 1788 if (compilable == ciEnv::MethodCompilable_not_at_tier) {
1759 tty->print_cr("%3d COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason); 1789 tty->print_cr("%4d COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason);
1760 } else if (compilable == ciEnv::MethodCompilable_never) { 1790 } else if (compilable == ciEnv::MethodCompilable_never) {
1761 tty->print_cr("%3d COMPILE SKIPPED: %s (not retryable)", compile_id, reason); 1791 tty->print_cr("%4d COMPILE SKIPPED: %s (not retryable)", compile_id, reason);
1762 } else if (compilable == ciEnv::MethodCompilable) { 1792 } else if (compilable == ciEnv::MethodCompilable) {
1763 tty->print_cr("%3d COMPILE SKIPPED: %s", compile_id, reason); 1793 tty->print_cr("%4d COMPILE SKIPPED: %s", compile_id, reason);
1764 } 1794 }
1765 } 1795 }
1766 } else { 1796 } else {
1767 task->mark_success(); 1797 task->mark_success();
1768 task->set_num_inlined_bytecodes(ci_env.num_inlined_bytecodes()); 1798 task->set_num_inlined_bytecodes(ci_env.num_inlined_bytecodes());
1774 (methodOop)JNIHandles::resolve(task->method_handle())); 1804 (methodOop)JNIHandles::resolve(task->method_handle()));
1775 1805
1776 DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success()); 1806 DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success());
1777 1807
1778 collect_statistics(thread, time, task); 1808 collect_statistics(thread, time, task);
1809
1810 if (PrintCompilation && PrintCompilation2) {
1811 tty->print("%7d ", (int) tty->time_stamp().milliseconds()); // print timestamp
1812 tty->print("%4d ", compile_id); // print compilation number
1813 tty->print("%s ", (is_osr ? "%" : " "));
1814 int code_size = (task->code() == NULL) ? 0 : task->code()->total_size();
1815 tty->print_cr("size: %d time: %d inlined: %d bytes", code_size, (int)time.milliseconds(), task->num_inlined_bytecodes());
1816 }
1779 1817
1780 if (compilable == ciEnv::MethodCompilable_never) { 1818 if (compilable == ciEnv::MethodCompilable_never) {
1781 if (is_osr) { 1819 if (is_osr) {
1782 method->set_not_osr_compilable(); 1820 method->set_not_osr_compilable();
1783 } else { 1821 } else {