#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 {
#if defined(V8_TARGET_ARCH_ARM)
static const bool kHaveCodePages = true;
#else
static const bool kHaveCodePages = …;
#endif
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) { … }
}
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) { … }
}
}
}