#include "src/wasm/wasm-module.h"
#include <functional>
#include <memory>
#include "src/api/api-inl.h"
#include "src/compiler/wasm-compiler.h"
#include "src/objects/js-array-inl.h"
#include "src/objects/objects.h"
#include "src/wasm/jump-table-assembler.h"
#include "src/wasm/module-decoder.h"
#include "src/wasm/std-object-sizes.h"
#include "src/wasm/wasm-code-manager.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-init-expr.h"
#include "src/wasm/wasm-js.h"
#include "src/wasm/wasm-module-builder.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/wasm/wasm-result.h"
#include "src/wasm/wasm-subtyping.h"
namespace v8::internal::wasm {
static_assert …;
int WasmMemory::GetMemory64GuardsShift(uint64_t max_memory_size) { … }
template <class Value>
void AdaptiveMap<Value>::FinishInitialization() { … }
template void NameMap::FinishInitialization();
template void IndirectNameMap::FinishInitialization();
WireBytesRef LazilyGeneratedNames::LookupFunctionName(
ModuleWireBytes wire_bytes, uint32_t function_index) { … }
bool LazilyGeneratedNames::Has(uint32_t function_index) { … }
int GetWasmFunctionOffset(const WasmModule* module, uint32_t func_index) { … }
int GetNearestWasmFunction(const WasmModule* module, uint32_t byte_offset) { … }
int GetContainingWasmFunction(const WasmModule* module, uint32_t byte_offset) { … }
int GetSubtypingDepth(const WasmModule* module, uint32_t type_index) { … }
void LazilyGeneratedNames::AddForTesting(int function_index,
WireBytesRef name) { … }
AsmJsOffsetInformation::AsmJsOffsetInformation(
base::Vector<const uint8_t> encoded_offsets)
: … { … }
AsmJsOffsetInformation::~AsmJsOffsetInformation() = default;
int AsmJsOffsetInformation::GetSourcePosition(int declared_func_index,
int byte_offset,
bool is_at_number_conversion) { … }
std::pair<int, int> AsmJsOffsetInformation::GetFunctionOffsets(
int declared_func_index) { … }
void AsmJsOffsetInformation::EnsureDecodedOffsets() { … }
WasmName ModuleWireBytes::GetNameOrNull(WireBytesRef ref) const { … }
WasmName ModuleWireBytes::GetNameOrNull(int func_index,
const WasmModule* module) const { … }
std::ostream& operator<<(std::ostream& os, const WasmFunctionName& name) { … }
WasmModule::WasmModule(ModuleOrigin origin)
: … { … }
bool IsWasmCodegenAllowed(Isolate* isolate, Handle<NativeContext> context) { … }
DirectHandle<String> ErrorStringForCodegen(Isolate* isolate,
DirectHandle<Context> context) { … }
namespace {
Handle<String> ToValueTypeString(Isolate* isolate, ValueType type) { … }
}
Handle<JSObject> GetTypeForFunction(Isolate* isolate, const FunctionSig* sig,
bool for_exception) { … }
Handle<JSObject> GetTypeForGlobal(Isolate* isolate, bool is_mutable,
ValueType type) { … }
Handle<JSObject> GetTypeForMemory(Isolate* isolate, uint32_t min_size,
std::optional<uint32_t> max_size, bool shared,
bool is_memory64) { … }
Handle<JSObject> GetTypeForTable(Isolate* isolate, ValueType type,
uint32_t min_size,
std::optional<uint32_t> max_size,
bool is_table64) { … }
Handle<JSArray> GetImports(Isolate* isolate,
DirectHandle<WasmModuleObject> module_object) { … }
Handle<JSArray> GetExports(Isolate* isolate,
DirectHandle<WasmModuleObject> module_object) { … }
Handle<JSArray> GetCustomSections(Isolate* isolate,
DirectHandle<WasmModuleObject> module_object,
DirectHandle<String> name,
ErrorThrower* thrower) { … }
int GetSourcePosition(const WasmModule* module, uint32_t func_index,
uint32_t byte_offset, bool is_at_number_conversion) { … }
size_t WasmModule::EstimateStoredSize() const { … }
template <class Value>
size_t AdaptiveMap<Value>::EstimateCurrentMemoryConsumption() const { … }
template <>
size_t NameMap::EstimateCurrentMemoryConsumption() const { … }
size_t LazilyGeneratedNames::EstimateCurrentMemoryConsumption() const { … }
template <>
size_t IndirectNameMap::EstimateCurrentMemoryConsumption() const {
size_t result = ContentSize(vector_);
for (const auto& inner_map : vector_) {
result += inner_map.EstimateCurrentMemoryConsumption();
}
if (map_) {
result += ContentSize(*map_);
for (const auto& [outer_index, inner_map] : *map_) {
result += inner_map.EstimateCurrentMemoryConsumption();
}
}
return result;
}
size_t TypeFeedbackStorage::EstimateCurrentMemoryConsumption() const { … }
size_t WasmModule::EstimateCurrentMemoryConsumption() const { … }
size_t PrintSignature(base::Vector<char> buffer, const wasm::FunctionSig* sig,
char delimiter) { … }
int JumpTableOffset(const WasmModule* module, int func_index) { … }
size_t GetWireBytesHash(base::Vector<const uint8_t> wire_bytes) { … }
int NumFeedbackSlots(const WasmModule* module, int func_index) { … }
}