v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::wasm::NamesProvider Class Reference

#include <names-provider.h>

Collaboration diagram for v8::internal::wasm::NamesProvider:

Public Types

enum  FunctionNamesBehavior : bool { kWasmInternal = false , kDevTools = true }
 
enum  IndexAsComment : bool { kDontPrintIndex = false , kIndexAsComment = true }
 

Public Member Functions

 NamesProvider (const WasmModule *module, base::Vector< const uint8_t > wire_bytes)
 
 ~NamesProvider ()
 
void PrintFunctionName (StringBuilder &out, uint32_t function_index, FunctionNamesBehavior behavior=kWasmInternal, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintLocalName (StringBuilder &out, uint32_t function_index, uint32_t local_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintLabelName (StringBuilder &out, uint32_t function_index, uint32_t label_index, uint32_t fallback_index)
 
void PrintTypeName (StringBuilder &out, uint32_t type_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintTypeName (StringBuilder &out, ModuleTypeIndex type_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintTableName (StringBuilder &out, uint32_t table_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintMemoryName (StringBuilder &out, uint32_t memory_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintGlobalName (StringBuilder &out, uint32_t global_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintElementSegmentName (StringBuilder &out, uint32_t element_segment_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintDataSegmentName (StringBuilder &out, uint32_t data_segment_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintFieldName (StringBuilder &out, uint32_t struct_index, uint32_t field_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintTagName (StringBuilder &out, uint32_t tag_index, IndexAsComment index_as_comment=kDontPrintIndex)
 
void PrintHeapType (StringBuilder &out, HeapType type)
 
void PrintValueType (StringBuilder &out, ValueType type)
 
size_t EstimateCurrentMemoryConsumption () const
 

Private Member Functions

void DecodeNamesIfNotYetDone ()
 
void ComputeFunctionNamesFromImportsExports ()
 
void ComputeNamesFromImportsExports ()
 
void ComputeImportName (const WasmImport &import, std::map< uint32_t, std::string > &target)
 
void ComputeExportName (const WasmExport &ex, std::map< uint32_t, std::string > &target)
 
void WriteRef (StringBuilder &out, WireBytesRef ref)
 

Private Attributes

base::Mutex mutex_
 
bool has_decoded_ {false}
 
bool has_computed_function_import_names_ {false}
 
bool has_computed_import_names_ {false}
 
const WasmModulemodule_
 
base::Vector< const uint8_t > wire_bytes_
 
std::unique_ptr< DecodedNameSectionname_section_names_
 
std::map< uint32_t, std::string > import_export_function_names_
 
std::map< uint32_t, std::string > import_export_table_names_
 
std::map< uint32_t, std::string > import_export_memory_names_
 
std::map< uint32_t, std::string > import_export_global_names_
 
std::map< uint32_t, std::string > import_export_tag_names_
 

Detailed Description

Definition at line 26 of file names-provider.h.

Member Enumeration Documentation

◆ FunctionNamesBehavior

Enumerator
kWasmInternal 
kDevTools 

Definition at line 31 of file names-provider.h.

◆ IndexAsComment

Enumerator
kDontPrintIndex 
kIndexAsComment 

Definition at line 33 of file names-provider.h.

Constructor & Destructor Documentation

◆ NamesProvider()

v8::internal::wasm::NamesProvider::NamesProvider ( const WasmModule * module,
base::Vector< const uint8_t > wire_bytes )

Definition at line 19 of file names-provider.cc.

Here is the caller graph for this function:

◆ ~NamesProvider()

v8::internal::wasm::NamesProvider::~NamesProvider ( )
default

Member Function Documentation

◆ ComputeExportName()

void v8::internal::wasm::NamesProvider::ComputeExportName ( const WasmExport & ex,
std::map< uint32_t, std::string > & target )
private

Definition at line 160 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeFunctionNamesFromImportsExports()

void v8::internal::wasm::NamesProvider::ComputeFunctionNamesFromImportsExports ( )
private

Definition at line 38 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeImportName()

void v8::internal::wasm::NamesProvider::ComputeImportName ( const WasmImport & import,
std::map< uint32_t, std::string > & target )
private

Definition at line 146 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeNamesFromImportsExports()

void v8::internal::wasm::NamesProvider::ComputeNamesFromImportsExports ( )
private

Definition at line 55 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeNamesIfNotYetDone()

void v8::internal::wasm::NamesProvider::DecodeNamesIfNotYetDone ( )
private

Definition at line 25 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EstimateCurrentMemoryConsumption()

size_t v8::internal::wasm::NamesProvider::EstimateCurrentMemoryConsumption ( ) const

Definition at line 421 of file names-provider.cc.

Here is the call graph for this function:

◆ PrintDataSegmentName()

void v8::internal::wasm::NamesProvider::PrintDataSegmentName ( StringBuilder & out,
uint32_t data_segment_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 345 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintElementSegmentName()

void v8::internal::wasm::NamesProvider::PrintElementSegmentName ( StringBuilder & out,
uint32_t element_segment_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 330 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintFieldName()

void v8::internal::wasm::NamesProvider::PrintFieldName ( StringBuilder & out,
uint32_t struct_index,
uint32_t field_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 360 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintFunctionName()

void v8::internal::wasm::NamesProvider::PrintFunctionName ( StringBuilder & out,
uint32_t function_index,
FunctionNamesBehavior behavior = kWasmInternal,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 184 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintGlobalName()

void v8::internal::wasm::NamesProvider::PrintGlobalName ( StringBuilder & out,
uint32_t global_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 311 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintHeapType()

void v8::internal::wasm::NamesProvider::PrintHeapType ( StringBuilder & out,
HeapType type )

Definition at line 391 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintLabelName()

void v8::internal::wasm::NamesProvider::PrintLabelName ( StringBuilder & out,
uint32_t function_index,
uint32_t label_index,
uint32_t fallback_index )

Definition at line 248 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintLocalName()

void v8::internal::wasm::NamesProvider::PrintLocalName ( StringBuilder & out,
uint32_t function_index,
uint32_t local_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 233 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMemoryName()

void v8::internal::wasm::NamesProvider::PrintMemoryName ( StringBuilder & out,
uint32_t memory_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 292 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintTableName()

void v8::internal::wasm::NamesProvider::PrintTableName ( StringBuilder & out,
uint32_t table_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 274 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintTagName()

void v8::internal::wasm::NamesProvider::PrintTagName ( StringBuilder & out,
uint32_t tag_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 374 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintTypeName() [1/2]

void v8::internal::wasm::NamesProvider::PrintTypeName ( StringBuilder & out,
ModuleTypeIndex type_index,
IndexAsComment index_as_comment = kDontPrintIndex )
inline

Definition at line 52 of file names-provider.h.

◆ PrintTypeName() [2/2]

void v8::internal::wasm::NamesProvider::PrintTypeName ( StringBuilder & out,
uint32_t type_index,
IndexAsComment index_as_comment = kDontPrintIndex )

Definition at line 262 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintValueType()

void v8::internal::wasm::NamesProvider::PrintValueType ( StringBuilder & out,
ValueType type )

Definition at line 400 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteRef()

void v8::internal::wasm::NamesProvider::WriteRef ( StringBuilder & out,
WireBytesRef ref )
private

Definition at line 180 of file names-provider.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ has_computed_function_import_names_

bool v8::internal::wasm::NamesProvider::has_computed_function_import_names_ {false}
private

Definition at line 92 of file names-provider.h.

◆ has_computed_import_names_

bool v8::internal::wasm::NamesProvider::has_computed_import_names_ {false}
private

Definition at line 93 of file names-provider.h.

◆ has_decoded_

bool v8::internal::wasm::NamesProvider::has_decoded_ {false}
private

Definition at line 91 of file names-provider.h.

◆ import_export_function_names_

std::map<uint32_t, std::string> v8::internal::wasm::NamesProvider::import_export_function_names_
private

Definition at line 97 of file names-provider.h.

◆ import_export_global_names_

std::map<uint32_t, std::string> v8::internal::wasm::NamesProvider::import_export_global_names_
private

Definition at line 100 of file names-provider.h.

◆ import_export_memory_names_

std::map<uint32_t, std::string> v8::internal::wasm::NamesProvider::import_export_memory_names_
private

Definition at line 99 of file names-provider.h.

◆ import_export_table_names_

std::map<uint32_t, std::string> v8::internal::wasm::NamesProvider::import_export_table_names_
private

Definition at line 98 of file names-provider.h.

◆ import_export_tag_names_

std::map<uint32_t, std::string> v8::internal::wasm::NamesProvider::import_export_tag_names_
private

Definition at line 101 of file names-provider.h.

◆ module_

const WasmModule* v8::internal::wasm::NamesProvider::module_
private

Definition at line 94 of file names-provider.h.

◆ mutex_

base::Mutex v8::internal::wasm::NamesProvider::mutex_
mutableprivate

Definition at line 90 of file names-provider.h.

◆ name_section_names_

std::unique_ptr<DecodedNameSection> v8::internal::wasm::NamesProvider::name_section_names_
private

Definition at line 96 of file names-provider.h.

◆ wire_bytes_

base::Vector<const uint8_t> v8::internal::wasm::NamesProvider::wire_bytes_
private

Definition at line 95 of file names-provider.h.


The documentation for this class was generated from the following files: