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

#include <wasm-module-builder.h>

Inheritance diagram for v8::internal::wasm::WasmModuleBuilder:
Collaboration diagram for v8::internal::wasm::WasmModuleBuilder:

Classes

struct  RecGroup
 
struct  WasmDataSegment
 
class  WasmElemSegment
 
struct  WasmExport
 
struct  WasmFunctionImport
 
struct  WasmGlobal
 
struct  WasmGlobalImport
 
struct  WasmMemory
 
struct  WasmTable
 

Public Member Functions

 WasmModuleBuilder (Zone *zone)
 
 WasmModuleBuilder (const WasmModuleBuilder &)=delete
 
WasmModuleBuilderoperator= (const WasmModuleBuilder &)=delete
 
uint32_t AddImport (base::Vector< const char > name, const FunctionSig *sig, base::Vector< const char > module={})
 
WasmFunctionBuilderAddFunction (const FunctionSig *sig=nullptr)
 
WasmFunctionBuilderAddFunction (ModuleTypeIndex sig_index)
 
uint32_t AddGlobal (ValueType type, bool mutability, WasmInitExpr init)
 
uint32_t AddGlobalImport (base::Vector< const char > name, ValueType type, bool mutability, base::Vector< const char > module={})
 
void AddDataSegment (const uint8_t *data, uint32_t size, uint32_t dest)
 
void AddPassiveDataSegment (const uint8_t *data, uint32_t size)
 
uint32_t AddElementSegment (WasmElemSegment segment)
 
void SetIndirectFunction (uint32_t table_index, uint32_t index_in_table, uint32_t direct_function_index, WasmElemSegment::FunctionIndexingMode indexing_mode)
 
uint32_t IncreaseTableMinSize (uint32_t table_index, uint32_t count)
 
ModuleTypeIndex AddSignature (const FunctionSig *sig, bool is_final, ModuleTypeIndex supertype=kNoSuperType)
 
ModuleTypeIndex ForceAddSignature (const FunctionSig *sig, bool is_final, ModuleTypeIndex supertype=kNoSuperType)
 
uint32_t AddTag (const FunctionSig *type)
 
ModuleTypeIndex AddStructType (StructType *type, bool is_final, ModuleTypeIndex supertype=kNoSuperType)
 
ModuleTypeIndex AddArrayType (ArrayType *type, bool is_final, ModuleTypeIndex supertype=kNoSuperType)
 
uint32_t AddTable (ValueType type, uint32_t min_size)
 
uint32_t AddTable (ValueType type, uint32_t min_size, uint32_t max_size, AddressType address_type=AddressType::kI32)
 
uint32_t AddTable (ValueType type, uint32_t min_size, uint32_t max_size, WasmInitExpr init, AddressType address_type=AddressType::kI32)
 
uint32_t AddMemory (uint32_t min_pages)
 
uint32_t AddMemory (uint32_t min_pages, uint32_t max_pages)
 
uint32_t AddMemory64 (uint32_t min_pages)
 
uint32_t AddMemory64 (uint32_t min_pages, uint32_t max_pages)
 
void MarkStartFunction (WasmFunctionBuilder *builder)
 
void AddExport (base::Vector< const char > name, ImportExportKindCode kind, uint32_t index)
 
void AddExport (base::Vector< const char > name, WasmFunctionBuilder *builder)
 
uint32_t AddExportedGlobal (ValueType type, bool mutability, WasmInitExpr init, base::Vector< const char > name)
 
void ExportImportedFunction (base::Vector< const char > name, int import_index)
 
void StartRecursiveTypeGroup ()
 
void EndRecursiveTypeGroup ()
 
void AddRecursiveTypeGroup (uint32_t start, uint32_t size)
 
void WriteTo (ZoneBuffer *buffer) const
 
void WriteAsmJsOffsetTable (ZoneBuffer *buffer) const
 
Zonezone ()
 
ValueType GetTableType (uint32_t index)
 
bool IsSignature (uint32_t index)
 
bool IsSignature (ModuleTypeIndex index)
 
const FunctionSigGetSignature (uint32_t index)
 
const FunctionSigGetSignature (ModuleTypeIndex index)
 
bool IsStructType (uint32_t index)
 
bool IsStructType (ModuleTypeIndex index)
 
const StructTypeGetStructType (uint32_t index)
 
const StructTypeGetStructType (ModuleTypeIndex index)
 
bool IsArrayType (uint32_t index)
 
bool IsArrayType (ModuleTypeIndex index)
 
const ArrayTypeGetArrayType (uint32_t index)
 
const ArrayTypeGetArrayType (ModuleTypeIndex index)
 
