Reviewers: danno, Benedikt Meurer, paul.l..., dusmil.imgtec, akos.palfi.imgtec, titzer,

Description:
MIPS: Fix unaligned double acces in
cctest/test-simplified-lowering/RunAccessTests_float64.

TEST=cctest/test-simplified-lowering/RunAccessTests_float64
BUG=

Please review this at https://codereview.chromium.org/1182713004/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+12, -2 lines):
  M test/cctest/compiler/test-simplified-lowering.cc


Index: test/cctest/compiler/test-simplified-lowering.cc
diff --git a/test/cctest/compiler/test-simplified-lowering.cc b/test/cctest/compiler/test-simplified-lowering.cc index 1ef35598be60901ddd268f8625bb332344f6c3e4..09b4bc3114a0b0448139a35f7b010e5090407357 100644
--- a/test/cctest/compiler/test-simplified-lowering.cc
+++ b/test/cctest/compiler/test-simplified-lowering.cc
@@ -535,8 +535,7 @@ class AccessTester : public HandleAndZoneScope {
   E GetElement(int index) {
     BoundsCheck(index);
     if (tagged) {
-      E* raw = reinterpret_cast<E*>(tagged_array->GetDataStartAddress());
-      return raw[index];
+      return GetTaggedElement(index);
     } else {
       return untagged_array[index];
     }
@@ -569,8 +568,19 @@ class AccessTester : public HandleAndZoneScope {
     CHECK_LT(index, static_cast<int>(num_elements));
     CHECK_EQ(static_cast<int>(ByteSize()), tagged_array->length());
   }
+
+  E GetTaggedElement(int index) {
+    E* raw = reinterpret_cast<E*>(tagged_array->GetDataStartAddress());
+    return raw[index];
+  }
 };

+template <>
+double AccessTester<double>::GetTaggedElement(int index) {
+  return ReadDoubleValue(tagged_array->GetDataStartAddress() +
+                         index * sizeof(double));
+}
+

 template <typename E>
static void RunAccessTest(MachineType rep, E* original_elements, size_t num) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to