2d1c3ed604
Mostly test/cctest/. Bug: v8:13006 Change-Id: I8853d38feb79bed6234a4354ab25a13255a1871b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3755149 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#81777}
32 lines
808 B
C++
32 lines
808 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 (FLAG_print_code) {
|
|
code->Print();
|
|
}
|
|
return code;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|