changeset 3757:8eeffbc22f10

8001055: Bytes.swap should follow big endian Summary: This is a mistake change in 6879063 about Bytes.swap. Java byte code order always follows big endian, but in that change, assume they follow native platform order that is not right. Reviewed-by: coleenp, sspitsyn, dholmes Contributed-by: yumin.qi@oracle.com
author minqi
date Fri, 19 Oct 2012 08:58:14 -0700
parents c7957b458bf8
children b988bff99b38
files agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
diffstat 1 files changed, 1 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java	Fri Oct 19 08:56:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java	Fri Oct 19 08:58:14 2012 -0700
@@ -30,24 +30,10 @@
 /** Encapsulates some byte-swapping operations defined in the VM */
 
 public class Bytes {
-  // swap if client platform is different from server's.
   private boolean swap;
 
   public Bytes(MachineDescription machDesc) {
-    String cpu = PlatformInfo.getCPU();
-    if (cpu.equals("sparc")) {
-      if (machDesc.isBigEndian()) {
-        swap = false;
-      } else {
-        swap = true;
-      }
-    } else { // intel
-      if (machDesc.isBigEndian()) {
-        swap = true;
-      } else {
-        swap = false;
-      }
-    }
+    swap = !machDesc.isBigEndian();
   }
 
   /** Should only swap if the hardware's underlying byte order is