ModuleTypeIndex GetSuperType (uint32_t index)
 
WasmFunctionBuilderGetFunction (uint32_t index)
 
int NumTags ()
 
int NumTypes ()
 
int NumTables ()
 
int NumMemories ()
 
int NumGlobals ()
 
int NumImportedFunctions ()
 
int NumDeclaredFunctions ()
 
int NumDataSegments ()
 
bool IsMemory64 (uint32_t index)
 
bool IsTable64 (uint32_t index)
 
const FunctionSigGetTagType (int index)
 
ValueType GetGlobalType (uint32_t index) const
 
bool IsMutableGlobal (uint32_t index) const
 
- Public Member Functions inherited from v8::internal::ZoneObject
void * operator new (size_t, Zone *)=delete
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)=delete
 

Private Attributes

Zonezone_
 
ZoneVector< TypeDefinitiontypes_
 
ZoneVector< WasmFunctionImportfunction_imports_
 
ZoneVector< WasmGlobalImportglobal_imports_
 
ZoneVector< WasmExportexports_
 
ZoneVector< WasmFunctionBuilder * > functions_
 
ZoneVector< WasmTabletables_
 
ZoneVector< WasmMemorymemories_
 
ZoneVector< WasmDataSegmentdata_segments_
 
ZoneVector< WasmElemSegmentelement_segments_
 
ZoneVector< WasmGlobalglobals_
 
ZoneVector< ModuleTypeIndextags_
 
ZoneUnorderedMap< FunctionSig, ModuleTypeIndexsignature_map_
 
int current_recursive_group_start_
 
ZoneVector< RecGrouprecursive_groups_
 
int start_function_index_
 

Friends

class WasmFunctionBuilder
 

Detailed Description

Definition at line 257 of file wasm-module-builder.h.

Constructor & Destructor Documentation

◆ WasmModuleBuilder() [1/2]

v8::internal::wasm::WasmModuleBuilder::WasmModuleBuilder ( Zone * zone)
explicit

Definition at line 434 of file wasm-module-builder.cc.

◆ WasmModuleBuilder() [2/2]

v8::internal::wasm::WasmModuleBuilder::WasmModuleBuilder ( const WasmModuleBuilder & )
delete

Member Function Documentation

◆ AddArrayType()

ModuleTypeIndex v8::internal::wasm::WasmModuleBuilder::AddArrayType ( ArrayType * type,
bool is_final,
ModuleTypeIndex supertype = kNoSuperType )

Definition at line 516 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddDataSegment()

void v8::internal::wasm::WasmModuleBuilder::AddDataSegment ( const uint8_t * data,
uint32_t size,
uint32_t dest )

Definition at line 465 of file wasm-module-builder.cc.

Here is the call graph for this function:

◆ AddElementSegment()

uint32_t v8::internal::wasm::WasmModuleBuilder::AddElementSegment ( WasmElemSegment segment)

Definition at line 590 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddExport() [1/2]

void v8::internal::wasm::WasmModuleBuilder::AddExport ( base::Vector< const char > name,
ImportExportKindCode kind,
uint32_t index )

Definition at line 630 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddExport() [2/2]

void v8::internal::wasm::WasmModuleBuilder::AddExport ( base::Vector< const char > name,
WasmFunctionBuilder * builder )
inline

Definition at line 377 of file wasm-module-builder.h.

Here is the call graph for this function:

◆ AddExportedGlobal()

uint32_t v8::internal::wasm::WasmModuleBuilder::AddExportedGlobal ( ValueType type,
bool mutability,
WasmInitExpr init,
base::Vector< const char > name )

Definition at line 637 of file wasm-module-builder.cc.

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

◆ AddFunction() [1/2]

WasmFunctionBuilder * v8::internal::wasm::WasmModuleBuilder::AddFunction ( const FunctionSig * sig = nullptr)

Definition at line 452 of file wasm-module-builder.cc.

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

◆ AddFunction() [2/2]

WasmFunctionBuilder * v8::internal::wasm::WasmModuleBuilder::AddFunction ( ModuleTypeIndex sig_index)

Definition at line 459 of file wasm-module-builder.cc.

Here is the call graph for this function:

◆ AddGlobal()

uint32_t v8::internal::wasm::WasmModuleBuilder::AddGlobal ( ValueType type,
bool mutability,
WasmInitExpr init )

Definition at line 657 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddGlobalImport()

uint32_t v8::internal::wasm::WasmModuleBuilder::AddGlobalImport ( base::Vector< const char > name,
ValueType type,
bool mutability,
base::Vector< const char > module = {} )

Definition at line 616 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddImport()

