v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
pgo.h
Go to the documentation of this file.
1// Copyright 2022 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_WASM_PGO_H_
6#define V8_WASM_PGO_H_
7
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
10#endif // !V8_ENABLE_WEBASSEMBLY
11
12#include <vector>
13
14#include "src/base/vector.h"
15
16namespace v8::internal::wasm {
17
18struct WasmModule;
19
21 public:
26
27 // Disallow copying (not needed, so most probably a bug).
30
37
38 private:
39 const std::vector<uint32_t> executed_functions_;
40 const std::vector<uint32_t> tiered_up_functions_;
41};
42
43void DumpProfileToFile(const WasmModule* module,
45 std::atomic<uint32_t>* tiering_budget_array);
46
47V8_WARN_UNUSED_RESULT std::unique_ptr<ProfileInformation> LoadProfileFromFile(
48 const WasmModule* module, base::Vector<const uint8_t> wire_bytes);
49
50} // namespace v8::internal::wasm
51
52#endif // V8_WASM_PGO_H_
const std::vector< uint32_t > tiered_up_functions_
Definition pgo.h:40
const std::vector< uint32_t > executed_functions_
Definition pgo.h:39
ProfileInformation & operator=(const ProfileInformation &)=delete
base::Vector< const uint32_t > executed_functions() const
Definition pgo.h:31
base::Vector< const uint32_t > tiered_up_functions() const
Definition pgo.h:34
ProfileInformation(std::vector< uint32_t > executed_functions, std::vector< uint32_t > tiered_up_functions)
Definition pgo.h:22
ProfileInformation(const ProfileInformation &)=delete
STL namespace.
constexpr Vector< T > VectorOf(T *start, size_t size)
Definition vector.h:360
void DumpProfileToFile(const WasmModule *module, base::Vector< const uint8_t > wire_bytes, std::atomic< uint32_t > *tiering_budget_array)
Definition pgo.cc:196
std::unique_ptr< ProfileInformation > LoadProfileFromFile(const WasmModule *module, base::Vector< const uint8_t > wire_bytes)
Definition pgo.cc:222
kMemory0SizeOffset Address kNewAllocationLimitAddressOffset Address kOldAllocationLimitAddressOffset uint8_t kGlobalsStartOffset kJumpTableStartOffset tiering_budget_array
wasm::WasmModule WasmModule
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:671