Update V8 to r4588

We're using WebKit r58033, as used by
http://src.chromium.org/svn/releases/5.0.387.0/DEPS
This requires http://v8.googlecode.com/svn/trunk@4465 but this version has a
crashing bug for ARM. Instead we use http://v8.googlecode.com/svn/trunk@4588,
which is used by http://src.chromium.org/svn/releases/6.0.399.0/DEPS

Note that a trivial bug fix was required in arm/codegen-arm.cc. This is guarded
with ANDROID. See http://code.google.com/p/v8/issues/detail?id=703

Change-Id: I459647a8286c4f8c7405f0c5581ecbf051a6f1e8
diff --git a/test/cctest/test-diy-fp.cc b/test/cctest/test-diy-fp.cc
new file mode 100644
index 0000000..dd6476f
--- /dev/null
+++ b/test/cctest/test-diy-fp.cc
@@ -0,0 +1,67 @@
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
+
+#include <stdlib.h>
+
+#include "v8.h"
+
+#include "platform.h"
+#include "cctest.h"
+#include "diy-fp.h"
+
+
+using namespace v8::internal;
+
+
+TEST(Subtract) {
+  DiyFp diy_fp1 = DiyFp(3, 0);
+  DiyFp diy_fp2 = DiyFp(1, 0);
+  DiyFp diff = DiyFp::Minus(diy_fp1, diy_fp2);
+
+  CHECK(2 == diff.f());  // NOLINT
+  CHECK_EQ(0, diff.e());
+  diy_fp1.Subtract(diy_fp2);
+  CHECK(2 == diy_fp1.f());  // NOLINT
+  CHECK_EQ(0, diy_fp1.e());
+}
+
+
+TEST(Multiply) {
+  DiyFp diy_fp1 = DiyFp(3, 0);
+  DiyFp diy_fp2 = DiyFp(2, 0);
+  DiyFp product = DiyFp::Times(diy_fp1, diy_fp2);
+
+  CHECK(0 == product.f());  // NOLINT
+  CHECK_EQ(64, product.e());
+  diy_fp1.Multiply(diy_fp2);
+  CHECK(0 == diy_fp1.f());  // NOLINT
+  CHECK_EQ(64, diy_fp1.e());
+
+  diy_fp1 = DiyFp(V8_2PART_UINT64_C(0x80000000, 00000000), 11);
+  diy_fp2 = DiyFp(2, 13);
+  product = DiyFp::Times(diy_fp1, diy_fp2);
+  CHECK(1 == product.f());  // NOLINT
+  CHECK_EQ(11 + 13 + 64, product.e());
+
+  // Test rounding.
+  diy_fp1 = DiyFp(V8_2PART_UINT64_C(0x80000000, 00000001), 11);
+  diy_fp2 = DiyFp(1, 13);
+  product = DiyFp::Times(diy_fp1, diy_fp2);
+  CHECK(1 == product.f());  // NOLINT
+  CHECK_EQ(11 + 13 + 64, product.e());
+
+  diy_fp1 = DiyFp(V8_2PART_UINT64_C(0x7fffffff, ffffffff), 11);
+  diy_fp2 = DiyFp(1, 13);
+  product = DiyFp::Times(diy_fp1, diy_fp2);
+  CHECK(0 == product.f());  // NOLINT
+  CHECK_EQ(11 + 13 + 64, product.e());
+
+  // Halfway cases are allowed to round either way. So don't check for it.
+
+  // Big numbers.
+  diy_fp1 = DiyFp(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF), 11);
+  diy_fp2 = DiyFp(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF), 13);
+  // 128bit result: 0xfffffffffffffffe0000000000000001
+  product = DiyFp::Times(diy_fp1, diy_fp2);
+  CHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFe) == product.f());
+  CHECK_EQ(11 + 13 + 64, product.e());
+}