uint32_t v8::internal::wasm::WasmModuleBuilder::AddImport ( base::Vector< const char > name,
const FunctionSig * sig,
base::Vector< const char > module = {} )

Definition at line 607 of file wasm-module-builder.cc.

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

◆ AddMemory() [1/2]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddMemory ( uint32_t min_pages)

Definition at line 564 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddMemory() [2/2]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddMemory ( uint32_t min_pages,
uint32_t max_pages )

Definition at line 569 of file wasm-module-builder.cc.

◆ AddMemory64() [1/2]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddMemory64 ( uint32_t min_pages)

Definition at line 575 of file wasm-module-builder.cc.

◆ AddMemory64() [2/2]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddMemory64 ( uint32_t min_pages,
uint32_t max_pages )

Definition at line 581 of file wasm-module-builder.cc.

◆ AddPassiveDataSegment()

void v8::internal::wasm::WasmModuleBuilder::AddPassiveDataSegment ( const uint8_t * data,
uint32_t size )

Definition at line 474 of file wasm-module-builder.cc.

Here is the call graph for this function:

◆ AddRecursiveTypeGroup()

void v8::internal::wasm::WasmModuleBuilder::AddRecursiveTypeGroup ( uint32_t start,
uint32_t size )
inline

Definition at line 398 of file wasm-module-builder.h.

◆ AddSignature()

ModuleTypeIndex v8::internal::wasm::WasmModuleBuilder::AddSignature ( const FunctionSig * sig,
bool is_final,
ModuleTypeIndex supertype = kNoSuperType )

Definition at line 492 of file wasm-module-builder.cc.

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

◆ AddStructType()

ModuleTypeIndex v8::internal::wasm::WasmModuleBuilder::AddStructType ( StructType * type,
bool is_final,
ModuleTypeIndex supertype = kNoSuperType )

Definition at line 508 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddTable() [1/3]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddTable ( ValueType type,
uint32_t min_size )

Definition at line 536 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ AddTable() [2/3]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddTable ( ValueType type,
uint32_t min_size,
uint32_t max_size,
AddressType address_type = AddressType::kI32 )

Definition at line 541 of file wasm-module-builder.cc.

◆ AddTable() [3/3]

uint32_t v8::internal::wasm::WasmModuleBuilder::AddTable ( ValueType type,
uint32_t min_size,
uint32_t max_size,
WasmInitExpr init,
AddressType address_type = AddressType::kI32 )

Definition at line 552 of file wasm-module-builder.cc.

◆ AddTag()

uint32_t v8::internal::wasm::WasmModuleBuilder::AddTag ( const FunctionSig * type)

Definition at line 500 of file wasm-module-builder.cc.

Here is the call graph for this function:

◆ EndRecursiveTypeGroup()

void v8::internal::wasm::WasmModuleBuilder::EndRecursiveTypeGroup ( )
inline

Definition at line 389 of file wasm-module-builder.h.

◆ ExportImportedFunction()

void v8::internal::wasm::WasmModuleBuilder::ExportImportedFunction ( base::Vector< const char > name,
int import_index )

Definition at line 645 of file wasm-module-builder.cc.

◆ ForceAddSignature()

ModuleTypeIndex v8::internal::wasm::WasmModuleBuilder::ForceAddSignature ( const FunctionSig * sig,
bool is_final,
ModuleTypeIndex supertype = kNoSuperType )

Definition at line 484 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ GetArrayType() [1/2]

const ArrayType * v8::internal::wasm::WasmModuleBuilder::GetArrayType ( ModuleTypeIndex index)
inline

Definition at line 441 of file wasm-module-builder.h.

◆ GetArrayType() [2/2]

const ArrayType * v8::internal::wasm::WasmModuleBuilder::GetArrayType ( uint32_t index)
inline

Definition at line 438 of file wasm-module-builder.h.

Here is the caller graph for this function:

◆ GetFunction()

WasmFunctionBuilder * v8::internal::wasm::WasmModuleBuilder::GetFunction ( uint32_t index)
inline

Definition at line 449 of file wasm-module-builder.h.

◆ GetGlobalType()

ValueType v8::internal::wasm::WasmModuleBuilder::GetGlobalType ( uint32_t index) const
inline

Definition at line 475 of file wasm-module-builder.h.

◆ GetSignature() [1/2]

const FunctionSig * v8::internal::wasm::WasmModuleBuilder::GetSignature ( ModuleTypeIndex index)
inline

Definition at line 419 of file wasm-module-builder.h.

◆ GetSignature() [2/2]

const FunctionSig * v8::internal::wasm::WasmModuleBuilder::GetSignature ( uint32_t index)
inline

