v8/test/cctest/assembler-helper-arm.cc
Yang Guo 0fa243af70 Move relevant files to src/execution
Bug: v8:9247
Change-Id: I79e0553e8a0d6dac2aa16b94a6c0e05b6ccde4a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621934
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61725}
2019-05-22 08:36:33 +00:00

33 lines
822 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"
#include "src/v8.h"
#include "test/cctest/cctest.h"
namespace v8 {
namespace internal {
Handle<Code> AssembleCodeImpl(std::function<void(MacroAssembler&)> assemble) {
Isolate* isolate = CcTest::i_isolate();
MacroAssembler assm(AssemblerOptions{});
assemble(assm);
assm.bx(lr);
CodeDesc desc;
assm.GetCode(isolate, &desc);
Handle<Code> code = Factory::CodeBuilder(isolate, desc, Code::STUB).Build();
if (FLAG_print_code) {
code->Print();
}
return code;
}
} // namespace internal
} // namespace v8