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

#include <wasm-module-builder.h>

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

Classes

struct  DirectCallIndex
 

Public Member Functions

void SetSignature (const FunctionSig *sig)
 
void SetSignature (ModuleTypeIndex sig_index)
 
uint32_t AddLocal (ValueType type)
 
void EmitByte (uint8_t b)
 
void EmitI32V (int32_t val)
 
void EmitI32V (ModuleTypeIndex index)
 
void EmitU32V (uint32_t val)
 
void EmitU32V (ModuleTypeIndex index)
 
void EmitU64V (uint64_t val)
 
void EmitCode (const uint8_t *code, uint32_t code_size)
 
void EmitCode (std::initializer_list< const uint8_t > code)
 
void Emit (WasmOpcode opcode)
 
void EmitWithPrefix (WasmOpcode opcode)
 
void EmitGetLocal (uint32_t index)
 
void EmitSetLocal (uint32_t index)
 
void EmitTeeLocal (uint32_t index)
 
void EmitI32Const (int32_t val)
 
void EmitI64Const (int64_t val)
 
void EmitF32Const (float val)
 
void EmitF64Const (double val)
 
void EmitS128Const (Simd128 val)
 
void EmitWithU8 (WasmOpcode opcode, const uint8_t immediate)
 
void EmitWithU8U8 (WasmOpcode opcode, const uint8_t imm1, const uint8_t imm2)
 
void EmitWithI32V (WasmOpcode opcode, int32_t immediate)
 
void EmitWithU32V (WasmOpcode opcode, uint32_t immediate)
 
void EmitWithU32V (WasmOpcode opcode, ModuleTypeIndex index)
 
void EmitHeapType (HeapType type)
 
void EmitValueType (ValueType type)
 
void EmitDirectCallIndex (uint32_t index)
 
void EmitFromInitializerExpression (const WasmInitExpr &init_expr)
 
void SetName (base::Vector< const char > name)
 
void AddAsmWasmOffset (size_t call_position, size_t to_number_position)
 
void SetAsmFunctionStartPosition (size_t function_position)
 
void SetCompilationHint (WasmCompilationHintStrategy strategy, WasmCompilationHintTier baseline, WasmCompilationHintTier top_tier)
 
size_t GetPosition () const
 
void FixupByte (size_t position, uint8_t value)
 
void DeleteCodeAfter (size_t position)
 
void WriteSignature (ZoneBuffer *buffer) const
 
void WriteBody (ZoneBuffer *buffer) const
 
void WriteAsmWasmOffsetTable (ZoneBuffer *buffer) const
 
WasmModuleBuilderbuilder () const
 
uint32_t func_index () const
 
ModuleTypeIndex sig_index () const
 
const FunctionSigsignature () 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 Member Functions

 WasmFunctionBuilder (WasmModuleBuilder *builder)
 

Private Attributes

friend Zone
 
WasmModuleBuilderbuilder_
 
LocalDeclEncoder locals_
 
ModuleTypeIndex signature_index_
 
uint32_t func_index_
 
ZoneBuffer body_
 
base::Vector< const char > name_
 
ZoneVector< uint32_t > i32_temps_
 
ZoneVector< uint32_t > i64_temps_
 
ZoneVector< uint32_t > f32_temps_
 
ZoneVector< uint32_t > f64_temps_
 
ZoneVector< DirectCallIndexdirect_calls_
 
ZoneBuffer asm_offsets_
 
uint32_t last_asm_byte_offset_ = 0
 
uint32_t last_asm_source_position_ = 0
 
uint32_t asm_func_start_source_position_ = 0
 
uint8_t hint_ = kNoCompilationHint
 

Friends

class WasmModuleBuilder
 

Detailed Description

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

Constructor & Destructor Documentation

◆ WasmFunctionBuilder()

v8::internal::wasm::WasmFunctionBuilder::WasmFunctionBuilder ( WasmModuleBuilder * builder)
explicitprivate

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

Member Function Documentation

◆ AddAsmWasmOffset()

void v8::internal::wasm::WasmFunctionBuilder::AddAsmWasmOffset ( size_t call_position,
size_t to_number_position )

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

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

◆ AddLocal()

uint32_t v8::internal::wasm::WasmFunctionBuilder::AddLocal ( ValueType type)

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

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

◆ builder()

WasmModuleBuilder * v8::internal::wasm::WasmFunctionBuilder::builder ( ) const
inline

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

