1299ba9681
This CL surfaces AssemblerOptions to CodeAssembler::GenerateCode and to pipeline methods. To allow forward declaring AssemblerOptions, AssemblerBase::Options was moved out of the AssemblerBase class. Bug: v8:6666 Change-Id: If9fc50d3d4767bb5dd39a0c3b6e094021f4cae2b Reviewed-on: https://chromium-review.googlesource.com/1127039 Commit-Queue: Sigurd Schneider <sigurds@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#54286}
34 lines
823 B
C++
34 lines
823 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/assembler-inl.h"
|
|
#include "src/isolate-inl.h"
|
|
#include "src/v8.h"
|
|
#include "test/cctest/cctest.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
Handle<Code> AssembleCodeImpl(std::function<void(Assembler&)> assemble) {
|
|
Isolate* isolate = CcTest::i_isolate();
|
|
Assembler assm(AssemblerOptions{}, nullptr, 0);
|
|
|
|
assemble(assm);
|
|
assm.bx(lr);
|
|
|
|
CodeDesc desc;
|
|
assm.GetCode(isolate, &desc);
|
|
Handle<Code> code =
|
|
isolate->factory()->NewCode(desc, Code::STUB, Handle<Code>());
|
|
if (FLAG_print_code) {
|
|
code->Print(isolate);
|
|
}
|
|
return code;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|