Mercurial > hg > graal-compiler
comparison src/os/bsd/vm/os_bsd.cpp @ 8689:bf06968a8a00
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
author | morris |
---|---|
date | Mon, 04 Mar 2013 13:15:01 -0800 |
parents | 5cd2fac2ae70 |
children | bdb602473679 |
comparison
equal
deleted
inserted
replaced
8688:40b7c6b800ab | 8689:bf06968a8a00 |
---|---|
3901 // the fast estimate available on the platform. | 3901 // the fast estimate available on the platform. |
3902 | 3902 |
3903 jlong os::current_thread_cpu_time() { | 3903 jlong os::current_thread_cpu_time() { |
3904 #ifdef __APPLE__ | 3904 #ifdef __APPLE__ |
3905 return os::thread_cpu_time(Thread::current(), true /* user + sys */); | 3905 return os::thread_cpu_time(Thread::current(), true /* user + sys */); |
3906 #else | |
3907 Unimplemented(); | |
3908 return 0; | |
3906 #endif | 3909 #endif |
3907 } | 3910 } |
3908 | 3911 |
3909 jlong os::thread_cpu_time(Thread* thread) { | 3912 jlong os::thread_cpu_time(Thread* thread) { |
3913 #ifdef __APPLE__ | |
3914 return os::thread_cpu_time(thread, true /* user + sys */); | |
3915 #else | |
3916 Unimplemented(); | |
3917 return 0; | |
3918 #endif | |
3910 } | 3919 } |
3911 | 3920 |
3912 jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { | 3921 jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { |
3913 #ifdef __APPLE__ | 3922 #ifdef __APPLE__ |
3914 return os::thread_cpu_time(Thread::current(), user_sys_cpu_time); | 3923 return os::thread_cpu_time(Thread::current(), user_sys_cpu_time); |
3924 #else | |
3925 Unimplemented(); | |
3926 return 0; | |
3915 #endif | 3927 #endif |
3916 } | 3928 } |
3917 | 3929 |
3918 jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { | 3930 jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { |
3919 #ifdef __APPLE__ | 3931 #ifdef __APPLE__ |
3933 nanos += ((jlong) tinfo.system_time.microseconds + (jlong) tinfo.user_time.microseconds) * (jlong)1000; | 3945 nanos += ((jlong) tinfo.system_time.microseconds + (jlong) tinfo.user_time.microseconds) * (jlong)1000; |
3934 return nanos; | 3946 return nanos; |
3935 } else { | 3947 } else { |
3936 return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000); | 3948 return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000); |
3937 } | 3949 } |
3950 #else | |
3951 Unimplemented(); | |
3952 return 0; | |
3938 #endif | 3953 #endif |
3939 } | 3954 } |
3940 | 3955 |
3941 | 3956 |
3942 void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) { | 3957 void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) { |