Definition at line 415 of file wasm-module-builder.h.

◆ GetStructType() [1/2]

const StructType * v8::internal::wasm::WasmModuleBuilder::GetStructType ( ModuleTypeIndex index)
inline

Definition at line 430 of file wasm-module-builder.h.

◆ GetStructType() [2/2]

const StructType * v8::internal::wasm::WasmModuleBuilder::GetStructType ( uint32_t index)
inline

Definition at line 427 of file wasm-module-builder.h.

Here is the caller graph for this function:

◆ GetSuperType()

ModuleTypeIndex v8::internal::wasm::WasmModuleBuilder::GetSuperType ( uint32_t index)
inline

Definition at line 445 of file wasm-module-builder.h.

◆ GetTableType()

ValueType v8::internal::wasm::WasmModuleBuilder::GetTableType ( uint32_t index)
inline

Definition at line 408 of file wasm-module-builder.h.

◆ GetTagType()

const FunctionSig * v8::internal::wasm::WasmModuleBuilder::GetTagType ( int index)
inline

Definition at line 471 of file wasm-module-builder.h.

◆ IncreaseTableMinSize()

uint32_t v8::internal::wasm::WasmModuleBuilder::IncreaseTableMinSize ( uint32_t table_index,
uint32_t count )

Definition at line 523 of file wasm-module-builder.cc.

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

◆ IsArrayType() [1/2]

bool v8::internal::wasm::WasmModuleBuilder::IsArrayType ( ModuleTypeIndex index)
inline

Definition at line 437 of file wasm-module-builder.h.

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

◆ IsArrayType() [2/2]

bool v8::internal::wasm::WasmModuleBuilder::IsArrayType ( uint32_t index)
inline

Definition at line 434 of file wasm-module-builder.h.

◆ IsMemory64()

bool v8::internal::wasm::WasmModuleBuilder::IsMemory64 ( uint32_t index)
inline

Definition at line 467 of file wasm-module-builder.h.

◆ IsMutableGlobal()

bool v8::internal::wasm::WasmModuleBuilder::IsMutableGlobal ( uint32_t index) const
inline

Definition at line 477 of file wasm-module-builder.h.

◆ IsSignature() [1/2]

bool v8::internal::wasm::WasmModuleBuilder::IsSignature ( ModuleTypeIndex index)
inline

Definition at line 413 of file wasm-module-builder.h.

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

◆ IsSignature() [2/2]

bool v8::internal::wasm::WasmModuleBuilder::IsSignature ( uint32_t index)
inline

Definition at line 410 of file wasm-module-builder.h.

◆ IsStructType() [1/2]

bool v8::internal::wasm::WasmModuleBuilder::IsStructType ( ModuleTypeIndex index)
inline

Definition at line 426 of file wasm-module-builder.h.

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

◆ IsStructType() [2/2]

bool v8::internal::wasm::WasmModuleBuilder::IsStructType ( uint32_t index)
inline

Definition at line 423 of file wasm-module-builder.h.

◆ IsTable64()

bool v8::internal::wasm::WasmModuleBuilder::IsTable64 ( uint32_t index)
inline

Definition at line 469 of file wasm-module-builder.h.

◆ MarkStartFunction()

void v8::internal::wasm::WasmModuleBuilder::MarkStartFunction ( WasmFunctionBuilder * builder)

Definition at line 626 of file wasm-module-builder.cc.

Here is the caller graph for this function:

◆ NumDataSegments()

int v8::internal::wasm::WasmModuleBuilder::NumDataSegments ( )
inline

Definition at line 465 of file wasm-module-builder.h.

◆ NumDeclaredFunctions()

int v8::internal::wasm::WasmModuleBuilder::NumDeclaredFunctions ( )
inline

Definition at line 463 of file wasm-module-builder.h.

◆ NumGlobals()

int v8::internal::wasm::WasmModuleBuilder::NumGlobals ( )
inline

Definition at line 458 of file wasm-module-builder.h.

◆ NumImportedFunctions()

int v8::internal::wasm::WasmModuleBuilder::NumImportedFunctions ( )
inline

Definition at line 460 of file wasm-module-builder.h.

◆ NumMemories()

int v8::internal::wasm::WasmModuleBuilder::NumMemories ( )
inline

Definition at line 456 of file wasm-module-builder.h.

◆ NumTables()

int v8::internal::wasm::WasmModuleBuilder::NumTables ( )
inline

Definition at line 454 of file wasm-module-builder.h.

Here is the caller graph for this function:

◆ NumTags()

int v8::internal::wasm::WasmModuleBuilder::NumTags ( )
inline

