Commit 6a2a9d28 authored by ishell@chromium.org's avatar ishell@chromium.org Committed by V8 LUCI CQ

[ext-code-space] Prepare DisasmX64 unittest for Code-less builtins

Bug: v8:11880
Change-Id: Ic1492fb46e8c3a8c70ce95bd177ae71bf5292c77
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3776689
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81986}
parent d2f11a74
......@@ -47,6 +47,23 @@ using DisasmX64Test = TestWithIsolate;
#define __ assm.
namespace {
Handle<CodeT> CreateDummyCode(Isolate* isolate) {
i::byte buffer[128];
Assembler assm(AssemblerOptions{},
ExternalAssemblerBuffer(buffer, sizeof(buffer)));
__ nop();
CodeDesc desc;
assm.GetCode(isolate, &desc);
Handle<Code> code =
Factory::CodeBuilder(isolate, desc, CodeKind::FOR_TESTING).Build();
return ToCodeT(code, isolate);
}
} // namespace
TEST_F(DisasmX64Test, DisasmX64) {
HandleScope handle_scope(isolate());
v8::internal::byte buffer[8192];
......@@ -65,7 +82,7 @@ TEST_F(DisasmX64Test, DisasmX64) {
__ bind(&L2);
__ call(rcx);
__ nop();
Handle<CodeT> ic = BUILTIN_CODE(isolate(), ArrayFrom);
Handle<CodeT> ic = CreateDummyCode(isolate());
__ call(ic, RelocInfo::CODE_TARGET);
__ nop();
......
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