< prev index next >

src/cpu/arm/vm/bytes_arm.hpp

Print this page
@  rev 12742 : imported patch alpinefixes-copyswapaligned
|


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef CPU_ARM_VM_BYTES_ARM_HPP
  26 #define CPU_ARM_VM_BYTES_ARM_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/macros.hpp"
  30 
  31 #ifndef VM_LITTLE_ENDIAN
  32 #define VM_LITTLE_ENDIAN  1
  33 #endif
  34 
  35 class Bytes: AllStatic {
  36 
  37  public:
  38   // Returns true if the byte ordering used by Java is different from the native byte ordering
  39   // of the underlying machine.
  40   static inline bool is_Java_byte_ordering_different() {
  41     return VM_LITTLE_ENDIAN != 0;
  42   }
  43 
  44   static inline u2 get_Java_u2(address p) {
  45     return (u2(p[0]) << 8) | u2(p[1]);
  46   }
  47 
  48   static inline u4 get_Java_u4(address p) {
  49     return u4(p[0]) << 24 |
  50            u4(p[1]) << 16 |
  51            u4(p[2]) <<  8 |
  52            u4(p[3]);
  53   }
  54 
  55   static inline u8 get_Java_u8(address p) {
  56     return u8(p[0]) << 56 |
  57            u8(p[1]) << 48 |
  58            u8(p[2]) << 40 |
  59            u8(p[3]) << 32 |
  60            u8(p[4]) << 24 |
  61            u8(p[5]) << 16 |
  62            u8(p[6]) <<  8 |
  63            u8(p[7]);




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef CPU_ARM_VM_BYTES_ARM_HPP
  26 #define CPU_ARM_VM_BYTES_ARM_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/macros.hpp"
  30 
  31 #ifndef VM_LITTLE_ENDIAN
  32 #define VM_LITTLE_ENDIAN  1
  33 #endif
  34 
  35 class Bytes: AllStatic {
  36 
  37  public:






  38   static inline u2 get_Java_u2(address p) {
  39     return (u2(p[0]) << 8) | u2(p[1]);
  40   }
  41 
  42   static inline u4 get_Java_u4(address p) {
  43     return u4(p[0]) << 24 |
  44            u4(p[1]) << 16 |
  45            u4(p[2]) <<  8 |
  46            u4(p[3]);
  47   }
  48 
  49   static inline u8 get_Java_u8(address p) {
  50     return u8(p[0]) << 56 |
  51            u8(p[1]) << 48 |
  52            u8(p[2]) << 40 |
  53            u8(p[3]) << 32 |
  54            u8(p[4]) << 24 |
  55            u8(p[5]) << 16 |
  56            u8(p[6]) <<  8 |
  57            u8(p[7]);


< prev index next >