提交 5f41d4d5 编写于 作者: M morris

8008559: [parfait] Path through non-void function...

8008559: [parfait] Path through non-void function '_ZN2os15thread_cpu_timeEP6Thread' returns an undefined value
Summary: safety checks for non-Apple thread time functions
Reviewed-by: kvn
上级 d522c988
...@@ -3903,15 +3903,27 @@ bool os::pd_unmap_memory(char* addr, size_t bytes) { ...@@ -3903,15 +3903,27 @@ bool os::pd_unmap_memory(char* addr, size_t bytes) {
jlong os::current_thread_cpu_time() { jlong os::current_thread_cpu_time() {
#ifdef __APPLE__ #ifdef __APPLE__
return os::thread_cpu_time(Thread::current(), true /* user + sys */); return os::thread_cpu_time(Thread::current(), true /* user + sys */);
#else
Unimplemented();
return 0;
#endif #endif
} }
jlong os::thread_cpu_time(Thread* thread) { jlong os::thread_cpu_time(Thread* thread) {
#ifdef __APPLE__
return os::thread_cpu_time(thread, true /* user + sys */);
#else
Unimplemented();
return 0;
#endif
} }
jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { jlong os::current_thread_cpu_time(bool user_sys_cpu_time) {
#ifdef __APPLE__ #ifdef __APPLE__
return os::thread_cpu_time(Thread::current(), user_sys_cpu_time); return os::thread_cpu_time(Thread::current(), user_sys_cpu_time);
#else
Unimplemented();
return 0;
#endif #endif
} }
...@@ -3935,6 +3947,9 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { ...@@ -3935,6 +3947,9 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
} else { } else {
return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000); return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000);
} }
#else
Unimplemented();
return 0;
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册