edec05ea73
All Object::Print functions now take an Isolate* parameter. Various XX::XXPrint functions now take an Isolate if it's needed rather than calling GetIsolate(). Such method use DECL_PRINTER_WITH_ISOLATE rather than DECL_PRINTER. The _v8_internal_Print_ function (intended for use in gdb) now uses Isolate::Current() to get hold of an Isolate. Reduces the GetIsolate and GetHeap count by 9 and 5 respectively. Also removes unneeded gdb/lldb macros (along with their support functions), jfv, jfm, jda and jta, since job does the same thing. Bug: v8:7786 Change-Id: Ib93ebca6ca47c4db9c85cc6d9ff8004da5942dec Reviewed-on: https://chromium-review.googlesource.com/1112001 Commit-Queue: Dan Elphick <delphick@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#54029}
34 lines
825 B
C++
34 lines
825 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(Assembler::Options{}, 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
|