Commit 26cb6b92 authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[test] Move cctest/test-disasm-ia32 to test/unittests/

... disasm-ia32-unittest.

Bug: v8:12781
Change-Id: I7291ac23571ecb5564053ba97746c8d18fd615e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3675900Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80797}
parent 26694183
......@@ -286,7 +286,6 @@ v8_source_set("cctest_sources") {
} else if (v8_current_cpu == "x86") {
sources += [ ### gcmole(arch:ia32) ###
"test-assembler-ia32.cc",
"test-disasm-ia32.cc",
"test-log-stack-tracer.cc",
]
} else if (v8_current_cpu == "mips") {
......
......@@ -501,6 +501,7 @@ v8_source_set("unittests_sources") {
]
} else if (v8_current_cpu == "x86") {
sources += [
"assembler/disasm-ia32-unittest.cc",
"assembler/turbo-assembler-ia32-unittest.cc",
"compiler/ia32/instruction-selector-ia32-unittest.cc",
]
......
......@@ -27,28 +27,28 @@
#include <stdlib.h>
#include "src/init/v8.h"
#include "src/codegen/code-factory.h"
#include "src/codegen/macro-assembler.h"
#include "src/debug/debug.h"
#include "src/diagnostics/disasm.h"
#include "src/diagnostics/disassembler.h"
#include "src/execution/frames-inl.h"
#include "src/init/v8.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 internal {
using DisasmIa320Test = TestWithIsolate;
#define __ assm.
static void DummyStaticFunction(Object result) {}
TEST(DisasmIa320) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
TEST_F(DisasmIa320Test, DisasmIa320) {
HandleScope scope(isolate());
v8::internal::byte buffer[8192];
Assembler assm(AssemblerOptions{},
ExternalAssemblerBuffer(buffer, sizeof buffer));
......@@ -60,7 +60,7 @@ TEST(DisasmIa320) {
__ xor_(eax, 12345678);
__ and_(eax, 12345678);
Handle<FixedArray> foo =
isolate->factory()->NewFixedArray(10, AllocationType::kOld);
isolate()->factory()->NewFixedArray(10, AllocationType::kOld);
__ cmp(eax, foo);
// ---- This one caused crash
......@@ -106,7 +106,7 @@ TEST(DisasmIa320) {
__ cmp(edx, Operand(esp, 4));
__ cmp(Operand(ebp, ecx, times_4, 0), Immediate(1000));
Handle<FixedArray> foo2 =
isolate->factory()->NewFixedArray(10, AllocationType::kOld);
isolate()->factory()->NewFixedArray(10, AllocationType::kOld);
__ cmp(ebx, foo2);
__ cmpb(ebx, Operand(ebp, ecx, times_2, 0));
__ cmpb(Operand(ebp, ecx, times_2, 0), ebx);
......@@ -232,7 +232,6 @@ TEST(DisasmIa320) {
__ shr(Operand(ebx, ecx, times_4, 10000), 6);
__ shr_cl(Operand(ebx, ecx, times_4, 10000));
// Immediates
__ adc(edx, 12345);
......@@ -291,7 +290,7 @@ TEST(DisasmIa320) {
__ bind(&L2);
__ call(Operand(ebx, ecx, times_4, 10000));
__ nop();
Handle<Code> ic = BUILTIN_CODE(isolate, ArrayFrom);
Handle<Code> ic = BUILTIN_CODE(isolate(), ArrayFrom);
__ call(ic, RelocInfo::CODE_TARGET);
__ nop();
__ call(FUNCTION_ADDR(DummyStaticFunction), RelocInfo::RUNTIME_ENTRY);
......@@ -302,7 +301,6 @@ TEST(DisasmIa320) {
__ jmp(ic, RelocInfo::CODE_TARGET);
__ nop();
Label Ljcc;
__ nop();
// long jumps
......@@ -987,9 +985,9 @@ TEST(DisasmIa320) {
__ ret(0);
CodeDesc desc;
assm.GetCode(isolate, &desc);
assm.GetCode(isolate(), &desc);
Handle<Code> code =
Factory::CodeBuilder(isolate, desc, CodeKind::FOR_TESTING).Build();
Factory::CodeBuilder(isolate(), desc, CodeKind::FOR_TESTING).Build();
USE(code);
#ifdef OBJECT_PRINT
StdoutStream os;
......
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