Use memcpy to read double value in the deoptimizer.
authoryangguo@chromium.org <yangguo@chromium.org>
Mon, 15 Sep 2014 10:57:52 +0000 (10:57 +0000)
committeryangguo@chromium.org <yangguo@chromium.org>
Mon, 15 Sep 2014 10:57:52 +0000 (10:57 +0000)
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/568043002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23939 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/deoptimizer.h

index 4becf6e..90f5d5c 100644 (file)
@@ -17,17 +17,9 @@ namespace internal {
 
 
 static inline double read_double_value(Address p) {
-  // Prevent gcc from using load-double (mips ldc1) on (possibly)
-  // non-64-bit aligned address.
-  // We assume that the address is 32-bit aligned.
-  DCHECK(IsAligned(reinterpret_cast<intptr_t>(p), kInt32Size));
-  union conversion {
-    double d;
-    uint32_t u[2];
-  } c;
-  c.u[0] = Memory::uint32_at(p);
-  c.u[1] = Memory::uint32_at(p + 4);
-  return c.d;
+  double d;
+  memcpy(&d, p, sizeof(d));
+  return d;
 }