chromium/v8/test/unittests/codegen/code-pages-unittest.cc

// Copyright 2022 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 "include/v8-function.h"
#include "src/api/api-inl.h"
#include "src/codegen/code-desc.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/handles/handles-inl.h"
#include "src/heap/factory.h"
#include "src/heap/spaces.h"
#include "src/libsampler/sampler.h"
#include "test/unittests/heap/heap-utils.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace v8 {

using CodePagesTest = TestWithContext;

namespace internal {
namespace test_code_pages {

// We have three levels of support which have different behaviors to test.
// 1 - Have code range. ARM64 and x64
// 2 - Have code pages. ARM32 only
// 3 - Nothing - This feature does not work on other platforms.
#if defined(V8_TARGET_ARCH_ARM)
static const bool kHaveCodePages = true;
#else
static const bool kHaveCodePages =;
#endif  // defined(V8_TARGET_ARCH_ARM)

static const char* foo_source =;

std::string getFooCode(int n) {}

namespace {

bool PagesHasExactPage(std::vector<MemoryRange>* pages, Address search_page) {}

bool PagesHasExactPage(std::vector<MemoryRange>* pages, Address search_page,
                       size_t size) {}

bool PagesContainsRange(std::vector<MemoryRange>* pages, Address search_address,
                        size_t size) {}

bool PagesContainsAddress(std::vector<MemoryRange>* pages,
                          Address search_address) {}

}  // namespace

TEST_F(CodePagesTest, CodeRangeCorrectContents) {}

TEST_F(CodePagesTest, CodePagesCorrectContents) {}

TEST_F(CodePagesTest, OptimizedCodeWithCodeRange) {}

TEST_F(CodePagesTest, OptimizedCodeWithCodePages) {}

TEST_F(CodePagesTest, LargeCodeObject) {}

static constexpr size_t kBufSize =;

class SignalSender : public sampler::Sampler {};

class SamplingThread : public base::Thread {};

TEST_F(CodePagesTest, LargeCodeObjectWithSignalHandler) {}

TEST_F(CodePagesTest, Sorted) {}

}  // namespace test_code_pages
}  // namespace internal
}  // namespace v8