summaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-03-07 08:54:53 +0100
committerMichaël Zasso <targos@protonmail.com>2018-03-07 16:48:52 +0100
commit88786fecff336342a56e6f2e7ff3b286be716e47 (patch)
tree92e6ba5b8ac8dae1a058988d20c9d27bfa654390 /deps/v8/test/unittests
parent4e86f9b5ab83cbabf43839385bf383e6a7ef7d19 (diff)
downloadnode-new-88786fecff336342a56e6f2e7ff3b286be716e47.tar.gz
deps: update V8 to 6.5.254.31
PR-URL: https://github.com/nodejs/node/pull/18453 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/v8/test/unittests')
-rw-r--r--deps/v8/test/unittests/BUILD.gn4
-rw-r--r--deps/v8/test/unittests/allocation-unittest.cc164
-rw-r--r--deps/v8/test/unittests/api/access-check-unittest.cc9
-rw-r--r--deps/v8/test/unittests/asmjs/asm-scanner-unittest.cc8
-rw-r--r--deps/v8/test/unittests/base/bits-unittest.cc60
-rw-r--r--deps/v8/test/unittests/base/logging-unittest.cc46
-rw-r--r--deps/v8/test/unittests/base/ostreams-unittest.cc4
-rw-r--r--deps/v8/test/unittests/base/platform/platform-unittest.cc116
-rw-r--r--deps/v8/test/unittests/bigint-unittest.cc2
-rw-r--r--deps/v8/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc45
-rw-r--r--deps/v8/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc309
-rw-r--r--deps/v8/test/unittests/compiler/graph-unittest.cc3
-rw-r--r--deps/v8/test/unittests/compiler/graph-unittest.h3
-rw-r--r--deps/v8/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc11
-rw-r--r--deps/v8/test/unittests/compiler/instruction-sequence-unittest.cc6
-rw-r--r--deps/v8/test/unittests/compiler/int64-lowering-unittest.cc8
-rw-r--r--deps/v8/test/unittests/compiler/js-typed-lowering-unittest.cc3
-rw-r--r--deps/v8/test/unittests/compiler/linkage-tail-call-unittest.cc16
-rw-r--r--deps/v8/test/unittests/compiler/loop-peeling-unittest.cc21
-rw-r--r--deps/v8/test/unittests/compiler/machine-operator-reducer-unittest.cc180
-rw-r--r--deps/v8/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc12
-rw-r--r--deps/v8/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc28
-rw-r--r--deps/v8/test/unittests/compiler/node-test-utils.cc1
-rw-r--r--deps/v8/test/unittests/compiler/node-test-utils.h1
-rw-r--r--deps/v8/test/unittests/compiler/regalloc/move-optimizer-unittest.cc3
-rw-r--r--deps/v8/test/unittests/compiler/simplified-lowering-unittest.cc89
-rw-r--r--deps/v8/test/unittests/compiler/simplified-operator-reducer-unittest.cc29
-rw-r--r--deps/v8/test/unittests/compiler/state-values-utils-unittest.cc4
-rw-r--r--deps/v8/test/unittests/compiler/typer-unittest.cc4
-rw-r--r--deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc23
-rw-r--r--deps/v8/test/unittests/counters-unittest.cc62
-rw-r--r--deps/v8/test/unittests/eh-frame-iterator-unittest.cc18
-rw-r--r--deps/v8/test/unittests/eh-frame-writer-unittest.cc8
-rw-r--r--deps/v8/test/unittests/heap/gc-tracer-unittest.cc121
-rw-r--r--deps/v8/test/unittests/heap/heap-unittest.cc2
-rw-r--r--deps/v8/test/unittests/heap/marking-unittest.cc14
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc19
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc5
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc29
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-node-unittest.cc8
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-register-optimizer-unittest.cc9
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-utils.h20
-rw-r--r--deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc4
-rw-r--r--deps/v8/test/unittests/object-unittest.cc4
-rw-r--r--deps/v8/test/unittests/parser/ast-value-unittest.cc4
-rw-r--r--deps/v8/test/unittests/testcfg.py70
-rw-r--r--deps/v8/test/unittests/unicode-unittest.cc476
-rw-r--r--deps/v8/test/unittests/unittests.gyp4
-rw-r--r--deps/v8/test/unittests/unittests.isolate3
-rw-r--r--deps/v8/test/unittests/value-serializer-unittest.cc521
-rw-r--r--deps/v8/test/unittests/wasm/decoder-unittest.cc32
-rw-r--r--deps/v8/test/unittests/wasm/function-body-decoder-unittest.cc127
-rw-r--r--deps/v8/test/unittests/wasm/leb-helper-unittest.cc8
-rw-r--r--deps/v8/test/unittests/wasm/loop-assignment-analysis-unittest.cc6
-rw-r--r--deps/v8/test/unittests/wasm/module-decoder-unittest.cc70
-rw-r--r--deps/v8/test/unittests/wasm/streaming-decoder-unittest.cc70
-rw-r--r--deps/v8/test/unittests/wasm/wasm-code-manager-unittest.cc (renamed from deps/v8/test/unittests/wasm/wasm-heap-unittest.cc)4
-rw-r--r--deps/v8/test/unittests/wasm/wasm-macro-gen-unittest.cc2
58 files changed, 1723 insertions, 1209 deletions
diff --git a/deps/v8/test/unittests/BUILD.gn b/deps/v8/test/unittests/BUILD.gn
index d6d0a1067f..7f70a5c959 100644
--- a/deps/v8/test/unittests/BUILD.gn
+++ b/deps/v8/test/unittests/BUILD.gn
@@ -35,6 +35,7 @@ v8_source_set("unittests_sources") {
"../../test/common/wasm/wasm-macro-gen.h",
"../../testing/gmock-support.h",
"../../testing/gtest-support.h",
+ "allocation-unittest.cc",
"api/access-check-unittest.cc",
"api/exception-unittest.cc",
"api/interceptor-unittest.cc",
@@ -121,6 +122,7 @@ v8_source_set("unittests_sources") {
"compiler/schedule-unittest.cc",
"compiler/scheduler-rpo-unittest.cc",
"compiler/scheduler-unittest.cc",
+ "compiler/simplified-lowering-unittest.cc",
"compiler/simplified-operator-reducer-unittest.cc",
"compiler/simplified-operator-unittest.cc",
"compiler/state-values-utils-unittest.cc",
@@ -186,7 +188,7 @@ v8_source_set("unittests_sources") {
"wasm/module-decoder-unittest.cc",
"wasm/streaming-decoder-unittest.cc",
"wasm/trap-handler-unittest.cc",
- "wasm/wasm-heap-unittest.cc",
+ "wasm/wasm-code-manager-unittest.cc",
"wasm/wasm-macro-gen-unittest.cc",
"wasm/wasm-module-builder-unittest.cc",
"wasm/wasm-opcodes-unittest.cc",
diff --git a/deps/v8/test/unittests/allocation-unittest.cc b/deps/v8/test/unittests/allocation-unittest.cc
new file mode 100644
index 0000000000..42904da149
--- /dev/null
+++ b/deps/v8/test/unittests/allocation-unittest.cc
@@ -0,0 +1,164 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/allocation.h"
+
+#if V8_OS_POSIX
+#include <setjmp.h>
+#include <signal.h>
+#include <unistd.h> // NOLINT
+#endif // V8_OS_POSIX
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace v8 {
+namespace internal {
+
+// TODO(eholk): Add a windows version of permissions tests.
+#if V8_OS_POSIX
+namespace {
+
+// These tests make sure the routines to allocate memory do so with the correct
+// permissions.
+//
+// Unfortunately, there is no API to find the protection of a memory address,
+// so instead we test permissions by installing a signal handler, probing a
+// memory location and recovering from the fault.
+//
+// We don't test the execution permission because to do so we'd have to
+// dynamically generate code and test if we can execute it.
+
+class MemoryAllocationPermissionsTest : public ::testing::Test {
+ static void SignalHandler(int signal, siginfo_t* info, void*) {
+ siglongjmp(continuation_, 1);
+ }
+ struct sigaction old_action_;
+// On Mac, sometimes we get SIGBUS instead of SIGSEGV.
+#if V8_OS_MACOSX
+ struct sigaction old_bus_action_;
+#endif
+
+ protected:
+ virtual void SetUp() {
+ struct sigaction action;
+ action.sa_sigaction = SignalHandler;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = SA_SIGINFO;
+ sigaction(SIGSEGV, &action, &old_action_);
+#if V8_OS_MACOSX
+ sigaction(SIGBUS, &action, &old_bus_action_);
+#endif
+ }
+
+ virtual void TearDown() {
+ // Be a good citizen and restore the old signal handler.
+ sigaction(SIGSEGV, &old_action_, nullptr);
+#if V8_OS_MACOSX
+ sigaction(SIGBUS, &old_bus_action_, nullptr);
+#endif
+ }
+
+ public:
+ static sigjmp_buf continuation_;
+
+ enum class MemoryAction { kRead, kWrite };
+
+ void ProbeMemory(volatile int* buffer, MemoryAction action,
+ bool should_succeed) {
+ const int save_sigs = 1;
+ if (!sigsetjmp(continuation_, save_sigs)) {
+ switch (action) {
+ case MemoryAction::kRead: {
+ // static_cast to remove the reference and force a memory read.
+ USE(static_cast<int>(*buffer));
+ break;
+ }
+ case MemoryAction::kWrite: {
+ *buffer = 0;
+ break;
+ }
+ }
+ if (should_succeed) {
+ SUCCEED();
+ } else {
+ FAIL();
+ }
+ return;
+ }
+ if (should_succeed) {
+ FAIL();
+ } else {
+ SUCCEED();
+ }
+ }
+
+ void TestPermissions(PageAllocator::Permission permission, bool can_read,
+ bool can_write) {
+ const size_t page_size = AllocatePageSize();
+ int* buffer = static_cast<int*>(
+ AllocatePages(nullptr, page_size, page_size, permission));
+ ProbeMemory(buffer, MemoryAction::kRead, can_read);
+ ProbeMemory(buffer, MemoryAction::kWrite, can_write);
+ CHECK(FreePages(buffer, page_size));
+ }
+};
+
+sigjmp_buf MemoryAllocationPermissionsTest::continuation_;
+
+} // namespace
+
+TEST_F(MemoryAllocationPermissionsTest, DoTest) {
+ TestPermissions(PageAllocator::Permission::kNoAccess, false, false);
+ TestPermissions(PageAllocator::Permission::kReadWrite, true, true);
+ TestPermissions(PageAllocator::Permission::kReadWriteExecute, true, true);
+}
+#endif // V8_OS_POSIX
+
+// Basic tests of allocation.
+
+class AllocationTest : public ::testing::Test {};
+
+TEST(AllocationTest, AllocateAndFree) {
+ size_t page_size = v8::internal::AllocatePageSize();
+ CHECK_NE(0, page_size);
+
+ // A large allocation, aligned at native allocation granularity.
+ const size_t kAllocationSize = 1 * v8::internal::MB;
+ void* mem_addr = v8::internal::AllocatePages(
+ v8::internal::GetRandomMmapAddr(), kAllocationSize, page_size,
+ PageAllocator::Permission::kReadWrite);
+ CHECK_NOT_NULL(mem_addr);
+ CHECK(v8::internal::FreePages(mem_addr, kAllocationSize));
+
+ // A large allocation, aligned significantly beyond native granularity.
+ const size_t kBigAlignment = 64 * v8::internal::MB;
+ void* aligned_mem_addr = v8::internal::AllocatePages(
+ v8::internal::GetRandomMmapAddr(), kAllocationSize, kBigAlignment,
+ PageAllocator::Permission::kReadWrite);
+ CHECK_NOT_NULL(aligned_mem_addr);
+ CHECK_EQ(aligned_mem_addr, AlignedAddress(aligned_mem_addr, kBigAlignment));
+ CHECK(v8::internal::FreePages(aligned_mem_addr, kAllocationSize));
+}
+
+TEST(AllocationTest, ReserveMemory) {
+ size_t page_size = v8::internal::AllocatePageSize();
+ const size_t kAllocationSize = 1 * v8::internal::MB;
+ void* mem_addr = v8::internal::AllocatePages(
+ v8::internal::GetRandomMmapAddr(), kAllocationSize, page_size,
+ PageAllocator::Permission::kReadWrite);
+ CHECK_NE(0, page_size);
+ CHECK_NOT_NULL(mem_addr);
+ size_t commit_size = v8::internal::CommitPageSize();
+ CHECK(v8::internal::SetPermissions(mem_addr, commit_size,
+ PageAllocator::Permission::kReadWrite));
+ // Check whether we can write to memory.
+ int* addr = static_cast<int*>(mem_addr);
+ addr[v8::internal::KB - 1] = 2;
+ CHECK(v8::internal::SetPermissions(mem_addr, commit_size,
+ PageAllocator::Permission::kNoAccess));
+ CHECK(v8::internal::FreePages(mem_addr, kAllocationSize));
+}
+
+} // namespace internal
+} // namespace v8
diff --git a/deps/v8/test/unittests/api/access-check-unittest.cc b/deps/v8/test/unittests/api/access-check-unittest.cc
index 05913de62a..8bfb507a7c 100644
--- a/deps/v8/test/unittests/api/access-check-unittest.cc
+++ b/deps/v8/test/unittests/api/access-check-unittest.cc
@@ -37,15 +37,10 @@ TEST_F(AccessCheckTest, GetOwnPropertyDescriptor) {
global_template->SetAccessCheckCallback(AccessCheck);
Local<FunctionTemplate> getter_template = FunctionTemplate::New(
- isolate(), [](const FunctionCallbackInfo<Value>& info) {
- FAIL() << "This should never be called.";
- info.GetReturnValue().Set(42);
- });
+ isolate(), [](const FunctionCallbackInfo<Value>& info) { FAIL(); });
getter_template->SetAcceptAnyReceiver(false);
Local<FunctionTemplate> setter_template = FunctionTemplate::New(
- isolate(), [](const FunctionCallbackInfo<v8::Value>& info) {
- FAIL() << "This should never be called.";
- });
+ isolate(), [](const FunctionCallbackInfo<v8::Value>& info) { FAIL(); });
setter_template->SetAcceptAnyReceiver(false);
global_template->SetAccessorProperty(
String::NewFromUtf8(isolate(), "property", NewStringType::kNormal)
diff --git a/deps/v8/test/unittests/asmjs/asm-scanner-unittest.cc b/deps/v8/test/unittests/asmjs/asm-scanner-unittest.cc
index ebfcc665f8..fe061f8e2a 100644
--- a/deps/v8/test/unittests/asmjs/asm-scanner-unittest.cc
+++ b/deps/v8/test/unittests/asmjs/asm-scanner-unittest.cc
@@ -190,7 +190,7 @@ TEST_F(AsmJsScannerTest, LocalScope) {
}
TEST_F(AsmJsScannerTest, Numbers) {
- SetupScanner("1 1.2 0x1f 1.e3");
+ SetupScanner("1 1.2 0x1F 1.e3");
CHECK(scanner->IsUnsigned());
CHECK_EQ(1, scanner->AsUnsigned());
@@ -212,10 +212,10 @@ TEST_F(AsmJsScannerTest, Numbers) {
}
TEST_F(AsmJsScannerTest, UnsignedNumbers) {
- SetupScanner("0x7fffffff 0x80000000 0xffffffff 0x100000000");
+ SetupScanner("0x7FFFFFFF 0x80000000 0xFFFFFFFF 0x100000000");
CHECK(scanner->IsUnsigned());
- CHECK_EQ(0x7fffffff, scanner->AsUnsigned());
+ CHECK_EQ(0x7FFFFFFF, scanner->AsUnsigned());
scanner->Next();
CHECK(scanner->IsUnsigned());
@@ -223,7 +223,7 @@ TEST_F(AsmJsScannerTest, UnsignedNumbers) {
scanner->Next();
CHECK(scanner->IsUnsigned());
- CHECK_EQ(0xffffffff, scanner->AsUnsigned());
+ CHECK_EQ(0xFFFFFFFF, scanner->AsUnsigned());
scanner->Next();
// Numeric "unsigned" literals with a payload of more than 32-bit are rejected
diff --git a/deps/v8/test/unittests/base/bits-unittest.cc b/deps/v8/test/unittests/base/bits-unittest.cc
index 485dddf529..6f787eb727 100644
--- a/deps/v8/test/unittests/base/bits-unittest.cc
+++ b/deps/v8/test/unittests/base/bits-unittest.cc
@@ -22,18 +22,18 @@ TEST(Bits, CountPopulation16) {
EXPECT_EQ(0u, CountPopulation(uint16_t{0}));
EXPECT_EQ(1u, CountPopulation(uint16_t{1}));
EXPECT_EQ(4u, CountPopulation(uint16_t{0x1111}));
- EXPECT_EQ(8u, CountPopulation(uint16_t{0xf0f0}));
- EXPECT_EQ(12u, CountPopulation(uint16_t{0xf0ff}));
- EXPECT_EQ(16u, CountPopulation(uint16_t{0xffff}));
+ EXPECT_EQ(8u, CountPopulation(uint16_t{0xF0F0}));
+ EXPECT_EQ(12u, CountPopulation(uint16_t{0xF0FF}));
+ EXPECT_EQ(16u, CountPopulation(uint16_t{0xFFFF}));
}
TEST(Bits, CountPopulation32) {
EXPECT_EQ(0u, CountPopulation(uint32_t{0}));
EXPECT_EQ(1u, CountPopulation(uint32_t{1}));
EXPECT_EQ(8u, CountPopulation(uint32_t{0x11111111}));
- EXPECT_EQ(16u, CountPopulation(uint32_t{0xf0f0f0f0}));
- EXPECT_EQ(24u, CountPopulation(uint32_t{0xfff0f0ff}));
- EXPECT_EQ(32u, CountPopulation(uint32_t{0xffffffff}));
+ EXPECT_EQ(16u, CountPopulation(uint32_t{0xF0F0F0F0}));
+ EXPECT_EQ(24u, CountPopulation(uint32_t{0xFFF0F0FF}));
+ EXPECT_EQ(32u, CountPopulation(uint32_t{0xFFFFFFFF}));
}
TEST(Bits, CountPopulation64) {
@@ -41,13 +41,13 @@ TEST(Bits, CountPopulation64) {
EXPECT_EQ(1u, CountPopulation(uint64_t{1}));
EXPECT_EQ(2u, CountPopulation(uint64_t{0x8000000000000001}));
EXPECT_EQ(8u, CountPopulation(uint64_t{0x11111111}));
- EXPECT_EQ(16u, CountPopulation(uint64_t{0xf0f0f0f0}));
- EXPECT_EQ(24u, CountPopulation(uint64_t{0xfff0f0ff}));
- EXPECT_EQ(32u, CountPopulation(uint64_t{0xffffffff}));
+ EXPECT_EQ(16u, CountPopulation(uint64_t{0xF0F0F0F0}));
+ EXPECT_EQ(24u, CountPopulation(uint64_t{0xFFF0F0FF}));
+ EXPECT_EQ(32u, CountPopulation(uint64_t{0xFFFFFFFF}));
EXPECT_EQ(16u, CountPopulation(uint64_t{0x1111111111111111}));
- EXPECT_EQ(32u, CountPopulation(uint64_t{0xf0f0f0f0f0f0f0f0}));
- EXPECT_EQ(48u, CountPopulation(uint64_t{0xfff0f0fffff0f0ff}));
- EXPECT_EQ(64u, CountPopulation(uint64_t{0xffffffffffffffff}));
+ EXPECT_EQ(32u, CountPopulation(uint64_t{0xF0F0F0F0F0F0F0F0}));
+ EXPECT_EQ(48u, CountPopulation(uint64_t{0xFFF0F0FFFFF0F0FF}));
+ EXPECT_EQ(64u, CountPopulation(uint64_t{0xFFFFFFFFFFFFFFFF}));
}
TEST(Bits, CountLeadingZeros16) {
@@ -57,7 +57,7 @@ TEST(Bits, CountLeadingZeros16) {
EXPECT_EQ(15u - shift,
CountLeadingZeros(static_cast<uint16_t>(1 << shift)));
}
- EXPECT_EQ(4u, CountLeadingZeros(uint16_t{0x0f0f}));
+ EXPECT_EQ(4u, CountLeadingZeros(uint16_t{0x0F0F}));
}
TEST(Bits, CountLeadingZeros32) {
@@ -66,7 +66,7 @@ TEST(Bits, CountLeadingZeros32) {
TRACED_FORRANGE(uint32_t, shift, 0, 31) {
EXPECT_EQ(31u - shift, CountLeadingZeros(uint32_t{1} << shift));
}
- EXPECT_EQ(4u, CountLeadingZeros(uint32_t{0x0f0f0f0f}));
+ EXPECT_EQ(4u, CountLeadingZeros(uint32_t{0x0F0F0F0F}));
}
TEST(Bits, CountLeadingZeros64) {
@@ -75,8 +75,8 @@ TEST(Bits, CountLeadingZeros64) {
TRACED_FORRANGE(uint32_t, shift, 0, 63) {
EXPECT_EQ(63u - shift, CountLeadingZeros(uint64_t{1} << shift));
}
- EXPECT_EQ(36u, CountLeadingZeros(uint64_t{0x0f0f0f0f}));
- EXPECT_EQ(4u, CountLeadingZeros(uint64_t{0x0f0f0f0f00000000}));
+ EXPECT_EQ(36u, CountLeadingZeros(uint64_t{0x0F0F0F0F}));
+ EXPECT_EQ(4u, CountLeadingZeros(uint64_t{0x0F0F0F0F00000000}));
}
TEST(Bits, CountTrailingZeros16) {
@@ -85,7 +85,7 @@ TEST(Bits, CountTrailingZeros16) {
TRACED_FORRANGE(uint16_t, shift, 0, 15) {
EXPECT_EQ(shift, CountTrailingZeros(static_cast<uint16_t>(1 << shift)));
}
- EXPECT_EQ(4u, CountTrailingZeros(uint16_t{0xf0f0u}));
+ EXPECT_EQ(4u, CountTrailingZeros(uint16_t{0xF0F0u}));
}
TEST(Bits, CountTrailingZerosu32) {
@@ -94,7 +94,7 @@ TEST(Bits, CountTrailingZerosu32) {
TRACED_FORRANGE(uint32_t, shift, 0, 31) {
EXPECT_EQ(shift, CountTrailingZeros(uint32_t{1} << shift));
}
- EXPECT_EQ(4u, CountTrailingZeros(uint32_t{0xf0f0f0f0u}));
+ EXPECT_EQ(4u, CountTrailingZeros(uint32_t{0xF0F0F0F0u}));
}
TEST(Bits, CountTrailingZerosi32) {
@@ -102,7 +102,7 @@ TEST(Bits, CountTrailingZerosi32) {
TRACED_FORRANGE(uint32_t, shift, 0, 31) {
EXPECT_EQ(shift, CountTrailingZeros(int32_t{1} << shift));
}
- EXPECT_EQ(4u, CountTrailingZeros(int32_t{0x70f0f0f0u}));
+ EXPECT_EQ(4u, CountTrailingZeros(int32_t{0x70F0F0F0u}));
EXPECT_EQ(2u, CountTrailingZeros(int32_t{-4}));
EXPECT_EQ(0u, CountTrailingZeros(int32_t{-1}));
}
@@ -113,8 +113,8 @@ TEST(Bits, CountTrailingZeros64) {
TRACED_FORRANGE(uint32_t, shift, 0, 63) {
EXPECT_EQ(shift, CountTrailingZeros(uint64_t{1} << shift));
}
- EXPECT_EQ(4u, CountTrailingZeros(uint64_t{0xf0f0f0f0}));
- EXPECT_EQ(36u, CountTrailingZeros(uint64_t{0xf0f0f0f000000000}));
+ EXPECT_EQ(4u, CountTrailingZeros(uint64_t{0xF0F0F0F0}));
+ EXPECT_EQ(36u, CountTrailingZeros(uint64_t{0xF0F0F0F000000000}));
}
@@ -128,21 +128,21 @@ TEST(Bits, IsPowerOfTwo32) {
TRACED_FORRANGE(uint32_t, shift, 2, 31) {
EXPECT_FALSE(IsPowerOfTwo((1U << shift) - 1U));
}
- EXPECT_FALSE(IsPowerOfTwo(0xffffffff));
+ EXPECT_FALSE(IsPowerOfTwo(0xFFFFFFFF));
}
TEST(Bits, IsPowerOfTwo64) {
- EXPECT_FALSE(IsPowerOfTwo(V8_UINT64_C(0)));
+ EXPECT_FALSE(IsPowerOfTwo(uint64_t{0}));
TRACED_FORRANGE(uint32_t, shift, 0, 63) {
- EXPECT_TRUE(IsPowerOfTwo(V8_UINT64_C(1) << shift));
- EXPECT_FALSE(IsPowerOfTwo((V8_UINT64_C(1) << shift) + 5U));
- EXPECT_FALSE(IsPowerOfTwo(~(V8_UINT64_C(1) << shift)));
+ EXPECT_TRUE(IsPowerOfTwo(uint64_t{1} << shift));
+ EXPECT_FALSE(IsPowerOfTwo((uint64_t{1} << shift) + 5U));
+ EXPECT_FALSE(IsPowerOfTwo(~(uint64_t{1} << shift)));
}
TRACED_FORRANGE(uint32_t, shift, 2, 63) {
- EXPECT_FALSE(IsPowerOfTwo((V8_UINT64_C(1) << shift) - 1U));
+ EXPECT_FALSE(IsPowerOfTwo((uint64_t{1} << shift) - 1U));
}
- EXPECT_FALSE(IsPowerOfTwo(V8_UINT64_C(0xffffffffffffffff)));
+ EXPECT_FALSE(IsPowerOfTwo(uint64_t{0xFFFFFFFFFFFFFFFF}));
}
@@ -153,7 +153,7 @@ TEST(Bits, RoundUpToPowerOfTwo32) {
EXPECT_EQ(1u, RoundUpToPowerOfTwo32(0));
EXPECT_EQ(1u, RoundUpToPowerOfTwo32(1));
EXPECT_EQ(4u, RoundUpToPowerOfTwo32(3));
- EXPECT_EQ(0x80000000u, RoundUpToPowerOfTwo32(0x7fffffffu));
+ EXPECT_EQ(0x80000000u, RoundUpToPowerOfTwo32(0x7FFFFFFFu));
}
@@ -206,7 +206,7 @@ TEST(Bits, RotateRight64) {
}
EXPECT_EQ(1u, RotateRight64(1, 0));
EXPECT_EQ(1u, RotateRight64(2, 1));
- EXPECT_EQ(V8_UINT64_C(0x8000000000000000), RotateRight64(1, 1));
+ EXPECT_EQ(uint64_t{0x8000000000000000}, RotateRight64(1, 1));
}
diff --git a/deps/v8/test/unittests/base/logging-unittest.cc b/deps/v8/test/unittests/base/logging-unittest.cc
index fd334ec49d..a0686a2f64 100644
--- a/deps/v8/test/unittests/base/logging-unittest.cc
+++ b/deps/v8/test/unittests/base/logging-unittest.cc
@@ -32,30 +32,34 @@ namespace {
} // namespace
TEST(LoggingTest, CheckEQImpl) {
- CHECK_SUCCEED(EQ, 0.0, 0.0)
- CHECK_SUCCEED(EQ, 0.0, -0.0)
- CHECK_SUCCEED(EQ, -0.0, 0.0)
- CHECK_SUCCEED(EQ, -0.0, -0.0)
+ CHECK_SUCCEED(EQ, 0.0, 0.0);
+ CHECK_SUCCEED(EQ, 0.0, -0.0);
+ CHECK_SUCCEED(EQ, -0.0, 0.0);
+ CHECK_SUCCEED(EQ, -0.0, -0.0);
}
TEST(LoggingTest, CompareSignedMismatch) {
- CHECK_SUCCEED(EQ, static_cast<int32_t>(14), static_cast<uint32_t>(14))
- CHECK_FAIL(EQ, static_cast<int32_t>(14), static_cast<uint32_t>(15))
- CHECK_FAIL(EQ, static_cast<int32_t>(-1), static_cast<uint32_t>(-1))
- CHECK_SUCCEED(LT, static_cast<int32_t>(-1), static_cast<uint32_t>(0))
- CHECK_SUCCEED(LT, static_cast<int32_t>(-1), static_cast<uint32_t>(-1))
- CHECK_SUCCEED(LE, static_cast<int32_t>(-1), static_cast<uint32_t>(0))
- CHECK_SUCCEED(LE, static_cast<int32_t>(55), static_cast<uint32_t>(55))
- CHECK_SUCCEED(LT, static_cast<int32_t>(55), static_cast<uint32_t>(0x7fffff00))
- CHECK_SUCCEED(LE, static_cast<int32_t>(55), static_cast<uint32_t>(0x7fffff00))
- CHECK_SUCCEED(GE, static_cast<uint32_t>(0x7fffff00), static_cast<int32_t>(55))
- CHECK_SUCCEED(GT, static_cast<uint32_t>(0x7fffff00), static_cast<int32_t>(55))
- CHECK_SUCCEED(GT, static_cast<uint32_t>(-1), static_cast<int32_t>(-1))
- CHECK_SUCCEED(GE, static_cast<uint32_t>(0), static_cast<int32_t>(-1))
- CHECK_SUCCEED(LT, static_cast<int8_t>(-1), static_cast<uint32_t>(0))
- CHECK_SUCCEED(GT, static_cast<uint64_t>(0x7f01010101010101), 0)
- CHECK_SUCCEED(LE, static_cast<int64_t>(0xff01010101010101),
- static_cast<uint8_t>(13))
+ CHECK_SUCCEED(EQ, static_cast<int32_t>(14), static_cast<uint32_t>(14));
+ CHECK_FAIL(EQ, static_cast<int32_t>(14), static_cast<uint32_t>(15));
+ CHECK_FAIL(EQ, static_cast<int32_t>(-1), static_cast<uint32_t>(-1));
+ CHECK_SUCCEED(LT, static_cast<int32_t>(-1), static_cast<uint32_t>(0));
+ CHECK_SUCCEED(LT, static_cast<int32_t>(-1), static_cast<uint32_t>(-1));
+ CHECK_SUCCEED(LE, static_cast<int32_t>(-1), static_cast<uint32_t>(0));
+ CHECK_SUCCEED(LE, static_cast<int32_t>(55), static_cast<uint32_t>(55));
+ CHECK_SUCCEED(LT, static_cast<int32_t>(55),
+ static_cast<uint32_t>(0x7FFFFF00));
+ CHECK_SUCCEED(LE, static_cast<int32_t>(55),
+ static_cast<uint32_t>(0x7FFFFF00));
+ CHECK_SUCCEED(GE, static_cast<uint32_t>(0x7FFFFF00),
+ static_cast<int32_t>(55));
+ CHECK_SUCCEED(GT, static_cast<uint32_t>(0x7FFFFF00),
+ static_cast<int32_t>(55));
+ CHECK_SUCCEED(GT, static_cast<uint32_t>(-1), static_cast<int32_t>(-1));
+ CHECK_SUCCEED(GE, static_cast<uint32_t>(0), static_cast<int32_t>(-1));
+ CHECK_SUCCEED(LT, static_cast<int8_t>(-1), static_cast<uint32_t>(0));
+ CHECK_SUCCEED(GT, static_cast<uint64_t>(0x7F01010101010101), 0);
+ CHECK_SUCCEED(LE, static_cast<int64_t>(0xFF01010101010101),
+ static_cast<uint8_t>(13));
}
TEST(LoggingTest, CompareAgainstStaticConstPointer) {
diff --git a/deps/v8/test/unittests/base/ostreams-unittest.cc b/deps/v8/test/unittests/base/ostreams-unittest.cc
index 31744cdbda..1444eb7a5c 100644
--- a/deps/v8/test/unittests/base/ostreams-unittest.cc
+++ b/deps/v8/test/unittests/base/ostreams-unittest.cc
@@ -47,7 +47,7 @@ TEST(Ostream, AsHexBytes) {
testAsHexBytes("23 01", AsHexBytes(0x123, 1));
testAsHexBytes("23 01", AsHexBytes(0x123, 2));
testAsHexBytes("23 01 00", AsHexBytes(0x123, 3));
- testAsHexBytes("ff ff ff ff", AsHexBytes(0xffffffff));
+ testAsHexBytes("ff ff ff ff", AsHexBytes(0xFFFFFFFF));
testAsHexBytes("00 00 00 00", AsHexBytes(0, 4));
testAsHexBytes("56 34 12", AsHexBytes(0x123456));
@@ -58,7 +58,7 @@ TEST(Ostream, AsHexBytes) {
testAsHexBytes("01 23", AsHexBytes(0x123, 1, AsHexBytes::kBigEndian));
testAsHexBytes("01 23", AsHexBytes(0x123, 2, AsHexBytes::kBigEndian));
testAsHexBytes("00 01 23", AsHexBytes(0x123, 3, AsHexBytes::kBigEndian));
- testAsHexBytes("ff ff ff ff", AsHexBytes(0xffffffff, AsHexBytes::kBigEndian));
+ testAsHexBytes("ff ff ff ff", AsHexBytes(0xFFFFFFFF, AsHexBytes::kBigEndian));
testAsHexBytes("00 00 00 00", AsHexBytes(0, 4, AsHexBytes::kBigEndian));
testAsHexBytes("12 34 56", AsHexBytes(0x123456, 1, AsHexBytes::kBigEndian));
}
diff --git a/deps/v8/test/unittests/base/platform/platform-unittest.cc b/deps/v8/test/unittests/base/platform/platform-unittest.cc
index cb07ad1ca4..f9fc26a2df 100644
--- a/deps/v8/test/unittests/base/platform/platform-unittest.cc
+++ b/deps/v8/test/unittests/base/platform/platform-unittest.cc
@@ -4,23 +4,8 @@
#include "src/base/platform/platform.h"
-#if V8_OS_POSIX
-#include <setjmp.h>
-#include <signal.h>
-#include <unistd.h> // NOLINT
-#endif
-
-#if V8_OS_WIN
-#include "src/base/win32-headers.h"
-#endif
#include "testing/gtest/include/gtest/gtest.h"
-#if V8_OS_ANDROID
-#define DISABLE_ON_ANDROID(Name) DISABLED_##Name
-#else
-#define DISABLE_ON_ANDROID(Name) Name
-#endif
-
namespace v8 {
namespace base {
@@ -98,106 +83,5 @@ TEST_F(ThreadLocalStorageTest, DoTest) {
Join();
}
-#if V8_OS_POSIX
-// TODO(eholk): Add a windows version of these tests
-
-namespace {
-
-// These tests make sure the routines to allocate memory do so with the correct
-// permissions.
-//
-// Unfortunately, there is no API to find the protection of a memory address,
-// so instead we test permissions by installing a signal handler, probing a
-// memory location and recovering from the fault.
-//
-// We don't test the execution permission because to do so we'd have to
-// dynamically generate code and test if we can execute it.
-
-class MemoryAllocationPermissionsTest : public ::testing::Test {
- static void SignalHandler(int signal, siginfo_t* info, void*) {
- siglongjmp(continuation_, 1);
- }
- struct sigaction old_action_;
-// On Mac, sometimes we get SIGBUS instead of SIGSEGV.
-#if V8_OS_MACOSX
- struct sigaction old_bus_action_;
-#endif
-
- protected:
- virtual void SetUp() {
- struct sigaction action;
- action.sa_sigaction = SignalHandler;
- sigemptyset(&action.sa_mask);
- action.sa_flags = SA_SIGINFO;
- sigaction(SIGSEGV, &action, &old_action_);
-#if V8_OS_MACOSX
- sigaction(SIGBUS, &action, &old_bus_action_);
-#endif
- }
-
- virtual void TearDown() {
- // be a good citizen and restore the old signal handler.
- sigaction(SIGSEGV, &old_action_, nullptr);
-#if V8_OS_MACOSX
- sigaction(SIGBUS, &old_bus_action_, nullptr);
-#endif
- }
-
- public:
- static sigjmp_buf continuation_;
-
- enum class MemoryAction { kRead, kWrite };
-
- void ProbeMemory(volatile int* buffer, MemoryAction action,
- bool should_succeed) {
- const int save_sigs = 1;
- if (!sigsetjmp(continuation_, save_sigs)) {
- switch (action) {
- case MemoryAction::kRead: {
- // static_cast to remove the reference and force a memory read.
- USE(static_cast<int>(*buffer));
- break;
- }
- case MemoryAction::kWrite: {
- *buffer = 0;
- break;
- }
- }
- if (should_succeed) {
- SUCCEED();
- } else {
- FAIL();
- }
- return;
- }
- if (should_succeed) {
- FAIL();
- } else {
- SUCCEED();
- }
- }
-
- void TestPermissions(OS::MemoryPermission permission, bool can_read,
- bool can_write) {
- const size_t page_size = OS::AllocatePageSize();
- int* buffer = static_cast<int*>(
- OS::Allocate(nullptr, page_size, page_size, permission));
- ProbeMemory(buffer, MemoryAction::kRead, can_read);
- ProbeMemory(buffer, MemoryAction::kWrite, can_write);
- CHECK(OS::Free(buffer, page_size));
- }
-};
-
-sigjmp_buf MemoryAllocationPermissionsTest::continuation_;
-
-TEST_F(MemoryAllocationPermissionsTest, DoTest) {
- TestPermissions(OS::MemoryPermission::kNoAccess, false, false);
- TestPermissions(OS::MemoryPermission::kReadWrite, true, true);
- TestPermissions(OS::MemoryPermission::kReadWriteExecute, true, true);
-}
-
-} // namespace
-#endif // V8_OS_POSIX
-
} // namespace base
} // namespace v8
diff --git a/deps/v8/test/unittests/bigint-unittest.cc b/deps/v8/test/unittests/bigint-unittest.cc
index 252cad6a8f..6e1018c581 100644
--- a/deps/v8/test/unittests/bigint-unittest.cc
+++ b/deps/v8/test/unittests/bigint-unittest.cc
@@ -97,7 +97,7 @@ TEST_F(BigIntWithIsolate, CompareToDouble) {
big = NewFromInt(isolate(), 0xF00D00);
Compare(big, 15731968.125, ComparisonResult::kLessThan);
Compare(big, 15731967.875, ComparisonResult::kGreaterThan);
- big = BigIntLiteral(isolate(), "0x123456789ab").ToHandleChecked();
+ big = BigIntLiteral(isolate(), "0x123456789AB").ToHandleChecked();
Compare(big, 1250999896491.125, ComparisonResult::kLessThan);
// Equality!
diff --git a/deps/v8/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc b/deps/v8/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
index 186a4397ed..ab1c57d9c5 100644
--- a/deps/v8/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
+++ b/deps/v8/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
@@ -2302,7 +2302,7 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* const r = m.Int32Add(m.Word32And(p0, m.Int32Constant(0xff)), p1);
+ Node* const r = m.Int32Add(m.Word32And(p0, m.Int32Constant(0xFF)), p1);
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2319,7 +2319,7 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* const r = m.Int32Add(p1, m.Word32And(p0, m.Int32Constant(0xff)));
+ Node* const r = m.Int32Add(p1, m.Word32And(p0, m.Int32Constant(0xFF)));
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2336,7 +2336,7 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* const r = m.Int32Add(m.Word32And(p0, m.Int32Constant(0xffff)), p1);
+ Node* const r = m.Int32Add(m.Word32And(p0, m.Int32Constant(0xFFFF)), p1);
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2353,7 +2353,7 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* const r = m.Int32Add(p1, m.Word32And(p0, m.Int32Constant(0xffff)));
+ Node* const r = m.Int32Add(p1, m.Word32And(p0, m.Int32Constant(0xFFFF)));
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2808,7 +2808,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithUbfxImmediateForARMv7) {
if (width == 16) continue; // Uxth.
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Parameter(0),
- m.Int32Constant(0xffffffffu >> (32 - width))));
+ m.Int32Constant(0xFFFFFFFFu >> (32 - width))));
Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size());
EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
@@ -2819,7 +2819,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithUbfxImmediateForARMv7) {
TRACED_FORRANGE(int32_t, width, 9, 23) {
if (width == 16) continue; // Uxth.
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
- m.Return(m.Word32And(m.Int32Constant(0xffffffffu >> (32 - width)),
+ m.Return(m.Word32And(m.Int32Constant(0xFFFFFFFFu >> (32 - width)),
m.Parameter(0)));
Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size());
@@ -2837,7 +2837,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(
m.Parameter(0),
- m.Int32Constant(~((0xffffffffu >> (32 - width)) << lsb))));
+ m.Int32Constant(~((0xFFFFFFFFu >> (32 - width)) << lsb))));
Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size());
EXPECT_EQ(kArmBfc, s[0]->arch_opcode());
@@ -2853,7 +2853,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7) {
TRACED_FORRANGE(int32_t, width, 9, (24 - lsb) - 1) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(
- m.Word32And(m.Int32Constant(~((0xffffffffu >> (32 - width)) << lsb)),
+ m.Word32And(m.Int32Constant(~((0xFFFFFFFFu >> (32 - width)) << lsb)),
m.Parameter(0)));
Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size());
@@ -2868,12 +2868,11 @@ TEST_F(InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7) {
}
}
-
-TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
+TEST_F(InstructionSelectorTest, Word32AndWith0xFFFF) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const r = m.Word32And(p0, m.Int32Constant(0xffff));
+ Node* const r = m.Word32And(p0, m.Int32Constant(0xFFFF));
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2887,7 +2886,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const r = m.Word32And(m.Int32Constant(0xffff), p0);
+ Node* const r = m.Word32And(m.Int32Constant(0xFFFF), p0);
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2941,7 +2940,7 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediateForARMv7) {
uint32_t max = 1 << lsb;
if (max > static_cast<uint32_t>(kMaxInt)) max -= 1;
uint32_t jnk = rng()->NextInt(max);
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Parameter(0), m.Int32Constant(msk)),
m.Int32Constant(lsb)));
@@ -2958,7 +2957,7 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediateForARMv7) {
uint32_t max = 1 << lsb;
if (max > static_cast<uint32_t>(kMaxInt)) max -= 1;
uint32_t jnk = rng()->NextInt(max);
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Int32Constant(msk), m.Parameter(0)),
m.Int32Constant(lsb)));
@@ -3098,7 +3097,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7) {
continue; // Uxtb/h ror.
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Word32Shr(m.Parameter(0), m.Int32Constant(lsb)),
- m.Int32Constant(0xffffffffu >> (32 - width))));
+ m.Int32Constant(0xFFFFFFFFu >> (32 - width))));
Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size());
EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
@@ -3113,7 +3112,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7) {
((lsb == 8) || (lsb == 16) || (lsb == 24)))
continue; // Uxtb/h ror.
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
- m.Return(m.Word32And(m.Int32Constant(0xffffffffu >> (32 - width)),
+ m.Return(m.Word32And(m.Int32Constant(0xFFFFFFFFu >> (32 - width)),
m.Word32Shr(m.Parameter(0), m.Int32Constant(lsb))));
Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size());
@@ -3125,13 +3124,12 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7) {
}
}
-
-TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xff) {
+TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xFF) {
TRACED_FORRANGE(int32_t, shr, 1, 3) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const r = m.Word32And(m.Word32Shr(p0, m.Int32Constant(shr * 8)),
- m.Int32Constant(0xff));
+ m.Int32Constant(0xFF));
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -3142,7 +3140,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xff) {
TRACED_FORRANGE(int32_t, shr, 1, 3) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const r = m.Word32And(m.Int32Constant(0xff),
+ Node* const r = m.Word32And(m.Int32Constant(0xFF),
m.Word32Shr(p0, m.Int32Constant(shr * 8)));
m.Return(r);
Stream s = m.Build();
@@ -3153,13 +3151,12 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xff) {
}
}
-
-TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xffff) {
+TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xFFFF) {
TRACED_FORRANGE(int32_t, shr, 1, 2) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const r = m.Word32And(m.Word32Shr(p0, m.Int32Constant(shr * 8)),
- m.Int32Constant(0xffff));
+ m.Int32Constant(0xFFFF));
m.Return(r);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -3170,7 +3167,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrAnd0xffff) {
TRACED_FORRANGE(int32_t, shr, 1, 2) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const r = m.Word32And(m.Int32Constant(0xffff),
+ Node* const r = m.Word32And(m.Int32Constant(0xFFFF),
m.Word32Shr(p0, m.Int32Constant(shr * 8)));
m.Return(r);
Stream s = m.Build();
diff --git a/deps/v8/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc b/deps/v8/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
index 92cdb4962c..013d96f26d 100644
--- a/deps/v8/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
+++ b/deps/v8/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc
@@ -80,49 +80,47 @@ const MachInst2 kLogicalInstructions[] = {
// sized block. The block is then duplicated across the word. Below is a random
// subset of the 32-bit immediates.
const uint32_t kLogical32Immediates[] = {
- 0x00000002, 0x00000003, 0x00000070, 0x00000080, 0x00000100, 0x000001c0,
- 0x00000300, 0x000007e0, 0x00003ffc, 0x00007fc0, 0x0003c000, 0x0003f000,
- 0x0003ffc0, 0x0003fff8, 0x0007ff00, 0x0007ffe0, 0x000e0000, 0x001e0000,
- 0x001ffffc, 0x003f0000, 0x003f8000, 0x00780000, 0x007fc000, 0x00ff0000,
- 0x01800000, 0x01800180, 0x01f801f8, 0x03fe0000, 0x03ffffc0, 0x03fffffc,
- 0x06000000, 0x07fc0000, 0x07ffc000, 0x07ffffc0, 0x07ffffe0, 0x0ffe0ffe,
- 0x0ffff800, 0x0ffffff0, 0x0fffffff, 0x18001800, 0x1f001f00, 0x1f801f80,
- 0x30303030, 0x3ff03ff0, 0x3ff83ff8, 0x3fff0000, 0x3fff8000, 0x3fffffc0,
- 0x70007000, 0x7f7f7f7f, 0x7fc00000, 0x7fffffc0, 0x8000001f, 0x800001ff,
- 0x81818181, 0x9fff9fff, 0xc00007ff, 0xc0ffffff, 0xdddddddd, 0xe00001ff,
- 0xe00003ff, 0xe007ffff, 0xefffefff, 0xf000003f, 0xf001f001, 0xf3fff3ff,
- 0xf800001f, 0xf80fffff, 0xf87ff87f, 0xfbfbfbfb, 0xfc00001f, 0xfc0000ff,
- 0xfc0001ff, 0xfc03fc03, 0xfe0001ff, 0xff000001, 0xff03ff03, 0xff800000,
- 0xff800fff, 0xff801fff, 0xff87ffff, 0xffc0003f, 0xffc007ff, 0xffcfffcf,
- 0xffe00003, 0xffe1ffff, 0xfff0001f, 0xfff07fff, 0xfff80007, 0xfff87fff,
- 0xfffc00ff, 0xfffe07ff, 0xffff00ff, 0xffffc001, 0xfffff007, 0xfffff3ff,
- 0xfffff807, 0xfffff9ff, 0xfffffc0f, 0xfffffeff};
-
+ 0x00000002, 0x00000003, 0x00000070, 0x00000080, 0x00000100, 0x000001C0,
+ 0x00000300, 0x000007E0, 0x00003FFC, 0x00007FC0, 0x0003C000, 0x0003F000,
+ 0x0003FFC0, 0x0003FFF8, 0x0007FF00, 0x0007FFE0, 0x000E0000, 0x001E0000,
+ 0x001FFFFC, 0x003F0000, 0x003F8000, 0x00780000, 0x007FC000, 0x00FF0000,
+ 0x01800000, 0x01800180, 0x01F801F8, 0x03FE0000, 0x03FFFFC0, 0x03FFFFFC,
+ 0x06000000, 0x07FC0000, 0x07FFC000, 0x07FFFFC0, 0x07FFFFE0, 0x0FFE0FFE,
+ 0x0FFFF800, 0x0FFFFFF0, 0x0FFFFFFF, 0x18001800, 0x1F001F00, 0x1F801F80,
+ 0x30303030, 0x3FF03FF0, 0x3FF83FF8, 0x3FFF0000, 0x3FFF8000, 0x3FFFFFC0,
+ 0x70007000, 0x7F7F7F7F, 0x7FC00000, 0x7FFFFFC0, 0x8000001F, 0x800001FF,
+ 0x81818181, 0x9FFF9FFF, 0xC00007FF, 0xC0FFFFFF, 0xDDDDDDDD, 0xE00001FF,
+ 0xE00003FF, 0xE007FFFF, 0xEFFFEFFF, 0xF000003F, 0xF001F001, 0xF3FFF3FF,
+ 0xF800001F, 0xF80FFFFF, 0xF87FF87F, 0xFBFBFBFB, 0xFC00001F, 0xFC0000FF,
+ 0xFC0001FF, 0xFC03FC03, 0xFE0001FF, 0xFF000001, 0xFF03FF03, 0xFF800000,
+ 0xFF800FFF, 0xFF801FFF, 0xFF87FFFF, 0xFFC0003F, 0xFFC007FF, 0xFFCFFFCF,
+ 0xFFE00003, 0xFFE1FFFF, 0xFFF0001F, 0xFFF07FFF, 0xFFF80007, 0xFFF87FFF,
+ 0xFFFC00FF, 0xFFFE07FF, 0xFFFF00FF, 0xFFFFC001, 0xFFFFF007, 0xFFFFF3FF,
+ 0xFFFFF807, 0xFFFFF9FF, 0xFFFFFC0F, 0xFFFFFEFF};
// Random subset of 64-bit logical immediates.
const uint64_t kLogical64Immediates[] = {
0x0000000000000001, 0x0000000000000002, 0x0000000000000003,
0x0000000000000070, 0x0000000000000080, 0x0000000000000100,
- 0x00000000000001c0, 0x0000000000000300, 0x0000000000000600,
- 0x00000000000007e0, 0x0000000000003ffc, 0x0000000000007fc0,
- 0x0000000600000000, 0x0000003ffffffffc, 0x000000f000000000,
- 0x000001f800000000, 0x0003fc0000000000, 0x0003fc000003fc00,
- 0x0003ffffffc00000, 0x0003ffffffffffc0, 0x0006000000060000,
- 0x003ffffffffc0000, 0x0180018001800180, 0x01f801f801f801f8,
+ 0x00000000000001C0, 0x0000000000000300, 0x0000000000000600,
+ 0x00000000000007E0, 0x0000000000003FFC, 0x0000000000007FC0,
+ 0x0000000600000000, 0x0000003FFFFFFFFC, 0x000000F000000000,
+ 0x000001F800000000, 0x0003FC0000000000, 0x0003FC000003FC00,
+ 0x0003FFFFFFC00000, 0x0003FFFFFFFFFFC0, 0x0006000000060000,
+ 0x003FFFFFFFFC0000, 0x0180018001800180, 0x01F801F801F801F8,
0x0600000000000000, 0x1000000010000000, 0x1000100010001000,
- 0x1010101010101010, 0x1111111111111111, 0x1f001f001f001f00,
- 0x1f1f1f1f1f1f1f1f, 0x1ffffffffffffffe, 0x3ffc3ffc3ffc3ffc,
- 0x5555555555555555, 0x7f7f7f7f7f7f7f7f, 0x8000000000000000,
- 0x8000001f8000001f, 0x8181818181818181, 0x9999999999999999,
- 0x9fff9fff9fff9fff, 0xaaaaaaaaaaaaaaaa, 0xdddddddddddddddd,
- 0xe0000000000001ff, 0xf800000000000000, 0xf8000000000001ff,
- 0xf807f807f807f807, 0xfefefefefefefefe, 0xfffefffefffefffe,
- 0xfffff807fffff807, 0xfffff9fffffff9ff, 0xfffffc0ffffffc0f,
- 0xfffffc0fffffffff, 0xfffffefffffffeff, 0xfffffeffffffffff,
- 0xffffff8000000000, 0xfffffffefffffffe, 0xffffffffefffffff,
- 0xfffffffff9ffffff, 0xffffffffff800000, 0xffffffffffffc0ff,
- 0xfffffffffffffffe};
-
+ 0x1010101010101010, 0x1111111111111111, 0x1F001F001F001F00,
+ 0x1F1F1F1F1F1F1F1F, 0x1FFFFFFFFFFFFFFE, 0x3FFC3FFC3FFC3FFC,
+ 0x5555555555555555, 0x7F7F7F7F7F7F7F7F, 0x8000000000000000,
+ 0x8000001F8000001F, 0x8181818181818181, 0x9999999999999999,
+ 0x9FFF9FFF9FFF9FFF, 0xAAAAAAAAAAAAAAAA, 0xDDDDDDDDDDDDDDDD,
+ 0xE0000000000001FF, 0xF800000000000000, 0xF8000000000001FF,
+ 0xF807F807F807F807, 0xFEFEFEFEFEFEFEFE, 0xFFFEFFFEFFFEFFFE,
+ 0xFFFFF807FFFFF807, 0xFFFFF9FFFFFFF9FF, 0xFFFFFC0FFFFFFC0F,
+ 0xFFFFFC0FFFFFFFFF, 0xFFFFFEFFFFFFFEFF, 0xFFFFFEFFFFFFFFFF,
+ 0xFFFFFF8000000000, 0xFFFFFFFEFFFFFFFE, 0xFFFFFFFFEFFFFFFF,
+ 0xFFFFFFFFF9FFFFFF, 0xFFFFFFFFFF800000, 0xFFFFFFFFFFFFC0FF,
+ 0xFFFFFFFFFFFFFFFE};
// ARM64 arithmetic instructions.
struct AddSub {
@@ -595,7 +593,7 @@ TEST_P(InstructionSelectorAddSubTest, UnsignedExtendByte) {
const MachineType type = dpi.mi.machine_type;
StreamBuilder m(this, type, type, type);
m.Return((m.*dpi.mi.constructor)(
- m.Parameter(0), m.Word32And(m.Parameter(1), m.Int32Constant(0xff))));
+ m.Parameter(0), m.Word32And(m.Parameter(1), m.Int32Constant(0xFF))));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
EXPECT_EQ(dpi.mi.arch_opcode, s[0]->arch_opcode());
@@ -610,7 +608,7 @@ TEST_P(InstructionSelectorAddSubTest, UnsignedExtendHalfword) {
const MachineType type = dpi.mi.machine_type;
StreamBuilder m(this, type, type, type);
m.Return((m.*dpi.mi.constructor)(
- m.Parameter(0), m.Word32And(m.Parameter(1), m.Int32Constant(0xffff))));
+ m.Parameter(0), m.Word32And(m.Parameter(1), m.Int32Constant(0xFFFF))));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
EXPECT_EQ(dpi.mi.arch_opcode, s[0]->arch_opcode());
@@ -746,7 +744,7 @@ TEST_F(InstructionSelectorTest, SubZeroOnLeftWithShift) {
EXPECT_TRUE(s[0]->InputAt(0)->IsImmediate());
EXPECT_EQ(0, s.ToInt32(s[0]->InputAt(0)));
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt32(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt32(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
}
}
@@ -772,7 +770,7 @@ TEST_F(InstructionSelectorTest, SubZeroOnLeftWithShift) {
EXPECT_TRUE(s[0]->InputAt(0)->IsImmediate());
EXPECT_EQ(0, s.ToInt32(s[0]->InputAt(0)));
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt32(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt32(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
}
}
@@ -836,7 +834,7 @@ TEST_F(InstructionSelectorTest, AddShiftByImmediateOnLeft) {
EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
EXPECT_EQ(3U, s[0]->InputCount());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt64(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt64(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
}
}
@@ -860,7 +858,7 @@ TEST_F(InstructionSelectorTest, AddShiftByImmediateOnLeft) {
EXPECT_EQ(kArm64Add, s[0]->arch_opcode());
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
EXPECT_EQ(3U, s[0]->InputCount());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt64(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt64(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
}
}
@@ -871,7 +869,7 @@ TEST_F(InstructionSelectorTest, AddUnsignedExtendByteOnLeft) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
MachineType::Int32());
- m.Return(m.Int32Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xff)),
+ m.Return(m.Int32Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xFF)),
m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -883,7 +881,7 @@ TEST_F(InstructionSelectorTest, AddUnsignedExtendByteOnLeft) {
{
StreamBuilder m(this, MachineType::Int64(), MachineType::Int32(),
MachineType::Int64());
- m.Return(m.Int64Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xff)),
+ m.Return(m.Int64Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xFF)),
m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -899,7 +897,7 @@ TEST_F(InstructionSelectorTest, AddUnsignedExtendHalfwordOnLeft) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
MachineType::Int32());
- m.Return(m.Int32Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xffff)),
+ m.Return(m.Int32Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xFFFF)),
m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -911,7 +909,7 @@ TEST_F(InstructionSelectorTest, AddUnsignedExtendHalfwordOnLeft) {
{
StreamBuilder m(this, MachineType::Int64(), MachineType::Int32(),
MachineType::Int64());
- m.Return(m.Int64Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xffff)),
+ m.Return(m.Int64Add(m.Word32And(m.Parameter(0), m.Int32Constant(0xFFFF)),
m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1167,87 +1165,126 @@ TEST_F(InstructionSelectorTest, AddBranchWithImmediateOnLeft) {
}
}
+struct TestAndBranch {
+ MachInst<std::function<Node*(InstructionSelectorTest::StreamBuilder&, Node*,
+ uint32_t mask)>>
+ mi;
+ FlagsCondition cond;
+};
-TEST_F(InstructionSelectorTest, Word32AndBranchWithOneBitMaskOnRight) {
- TRACED_FORRANGE(int, bit, 0, 31) {
- uint32_t mask = 1 << bit;
- StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
- RawMachineLabel a, b;
- m.Branch(m.Word32And(m.Parameter(0), m.Int32Constant(mask)), &a, &b);
- m.Bind(&a);
- m.Return(m.Int32Constant(1));
- m.Bind(&b);
- m.Return(m.Int32Constant(0));
- Stream s = m.Build();
- ASSERT_EQ(1U, s.size());
- EXPECT_EQ(kArm64TestAndBranch32, s[0]->arch_opcode());
- EXPECT_EQ(kNotEqual, s[0]->flags_condition());
- EXPECT_EQ(4U, s[0]->InputCount());
- EXPECT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
- EXPECT_EQ(bit, s.ToInt32(s[0]->InputAt(1)));
- }
-
- TRACED_FORRANGE(int, bit, 0, 31) {
- uint32_t mask = 1 << bit;
- StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
- RawMachineLabel a, b;
- m.Branch(
- m.Word32BinaryNot(m.Word32And(m.Parameter(0), m.Int32Constant(mask))),
- &a, &b);
- m.Bind(&a);
- m.Return(m.Int32Constant(1));
- m.Bind(&b);
- m.Return(m.Int32Constant(0));
- Stream s = m.Build();
- ASSERT_EQ(1U, s.size());
- EXPECT_EQ(kArm64TestAndBranch32, s[0]->arch_opcode());
- EXPECT_EQ(kEqual, s[0]->flags_condition());
- EXPECT_EQ(4U, s[0]->InputCount());
- EXPECT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
- EXPECT_EQ(bit, s.ToInt32(s[0]->InputAt(1)));
- }
+std::ostream& operator<<(std::ostream& os, const TestAndBranch& tb) {
+ return os << tb.mi;
}
-TEST_F(InstructionSelectorTest, Word32AndBranchWithOneBitMaskOnLeft) {
- TRACED_FORRANGE(int, bit, 0, 31) {
- uint32_t mask = 1 << bit;
- StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
- RawMachineLabel a, b;
- m.Branch(m.Word32And(m.Int32Constant(mask), m.Parameter(0)), &a, &b);
- m.Bind(&a);
- m.Return(m.Int32Constant(1));
- m.Bind(&b);
- m.Return(m.Int32Constant(0));
- Stream s = m.Build();
- ASSERT_EQ(1U, s.size());
- EXPECT_EQ(kArm64TestAndBranch32, s[0]->arch_opcode());
- EXPECT_EQ(kNotEqual, s[0]->flags_condition());
- EXPECT_EQ(4U, s[0]->InputCount());
- EXPECT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
- EXPECT_EQ(bit, s.ToInt32(s[0]->InputAt(1)));
- }
-
+const TestAndBranch kTestAndBranchMatchers32[] = {
+ // Branch on the result of Word32And directly.
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x, uint32_t mask)
+ -> Node* { return m.Word32And(x, m.Int32Constant(mask)); },
+ "if (x and mask)", kArm64TestAndBranch32, MachineType::Int32()},
+ kNotEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32BinaryNot(m.Word32And(x, m.Int32Constant(mask)));
+ },
+ "if not (x and mask)", kArm64TestAndBranch32, MachineType::Int32()},
+ kEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x, uint32_t mask)
+ -> Node* { return m.Word32And(m.Int32Constant(mask), x); },
+ "if (mask and x)", kArm64TestAndBranch32, MachineType::Int32()},
+ kNotEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32BinaryNot(m.Word32And(m.Int32Constant(mask), x));
+ },
+ "if not (mask and x)", kArm64TestAndBranch32, MachineType::Int32()},
+ kEqual},
+ // Branch on the result of '(x and mask) == mask'. This tests that a bit is
+ // set rather than cleared which is why conditions are inverted.
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32Equal(m.Word32And(x, m.Int32Constant(mask)),
+ m.Int32Constant(mask));
+ },
+ "if ((x and mask) == mask)", kArm64TestAndBranch32, MachineType::Int32()},
+ kNotEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32BinaryNot(m.Word32Equal(
+ m.Word32And(x, m.Int32Constant(mask)), m.Int32Constant(mask)));
+ },
+ "if ((x and mask) != mask)", kArm64TestAndBranch32, MachineType::Int32()},
+ kEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32Equal(m.Int32Constant(mask),
+ m.Word32And(x, m.Int32Constant(mask)));
+ },
+ "if (mask == (x and mask))", kArm64TestAndBranch32, MachineType::Int32()},
+ kNotEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32BinaryNot(m.Word32Equal(
+ m.Int32Constant(mask), m.Word32And(x, m.Int32Constant(mask))));
+ },
+ "if (mask != (x and mask))", kArm64TestAndBranch32, MachineType::Int32()},
+ kEqual},
+ // Same as above but swap 'mask' and 'x'.
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32Equal(m.Word32And(m.Int32Constant(mask), x),
+ m.Int32Constant(mask));
+ },
+ "if ((mask and x) == mask)", kArm64TestAndBranch32, MachineType::Int32()},
+ kNotEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32BinaryNot(m.Word32Equal(
+ m.Word32And(m.Int32Constant(mask), x), m.Int32Constant(mask)));
+ },
+ "if ((mask and x) != mask)", kArm64TestAndBranch32, MachineType::Int32()},
+ kEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32Equal(m.Int32Constant(mask),
+ m.Word32And(m.Int32Constant(mask), x));
+ },
+ "if (mask == (mask and x))", kArm64TestAndBranch32, MachineType::Int32()},
+ kNotEqual},
+ {{[](InstructionSelectorTest::StreamBuilder& m, Node* x,
+ uint32_t mask) -> Node* {
+ return m.Word32BinaryNot(m.Word32Equal(
+ m.Int32Constant(mask), m.Word32And(m.Int32Constant(mask), x)));
+ },
+ "if (mask != (mask and x))", kArm64TestAndBranch32, MachineType::Int32()},
+ kEqual}};
+
+typedef InstructionSelectorTestWithParam<TestAndBranch>
+ InstructionSelectorTestAndBranchTest;
+
+TEST_P(InstructionSelectorTestAndBranchTest, TestAndBranch32) {
+ const TestAndBranch inst = GetParam();
TRACED_FORRANGE(int, bit, 0, 31) {
uint32_t mask = 1 << bit;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
- m.Branch(
- m.Word32BinaryNot(m.Word32And(m.Int32Constant(mask), m.Parameter(0))),
- &a, &b);
+ m.Branch(inst.mi.constructor(m, m.Parameter(0), mask), &a, &b);
m.Bind(&a);
m.Return(m.Int32Constant(1));
m.Bind(&b);
m.Return(m.Int32Constant(0));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
- EXPECT_EQ(kArm64TestAndBranch32, s[0]->arch_opcode());
- EXPECT_EQ(kEqual, s[0]->flags_condition());
+ EXPECT_EQ(inst.mi.arch_opcode, s[0]->arch_opcode());
+ EXPECT_EQ(inst.cond, s[0]->flags_condition());
EXPECT_EQ(4U, s[0]->InputCount());
EXPECT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(bit, s.ToInt32(s[0]->InputAt(1)));
}
}
+INSTANTIATE_TEST_CASE_P(InstructionSelectorTest,
+ InstructionSelectorTestAndBranchTest,
+ ::testing::ValuesIn(kTestAndBranchMatchers32));
TEST_F(InstructionSelectorTest, Word64AndBranchWithOneBitMaskOnRight) {
TRACED_FORRANGE(int, bit, 0, 63) {
@@ -1335,7 +1372,7 @@ TEST_F(InstructionSelectorTest, Word32EqualZeroAndBranchWithOneBitMask) {
TEST_F(InstructionSelectorTest, Word64EqualZeroAndBranchWithOneBitMask) {
TRACED_FORRANGE(int, bit, 0, 63) {
- uint64_t mask = V8_UINT64_C(1) << bit;
+ uint64_t mask = uint64_t{1} << bit;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
RawMachineLabel a, b;
m.Branch(m.Word64Equal(m.Word64And(m.Int64Constant(mask), m.Parameter(0)),
@@ -1355,7 +1392,7 @@ TEST_F(InstructionSelectorTest, Word64EqualZeroAndBranchWithOneBitMask) {
}
TRACED_FORRANGE(int, bit, 0, 63) {
- uint64_t mask = V8_UINT64_C(1) << bit;
+ uint64_t mask = uint64_t{1} << bit;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
RawMachineLabel a, b;
m.Branch(
@@ -2925,7 +2962,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithWord32Shift) {
ASSERT_EQ(3U, s[0]->InputCount());
EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1)));
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt32(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt32(s[0]->InputAt(2)));
ASSERT_EQ(1U, s[0]->OutputCount());
}
TRACED_FORRANGE(int32_t, imm, -32, 63) {
@@ -2942,7 +2979,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithWord32Shift) {
ASSERT_EQ(3U, s[0]->InputCount());
EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1)));
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt32(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt32(s[0]->InputAt(2)));
ASSERT_EQ(1U, s[0]->OutputCount());
}
}
@@ -2955,7 +2992,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithUnsignedExtendByte) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* r = m.Word32And(p1, m.Int32Constant(0xff));
+ Node* r = m.Word32And(p1, m.Int32Constant(0xFF));
m.Return(m.Word32Equal(p0, r));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2971,7 +3008,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithUnsignedExtendByte) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* r = m.Word32And(p1, m.Int32Constant(0xff));
+ Node* r = m.Word32And(p1, m.Int32Constant(0xFF));
m.Return(m.Word32Equal(r, p0));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2991,7 +3028,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithUnsignedExtendHalfword) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* r = m.Word32And(p1, m.Int32Constant(0xffff));
+ Node* r = m.Word32And(p1, m.Int32Constant(0xFFFF));
m.Return(m.Word32Equal(p0, r));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -3007,7 +3044,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithUnsignedExtendHalfword) {
MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
- Node* r = m.Word32And(p1, m.Int32Constant(0xffff));
+ Node* r = m.Word32And(p1, m.Int32Constant(0xFFFF));
m.Return(m.Word32Equal(r, p0));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -3204,7 +3241,7 @@ TEST_F(InstructionSelectorTest, Word32CompareNegateWithWord32Shift) {
EXPECT_EQ(kArm64Cmn32, s[0]->arch_opcode());
EXPECT_EQ(3U, s[0]->InputCount());
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt32(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt32(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
EXPECT_EQ(kFlags_set, s[0]->flags_mode());
EXPECT_EQ(cmp.cond, s[0]->flags_condition());
@@ -3312,7 +3349,7 @@ TEST_F(InstructionSelectorTest, CmpShiftByImmediateOnLeft) {
EXPECT_EQ(kArm64Cmp32, s[0]->arch_opcode());
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
EXPECT_EQ(3U, s[0]->InputCount());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt64(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt64(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
EXPECT_EQ(kFlags_set, s[0]->flags_mode());
EXPECT_EQ(cmp.commuted_cond, s[0]->flags_condition());
@@ -3346,7 +3383,7 @@ TEST_F(InstructionSelectorTest, CmnShiftByImmediateOnLeft) {
EXPECT_EQ(kArm64Cmn32, s[0]->arch_opcode());
EXPECT_EQ(shift.mode, s[0]->addressing_mode());
EXPECT_EQ(3U, s[0]->InputCount());
- EXPECT_EQ(0x3f & imm, 0x3f & s.ToInt64(s[0]->InputAt(2)));
+ EXPECT_EQ(0x3F & imm, 0x3F & s.ToInt64(s[0]->InputAt(2)));
EXPECT_EQ(1U, s[0]->OutputCount());
EXPECT_EQ(kFlags_set, s[0]->flags_mode());
EXPECT_EQ(cmp.cond, s[0]->flags_condition());
@@ -3816,11 +3853,11 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) {
// The available shift operand range is `0 <= imm < 32`, but we also test
// that immediates outside this range are handled properly (modulo-32).
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
uint32_t jnk = rng()->NextInt();
jnk = (lsb > 0) ? (jnk >> (32 - lsb)) : 0;
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Parameter(0), m.Int32Constant(msk)),
m.Int32Constant(shift)));
@@ -3833,11 +3870,11 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) {
}
}
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
uint32_t jnk = rng()->NextInt();
jnk = (lsb > 0) ? (jnk >> (32 - lsb)) : 0;
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Int32Constant(msk), m.Parameter(0)),
m.Int32Constant(shift)));
@@ -3856,12 +3893,12 @@ TEST_F(InstructionSelectorTest, Word64ShrWithWord64AndWithImmediate) {
// The available shift operand range is `0 <= imm < 64`, but we also test
// that immediates outside this range are handled properly (modulo-64).
TRACED_FORRANGE(int32_t, shift, -64, 127) {
- int32_t lsb = shift & 0x3f;
+ int32_t lsb = shift & 0x3F;
TRACED_FORRANGE(int32_t, width, 1, 64 - lsb) {
uint64_t jnk = rng()->NextInt64();
jnk = (lsb > 0) ? (jnk >> (64 - lsb)) : 0;
uint64_t msk =
- ((V8_UINT64_C(0xffffffffffffffff) >> (64 - width)) << lsb) | jnk;
+ ((uint64_t{0xFFFFFFFFFFFFFFFF} >> (64 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(m.Word64Shr(m.Word64And(m.Parameter(0), m.Int64Constant(msk)),
m.Int64Constant(shift)));
@@ -3874,12 +3911,12 @@ TEST_F(InstructionSelectorTest, Word64ShrWithWord64AndWithImmediate) {
}
}
TRACED_FORRANGE(int32_t, shift, -64, 127) {
- int32_t lsb = shift & 0x3f;
+ int32_t lsb = shift & 0x3F;
TRACED_FORRANGE(int32_t, width, 1, 64 - lsb) {
uint64_t jnk = rng()->NextInt64();
jnk = (lsb > 0) ? (jnk >> (64 - lsb)) : 0;
uint64_t msk =
- ((V8_UINT64_C(0xffffffffffffffff) >> (64 - width)) << lsb) | jnk;
+ ((uint64_t{0xFFFFFFFFFFFFFFFF} >> (64 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(m.Word64Shr(m.Word64And(m.Int64Constant(msk), m.Parameter(0)),
m.Int64Constant(shift)));
@@ -3898,7 +3935,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
// The available shift operand range is `0 <= imm < 32`, but we also test
// that immediates outside this range are handled properly (modulo-32).
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 31) {
uint32_t msk = (1 << width) - 1;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
@@ -3914,7 +3951,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
}
}
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 31) {
uint32_t msk = (1 << width) - 1;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
@@ -3937,9 +3974,9 @@ TEST_F(InstructionSelectorTest, Word64AndWithImmediateWithWord64Shr) {
// The available shift operand range is `0 <= imm < 64`, but we also test
// that immediates outside this range are handled properly (modulo-64).
TRACED_FORRANGE(int64_t, shift, -64, 127) {
- int64_t lsb = shift & 0x3f;
+ int64_t lsb = shift & 0x3F;
TRACED_FORRANGE(int64_t, width, 1, 63) {
- uint64_t msk = (V8_UINT64_C(1) << width) - 1;
+ uint64_t msk = (uint64_t{1} << width) - 1;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(m.Word64And(m.Word64Shr(m.Parameter(0), m.Int64Constant(shift)),
m.Int64Constant(msk)));
@@ -3953,9 +3990,9 @@ TEST_F(InstructionSelectorTest, Word64AndWithImmediateWithWord64Shr) {
}
}
TRACED_FORRANGE(int64_t, shift, -64, 127) {
- int64_t lsb = shift & 0x3f;
+ int64_t lsb = shift & 0x3F;
TRACED_FORRANGE(int64_t, width, 1, 63) {
- uint64_t msk = (V8_UINT64_C(1) << width) - 1;
+ uint64_t msk = (uint64_t{1} << width) - 1;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(
m.Word64And(m.Int64Constant(msk),
@@ -4013,7 +4050,7 @@ TEST_F(InstructionSelectorTest, Int32MulHighWithSar) {
EXPECT_EQ(kArm64Asr, s[1]->arch_opcode());
ASSERT_EQ(2U, s[1]->InputCount());
EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
- EXPECT_EQ((shift & 0x1f) + 32, s.ToInt64(s[1]->InputAt(1)));
+ EXPECT_EQ((shift & 0x1F) + 32, s.ToInt64(s[1]->InputAt(1)));
ASSERT_EQ(1U, s[1]->OutputCount());
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[1]->Output()));
}
@@ -4072,7 +4109,7 @@ TEST_F(InstructionSelectorTest, Uint32MulHighWithShr) {
EXPECT_EQ(kArm64Lsr, s[1]->arch_opcode());
ASSERT_EQ(2U, s[1]->InputCount());
EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
- EXPECT_EQ((shift & 0x1f) + 32, s.ToInt64(s[1]->InputAt(1)));
+ EXPECT_EQ((shift & 0x1F) + 32, s.ToInt64(s[1]->InputAt(1)));
ASSERT_EQ(1U, s[1]->OutputCount());
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[1]->Output()));
}
diff --git a/deps/v8/test/unittests/compiler/graph-unittest.cc b/deps/v8/test/unittests/compiler/graph-unittest.cc
index 55931d51fb..a39f56e6bb 100644
--- a/deps/v8/test/unittests/compiler/graph-unittest.cc
+++ b/deps/v8/test/unittests/compiler/graph-unittest.cc
@@ -17,7 +17,8 @@ GraphTest::GraphTest(int num_parameters)
: TestWithNativeContext(),
TestWithIsolateAndZone(),
common_(zone()),
- graph_(zone()) {
+ graph_(zone()),
+ source_positions_(&graph_) {
graph()->SetStart(graph()->NewNode(common()->Start(num_parameters)));
graph()->SetEnd(graph()->NewNode(common()->End(1), graph()->start()));
}
diff --git a/deps/v8/test/unittests/compiler/graph-unittest.h b/deps/v8/test/unittests/compiler/graph-unittest.h
index 8701f1ff6d..9d4a15ad27 100644
--- a/deps/v8/test/unittests/compiler/graph-unittest.h
+++ b/deps/v8/test/unittests/compiler/graph-unittest.h
@@ -6,6 +6,7 @@
#define V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_
#include "src/compiler/common-operator.h"
+#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/graph.h"
#include "src/compiler/typer.h"
#include "test/unittests/test-utils.h"
@@ -58,10 +59,12 @@ class GraphTest : public virtual TestWithNativeContext,
CommonOperatorBuilder* common() { return &common_; }
Graph* graph() { return &graph_; }
+ SourcePositionTable* source_positions() { return &source_positions_; }
private:
CommonOperatorBuilder common_;
Graph graph_;
+ SourcePositionTable source_positions_;
};
diff --git a/deps/v8/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc b/deps/v8/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc
index b9f5fc4b9f..f2767a0bb8 100644
--- a/deps/v8/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc
+++ b/deps/v8/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc
@@ -15,7 +15,7 @@ namespace {
// Immediates (random subset).
const int32_t kImmediates[] = {kMinInt, -42, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8,
- 16, 42, 0xff, 0xffff, 0x0f0f0f0f, kMaxInt};
+ 16, 42, 0xFF, 0xFFFF, 0x0F0F0F0F, kMaxInt};
} // namespace
@@ -864,6 +864,15 @@ TEST_F(InstructionSelectorTest, Word32Clz) {
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
}
+TEST_F(InstructionSelectorTest, SpeculationFence) {
+ StreamBuilder m(this, MachineType::Int32());
+ m.SpeculationFence();
+ m.Return(m.Int32Constant(0));
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kLFence, s[0]->arch_opcode());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
diff --git a/deps/v8/test/unittests/compiler/instruction-sequence-unittest.cc b/deps/v8/test/unittests/compiler/instruction-sequence-unittest.cc
index d629639c49..17d1572e98 100644
--- a/deps/v8/test/unittests/compiler/instruction-sequence-unittest.cc
+++ b/deps/v8/test/unittests/compiler/instruction-sequence-unittest.cc
@@ -432,8 +432,7 @@ InstructionOperand InstructionSequenceTest::ConvertInputOp(TestOperand op) {
default:
break;
}
- CHECK(false);
- return InstructionOperand();
+ UNREACHABLE();
}
@@ -468,8 +467,7 @@ InstructionOperand InstructionSequenceTest::ConvertOutputOp(VReg vreg,
default:
break;
}
- CHECK(false);
- return InstructionOperand();
+ UNREACHABLE();
}
diff --git a/deps/v8/test/unittests/compiler/int64-lowering-unittest.cc b/deps/v8/test/unittests/compiler/int64-lowering-unittest.cc
index a6bd1f2dad..ddb8408e5f 100644
--- a/deps/v8/test/unittests/compiler/int64-lowering-unittest.cc
+++ b/deps/v8/test/unittests/compiler/int64-lowering-unittest.cc
@@ -34,8 +34,8 @@ class Int64LoweringTest : public GraphTest {
: GraphTest(),
machine_(zone(), MachineRepresentation::kWord32,
MachineOperatorBuilder::Flag::kAllOptionalOps) {
- value_[0] = 0x1234567890abcdef;
- value_[1] = 0x1edcba098765432f;
+ value_[0] = 0x1234567890ABCDEF;
+ value_[1] = 0x1EDCBA098765432F;
value_[2] = 0x1133557799886644;
}
@@ -85,7 +85,7 @@ class Int64LoweringTest : public GraphTest {
int64_t value(int i) { return value_[i]; }
int32_t low_word_value(int i) {
- return static_cast<int32_t>(value_[i] & 0xffffffff);
+ return static_cast<int32_t>(value_[i] & 0xFFFFFFFF);
}
int32_t high_word_value(int i) {
@@ -760,7 +760,7 @@ TEST_F(Int64LoweringTest, I64Ror) {
IsMerge(IsIfTrue(branch_lt32_matcher), IsIfFalse(branch_lt32_matcher)));
Matcher<Node*> shift_matcher =
- IsWord32And(IsParameter(0), IsInt32Constant(0x1f));
+ IsWord32And(IsParameter(0), IsInt32Constant(0x1F));
Matcher<Node*> bit_mask_matcher = IsWord32Shl(
IsWord32Sar(IsInt32Constant(std::numeric_limits<int32_t>::min()),
diff --git a/deps/v8/test/unittests/compiler/js-typed-lowering-unittest.cc b/deps/v8/test/unittests/compiler/js-typed-lowering-unittest.cc
index 485efd6288..b07dbfd0dc 100644
--- a/deps/v8/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/deps/v8/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -382,8 +382,7 @@ TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) {
Reduce(graph()->NewNode(javascript()->LoadNamed(name, feedback), receiver,
context, EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsLoadField(AccessBuilder::ForStringLength(),
- receiver, effect, control));
+ EXPECT_THAT(r.replacement(), IsStringLength(receiver));
}
diff --git a/deps/v8/test/unittests/compiler/linkage-tail-call-unittest.cc b/deps/v8/test/unittests/compiler/linkage-tail-call-unittest.cc
index 741021a446..17dc998f6d 100644
--- a/deps/v8/test/unittests/compiler/linkage-tail-call-unittest.cc
+++ b/deps/v8/test/unittests/compiler/linkage-tail-call-unittest.cc
@@ -157,7 +157,9 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCallee) {
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
- EXPECT_EQ(1, stack_param_delta);
+ // We might need to add one slot of padding to the callee arguments.
+ int expected = kPadArguments ? 2 : 1;
+ EXPECT_EQ(expected, stack_param_delta);
}
@@ -178,7 +180,9 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCaller) {
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
- EXPECT_EQ(-1, stack_param_delta);
+ // We might need to drop one slot of padding from the caller's arguments.
+ int expected = kPadArguments ? -2 : -1;
+ EXPECT_EQ(expected, stack_param_delta);
}
@@ -313,7 +317,9 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCallerRegistersAndStack) {
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
- EXPECT_EQ(-1, stack_param_delta);
+ // We might need to add one slot of padding to the callee arguments.
+ int expected = kPadArguments ? 0 : -1;
+ EXPECT_EQ(expected, stack_param_delta);
}
@@ -341,7 +347,9 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCalleeRegistersAndStack) {
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
- EXPECT_EQ(1, stack_param_delta);
+ // We might need to drop one slot of padding from the caller's arguments.
+ int expected = kPadArguments ? 0 : 1;
+ EXPECT_EQ(expected, stack_param_delta);
}
} // namespace compiler
diff --git a/deps/v8/test/unittests/compiler/loop-peeling-unittest.cc b/deps/v8/test/unittests/compiler/loop-peeling-unittest.cc
index 969f253ae1..ef129fa7f3 100644
--- a/deps/v8/test/unittests/compiler/loop-peeling-unittest.cc
+++ b/deps/v8/test/unittests/compiler/loop-peeling-unittest.cc
@@ -74,14 +74,14 @@ class LoopPeelingTest : public GraphTest {
PeeledIteration* PeelOne() {
LoopTree* loop_tree = GetLoopTree();
LoopTree::Loop* loop = loop_tree->outer_loops()[0];
- EXPECT_TRUE(LoopPeeler::CanPeel(loop_tree, loop));
- return Peel(loop_tree, loop);
+ LoopPeeler peeler(graph(), common(), loop_tree, zone(), source_positions());
+ EXPECT_TRUE(peeler.CanPeel(loop));
+ return Peel(peeler, loop);
}
- PeeledIteration* Peel(LoopTree* loop_tree, LoopTree::Loop* loop) {
- EXPECT_TRUE(LoopPeeler::CanPeel(loop_tree, loop));
- PeeledIteration* peeled =
- LoopPeeler::Peel(graph(), common(), loop_tree, loop, zone());
+ PeeledIteration* Peel(LoopPeeler peeler, LoopTree::Loop* loop) {
+ EXPECT_TRUE(peeler.CanPeel(loop));
+ PeeledIteration* peeled = peeler.Peel(loop);
if (FLAG_trace_turbo_graph) {
OFStream os(stdout);
os << AsRPO(*graph());
@@ -250,7 +250,8 @@ TEST_F(LoopPeelingTest, SimpleNestedLoopWithCounter_peel_inner) {
EXPECT_NE(nullptr, loop);
EXPECT_EQ(1u, loop->depth());
- PeeledIteration* peeled = Peel(loop_tree, loop);
+ LoopPeeler peeler(graph(), common(), loop_tree, zone(), source_positions());
+ PeeledIteration* peeled = Peel(peeler, loop);
ExpectNotPeeled(outer.loop, peeled);
ExpectNotPeeled(outer.branch, peeled);
@@ -289,7 +290,8 @@ TEST_F(LoopPeelingTest, SimpleInnerCounter_peel_inner) {
EXPECT_NE(nullptr, loop);
EXPECT_EQ(1u, loop->depth());
- PeeledIteration* peeled = Peel(loop_tree, loop);
+ LoopPeeler peeler(graph(), common(), loop_tree, zone(), source_positions());
+ PeeledIteration* peeled = Peel(peeler, loop);
ExpectNotPeeled(outer.loop, peeled);
ExpectNotPeeled(outer.branch, peeled);
@@ -517,7 +519,8 @@ TEST_F(LoopPeelingTest, SimpleLoopWithUnmarkedExit) {
{
LoopTree* loop_tree = GetLoopTree();
LoopTree::Loop* loop = loop_tree->outer_loops()[0];
- EXPECT_FALSE(LoopPeeler::CanPeel(loop_tree, loop));
+ LoopPeeler peeler(graph(), common(), loop_tree, zone(), source_positions());
+ EXPECT_FALSE(peeler.CanPeel(loop));
}
}
diff --git a/deps/v8/test/unittests/compiler/machine-operator-reducer-unittest.cc b/deps/v8/test/unittests/compiler/machine-operator-reducer-unittest.cc
index 1a4476f488..4448452327 100644
--- a/deps/v8/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/deps/v8/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -173,70 +173,116 @@ const int32_t kInt32Values[] = {
1954730266, 2008792749, 2045320228,
std::numeric_limits<int32_t>::max()};
-
-const int64_t kInt64Values[] = {
- std::numeric_limits<int64_t>::min(), V8_INT64_C(-8974392461363618006),
- V8_INT64_C(-8874367046689588135), V8_INT64_C(-8269197512118230839),
- V8_INT64_C(-8146091527100606733), V8_INT64_C(-7550917981466150848),
- V8_INT64_C(-7216590251577894337), V8_INT64_C(-6464086891160048440),
- V8_INT64_C(-6365616494908257190), V8_INT64_C(-6305630541365849726),
- V8_INT64_C(-5982222642272245453), V8_INT64_C(-5510103099058504169),
- V8_INT64_C(-5496838675802432701), V8_INT64_C(-4047626578868642657),
- V8_INT64_C(-4033755046900164544), V8_INT64_C(-3554299241457877041),
- V8_INT64_C(-2482258764588614470), V8_INT64_C(-1688515425526875335),
- V8_INT64_C(-924784137176548532), V8_INT64_C(-725316567157391307),
- V8_INT64_C(-439022654781092241), V8_INT64_C(-105545757668917080),
- V8_INT64_C(-2088319373), V8_INT64_C(-2073699916),
- V8_INT64_C(-1844949911), V8_INT64_C(-1831090548),
- V8_INT64_C(-1756711933), V8_INT64_C(-1559409497),
- V8_INT64_C(-1281179700), V8_INT64_C(-1211513985),
- V8_INT64_C(-1182371520), V8_INT64_C(-785934753),
- V8_INT64_C(-767480697), V8_INT64_C(-705745662),
- V8_INT64_C(-514362436), V8_INT64_C(-459916580),
- V8_INT64_C(-312328082), V8_INT64_C(-302949707),
- V8_INT64_C(-285499304), V8_INT64_C(-125701262),
- V8_INT64_C(-95139843), V8_INT64_C(-32768),
- V8_INT64_C(-27542), V8_INT64_C(-23600),
- V8_INT64_C(-18582), V8_INT64_C(-17770),
- V8_INT64_C(-9086), V8_INT64_C(-9010),
- V8_INT64_C(-8244), V8_INT64_C(-2890),
- V8_INT64_C(-103), V8_INT64_C(-34),
- V8_INT64_C(-27), V8_INT64_C(-25),
- V8_INT64_C(-9), V8_INT64_C(-7),
- V8_INT64_C(0), V8_INT64_C(2),
- V8_INT64_C(38), V8_INT64_C(58),
- V8_INT64_C(65), V8_INT64_C(93),
- V8_INT64_C(111), V8_INT64_C(1003),
- V8_INT64_C(1267), V8_INT64_C(12797),
- V8_INT64_C(23122), V8_INT64_C(28200),
- V8_INT64_C(30888), V8_INT64_C(42648848),
- V8_INT64_C(116836693), V8_INT64_C(263003643),
- V8_INT64_C(571039860), V8_INT64_C(1079398689),
- V8_INT64_C(1145196402), V8_INT64_C(1184846321),
- V8_INT64_C(1758281648), V8_INT64_C(1859991374),
- V8_INT64_C(1960251588), V8_INT64_C(2042443199),
- V8_INT64_C(296220586027987448), V8_INT64_C(1015494173071134726),
- V8_INT64_C(1151237951914455318), V8_INT64_C(1331941174616854174),
- V8_INT64_C(2022020418667972654), V8_INT64_C(2450251424374977035),
- V8_INT64_C(3668393562685561486), V8_INT64_C(4858229301215502171),
- V8_INT64_C(4919426235170669383), V8_INT64_C(5034286595330341762),
- V8_INT64_C(5055797915536941182), V8_INT64_C(6072389716149252074),
- V8_INT64_C(6185309910199801210), V8_INT64_C(6297328311011094138),
- V8_INT64_C(6932372858072165827), V8_INT64_C(8483640924987737210),
- V8_INT64_C(8663764179455849203), V8_INT64_C(8877197042645298254),
- V8_INT64_C(8901543506779157333), std::numeric_limits<int64_t>::max()};
-
+const int64_t kInt64Values[] = {std::numeric_limits<int64_t>::min(),
+ int64_t{-8974392461363618006},
+ int64_t{-8874367046689588135},
+ int64_t{-8269197512118230839},
+ int64_t{-8146091527100606733},
+ int64_t{-7550917981466150848},
+ int64_t{-7216590251577894337},
+ int64_t{-6464086891160048440},
+ int64_t{-6365616494908257190},
+ int64_t{-6305630541365849726},
+ int64_t{-5982222642272245453},
+ int64_t{-5510103099058504169},
+ int64_t{-5496838675802432701},
+ int64_t{-4047626578868642657},
+ int64_t{-4033755046900164544},
+ int64_t{-3554299241457877041},
+ int64_t{-2482258764588614470},
+ int64_t{-1688515425526875335},
+ int64_t{-924784137176548532},
+ int64_t{-725316567157391307},
+ int64_t{-439022654781092241},
+ int64_t{-105545757668917080},
+ int64_t{-2088319373},
+ int64_t{-2073699916},
+ int64_t{-1844949911},
+ int64_t{-1831090548},
+ int64_t{-1756711933},
+ int64_t{-1559409497},
+ int64_t{-1281179700},
+ int64_t{-1211513985},
+ int64_t{-1182371520},
+ int64_t{-785934753},
+ int64_t{-767480697},
+ int64_t{-705745662},
+ int64_t{-514362436},
+ int64_t{-459916580},
+ int64_t{-312328082},
+ int64_t{-302949707},
+ int64_t{-285499304},
+ int64_t{-125701262},
+ int64_t{-95139843},
+ int64_t{-32768},
+ int64_t{-27542},
+ int64_t{-23600},
+ int64_t{-18582},
+ int64_t{-17770},
+ int64_t{-9086},
+ int64_t{-9010},
+ int64_t{-8244},
+ int64_t{-2890},
+ int64_t{-103},
+ int64_t{-34},
+ int64_t{-27},
+ int64_t{-25},
+ int64_t{-9},
+ int64_t{-7},
+ int64_t{0},
+ int64_t{2},
+ int64_t{38},
+ int64_t{58},
+ int64_t{65},
+ int64_t{93},
+ int64_t{111},
+ int64_t{1003},
+ int64_t{1267},
+ int64_t{12797},
+ int64_t{23122},
+ int64_t{28200},
+ int64_t{30888},
+ int64_t{42648848},
+ int64_t{116836693},
+ int64_t{263003643},
+ int64_t{571039860},
+ int64_t{1079398689},
+ int64_t{1145196402},
+ int64_t{1184846321},
+ int64_t{1758281648},
+ int64_t{1859991374},
+ int64_t{1960251588},
+ int64_t{2042443199},
+ int64_t{296220586027987448},
+ int64_t{1015494173071134726},
+ int64_t{1151237951914455318},
+ int64_t{1331941174616854174},
+ int64_t{2022020418667972654},
+ int64_t{2450251424374977035},
+ int64_t{3668393562685561486},
+ int64_t{4858229301215502171},
+ int64_t{4919426235170669383},
+ int64_t{5034286595330341762},
+ int64_t{5055797915536941182},
+ int64_t{6072389716149252074},
+ int64_t{6185309910199801210},
+ int64_t{6297328311011094138},
+ int64_t{6932372858072165827},
+ int64_t{8483640924987737210},
+ int64_t{8663764179455849203},
+ int64_t{8877197042645298254},
+ int64_t{8901543506779157333},
+ std::numeric_limits<int64_t>::max()};
const uint32_t kUint32Values[] = {
- 0x00000000, 0x00000001, 0xffffffff, 0x1b09788b, 0x04c5fce8, 0xcc0de5bf,
- 0x273a798e, 0x187937a3, 0xece3af83, 0x5495a16b, 0x0b668ecc, 0x11223344,
- 0x0000009e, 0x00000043, 0x0000af73, 0x0000116b, 0x00658ecc, 0x002b3b4c,
- 0x88776655, 0x70000000, 0x07200000, 0x7fffffff, 0x56123761, 0x7fffff00,
- 0x761c4761, 0x80000000, 0x88888888, 0xa0000000, 0xdddddddd, 0xe0000000,
- 0xeeeeeeee, 0xfffffffd, 0xf0000000, 0x007fffff, 0x003fffff, 0x001fffff,
- 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff, 0x0000ffff, 0x00007fff,
- 0x00003fff, 0x00001fff, 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff};
-
+ 0x00000000, 0x00000001, 0xFFFFFFFF, 0x1B09788B, 0x04C5FCE8, 0xCC0DE5BF,
+ 0x273A798E, 0x187937A3, 0xECE3AF83, 0x5495A16B, 0x0B668ECC, 0x11223344,
+ 0x0000009E, 0x00000043, 0x0000AF73, 0x0000116B, 0x00658ECC, 0x002B3B4C,
+ 0x88776655, 0x70000000, 0x07200000, 0x7FFFFFFF, 0x56123761, 0x7FFFFF00,
+ 0x761C4761, 0x80000000, 0x88888888, 0xA0000000, 0xDDDDDDDD, 0xE0000000,
+ 0xEEEEEEEE, 0xFFFFFFFD, 0xF0000000, 0x007FFFFF, 0x003FFFFF, 0x001FFFFF,
+ 0x000FFFFF, 0x0007FFFF, 0x0003FFFF, 0x0001FFFF, 0x0000FFFF, 0x00007FFF,
+ 0x00003FFF, 0x00001FFF, 0x00000FFF, 0x000007FF, 0x000003FF, 0x000001FF};
struct ComparisonBinaryOperator {
const Operator* (MachineOperatorBuilder::*constructor)();
@@ -1653,7 +1699,7 @@ TEST_F(MachineOperatorReducerTest, Float64DivWithMinusOne) {
TEST_F(MachineOperatorReducerTest, Float64DivWithPowerOfTwo) {
Node* const p0 = Parameter(0);
- TRACED_FORRANGE(uint64_t, exponent, 1, 0x7fe) {
+ TRACED_FORRANGE(uint64_t, exponent, 1, 0x7FE) {
Double divisor = Double(exponent << Double::kPhysicalSignificandSize);
if (divisor.value() == 1.0) continue; // Skip x / 1.0 => x.
Reduction r = Reduce(graph()->NewNode(machine()->Float64Div(), p0,
@@ -1946,7 +1992,7 @@ TEST_F(MachineOperatorReducerTest, Float64InsertLowWord32WithConstant) {
EXPECT_THAT(
r.replacement(),
IsFloat64Constant(BitEq(bit_cast<double>(
- (bit_cast<uint64_t>(x) & V8_UINT64_C(0xFFFFFFFF00000000)) | y))));
+ (bit_cast<uint64_t>(x) & uint64_t{0xFFFFFFFF00000000}) | y))));
}
}
}
@@ -1965,7 +2011,7 @@ TEST_F(MachineOperatorReducerTest, Float64InsertHighWord32WithConstant) {
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsFloat64Constant(BitEq(bit_cast<double>(
- (bit_cast<uint64_t>(x) & V8_UINT64_C(0xFFFFFFFF)) |
+ (bit_cast<uint64_t>(x) & uint64_t{0xFFFFFFFF}) |
(static_cast<uint64_t>(y) << 32)))));
}
}
@@ -2110,7 +2156,7 @@ TEST_F(MachineOperatorReducerTest, StoreRepWord8WithWord32And) {
Node* const node =
graph()->NewNode(machine()->Store(rep), base, index,
graph()->NewNode(machine()->Word32And(), value,
- Uint32Constant(x | 0xffu)),
+ Uint32Constant(x | 0xFFu)),
effect, control);
Reduction r = Reduce(node);
@@ -2157,7 +2203,7 @@ TEST_F(MachineOperatorReducerTest, StoreRepWord16WithWord32And) {
Node* const node =
graph()->NewNode(machine()->Store(rep), base, index,
graph()->NewNode(machine()->Word32And(), value,
- Uint32Constant(x | 0xffffu)),
+ Uint32Constant(x | 0xFFFFu)),
effect, control);
Reduction r = Reduce(node);
diff --git a/deps/v8/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc b/deps/v8/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc
index 2f1e7e8be2..34faec9690 100644
--- a/deps/v8/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc
+++ b/deps/v8/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc
@@ -356,11 +356,11 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) {
// The available shift operand range is `0 <= imm < 32`, but we also test
// that immediates outside this range are handled properly (modulo-32).
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
uint32_t jnk = rng()->NextInt();
jnk = (lsb > 0) ? (jnk >> (32 - lsb)) : 0;
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Parameter(0), m.Int32Constant(msk)),
m.Int32Constant(shift)));
@@ -373,11 +373,11 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) {
}
}
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
uint32_t jnk = rng()->NextInt();
jnk = (lsb > 0) ? (jnk >> (32 - lsb)) : 0;
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Int32Constant(msk), m.Parameter(0)),
m.Int32Constant(shift)));
@@ -517,7 +517,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
// The available shift operand range is `0 <= imm < 32`, but we also test
// that immediates outside this range are handled properly (modulo-32).
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 31) {
uint32_t msk = (1 << width) - 1;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
@@ -533,7 +533,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
}
}
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 31) {
uint32_t msk = (1 << width) - 1;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
diff --git a/deps/v8/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc b/deps/v8/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
index 74af374379..c090e29321 100644
--- a/deps/v8/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
+++ b/deps/v8/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
@@ -400,11 +400,11 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) {
// The available shift operand range is `0 <= imm < 32`, but we also test
// that immediates outside this range are handled properly (modulo-32).
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
uint32_t jnk = rng()->NextInt();
jnk = (lsb > 0) ? (jnk >> (32 - lsb)) : 0;
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Parameter(0), m.Int32Constant(msk)),
m.Int32Constant(shift)));
@@ -417,11 +417,11 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) {
}
}
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
uint32_t jnk = rng()->NextInt();
jnk = (lsb > 0) ? (jnk >> (32 - lsb)) : 0;
- uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
+ uint32_t msk = ((0xFFFFFFFFu >> (32 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Int32Constant(msk), m.Parameter(0)),
m.Int32Constant(shift)));
@@ -440,12 +440,12 @@ TEST_F(InstructionSelectorTest, Word64ShrWithWord64AndWithImmediate) {
// The available shift operand range is `0 <= imm < 64`, but we also test
// that immediates outside this range are handled properly (modulo-64).
TRACED_FORRANGE(int32_t, shift, -64, 127) {
- int32_t lsb = shift & 0x3f;
+ int32_t lsb = shift & 0x3F;
TRACED_FORRANGE(int32_t, width, 1, 64 - lsb) {
uint64_t jnk = rng()->NextInt64();
jnk = (lsb > 0) ? (jnk >> (64 - lsb)) : 0;
uint64_t msk =
- ((V8_UINT64_C(0xffffffffffffffff) >> (64 - width)) << lsb) | jnk;
+ ((uint64_t{0xFFFFFFFFFFFFFFFF} >> (64 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(m.Word64Shr(m.Word64And(m.Parameter(0), m.Int64Constant(msk)),
m.Int64Constant(shift)));
@@ -458,12 +458,12 @@ TEST_F(InstructionSelectorTest, Word64ShrWithWord64AndWithImmediate) {
}
}
TRACED_FORRANGE(int32_t, shift, -64, 127) {
- int32_t lsb = shift & 0x3f;
+ int32_t lsb = shift & 0x3F;
TRACED_FORRANGE(int32_t, width, 1, 64 - lsb) {
uint64_t jnk = rng()->NextInt64();
jnk = (lsb > 0) ? (jnk >> (64 - lsb)) : 0;
uint64_t msk =
- ((V8_UINT64_C(0xffffffffffffffff) >> (64 - width)) << lsb) | jnk;
+ ((uint64_t{0xFFFFFFFFFFFFFFFF} >> (64 - width)) << lsb) | jnk;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(m.Word64Shr(m.Word64And(m.Int64Constant(msk), m.Parameter(0)),
m.Int64Constant(shift)));
@@ -649,7 +649,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
// The available shift operand range is `0 <= imm < 32`, but we also test
// that immediates outside this range are handled properly (modulo-32).
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 31) {
uint32_t msk = (1 << width) - 1;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
@@ -665,7 +665,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
}
}
TRACED_FORRANGE(int32_t, shift, -32, 63) {
- int32_t lsb = shift & 0x1f;
+ int32_t lsb = shift & 0x1F;
TRACED_FORRANGE(int32_t, width, 1, 31) {
uint32_t msk = (1 << width) - 1;
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
@@ -688,9 +688,9 @@ TEST_F(InstructionSelectorTest, Word64AndWithImmediateWithWord64Shr) {
// The available shift operand range is `0 <= imm < 64`, but we also test
// that immediates outside this range are handled properly (modulo-64).
TRACED_FORRANGE(int64_t, shift, -64, 127) {
- int64_t lsb = shift & 0x3f;
+ int64_t lsb = shift & 0x3F;
TRACED_FORRANGE(int64_t, width, 1, 63) {
- uint64_t msk = (V8_UINT64_C(1) << width) - 1;
+ uint64_t msk = (uint64_t{1} << width) - 1;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(m.Word64And(m.Word64Shr(m.Parameter(0), m.Int64Constant(shift)),
m.Int64Constant(msk)));
@@ -704,9 +704,9 @@ TEST_F(InstructionSelectorTest, Word64AndWithImmediateWithWord64Shr) {
}
}
TRACED_FORRANGE(int64_t, shift, -64, 127) {
- int64_t lsb = shift & 0x3f;
+ int64_t lsb = shift & 0x3F;
TRACED_FORRANGE(int64_t, width, 1, 63) {
- uint64_t msk = (V8_UINT64_C(1) << width) - 1;
+ uint64_t msk = (uint64_t{1} << width) - 1;
StreamBuilder m(this, MachineType::Int64(), MachineType::Int64());
m.Return(
m.Word64And(m.Int64Constant(msk),
diff --git a/deps/v8/test/unittests/compiler/node-test-utils.cc b/deps/v8/test/unittests/compiler/node-test-utils.cc
index 52fd02b0a6..8e7084d1b1 100644
--- a/deps/v8/test/unittests/compiler/node-test-utils.cc
+++ b/deps/v8/test/unittests/compiler/node-test-utils.cc
@@ -2182,6 +2182,7 @@ IS_UNOP_MATCHER(ObjectIsReceiver)
IS_UNOP_MATCHER(ObjectIsSmi)
IS_UNOP_MATCHER(ObjectIsUndetectable)
IS_UNOP_MATCHER(StringFromCharCode)
+IS_UNOP_MATCHER(StringLength)
IS_UNOP_MATCHER(Word32Clz)
IS_UNOP_MATCHER(Word32Ctz)
IS_UNOP_MATCHER(Word32Popcnt)
diff --git a/deps/v8/test/unittests/compiler/node-test-utils.h b/deps/v8/test/unittests/compiler/node-test-utils.h
index 81e471f30f..3ce6aba0f3 100644
--- a/deps/v8/test/unittests/compiler/node-test-utils.h
+++ b/deps/v8/test/unittests/compiler/node-test-utils.h
@@ -272,6 +272,7 @@ Matcher<Node*> IsNumberTan(const Matcher<Node*>& value_matcher);
Matcher<Node*> IsNumberTanh(const Matcher<Node*>& value_matcher);
Matcher<Node*> IsNumberTrunc(const Matcher<Node*>& value_matcher);
Matcher<Node*> IsStringFromCharCode(const Matcher<Node*>& value_matcher);
+Matcher<Node*> IsStringLength(const Matcher<Node*>& value_matcher);
Matcher<Node*> IsAllocate(const Matcher<Node*>& size_matcher,
const Matcher<Node*>& effect_matcher,
const Matcher<Node*>& control_matcher);
diff --git a/deps/v8/test/unittests/compiler/regalloc/move-optimizer-unittest.cc b/deps/v8/test/unittests/compiler/regalloc/move-optimizer-unittest.cc
index 0ad114241f..8b3e93fdce 100644
--- a/deps/v8/test/unittests/compiler/regalloc/move-optimizer-unittest.cc
+++ b/deps/v8/test/unittests/compiler/regalloc/move-optimizer-unittest.cc
@@ -94,8 +94,7 @@ class MoveOptimizerTest : public InstructionSequenceTest {
default:
break;
}
- CHECK(false);
- return InstructionOperand();
+ UNREACHABLE();
}
};
diff --git a/deps/v8/test/unittests/compiler/simplified-lowering-unittest.cc b/deps/v8/test/unittests/compiler/simplified-lowering-unittest.cc
new file mode 100644
index 0000000000..5f5afe54ef
--- /dev/null
+++ b/deps/v8/test/unittests/compiler/simplified-lowering-unittest.cc
@@ -0,0 +1,89 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/compiler/simplified-lowering.h"
+
+#include "src/compiler/compiler-source-position-table.h"
+#include "src/compiler/machine-operator.h"
+#include "src/compiler/simplified-operator.h"
+
+#include "test/unittests/compiler/graph-unittest.h"
+#include "test/unittests/compiler/node-test-utils.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+class SimplifiedLoweringTest : public GraphTest {
+ public:
+ explicit SimplifiedLoweringTest(int num_parameters = 1)
+ : GraphTest(num_parameters),
+ num_parameters_(num_parameters),
+ machine_(zone()),
+ javascript_(zone()),
+ simplified_(zone()),
+ jsgraph_(isolate(), graph(), common(), &javascript_, &simplified_,
+ &machine_) {}
+ ~SimplifiedLoweringTest() override {}
+
+ void LowerGraph(Node* node) {
+ // Make sure we always start with an empty graph.
+ graph()->SetStart(graph()->NewNode(common()->Start(num_parameters())));
+ graph()->SetEnd(graph()->NewNode(common()->End(1), graph()->start()));
+
+ // Return {node} directly, so that we can match it with
+ // "IsReturn(expected)".
+ Node* zero = graph()->NewNode(common()->NumberConstant(0));
+ Node* ret = graph()->NewNode(common()->Return(), zero, node,
+ graph()->start(), graph()->start());
+ NodeProperties::MergeControlToEnd(graph(), common(), ret);
+
+ {
+ // Simplified lowering needs to run w/o the typer decorator so make sure
+ // the object is not live at the same time.
+ Typer typer(isolate(), Typer::kNoFlags, graph());
+ typer.Run();
+ }
+
+ SimplifiedLowering lowering(jsgraph(), zone(), source_positions());
+ lowering.LowerAllNodes();
+ }
+
+ int num_parameters() const { return num_parameters_; }
+ JSGraph* jsgraph() { return &jsgraph_; }
+
+ private:
+ const int num_parameters_;
+ MachineOperatorBuilder machine_;
+ JSOperatorBuilder javascript_;
+ SimplifiedOperatorBuilder simplified_;
+ JSGraph jsgraph_;
+};
+
+const int kSmiValues[] = {Smi::kMinValue,
+ Smi::kMinValue + 1,
+ Smi::kMinValue + 2,
+ 3,
+ 2,
+ 1,
+ 0,
+ -1,
+ -2,
+ -3,
+ Smi::kMaxValue - 2,
+ Smi::kMaxValue - 1,
+ Smi::kMaxValue};
+
+TEST_F(SimplifiedLoweringTest, SmiConstantToIntPtrConstant) {
+ TRACED_FOREACH(int, x, kSmiValues) {
+ LowerGraph(jsgraph()->Constant(x));
+ intptr_t smi = bit_cast<intptr_t>(Smi::FromInt(x));
+ EXPECT_THAT(graph()->end()->InputAt(1),
+ IsReturn(IsIntPtrConstant(smi), start(), start()));
+ }
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
diff --git a/deps/v8/test/unittests/compiler/simplified-operator-reducer-unittest.cc b/deps/v8/test/unittests/compiler/simplified-operator-reducer-unittest.cc
index 2e67c0d4df..5dd7d84fbd 100644
--- a/deps/v8/test/unittests/compiler/simplified-operator-reducer-unittest.cc
+++ b/deps/v8/test/unittests/compiler/simplified-operator-reducer-unittest.cc
@@ -92,11 +92,10 @@ const int32_t kInt32Values[] = {
1062628108, 1087581664, 1488498068, 1534668023, 1661587028, 1696896187,
1866841746, 2032089723, 2147483647};
-
const double kNaNs[] = {-std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::quiet_NaN(),
- bit_cast<double>(V8_UINT64_C(0x7FFFFFFFFFFFFFFF)),
- bit_cast<double>(V8_UINT64_C(0xFFFFFFFFFFFFFFFF))};
+ bit_cast<double>(uint64_t{0x7FFFFFFFFFFFFFFF}),
+ bit_cast<double>(uint64_t{0xFFFFFFFFFFFFFFFF})};
const CheckForMinusZeroMode kCheckForMinusZeroModes[] = {
CheckForMinusZeroMode::kDontCheckForMinusZero,
@@ -357,10 +356,10 @@ TEST_F(SimplifiedOperatorReducerTest, CheckedFloat64ToInt32WithConstant) {
Node* effect = graph()->start();
Node* control = graph()->start();
TRACED_FOREACH(int32_t, n, kInt32Values) {
- Reduction r = Reduce(
- graph()->NewNode(simplified()->CheckedFloat64ToInt32(
- CheckForMinusZeroMode::kDontCheckForMinusZero),
- Float64Constant(n), effect, control));
+ Reduction r = Reduce(graph()->NewNode(
+ simplified()->CheckedFloat64ToInt32(
+ CheckForMinusZeroMode::kDontCheckForMinusZero, VectorSlotPair()),
+ Float64Constant(n), effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsInt32Constant(n));
}
@@ -416,8 +415,8 @@ TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithChangeInt31ToTaggedSigned) {
Node* control = graph()->start();
Node* value =
graph()->NewNode(simplified()->ChangeInt31ToTaggedSigned(), param0);
- Reduction reduction = Reduce(
- graph()->NewNode(simplified()->CheckSmi(), value, effect, control));
+ Reduction reduction = Reduce(graph()->NewNode(
+ simplified()->CheckSmi(VectorSlotPair()), value, effect, control));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(value, reduction.replacement());
}
@@ -426,8 +425,8 @@ TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithNumberConstant) {
Node* effect = graph()->start();
Node* control = graph()->start();
Node* value = NumberConstant(1.0);
- Reduction reduction = Reduce(
- graph()->NewNode(simplified()->CheckSmi(), value, effect, control));
+ Reduction reduction = Reduce(graph()->NewNode(
+ simplified()->CheckSmi(VectorSlotPair()), value, effect, control));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(value, reduction.replacement());
}
@@ -436,10 +435,10 @@ TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithCheckSmi) {
Node* param0 = Parameter(0);
Node* effect = graph()->start();
Node* control = graph()->start();
- Node* value = effect =
- graph()->NewNode(simplified()->CheckSmi(), param0, effect, control);
- Reduction reduction = Reduce(
- graph()->NewNode(simplified()->CheckSmi(), value, effect, control));
+ Node* value = effect = graph()->NewNode(
+ simplified()->CheckSmi(VectorSlotPair()), param0, effect, control);
+ Reduction reduction = Reduce(graph()->NewNode(
+ simplified()->CheckSmi(VectorSlotPair()), value, effect, control));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(value, reduction.replacement());
}
diff --git a/deps/v8/test/unittests/compiler/state-values-utils-unittest.cc b/deps/v8/test/unittests/compiler/state-values-utils-unittest.cc
index 388dd56247..d53e7d9462 100644
--- a/deps/v8/test/unittests/compiler/state-values-utils-unittest.cc
+++ b/deps/v8/test/unittests/compiler/state-values-utils-unittest.cc
@@ -45,10 +45,12 @@ TEST_F(StateValuesIteratorTest, SimpleIteration) {
TEST_F(StateValuesIteratorTest, EmptyIteration) {
NodeVector inputs(zone());
Node* state_values = StateValuesFromVector(&inputs);
+ bool empty = true;
for (auto node : StateValuesAccess(state_values)) {
USE(node);
- FAIL();
+ empty = false;
}
+ EXPECT_TRUE(empty);
}
diff --git a/deps/v8/test/unittests/compiler/typer-unittest.cc b/deps/v8/test/unittests/compiler/typer-unittest.cc
index 40f3efd2cf..44464b9476 100644
--- a/deps/v8/test/unittests/compiler/typer-unittest.cc
+++ b/deps/v8/test/unittests/compiler/typer-unittest.cc
@@ -297,8 +297,8 @@ class TyperTest : public TypedGraphTest {
namespace {
-int32_t shift_left(int32_t x, int32_t y) { return x << (y & 0x1f); }
-int32_t shift_right(int32_t x, int32_t y) { return x >> (y & 0x1f); }
+int32_t shift_left(int32_t x, int32_t y) { return x << (y & 0x1F); }
+int32_t shift_right(int32_t x, int32_t y) { return x >> (y & 0x1F); }
int32_t bit_or(int32_t x, int32_t y) { return x | y; }
int32_t bit_and(int32_t x, int32_t y) { return x & y; }
int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; }
diff --git a/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc b/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
index d1497392f9..031217b6b8 100644
--- a/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
+++ b/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
@@ -1519,12 +1519,11 @@ TEST_F(InstructionSelectorTest, Word64ShlWithChangeUint32ToUint64) {
}
}
-
-TEST_F(InstructionSelectorTest, Word32AndWith0xff) {
+TEST_F(InstructionSelectorTest, Word32AndWith0xFF) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const n = m.Word32And(p0, m.Int32Constant(0xff));
+ Node* const n = m.Word32And(p0, m.Int32Constant(0xFF));
m.Return(n);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1537,7 +1536,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xff) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const n = m.Word32And(m.Int32Constant(0xff), p0);
+ Node* const n = m.Word32And(m.Int32Constant(0xFF), p0);
m.Return(n);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1549,12 +1548,11 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xff) {
}
}
-
-TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
+TEST_F(InstructionSelectorTest, Word32AndWith0xFFFF) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const n = m.Word32And(p0, m.Int32Constant(0xffff));
+ Node* const n = m.Word32And(p0, m.Int32Constant(0xFFFF));
m.Return(n);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1567,7 +1565,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
{
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
- Node* const n = m.Word32And(m.Int32Constant(0xffff), p0);
+ Node* const n = m.Word32And(m.Int32Constant(0xFFFF), p0);
m.Return(n);
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1643,6 +1641,15 @@ TEST_F(InstructionSelectorTest, LoadAndWord64ShiftRight32) {
}
}
+TEST_F(InstructionSelectorTest, SpeculationFence) {
+ StreamBuilder m(this, MachineType::Int32());
+ m.SpeculationFence();
+ m.Return(m.Int32Constant(0));
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kLFence, s[0]->arch_opcode());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
diff --git a/deps/v8/test/unittests/counters-unittest.cc b/deps/v8/test/unittests/counters-unittest.cc
index d32d01060e..887ba54e01 100644
--- a/deps/v8/test/unittests/counters-unittest.cc
+++ b/deps/v8/test/unittests/counters-unittest.cc
@@ -4,6 +4,7 @@
#include <vector>
+#include "src/base/atomic-utils.h"
#include "src/base/platform/time.h"
#include "src/counters-inl.h"
#include "src/counters.h"
@@ -55,8 +56,9 @@ static base::TimeTicks RuntimeCallStatsTestNow() {
class RuntimeCallStatsTest : public TestWithNativeContext {
public:
RuntimeCallStatsTest() {
- FLAG_runtime_stats =
- v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE;
+ base::AsAtomic32::Relaxed_Store(
+ &FLAG_runtime_stats,
+ v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE);
// We need to set {time_} to a non-zero value since it would otherwise
// cause runtime call timers to think they are uninitialized.
Sleep(1);
@@ -67,7 +69,7 @@ class RuntimeCallStatsTest : public TestWithNativeContext {
// Disable RuntimeCallStats before tearing down the isolate to prevent
// printing the tests table. Comment the following line for debugging
// purposes.
- FLAG_runtime_stats = 0;
+ base::AsAtomic32::Relaxed_Store(&FLAG_runtime_stats, 0);
}
static void SetUpTestCase() {
@@ -89,22 +91,24 @@ class RuntimeCallStatsTest : public TestWithNativeContext {
// Print current RuntimeCallStats table. For debugging purposes.
void PrintStats() { stats()->Print(); }
- RuntimeCallStats::CounterId counter_id() {
- return &RuntimeCallStats::TestCounter1;
+ RuntimeCallCounterId counter_id() {
+ return RuntimeCallCounterId::kTestCounter1;
}
- RuntimeCallStats::CounterId counter_id2() {
- return &RuntimeCallStats::TestCounter2;
+ RuntimeCallCounterId counter_id2() {
+ return RuntimeCallCounterId::kTestCounter2;
}
- RuntimeCallStats::CounterId counter_id3() {
- return &RuntimeCallStats::TestCounter3;
+ RuntimeCallCounterId counter_id3() {
+ return RuntimeCallCounterId::kTestCounter3;
}
- RuntimeCallCounter* js_counter() { return &stats()->JS_Execution; }
- RuntimeCallCounter* counter() { return &(stats()->*counter_id()); }
- RuntimeCallCounter* counter2() { return &(stats()->*counter_id2()); }
- RuntimeCallCounter* counter3() { return &(stats()->*counter_id3()); }
+ RuntimeCallCounter* js_counter() {
+ return stats()->GetCounter(RuntimeCallCounterId::kJS_Execution);
+ }
+ RuntimeCallCounter* counter() { return stats()->GetCounter(counter_id()); }
+ RuntimeCallCounter* counter2() { return stats()->GetCounter(counter_id2()); }
+ RuntimeCallCounter* counter3() { return stats()->GetCounter(counter_id3()); }
void Sleep(int64_t microseconds) {
base::TimeDelta delta = base::TimeDelta::FromMicroseconds(microseconds);
@@ -300,7 +304,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimer) {
RuntimeCallTimer timer;
Sleep(50);
- RuntimeCallStats::Enter(stats(), &timer, counter_id());
+ stats()->Enter(&timer, counter_id());
EXPECT_EQ(counter(), timer.counter());
EXPECT_EQ(nullptr, timer.parent());
EXPECT_TRUE(timer.IsStarted());
@@ -308,7 +312,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimer) {
Sleep(100);
- RuntimeCallStats::Leave(stats(), &timer);
+ stats()->Leave(&timer);
Sleep(50);
EXPECT_FALSE(timer.IsStarted());
EXPECT_EQ(1, counter()->count());
@@ -319,7 +323,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerSubTimer) {
RuntimeCallTimer timer;
RuntimeCallTimer timer2;
- RuntimeCallStats::Enter(stats(), &timer, counter_id());
+ stats()->Enter(&timer, counter_id());
EXPECT_TRUE(timer.IsStarted());
EXPECT_FALSE(timer2.IsStarted());
EXPECT_EQ(counter(), timer.counter());
@@ -328,7 +332,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerSubTimer) {
Sleep(50);
- RuntimeCallStats::Enter(stats(), &timer2, counter_id2());
+ stats()->Enter(&timer2, counter_id2());
// timer 1 is paused, while timer 2 is active.
EXPECT_TRUE(timer2.IsStarted());
EXPECT_EQ(counter(), timer.counter());
@@ -338,7 +342,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerSubTimer) {
EXPECT_EQ(&timer2, stats()->current_timer());
Sleep(100);
- RuntimeCallStats::Leave(stats(), &timer2);
+ stats()->Leave(&timer2);
// The subtimer subtracts its time from the parent timer.
EXPECT_TRUE(timer.IsStarted());
@@ -351,7 +355,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerSubTimer) {
Sleep(100);
- RuntimeCallStats::Leave(stats(), &timer);
+ stats()->Leave(&timer);
EXPECT_FALSE(timer.IsStarted());
EXPECT_EQ(1, counter()->count());
EXPECT_EQ(1, counter2()->count());
@@ -364,13 +368,13 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerRecursive) {
RuntimeCallTimer timer;
RuntimeCallTimer timer2;
- RuntimeCallStats::Enter(stats(), &timer, counter_id());
+ stats()->Enter(&timer, counter_id());
EXPECT_EQ(counter(), timer.counter());
EXPECT_EQ(nullptr, timer.parent());
EXPECT_TRUE(timer.IsStarted());
EXPECT_EQ(&timer, stats()->current_timer());
- RuntimeCallStats::Enter(stats(), &timer2, counter_id());
+ stats()->Enter(&timer2, counter_id());
EXPECT_EQ(counter(), timer2.counter());
EXPECT_EQ(nullptr, timer.parent());
EXPECT_EQ(&timer, timer2.parent());
@@ -379,7 +383,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerRecursive) {
Sleep(50);
- RuntimeCallStats::Leave(stats(), &timer2);
+ stats()->Leave(&timer2);
EXPECT_EQ(nullptr, timer.parent());
EXPECT_FALSE(timer2.IsStarted());
EXPECT_TRUE(timer.IsStarted());
@@ -388,7 +392,7 @@ TEST_F(RuntimeCallStatsTest, RuntimeCallTimerRecursive) {
Sleep(100);
- RuntimeCallStats::Leave(stats(), &timer);
+ stats()->Leave(&timer);
EXPECT_FALSE(timer.IsStarted());
EXPECT_EQ(2, counter()->count());
EXPECT_EQ(150, counter()->time().InMicroseconds());
@@ -439,7 +443,8 @@ TEST_F(RuntimeCallStatsTest, RenameTimer) {
RuntimeCallTimerScope scope(stats(), counter_id());
Sleep(100);
}
- CHANGE_CURRENT_RUNTIME_COUNTER(stats(), TestCounter2);
+ CHANGE_CURRENT_RUNTIME_COUNTER(stats(),
+ RuntimeCallCounterId::kTestCounter2);
EXPECT_EQ(1, counter()->count());
EXPECT_EQ(0, counter2()->count());
EXPECT_EQ(100, counter()->time().InMicroseconds());
@@ -558,7 +563,8 @@ TEST_F(RuntimeCallStatsTest, NestedScopes) {
}
TEST_F(RuntimeCallStatsTest, BasicJavaScript) {
- RuntimeCallCounter* counter = &stats()->JS_Execution;
+ RuntimeCallCounter* counter =
+ stats()->GetCounter(RuntimeCallCounterId::kJS_Execution);
EXPECT_EQ(0, counter->count());
EXPECT_EQ(0, counter->time().InMicroseconds());
@@ -579,8 +585,10 @@ TEST_F(RuntimeCallStatsTest, BasicJavaScript) {
}
TEST_F(RuntimeCallStatsTest, FunctionLengthGetter) {
- RuntimeCallCounter* getter_counter = &stats()->FunctionLengthGetter;
- RuntimeCallCounter* js_counter = &stats()->JS_Execution;
+ RuntimeCallCounter* getter_counter =
+ stats()->GetCounter(RuntimeCallCounterId::kFunctionLengthGetter);
+ RuntimeCallCounter* js_counter =
+ stats()->GetCounter(RuntimeCallCounterId::kJS_Execution);
EXPECT_EQ(0, getter_counter->count());
EXPECT_EQ(0, js_counter->count());
EXPECT_EQ(0, getter_counter->time().InMicroseconds());
diff --git a/deps/v8/test/unittests/eh-frame-iterator-unittest.cc b/deps/v8/test/unittests/eh-frame-iterator-unittest.cc
index b228cc9caf..fff38209c5 100644
--- a/deps/v8/test/unittests/eh-frame-iterator-unittest.cc
+++ b/deps/v8/test/unittests/eh-frame-iterator-unittest.cc
@@ -20,40 +20,40 @@ class EhFrameIteratorTest : public testing::Test {};
TEST_F(EhFrameIteratorTest, Values) {
// Assuming little endian.
- static const byte kEncoded[] = {0xde, 0xc0, 0xad, 0xde, 0xef, 0xbe, 0xff};
+ static const byte kEncoded[] = {0xDE, 0xC0, 0xAD, 0xDE, 0xEF, 0xBE, 0xFF};
EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
- EXPECT_EQ(0xdeadc0de, iterator.GetNextUInt32());
- EXPECT_EQ(0xbeef, iterator.GetNextUInt16());
- EXPECT_EQ(0xff, iterator.GetNextByte());
+ EXPECT_EQ(0xDEADC0DE, iterator.GetNextUInt32());
+ EXPECT_EQ(0xBEEF, iterator.GetNextUInt16());
+ EXPECT_EQ(0xFF, iterator.GetNextByte());
EXPECT_TRUE(iterator.Done());
}
TEST_F(EhFrameIteratorTest, Skip) {
- static const byte kEncoded[] = {0xde, 0xad, 0xc0, 0xde};
+ static const byte kEncoded[] = {0xDE, 0xAD, 0xC0, 0xDE};
EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
iterator.Skip(2);
EXPECT_EQ(2, iterator.GetCurrentOffset());
- EXPECT_EQ(0xc0, iterator.GetNextByte());
+ EXPECT_EQ(0xC0, iterator.GetNextByte());
iterator.Skip(1);
EXPECT_TRUE(iterator.Done());
}
TEST_F(EhFrameIteratorTest, ULEB128Decoding) {
- static const byte kEncoded[] = {0xe5, 0x8e, 0x26};
+ static const byte kEncoded[] = {0xE5, 0x8E, 0x26};
EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
EXPECT_EQ(624485u, iterator.GetNextULeb128());
EXPECT_TRUE(iterator.Done());
}
TEST_F(EhFrameIteratorTest, SLEB128DecodingPositive) {
- static const byte kEncoded[] = {0xe5, 0x8e, 0x26};
+ static const byte kEncoded[] = {0xE5, 0x8E, 0x26};
EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
EXPECT_EQ(624485, iterator.GetNextSLeb128());
EXPECT_TRUE(iterator.Done());
}
TEST_F(EhFrameIteratorTest, SLEB128DecodingNegative) {
- static const byte kEncoded[] = {0x9b, 0xf1, 0x59};
+ static const byte kEncoded[] = {0x9B, 0xF1, 0x59};
EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
EXPECT_EQ(-624485, iterator.GetNextSLeb128());
EXPECT_TRUE(iterator.Done());
diff --git a/deps/v8/test/unittests/eh-frame-writer-unittest.cc b/deps/v8/test/unittests/eh-frame-writer-unittest.cc
index 0213835e9f..0846fda2f4 100644
--- a/deps/v8/test/unittests/eh-frame-writer-unittest.cc
+++ b/deps/v8/test/unittests/eh-frame-writer-unittest.cc
@@ -47,7 +47,7 @@ TEST_F(EhFrameWriterTest, Alignment) {
}
TEST_F(EhFrameWriterTest, FDEHeader) {
- static const int kProcedureSize = 0x5678abcd;
+ static const int kProcedureSize = 0x5678ABCD;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -76,7 +76,7 @@ TEST_F(EhFrameWriterTest, FDEHeader) {
}
TEST_F(EhFrameWriterTest, SetOffset) {
- static const uint32_t kOffset = 0x0badc0de;
+ static const uint32_t kOffset = 0x0BADC0DE;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -132,7 +132,7 @@ TEST_F(EhFrameWriterTest, SetRegister) {
TEST_F(EhFrameWriterTest, SetRegisterAndOffset) {
Register test_register = Register::from_code(kTestRegisterCode);
- static const uint32_t kOffset = 0x0badc0de;
+ static const uint32_t kOffset = 0x0BADC0DE;
EhFrameWriter writer(zone());
writer.Initialize();
@@ -199,7 +199,7 @@ TEST_F(EhFrameWriterTest, PcOffsetEncoding8bit) {
TEST_F(EhFrameWriterTest, PcOffsetEncoding8bitDelta) {
static const int kFirstOffset = 0x10;
static const int kSecondOffset = 0x70;
- static const int kThirdOffset = 0xb5;
+ static const int kThirdOffset = 0xB5;
EhFrameWriter writer(zone());
writer.Initialize();
diff --git a/deps/v8/test/unittests/heap/gc-tracer-unittest.cc b/deps/v8/test/unittests/heap/gc-tracer-unittest.cc
index e7702fda75..e4e9260881 100644
--- a/deps/v8/test/unittests/heap/gc-tracer-unittest.cc
+++ b/deps/v8/test/unittests/heap/gc-tracer-unittest.cc
@@ -5,6 +5,7 @@
#include <cmath>
#include <limits>
+#include "src/base/platform/platform.h"
#include "src/globals.h"
#include "src/heap/gc-tracer.h"
#include "src/isolate.h"
@@ -294,5 +295,125 @@ TEST_F(GCTracerTest, IncrementalMarkingSpeed) {
tracer->IncrementalMarkingSpeedInBytesPerMillisecond()));
}
+TEST_F(GCTracerTest, BackgroundScavengerScope) {
+ GCTracer* tracer = i_isolate()->heap()->tracer();
+ tracer->ResetForTesting();
+ tracer->Start(SCAVENGER, GarbageCollectionReason::kTesting,
+ "collector unittest");
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::SCAVENGER_BACKGROUND_SCAVENGE_PARALLEL, 10,
+ nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::SCAVENGER_BACKGROUND_SCAVENGE_PARALLEL, 1,
+ nullptr);
+ tracer->Stop(SCAVENGER);
+ EXPECT_DOUBLE_EQ(
+ 11, tracer->current_
+ .scopes[GCTracer::Scope::SCAVENGER_BACKGROUND_SCAVENGE_PARALLEL]);
+}
+
+TEST_F(GCTracerTest, BackgroundMinorMCScope) {
+ GCTracer* tracer = i_isolate()->heap()->tracer();
+ tracer->ResetForTesting();
+ tracer->Start(MINOR_MARK_COMPACTOR, GarbageCollectionReason::kTesting,
+ "collector unittest");
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MINOR_MC_BACKGROUND_MARKING, 10, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MINOR_MC_BACKGROUND_MARKING, 1, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MINOR_MC_BACKGROUND_EVACUATE_COPY, 20,
+ nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MINOR_MC_BACKGROUND_EVACUATE_COPY, 2, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MINOR_MC_BACKGROUND_EVACUATE_UPDATE_POINTERS,
+ 30, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MINOR_MC_BACKGROUND_EVACUATE_UPDATE_POINTERS,
+ 3, nullptr);
+ tracer->Stop(MINOR_MARK_COMPACTOR);
+ EXPECT_DOUBLE_EQ(
+ 11,
+ tracer->current_.scopes[GCTracer::Scope::MINOR_MC_BACKGROUND_MARKING]);
+ EXPECT_DOUBLE_EQ(
+ 22, tracer->current_
+ .scopes[GCTracer::Scope::MINOR_MC_BACKGROUND_EVACUATE_COPY]);
+ EXPECT_DOUBLE_EQ(
+ 33, tracer->current_.scopes
+ [GCTracer::Scope::MINOR_MC_BACKGROUND_EVACUATE_UPDATE_POINTERS]);
+}
+
+TEST_F(GCTracerTest, BackgroundMajorMCScope) {
+ GCTracer* tracer = i_isolate()->heap()->tracer();
+ tracer->ResetForTesting();
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_MARKING, 100, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_SWEEPING, 200, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_MARKING, 10, nullptr);
+ // Scavenger should not affect the major mark-compact scopes.
+ tracer->Start(SCAVENGER, GarbageCollectionReason::kTesting,
+ "collector unittest");
+ tracer->Stop(SCAVENGER);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_SWEEPING, 20, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_MARKING, 1, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_SWEEPING, 2, nullptr);
+ tracer->Start(MARK_COMPACTOR, GarbageCollectionReason::kTesting,
+ "collector unittest");
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_EVACUATE_COPY, 30, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_EVACUATE_COPY, 3, nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_EVACUATE_UPDATE_POINTERS, 40,
+ nullptr);
+ tracer->AddBackgroundScopeSample(
+ GCTracer::BackgroundScope::MC_BACKGROUND_EVACUATE_UPDATE_POINTERS, 4,
+ nullptr);
+ tracer->Stop(MARK_COMPACTOR);
+ EXPECT_DOUBLE_EQ(
+ 111, tracer->current_.scopes[GCTracer::Scope::MC_BACKGROUND_MARKING]);
+ EXPECT_DOUBLE_EQ(
+ 222, tracer->current_.scopes[GCTracer::Scope::MC_BACKGROUND_SWEEPING]);
+ EXPECT_DOUBLE_EQ(
+ 33,
+ tracer->current_.scopes[GCTracer::Scope::MC_BACKGROUND_EVACUATE_COPY]);
+ EXPECT_DOUBLE_EQ(
+ 44, tracer->current_
+ .scopes[GCTracer::Scope::MC_BACKGROUND_EVACUATE_UPDATE_POINTERS]);
+}
+
+class ThreadWithBackgroundScope final : public base::Thread {
+ public:
+ explicit ThreadWithBackgroundScope(GCTracer* tracer)
+ : Thread(Options("ThreadWithBackgroundScope")), tracer_(tracer) {}
+ void Run() override {
+ GCTracer::BackgroundScope scope(
+ tracer_, GCTracer::BackgroundScope::MC_BACKGROUND_MARKING);
+ }
+
+ private:
+ GCTracer* tracer_;
+};
+
+TEST_F(GCTracerTest, MultithreadedBackgroundScope) {
+ GCTracer* tracer = i_isolate()->heap()->tracer();
+ ThreadWithBackgroundScope thread1(tracer);
+ ThreadWithBackgroundScope thread2(tracer);
+ tracer->ResetForTesting();
+ thread1.Start();
+ thread2.Start();
+ tracer->FetchBackgroundMarkCompactCounters();
+ thread1.Join();
+ thread2.Join();
+ tracer->FetchBackgroundMarkCompactCounters();
+ EXPECT_LE(0, tracer->current_.scopes[GCTracer::Scope::MC_BACKGROUND_MARKING]);
+}
+
} // namespace internal
} // namespace v8
diff --git a/deps/v8/test/unittests/heap/heap-unittest.cc b/deps/v8/test/unittests/heap/heap-unittest.cc
index 3b7b610c8c..c63aa2b724 100644
--- a/deps/v8/test/unittests/heap/heap-unittest.cc
+++ b/deps/v8/test/unittests/heap/heap-unittest.cc
@@ -99,7 +99,7 @@ TEST_F(HeapTest, ASLR) {
}
if (hints.size() == 1) {
EXPECT_TRUE((*hints.begin()) == nullptr);
- EXPECT_TRUE(base::OS::GetRandomMmapAddr() == nullptr);
+ EXPECT_TRUE(i::GetRandomMmapAddr() == nullptr);
} else {
// It is unlikely that 1000 random samples will collide to less then 500
// values.
diff --git a/deps/v8/test/unittests/heap/marking-unittest.cc b/deps/v8/test/unittests/heap/marking-unittest.cc
index 9dd432c175..0553dc0ea5 100644
--- a/deps/v8/test/unittests/heap/marking-unittest.cc
+++ b/deps/v8/test/unittests/heap/marking-unittest.cc
@@ -63,7 +63,7 @@ TEST(Marking, SetAndClearRange) {
calloc(Bitmap::kSize / kPointerSize, kPointerSize));
for (int i = 0; i < 3; i++) {
bitmap->SetRange(i, Bitmap::kBitsPerCell + i);
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0xffffffffu << i);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0xFFFFFFFFu << i);
CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[1], (1u << i) - 1);
bitmap->ClearRange(i, Bitmap::kBitsPerCell + i);
CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0x0u);
@@ -77,9 +77,9 @@ TEST(Marking, ClearMultipleRanges) {
calloc(Bitmap::kSize / kPointerSize, kPointerSize));
CHECK(bitmap->AllBitsClearInRange(0, Bitmap::kBitsPerCell * 3));
bitmap->SetRange(0, Bitmap::kBitsPerCell * 3);
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0xffffffffu);
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[1], 0xffffffffu);
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[2], 0xffffffffu);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0xFFFFFFFFu);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[1], 0xFFFFFFFFu);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[2], 0xFFFFFFFFu);
CHECK(bitmap->AllBitsSetInRange(0, Bitmap::kBitsPerCell * 3));
bitmap->ClearRange(Bitmap::kBitsPerCell / 2, Bitmap::kBitsPerCell);
bitmap->ClearRange(Bitmap::kBitsPerCell,
@@ -87,17 +87,17 @@ TEST(Marking, ClearMultipleRanges) {
bitmap->ClearRange(Bitmap::kBitsPerCell * 2 + 8,
Bitmap::kBitsPerCell * 2 + 16);
bitmap->ClearRange(Bitmap::kBitsPerCell * 2 + 24, Bitmap::kBitsPerCell * 3);
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0xffffu);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[0], 0xFFFFu);
CHECK(bitmap->AllBitsSetInRange(0, Bitmap::kBitsPerCell / 2));
CHECK(bitmap->AllBitsClearInRange(Bitmap::kBitsPerCell / 2,
Bitmap::kBitsPerCell));
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[1], 0xffff0000u);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[1], 0xFFFF0000u);
CHECK(
bitmap->AllBitsSetInRange(Bitmap::kBitsPerCell + Bitmap::kBitsPerCell / 2,
2 * Bitmap::kBitsPerCell));
CHECK(bitmap->AllBitsClearInRange(
Bitmap::kBitsPerCell, Bitmap::kBitsPerCell + Bitmap::kBitsPerCell / 2));
- CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[2], 0xff00ffu);
+ CHECK_EQ(reinterpret_cast<uint32_t*>(bitmap)[2], 0xFF00FFu);
CHECK(bitmap->AllBitsSetInRange(2 * Bitmap::kBitsPerCell,
2 * Bitmap::kBitsPerCell + 8));
CHECK(bitmap->AllBitsClearInRange(2 * Bitmap::kBitsPerCell + 24,
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index bbc9e565c9..26fcd1937b 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -13,6 +13,7 @@
#include "src/interpreter/bytecode-label.h"
#include "src/interpreter/bytecode-register-allocator.h"
#include "src/objects-inl.h"
+#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
@@ -41,8 +42,11 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
Register reg(0);
Register other(reg.index() + 1);
Register wide(128);
- RegisterList reg_list(0, 10);
- RegisterList empty, single(0, 1), pair(0, 2), triple(0, 3);
+ RegisterList empty;
+ RegisterList single = BytecodeUtils::NewRegisterList(0, 1);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
+ RegisterList reg_list = BytecodeUtils::NewRegisterList(0, 10);
// Emit argument creation operations.
builder.CreateArguments(CreateArgumentsType::kMappedArguments)
@@ -89,8 +93,6 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
feedback_spec.AddLoadGlobalICSlot(INSIDE_TYPEOF);
FeedbackSlot sloppy_store_global_slot =
feedback_spec.AddStoreGlobalICSlot(LanguageMode::kSloppy);
- FeedbackSlot strict_store_global_slot =
- feedback_spec.AddStoreGlobalICSlot(LanguageMode::kStrict);
FeedbackSlot load_slot = feedback_spec.AddLoadICSlot();
FeedbackSlot keyed_load_slot = feedback_spec.AddKeyedLoadICSlot();
FeedbackSlot sloppy_store_slot =
@@ -109,10 +111,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.LoadGlobal(name, load_global_slot.ToInt(), TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, load_global_typeof_slot.ToInt(),
TypeofMode::INSIDE_TYPEOF)
- .StoreGlobal(name, sloppy_store_global_slot.ToInt(),
- LanguageMode::kSloppy)
- .StoreGlobal(name, strict_store_global_slot.ToInt(),
- LanguageMode::kStrict);
+ .StoreGlobal(name, sloppy_store_global_slot.ToInt());
// Emit context operations.
builder.PushContext(reg)
@@ -387,7 +386,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Emit generator operations.
builder.SuspendGenerator(reg, reg_list, 0)
.RestoreGeneratorState(reg)
- .RestoreGeneratorRegisters(reg, reg_list);
+ .ResumeGenerator(reg, reg, reg_list);
// Intrinsics handled by the interpreter.
builder.CallRuntime(Runtime::kInlineIsArray, reg_list);
@@ -398,7 +397,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Emit abort bytecode.
{
BytecodeLabel after;
- builder.Abort(kGenerator).Bind(&after);
+ builder.Abort(AbortReason::kOperandIsASmi).Bind(&after);
}
// Insert dummy ops to force longer jumps.
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
index ee5d8803f7..f7c89e2869 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
@@ -7,6 +7,7 @@
#include "src/interpreter/bytecode-array-builder.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/objects-inl.h"
+#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
@@ -33,8 +34,8 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc
index 12cd55c2a9..8d2cd4c501 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc
@@ -7,6 +7,7 @@
#include "src/interpreter/bytecode-array-builder.h"
#include "src/interpreter/bytecode-array-random-iterator.h"
#include "src/objects-inl.h"
+#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
@@ -33,8 +34,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
@@ -87,8 +88,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
@@ -141,8 +142,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
@@ -199,8 +200,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
@@ -258,8 +259,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
@@ -443,8 +444,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
@@ -722,8 +723,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
Smi* smi_1 = Smi::FromInt(-65536);
Register reg_0(0);
Register reg_1(1);
- RegisterList pair(0, 2);
- RegisterList triple(0, 3);
+ RegisterList pair = BytecodeUtils::NewRegisterList(0, 2);
+ RegisterList triple = BytecodeUtils::NewRegisterList(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
diff --git a/deps/v8/test/unittests/interpreter/bytecode-node-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-node-unittest.cc
index af793ebcfe..8b8cae50ea 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-node-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-node-unittest.cc
@@ -52,7 +52,7 @@ TEST_F(BytecodeNodeTest, Constructor4) {
}
TEST_F(BytecodeNodeTest, Constructor5) {
- uint32_t operands[] = {0x71, 0xa5, 0x5a, 0xfc};
+ uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
CHECK_EQ(node.operand_count(), 4);
@@ -65,7 +65,7 @@ TEST_F(BytecodeNodeTest, Constructor5) {
}
TEST_F(BytecodeNodeTest, Equality) {
- uint32_t operands[] = {0x71, 0xa5, 0x5a, 0xfc};
+ uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
CHECK_EQ(node, node);
@@ -75,7 +75,7 @@ TEST_F(BytecodeNodeTest, Equality) {
}
TEST_F(BytecodeNodeTest, EqualityWithSourceInfo) {
- uint32_t operands[] = {0x71, 0xa5, 0x5a, 0xfc};
+ uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeSourceInfo first_source_info(3, true);
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3], first_source_info);
@@ -87,7 +87,7 @@ TEST_F(BytecodeNodeTest, EqualityWithSourceInfo) {
}
TEST_F(BytecodeNodeTest, NoEqualityWithDifferentSourceInfo) {
- uint32_t operands[] = {0x71, 0xa5, 0x5a, 0xfc};
+ uint32_t operands[] = {0x71, 0xA5, 0x5A, 0xFC};
BytecodeSourceInfo source_info(77, true);
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3], source_info);
diff --git a/deps/v8/test/unittests/interpreter/bytecode-register-optimizer-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-register-optimizer-unittest.cc
index 8c7b363ebf..9e3ceb140f 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-register-optimizer-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-register-optimizer-unittest.cc
@@ -6,6 +6,7 @@
#include "src/interpreter/bytecode-label.h"
#include "src/interpreter/bytecode-register-optimizer.h"
+#include "test/unittests/interpreter/bytecode-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
@@ -169,8 +170,8 @@ TEST_F(BytecodeRegisterOptimizerTest, SingleTemporaryNotMaterializedForInput) {
CHECK_EQ(write_count(), 0u);
Register reg = optimizer()->GetInputRegister(temp0);
- RegisterList reg_list =
- optimizer()->GetInputRegisterList(RegisterList(temp0.index(), 1));
+ RegisterList reg_list = optimizer()->GetInputRegisterList(
+ BytecodeUtils::NewRegisterList(temp0.index(), 1));
CHECK_EQ(write_count(), 0u);
CHECK_EQ(parameter.index(), reg.index());
CHECK_EQ(parameter.index(), reg_list.first_register().index());
@@ -189,8 +190,8 @@ TEST_F(BytecodeRegisterOptimizerTest, RangeOfTemporariesMaterializedForInput) {
optimizer()
->PrepareForBytecode<Bytecode::kCallJSRuntime, AccumulatorUse::kWrite>();
- RegisterList reg_list =
- optimizer()->GetInputRegisterList(RegisterList(temp0.index(), 2));
+ RegisterList reg_list = optimizer()->GetInputRegisterList(
+ BytecodeUtils::NewRegisterList(temp0.index(), 2));
CHECK_EQ(temp0.index(), reg_list.first_register().index());
CHECK_EQ(2, reg_list.register_count());
CHECK_EQ(write_count(), 2u);
diff --git a/deps/v8/test/unittests/interpreter/bytecode-utils.h b/deps/v8/test/unittests/interpreter/bytecode-utils.h
index 9a2cee3014..401884559e 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-utils.h
+++ b/deps/v8/test/unittests/interpreter/bytecode-utils.h
@@ -6,6 +6,11 @@
#define V8_UNITTESTS_INTERPRETER_BYTECODE_UTILS_H_
#include "src/frames.h"
+#include "src/interpreter/bytecode-register.h"
+
+namespace v8 {
+namespace internal {
+namespace interpreter {
#if V8_TARGET_LITTLE_ENDIAN
@@ -33,4 +38,19 @@
#define R16(i) U16(REG_OPERAND(i))
#define R32(i) U32(REG_OPERAND(i))
+class BytecodeUtils {
+ public:
+ // Expose raw RegisterList construction to tests.
+ static RegisterList NewRegisterList(int first_reg_index, int register_count) {
+ return RegisterList(first_reg_index, register_count);
+ }
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeUtils);
+};
+
+} // namespace interpreter
+} // namespace internal
+} // namespace v8
+
#endif // V8_UNITTESTS_INTERPRETER_BYTECODE_UTILS_H_
diff --git a/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc b/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc
index 88acf680f5..03d9397c7f 100644
--- a/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc
@@ -417,7 +417,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, StoreRegister) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerTestState state(this, bytecode);
InterpreterAssemblerForTest m(&state, bytecode);
- Node* store_value = m.Int32Constant(0xdeadbeef);
+ Node* store_value = m.Int32Constant(0xDEADBEEF);
Node* reg_index_node = m.Parameter(0);
Node* store_reg_node = m.StoreRegister(store_value, reg_index_node);
EXPECT_THAT(store_reg_node,
@@ -471,7 +471,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerTestState state(this, bytecode);
InterpreterAssemblerForTest m(&state, bytecode);
- Node* object = m.IntPtrConstant(0xdeadbeef);
+ Node* object = m.IntPtrConstant(0xDEADBEEF);
int offset = 16;
Node* load_field = m.LoadObjectField(object, offset);
EXPECT_THAT(load_field,
diff --git a/deps/v8/test/unittests/object-unittest.cc b/deps/v8/test/unittests/object-unittest.cc
index 47772a0f20..4cb113a644 100644
--- a/deps/v8/test/unittests/object-unittest.cc
+++ b/deps/v8/test/unittests/object-unittest.cc
@@ -61,7 +61,7 @@ TEST(Object, InstanceTypeListOrder) {
current_type = InstanceType::type; \
current = static_cast<int>(current_type); \
if (current > static_cast<int>(LAST_NAME_TYPE)) { \
- EXPECT_EQ(last + 1, current); \
+ EXPECT_LE(last + 1, current); \
} \
EXPECT_LT(last, current) << " INSTANCE_TYPE_LIST is not ordered: " \
<< "last = " << static_cast<InstanceType>(last) \
@@ -73,7 +73,7 @@ TEST(Object, InstanceTypeListOrder) {
}
TEST(Object, StructListOrder) {
- int current = static_cast<int>(InstanceType::ACCESSOR_INFO_TYPE);
+ int current = static_cast<int>(InstanceType::ACCESS_CHECK_INFO_TYPE);
int last = current - 1;
ASSERT_LT(0, last);
InstanceType current_type = static_cast<InstanceType>(current);
diff --git a/deps/v8/test/unittests/parser/ast-value-unittest.cc b/deps/v8/test/unittests/parser/ast-value-unittest.cc
index 2b7a227e0f..72e35a43a0 100644
--- a/deps/v8/test/unittests/parser/ast-value-unittest.cc
+++ b/deps/v8/test/unittests/parser/ast-value-unittest.cc
@@ -41,10 +41,10 @@ TEST_F(AstValueTest, BigIntToBooleanIsTrue) {
EXPECT_TRUE(NewBigInt("3")->ToBooleanIsTrue());
EXPECT_TRUE(NewBigInt("0b1")->ToBooleanIsTrue());
EXPECT_TRUE(NewBigInt("0o6")->ToBooleanIsTrue());
- EXPECT_TRUE(NewBigInt("0xa")->ToBooleanIsTrue());
+ EXPECT_TRUE(NewBigInt("0xA")->ToBooleanIsTrue());
EXPECT_TRUE(NewBigInt("0b0000001")->ToBooleanIsTrue());
EXPECT_TRUE(NewBigInt("0o00005000")->ToBooleanIsTrue());
- EXPECT_TRUE(NewBigInt("0x0000d00c0")->ToBooleanIsTrue());
+ EXPECT_TRUE(NewBigInt("0x0000D00C0")->ToBooleanIsTrue());
}
} // namespace internal
diff --git a/deps/v8/test/unittests/testcfg.py b/deps/v8/test/unittests/testcfg.py
new file mode 100644
index 0000000000..9b18743566
--- /dev/null
+++ b/deps/v8/test/unittests/testcfg.py
@@ -0,0 +1,70 @@
+# Copyright 2017 the V8 project authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+
+from testrunner.local import command
+from testrunner.local import utils
+from testrunner.local import testsuite
+from testrunner.objects import testcase
+
+
+class TestSuite(testsuite.TestSuite):
+ def ListTests(self, context):
+ shell = os.path.abspath(os.path.join(context.shell_dir, self.name))
+ if utils.IsWindows():
+ shell += ".exe"
+
+ output = None
+ for i in xrange(3): # Try 3 times in case of errors.
+ cmd = command.Command(
+ cmd_prefix=context.command_prefix,
+ shell=shell,
+ args=['--gtest_list_tests'] + context.extra_flags)
+ output = cmd.execute()
+ if output.exit_code == 0:
+ break
+ print "Test executable failed to list the tests (try %d).\n\nCmd:" % i
+ print cmd
+ print "\nStdout:"
+ print output.stdout
+ print "\nStderr:"
+ print output.stderr
+ print "\nExit code: %d" % output.exit_code
+ else:
+ raise Exception("Test executable failed to list the tests.")
+
+ tests = []
+ test_case = ''
+ for line in output.stdout.splitlines():
+ test_desc = line.strip().split()[0]
+ if test_desc.endswith('.'):
+ test_case = test_desc
+ elif test_case and test_desc:
+ test_path = test_case + test_desc
+ tests.append(self._create_test(test_path))
+ tests.sort(key=lambda t: t.path)
+ return tests
+
+ def _test_class(self):
+ return TestCase
+
+ def _LegacyVariantsGeneratorFactory(self):
+ return testsuite.StandardLegacyVariantsGenerator
+
+
+class TestCase(testcase.TestCase):
+ def _get_suite_flags(self, ctx):
+ return (
+ ["--gtest_filter=" + self.path] +
+ ["--gtest_random_seed=%s" % ctx.random_seed] +
+ ["--gtest_print_time=0"]
+ )
+
+ def get_shell(self):
+ return self.suite.name
+
+
+def GetSuite(name, root):
+ return TestSuite(name, root)
diff --git a/deps/v8/test/unittests/unicode-unittest.cc b/deps/v8/test/unittests/unicode-unittest.cc
index c4df42c1c6..e5ccaca7b1 100644
--- a/deps/v8/test/unittests/unicode-unittest.cc
+++ b/deps/v8/test/unittests/unicode-unittest.cc
@@ -37,13 +37,15 @@ void DecodeNormally(const std::vector<byte>& bytes,
void DecodeIncrementally(const std::vector<byte>& bytes,
std::vector<unibrow::uchar>* output) {
unibrow::Utf8::Utf8IncrementalBuffer buffer = 0;
- for (auto b : bytes) {
- unibrow::uchar result = unibrow::Utf8::ValueOfIncremental(b, &buffer);
+ unibrow::Utf8::State state = unibrow::Utf8::State::kAccept;
+ for (size_t i = 0; i < bytes.size();) {
+ unibrow::uchar result =
+ unibrow::Utf8::ValueOfIncremental(bytes[i], &i, &state, &buffer);
if (result != unibrow::Utf8::kIncomplete) {
output->push_back(result);
}
}
- unibrow::uchar result = unibrow::Utf8::ValueOfIncrementalFinish(&buffer);
+ unibrow::uchar result = unibrow::Utf8::ValueOfIncrementalFinish(&state);
if (result != unibrow::Utf8::kBufferEmpty) {
output->push_back(result);
}
@@ -72,344 +74,344 @@ TEST(UnicodeTest, IncrementalUTF8DecodingVsNonIncrementalUtf8Decoding) {
TestCase data[] = {
// Correct UTF-8 text.
- {{0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5},
- {0x3ba, 0x1f79, 0x3c3, 0x3bc, 0x3b5}},
+ {{0xCE, 0xBA, 0xE1, 0xBD, 0xB9, 0xCF, 0x83, 0xCE, 0xBC, 0xCE, 0xB5},
+ {0x3BA, 0x1F79, 0x3C3, 0x3BC, 0x3B5}},
// First possible sequence of a certain length:
// 1 byte
{{0x00}, {0x0}},
// 2 bytes
- {{0xc2, 0x80}, {0x80}},
+ {{0xC2, 0x80}, {0x80}},
// 3 bytes
- {{0xe0, 0xa0, 0x80}, {0x800}},
+ {{0xE0, 0xA0, 0x80}, {0x800}},
// 4 bytes
- {{0xf0, 0x90, 0x80, 0x80}, {0x10000}},
+ {{0xF0, 0x90, 0x80, 0x80}, {0x10000}},
// 5 bytes (not supported)
- {{0xf8, 0x88, 0x80, 0x80, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF8, 0x88, 0x80, 0x80, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6 bytes (not supported)
- {{0xfc, 0x84, 0x80, 0x80, 0x80, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFC, 0x84, 0x80, 0x80, 0x80, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Last possible sequence of certain length:
// 1 byte
- {{0x7f}, {0x7f}},
+ {{0x7F}, {0x7F}},
// 2 bytes
- {{0xdf, 0xbf}, {0x7ff}},
+ {{0xDF, 0xBF}, {0x7FF}},
// 3 bytes
- {{0xef, 0xbf, 0xbf}, {0xffff}},
+ {{0xEF, 0xBF, 0xBF}, {0xFFFF}},
// 4 bytes (this sequence is not a valid code point)
- {{0xf7, 0xbf, 0xbf, 0xbf}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF7, 0xBF, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 5 bytes (not supported)
- {{0xfb, 0xbf, 0xbf, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFB, 0xBF, 0xBF, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6 bytes (not supported)
- {{0xfd, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Other boundary conditions:
- {{0xed, 0x9f, 0xbf}, {0xd7ff}},
- {{0xee, 0x80, 0x80}, {0xe000}},
+ {{0xED, 0x9F, 0xBF}, {0xD7FF}},
+ {{0xEE, 0x80, 0x80}, {0xE000}},
// U+fffd (invalid code point)
- {{0xef, 0xbf, 0xbd}, {0xfffd}},
+ {{0xEF, 0xBF, 0xBD}, {0xFFFD}},
// U+10ffff (last valid code point)
- {{0xf4, 0x8f, 0xbf, 0xbf}, {0x10ffff}},
+ {{0xF4, 0x8F, 0xBF, 0xBF}, {0x10FFFF}},
// First invalid (too large) code point
- {{0xf4, 0x90, 0x80, 0x80}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF4, 0x90, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Malformed sequences:
// Unexpected continuation bytes:
// First continuation byte
- {{0x80}, {0xfffd}},
+ {{0x80}, {0xFFFD}},
// Last continuation byte
- {{0xbf}, {0xfffd}},
+ {{0xBF}, {0xFFFD}},
// 2 continuation bytes
- {{0x80, 0xbf}, {0xfffd, 0xfffd}},
+ {{0x80, 0xBF}, {0xFFFD, 0xFFFD}},
// 3 continuation bytes
- {{0x80, 0xbf, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
+ {{0x80, 0xBF, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
// 4 continuation bytes
- {{0x80, 0xbf, 0x80, 0xbf}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0x80, 0xBF, 0x80, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 5 continuation bytes
- {{0x80, 0xbf, 0x80, 0xbf, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0x80, 0xBF, 0x80, 0xBF, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6 continuation bytes
- {{0x80, 0xbf, 0x80, 0xbf, 0x80, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 7 continuation bytes
- {{0x80, 0xbf, 0x80, 0xbf, 0x80, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Sequence of all 64 possible continuation bytes
- {{0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
- 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,
- 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0,
- 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab,
- 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
- 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A,
+ 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,
+ 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0,
+ 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
+ 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
+ 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Using each possible continuation byte in a two-byte sequence:
- {{0xd0, 0x80, 0xd0, 0x81, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0x84, 0xd0, 0x85,
- 0xd0, 0x86, 0xd0, 0x87, 0xd0, 0x88, 0xd0, 0x89, 0xd0, 0x8a, 0xd0, 0x8b,
- 0xd0, 0x8c, 0xd0, 0x8d, 0xd0, 0x8e, 0xd0, 0x8f, 0xd0, 0x90, 0xd0, 0x91,
- 0xd0, 0x92, 0xd0, 0x93, 0xd0, 0x94, 0xd0, 0x95, 0xd0, 0x96, 0xd0, 0x97,
- 0xd0, 0x98, 0xd0, 0x99, 0xd0, 0x9a, 0xd0, 0x9b, 0xd0, 0x9c, 0xd0, 0x9d,
- 0xd0, 0x9e, 0xd0, 0x9f, 0xd0, 0xa0, 0xd0, 0xa1, 0xd0, 0xa2, 0xd0, 0xa3,
- 0xd0, 0xa4, 0xd0, 0xa5, 0xd0, 0xa6, 0xd0, 0xa7, 0xd0, 0xa8, 0xd0, 0xa9,
- 0xd0, 0xaa, 0xd0, 0xab, 0xd0, 0xac, 0xd0, 0xad, 0xd0, 0xae, 0xd0, 0xaf,
- 0xd0, 0xb0, 0xd0, 0xb1, 0xd0, 0xb2, 0xd0, 0xb3, 0xd0, 0xb4, 0xd0, 0xb5,
- 0xd0, 0xb6, 0xd0, 0xb7, 0xd0, 0xb8, 0xd0, 0xb9, 0xd0, 0xba, 0xd0, 0xbb,
- 0xd0, 0xbc, 0xd0, 0xbd, 0xd0, 0xbe, 0xd0, 0xbf},
+ {{0xD0, 0x80, 0xD0, 0x81, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0x84, 0xD0, 0x85,
+ 0xD0, 0x86, 0xD0, 0x87, 0xD0, 0x88, 0xD0, 0x89, 0xD0, 0x8A, 0xD0, 0x8B,
+ 0xD0, 0x8C, 0xD0, 0x8D, 0xD0, 0x8E, 0xD0, 0x8F, 0xD0, 0x90, 0xD0, 0x91,
+ 0xD0, 0x92, 0xD0, 0x93, 0xD0, 0x94, 0xD0, 0x95, 0xD0, 0x96, 0xD0, 0x97,
+ 0xD0, 0x98, 0xD0, 0x99, 0xD0, 0x9A, 0xD0, 0x9B, 0xD0, 0x9C, 0xD0, 0x9D,
+ 0xD0, 0x9E, 0xD0, 0x9F, 0xD0, 0xA0, 0xD0, 0xA1, 0xD0, 0xA2, 0xD0, 0xA3,
+ 0xD0, 0xA4, 0xD0, 0xA5, 0xD0, 0xA6, 0xD0, 0xA7, 0xD0, 0xA8, 0xD0, 0xA9,
+ 0xD0, 0xAA, 0xD0, 0xAB, 0xD0, 0xAC, 0xD0, 0xAD, 0xD0, 0xAE, 0xD0, 0xAF,
+ 0xD0, 0xB0, 0xD0, 0xB1, 0xD0, 0xB2, 0xD0, 0xB3, 0xD0, 0xB4, 0xD0, 0xB5,
+ 0xD0, 0xB6, 0xD0, 0xB7, 0xD0, 0xB8, 0xD0, 0xB9, 0xD0, 0xBA, 0xD0, 0xBB,
+ 0xD0, 0xBC, 0xD0, 0xBD, 0xD0, 0xBE, 0xD0, 0xBF},
{0x400, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409,
- 0x40a, 0x40b, 0x40c, 0x40d, 0x40e, 0x40f, 0x410, 0x411, 0x412, 0x413,
- 0x414, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41a, 0x41b, 0x41c, 0x41d,
- 0x41e, 0x41f, 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427,
- 0x428, 0x429, 0x42a, 0x42b, 0x42c, 0x42d, 0x42e, 0x42f, 0x430, 0x431,
- 0x432, 0x433, 0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43a, 0x43b,
- 0x43c, 0x43d, 0x43e, 0x43f}},
+ 0x40A, 0x40B, 0x40C, 0x40D, 0x40E, 0x40F, 0x410, 0x411, 0x412, 0x413,
+ 0x414, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41A, 0x41B, 0x41C, 0x41D,
+ 0x41E, 0x41F, 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427,
+ 0x428, 0x429, 0x42A, 0x42B, 0x42C, 0x42D, 0x42E, 0x42F, 0x430, 0x431,
+ 0x432, 0x433, 0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43A, 0x43B,
+ 0x43C, 0x43D, 0x43E, 0x43F}},
// Lonely first bytes:
// All 32 first bytes of 32-byte sequences, each followed by a space
// (generates 32 invalid char + space sequences.
- {{0xc0, 0x20, 0xc1, 0x20, 0xc2, 0x20, 0xc3, 0x20, 0xc4, 0x20, 0xc5,
- 0x20, 0xc6, 0x20, 0xc7, 0x20, 0xc8, 0x20, 0xc9, 0x20, 0xca, 0x20,
- 0xcb, 0x20, 0xcc, 0x20, 0xcd, 0x20, 0xce, 0x20, 0xcf, 0x20, 0xd0,
- 0x20, 0xd1, 0x20, 0xd2, 0x20, 0xd3, 0x20, 0xd4, 0x20, 0xd5, 0x20,
- 0xd6, 0x20, 0xd7, 0x20, 0xd8, 0x20, 0xd9, 0x20, 0xda, 0x20, 0xdb,
- 0x20, 0xdc, 0x20, 0xdd, 0x20, 0xde, 0x20, 0xdf, 0x20},
- {0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20}},
+ {{0xC0, 0x20, 0xC1, 0x20, 0xC2, 0x20, 0xC3, 0x20, 0xC4, 0x20, 0xC5,
+ 0x20, 0xC6, 0x20, 0xC7, 0x20, 0xC8, 0x20, 0xC9, 0x20, 0xCA, 0x20,
+ 0xCB, 0x20, 0xCC, 0x20, 0xCD, 0x20, 0xCE, 0x20, 0xCF, 0x20, 0xD0,
+ 0x20, 0xD1, 0x20, 0xD2, 0x20, 0xD3, 0x20, 0xD4, 0x20, 0xD5, 0x20,
+ 0xD6, 0x20, 0xD7, 0x20, 0xD8, 0x20, 0xD9, 0x20, 0xDA, 0x20, 0xDB,
+ 0x20, 0xDC, 0x20, 0xDD, 0x20, 0xDE, 0x20, 0xDF, 0x20},
+ {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20}},
// All 16 first bytes of 3-byte sequences, each followed by a space
// (generates 16 invalid char + space sequences):
- {{0xe0, 0x20, 0xe1, 0x20, 0xe2, 0x20, 0xe3, 0x20, 0xe4, 0x20, 0xe5,
- 0x20, 0xe6, 0x20, 0xe7, 0x20, 0xe8, 0x20, 0xe9, 0x20, 0xea, 0x20,
- 0xeb, 0x20, 0xec, 0x20, 0xed, 0x20, 0xee, 0x20, 0xef, 0x20},
- {0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20}},
+ {{0xE0, 0x20, 0xE1, 0x20, 0xE2, 0x20, 0xE3, 0x20, 0xE4, 0x20, 0xE5,
+ 0x20, 0xE6, 0x20, 0xE7, 0x20, 0xE8, 0x20, 0xE9, 0x20, 0xEA, 0x20,
+ 0xEB, 0x20, 0xEC, 0x20, 0xED, 0x20, 0xEE, 0x20, 0xEF, 0x20},
+ {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20}},
// All 8 first bytes of 4-byte sequences, each followed by a space
// (generates 8 invalid char + space sequences):
- {{0xf0, 0x20, 0xf1, 0x20, 0xf2, 0x20, 0xf3, 0x20, 0xf4, 0x20, 0xf5, 0x20,
- 0xf6, 0x20, 0xf7, 0x20},
- {0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20,
- 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20}},
+ {{0xF0, 0x20, 0xF1, 0x20, 0xF2, 0x20, 0xF3, 0x20, 0xF4, 0x20, 0xF5, 0x20,
+ 0xF6, 0x20, 0xF7, 0x20},
+ {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
+ 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20}},
// All 4 first bytes of 5-byte sequences (not supported), each followed by
// a space (generates 4 invalid char + space sequences):
- {{0xf8, 0x20, 0xf9, 0x20, 0xfa, 0x20, 0xfb, 0x20},
- {0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20, 0xfffd, 0x20}},
+ {{0xF8, 0x20, 0xF9, 0x20, 0xFA, 0x20, 0xFB, 0x20},
+ {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20}},
// All 2 first bytes of 6-byte sequences (not supported), each followed by
// a space (generates 2 invalid char + space sequences):
- {{0xfc, 0x20, 0xfd, 0x20}, {0xfffd, 0x20, 0xfffd, 0x20}},
+ {{0xFC, 0x20, 0xFD, 0x20}, {0xFFFD, 0x20, 0xFFFD, 0x20}},
// Sequences with last continuation byte missing. Normally the whole
// incomplete sequence generates a single invalid character (exceptions
// explained below).
// 2-byte sequences with last byte missing
- {{0xc0}, {0xfffd}},
- {{0xdf}, {0xfffd}},
+ {{0xC0}, {0xFFFD}},
+ {{0xDF}, {0xFFFD}},
// 3-byte sequences with last byte missing.
- {{0xe8, 0x80}, {0xfffd}},
- {{0xe0, 0xbf}, {0xfffd}},
- {{0xef, 0xbf}, {0xfffd}},
+ {{0xE8, 0x80}, {0xFFFD}},
+ {{0xE0, 0xBF}, {0xFFFD}},
+ {{0xEF, 0xBF}, {0xFFFD}},
// Start of an overlong sequence. The first "maximal subpart" is the first
// byte; it creates an invalid character. Each following byte generates an
// invalid character too.
- {{0xe0, 0x80}, {0xfffd, 0xfffd}},
+ {{0xE0, 0x80}, {0xFFFD, 0xFFFD}},
// 4-byte sequences with last byte missing
- {{0xf1, 0x80, 0x80}, {0xfffd}},
- {{0xf4, 0x8f, 0xbf}, {0xfffd}},
+ {{0xF1, 0x80, 0x80}, {0xFFFD}},
+ {{0xF4, 0x8F, 0xBF}, {0xFFFD}},
// Start of an overlong sequence. The first "maximal subpart" is the first
// byte; it creates an invalid character. Each following byte generates an
// invalid character too.
- {{0xf0, 0x80, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
+ {{0xF0, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
// 5-byte sequences (not supported) with last byte missing
- {{0xf8, 0x80, 0x80, 0x80}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfb, 0xbf, 0xbf, 0xbf}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF8, 0x80, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFB, 0xBF, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6-byte sequences (not supported) with last byte missing
- {{0xfc, 0x80, 0x80, 0x80, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfd, 0xbf, 0xbf, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFC, 0x80, 0x80, 0x80, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFD, 0xBF, 0xBF, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Concatenation of incomplete sequences: above incomplete sequences
// concatenated.
- {{0xc0, 0xdf, 0xe8, 0x80, 0xe0, 0xbf, 0xef, 0xbf, 0xe0, 0x80,
- 0xf1, 0x80, 0x80, 0xf4, 0x8f, 0xbf, 0xf0, 0x80, 0x80, 0xf8,
- 0x80, 0x80, 0x80, 0xfb, 0xbf, 0xbf, 0xbf, 0xfc, 0x80, 0x80,
- 0x80, 0x80, 0xfd, 0xbf, 0xbf, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
- 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xC0, 0xDF, 0xE8, 0x80, 0xE0, 0xBF, 0xEF, 0xBF, 0xE0, 0x80,
+ 0xF1, 0x80, 0x80, 0xF4, 0x8F, 0xBF, 0xF0, 0x80, 0x80, 0xF8,
+ 0x80, 0x80, 0x80, 0xFB, 0xBF, 0xBF, 0xBF, 0xFC, 0x80, 0x80,
+ 0x80, 0x80, 0xFD, 0xBF, 0xBF, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
+ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Incomplete sequence tests repeated with a space after the incomplete
// sequence.
// 2-byte sequences with last byte missing
- {{0xc0, 0x20}, {0xfffd, 0x20}},
- {{0xdf, 0x20}, {0xfffd, 0x20}},
+ {{0xC0, 0x20}, {0xFFFD, 0x20}},
+ {{0xDF, 0x20}, {0xFFFD, 0x20}},
// 3-byte sequences with last byte missing
- {{0xe8, 0x80, 0x20}, {0xfffd, 0x20}},
- {{0xe0, 0xbf, 0x20}, {0xfffd, 0x20}},
- {{0xef, 0xbf, 0x20}, {0xfffd, 0x20}},
+ {{0xE8, 0x80, 0x20}, {0xFFFD, 0x20}},
+ {{0xE0, 0xBF, 0x20}, {0xFFFD, 0x20}},
+ {{0xEF, 0xBF, 0x20}, {0xFFFD, 0x20}},
// Start of overlong 3-byte sequence with last byte missing
- {{0xe0, 0x80, 0x20}, {0xfffd, 0xfffd, 0x20}},
+ {{0xE0, 0x80, 0x20}, {0xFFFD, 0xFFFD, 0x20}},
// 4-byte sequences with last byte missing
- {{0xf1, 0x80, 0x80, 0x20}, {0xfffd, 0x20}},
- {{0xf4, 0x8f, 0xbf, 0x20}, {0xfffd, 0x20}},
+ {{0xF1, 0x80, 0x80, 0x20}, {0xFFFD, 0x20}},
+ {{0xF4, 0x8F, 0xBF, 0x20}, {0xFFFD, 0x20}},
// Start of overlong 4-byte sequence with last byte missing
- {{0xf0, 0x80, 0x80, 0x20}, {0xfffd, 0xfffd, 0xfffd, 0x20}},
+ {{0xF0, 0x80, 0x80, 0x20}, {0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
// 5-byte sequences (not supported) with last byte missing
- {{0xf8, 0x80, 0x80, 0x80, 0x20}, {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x20}},
- {{0xfb, 0xbf, 0xbf, 0xbf, 0x20}, {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x20}},
+ {{0xF8, 0x80, 0x80, 0x80, 0x20}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
+ {{0xFB, 0xBF, 0xBF, 0xBF, 0x20}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
// 6-byte sequences (not supported) with last byte missing
- {{0xfc, 0x80, 0x80, 0x80, 0x80, 0x20},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x20}},
- {{0xfd, 0xbf, 0xbf, 0xbf, 0xbf, 0x20},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x20}},
+ {{0xFC, 0x80, 0x80, 0x80, 0x80, 0x20},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
+ {{0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0x20},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
// Impossible bytes
- {{0xfe}, {0xfffd}},
- {{0xff}, {0xfffd}},
- {{0xfe, 0xfe, 0xff, 0xff}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFE}, {0xFFFD}},
+ {{0xFF}, {0xFFFD}},
+ {{0xFE, 0xFE, 0xFF, 0xFF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Lead-byte-like bytes which aren't valid lead bytes.
- {{0xc0}, {0xfffd}},
- {{0xc0, 0xaa}, {0xfffd, 0xfffd}},
- {{0xc1}, {0xfffd}},
- {{0xc1, 0xaa}, {0xfffd, 0xfffd}},
- {{0xf5}, {0xfffd}},
- {{0xf5, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xf6}, {0xfffd}},
- {{0xf6, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xf7}, {0xfffd}},
- {{0xf7, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xf8}, {0xfffd}},
- {{0xf8, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xf9}, {0xfffd}},
- {{0xf9, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfa}, {0xfffd}},
- {{0xfa, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfb}, {0xfffd}},
- {{0xfb, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfc}, {0xfffd}},
- {{0xfc, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfd}, {0xfffd}},
- {{0xfd, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xfe}, {0xfffd}},
- {{0xfe, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xff}, {0xfffd}},
- {{0xff, 0xaa, 0xaa, 0xaa}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xC0}, {0xFFFD}},
+ {{0xC0, 0xAA}, {0xFFFD, 0xFFFD}},
+ {{0xC1}, {0xFFFD}},
+ {{0xC1, 0xAA}, {0xFFFD, 0xFFFD}},
+ {{0xF5}, {0xFFFD}},
+ {{0xF5, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF6}, {0xFFFD}},
+ {{0xF6, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF7}, {0xFFFD}},
+ {{0xF7, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF8}, {0xFFFD}},
+ {{0xF8, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF9}, {0xFFFD}},
+ {{0xF9, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFA}, {0xFFFD}},
+ {{0xFA, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFB}, {0xFFFD}},
+ {{0xFB, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFC}, {0xFFFD}},
+ {{0xFC, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFD}, {0xFFFD}},
+ {{0xFD, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFE}, {0xFFFD}},
+ {{0xFE, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xFF}, {0xFFFD}},
+ {{0xFF, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Overlong sequences:
// Overlong encodings for "/"
- {{0xc0, 0xaf}, {0xfffd, 0xfffd}},
- {{0xe0, 0x80, 0xaf}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xf0, 0x80, 0x80, 0xaf}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xC0, 0xAF}, {0xFFFD, 0xFFFD}},
+ {{0xE0, 0x80, 0xAF}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF0, 0x80, 0x80, 0xAF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 5-byte sequence (not supported anyway)
- {{0xf8, 0x80, 0x80, 0x80, 0xaf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF8, 0x80, 0x80, 0x80, 0xAF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6-byte sequence (not supported anyway)
- {{0xfc, 0x80, 0x80, 0x80, 0x80, 0xaf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFC, 0x80, 0x80, 0x80, 0x80, 0xAF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Maximum overlong sequences
- {{0xc1, 0xbf}, {0xfffd, 0xfffd}},
- {{0xe0, 0x9f, 0xbf}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xf0, 0x8f, 0xbf, 0xbf}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xC1, 0xBF}, {0xFFFD, 0xFFFD}},
+ {{0xE0, 0x9F, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF0, 0x8F, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 5-byte sequence (not supported anyway)
- {{0xf8, 0x87, 0xbf, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF8, 0x87, 0xBF, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6-byte sequence (not supported anyway)
- {{0xfc, 0x83, 0xbf, 0xbf, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFC, 0x83, 0xBF, 0xBF, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Overlong encodings for 0
- {{0xc0, 0x80}, {0xfffd, 0xfffd}},
- {{0xe0, 0x80, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xf0, 0x80, 0x80, 0x80}, {0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xC0, 0x80}, {0xFFFD, 0xFFFD}},
+ {{0xE0, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xF0, 0x80, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 5-byte sequence (not supported anyway)
- {{0xf8, 0x80, 0x80, 0x80, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xF8, 0x80, 0x80, 0x80, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// 6-byte sequence (not supported anyway)
- {{0xfc, 0x80, 0x80, 0x80, 0x80, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xFC, 0x80, 0x80, 0x80, 0x80, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Illegal code positions:
// Single UTF-16 surrogates
- {{0xed, 0xa0, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xa0, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xad, 0xbf}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xae, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xaf, 0xbf}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xb0, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xbe, 0x80}, {0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xbf, 0xbf}, {0xfffd, 0xfffd, 0xfffd}},
+ {{0xED, 0xA0, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xA0, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAD, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAE, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xB0, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xBE, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
// Paired surrogates
- {{0xed, 0xa0, 0x80, 0xed, 0xb0, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xa0, 0x80, 0xed, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xad, 0xbf, 0xed, 0xb0, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xad, 0xbf, 0xed, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xae, 0x80, 0xed, 0xb0, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xae, 0x80, 0xed, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xaf, 0xbf, 0xed, 0xb0, 0x80},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
- {{0xed, 0xaf, 0xbf, 0xed, 0xbf, 0xbf},
- {0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd}},
+ {{0xED, 0xA0, 0x80, 0xED, 0xB0, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xA0, 0x80, 0xED, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAD, 0xBF, 0xED, 0xB0, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAD, 0xBF, 0xED, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAE, 0x80, 0xED, 0xB0, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAE, 0x80, 0xED, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAF, 0xBF, 0xED, 0xB0, 0x80},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
+ {{0xED, 0xAF, 0xBF, 0xED, 0xBF, 0xBF},
+ {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
// Surrogates with the last byte missing.
- {{0xed, 0xa0}, {0xfffd, 0xfffd}},
- {{0xed, 0xa0}, {0xfffd, 0xfffd}},
- {{0xed, 0xad}, {0xfffd, 0xfffd}},
- {{0xed, 0xae}, {0xfffd, 0xfffd}},
- {{0xed, 0xaf}, {0xfffd, 0xfffd}},
- {{0xed, 0xb0}, {0xfffd, 0xfffd}},
- {{0xed, 0xbe}, {0xfffd, 0xfffd}},
- {{0xed, 0xbf}, {0xfffd, 0xfffd}},
+ {{0xED, 0xA0}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xA0}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xAD}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xAE}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xAF}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xB0}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xBE}, {0xFFFD, 0xFFFD}},
+ {{0xED, 0xBF}, {0xFFFD, 0xFFFD}},
// Other non-characters
- {{0xef, 0xbf, 0xbe}, {0xfffe}},
- {{0xef, 0xbf, 0xbf}, {0xffff}},
- {{0xef, 0xb7, 0x90, 0xef, 0xb7, 0x91, 0xef, 0xb7, 0x92, 0xef, 0xb7, 0x93,
- 0xef, 0xb7, 0x94, 0xef, 0xb7, 0x95, 0xef, 0xb7, 0x96, 0xef, 0xb7, 0x97,
- 0xef, 0xb7, 0x98, 0xef, 0xb7, 0x99, 0xef, 0xb7, 0x9a, 0xef, 0xb7, 0x9b,
- 0xef, 0xb7, 0x9c, 0xef, 0xb7, 0x9d, 0xef, 0xb7, 0x9e, 0xef, 0xb7, 0x9f,
- 0xef, 0xb7, 0xa0, 0xef, 0xb7, 0xa1, 0xef, 0xb7, 0xa2, 0xef, 0xb7, 0xa3,
- 0xef, 0xb7, 0xa4, 0xef, 0xb7, 0xa5, 0xef, 0xb7, 0xa6, 0xef, 0xb7, 0xa7,
- 0xef, 0xb7, 0xa8, 0xef, 0xb7, 0xa9, 0xef, 0xb7, 0xaa, 0xef, 0xb7, 0xab,
- 0xef, 0xb7, 0xac, 0xef, 0xb7, 0xad, 0xef, 0xb7, 0xae, 0xef, 0xb7, 0xaf},
- {0xfdd0, 0xfdd1, 0xfdd2, 0xfdd3, 0xfdd4, 0xfdd5, 0xfdd6, 0xfdd7,
- 0xfdd8, 0xfdd9, 0xfdda, 0xfddb, 0xfddc, 0xfddd, 0xfdde, 0xfddf,
- 0xfde0, 0xfde1, 0xfde2, 0xfde3, 0xfde4, 0xfde5, 0xfde6, 0xfde7,
- 0xfde8, 0xfde9, 0xfdea, 0xfdeb, 0xfdec, 0xfded, 0xfdee, 0xfdef}},
- {{0xf0, 0x9f, 0xbf, 0xbe, 0xf0, 0x9f, 0xbf, 0xbf, 0xf0, 0xaf, 0xbf,
- 0xbe, 0xf0, 0xaf, 0xbf, 0xbf, 0xf0, 0xbf, 0xbf, 0xbe, 0xf0, 0xbf,
- 0xbf, 0xbf, 0xf1, 0x8f, 0xbf, 0xbe, 0xf1, 0x8f, 0xbf, 0xbf, 0xf1,
- 0x9f, 0xbf, 0xbe, 0xf1, 0x9f, 0xbf, 0xbf, 0xf1, 0xaf, 0xbf, 0xbe,
- 0xf1, 0xaf, 0xbf, 0xbf, 0xf1, 0xbf, 0xbf, 0xbe, 0xf1, 0xbf, 0xbf,
- 0xbf, 0xf2, 0x8f, 0xbf, 0xbe, 0xf2, 0x8f, 0xbf, 0xbf},
- {0x1fffe, 0x1ffff, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe,
- 0x8ffff}},
+ {{0xEF, 0xBF, 0xBE}, {0xFFFE}},
+ {{0xEF, 0xBF, 0xBF}, {0xFFFF}},
+ {{0xEF, 0xB7, 0x90, 0xEF, 0xB7, 0x91, 0xEF, 0xB7, 0x92, 0xEF, 0xB7, 0x93,
+ 0xEF, 0xB7, 0x94, 0xEF, 0xB7, 0x95, 0xEF, 0xB7, 0x96, 0xEF, 0xB7, 0x97,
+ 0xEF, 0xB7, 0x98, 0xEF, 0xB7, 0x99, 0xEF, 0xB7, 0x9A, 0xEF, 0xB7, 0x9B,
+ 0xEF, 0xB7, 0x9C, 0xEF, 0xB7, 0x9D, 0xEF, 0xB7, 0x9E, 0xEF, 0xB7, 0x9F,
+ 0xEF, 0xB7, 0xA0, 0xEF, 0xB7, 0xA1, 0xEF, 0xB7, 0xA2, 0xEF, 0xB7, 0xA3,
+ 0xEF, 0xB7, 0xA4, 0xEF, 0xB7, 0xA5, 0xEF, 0xB7, 0xA6, 0xEF, 0xB7, 0xA7,
+ 0xEF, 0xB7, 0xA8, 0xEF, 0xB7, 0xA9, 0xEF, 0xB7, 0xAA, 0xEF, 0xB7, 0xAB,
+ 0xEF, 0xB7, 0xAC, 0xEF, 0xB7, 0xAD, 0xEF, 0xB7, 0xAE, 0xEF, 0xB7, 0xAF},
+ {0xFDD0, 0xFDD1, 0xFDD2, 0xFDD3, 0xFDD4, 0xFDD5, 0xFDD6, 0xFDD7,
+ 0xFDD8, 0xFDD9, 0xFDDA, 0xFDDB, 0xFDDC, 0xFDDD, 0xFDDE, 0xFDDF,
+ 0xFDE0, 0xFDE1, 0xFDE2, 0xFDE3, 0xFDE4, 0xFDE5, 0xFDE6, 0xFDE7,
+ 0xFDE8, 0xFDE9, 0xFDEA, 0xFDEB, 0xFDEC, 0xFDED, 0xFDEE, 0xFDEF}},
+ {{0xF0, 0x9F, 0xBF, 0xBE, 0xF0, 0x9F, 0xBF, 0xBF, 0xF0, 0xAF, 0xBF,
+ 0xBE, 0xF0, 0xAF, 0xBF, 0xBF, 0xF0, 0xBF, 0xBF, 0xBE, 0xF0, 0xBF,
+ 0xBF, 0xBF, 0xF1, 0x8F, 0xBF, 0xBE, 0xF1, 0x8F, 0xBF, 0xBF, 0xF1,
+ 0x9F, 0xBF, 0xBE, 0xF1, 0x9F, 0xBF, 0xBF, 0xF1, 0xAF, 0xBF, 0xBE,
+ 0xF1, 0xAF, 0xBF, 0xBF, 0xF1, 0xBF, 0xBF, 0xBE, 0xF1, 0xBF, 0xBF,
+ 0xBF, 0xF2, 0x8F, 0xBF, 0xBE, 0xF2, 0x8F, 0xBF, 0xBF},
+ {0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF,
+ 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE,
+ 0x8FFFF}},
};
for (auto test : data) {
diff --git a/deps/v8/test/unittests/unittests.gyp b/deps/v8/test/unittests/unittests.gyp
index 575f550871..50e820e5f1 100644
--- a/deps/v8/test/unittests/unittests.gyp
+++ b/deps/v8/test/unittests/unittests.gyp
@@ -8,6 +8,7 @@
'variables': {
'v8_code': 1,
'unittests_sources': [ ### gcmole(all) ###
+ 'allocation-unittest.cc',
'api/access-check-unittest.cc',
'api/exception-unittest.cc',
'api/interceptor-unittest.cc',
@@ -90,6 +91,7 @@
'compiler/schedule-unittest.cc',
'compiler/scheduler-unittest.cc',
'compiler/scheduler-rpo-unittest.cc',
+ 'compiler/simplified-lowering-unittest.cc',
'compiler/simplified-operator-reducer-unittest.cc',
'compiler/simplified-operator-unittest.cc',
'compiler/state-values-utils-unittest.cc',
@@ -158,7 +160,7 @@
'wasm/control-transfer-unittest.cc',
'wasm/decoder-unittest.cc',
'wasm/function-body-decoder-unittest.cc',
- 'wasm/wasm-heap-unittest.cc',
+ 'wasm/wasm-code-manager-unittest.cc',
'wasm/leb-helper-unittest.cc',
'wasm/loop-assignment-analysis-unittest.cc',
'wasm/module-decoder-unittest.cc',
diff --git a/deps/v8/test/unittests/unittests.isolate b/deps/v8/test/unittests/unittests.isolate
index ae503bf9bf..ec3bae42d3 100644
--- a/deps/v8/test/unittests/unittests.isolate
+++ b/deps/v8/test/unittests/unittests.isolate
@@ -5,6 +5,7 @@
'variables': {
'files': [
'<(PRODUCT_DIR)/unittests<(EXECUTABLE_SUFFIX)',
+ './testcfg.py',
'./unittests.status',
],
},
@@ -12,4 +13,4 @@
'../../src/base.isolate',
'../../tools/testrunner/testrunner.isolate',
],
-} \ No newline at end of file
+}
diff --git a/deps/v8/test/unittests/value-serializer-unittest.cc b/deps/v8/test/unittests/value-serializer-unittest.cc
index b3e656e917..c143b58090 100644
--- a/deps/v8/test/unittests/value-serializer-unittest.cc
+++ b/deps/v8/test/unittests/value-serializer-unittest.cc
@@ -289,11 +289,11 @@ class ValueSerializerTest : public TestWithIsolate {
TEST_F(ValueSerializerTest, DecodeInvalid) {
// Version tag but no content.
- InvalidDecodeTest({0xff});
+ InvalidDecodeTest({0xFF});
// Version too large.
- InvalidDecodeTest({0xff, 0x7f, 0x5f});
+ InvalidDecodeTest({0xFF, 0x7F, 0x5F});
// Nonsense tag.
- InvalidDecodeTest({0xff, 0x09, 0xdd});
+ InvalidDecodeTest({0xFF, 0x09, 0xDD});
}
TEST_F(ValueSerializerTest, RoundTripOddball) {
@@ -309,27 +309,27 @@ TEST_F(ValueSerializerTest, RoundTripOddball) {
TEST_F(ValueSerializerTest, DecodeOddball) {
// What this code is expected to generate.
- DecodeTest({0xff, 0x09, 0x5f},
+ DecodeTest({0xFF, 0x09, 0x5F},
[](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
- DecodeTest({0xff, 0x09, 0x54},
+ DecodeTest({0xFF, 0x09, 0x54},
[](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
- DecodeTest({0xff, 0x09, 0x46},
+ DecodeTest({0xFF, 0x09, 0x46},
[](Local<Value> value) { EXPECT_TRUE(value->IsFalse()); });
- DecodeTest({0xff, 0x09, 0x30},
+ DecodeTest({0xFF, 0x09, 0x30},
[](Local<Value> value) { EXPECT_TRUE(value->IsNull()); });
// What v9 of the Blink code generates.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x5f, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x5F, 0x00},
[](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x54, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x54, 0x00},
[](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x46, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x46, 0x00},
[](Local<Value> value) { EXPECT_TRUE(value->IsFalse()); });
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x30, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x30, 0x00},
[](Local<Value> value) { EXPECT_TRUE(value->IsNull()); });
// v0 (with no explicit version).
- DecodeTest({0x5f, 0x00},
+ DecodeTest({0x5F, 0x00},
[](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
DecodeTest({0x54, 0x00},
[](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
@@ -376,44 +376,40 @@ TEST_F(ValueSerializerTest, RoundTripNumber) {
TEST_F(ValueSerializerTest, DecodeNumber) {
// 42 zig-zag encoded (signed)
- DecodeTest({0xff, 0x09, 0x49, 0x54},
- [](Local<Value> value) {
- ASSERT_TRUE(value->IsInt32());
- EXPECT_EQ(42, Int32::Cast(*value)->Value());
- });
+ DecodeTest({0xFF, 0x09, 0x49, 0x54}, [](Local<Value> value) {
+ ASSERT_TRUE(value->IsInt32());
+ EXPECT_EQ(42, Int32::Cast(*value)->Value());
+ });
// 42 varint encoded (unsigned)
- DecodeTest({0xff, 0x09, 0x55, 0x2a},
- [](Local<Value> value) {
- ASSERT_TRUE(value->IsInt32());
- EXPECT_EQ(42, Int32::Cast(*value)->Value());
- });
+ DecodeTest({0xFF, 0x09, 0x55, 0x2A}, [](Local<Value> value) {
+ ASSERT_TRUE(value->IsInt32());
+ EXPECT_EQ(42, Int32::Cast(*value)->Value());
+ });
// 160 zig-zag encoded (signed)
- DecodeTest({0xff, 0x09, 0x49, 0xc0, 0x02},
- [](Local<Value> value) {
- ASSERT_TRUE(value->IsInt32());
- ASSERT_EQ(160, Int32::Cast(*value)->Value());
- });
+ DecodeTest({0xFF, 0x09, 0x49, 0xC0, 0x02}, [](Local<Value> value) {
+ ASSERT_TRUE(value->IsInt32());
+ ASSERT_EQ(160, Int32::Cast(*value)->Value());
+ });
// 160 varint encoded (unsigned)
- DecodeTest({0xff, 0x09, 0x55, 0xa0, 0x01},
- [](Local<Value> value) {
- ASSERT_TRUE(value->IsInt32());
- ASSERT_EQ(160, Int32::Cast(*value)->Value());
- });
+ DecodeTest({0xFF, 0x09, 0x55, 0xA0, 0x01}, [](Local<Value> value) {
+ ASSERT_TRUE(value->IsInt32());
+ ASSERT_EQ(160, Int32::Cast(*value)->Value());
+ });
#if defined(V8_TARGET_LITTLE_ENDIAN)
// IEEE 754 doubles, little-endian byte order
- DecodeTest({0xff, 0x09, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xbf},
+ DecodeTest({0xFF, 0x09, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xBF},
[](Local<Value> value) {
ASSERT_TRUE(value->IsNumber());
EXPECT_EQ(-0.25, Number::Cast(*value)->Value());
});
// quiet NaN
- DecodeTest({0xff, 0x09, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f},
+ DecodeTest({0xFF, 0x09, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F},
[](Local<Value> value) {
ASSERT_TRUE(value->IsNumber());
EXPECT_TRUE(std::isnan(Number::Cast(*value)->Value()));
});
// signaling NaN
- DecodeTest({0xff, 0x09, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x7f},
+ DecodeTest({0xFF, 0x09, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x7F},
[](Local<Value> value) {
ASSERT_TRUE(value->IsNumber());
EXPECT_TRUE(std::isnan(Number::Cast(*value)->Value()));
@@ -458,24 +454,23 @@ TEST_F(ValueSerializerTest, RoundTripString) {
TEST_F(ValueSerializerTest, DecodeString) {
// Decoding the strings above from UTF-8.
- DecodeTest({0xff, 0x09, 0x53, 0x00},
- [](Local<Value> value) {
- ASSERT_TRUE(value->IsString());
- EXPECT_EQ(0, String::Cast(*value)->Length());
- });
- DecodeTest({0xff, 0x09, 0x53, 0x05, 'H', 'e', 'l', 'l', 'o'},
+ DecodeTest({0xFF, 0x09, 0x53, 0x00}, [](Local<Value> value) {
+ ASSERT_TRUE(value->IsString());
+ EXPECT_EQ(0, String::Cast(*value)->Length());
+ });
+ DecodeTest({0xFF, 0x09, 0x53, 0x05, 'H', 'e', 'l', 'l', 'o'},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(5, String::Cast(*value)->Length());
EXPECT_EQ(kHelloString, Utf8Value(value));
});
- DecodeTest({0xff, 0x09, 0x53, 0x07, 'Q', 'u', 0xc3, 0xa9, 'b', 'e', 'c'},
+ DecodeTest({0xFF, 0x09, 0x53, 0x07, 'Q', 'u', 0xC3, 0xA9, 'b', 'e', 'c'},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(6, String::Cast(*value)->Length());
EXPECT_EQ(kQuebecString, Utf8Value(value));
});
- DecodeTest({0xff, 0x09, 0x53, 0x04, 0xf0, 0x9f, 0x91, 0x8a},
+ DecodeTest({0xFF, 0x09, 0x53, 0x04, 0xF0, 0x9F, 0x91, 0x8A},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(2, String::Cast(*value)->Length());
@@ -483,17 +478,17 @@ TEST_F(ValueSerializerTest, DecodeString) {
});
// And from Latin-1 (for the ones that fit).
- DecodeTest({0xff, 0x0a, 0x22, 0x00}, [](Local<Value> value) {
+ DecodeTest({0xFF, 0x0A, 0x22, 0x00}, [](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(0, String::Cast(*value)->Length());
});
- DecodeTest({0xff, 0x0a, 0x22, 0x05, 'H', 'e', 'l', 'l', 'o'},
+ DecodeTest({0xFF, 0x0A, 0x22, 0x05, 'H', 'e', 'l', 'l', 'o'},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(5, String::Cast(*value)->Length());
EXPECT_EQ(kHelloString, Utf8Value(value));
});
- DecodeTest({0xff, 0x0a, 0x22, 0x06, 'Q', 'u', 0xe9, 'b', 'e', 'c'},
+ DecodeTest({0xFF, 0x0A, 0x22, 0x06, 'Q', 'u', 0xE9, 'b', 'e', 'c'},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(6, String::Cast(*value)->Length());
@@ -502,26 +497,25 @@ TEST_F(ValueSerializerTest, DecodeString) {
// And from two-byte strings (endianness dependent).
#if defined(V8_TARGET_LITTLE_ENDIAN)
- DecodeTest({0xff, 0x09, 0x63, 0x00},
- [](Local<Value> value) {
- ASSERT_TRUE(value->IsString());
- EXPECT_EQ(0, String::Cast(*value)->Length());
- });
- DecodeTest({0xff, 0x09, 0x63, 0x0a, 'H', '\0', 'e', '\0', 'l', '\0', 'l',
+ DecodeTest({0xFF, 0x09, 0x63, 0x00}, [](Local<Value> value) {
+ ASSERT_TRUE(value->IsString());
+ EXPECT_EQ(0, String::Cast(*value)->Length());
+ });
+ DecodeTest({0xFF, 0x09, 0x63, 0x0A, 'H', '\0', 'e', '\0', 'l', '\0', 'l',
'\0', 'o', '\0'},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(5, String::Cast(*value)->Length());
EXPECT_EQ(kHelloString, Utf8Value(value));
});
- DecodeTest({0xff, 0x09, 0x63, 0x0c, 'Q', '\0', 'u', '\0', 0xe9, '\0', 'b',
+ DecodeTest({0xFF, 0x09, 0x63, 0x0C, 'Q', '\0', 'u', '\0', 0xE9, '\0', 'b',
'\0', 'e', '\0', 'c', '\0'},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(6, String::Cast(*value)->Length());
EXPECT_EQ(kQuebecString, Utf8Value(value));
});
- DecodeTest({0xff, 0x09, 0x63, 0x04, 0x3d, 0xd8, 0x4a, 0xdc},
+ DecodeTest({0xFF, 0x09, 0x63, 0x04, 0x3D, 0xD8, 0x4A, 0xDC},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsString());
EXPECT_EQ(2, String::Cast(*value)->Length());
@@ -533,14 +527,14 @@ TEST_F(ValueSerializerTest, DecodeString) {
TEST_F(ValueSerializerTest, DecodeInvalidString) {
// UTF-8 string with too few bytes available.
- InvalidDecodeTest({0xff, 0x09, 0x53, 0x10, 'v', '8'});
+ InvalidDecodeTest({0xFF, 0x09, 0x53, 0x10, 'v', '8'});
// One-byte string with too few bytes available.
- InvalidDecodeTest({0xff, 0x0a, 0x22, 0x10, 'v', '8'});
+ InvalidDecodeTest({0xFF, 0x0A, 0x22, 0x10, 'v', '8'});
#if defined(V8_TARGET_LITTLE_ENDIAN)
// Two-byte string with too few bytes available.
- InvalidDecodeTest({0xff, 0x09, 0x63, 0x10, 'v', '\0', '8', '\0'});
+ InvalidDecodeTest({0xFF, 0x09, 0x63, 0x10, 'v', '\0', '8', '\0'});
// Two-byte string with an odd byte length.
- InvalidDecodeTest({0xff, 0x09, 0x63, 0x03, 'v', '\0', '8'});
+ InvalidDecodeTest({0xFF, 0x09, 0x63, 0x03, 'v', '\0', '8'});
#endif
// TODO(jbroman): The same for big-endian systems.
}
@@ -565,9 +559,9 @@ TEST_F(ValueSerializerTest, EncodeTwoByteStringUsesPadding) {
// what that value may be.
const uint8_t expected_prefix[] = {0x00, 0x63, 0x94, 0x03};
ASSERT_GT(data.size(), sizeof(expected_prefix) + 2);
- EXPECT_EQ(0xff, data[0]);
+ EXPECT_EQ(0xFF, data[0]);
EXPECT_GE(data[1], 0x09);
- EXPECT_LE(data[1], 0x7f);
+ EXPECT_LE(data[1], 0x7F);
EXPECT_TRUE(std::equal(std::begin(expected_prefix),
std::end(expected_prefix), data.begin() + 2));
});
@@ -630,7 +624,7 @@ TEST_F(ValueSerializerTest, RoundTripDictionaryObject) {
TEST_F(ValueSerializerTest, DecodeDictionaryObject) {
// Empty object.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x6f, 0x7b, 0x00, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x7B, 0x00, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -640,8 +634,8 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObject) {
});
// String key.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01, 0x61, 0x3f, 0x01,
- 0x49, 0x54, 0x7b, 0x01},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01,
+ 0x49, 0x54, 0x7B, 0x01},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('a')"));
@@ -651,8 +645,8 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObject) {
});
// Integer key (treated as a string, but may be encoded differently).
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x49, 0x54, 0x3f, 0x01, 0x53,
- 0x01, 0x61, 0x7b, 0x01},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x49, 0x54, 0x3F, 0x01, 0x53,
+ 0x01, 0x61, 0x7B, 0x01},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('42')"));
@@ -662,20 +656,20 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObject) {
});
// Key order must be preserved.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01, 0x78, 0x3f, 0x01,
- 0x49, 0x02, 0x3f, 0x01, 0x53, 0x01, 0x79, 0x3f, 0x01, 0x49, 0x04, 0x3f,
- 0x01, 0x53, 0x01, 0x61, 0x3f, 0x01, 0x49, 0x06, 0x7b, 0x03},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x78, 0x3F, 0x01,
+ 0x49, 0x02, 0x3F, 0x01, 0x53, 0x01, 0x79, 0x3F, 0x01, 0x49, 0x04, 0x3F,
+ 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01, 0x49, 0x06, 0x7B, 0x03},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getOwnPropertyNames(result).toString() === 'x,y,a'"));
});
// A harder case of enumeration order.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x49, 0x02, 0x3f, 0x01,
- 0x49, 0x00, 0x3f, 0x01, 0x55, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x3f,
- 0x01, 0x49, 0x06, 0x3f, 0x01, 0x53, 0x01, 0x61, 0x3f, 0x01, 0x49,
- 0x04, 0x3f, 0x01, 0x53, 0x0a, 0x34, 0x32, 0x39, 0x34, 0x39, 0x36,
- 0x37, 0x32, 0x39, 0x35, 0x3f, 0x01, 0x49, 0x02, 0x7b, 0x04},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x49, 0x02, 0x3F, 0x01,
+ 0x49, 0x00, 0x3F, 0x01, 0x55, 0xFE, 0xFF, 0xFF, 0xFF, 0x0F, 0x3F,
+ 0x01, 0x49, 0x06, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01, 0x49,
+ 0x04, 0x3F, 0x01, 0x53, 0x0A, 0x34, 0x32, 0x39, 0x34, 0x39, 0x36,
+ 0x37, 0x32, 0x39, 0x35, 0x3F, 0x01, 0x49, 0x02, 0x7B, 0x04},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getOwnPropertyNames(result).toString() === "
@@ -689,8 +683,8 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObject) {
// before its properties are deserialized, so that references to it can be
// resolved.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x04, 0x73,
- 0x65, 0x6c, 0x66, 0x3f, 0x01, 0x5e, 0x00, 0x7b, 0x01, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x04, 0x73,
+ 0x65, 0x6C, 0x66, 0x3F, 0x01, 0x5E, 0x00, 0x7B, 0x01, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool("result === result.self"));
@@ -702,7 +696,7 @@ TEST_F(ValueSerializerTest, InvalidDecodeObjectWithInvalidKeyType) {
// object keys. The serializer would have obtained them from the own property
// keys list, which should only contain names and indices.
InvalidDecodeTest(
- {0xff, 0x09, 0x6f, 0x61, 0x00, 0x40, 0x00, 0x00, 0x7b, 0x01});
+ {0xFF, 0x09, 0x6F, 0x61, 0x00, 0x40, 0x00, 0x00, 0x7B, 0x01});
}
TEST_F(ValueSerializerTest, RoundTripOnlyOwnEnumerableStringKeys) {
@@ -820,8 +814,7 @@ TEST_F(ValueSerializerTest, RoundTripDictionaryObjectForTransitions) {
TEST_F(ValueSerializerTest, DecodeDictionaryObjectVersion0) {
// Empty object.
DecodeTestForVersion0(
- {0x7b, 0x00},
- [this](Local<Value> value) {
+ {0x7B, 0x00}, [this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Object.prototype"));
@@ -830,7 +823,7 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObjectVersion0) {
});
// String key.
DecodeTestForVersion0(
- {0x53, 0x01, 0x61, 0x49, 0x54, 0x7b, 0x01, 0x00},
+ {0x53, 0x01, 0x61, 0x49, 0x54, 0x7B, 0x01, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -842,7 +835,7 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObjectVersion0) {
});
// Integer key (treated as a string, but may be encoded differently).
DecodeTestForVersion0(
- {0x49, 0x54, 0x53, 0x01, 0x61, 0x7b, 0x01, 0x00},
+ {0x49, 0x54, 0x53, 0x01, 0x61, 0x7B, 0x01, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('42')"));
@@ -853,14 +846,14 @@ TEST_F(ValueSerializerTest, DecodeDictionaryObjectVersion0) {
// Key order must be preserved.
DecodeTestForVersion0(
{0x53, 0x01, 0x78, 0x49, 0x02, 0x53, 0x01, 0x79, 0x49, 0x04, 0x53, 0x01,
- 0x61, 0x49, 0x06, 0x7b, 0x03, 0x00},
+ 0x61, 0x49, 0x06, 0x7B, 0x03, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getOwnPropertyNames(result).toString() === 'x,y,a'"));
});
// A property and an element.
DecodeTestForVersion0(
- {0x49, 0x54, 0x53, 0x01, 0x61, 0x53, 0x01, 0x61, 0x49, 0x54, 0x7b, 0x02},
+ {0x49, 0x54, 0x53, 0x01, 0x61, 0x53, 0x01, 0x61, 0x49, 0x54, 0x7B, 0x02},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getOwnPropertyNames(result).toString() === '42,a'"));
@@ -954,9 +947,9 @@ TEST_F(ValueSerializerTest, RoundTripArray) {
TEST_F(ValueSerializerTest, DecodeArray) {
// A simple array of integers.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x41, 0x05, 0x3f, 0x01, 0x49, 0x02,
- 0x3f, 0x01, 0x49, 0x04, 0x3f, 0x01, 0x49, 0x06, 0x3f, 0x01,
- 0x49, 0x08, 0x3f, 0x01, 0x49, 0x0a, 0x24, 0x00, 0x05, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x41, 0x05, 0x3F, 0x01, 0x49, 0x02,
+ 0x3F, 0x01, 0x49, 0x04, 0x3F, 0x01, 0x49, 0x06, 0x3F, 0x01,
+ 0x49, 0x08, 0x3F, 0x01, 0x49, 0x0A, 0x24, 0x00, 0x05, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
EXPECT_EQ(5u, Array::Cast(*value)->Length());
@@ -966,8 +959,8 @@ TEST_F(ValueSerializerTest, DecodeArray) {
"result.toString() === '1,2,3,4,5'"));
});
// A long (sparse) array.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x61, 0xe8, 0x07, 0x3f, 0x01, 0x49,
- 0xe8, 0x07, 0x3f, 0x01, 0x49, 0x54, 0x40, 0x01, 0xe8, 0x07},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01, 0x49,
+ 0xE8, 0x07, 0x3F, 0x01, 0x49, 0x54, 0x40, 0x01, 0xE8, 0x07},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
EXPECT_EQ(1000u, Array::Cast(*value)->Length());
@@ -975,8 +968,8 @@ TEST_F(ValueSerializerTest, DecodeArray) {
});
// Duplicate reference.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x41, 0x02, 0x3f, 0x01, 0x6f, 0x7b, 0x00, 0x3f,
- 0x02, 0x5e, 0x01, 0x24, 0x00, 0x02},
+ {0xFF, 0x09, 0x3F, 0x00, 0x41, 0x02, 0x3F, 0x01, 0x6F, 0x7B, 0x00, 0x3F,
+ 0x02, 0x5E, 0x01, 0x24, 0x00, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
ASSERT_EQ(2u, Array::Cast(*value)->Length());
@@ -984,9 +977,9 @@ TEST_F(ValueSerializerTest, DecodeArray) {
});
// Duplicate reference in a sparse array.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x61, 0xe8, 0x07, 0x3f, 0x01, 0x49,
- 0x02, 0x3f, 0x01, 0x6f, 0x7b, 0x00, 0x3f, 0x02, 0x49, 0xe8,
- 0x07, 0x3f, 0x02, 0x5e, 0x01, 0x40, 0x02, 0xe8, 0x07, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01, 0x49,
+ 0x02, 0x3F, 0x01, 0x6F, 0x7B, 0x00, 0x3F, 0x02, 0x49, 0xE8,
+ 0x07, 0x3F, 0x02, 0x5E, 0x01, 0x40, 0x02, 0xE8, 0x07, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
ASSERT_EQ(1000u, Array::Cast(*value)->Length());
@@ -995,7 +988,7 @@ TEST_F(ValueSerializerTest, DecodeArray) {
EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === result[500]"));
});
// Self reference.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x41, 0x01, 0x3f, 0x01, 0x5e, 0x00, 0x24,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x41, 0x01, 0x3F, 0x01, 0x5E, 0x00, 0x24,
0x00, 0x01, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
@@ -1004,8 +997,8 @@ TEST_F(ValueSerializerTest, DecodeArray) {
});
// Self reference in a sparse array.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x61, 0xe8, 0x07, 0x3f, 0x01, 0x49,
- 0x8e, 0x08, 0x3f, 0x01, 0x5e, 0x00, 0x40, 0x01, 0xe8, 0x07},
+ {0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01, 0x49,
+ 0x8E, 0x08, 0x3F, 0x01, 0x5E, 0x00, 0x40, 0x01, 0xE8, 0x07},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
ASSERT_EQ(1000u, Array::Cast(*value)->Length());
@@ -1013,8 +1006,8 @@ TEST_F(ValueSerializerTest, DecodeArray) {
});
// Array with additional properties.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x41, 0x02, 0x3f, 0x01, 0x49, 0x02, 0x3f,
- 0x01, 0x49, 0x04, 0x3f, 0x01, 0x53, 0x03, 0x66, 0x6f, 0x6f, 0x3f,
+ {0xFF, 0x09, 0x3F, 0x00, 0x41, 0x02, 0x3F, 0x01, 0x49, 0x02, 0x3F,
+ 0x01, 0x49, 0x04, 0x3F, 0x01, 0x53, 0x03, 0x66, 0x6F, 0x6F, 0x3F,
0x01, 0x53, 0x03, 0x62, 0x61, 0x72, 0x24, 0x01, 0x02, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
@@ -1023,9 +1016,9 @@ TEST_F(ValueSerializerTest, DecodeArray) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.foo === 'bar'"));
});
// Sparse array with additional properties.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x61, 0xe8, 0x07, 0x3f, 0x01,
- 0x53, 0x03, 0x66, 0x6f, 0x6f, 0x3f, 0x01, 0x53, 0x03,
- 0x62, 0x61, 0x72, 0x40, 0x01, 0xe8, 0x07, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01,
+ 0x53, 0x03, 0x66, 0x6F, 0x6F, 0x3F, 0x01, 0x53, 0x03,
+ 0x62, 0x61, 0x72, 0x40, 0x01, 0xE8, 0x07, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
ASSERT_EQ(1000u, Array::Cast(*value)->Length());
@@ -1037,7 +1030,7 @@ TEST_F(ValueSerializerTest, DecodeArray) {
// Note that since the previous output from Chrome fails this test, an
// encoding using the sparse format was constructed instead.
DecodeTest(
- {0xff, 0x09, 0x61, 0x02, 0x49, 0x02, 0x5f, 0x40, 0x01, 0x02},
+ {0xFF, 0x09, 0x61, 0x02, 0x49, 0x02, 0x5F, 0x40, 0x01, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
ASSERT_EQ(2u, Array::Cast(*value)->Length());
@@ -1053,9 +1046,9 @@ TEST_F(ValueSerializerTest, DecodeArray) {
TEST_F(ValueSerializerTest, DecodeInvalidOverLargeArray) {
// So large it couldn't exist in the V8 heap, and its size couldn't fit in a
// SMI on 32-bit systems (2^30).
- InvalidDecodeTest({0xff, 0x09, 0x41, 0x80, 0x80, 0x80, 0x80, 0x04});
+ InvalidDecodeTest({0xFF, 0x09, 0x41, 0x80, 0x80, 0x80, 0x80, 0x04});
// Not so large, but there isn't enough data left in the buffer.
- InvalidDecodeTest({0xff, 0x09, 0x41, 0x01});
+ InvalidDecodeTest({0xFF, 0x09, 0x41, 0x01});
}
TEST_F(ValueSerializerTest, RoundTripArrayWithNonEnumerableElement) {
@@ -1245,7 +1238,7 @@ TEST_F(ValueSerializerTest, DecodeSparseArrayVersion0) {
DecodeTestForVersion0(
{0x55, 0x00, 0x53, 0x01, 'a', 0x55, 0x02, 0x55, 0x05, 0x53,
0x03, 'f', 'o', 'o', 0x53, 0x03, 'b', 'a', 'r', 0x53,
- 0x03, 'b', 'a', 'z', 0x49, 0x0b, 0x40, 0x04, 0x03, 0x00},
+ 0x03, 'b', 'a', 'z', 0x49, 0x0B, 0x40, 0x04, 0x03, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArray());
EXPECT_EQ(3u, Array::Cast(*value)->Length());
@@ -1282,17 +1275,17 @@ TEST_F(ValueSerializerTest, RoundTripDenseArrayContainingUndefined) {
TEST_F(ValueSerializerTest, DecodeDenseArrayContainingUndefined) {
// In previous versions, "undefined" in a dense array signified absence of the
// element (for compatibility). In new versions, it has a separate encoding.
- DecodeTest({0xff, 0x09, 0x41, 0x01, 0x5f, 0x24, 0x00, 0x01},
+ DecodeTest({0xFF, 0x09, 0x41, 0x01, 0x5F, 0x24, 0x00, 0x01},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
});
DecodeTest(
- {0xff, 0x0b, 0x41, 0x01, 0x5f, 0x24, 0x00, 0x01},
+ {0xFF, 0x0B, 0x41, 0x01, 0x5F, 0x24, 0x00, 0x01},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("0 in result"));
EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === undefined"));
});
- DecodeTest({0xff, 0x0b, 0x41, 0x01, 0x2d, 0x24, 0x00, 0x01},
+ DecodeTest({0xFF, 0x0B, 0x41, 0x01, 0x2D, 0x24, 0x00, 0x01},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
});
@@ -1324,29 +1317,29 @@ TEST_F(ValueSerializerTest, RoundTripDate) {
TEST_F(ValueSerializerTest, DecodeDate) {
#if defined(V8_TARGET_LITTLE_ENDIAN)
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84,
- 0x2e, 0x41, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84,
+ 0x2E, 0x41, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsDate());
EXPECT_EQ(1e6, Date::Cast(*value)->ValueOf());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Date.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x44, 0x00, 0x00, 0x20, 0x45, 0x27, 0x89,
- 0x87, 0xc2, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x00, 0x00, 0x20, 0x45, 0x27, 0x89,
+ 0x87, 0xC2, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsDate());
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toISOString() === '1867-07-01T00:00:00.000Z'"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf8, 0x7f, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xF8, 0x7F, 0x00},
[](Local<Value> value) {
ASSERT_TRUE(value->IsDate());
EXPECT_TRUE(std::isnan(Date::Cast(*value)->ValueOf()));
});
#else
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x44, 0x41, 0x2e, 0x84, 0x80, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x41, 0x2E, 0x84, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsDate());
@@ -1354,14 +1347,14 @@ TEST_F(ValueSerializerTest, DecodeDate) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Date.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x44, 0xc2, 0x87, 0x89, 0x27, 0x45, 0x20,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0xC2, 0x87, 0x89, 0x27, 0x45, 0x20,
0x00, 0x00, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsDate());
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toISOString() === '1867-07-01T00:00:00.000Z'"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x44, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00},
[](Local<Value> value) {
ASSERT_TRUE(value->IsDate());
@@ -1369,9 +1362,9 @@ TEST_F(ValueSerializerTest, DecodeDate) {
});
#endif
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01, 0x61, 0x3f,
- 0x01, 0x44, 0x00, 0x20, 0x39, 0x50, 0x37, 0x6a, 0x75, 0x42, 0x3f,
- 0x02, 0x53, 0x01, 0x62, 0x3f, 0x02, 0x5e, 0x01, 0x7b, 0x02},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F,
+ 0x01, 0x44, 0x00, 0x20, 0x39, 0x50, 0x37, 0x6A, 0x75, 0x42, 0x3F,
+ 0x02, 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Date"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
@@ -1440,37 +1433,35 @@ TEST_F(ValueSerializerTest, RejectsOtherValueObjects) {
TEST_F(ValueSerializerTest, DecodeValueObjects) {
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x79, 0x00},
- [this](Local<Value> value) {
+ {0xFF, 0x09, 0x3F, 0x00, 0x79, 0x00}, [this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Boolean.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === true"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x78, 0x00},
- [this](Local<Value> value) {
+ {0xFF, 0x09, 0x3F, 0x00, 0x78, 0x00}, [this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Boolean.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === false"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01, 0x61, 0x3f, 0x01,
- 0x79, 0x3f, 0x02, 0x53, 0x01, 0x62, 0x3f, 0x02, 0x5e, 0x01, 0x7b, 0x02},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01,
+ 0x79, 0x3F, 0x02, 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Boolean"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
});
#if defined(V8_TARGET_LITTLE_ENDIAN)
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45,
- 0xc0, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45,
+ 0xC0, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Number.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === -42"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf8, 0x7f, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xF8, 0x7F, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Number.prototype"));
@@ -1479,14 +1470,14 @@ TEST_F(ValueSerializerTest, DecodeValueObjects) {
});
#else
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6e, 0xc0, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00,
+ {0xFF, 0x09, 0x3F, 0x00, 0x6E, 0xC0, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Number.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === -42"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x6e, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x6E, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1496,14 +1487,14 @@ TEST_F(ValueSerializerTest, DecodeValueObjects) {
});
#endif
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01, 0x61, 0x3f,
- 0x01, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x40, 0x3f,
- 0x02, 0x53, 0x01, 0x62, 0x3f, 0x02, 0x5e, 0x01, 0x7b, 0x02},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F,
+ 0x01, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x40, 0x3F,
+ 0x02, 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Number"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x73, 0x07, 0x51, 0x75, 0xc3, 0xa9, 0x62,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x73, 0x07, 0x51, 0x75, 0xC3, 0xA9, 0x62,
0x65, 0x63, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1512,7 +1503,7 @@ TEST_F(ValueSerializerTest, DecodeValueObjects) {
"result.valueOf() === 'Qu\\xe9bec'"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 6"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x73, 0x04, 0xf0, 0x9f, 0x91, 0x8a},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x73, 0x04, 0xF0, 0x9F, 0x91, 0x8A},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === String.prototype"));
@@ -1521,16 +1512,16 @@ TEST_F(ValueSerializerTest, DecodeValueObjects) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 2"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01,
- 0x61, 0x3f, 0x01, 0x73, 0x00, 0x3f, 0x02, 0x53, 0x01,
- 0x62, 0x3f, 0x02, 0x5e, 0x01, 0x7b, 0x02, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01,
+ 0x61, 0x3F, 0x01, 0x73, 0x00, 0x3F, 0x02, 0x53, 0x01,
+ 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof String"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
});
// String object containing a Latin-1 string.
- DecodeTest({0xff, 0x0c, 0x73, 0x22, 0x06, 'Q', 'u', 0xe9, 'b', 'e', 'c'},
+ DecodeTest({0xFF, 0x0C, 0x73, 0x22, 0x06, 'Q', 'u', 0xE9, 'b', 'e', 'c'},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === String.prototype"));
@@ -1567,7 +1558,7 @@ TEST_F(ValueSerializerTest, RoundTripRegExp) {
}
TEST_F(ValueSerializerTest, DecodeRegExp) {
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x01},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x01},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsRegExp());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1575,7 +1566,7 @@ TEST_F(ValueSerializerTest, DecodeRegExp) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toString() === '/foo/g'"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x52, 0x07, 0x51, 0x75, 0xc3, 0xa9, 0x62,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x07, 0x51, 0x75, 0xC3, 0xA9, 0x62,
0x65, 0x63, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsRegExp());
@@ -1583,16 +1574,16 @@ TEST_F(ValueSerializerTest, DecodeRegExp) {
"result.toString() === '/Qu\\xe9bec/i'"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x52, 0x04, 0xf0, 0x9f, 0x91, 0x8a, 0x11, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x52, 0x04, 0xF0, 0x9F, 0x91, 0x8A, 0x11, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsRegExp());
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toString() === '/\\ud83d\\udc4a/gu'"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01, 0x61,
- 0x3f, 0x01, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x03, 0x3f, 0x02,
- 0x53, 0x01, 0x62, 0x3f, 0x02, 0x5e, 0x01, 0x7b, 0x02, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61,
+ 0x3F, 0x01, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x03, 0x3F, 0x02,
+ 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof RegExp"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
@@ -1600,7 +1591,7 @@ TEST_F(ValueSerializerTest, DecodeRegExp) {
// RegExp containing a Latin-1 string.
DecodeTest(
- {0xff, 0x0c, 0x52, 0x22, 0x06, 'Q', 'u', 0xe9, 'b', 'e', 'c', 0x02},
+ {0xFF, 0x0C, 0x52, 0x22, 0x06, 'Q', 'u', 0xE9, 'b', 'e', 'c', 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsRegExp());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1610,7 +1601,7 @@ TEST_F(ValueSerializerTest, DecodeRegExp) {
// Tests that invalid flags are not accepted by the deserializer.
TEST_F(ValueSerializerTest, DecodeRegExpDotAll) {
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x1f},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x1F},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsRegExp());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1618,7 +1609,7 @@ TEST_F(ValueSerializerTest, DecodeRegExpDotAll) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toString() === '/foo/gimuy'"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x3f},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x3F},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsRegExp());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1627,7 +1618,7 @@ TEST_F(ValueSerializerTest, DecodeRegExpDotAll) {
"result.toString() === '/foo/gimsuy'"));
});
InvalidDecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x7f});
+ {0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x7F});
}
TEST_F(ValueSerializerTest, RoundTripMap) {
@@ -1663,8 +1654,8 @@ TEST_F(ValueSerializerTest, RoundTripMap) {
TEST_F(ValueSerializerTest, DecodeMap) {
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x3b, 0x3f, 0x01, 0x49, 0x54, 0x3f, 0x01, 0x53,
- 0x03, 0x66, 0x6f, 0x6f, 0x3a, 0x02},
+ {0xFF, 0x09, 0x3F, 0x00, 0x3B, 0x3F, 0x01, 0x49, 0x54, 0x3F, 0x01, 0x53,
+ 0x03, 0x66, 0x6F, 0x6F, 0x3A, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsMap());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1672,8 +1663,8 @@ TEST_F(ValueSerializerTest, DecodeMap) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.get(42) === 'foo'"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3b, 0x3f, 0x01, 0x5e, 0x00, 0x3f, 0x01,
- 0x5e, 0x00, 0x3a, 0x02, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3B, 0x3F, 0x01, 0x5E, 0x00, 0x3F, 0x01,
+ 0x5E, 0x00, 0x3A, 0x02, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsMap());
EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
@@ -1681,10 +1672,10 @@ TEST_F(ValueSerializerTest, DecodeMap) {
"result.get(result) === result"));
});
// Iteration order must be preserved.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3b, 0x3f, 0x01, 0x49, 0x02, 0x3f,
- 0x01, 0x49, 0x00, 0x3f, 0x01, 0x53, 0x01, 0x61, 0x3f, 0x01,
- 0x49, 0x00, 0x3f, 0x01, 0x49, 0x06, 0x3f, 0x01, 0x49, 0x00,
- 0x3f, 0x01, 0x49, 0x04, 0x3f, 0x01, 0x49, 0x00, 0x3a, 0x08},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3B, 0x3F, 0x01, 0x49, 0x02, 0x3F,
+ 0x01, 0x49, 0x00, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01,
+ 0x49, 0x00, 0x3F, 0x01, 0x49, 0x06, 0x3F, 0x01, 0x49, 0x00,
+ 0x3F, 0x01, 0x49, 0x04, 0x3F, 0x01, 0x49, 0x00, 0x3A, 0x08},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsMap());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1763,8 +1754,8 @@ TEST_F(ValueSerializerTest, RoundTripSet) {
}
TEST_F(ValueSerializerTest, DecodeSet) {
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x27, 0x3f, 0x01, 0x49, 0x54, 0x3f, 0x01,
- 0x53, 0x03, 0x66, 0x6f, 0x6f, 0x2c, 0x02},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x27, 0x3F, 0x01, 0x49, 0x54, 0x3F, 0x01,
+ 0x53, 0x03, 0x66, 0x6F, 0x6F, 0x2C, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsSet());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1774,7 +1765,7 @@ TEST_F(ValueSerializerTest, DecodeSet) {
EXPECT_TRUE(EvaluateScriptForResultBool("result.has('foo')"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x27, 0x3f, 0x01, 0x5e, 0x00, 0x2c, 0x01, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x27, 0x3F, 0x01, 0x5E, 0x00, 0x2C, 0x01, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsSet());
EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
@@ -1782,8 +1773,8 @@ TEST_F(ValueSerializerTest, DecodeSet) {
});
// Iteration order must be preserved.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x27, 0x3f, 0x01, 0x49, 0x02, 0x3f, 0x01, 0x53,
- 0x01, 0x61, 0x3f, 0x01, 0x49, 0x06, 0x3f, 0x01, 0x49, 0x04, 0x2c, 0x04},
+ {0xFF, 0x09, 0x3F, 0x00, 0x27, 0x3F, 0x01, 0x49, 0x02, 0x3F, 0x01, 0x53,
+ 0x01, 0x61, 0x3F, 0x01, 0x49, 0x06, 0x3F, 0x01, 0x49, 0x04, 0x2C, 0x04},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsSet());
EXPECT_TRUE(EvaluateScriptForResultBool(
@@ -1849,14 +1840,14 @@ TEST_F(ValueSerializerTest, RoundTripArrayBuffer) {
}
TEST_F(ValueSerializerTest, DecodeArrayBuffer) {
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x42, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x42, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArrayBuffer());
EXPECT_EQ(0u, ArrayBuffer::Cast(*value)->ByteLength());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === ArrayBuffer.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x42, 0x03, 0x00, 0x80, 0xff, 0x00},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x42, 0x03, 0x00, 0x80, 0xFF, 0x00},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsArrayBuffer());
EXPECT_EQ(3u, ArrayBuffer::Cast(*value)->ByteLength());
@@ -1864,9 +1855,9 @@ TEST_F(ValueSerializerTest, DecodeArrayBuffer) {
"new Uint8Array(result).toString() === '0,128,255'"));
});
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x01,
- 0x61, 0x3f, 0x01, 0x42, 0x00, 0x3f, 0x02, 0x53, 0x01,
- 0x62, 0x3f, 0x02, 0x5e, 0x01, 0x7b, 0x02, 0x00},
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01,
+ 0x61, 0x3F, 0x01, 0x42, 0x00, 0x3F, 0x02, 0x53, 0x01,
+ 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(
EvaluateScriptForResultBool("result.a instanceof ArrayBuffer"));
@@ -1875,7 +1866,7 @@ TEST_F(ValueSerializerTest, DecodeArrayBuffer) {
}
TEST_F(ValueSerializerTest, DecodeInvalidArrayBuffer) {
- InvalidDecodeTest({0xff, 0x09, 0x42, 0xff, 0xff, 0x00});
+ InvalidDecodeTest({0xFF, 0x09, 0x42, 0xFF, 0xFF, 0x00});
}
// An array buffer allocator that never has available memory.
@@ -1904,8 +1895,8 @@ TEST_F(ValueSerializerTest, DecodeArrayBufferOOM) {
Context::Scope context_scope(context);
TryCatch try_catch(isolate);
- const std::vector<uint8_t> data = {0xff, 0x09, 0x3f, 0x00, 0x42,
- 0x03, 0x00, 0x80, 0xff, 0x00};
+ const std::vector<uint8_t> data = {0xFF, 0x09, 0x3F, 0x00, 0x42,
+ 0x03, 0x00, 0x80, 0xFF, 0x00};
ValueDeserializer deserializer(isolate, &data[0],
static_cast<int>(data.size()), nullptr);
deserializer.SetSupportsLegacyWireFormat(true);
@@ -1931,7 +1922,7 @@ class ValueSerializerTestWithArrayBufferTransfer : public ValueSerializerTest {
{
Context::Scope scope(deserialization_context());
output_buffer_ = ArrayBuffer::New(isolate(), kTestByteLength);
- const uint8_t data[kTestByteLength] = {0x00, 0x01, 0x80, 0xff};
+ const uint8_t data[kTestByteLength] = {0x00, 0x01, 0x80, 0xFF};
memcpy(output_buffer_->GetContents().Data(), data, kTestByteLength);
}
}
@@ -2044,7 +2035,7 @@ TEST_F(ValueSerializerTest, RoundTripTypedArray) {
TEST_F(ValueSerializerTest, DecodeTypedArray) {
// Check that the right type comes out the other side for every kind of typed
// array.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x02, 0x00, 0x00, 0x56,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x02, 0x00, 0x00, 0x56,
0x42, 0x00, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsUint8Array());
@@ -2053,7 +2044,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Uint8Array.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x02, 0x00, 0x00, 0x56,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x02, 0x00, 0x00, 0x56,
0x62, 0x00, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsInt8Array());
@@ -2063,7 +2054,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
"Object.getPrototypeOf(result) === Int8Array.prototype"));
});
#if defined(V8_TARGET_LITTLE_ENDIAN)
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
0x00, 0x56, 0x57, 0x00, 0x04},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsUint16Array());
@@ -2072,7 +2063,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Uint16Array.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
0x00, 0x56, 0x77, 0x00, 0x04},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsInt16Array());
@@ -2081,7 +2072,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Int16Array.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x08, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x44, 0x00, 0x08},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsUint32Array());
@@ -2090,7 +2081,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Uint32Array.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x08, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x64, 0x00, 0x08},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsInt32Array());
@@ -2099,7 +2090,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Int32Array.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x08, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x66, 0x00, 0x08},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsFloat32Array());
@@ -2108,7 +2099,7 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === Float32Array.prototype"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x10, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x56, 0x46, 0x00, 0x10},
[this](Local<Value> value) {
@@ -2121,22 +2112,22 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
#endif // V8_TARGET_LITTLE_ENDIAN
// Check that values of various kinds are suitably preserved.
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x03, 0x01, 0x80, 0xff,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x03, 0x01, 0x80, 0xFF,
0x56, 0x42, 0x00, 0x03, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toString() === '1,128,255'"));
});
#if defined(V8_TARGET_LITTLE_ENDIAN)
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x06, 0x00, 0x00, 0x00,
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x06, 0x00, 0x00, 0x00,
0x01, 0x00, 0x80, 0x56, 0x77, 0x00, 0x06},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toString() === '0,256,-32768'"));
});
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x10, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0xc0, 0x7f,
- 0x00, 0x00, 0x80, 0x7f, 0x56, 0x66, 0x00, 0x10},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0xC0, 0x7F,
+ 0x00, 0x00, 0x80, 0x7F, 0x56, 0x66, 0x00, 0x10},
[this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"result.toString() === '0,-0.5,NaN,Infinity'"));
@@ -2146,14 +2137,14 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
// Array buffer views sharing a buffer should do so on the other side.
// Similarly, multiple references to the same typed array should be resolved.
DecodeTest(
- {0xff, 0x09, 0x3f, 0x00, 0x6f, 0x3f, 0x01, 0x53, 0x02, 0x75, 0x38, 0x3f,
- 0x01, 0x3f, 0x01, 0x42, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x02, 0x75, 0x38, 0x3F,
+ 0x01, 0x3F, 0x01, 0x42, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x56, 0x42, 0x00, 0x20, 0x3f, 0x03, 0x53, 0x04, 0x75, 0x38, 0x5f,
- 0x32, 0x3f, 0x03, 0x5e, 0x02, 0x3f, 0x03, 0x53, 0x03, 0x66, 0x33, 0x32,
- 0x3f, 0x03, 0x3f, 0x03, 0x5e, 0x01, 0x56, 0x66, 0x04, 0x14, 0x3f, 0x04,
- 0x53, 0x01, 0x62, 0x3f, 0x04, 0x5e, 0x01, 0x7b, 0x04, 0x00},
+ 0x00, 0x56, 0x42, 0x00, 0x20, 0x3F, 0x03, 0x53, 0x04, 0x75, 0x38, 0x5F,
+ 0x32, 0x3F, 0x03, 0x5E, 0x02, 0x3F, 0x03, 0x53, 0x03, 0x66, 0x33, 0x32,
+ 0x3F, 0x03, 0x3F, 0x03, 0x5E, 0x01, 0x56, 0x66, 0x04, 0x14, 0x3F, 0x04,
+ 0x53, 0x01, 0x62, 0x3F, 0x04, 0x5E, 0x01, 0x7B, 0x04, 0x00},
[this](Local<Value> value) {
EXPECT_TRUE(
EvaluateScriptForResultBool("result.u8 instanceof Uint8Array"));
@@ -2170,19 +2161,19 @@ TEST_F(ValueSerializerTest, DecodeTypedArray) {
TEST_F(ValueSerializerTest, DecodeInvalidTypedArray) {
// Byte offset out of range.
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x42, 0x03, 0x01});
+ {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x42, 0x03, 0x01});
// Byte offset in range, offset + length out of range.
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x42, 0x01, 0x03});
+ {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x42, 0x01, 0x03});
// Byte offset not divisible by element size.
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x56, 0x77, 0x01, 0x02});
+ {0xFF, 0x09, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x56, 0x77, 0x01, 0x02});
// Byte length not divisible by element size.
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x56, 0x77, 0x02, 0x01});
- // Invalid view type (0xff).
+ {0xFF, 0x09, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x56, 0x77, 0x02, 0x01});
+ // Invalid view type (0xFF).
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0xff, 0x01, 0x01});
+ {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0xFF, 0x01, 0x01});
}
TEST_F(ValueSerializerTest, RoundTripDataView) {
@@ -2198,8 +2189,8 @@ TEST_F(ValueSerializerTest, RoundTripDataView) {
}
TEST_F(ValueSerializerTest, DecodeDataView) {
- DecodeTest({0xff, 0x09, 0x3f, 0x00, 0x3f, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x56, 0x3f, 0x01, 0x02},
+ DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x56, 0x3F, 0x01, 0x02},
[this](Local<Value> value) {
ASSERT_TRUE(value->IsDataView());
EXPECT_EQ(1u, DataView::Cast(*value)->ByteOffset());
@@ -2213,10 +2204,10 @@ TEST_F(ValueSerializerTest, DecodeDataView) {
TEST_F(ValueSerializerTest, DecodeInvalidDataView) {
// Byte offset out of range.
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x3f, 0x03, 0x01});
+ {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x3F, 0x03, 0x01});
// Byte offset in range, offset + length out of range.
InvalidDecodeTest(
- {0xff, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x3f, 0x01, 0x03});
+ {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x3F, 0x01, 0x03});
}
class ValueSerializerTestWithSharedArrayBufferTransfer
@@ -2303,7 +2294,7 @@ bool ValueSerializerTestWithSharedArrayBufferTransfer::flag_was_enabled_ =
TEST_F(ValueSerializerTestWithSharedArrayBufferTransfer,
RoundTripSharedArrayBufferTransfer) {
- InitializeData({0x00, 0x01, 0x80, 0xff});
+ InitializeData({0x00, 0x01, 0x80, 0xFF});
EXPECT_CALL(serializer_delegate_,
GetSharedArrayBufferId(isolate(), input_buffer()))
@@ -2345,7 +2336,7 @@ TEST_F(ValueSerializerTestWithSharedArrayBufferTransfer,
bool flag_was_enabled = i::FLAG_experimental_wasm_threads;
i::FLAG_experimental_wasm_threads = true;
- std::vector<uint8_t> data = {0x00, 0x01, 0x80, 0xff};
+ std::vector<uint8_t> data = {0x00, 0x01, 0x80, 0xFF};
data.resize(65536);
InitializeData(data);
@@ -2628,7 +2619,7 @@ TEST_F(ValueSerializerTestWithHostObject, DecodeSimpleHostObject) {
return NewHostObject(deserialization_context(), 0, nullptr);
}));
DecodeTest(
- {0xff, 0x0d, 0x5c, kExampleHostObjectTag}, [this](Local<Value> value) {
+ {0xFF, 0x0D, 0x5C, kExampleHostObjectTag}, [this](Local<Value> value) {
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
});
@@ -2963,67 +2954,67 @@ TEST_F(ValueSerializerTestWithWasm, ComplexObjectWithManyInline) {
// As produced around Chrome 56.
const unsigned char kSerializedIncrementerWasm[] = {
- 0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x2d, 0x00, 0x61, 0x73, 0x6d, 0x0d,
- 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7f, 0x01, 0x7f, 0x03,
- 0x02, 0x01, 0x00, 0x07, 0x0d, 0x01, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65,
- 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x0a, 0x08, 0x01, 0x06, 0x00, 0x20,
- 0x00, 0x41, 0x01, 0x6a, 0xf8, 0x04, 0xa1, 0x06, 0xde, 0xc0, 0xc6, 0x44,
- 0x3c, 0x29, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, 0x81, 0x4e,
- 0xce, 0x7c, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x30, 0x02,
- 0x00, 0x00, 0xb0, 0x25, 0x30, 0xe3, 0xf2, 0xdb, 0x2e, 0x48, 0x00, 0x00,
- 0x00, 0x80, 0xe8, 0x00, 0x00, 0x80, 0xe0, 0x01, 0x00, 0x80, 0x00, 0x00,
+ 0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x2D, 0x00, 0x61, 0x73, 0x6D, 0x0D,
+ 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7F, 0x01, 0x7F, 0x03,
+ 0x02, 0x01, 0x00, 0x07, 0x0D, 0x01, 0x09, 0x69, 0x6E, 0x63, 0x72, 0x65,
+ 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x0A, 0x08, 0x01, 0x06, 0x00, 0x20,
+ 0x00, 0x41, 0x01, 0x6A, 0xF8, 0x04, 0xA1, 0x06, 0xDE, 0xC0, 0xC6, 0x44,
+ 0x3C, 0x29, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x02, 0x00, 0x00, 0x81, 0x4E,
+ 0xCE, 0x7C, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x30, 0x02,
+ 0x00, 0x00, 0xB0, 0x25, 0x30, 0xE3, 0xF2, 0xDB, 0x2E, 0x48, 0x00, 0x00,
+ 0x00, 0x80, 0xE8, 0x00, 0x00, 0x80, 0xE0, 0x01, 0x00, 0x80, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x07, 0x08, 0x00, 0x00, 0x09, 0x04,
- 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3c, 0x8c, 0xc0, 0x00, 0x00,
- 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x01, 0x10, 0x8c, 0xc0, 0x00, 0x00,
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x70, 0x94, 0x01, 0x0c, 0x8b,
- 0xc1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x25, 0xdc, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x10, 0x8c, 0xc0, 0x00, 0x00,
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x84, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x7d, 0x01, 0x1a, 0xe1, 0x02, 0x00, 0x00,
+ 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3C, 0x8C, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x01, 0x10, 0x8C, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x70, 0x94, 0x01, 0x0C, 0x8B,
+ 0xC1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x25, 0xDC, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x01, 0x10, 0x8C, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x05, 0x7D, 0x01, 0x1A, 0xE1, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x23, 0x88, 0x42, 0x32, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x02, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x49, 0x3b, 0xa5, 0x60, 0x0c, 0x00,
- 0x00, 0x0f, 0x86, 0x04, 0x00, 0x00, 0x00, 0x83, 0xc0, 0x01, 0xc3, 0x55,
- 0x48, 0x89, 0xe5, 0x49, 0xba, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
- 0x00, 0x41, 0x52, 0x48, 0x83, 0xec, 0x08, 0x48, 0x89, 0x45, 0xf0, 0x48,
- 0xbb, 0xb0, 0x67, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xc0, 0x48,
- 0xbe, 0xe1, 0x57, 0x81, 0x85, 0xf6, 0x14, 0x00, 0x00, 0xe8, 0xfc, 0x3c,
- 0xea, 0xff, 0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0xe5, 0x5d, 0xeb, 0xbf,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x04, 0x00,
+ 0x00, 0x02, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x49, 0x3B, 0xA5, 0x60, 0x0C, 0x00,
+ 0x00, 0x0F, 0x86, 0x04, 0x00, 0x00, 0x00, 0x83, 0xC0, 0x01, 0xC3, 0x55,
+ 0x48, 0x89, 0xE5, 0x49, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
+ 0x00, 0x41, 0x52, 0x48, 0x83, 0xEC, 0x08, 0x48, 0x89, 0x45, 0xF0, 0x48,
+ 0xBB, 0xB0, 0x67, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xC0, 0x48,
+ 0xBE, 0xE1, 0x57, 0x81, 0x85, 0xF6, 0x14, 0x00, 0x00, 0xE8, 0xFC, 0x3C,
+ 0xEA, 0xFF, 0x48, 0x8B, 0x45, 0xF0, 0x48, 0x8B, 0xE5, 0x5D, 0xEB, 0xBF,
0x66, 0x90, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x44, 0x00,
- 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x20, 0x84, 0x0f, 0x7d, 0x01, 0x0d, 0x00, 0x0f, 0x04,
- 0x6d, 0x08, 0x0f, 0xf0, 0x02, 0x80, 0x94, 0x01, 0x0c, 0x8b, 0xc1, 0x00,
- 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xed, 0xa9, 0x2d, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x9e, 0xe0, 0x38, 0x1a, 0x61, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0F, 0x20, 0x84, 0x0F, 0x7D, 0x01, 0x0D, 0x00, 0x0F, 0x04,
+ 0x6D, 0x08, 0x0F, 0xF0, 0x02, 0x80, 0x94, 0x01, 0x0C, 0x8B, 0xC1, 0x00,
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xED, 0xA9, 0x2D, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x9E, 0xE0, 0x38, 0x1A, 0x61, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x23, 0x88, 0x42, 0x32, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
- 0x02, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x55, 0x48, 0x89, 0xe5, 0x56, 0x57, 0x48,
- 0x8b, 0x45, 0x10, 0xe8, 0x11, 0xed, 0xed, 0xff, 0xa8, 0x01, 0x0f, 0x85,
- 0x2d, 0x00, 0x00, 0x00, 0x48, 0xc1, 0xe8, 0x20, 0xc5, 0xf9, 0x57, 0xc0,
- 0xc5, 0xfb, 0x2a, 0xc0, 0xc4, 0xe1, 0xfb, 0x2c, 0xc0, 0x48, 0x83, 0xf8,
- 0x01, 0x0f, 0x80, 0x34, 0x00, 0x00, 0x00, 0x8b, 0xc0, 0xe8, 0x27, 0xfe,
- 0xff, 0xff, 0x48, 0xc1, 0xe0, 0x20, 0x48, 0x8b, 0xe5, 0x5d, 0xc2, 0x10,
- 0x00, 0x49, 0x39, 0x45, 0xa0, 0x0f, 0x84, 0x07, 0x00, 0x00, 0x00, 0xc5,
- 0xfb, 0x10, 0x40, 0x07, 0xeb, 0xce, 0x49, 0xba, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xf8, 0x7f, 0xc4, 0xc1, 0xf9, 0x6e, 0xc2, 0xeb, 0xbd, 0x48,
- 0x83, 0xec, 0x08, 0xc5, 0xfb, 0x11, 0x04, 0x24, 0xe8, 0xcc, 0xfe, 0xff,
- 0xff, 0x48, 0x83, 0xc4, 0x08, 0xeb, 0xb8, 0x66, 0x90, 0x02, 0x00, 0x00,
- 0x00, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0x0f, 0x39, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x00,
- 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x20, 0x84,
- 0x0f, 0xcc, 0x6e, 0x7d, 0x01, 0x72, 0x98, 0x00, 0x0f, 0xdc, 0x6d, 0x0c,
- 0x0f, 0xb0, 0x84, 0x0d, 0x04, 0x84, 0xe3, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x84, 0xe0, 0x84, 0x84, 0x18, 0x2f, 0x2f, 0x2f,
- 0x2f, 0x2f};
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
+ 0x02, 0xF9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x55, 0x48, 0x89, 0xE5, 0x56, 0x57, 0x48,
+ 0x8B, 0x45, 0x10, 0xE8, 0x11, 0xED, 0xED, 0xFF, 0xA8, 0x01, 0x0F, 0x85,
+ 0x2D, 0x00, 0x00, 0x00, 0x48, 0xC1, 0xE8, 0x20, 0xC5, 0xF9, 0x57, 0xC0,
+ 0xC5, 0xFB, 0x2A, 0xC0, 0xC4, 0xE1, 0xFB, 0x2C, 0xC0, 0x48, 0x83, 0xF8,
+ 0x01, 0x0F, 0x80, 0x34, 0x00, 0x00, 0x00, 0x8B, 0xC0, 0xE8, 0x27, 0xFE,
+ 0xFF, 0xFF, 0x48, 0xC1, 0xE0, 0x20, 0x48, 0x8B, 0xE5, 0x5D, 0xC2, 0x10,
+ 0x00, 0x49, 0x39, 0x45, 0xA0, 0x0F, 0x84, 0x07, 0x00, 0x00, 0x00, 0xC5,
+ 0xFB, 0x10, 0x40, 0x07, 0xEB, 0xCE, 0x49, 0xBA, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xF8, 0x7F, 0xC4, 0xC1, 0xF9, 0x6E, 0xC2, 0xEB, 0xBD, 0x48,
+ 0x83, 0xEC, 0x08, 0xC5, 0xFB, 0x11, 0x04, 0x24, 0xE8, 0xCC, 0xFE, 0xFF,
+ 0xFF, 0x48, 0x83, 0xC4, 0x08, 0xEB, 0xB8, 0x66, 0x90, 0x02, 0x00, 0x00,
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0x0F, 0x39, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0x00,
+ 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x20, 0x84,
+ 0x0F, 0xCC, 0x6E, 0x7D, 0x01, 0x72, 0x98, 0x00, 0x0F, 0xDC, 0x6D, 0x0C,
+ 0x0F, 0xB0, 0x84, 0x0D, 0x04, 0x84, 0xE3, 0xC0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x84, 0xE0, 0x84, 0x84, 0x18, 0x2F, 0x2F, 0x2F,
+ 0x2F, 0x2F};
TEST_F(ValueSerializerTestWithWasm, DecodeWasmModule) {
- if (true) return; // TODO(mtrofin): fix this test
+ if ((true)) return; // TODO(mtrofin): fix this test
std::vector<uint8_t> raw(
kSerializedIncrementerWasm,
kSerializedIncrementerWasm + sizeof(kSerializedIncrementerWasm));
@@ -3037,14 +3028,14 @@ TEST_F(ValueSerializerTestWithWasm, DecodeWasmModule) {
// As above, but with empty compiled data. Should work due to fallback to wire
// data.
const unsigned char kSerializedIncrementerWasmWithInvalidCompiledData[] = {
- 0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x2d, 0x00, 0x61, 0x73, 0x6d,
- 0x0d, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7f, 0x01,
- 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x0d, 0x01, 0x09, 0x69, 0x6e,
- 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x0a, 0x08,
- 0x01, 0x06, 0x00, 0x20, 0x00, 0x41, 0x01, 0x6a, 0x00};
+ 0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x2D, 0x00, 0x61, 0x73, 0x6D,
+ 0x0D, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7F, 0x01,
+ 0x7F, 0x03, 0x02, 0x01, 0x00, 0x07, 0x0D, 0x01, 0x09, 0x69, 0x6E,
+ 0x63, 0x72, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x0A, 0x08,
+ 0x01, 0x06, 0x00, 0x20, 0x00, 0x41, 0x01, 0x6A, 0x00};
TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidCompiledData) {
- if (true) return; // TODO(titzer): regenerate this test
+ if ((true)) return; // TODO(titzer): regenerate this test
std::vector<uint8_t> raw(
kSerializedIncrementerWasmWithInvalidCompiledData,
kSerializedIncrementerWasmWithInvalidCompiledData +
@@ -3058,7 +3049,7 @@ TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidCompiledData) {
// As above, but also with empty wire data. Should fail.
const unsigned char kSerializedIncrementerWasmInvalid[] = {
- 0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x00, 0x00};
+ 0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x00, 0x00};
TEST_F(ValueSerializerTestWithWasm,
DecodeWasmModuleWithInvalidCompiledAndWireData) {
@@ -3069,8 +3060,8 @@ TEST_F(ValueSerializerTestWithWasm,
}
TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidDataLength) {
- InvalidDecodeTest({0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x7f, 0x00});
- InvalidDecodeTest({0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x00, 0x7f});
+ InvalidDecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x7F, 0x00});
+ InvalidDecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x00, 0x7F});
}
} // namespace
diff --git a/deps/v8/test/unittests/wasm/decoder-unittest.cc b/deps/v8/test/unittests/wasm/decoder-unittest.cc
index 24606a43fd..627a9da3ee 100644
--- a/deps/v8/test/unittests/wasm/decoder-unittest.cc
+++ b/deps/v8/test/unittests/wasm/decoder-unittest.cc
@@ -185,7 +185,7 @@ TEST_F(DecoderTest, ReadU32v_FiveByte) {
const uint32_t max = 0xFFFFFFFFu;
for (uint32_t i = 1; i < 32; i++) {
- uint32_t val = 0x983489aau << i;
+ uint32_t val = 0x983489AAu << i;
CHECK_UINT32V_INLINE(val, 5, U32V_5(val), 0);
}
@@ -442,7 +442,7 @@ TEST_F(DecoderTest, ReadU32v_extra_bits) {
TEST_F(DecoderTest, ReadI32v_extra_bits_negative) {
// OK for negative signed values to have extra ones.
unsigned length = 0;
- byte data[] = {0xff, 0xff, 0xff, 0xff, 0x7f};
+ byte data[] = {0xFF, 0xFF, 0xFF, 0xFF, 0x7F};
decoder.Reset(data, data + sizeof(data));
decoder.read_i32v<Decoder::kValidate>(decoder.start(), &length);
EXPECT_EQ(5u, length);
@@ -463,11 +463,11 @@ TEST_F(DecoderTest, ReadU32v_Bits) {
// A more exhaustive test.
const int kMaxSize = 5;
const uint32_t kVals[] = {
- 0xaabbccdd, 0x11223344, 0x33445566, 0xffeeddcc, 0xF0F0F0F0, 0x0F0F0F0F,
- 0xEEEEEEEE, 0xAAAAAAAA, 0x12345678, 0x9abcdef0, 0x80309488, 0x729ed997,
- 0xc4a0cf81, 0x16c6eb85, 0x4206db8e, 0xf3b089d5, 0xaa2e223e, 0xf99e29c8,
- 0x4a4357d8, 0x1890b1c1, 0x8d80a085, 0xacb6ae4c, 0x1b827e10, 0xeb5c7bd9,
- 0xbb1bc146, 0xdf57a33l};
+ 0xAABBCCDD, 0x11223344, 0x33445566, 0xFFEEDDCC, 0xF0F0F0F0, 0x0F0F0F0F,
+ 0xEEEEEEEE, 0xAAAAAAAA, 0x12345678, 0x9ABCDEF0, 0x80309488, 0x729ED997,
+ 0xC4A0CF81, 0x16C6EB85, 0x4206DB8E, 0xF3B089D5, 0xAA2E223E, 0xF99E29C8,
+ 0x4A4357D8, 0x1890B1C1, 0x8D80A085, 0xACB6AE4C, 0x1B827E10, 0xEB5C7BD9,
+ 0xBB1BC146, 0xDF57A33l};
byte data[kMaxSize];
// foreach value in above array
@@ -560,11 +560,11 @@ TEST_F(DecoderTest, ReadU64v_PowerOf2) {
TEST_F(DecoderTest, ReadU64v_Bits) {
const int kMaxSize = 10;
const uint64_t kVals[] = {
- 0xaabbccdd11223344ull, 0x33445566ffeeddccull, 0xF0F0F0F0F0F0F0F0ull,
+ 0xAABBCCDD11223344ull, 0x33445566FFEEDDCCull, 0xF0F0F0F0F0F0F0F0ull,
0x0F0F0F0F0F0F0F0Full, 0xEEEEEEEEEEEEEEEEull, 0xAAAAAAAAAAAAAAAAull,
- 0x123456789abcdef0ull, 0x80309488729ed997ull, 0xc4a0cf8116c6eb85ull,
- 0x4206db8ef3b089d5ull, 0xaa2e223ef99e29c8ull, 0x4a4357d81890b1c1ull,
- 0x8d80a085acb6ae4cull, 0x1b827e10eb5c7bd9ull, 0xbb1bc146df57a338ull};
+ 0x123456789ABCDEF0ull, 0x80309488729ED997ull, 0xC4A0CF8116C6EB85ull,
+ 0x4206DB8EF3B089D5ull, 0xAA2E223EF99E29C8ull, 0x4A4357D81890B1C1ull,
+ 0x8D80A085ACB6AE4Cull, 0x1B827E10EB5C7BD9ull, 0xBB1BC146DF57A338ull};
byte data[kMaxSize];
// foreach value in above array
@@ -603,11 +603,11 @@ TEST_F(DecoderTest, ReadI64v_Bits) {
const int kMaxSize = 10;
// Exhaustive signedness test.
const uint64_t kVals[] = {
- 0xaabbccdd11223344ull, 0x33445566ffeeddccull, 0xF0F0F0F0F0F0F0F0ull,
+ 0xAABBCCDD11223344ull, 0x33445566FFEEDDCCull, 0xF0F0F0F0F0F0F0F0ull,
0x0F0F0F0F0F0F0F0Full, 0xEEEEEEEEEEEEEEEEull, 0xAAAAAAAAAAAAAAAAull,
- 0x123456789abcdef0ull, 0x80309488729ed997ull, 0xc4a0cf8116c6eb85ull,
- 0x4206db8ef3b089d5ull, 0xaa2e223ef99e29c8ull, 0x4a4357d81890b1c1ull,
- 0x8d80a085acb6ae4cull, 0x1b827e10eb5c7bd9ull, 0xbb1bc146df57a338ull};
+ 0x123456789ABCDEF0ull, 0x80309488729ED997ull, 0xC4A0CF8116C6EB85ull,
+ 0x4206DB8EF3B089D5ull, 0xAA2E223EF99E29C8ull, 0x4A4357D81890B1C1ull,
+ 0x8D80A085ACB6AE4Cull, 0x1B827E10EB5C7BD9ull, 0xBB1BC146DF57A338ull};
byte data[kMaxSize];
// foreach value in above array
@@ -656,7 +656,7 @@ TEST_F(DecoderTest, ReadU64v_extra_bits) {
TEST_F(DecoderTest, ReadI64v_extra_bits_negative) {
// OK for negative signed values to have extra ones.
unsigned length = 0;
- byte data[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f};
+ byte data[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F};
decoder.Reset(data, data + sizeof(data));
decoder.read_i64v<Decoder::kValidate>(decoder.start(), &length);
EXPECT_EQ(10u, length);
diff --git a/deps/v8/test/unittests/wasm/function-body-decoder-unittest.cc b/deps/v8/test/unittests/wasm/function-body-decoder-unittest.cc
index d02dca36be..5cc4bf8196 100644
--- a/deps/v8/test/unittests/wasm/function-body-decoder-unittest.cc
+++ b/deps/v8/test/unittests/wasm/function-body-decoder-unittest.cc
@@ -52,36 +52,40 @@ static const WasmOpcode kInt32BinopOpcodes[] = {
#define WASM_BRV_IF_ZERO(depth, val) \
val, WASM_ZERO, kExprBrIf, static_cast<byte>(depth)
-#define EXPECT_VERIFIES_C(sig, x) Verify(true, sigs.sig(), x, x + arraysize(x))
+#define EXPECT_VERIFIES_C(sig, x) \
+ Verify(true, sigs.sig(), x, x + arraysize(x), kAppendEnd)
-#define EXPECT_FAILURE_C(sig, x) Verify(false, sigs.sig(), x, x + arraysize(x))
+#define EXPECT_FAILURE_C(sig, x) \
+ Verify(false, sigs.sig(), x, x + arraysize(x), kAppendEnd)
-#define EXPECT_VERIFIES_SC(sig, x) Verify(true, sig, x, x + arraysize(x))
+#define EXPECT_VERIFIES_SC(sig, x) \
+ Verify(true, sig, x, x + arraysize(x), kAppendEnd)
-#define EXPECT_FAILURE_SC(sig, x) Verify(false, sig, x, x + arraysize(x))
+#define EXPECT_FAILURE_SC(sig, x) \
+ Verify(false, sig, x, x + arraysize(x), kAppendEnd)
-#define EXPECT_VERIFIES_S(env, ...) \
- do { \
- static byte code[] = {__VA_ARGS__}; \
- Verify(true, env, code, code + arraysize(code)); \
+#define EXPECT_VERIFIES_S(env, ...) \
+ do { \
+ static byte code[] = {__VA_ARGS__}; \
+ Verify(true, env, code, code + arraysize(code), kAppendEnd); \
} while (false)
-#define EXPECT_FAILURE_S(env, ...) \
- do { \
- static byte code[] = {__VA_ARGS__}; \
- Verify(false, env, code, code + arraysize(code)); \
+#define EXPECT_FAILURE_S(env, ...) \
+ do { \
+ static byte code[] = {__VA_ARGS__}; \
+ Verify(false, env, code, code + arraysize(code), kAppendEnd); \
} while (false)
-#define EXPECT_VERIFIES(sig, ...) \
- do { \
- static const byte code[] = {__VA_ARGS__}; \
- Verify(true, sigs.sig(), code, code + sizeof(code)); \
+#define EXPECT_VERIFIES(sig, ...) \
+ do { \
+ static const byte code[] = {__VA_ARGS__}; \
+ Verify(true, sigs.sig(), code, code + sizeof(code), kAppendEnd); \
} while (false)
-#define EXPECT_FAILURE(sig, ...) \
- do { \
- static const byte code[] = {__VA_ARGS__}; \
- Verify(false, sigs.sig(), code, code + sizeof(code)); \
+#define EXPECT_FAILURE(sig, ...) \
+ do { \
+ static const byte code[] = {__VA_ARGS__}; \
+ Verify(false, sigs.sig(), code, code + sizeof(code), kAppendEnd); \
} while (false)
class FunctionBodyDecoderTest : public TestWithZone {
@@ -98,18 +102,24 @@ class FunctionBodyDecoderTest : public TestWithZone {
local_decls.AddLocals(count, type);
}
- void PrepareBytecode(const byte** startp, const byte** endp) {
+ enum AppendEnd : bool { kAppendEnd, kOmitEnd };
+
+ void PrepareBytecode(const byte** startp, const byte** endp,
+ AppendEnd append_end) {
const byte* start = *startp;
const byte* end = *endp;
size_t locals_size = local_decls.Size();
- size_t total_size = end - start + locals_size + 1;
+ size_t total_size = end - start + locals_size;
+ if (append_end == kAppendEnd) ++total_size;
byte* buffer = static_cast<byte*>(zone()->New(total_size));
// Prepend the local decls to the code.
local_decls.Emit(buffer);
// Emit the code.
memcpy(buffer + locals_size, start, end - start);
- // Append an extra end opcode.
- buffer[total_size - 1] = kExprEnd;
+ if (append_end == kAppendEnd) {
+ // Append an extra end opcode.
+ buffer[total_size - 1] = kExprEnd;
+ }
*startp = buffer;
*endp = buffer + total_size;
@@ -118,8 +128,8 @@ class FunctionBodyDecoderTest : public TestWithZone {
// Prepends local variable declarations and renders nice error messages for
// verification failures.
void Verify(bool expected_success, FunctionSig* sig, const byte* start,
- const byte* end) {
- PrepareBytecode(&start, &end);
+ const byte* end, AppendEnd append_end) {
+ PrepareBytecode(&start, &end, append_end);
// Verify the code.
DecodeResult result =
@@ -253,8 +263,8 @@ TEST_F(FunctionBodyDecoderTest, Int32Const1) {
TEST_F(FunctionBodyDecoderTest, EmptyFunction) {
byte code[] = {0};
- Verify(true, sigs.v_v(), code, code);
- Verify(false, sigs.i_i(), code, code);
+ Verify(true, sigs.v_v(), code, code, kAppendEnd);
+ Verify(false, sigs.i_i(), code, code, kAppendEnd);
}
TEST_F(FunctionBodyDecoderTest, IncompleteIf1) {
@@ -307,10 +317,12 @@ TEST_F(FunctionBodyDecoderTest, Float64Const) {
}
TEST_F(FunctionBodyDecoderTest, Int32Const_off_end) {
- byte code[] = {kExprI32Const, 0xaa, 0xbb, 0xcc, 0x44};
+ byte code[] = {kExprI32Const, 0xAA, 0xBB, 0xCC, 0x44};
for (int size = 1; size <= 4; size++) {
- Verify(false, sigs.i_i(), code, code + size);
+ Verify(false, sigs.i_i(), code, code + size, kAppendEnd);
+ // Should also fail without the trailing 'end' opcode.
+ Verify(false, sigs.i_i(), code, code + size, kOmitEnd);
}
}
@@ -496,7 +508,7 @@ TEST_F(FunctionBodyDecoderTest, BlockN) {
buffer[0] = kExprBlock;
buffer[1] = kLocalVoid;
buffer[i + 2] = kExprEnd;
- Verify(true, sigs.v_i(), buffer, buffer + i + 3);
+ Verify(true, sigs.v_i(), buffer, buffer + i + 3, kAppendEnd);
}
}
@@ -643,7 +655,8 @@ TEST_F(FunctionBodyDecoderTest, BlockN_off_end) {
byte code[] = {WASM_BLOCK(kExprNop, kExprNop, kExprNop, kExprNop)};
EXPECT_VERIFIES_C(v_v, code);
for (size_t i = 1; i < arraysize(code); i++) {
- Verify(false, sigs.v_v(), code, code + i);
+ Verify(false, sigs.v_v(), code, code + i, kAppendEnd);
+ Verify(false, sigs.v_v(), code, code + i, kOmitEnd);
}
}
@@ -973,7 +986,8 @@ TEST_F(FunctionBodyDecoderTest, If_off_end) {
static const byte kCode[] = {
WASM_IF_ELSE(WASM_GET_LOCAL(0), WASM_GET_LOCAL(0), WASM_GET_LOCAL(0))};
for (size_t len = 3; len < arraysize(kCode); len++) {
- Verify(false, sigs.i_i(), kCode, kCode + len);
+ Verify(false, sigs.i_i(), kCode, kCode + len, kAppendEnd);
+ Verify(false, sigs.i_i(), kCode, kCode + len, kOmitEnd);
}
}
@@ -1566,6 +1580,40 @@ TEST_F(FunctionBodyDecoderTest, IndirectCallsWithoutTableCrash) {
WASM_I32V_2(72)));
}
+TEST_F(FunctionBodyDecoderTest, IncompleteIndirectCall) {
+ FunctionSig* sig = sigs.i_i();
+ TestModuleBuilder builder;
+ builder.InitializeFunctionTable();
+ module = builder.module();
+
+ static byte code[] = {kExprCallIndirect};
+ Verify(false, sig, code, code + arraysize(code), kOmitEnd);
+}
+
+TEST_F(FunctionBodyDecoderTest, IncompleteStore) {
+ FunctionSig* sig = sigs.i_i();
+ TestModuleBuilder builder;
+ builder.InitializeMemory();
+ builder.InitializeFunctionTable();
+ module = builder.module();
+
+ static byte code[] = {kExprI32StoreMem};
+ Verify(false, sig, code, code + arraysize(code), kOmitEnd);
+}
+
+TEST_F(FunctionBodyDecoderTest, IncompleteS8x16Shuffle) {
+ EXPERIMENTAL_FLAG_SCOPE(simd);
+ FunctionSig* sig = sigs.i_i();
+ TestModuleBuilder builder;
+ builder.InitializeMemory();
+ builder.InitializeFunctionTable();
+ module = builder.module();
+
+ static byte code[] = {kSimdPrefix,
+ static_cast<byte>(kExprS8x16Shuffle & 0xff)};
+ Verify(false, sig, code, code + arraysize(code), kOmitEnd);
+}
+
TEST_F(FunctionBodyDecoderTest, SimpleImportCalls) {
FunctionSig* sig = sigs.i_i();
TestModuleBuilder builder;
@@ -2139,7 +2187,8 @@ TEST_F(FunctionBodyDecoderTest, BrTable2b) {
TEST_F(FunctionBodyDecoderTest, BrTable_off_end) {
static byte code[] = {B1(WASM_BR_TABLE(WASM_GET_LOCAL(0), 0, BR_TARGET(0)))};
for (size_t len = 1; len < sizeof(code); len++) {
- Verify(false, sigs.i_i(), code, code + len);
+ Verify(false, sigs.i_i(), code, code + len, kAppendEnd);
+ Verify(false, sigs.i_i(), code, code + len, kOmitEnd);
}
}
@@ -2616,7 +2665,7 @@ TEST_F(FunctionBodyDecoderTest, Regression709741) {
byte code[] = {WASM_NOP};
const byte* start = code;
const byte* end = code + sizeof(code);
- PrepareBytecode(&start, &end);
+ PrepareBytecode(&start, &end, kAppendEnd);
for (const byte* i = start; i < end; i++) {
DecodeResult result =
@@ -2919,16 +2968,16 @@ TEST_F(WasmOpcodeLengthTest, SimpleExpressions) {
TEST_F(WasmOpcodeLengthTest, SimdExpressions) {
#define TEST_SIMD(name, opcode, sig) \
- EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff));
+ EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xFF));
FOREACH_SIMD_0_OPERAND_OPCODE(TEST_SIMD)
#undef TEST_SIMD
#define TEST_SIMD(name, opcode, sig) \
- EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff));
+ EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xFF));
FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD)
#undef TEST_SIMD
- EXPECT_LENGTH_N(18, kSimdPrefix, static_cast<byte>(kExprS8x16Shuffle & 0xff));
+ EXPECT_LENGTH_N(18, kSimdPrefix, static_cast<byte>(kExprS8x16Shuffle & 0xFF));
// test for bad simd opcode
- EXPECT_LENGTH_N(2, kSimdPrefix, 0xff);
+ EXPECT_LENGTH_N(2, kSimdPrefix, 0xFF);
}
#undef EXPECT_LENGTH
diff --git a/deps/v8/test/unittests/wasm/leb-helper-unittest.cc b/deps/v8/test/unittests/wasm/leb-helper-unittest.cc
index ec9fd3efb3..704703a3ea 100644
--- a/deps/v8/test/unittests/wasm/leb-helper-unittest.cc
+++ b/deps/v8/test/unittests/wasm/leb-helper-unittest.cc
@@ -119,7 +119,7 @@ TEST_F(LEBHelperTest, WriteAndDecode_u32v) {
CheckEncodeDecode_u32v(87348723);
CheckEncodeDecode_u32v(77777);
- for (uint32_t val = 0x3a; val != 0; val = val << 1) {
+ for (uint32_t val = 0x3A; val != 0; val = val << 1) {
CheckEncodeDecode_u32v(val);
}
}
@@ -141,7 +141,7 @@ TEST_F(LEBHelperTest, WriteAndDecode_i32v) {
CheckEncodeDecode_i32v(-87328723);
CheckEncodeDecode_i32v(-77377);
- for (uint32_t val = 0x3a; val != 0; val = val << 1) {
+ for (uint32_t val = 0x3A; val != 0; val = val << 1) {
CheckEncodeDecode_i32v(bit_cast<int32_t>(val));
}
@@ -159,7 +159,7 @@ TEST_F(LEBHelperTest, WriteAndDecode_u64v) {
CheckEncodeDecode_u64v(87348723);
CheckEncodeDecode_u64v(77777);
- for (uint64_t val = 0x3a; val != 0; val = val << 1) {
+ for (uint64_t val = 0x3A; val != 0; val = val << 1) {
CheckEncodeDecode_u64v(val);
}
}
@@ -180,7 +180,7 @@ TEST_F(LEBHelperTest, WriteAndDecode_i64v) {
CheckEncodeDecode_i64v(-87648723);
CheckEncodeDecode_i64v(-77377);
- for (uint64_t val = 0x3a; val != 0; val = val << 1) {
+ for (uint64_t val = 0x3A; val != 0; val = val << 1) {
CheckEncodeDecode_i64v(bit_cast<int64_t>(val));
}
diff --git a/deps/v8/test/unittests/wasm/loop-assignment-analysis-unittest.cc b/deps/v8/test/unittests/wasm/loop-assignment-analysis-unittest.cc
index d089d94ca2..20f3d2bf3b 100644
--- a/deps/v8/test/unittests/wasm/loop-assignment-analysis-unittest.cc
+++ b/deps/v8/test/unittests/wasm/loop-assignment-analysis-unittest.cc
@@ -176,7 +176,7 @@ TEST_F(WasmLoopAssignmentAnalyzerTest, Loop2) {
}
TEST_F(WasmLoopAssignmentAnalyzerTest, Malformed) {
- byte code[] = {kExprLoop, kLocalVoid, kExprF32Neg, kExprBrTable, 0x0e, 'h',
+ byte code[] = {kExprLoop, kLocalVoid, kExprF32Neg, kExprBrTable, 0x0E, 'h',
'e', 'l', 'l', 'o', ',', ' ',
'w', 'o', 'r', 'l', 'd', '!'};
BitVector* assigned = Analyze(code, code + arraysize(code));
@@ -185,8 +185,8 @@ TEST_F(WasmLoopAssignmentAnalyzerTest, Malformed) {
TEST_F(WasmLoopAssignmentAnalyzerTest, regress_642867) {
static const byte code[] = {
- WASM_LOOP(WASM_ZERO, kExprSetLocal, 0xfa, 0xff, 0xff, 0xff,
- 0x0f)}; // local index LEB128 0xfffffffa
+ WASM_LOOP(WASM_ZERO, kExprSetLocal, 0xFA, 0xFF, 0xFF, 0xFF,
+ 0x0F)}; // local index LEB128 0xFFFFFFFA
// Just make sure that the analysis does not crash.
Analyze(code, code + arraysize(code));
}
diff --git a/deps/v8/test/unittests/wasm/module-decoder-unittest.cc b/deps/v8/test/unittests/wasm/module-decoder-unittest.cc
index ae98bd9a70..a472623096 100644
--- a/deps/v8/test/unittests/wasm/module-decoder-unittest.cc
+++ b/deps/v8/test/unittests/wasm/module-decoder-unittest.cc
@@ -290,7 +290,7 @@ TEST_F(WasmModuleVerifyTest, ExportMutableGlobal) {
static void AppendUint32v(std::vector<byte>& buffer, uint32_t val) {
while (true) {
uint32_t next = val >> 7;
- uint32_t out = val & 0x7f;
+ uint32_t out = val & 0x7F;
if (next) {
buffer.push_back(static_cast<byte>(0x80 | out));
val = next;
@@ -553,7 +553,7 @@ TEST_F(WasmModuleVerifyTest, DataSegmentWithImmutableGlobal) {
1,
kLocalI32, // local type
0, // immutable
- WASM_INIT_EXPR_I32V_3(0x9bbaa), // init
+ WASM_INIT_EXPR_I32V_3(0x9BBAA), // init
SECTION(Data, 9),
ENTRY_COUNT(1),
LINEAR_MEMORY_INDEX_0,
@@ -577,7 +577,7 @@ TEST_F(WasmModuleVerifyTest, OneDataSegment) {
SECTION(Data, 11),
ENTRY_COUNT(1),
LINEAR_MEMORY_INDEX_0,
- WASM_INIT_EXPR_I32V_3(0x9bbaa), // dest addr
+ WASM_INIT_EXPR_I32V_3(0x9BBAA), // dest addr
U32V_1(3), // source size
'a',
'b',
@@ -595,7 +595,7 @@ TEST_F(WasmModuleVerifyTest, OneDataSegment) {
const WasmDataSegment* segment = &result.val->data_segments.back();
EXPECT_EQ(WasmInitExpr::kI32Const, segment->dest_addr.kind);
- EXPECT_EQ(0x9bbaa, segment->dest_addr.val.i32_const);
+ EXPECT_EQ(0x9BBAA, segment->dest_addr.val.i32_const);
EXPECT_EQ(kDataSegmentSourceOffset, segment->source.offset());
EXPECT_EQ(3u, segment->source.length());
}
@@ -616,14 +616,14 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) {
SECTION(Data, 29),
ENTRY_COUNT(2), // segment count
LINEAR_MEMORY_INDEX_0,
- WASM_INIT_EXPR_I32V_3(0x7ffee), // #0: dest addr
+ WASM_INIT_EXPR_I32V_3(0x7FFEE), // #0: dest addr
U32V_1(4), // source size
1,
2,
3,
4, // data bytes
LINEAR_MEMORY_INDEX_0,
- WASM_INIT_EXPR_I32V_3(0x6ddcc), // #1: dest addr
+ WASM_INIT_EXPR_I32V_3(0x6DDCC), // #1: dest addr
U32V_1(10), // source size
1,
2,
@@ -648,12 +648,12 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) {
const WasmDataSegment* s1 = &result.val->data_segments[1];
EXPECT_EQ(WasmInitExpr::kI32Const, s0->dest_addr.kind);
- EXPECT_EQ(0x7ffee, s0->dest_addr.val.i32_const);
+ EXPECT_EQ(0x7FFEE, s0->dest_addr.val.i32_const);
EXPECT_EQ(kDataSegment0SourceOffset, s0->source.offset());
EXPECT_EQ(4u, s0->source.length());
EXPECT_EQ(WasmInitExpr::kI32Const, s1->dest_addr.kind);
- EXPECT_EQ(0x6ddcc, s1->dest_addr.val.i32_const);
+ EXPECT_EQ(0x6DDCC, s1->dest_addr.val.i32_const);
EXPECT_EQ(kDataSegment1SourceOffset, s1->source.offset());
EXPECT_EQ(10u, s1->source.length());
}
@@ -666,7 +666,7 @@ TEST_F(WasmModuleVerifyTest, DataWithoutMemory) {
SECTION(Data, 11),
ENTRY_COUNT(1),
LINEAR_MEMORY_INDEX_0,
- WASM_INIT_EXPR_I32V_3(0x9bbaa), // dest addr
+ WASM_INIT_EXPR_I32V_3(0x9BBAA), // dest addr
U32V_1(3), // source size
'a',
'b',
@@ -718,7 +718,7 @@ TEST_F(WasmModuleVerifyTest, DataSegmentEndOverflow) {
ENTRY_COUNT(1), // one entry
LINEAR_MEMORY_INDEX_0, // mem index
WASM_INIT_EXPR_I32V_1(0), // offset
- U32V_5(0xffffffff) // size
+ U32V_5(0xFFFFFFFF) // size
};
EXPECT_FAILURE(data);
@@ -731,7 +731,7 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction) {
// funcs ---------------------------------------------------------------
ONE_EMPTY_FUNCTION,
// table declaration ---------------------------------------------------
- SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeForm, 0, 1};
+ SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeCode, 0, 1};
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result);
@@ -746,7 +746,7 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction) {
TEST_F(WasmModuleVerifyTest, ElementSectionWithInternalTable) {
static const byte data[] = {
// table ---------------------------------------------------------------
- SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeForm, 0, 1,
+ SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeCode, 0, 1,
// elements ------------------------------------------------------------
SECTION(Element, 1),
0 // entry count
@@ -764,7 +764,7 @@ TEST_F(WasmModuleVerifyTest, ElementSectionWithImportedTable) {
NAME_LENGTH(1), // --
't', // table name
kExternalTable, // import kind
- kWasmAnyFunctionTypeForm, // elem_type
+ kWasmAnyFunctionTypeCode, // elem_type
0, // no maximum field
1, // initial size
// elements ------------------------------------------------------------
@@ -797,13 +797,13 @@ TEST_F(WasmModuleVerifyTest, Regression_735887) {
// funcs ---------------------------------------------------------------
ONE_EMPTY_FUNCTION,
// table declaration ---------------------------------------------------
- SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeForm, 0, 1,
+ SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeCode, 0, 1,
// elements ------------------------------------------------------------
SECTION(Element, 7),
1, // entry count
TABLE_INDEX(0), WASM_INIT_EXPR_I32V_1(0),
1, // elements count
- 0x9a // invalid I32V as function index
+ 0x9A // invalid I32V as function index
};
EXPECT_FAILURE(data);
@@ -816,7 +816,7 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction_one_entry) {
// funcs ---------------------------------------------------------------
ONE_EMPTY_FUNCTION,
// table declaration ---------------------------------------------------
- SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeForm, 0, 1,
+ SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeCode, 0, 1,
// elements ------------------------------------------------------------
SECTION(Element, 7),
1, // entry count
@@ -844,7 +844,7 @@ TEST_F(WasmModuleVerifyTest, MultipleIndirectFunctions) {
// funcs ------------------------------------------------------
FOUR_EMPTY_FUNCTIONS,
// table declaration -------------------------------------------
- SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeForm, 0, 8,
+ SECTION(Table, 4), ENTRY_COUNT(1), kWasmAnyFunctionTypeCode, 0, 8,
// table elements ----------------------------------------------
SECTION(Element, 14),
1, // entry count
@@ -974,7 +974,7 @@ TEST_F(WasmSignatureDecodeTest, Ok_i_tt) {
}
TEST_F(WasmSignatureDecodeTest, TooManyParams) {
- static const byte data[] = {kWasmFunctionTypeForm,
+ static const byte data[] = {kWasmFunctionTypeCode,
WASM_I32V_3(kV8MaxWasmFunctionParams + 1),
kLocalI32, 0};
FunctionSig* sig =
@@ -988,7 +988,7 @@ TEST_F(WasmSignatureDecodeTest, TooManyReturns) {
const int max_return_count = static_cast<int>(
FLAG_experimental_wasm_mv ? kV8MaxWasmFunctionMultiReturns
: kV8MaxWasmFunctionReturns);
- byte data[] = {kWasmFunctionTypeForm, 0, WASM_I32V_3(max_return_count + 1),
+ byte data[] = {kWasmFunctionTypeCode, 0, WASM_I32V_3(max_return_count + 1),
kLocalI32};
FunctionSig* sig =
DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data));
@@ -1108,11 +1108,11 @@ TEST_F(WasmModuleVerifyTest, OnlyUnknownSectionEmpty) {
TEST_F(WasmModuleVerifyTest, OnlyUnknownSectionNonEmpty) {
const byte data[] = {
UNKNOWN_SECTION(5),
- 0xff,
- 0xff,
- 0xff,
- 0xff,
- 0xff, // section data
+ 0xFF,
+ 0xFF,
+ 0xFF,
+ 0xFF,
+ 0xFF, // section data
};
EXPECT_VERIFIES(data);
}
@@ -1131,7 +1131,7 @@ TEST_F(WasmModuleVerifyTest, SignatureFollowedByUnknownSection) {
// signatures
SIGNATURES_SECTION_VOID_VOID,
// -----------------------------------------------------------
- UNKNOWN_SECTION(5), 0xff, 0xff, 0xff, 0xff, 0xff,
+ UNKNOWN_SECTION(5), 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
EXPECT_VERIFIES(data);
}
@@ -1497,7 +1497,7 @@ TEST_F(WasmModuleVerifyTest, Regression_738097) {
FUNCTION_SIGNATURES_SECTION(1, 0), // --
SECTION(Code, 1 + 5 + 1), // --
1, // --
- U32V_5(0xffffffff), // function size,
+ U32V_5(0xFFFFFFFF), // function size,
0 // No real body
};
EXPECT_FAILURE(data);
@@ -1620,16 +1620,16 @@ TEST_F(WasmModuleVerifyTest, Names_two_empty) {
TEST_F(WasmModuleVerifyTest, Regression684855) {
static const byte data[] = {
SECTION_NAMES(12),
- 0xfb, // functions count
+ 0xFB, // functions count
0x27, // |
0x00, // function name length
- 0xff, // local names count
- 0xff, // |
- 0xff, // |
- 0xff, // |
- 0xff, // |
- 0xff, // error: "varint too large"
- 0xff, // |
+ 0xFF, // local names count
+ 0xFF, // |
+ 0xFF, // |
+ 0xFF, // |
+ 0xFF, // |
+ 0xFF, // error: "varint too large"
+ 0xFF, // |
0x00, // --
0x00 // --
};
@@ -1703,7 +1703,7 @@ TEST_F(WasmModuleVerifyTest, Multiple_Named_Sections) {
}
TEST_F(WasmModuleVerifyTest, Section_Name_No_UTF8) {
- static const byte data[] = {SECTION(Unknown, 4), 1, 0xff, 17, 18};
+ static const byte data[] = {SECTION(Unknown, 4), 1, 0xFF, 17, 18};
EXPECT_FAILURE(data);
}
diff --git a/deps/v8/test/unittests/wasm/streaming-decoder-unittest.cc b/deps/v8/test/unittests/wasm/streaming-decoder-unittest.cc
index 41211ac960..8655651332 100644
--- a/deps/v8/test/unittests/wasm/streaming-decoder-unittest.cc
+++ b/deps/v8/test/unittests/wasm/streaming-decoder-unittest.cc
@@ -140,20 +140,20 @@ TEST_F(WasmStreamingDecoderTest, IncompleteModuleHeader) {
TEST_F(WasmStreamingDecoderTest, MagicAndVersion) {
const uint8_t data[] = {U32_LE(kWasmMagic), U32_LE(kWasmVersion)};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 0, 0);
+ ExpectVerifies(ArrayVector(data), 0, 0);
}
TEST_F(WasmStreamingDecoderTest, BadMagic) {
for (uint32_t x = 1; x; x <<= 1) {
const uint8_t data[] = {U32_LE(kWasmMagic ^ x), U32_LE(kWasmVersion)};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
}
TEST_F(WasmStreamingDecoderTest, BadVersion) {
for (uint32_t x = 1; x; x <<= 1) {
const uint8_t data[] = {U32_LE(kWasmMagic), U32_LE(kWasmVersion ^ x)};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
}
@@ -170,7 +170,7 @@ TEST_F(WasmStreamingDecoderTest, OneSection) {
0x0, // 5
0x0 // 6
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 1, 0);
+ ExpectVerifies(ArrayVector(data), 1, 0);
}
TEST_F(WasmStreamingDecoderTest, OneSection_b) {
@@ -187,7 +187,7 @@ TEST_F(WasmStreamingDecoderTest, OneSection_b) {
0x0, // 5
0x0 // 6
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 1, 0);
+ ExpectVerifies(ArrayVector(data), 1, 0);
}
TEST_F(WasmStreamingDecoderTest, OneShortSection) {
@@ -201,7 +201,7 @@ TEST_F(WasmStreamingDecoderTest, OneShortSection) {
0x0, // Payload
0x0 // 2
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 1, 0);
+ ExpectVerifies(ArrayVector(data), 1, 0);
}
TEST_F(WasmStreamingDecoderTest, OneShortSection_b) {
@@ -215,7 +215,7 @@ TEST_F(WasmStreamingDecoderTest, OneShortSection_b) {
0x0, // Payload
0x0 // 2
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 1, 0);
+ ExpectVerifies(ArrayVector(data), 1, 0);
}
TEST_F(WasmStreamingDecoderTest, OneEmptySection) {
@@ -225,7 +225,7 @@ TEST_F(WasmStreamingDecoderTest, OneEmptySection) {
0x1, // Section ID
0x0 // Section Length
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 1, 0);
+ ExpectVerifies(ArrayVector(data), 1, 0);
}
TEST_F(WasmStreamingDecoderTest, OneSectionNotEnoughPayload1) {
@@ -240,7 +240,7 @@ TEST_F(WasmStreamingDecoderTest, OneSectionNotEnoughPayload1) {
0x0, // 4
0x0 // 5
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, OneSectionNotEnoughPayload2) {
@@ -251,7 +251,7 @@ TEST_F(WasmStreamingDecoderTest, OneSectionNotEnoughPayload2) {
0x6, // Section Length
0x0 // Payload
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, OneSectionInvalidLength) {
@@ -265,7 +265,7 @@ TEST_F(WasmStreamingDecoderTest, OneSectionInvalidLength) {
0x80, // --
0x80, // --
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, TwoLongSections) {
@@ -290,7 +290,7 @@ TEST_F(WasmStreamingDecoderTest, TwoLongSections) {
0x0, // 6
0x0 // 7
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 2, 0);
+ ExpectVerifies(ArrayVector(data), 2, 0);
}
TEST_F(WasmStreamingDecoderTest, TwoShortSections) {
@@ -305,7 +305,7 @@ TEST_F(WasmStreamingDecoderTest, TwoShortSections) {
0x0, // Payload
0x0, // 2
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 2, 0);
+ ExpectVerifies(ArrayVector(data), 2, 0);
}
TEST_F(WasmStreamingDecoderTest, TwoSectionsShortLong) {
@@ -325,7 +325,7 @@ TEST_F(WasmStreamingDecoderTest, TwoSectionsShortLong) {
0x0, // 6
0x0 // 7
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 2, 0);
+ ExpectVerifies(ArrayVector(data), 2, 0);
}
TEST_F(WasmStreamingDecoderTest, TwoEmptySections) {
@@ -337,7 +337,7 @@ TEST_F(WasmStreamingDecoderTest, TwoEmptySections) {
0x2, // Section ID
0x0 // Section Length
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 2, 0);
+ ExpectVerifies(ArrayVector(data), 2, 0);
}
TEST_F(WasmStreamingDecoderTest, OneFunction) {
@@ -355,7 +355,7 @@ TEST_F(WasmStreamingDecoderTest, OneFunction) {
0x0, // 5
0x0, // 6
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 0, 1);
+ ExpectVerifies(ArrayVector(data), 0, 1);
}
TEST_F(WasmStreamingDecoderTest, OneShortFunction) {
@@ -368,7 +368,7 @@ TEST_F(WasmStreamingDecoderTest, OneShortFunction) {
0x1, // Function Length
0x0, // Function
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 0, 1);
+ ExpectVerifies(ArrayVector(data), 0, 1);
}
TEST_F(WasmStreamingDecoderTest, EmptyFunction) {
@@ -380,7 +380,7 @@ TEST_F(WasmStreamingDecoderTest, EmptyFunction) {
0x1, // Number of Functions
0x0, // Function Length
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, TwoFunctions) {
@@ -406,7 +406,7 @@ TEST_F(WasmStreamingDecoderTest, TwoFunctions) {
0x0, // 6
0x0, // 7
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 0, 2);
+ ExpectVerifies(ArrayVector(data), 0, 2);
}
TEST_F(WasmStreamingDecoderTest, TwoFunctions_b) {
@@ -414,7 +414,7 @@ TEST_F(WasmStreamingDecoderTest, TwoFunctions_b) {
U32_LE(kWasmMagic), // --
U32_LE(kWasmVersion), // --
kCodeSectionCode, // Section ID
- 0xb, // Section Length
+ 0xB, // Section Length
0x2, // Number of Functions
0x1, // Function Length
0x0, // Function
@@ -427,7 +427,7 @@ TEST_F(WasmStreamingDecoderTest, TwoFunctions_b) {
0x0, // 6
0x0, // 7
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 0, 2);
+ ExpectVerifies(ArrayVector(data), 0, 2);
}
TEST_F(WasmStreamingDecoderTest, CodeSectionLengthZero) {
@@ -437,7 +437,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthZero) {
kCodeSectionCode, // Section ID
0x0, // Section Length
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooHigh) {
@@ -445,7 +445,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooHigh) {
U32_LE(kWasmMagic), // --
U32_LE(kWasmVersion), // --
kCodeSectionCode, // Section ID
- 0xd, // Section Length
+ 0xD, // Section Length
0x2, // Number of Functions
0x7, // Function Length
0x0, // Function
@@ -458,7 +458,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooHigh) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooHighZeroFunctions) {
@@ -466,7 +466,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooHighZeroFunctions) {
U32_LE(kWasmMagic), // --
U32_LE(kWasmVersion), // --
kCodeSectionCode, // Section ID
- 0xd, // Section Length
+ 0xD, // Section Length
0x0, // Number of Functions
};
ExpectFailure(ArrayVector(data));
@@ -490,7 +490,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooLow) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooLowEndsInNumFunctions) {
@@ -513,7 +513,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooLowEndsInNumFunctions) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooLowEndsInFunctionLength) {
@@ -538,7 +538,7 @@ TEST_F(WasmStreamingDecoderTest, CodeSectionLengthTooLowEndsInFunctionLength) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, NumberOfFunctionsTooHigh) {
@@ -546,7 +546,7 @@ TEST_F(WasmStreamingDecoderTest, NumberOfFunctionsTooHigh) {
U32_LE(kWasmMagic), // --
U32_LE(kWasmVersion), // --
kCodeSectionCode, // Section ID
- 0xb, // Section Length
+ 0xB, // Section Length
0x4, // Number of Functions
0x7, // Function Length
0x0, // Function
@@ -559,7 +559,7 @@ TEST_F(WasmStreamingDecoderTest, NumberOfFunctionsTooHigh) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, NumberOfFunctionsTooLow) {
@@ -567,7 +567,7 @@ TEST_F(WasmStreamingDecoderTest, NumberOfFunctionsTooLow) {
U32_LE(kWasmMagic), // --
U32_LE(kWasmVersion), // --
kCodeSectionCode, // Section ID
- 0xe, // Section Length
+ 0xE, // Section Length
0x2, // Number of Functions
0x1, // Function Length
0x0, // Function
@@ -583,7 +583,7 @@ TEST_F(WasmStreamingDecoderTest, NumberOfFunctionsTooLow) {
0x0, // 6
0x0, // 7
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, TwoCodeSections) {
@@ -601,7 +601,7 @@ TEST_F(WasmStreamingDecoderTest, TwoCodeSections) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
TEST_F(WasmStreamingDecoderTest, UnknownSection) {
@@ -619,7 +619,7 @@ TEST_F(WasmStreamingDecoderTest, UnknownSection) {
0x1, // Name
0x0, // Content
};
- ExpectVerifies(Vector<const uint8_t>(data, arraysize(data)), 1, 1);
+ ExpectVerifies(ArrayVector(data), 1, 1);
}
TEST_F(WasmStreamingDecoderTest, UnknownSectionSandwich) {
@@ -642,7 +642,7 @@ TEST_F(WasmStreamingDecoderTest, UnknownSectionSandwich) {
0x1, // Function Length
0x0, // Function
};
- ExpectFailure(Vector<const uint8_t>(data, arraysize(data)));
+ ExpectFailure(ArrayVector(data));
}
} // namespace wasm
diff --git a/deps/v8/test/unittests/wasm/wasm-heap-unittest.cc b/deps/v8/test/unittests/wasm/wasm-code-manager-unittest.cc
index d0c9284f93..1b6af25a4a 100644
--- a/deps/v8/test/unittests/wasm/wasm-heap-unittest.cc
+++ b/deps/v8/test/unittests/wasm/wasm-code-manager-unittest.cc
@@ -5,7 +5,7 @@
#include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h"
-#include "src/wasm/wasm-heap.h"
+#include "src/wasm/wasm-code-manager.h"
namespace v8 {
namespace internal {
@@ -190,7 +190,7 @@ class WasmCodeManagerTest : public TestWithIsolate {
return native_module->AddCode(desc, 0, index, 0, {}, false);
}
- size_t page() const { return base::OS::AllocatePageSize(); }
+ size_t page() const { return AllocatePageSize(); }
v8::Isolate* v8_isolate() const {
return reinterpret_cast<v8::Isolate*>(isolate());
}
diff --git a/deps/v8/test/unittests/wasm/wasm-macro-gen-unittest.cc b/deps/v8/test/unittests/wasm/wasm-macro-gen-unittest.cc
index 45a4c5a59b..d1087c02a6 100644
--- a/deps/v8/test/unittests/wasm/wasm-macro-gen-unittest.cc
+++ b/deps/v8/test/unittests/wasm/wasm-macro-gen-unittest.cc
@@ -37,7 +37,7 @@ TEST_F(WasmMacroGenTest, Constants) {
EXPECT_SIZE(4, WASM_I64V_3(10000));
EXPECT_SIZE(5, WASM_I64V_4(-9828934));
EXPECT_SIZE(6, WASM_I64V_5(-1119828934));
- EXPECT_SIZE(10, WASM_I64V_9(0x123456789abcdef0ULL));
+ EXPECT_SIZE(10, WASM_I64V_9(0x123456789ABCDEF0ULL));
EXPECT_SIZE(5, WASM_F32(1.0f));
EXPECT_SIZE(5, WASM_F32(10000.0f));