13b899a5f9
With ReadOnlyRoots and GetIsolate on JSReceiver, we can remove almost every isolate parameter from <Object>::Print. The remaining ones, like Map, are special-caseable for read-only maps, and as a result we can remove isolate parameters from <Object>::Print entirely. This patch also opportunistically cleans up a few places where isolates were only needed for Object::Print, such as TransitionAccessors and DescriptorArrays. TBR=yangguo@chromium.org,mstarzinger@chromium.org Bug: v8:7786 Change-Id: Id44bd53b9893e679eea5f37b9548257595a1bfd9 Reviewed-on: https://chromium-review.googlesource.com/1133385 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Dan Elphick <delphick@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#54401}
34 lines
816 B
C++
34 lines
816 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();
|
|
}
|
|
return code;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|