◆ DeleteCodeAfter()

void v8::internal::wasm::WasmFunctionBuilder::DeleteCodeAfter ( size_t position)

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

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

◆ Emit()

void v8::internal::wasm::WasmFunctionBuilder::Emit ( WasmOpcode opcode)

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

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

◆ EmitByte()

void v8::internal::wasm::WasmFunctionBuilder::EmitByte ( uint8_t b)

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

Here is the call graph for this function:

◆ EmitCode() [1/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitCode ( const uint8_t * code,
uint32_t code_size )

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

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

◆ EmitCode() [2/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitCode ( std::initializer_list< const uint8_t > code)

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

Here is the call graph for this function:

◆ EmitDirectCallIndex()

void v8::internal::wasm::WasmFunctionBuilder::EmitDirectCallIndex ( uint32_t index)

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

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

◆ EmitF32Const()

void v8::internal::wasm::WasmFunctionBuilder::EmitF32Const ( float val)

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

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

◆ EmitF64Const()

void v8::internal::wasm::WasmFunctionBuilder::EmitF64Const ( double val)

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

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

◆ EmitFromInitializerExpression()

void v8::internal::wasm::WasmFunctionBuilder::EmitFromInitializerExpression ( const WasmInitExpr & init_expr)

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

Here is the caller graph for this function:

◆ EmitGetLocal()

void v8::internal::wasm::WasmFunctionBuilder::EmitGetLocal ( uint32_t index)

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

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

◆ EmitHeapType()

void v8::internal::wasm::WasmFunctionBuilder::EmitHeapType ( HeapType type)

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

◆ EmitI32Const()

void v8::internal::wasm::WasmFunctionBuilder::EmitI32Const ( int32_t val)

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

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

◆ EmitI32V() [1/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitI32V ( int32_t val)

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

Here is the call graph for this function:

◆ EmitI32V() [2/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitI32V ( ModuleTypeIndex index)
inline

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

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

◆ EmitI64Const()

void v8::internal::wasm::WasmFunctionBuilder::EmitI64Const ( int64_t val)

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

Here is the call graph for this function:

◆ EmitS128Const()

void v8::internal::wasm::WasmFunctionBuilder::EmitS128Const ( Simd128 val)

◆ EmitSetLocal()

void v8::internal::wasm::WasmFunctionBuilder::EmitSetLocal ( uint32_t index)

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

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

◆ EmitTeeLocal()

void v8::internal::wasm::WasmFunctionBuilder::EmitTeeLocal ( uint32_t index)

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

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

◆ EmitU32V() [1/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitU32V ( ModuleTypeIndex index)
inline

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

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

◆ EmitU32V() [2/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitU32V ( uint32_t val)

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

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

◆ EmitU64V()

void v8::internal::wasm::WasmFunctionBuilder::EmitU64V ( uint64_t val)

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

Here is the call graph for this function:

◆ EmitValueType()

void v8::internal::wasm::WasmFunctionBuilder::EmitValueType ( ValueType type)

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

◆ EmitWithI32V()

void v8::internal::wasm::WasmFunctionBuilder::EmitWithI32V ( WasmOpcode opcode,
int32_t immediate )

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

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

◆ EmitWithPrefix()

void v8::internal::wasm::WasmFunctionBuilder::EmitWithPrefix ( WasmOpcode opcode)

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

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

◆ EmitWithU32V() [1/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitWithU32V ( WasmOpcode opcode,
ModuleTypeIndex index )
inline

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

◆ EmitWithU32V() [2/2]

void v8::internal::wasm::WasmFunctionBuilder::EmitWithU32V ( WasmOpcode opcode,
uint32_t immediate )

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

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

◆ EmitWithU8()

void v8::internal::wasm::WasmFunctionBuilder::EmitWithU8 ( WasmOpcode opcode,
const uint8_t immediate )

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

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

◆ EmitWithU8U8()

void v8::internal::wasm::WasmFunctionBuilder::EmitWithU8U8 ( WasmOpcode opcode,
const uint8_t imm1,
const uint8_t imm2 )

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

Here is the call graph for this function:

◆ FixupByte()

void v8::internal::wasm::WasmFunctionBuilder::FixupByte ( size_t position,
uint8_t value )
inline

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

Here is the caller graph for this function:

◆ func_index()

uint32_t v8::internal::wasm::WasmFunctionBuilder::func_index ( ) const
inline

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

Here is the caller graph for this function:

◆ GetPosition()

size_t v8::internal::wasm::WasmFunctionBuilder::GetPosition ( ) const
inline

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

Here is the caller graph for this function:

◆ SetAsmFunctionStartPosition()

void v8::internal::wasm::WasmFunctionBuilder::SetAsmFunctionStartPosition ( size_t function_position)

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

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

◆ SetCompilationHint()

void v8::internal::wasm::WasmFunctionBuilder::SetCompilationHint ( WasmCompilationHintStrategy strategy,
WasmCompilationHintTier baseline,
WasmCompilationHintTier top_tier )

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

◆ SetName()

void v8::internal::wasm::WasmFunctionBuilder::SetName ( base::Vector< const char > name)

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

Here is the caller graph for this function:

◆ SetSignature() [1/2]

void v8::internal::wasm::WasmFunctionBuilder::SetSignature ( const FunctionSig * sig)

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

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

◆ SetSignature() [2/2]

void v8::internal::wasm::WasmFunctionBuilder::SetSignature ( ModuleTypeIndex sig_index)

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

Here is the call graph for this function:

◆ sig_index()

ModuleTypeIndex v8::internal::wasm::WasmFunctionBuilder::sig_index ( ) const
inline

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

Here is the caller graph for this function:

◆ signature()

const FunctionSig * v8::internal::wasm::WasmFunctionBuilder::signature ( ) const
inline

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

Here is the caller graph for this function:

◆ WriteAsmWasmOffsetTable()

void v8::internal::wasm::WasmFunctionBuilder::WriteAsmWasmOffsetTable ( ZoneBuffer * buffer) const

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

Here is the call graph for this function:

◆ WriteBody()

void v8::internal::wasm::WasmFunctionBuilder::WriteBody ( ZoneBuffer * buffer) const

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

Here is the call graph for this function:

◆ WriteSignature()

void v8::internal::wasm::WasmFunctionBuilder::WriteSignature ( ZoneBuffer * buffer) const

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

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ WasmModuleBuilder

friend class WasmModuleBuilder
friend

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

Member Data Documentation

◆ asm_func_start_source_position_

uint32_t v8::internal::wasm::WasmFunctionBuilder::asm_func_start_source_position_ = 0
private

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

◆ asm_offsets_

ZoneBuffer v8::internal::wasm::WasmFunctionBuilder::asm_offsets_
private

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

◆ body_

ZoneBuffer v8::internal::wasm::WasmFunctionBuilder::body_
private

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

◆ builder_

WasmModuleBuilder* v8::internal::wasm::WasmFunctionBuilder::builder_
private

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

◆ direct_calls_

ZoneVector<DirectCallIndex> v8::internal::wasm::WasmFunctionBuilder::direct_calls_
private

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

◆ f32_temps_

ZoneVector<uint32_t> v8::internal::wasm::WasmFunctionBuilder::f32_temps_
private

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

◆ f64_temps_

ZoneVector<uint32_t> v8::internal::wasm::WasmFunctionBuilder::f64_temps_
private

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

◆ func_index_

uint32_t v8::internal::wasm::WasmFunctionBuilder::func_index_
private

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

◆ hint_

uint8_t v8::internal::wasm::WasmFunctionBuilder::hint_ = kNoCompilationHint
private

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

◆ i32_temps_

ZoneVector<uint32_t> v8::internal::wasm::WasmFunctionBuilder::i32_temps_
private

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

◆ i64_temps_

ZoneVector<uint32_t> v8::internal::wasm::WasmFunctionBuilder::i64_temps_
private

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

◆ last_asm_byte_offset_

uint32_t v8::internal::wasm::WasmFunctionBuilder::last_asm_byte_offset_ = 0
private

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

◆ last_asm_source_position_

uint32_t v8::internal::wasm::WasmFunctionBuilder::last_asm_source_position_ = 0
private

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

◆ locals_

LocalDeclEncoder v8::internal::wasm::WasmFunctionBuilder::locals_
private

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

◆ name_

base::Vector<const char> v8::internal::wasm::WasmFunctionBuilder::name_
private

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

◆ signature_index_

ModuleTypeIndex v8::internal::wasm::WasmFunctionBuilder::signature_index_
private

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

◆ Zone

friend v8::internal::wasm::WasmFunctionBuilder::Zone
private

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


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