c0367102a3
The biggest chunk of this CL is related to the CodeBuilder now returning a Code object instead of an InstructionStream. Most codegen-related parts of the codebase had to be updated, including compiler.cc, pipeline.cc, and many tests. The good news is, we now have 400 fewer references to InstructionStream. Smaller changes: - Remove ToAbstractCode - Remove dead code - Update comments - Update method and variable names Bug: v8:13654 Change-Id: Ieb12bc698af576e07016e4c5c8c9d494e5addb0e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174091 Reviewed-by: Dominik Inführ <dinfuehr@chromium.org> Auto-Submit: Jakob Linke <jgruber@chromium.org> Commit-Queue: Adam Klein <adamk@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/main@{#85372}
32 lines
812 B
C++
32 lines
812 B
C++
// 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 "test/cctest/assembler-helper-arm.h"
|
|
|
|
#include "src/codegen/macro-assembler.h"
|
|
#include "src/execution/isolate-inl.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
Handle<Code> AssembleCodeImpl(Isolate* isolate,
|
|
std::function<void(MacroAssembler&)> assemble) {
|
|
MacroAssembler assm(isolate, CodeObjectRequired::kYes);
|
|
|
|
assemble(assm);
|
|
assm.bx(lr);
|
|
|
|
CodeDesc desc;
|
|
assm.GetCode(isolate, &desc);
|
|
Handle<Code> code =
|
|
Factory::CodeBuilder(isolate, desc, CodeKind::FOR_TESTING).Build();
|
|
if (v8_flags.print_code) {
|
|
code->Print();
|
|
}
|
|
return code;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|