equal
deleted
inserted
replaced
1092 // "to" should be greater than "from." |
1092 // "to" should be greater than "from." |
1093 inline intx byte_size(void* from, void* to) { |
1093 inline intx byte_size(void* from, void* to) { |
1094 return (address)to - (address)from; |
1094 return (address)to - (address)from; |
1095 } |
1095 } |
1096 |
1096 |
1097 //---------------------------------------------------------------------------------------------------- |
|
1098 // Avoid non-portable casts with these routines (DEPRECATED) |
|
1099 |
|
1100 // NOTE: USE Bytes class INSTEAD WHERE POSSIBLE |
|
1101 // Bytes is optimized machine-specifically and may be much faster than the portable routines below. |
|
1102 |
|
1103 // Given sequence of four bytes, build into a 32-bit word |
|
1104 // following the conventions used in class files. |
|
1105 |
|
1106 // This one works if the two bytes are contiguous in memory: |
|
1107 inline u2 build_u2_from( u1* p ) { |
|
1108 return u2((( u2(p[0]) << 8 ) & 0xff00) |
|
1109 | (( u2(p[1]) << 0 ) & 0x00ff)); |
|
1110 } |
|
1111 |
|
1112 |
1097 |
1113 // Pack and extract shorts to/from ints: |
1098 // Pack and extract shorts to/from ints: |
1114 |
1099 |
1115 inline int extract_low_short_from_int(jint x) { |
1100 inline int extract_low_short_from_int(jint x) { |
1116 return x & 0xffff; |
1101 return x & 0xffff; |