Definition at line 450 of file wasm-module-builder.h.

◆ NumTypes()

int v8::internal::wasm::WasmModuleBuilder::NumTypes ( )
inline

Definition at line 452 of file wasm-module-builder.h.

◆ operator=()

WasmModuleBuilder & v8::internal::wasm::WasmModuleBuilder::operator= ( const WasmModuleBuilder & )
delete

◆ SetIndirectFunction()

void v8::internal::wasm::WasmModuleBuilder::SetIndirectFunction ( uint32_t table_index,
uint32_t index_in_table,
uint32_t direct_function_index,
WasmElemSegment::FunctionIndexingMode indexing_mode )

Definition at line 595 of file wasm-module-builder.cc.

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

◆ StartRecursiveTypeGroup()

void v8::internal::wasm::WasmModuleBuilder::StartRecursiveTypeGroup ( )
inline

Definition at line 384 of file wasm-module-builder.h.

◆ WriteAsmJsOffsetTable()

void v8::internal::wasm::WasmModuleBuilder::WriteAsmJsOffsetTable ( ZoneBuffer * buffer) const

Definition at line 1045 of file wasm-module-builder.cc.

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

◆ WriteTo()

void v8::internal::wasm::WasmModuleBuilder::WriteTo ( ZoneBuffer * buffer) const

Definition at line 663 of file wasm-module-builder.cc.

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

◆ zone()

Zone * v8::internal::wasm::WasmModuleBuilder::zone ( )
inline

Definition at line 406 of file wasm-module-builder.h.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ WasmFunctionBuilder

friend class WasmFunctionBuilder
friend

Definition at line 536 of file wasm-module-builder.h.

Member Data Documentation

◆ current_recursive_group_start_

int v8::internal::wasm::WasmModuleBuilder::current_recursive_group_start_
private

Definition at line 550 of file wasm-module-builder.h.

◆ data_segments_

ZoneVector<WasmDataSegment> v8::internal::wasm::WasmModuleBuilder::data_segments_
private

Definition at line 545 of file wasm-module-builder.h.

◆ element_segments_

ZoneVector<WasmElemSegment> v8::internal::wasm::WasmModuleBuilder::element_segments_
private

Definition at line 546 of file wasm-module-builder.h.

◆ exports_

ZoneVector<WasmExport> v8::internal::wasm::WasmModuleBuilder::exports_
private

Definition at line 541 of file wasm-module-builder.h.

◆ function_imports_

ZoneVector<WasmFunctionImport> v8::internal::wasm::WasmModuleBuilder::function_imports_
private

Definition at line 539 of file wasm-module-builder.h.

◆ functions_

ZoneVector<WasmFunctionBuilder*> v8::internal::wasm::WasmModuleBuilder::functions_
private

Definition at line 542 of file wasm-module-builder.h.

◆ global_imports_

ZoneVector<WasmGlobalImport> v8::internal::wasm::WasmModuleBuilder::global_imports_
private

Definition at line 540 of file wasm-module-builder.h.

◆ globals_

ZoneVector<WasmGlobal> v8::internal::wasm::WasmModuleBuilder::globals_
private

Definition at line 547 of file wasm-module-builder.h.

◆ memories_

ZoneVector<WasmMemory> v8::internal::wasm::WasmModuleBuilder::memories_
private

Definition at line 544 of file wasm-module-builder.h.

◆ recursive_groups_

ZoneVector<RecGroup> v8::internal::wasm::WasmModuleBuilder::recursive_groups_
private

Definition at line 555 of file wasm-module-builder.h.

◆ signature_map_

ZoneUnorderedMap<FunctionSig, ModuleTypeIndex> v8::internal::wasm::WasmModuleBuilder::signature_map_
private

Definition at line 549 of file wasm-module-builder.h.

◆ start_function_index_

int v8::internal::wasm::WasmModuleBuilder::start_function_index_
private

Definition at line 556 of file wasm-module-builder.h.

◆ tables_

ZoneVector<WasmTable> v8::internal::wasm::WasmModuleBuilder::tables_
private

Definition at line 543 of file wasm-module-builder.h.

◆ tags_

ZoneVector<ModuleTypeIndex> v8::internal::wasm::WasmModuleBuilder::tags_
private

Definition at line 548 of file wasm-module-builder.h.

◆ types_

ZoneVector<TypeDefinition> v8::internal::wasm::WasmModuleBuilder::types_
private

Definition at line 538 of file wasm-module-builder.h.

◆ zone_

Zone* v8::internal::wasm::WasmModuleBuilder::zone_
private

Definition at line 537 of file wasm-module-builder.h.


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