Commit 26694183 authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[test] Move cctest/test-disasm-x64 to unittests/assembler/

... disasm-x64-unittest.

Bug: v8:12781
Change-Id: Ia00f626e097606cb27aaaff1841ae3b5a031b2e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3675899Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80796}
parent d223aa67
...@@ -316,7 +316,6 @@ v8_source_set("cctest_sources") { ...@@ -316,7 +316,6 @@ v8_source_set("cctest_sources") {
} else if (v8_current_cpu == "x64") { } else if (v8_current_cpu == "x64") {
sources += [ ### gcmole(arch:x64) ### sources += [ ### gcmole(arch:x64) ###
"test-assembler-x64.cc", "test-assembler-x64.cc",
"test-disasm-x64.cc",
"test-log-stack-tracer.cc", "test-log-stack-tracer.cc",
"test-macro-assembler-x64.cc", "test-macro-assembler-x64.cc",
] ]
......
...@@ -614,7 +614,6 @@ ...@@ -614,7 +614,6 @@
'test-code-generator/*': [SKIP], 'test-code-generator/*': [SKIP],
'test-code-stub-assembler/*': [SKIP], 'test-code-stub-assembler/*': [SKIP],
'test-debug-helper/GetObjectProperties': [SKIP], 'test-debug-helper/GetObjectProperties': [SKIP],
'test-disasm-x64/DisasmX64': [SKIP],
'test-js-context-specialization/*': [SKIP], 'test-js-context-specialization/*': [SKIP],
'test-macro-assembler-x64/EmbeddedObj': [SKIP], 'test-macro-assembler-x64/EmbeddedObj': [SKIP],
'test-multiple-return/*': [SKIP], 'test-multiple-return/*': [SKIP],
......
...@@ -521,6 +521,7 @@ v8_source_set("unittests_sources") { ...@@ -521,6 +521,7 @@ v8_source_set("unittests_sources") {
] ]
} else if (v8_current_cpu == "x64") { } else if (v8_current_cpu == "x64") {
sources += [ sources += [
"assembler/disasm-x64-unittest.cc",
"assembler/turbo-assembler-x64-unittest.cc", "assembler/turbo-assembler-x64-unittest.cc",
"compiler/x64/instruction-selector-x64-unittest.cc", "compiler/x64/instruction-selector-x64-unittest.cc",
] ]
......
...@@ -37,16 +37,18 @@ ...@@ -37,16 +37,18 @@
#include "src/init/v8.h" #include "src/init/v8.h"
#include "src/objects/objects-inl.h" #include "src/objects/objects-inl.h"
#include "src/utils/ostreams.h" #include "src/utils/ostreams.h"
#include "test/cctest/cctest.h" #include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
using DisasmX64Test = TestWithIsolate;
#define __ assm. #define __ assm.
TEST(DisasmX64) { TEST_F(DisasmX64Test, DisasmX64) {
Isolate* isolate = CcTest::i_isolate(); HandleScope handle_scope(isolate());
HandleScope handle_scope(isolate);
v8::internal::byte buffer[8192]; v8::internal::byte buffer[8192];
Assembler assm(AssemblerOptions{}, Assembler assm(AssemblerOptions{},
ExternalAssemblerBuffer(buffer, sizeof buffer)); ExternalAssemblerBuffer(buffer, sizeof buffer));
...@@ -63,7 +65,7 @@ TEST(DisasmX64) { ...@@ -63,7 +65,7 @@ TEST(DisasmX64) {
__ bind(&L2); __ bind(&L2);
__ call(rcx); __ call(rcx);
__ nop(); __ nop();
Handle<CodeT> ic = BUILTIN_CODE(isolate, ArrayFrom); Handle<CodeT> ic = BUILTIN_CODE(isolate(), ArrayFrom);
__ call(ic, RelocInfo::CODE_TARGET); __ call(ic, RelocInfo::CODE_TARGET);
__ nop(); __ nop();
...@@ -72,7 +74,6 @@ TEST(DisasmX64) { ...@@ -72,7 +74,6 @@ TEST(DisasmX64) {
__ jmp(ic, RelocInfo::CODE_TARGET); __ jmp(ic, RelocInfo::CODE_TARGET);
__ nop(); __ nop();
Label Ljcc; Label Ljcc;
__ nop(); __ nop();
// long jumps // long jumps
...@@ -280,9 +281,9 @@ TEST(DisasmX64) { ...@@ -280,9 +281,9 @@ TEST(DisasmX64) {
__ ret(0); __ ret(0);
CodeDesc desc; CodeDesc desc;
assm.GetCode(isolate, &desc); assm.GetCode(isolate(), &desc);
Handle<Code> code = Handle<Code> code =
Factory::CodeBuilder(isolate, desc, CodeKind::FOR_TESTING).Build(); Factory::CodeBuilder(isolate(), desc, CodeKind::FOR_TESTING).Build();
USE(code); USE(code);
#ifdef OBJECT_PRINT #ifdef OBJECT_PRINT
StdoutStream os; StdoutStream os;
...@@ -333,7 +334,7 @@ struct DisassemblerTester { ...@@ -333,7 +334,7 @@ struct DisassemblerTester {
// Tests that compares the checks the disassembly output with an expected // Tests that compares the checks the disassembly output with an expected
// string. // string.
UNINITIALIZED_TEST(DisasmX64CheckOutput) { TEST_F(DisasmX64Test, DisasmX64CheckOutput) {
DisassemblerTester t; DisassemblerTester t;
// Short immediate instructions // Short immediate instructions
...@@ -743,7 +744,7 @@ constexpr int kHexOffset = 21; ...@@ -743,7 +744,7 @@ constexpr int kHexOffset = 21;
actual = std::string(actual, kHexOffset, actual.size() - kHexOffset); \ actual = std::string(actual, kHexOffset, actual.size() - kHexOffset); \
CHECK_EQ(str, actual); CHECK_EQ(str, actual);
UNINITIALIZED_TEST(DisasmX64CheckOutputSSE) { TEST_F(DisasmX64Test, DisasmX64CheckOutputSSE) {
DisassemblerTester t; DisassemblerTester t;
std::string actual; std::string actual;
...@@ -807,7 +808,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE) { ...@@ -807,7 +808,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE) {
#undef COMPARE_SSE_INSTR #undef COMPARE_SSE_INSTR
} }
UNINITIALIZED_TEST(DisasmX64CheckOutputSSE2) { TEST_F(DisasmX64Test, DisasmX64CheckOutputSSE2) {
DisassemblerTester t; DisassemblerTester t;
std::string actual, exp; std::string actual, exp;
...@@ -876,7 +877,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE2) { ...@@ -876,7 +877,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE2) {
#undef COMPARE_SSE2_SHIFT_IMM #undef COMPARE_SSE2_SHIFT_IMM
} }
UNINITIALIZED_TEST(DisasmX64CheckOutputSSE3) { TEST_F(DisasmX64Test, DisasmX64CheckOutputSSE3) {
if (!CpuFeatures::IsSupported(SSE3)) { if (!CpuFeatures::IsSupported(SSE3)) {
return; return;
} }
...@@ -895,7 +896,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE3) { ...@@ -895,7 +896,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE3) {
COMPARE("f30f16ca movshdup xmm1,xmm2", movshdup(xmm1, xmm2)); COMPARE("f30f16ca movshdup xmm1,xmm2", movshdup(xmm1, xmm2));
} }
UNINITIALIZED_TEST(DisasmX64CheckOutputSSSE3) { TEST_F(DisasmX64Test, DisasmX64CheckOutputSSSE3) {
if (!CpuFeatures::IsSupported(SSSE3)) { if (!CpuFeatures::IsSupported(SSSE3)) {
return; return;
} }
...@@ -918,7 +919,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSSE3) { ...@@ -918,7 +919,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSSE3) {
#undef COMPARE_SSSE3_INSTR #undef COMPARE_SSSE3_INSTR
} }
UNINITIALIZED_TEST(DisasmX64CheckOutputSSE4_1) { TEST_F(DisasmX64Test, DisasmX64CheckOutputSSE4_1) {
if (!CpuFeatures::IsSupported(SSE4_1)) { if (!CpuFeatures::IsSupported(SSE4_1)) {
return; return;
} }
...@@ -1054,7 +1055,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE4_1) { ...@@ -1054,7 +1055,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE4_1) {
#undef COMPARE_SSE4_EXTRACT_INSTR #undef COMPARE_SSE4_EXTRACT_INSTR
} }
UNINITIALIZED_TEST(DisasmX64CheckOutputSSE4_2) { TEST_F(DisasmX64Test, DisasmX64CheckOutputSSE4_2) {
if (!CpuFeatures::IsSupported(SSE4_2)) { if (!CpuFeatures::IsSupported(SSE4_2)) {
return; return;
} }
...@@ -1072,7 +1073,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE4_2) { ...@@ -1072,7 +1073,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputSSE4_2) {
#undef COMPARE_SSE4_2_INSTR #undef COMPARE_SSE4_2_INSTR
} }
UNINITIALIZED_TEST(DisasmX64CheckOutputAVX) { TEST_F(DisasmX64Test, DisasmX64CheckOutputAVX) {
if (!CpuFeatures::IsSupported(AVX)) { if (!CpuFeatures::IsSupported(AVX)) {
return; return;
} }
...@@ -1406,7 +1407,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputAVX) { ...@@ -1406,7 +1407,7 @@ UNINITIALIZED_TEST(DisasmX64CheckOutputAVX) {
vbroadcastss(xmm1, Operand(rbx, rcx, times_4, 10000))); vbroadcastss(xmm1, Operand(rbx, rcx, times_4, 10000)));
} }
UNINITIALIZED_TEST(DisasmX64YMMRegister) { TEST_F(DisasmX64Test, DisasmX64YMMRegister) {
if (!CpuFeatures::IsSupported(AVX)) return; if (!CpuFeatures::IsSupported(AVX)) return;
DisassemblerTester t; DisassemblerTester t;
......
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
'RegExpTest.MacroAssemblerNativeSuccess': [SKIP], 'RegExpTest.MacroAssemblerNativeSuccess': [SKIP],
'RegExpTest.MacroAssemblerStackOverflow': [SKIP], 'RegExpTest.MacroAssemblerStackOverflow': [SKIP],
'RegExpTest.Graph': [SKIP], 'RegExpTest.Graph': [SKIP],
'DisasmX64Test.*': [SKIP],
# Tests generated irregexp code. # Tests generated irregexp code.
'RegExpTestWithContext.RegExpInterruptReentrantExecution': [SKIP], 'RegExpTestWithContext.RegExpInterruptReentrantExecution': [SKIP],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment