Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/unsafe.cpp @ 23822:626f594dffa6
8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.
Reviewed-by: stuefe, coleenp, roland
author | csahu |
---|---|
date | Tue, 01 Mar 2016 12:50:37 +0530 |
parents | f46871c6c063 |
children | d109bda16490 |
comparison
equal
deleted
inserted
replaced
23821:2f8db587e1fc | 23822:626f594dffa6 |
---|---|
853 } | 853 } |
854 } | 854 } |
855 | 855 |
856 UNSAFE_ENTRY(jint, Unsafe_ArrayBaseOffset(JNIEnv *env, jobject unsafe, jclass acls)) | 856 UNSAFE_ENTRY(jint, Unsafe_ArrayBaseOffset(JNIEnv *env, jobject unsafe, jclass acls)) |
857 UnsafeWrapper("Unsafe_ArrayBaseOffset"); | 857 UnsafeWrapper("Unsafe_ArrayBaseOffset"); |
858 int base, scale; | 858 int base = 0, scale = 0; |
859 getBaseAndScale(base, scale, acls, CHECK_0); | 859 getBaseAndScale(base, scale, acls, CHECK_0); |
860 return field_offset_from_byte_offset(base); | 860 return field_offset_from_byte_offset(base); |
861 UNSAFE_END | 861 UNSAFE_END |
862 | 862 |
863 | 863 |
864 UNSAFE_ENTRY(jint, Unsafe_ArrayIndexScale(JNIEnv *env, jobject unsafe, jclass acls)) | 864 UNSAFE_ENTRY(jint, Unsafe_ArrayIndexScale(JNIEnv *env, jobject unsafe, jclass acls)) |
865 UnsafeWrapper("Unsafe_ArrayIndexScale"); | 865 UnsafeWrapper("Unsafe_ArrayIndexScale"); |
866 int base, scale; | 866 int base = 0, scale = 0; |
867 getBaseAndScale(base, scale, acls, CHECK_0); | 867 getBaseAndScale(base, scale, acls, CHECK_0); |
868 // This VM packs both fields and array elements down to the byte. | 868 // This VM packs both fields and array elements down to the byte. |
869 // But watch out: If this changes, so that array references for | 869 // But watch out: If this changes, so that array references for |
870 // a given primitive type (say, T_BOOLEAN) use different memory units | 870 // a given primitive type (say, T_BOOLEAN) use different memory units |
871 // than fields, this method MUST return zero for such arrays. | 871 // than fields, this method MUST return zero for such arrays. |