29bcdaad1d
CodeKind::OPTIMIZED_CODE -> TURBOFAN Kinds are now more fine-grained and distinguish between TF, TP, NCI. CodeKind::STUB -> DEOPT_ENTRIES_OR_FOR_TESTING Code stubs (like builtins, but generated at runtime) were removed from the codebase years ago, this is the last remnant. This kind is used only for deopt entries (which should be converted into builtins) and for tests. Change-Id: I67beb15377cb60f395e9b051b25f3e5764982e93 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440335 Auto-Submit: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Mythri Alle <mythria@chromium.org> Reviewed-by: Mythri Alle <mythria@chromium.org> Cr-Commit-Position: refs/heads/master@{#70234}
35 lines
924 B
C++
35 lines
924 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/init/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(isolate, CodeObjectRequired::kYes);
|
|
|
|
assemble(assm);
|
|
assm.bx(lr);
|
|
|
|
CodeDesc desc;
|
|
assm.GetCode(isolate, &desc);
|
|
Handle<Code> code = Factory::CodeBuilder(
|
|
isolate, desc, CodeKind::DEOPT_ENTRIES_OR_FOR_TESTING)
|
|
.Build();
|
|
if (FLAG_print_code) {
|
|
code->Print();
|
|
}
|
|
return code;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|