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

#include <wasm-code-manager.h>

Collaboration diagram for v8::internal::wasm::WasmCode:

Public Types

enum  Kind { kWasmFunction , kWasmToCapiWrapper , kWasmToJsWrapper , kJumpTable }
 
enum  FlushICache : bool { kFlushICache = true , kNoFlushICache = false }
 

Public Member Functions

base::Vector< uint8_t > instructions () const
 
Address instruction_start () const
 
size_t instructions_size () const
 
base::Vector< const uint8_t > reloc_info () const
 
base::Vector< const uint8_t > source_positions () const
 
base::Vector< const uint8_t > inlining_positions () const
 
base::Vector< const uint8_t > deopt_data () const
 
int index () const
 
bool IsAnonymous () const
 
Kind kind () const
 
NativeModulenative_module () const
 
ExecutionTier tier () const
 
Address constant_pool () const
 
Address handler_table () const
 
int handler_table_size () const
 
Address code_comments () const
 
int code_comments_size () const
 
int constant_pool_offset () const
 
int safepoint_table_offset () const
 
int handler_table_offset () const
 
int code_comments_offset () const
 
int unpadded_binary_size () const
 
int stack_slots () const
 
int ool_spills () const
 
uint64_t signature_hash () const
 
uint16_t first_tagged_parameter_slot () const
 
uint16_t num_tagged_parameter_slots () const
 
uint32_t raw_tagged_parameter_slots_for_serialization () const
 
bool is_liftoff () const
 
bool is_turbofan () const
 
bool contains (Address pc) const
 
bool is_inspectable () const
 
base::Vector< const uint8_t > protected_instructions_data () const
 
base::Vector< const trap_handler::ProtectedInstructionDataprotected_instructions () const
 
bool IsProtectedInstruction (Address pc)
 
void Validate () const
 
void Print (const char *name=nullptr) const
 
void MaybePrint () const
 
void Disassemble (const char *name, std::ostream &os, Address current_pc=kNullAddress) const
 
void LogCode (Isolate *isolate, const char *source_url, int script_id) const
 
 WasmCode (const WasmCode &)=delete
 
WasmCodeoperator= (const WasmCode &)=delete
 
 ~WasmCode ()
 
void IncRef ()
 
V8_WARN_UNUSED_RESULT bool DecRef ()
 
void DecRefOnLiveCode ()
 
V8_WARN_UNUSED_RESULT bool DecRefOnDeadCode ()
 
void DcheckRefCountIsOne ()
 
SourcePosition GetSourcePositionBefore (int code_offset)
 
int GetSourceOffsetBefore (int code_offset)
 
std::tuple< int, bool, SourcePositionGetInliningPosition (int inlining_id) const
 
ForDebugging for_debugging () const
 
bool is_dying () const
 
bool frame_has_feedback_slot () const
 
size_t EstimateCurrentMemoryConsumption () const
 
std::string DebugName () const
 

Static Public Member Functions

static constexpr Builtin GetRecordWriteBuiltin (SaveFPRegsMode fp_mode)
 
static bool ShouldBeLogged (Isolate *isolate)
 
static void DecrementRefCount (base::Vector< WasmCode *const >)
 

Private Types

using KindField = base::BitField8<Kind, 0, 2>
 
using ExecutionTierField = KindField::Next<ExecutionTier, 2>
 
using ForDebuggingField = ExecutionTierField::Next<ForDebugging, 2>
 
using FrameHasFeedbackSlotField = ForDebuggingField::Next<bool, 1>
 

Private Member Functions

 WasmCode (NativeModule *native_module, int index, base::Vector< uint8_t > instructions, int stack_slots, int ool_spills, uint32_t tagged_parameter_slots, int safepoint_table_offset, int handler_table_offset, int constant_pool_offset, int code_comments_offset, int unpadded_binary_size, base::Vector< const uint8_t > protected_instructions_data, base::Vector< const uint8_t > reloc_info, base::Vector< const uint8_t > source_position_table, base::Vector< const uint8_t > inlining_positions, base::Vector< const uint8_t > deopt_data, Kind kind, ExecutionTier tier, ForDebugging for_debugging, uint64_t signature_hash, bool frame_has_feedback_slot=false)
 
std::unique_ptr< const uint8_t[]> ConcatenateBytes (std::initializer_list< base::Vector< const uint8_t > >)
 
int trap_handler_index () const
 
void set_trap_handler_index (int value)
 
bool has_trap_handler_index () const
 
void RegisterTrapHandlerData ()
 
V8_NOINLINE void DecRefOnPotentiallyDeadCode ()
 
void mark_as_dying ()
 
void undo_mark_as_dying ()
 

Private Attributes

NativeModule *const native_module_ = nullptr
 
uint8_t *const instructions_
 
const uint64_t signature_hash_
 
std::unique_ptr< const uint8_t[]> meta_data_
 
const int instructions_size_
 
const int reloc_info_size_
 
const int source_positions_size_
 
const int inlining_positions_size_
 
const int deopt_data_size_
 
const int protected_instructions_size_
 
const int index_
 
const int constant_pool_offset_
 
const int stack_slots_
 
const int ool_spills_
 
const uint32_t tagged_parameter_slots_
 
const int safepoint_table_offset_
 
const int handler_table_offset_
 
const int code_comments_offset_
 
const int unpadded_binary_size_
 
int trap_handler_index_ = -1
 
const uint8_t flags_
 
std::atomic< booldying_ {false}
 
std::atomic< int > ref_count_ {1}
 

Friends

class NativeModule
 
class WasmImportWrapperCache
 

Detailed Description

Definition at line 90 of file wasm-code-manager.h.

Member Typedef Documentation

◆ ExecutionTierField

◆ ForDebuggingField

◆ FrameHasFeedbackSlotField

◆ KindField

Definition at line 471 of file wasm-code-manager.h.

Member Enumeration Documentation

◆ FlushICache

Enumerator
kFlushICache 
kNoFlushICache 

Definition at line 353 of file wasm-code-manager.h.

◆ Kind

Enumerator
kWasmFunction 
kWasmToCapiWrapper 
kWasmToJsWrapper 
kJumpTable 

Definition at line 92 of file wasm-code-manager.h.

Constructor & Destructor Documentation

◆ WasmCode() [1/2]

v8::internal::wasm::WasmCode::WasmCode ( const WasmCode & )
delete
Here is the caller graph for this function:

◆ ~WasmCode()

v8::internal::wasm::WasmCode::~WasmCode ( )

Definition at line 555 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ WasmCode() [2/2]

v8::internal::wasm::WasmCode::WasmCode ( NativeModule * native_module,
int index,
base::Vector< uint8_t > instructions,
int stack_slots,
int ool_spills,
uint32_t tagged_parameter_slots,
int safepoint_table_offset,
int handler_table_offset,
int constant_pool_offset,
int code_comments_offset,
int unpadded_binary_size,
base::Vector< const uint8_t > protected_instructions_data,
base::Vector< const uint8_t > reloc_info,
base::Vector< const uint8_t > source_position_table,
base::Vector< const uint8_t > inlining_positions,
base::Vector< const uint8_t > deopt_data,
Kind kind,
ExecutionTier tier,
ForDebugging for_debugging,
uint64_t signature_hash,
bool frame_has_feedback_slot = false )
inlineprivate

Definition at line 365 of file wasm-code-manager.h.

Member Function Documentation

◆ code_comments()

Address v8::internal::wasm::WasmCode::code_comments ( ) const

Definition at line 192 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ code_comments_offset()

int v8::internal::wasm::WasmCode::code_comments_offset ( ) const
inline

Definition at line 209 of file wasm-code-manager.h.

◆ code_comments_size()

int v8::internal::wasm::WasmCode::code_comments_size ( ) const

Definition at line 196 of file wasm-code-manager.cc.

◆ ConcatenateBytes()

std::unique_ptr< const uint8_t[]> v8::internal::wasm::WasmCode::ConcatenateBytes ( std::initializer_list< base::Vector< const uint8_t > > vectors)
private

Definition at line 201 of file wasm-code-manager.cc.

◆ constant_pool()

Address v8::internal::wasm::WasmCode::constant_pool ( ) const

Definition at line 174 of file wasm-code-manager.cc.

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

◆ constant_pool_offset()

int v8::internal::wasm::WasmCode::constant_pool_offset ( ) const
inline

Definition at line 206 of file wasm-code-manager.h.

◆ contains()

bool v8::internal::wasm::WasmCode::contains ( Address pc) const
inline

Definition at line 228 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ DcheckRefCountIsOne()

void v8::internal::wasm::WasmCode::DcheckRefCountIsOne ( )
inline

Definition at line 326 of file wasm-code-manager.h.

◆ DebugName()

std::string v8::internal::wasm::WasmCode::DebugName ( ) const

Definition at line 242 of file wasm-code-manager.cc.

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

◆ DecRef()

V8_WARN_UNUSED_RESULT bool v8::internal::wasm::WasmCode::DecRef ( )
inline

Definition at line 272 of file wasm-code-manager.h.

◆ DecRefOnDeadCode()

V8_WARN_UNUSED_RESULT bool v8::internal::wasm::WasmCode::DecRefOnDeadCode ( )
inline

Definition at line 315 of file wasm-code-manager.h.

◆ DecRefOnLiveCode()

void v8::internal::wasm::WasmCode::DecRefOnLiveCode ( )
inline

Definition at line 306 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ DecRefOnPotentiallyDeadCode()

void v8::internal::wasm::WasmCode::DecRefOnPotentiallyDeadCode ( )
private

Definition at line 561 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ DecrementRefCount()

void v8::internal::wasm::WasmCode::DecrementRefCount ( base::Vector< WasmCode *const > code_vec)
static

Definition at line 566 of file wasm-code-manager.cc.

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

◆ deopt_data()

base::Vector< const uint8_t > v8::internal::wasm::WasmCode::deopt_data ( ) const
inline

Definition at line 191 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ Disassemble()

void v8::internal::wasm::WasmCode::Disassemble ( const char * name,
std::ostream & os,
Address current_pc = kNullAddress ) const

Definition at line 434 of file wasm-code-manager.cc.

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

◆ EstimateCurrentMemoryConsumption()

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

Definition at line 615 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ first_tagged_parameter_slot()

uint16_t v8::internal::wasm::WasmCode::first_tagged_parameter_slot ( ) const
inline

Definition at line 214 of file wasm-code-manager.h.

◆ for_debugging()

ForDebugging v8::internal::wasm::WasmCode::for_debugging ( ) const
inline

Definition at line 340 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ frame_has_feedback_slot()

bool v8::internal::wasm::WasmCode::frame_has_feedback_slot ( ) const
inline

Definition at line 349 of file wasm-code-manager.h.

◆ GetInliningPosition()

std::tuple< int, bool, SourcePosition > v8::internal::wasm::WasmCode::GetInliningPosition ( int inlining_id) const

Definition at line 600 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ GetRecordWriteBuiltin()

static constexpr Builtin v8::internal::wasm::WasmCode::GetRecordWriteBuiltin ( SaveFPRegsMode fp_mode)
inlinestaticconstexpr

Definition at line 102 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ GetSourceOffsetBefore()

int v8::internal::wasm::WasmCode::GetSourceOffsetBefore ( int code_offset)

Definition at line 596 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ GetSourcePositionBefore()

SourcePosition v8::internal::wasm::WasmCode::GetSourcePositionBefore ( int code_offset)

Definition at line 586 of file wasm-code-manager.cc.

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

◆ handler_table()

Address v8::internal::wasm::WasmCode::handler_table ( ) const

Definition at line 183 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ handler_table_offset()

int v8::internal::wasm::WasmCode::handler_table_offset ( ) const
inline

Definition at line 208 of file wasm-code-manager.h.

◆ handler_table_size()

int v8::internal::wasm::WasmCode::handler_table_size ( ) const

Definition at line 187 of file wasm-code-manager.cc.

Here is the caller graph for this function:

◆ has_trap_handler_index()

bool v8::internal::wasm::WasmCode::has_trap_handler_index ( ) const
inlineprivate

Definition at line 421 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ IncRef()

void v8::internal::wasm::WasmCode::IncRef ( )
inline

Definition at line 263 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ index()

int v8::internal::wasm::WasmCode::index ( ) const
inline

Definition at line 195 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ inlining_positions()

base::Vector< const uint8_t > v8::internal::wasm::WasmCode::inlining_positions ( ) const
inline

Definition at line 187 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ instruction_start()

Address v8::internal::wasm::WasmCode::instruction_start ( ) const
inline

Definition at line 174 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ instructions()

base::Vector< uint8_t > v8::internal::wasm::WasmCode::instructions ( ) const
inline

Definition at line 170 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ instructions_size()

size_t v8::internal::wasm::WasmCode::instructions_size ( ) const
inline

Definition at line 177 of file wasm-code-manager.h.

◆ is_dying()

bool v8::internal::wasm::WasmCode::is_dying ( ) const
inline

Definition at line 344 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ is_inspectable()

bool v8::internal::wasm::WasmCode::is_inspectable ( ) const
inline

Definition at line 235 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ is_liftoff()

bool v8::internal::wasm::WasmCode::is_liftoff ( ) const
inline

Definition at line 224 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ is_turbofan()

bool v8::internal::wasm::WasmCode::is_turbofan ( ) const
inline

Definition at line 226 of file wasm-code-manager.h.

◆ IsAnonymous()

bool v8::internal::wasm::WasmCode::IsAnonymous ( ) const
inline

Definition at line 197 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ IsProtectedInstruction()

bool v8::internal::wasm::WasmCode::IsProtectedInstruction ( Address pc)

Definition at line 326 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ kind()

Kind v8::internal::wasm::WasmCode::kind ( ) const
inline

Definition at line 198 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ LogCode()

void v8::internal::wasm::WasmCode::LogCode ( Isolate * isolate,
const char * source_url,
int script_id ) const

Definition at line 276 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ mark_as_dying()

void v8::internal::wasm::WasmCode::mark_as_dying ( )
inlineprivate

Definition at line 431 of file wasm-code-manager.h.

◆ MaybePrint()

void v8::internal::wasm::WasmCode::MaybePrint ( ) const

Definition at line 407 of file wasm-code-manager.cc.

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

◆ native_module()

NativeModule * v8::internal::wasm::WasmCode::native_module ( ) const
inline

Definition at line 199 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ num_tagged_parameter_slots()

uint16_t v8::internal::wasm::WasmCode::num_tagged_parameter_slots ( ) const
inline

Definition at line 217 of file wasm-code-manager.h.

◆ ool_spills()

int v8::internal::wasm::WasmCode::ool_spills ( ) const
inline

Definition at line 212 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ operator=()

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

◆ Print()

void v8::internal::wasm::WasmCode::Print ( const char * name = nullptr) const

Definition at line 421 of file wasm-code-manager.cc.

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

◆ protected_instructions()

base::Vector< const trap_handler::ProtectedInstructionData > v8::internal::wasm::WasmCode::protected_instructions ( ) const
inline

Definition at line 243 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ protected_instructions_data()

base::Vector< const uint8_t > v8::internal::wasm::WasmCode::protected_instructions_data ( ) const
inline

Definition at line 237 of file wasm-code-manager.h.

◆ raw_tagged_parameter_slots_for_serialization()

uint32_t v8::internal::wasm::WasmCode::raw_tagged_parameter_slots_for_serialization ( ) const
inline

Definition at line 220 of file wasm-code-manager.h.

◆ RegisterTrapHandlerData()

void v8::internal::wasm::WasmCode::RegisterTrapHandlerData ( )
private

Definition at line 216 of file wasm-code-manager.cc.

Here is the call graph for this function:

◆ reloc_info()

base::Vector< const uint8_t > v8::internal::wasm::WasmCode::reloc_info ( ) const
inline

Definition at line 180 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ safepoint_table_offset()

int v8::internal::wasm::WasmCode::safepoint_table_offset ( ) const
inline

Definition at line 207 of file wasm-code-manager.h.

◆ set_trap_handler_index()

void v8::internal::wasm::WasmCode::set_trap_handler_index ( int value)
inlineprivate

Definition at line 417 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ ShouldBeLogged()

bool v8::internal::wasm::WasmCode::ShouldBeLogged ( Isolate * isolate)
static

Definition at line 235 of file wasm-code-manager.cc.

Here is the caller graph for this function:

◆ signature_hash()

uint64_t v8::internal::wasm::WasmCode::signature_hash ( ) const
inline

Definition at line 213 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ source_positions()

base::Vector< const uint8_t > v8::internal::wasm::WasmCode::source_positions ( ) const
inline

Definition at line 184 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ stack_slots()

int v8::internal::wasm::WasmCode::stack_slots ( ) const
inline

Definition at line 211 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ tier()

ExecutionTier v8::internal::wasm::WasmCode::tier ( ) const
inline

Definition at line 200 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ trap_handler_index()

int v8::internal::wasm::WasmCode::trap_handler_index ( ) const
inlineprivate

Definition at line 413 of file wasm-code-manager.h.

Here is the caller graph for this function:

◆ undo_mark_as_dying()

void v8::internal::wasm::WasmCode::undo_mark_as_dying ( )
inlineprivate

Definition at line 434 of file wasm-code-manager.h.

◆ unpadded_binary_size()

int v8::internal::wasm::WasmCode::unpadded_binary_size ( ) const
inline

Definition at line 210 of file wasm-code-manager.h.

◆ Validate()

void v8::internal::wasm::WasmCode::Validate ( ) const

Definition at line 335 of file wasm-code-manager.cc.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ NativeModule

friend class NativeModule
friend

Definition at line 362 of file wasm-code-manager.h.

◆ WasmImportWrapperCache

friend class WasmImportWrapperCache
friend

Definition at line 363 of file wasm-code-manager.h.

Member Data Documentation

◆ code_comments_offset_

const int v8::internal::wasm::WasmCode::code_comments_offset_
private

Definition at line 464 of file wasm-code-manager.h.

◆ constant_pool_offset_

const int v8::internal::wasm::WasmCode::constant_pool_offset_
private

Definition at line 453 of file wasm-code-manager.h.

◆ deopt_data_size_

const int v8::internal::wasm::WasmCode::deopt_data_size_
private

Definition at line 450 of file wasm-code-manager.h.

◆ dying_

std::atomic<bool> v8::internal::wasm::WasmCode::dying_ {false}
private

Definition at line 482 of file wasm-code-manager.h.

◆ flags_

const uint8_t v8::internal::wasm::WasmCode::flags_
private

Definition at line 468 of file wasm-code-manager.h.

◆ handler_table_offset_

const int v8::internal::wasm::WasmCode::handler_table_offset_
private

Definition at line 463 of file wasm-code-manager.h.

◆ index_

const int v8::internal::wasm::WasmCode::index_
private

Definition at line 452 of file wasm-code-manager.h.

◆ inlining_positions_size_

const int v8::internal::wasm::WasmCode::inlining_positions_size_
private

Definition at line 449 of file wasm-code-manager.h.

◆ instructions_

uint8_t* const v8::internal::wasm::WasmCode::instructions_
private

Definition at line 437 of file wasm-code-manager.h.

◆ instructions_size_

const int v8::internal::wasm::WasmCode::instructions_size_
private

Definition at line 446 of file wasm-code-manager.h.

◆ meta_data_

std::unique_ptr<const uint8_t[]> v8::internal::wasm::WasmCode::meta_data_
private

Definition at line 445 of file wasm-code-manager.h.

◆ native_module_

NativeModule* const v8::internal::wasm::WasmCode::native_module_ = nullptr
private

Definition at line 436 of file wasm-code-manager.h.

◆ ool_spills_

const int v8::internal::wasm::WasmCode::ool_spills_
private

Definition at line 455 of file wasm-code-manager.h.

◆ protected_instructions_size_

const int v8::internal::wasm::WasmCode::protected_instructions_size_
private

Definition at line 451 of file wasm-code-manager.h.

◆ ref_count_

std::atomic<int> v8::internal::wasm::WasmCode::ref_count_ {1}
private

Definition at line 494 of file wasm-code-manager.h.

◆ reloc_info_size_

const int v8::internal::wasm::WasmCode::reloc_info_size_
private

Definition at line 447 of file wasm-code-manager.h.

◆ safepoint_table_offset_

const int v8::internal::wasm::WasmCode::safepoint_table_offset_
private

Definition at line 462 of file wasm-code-manager.h.

◆ signature_hash_

const uint64_t v8::internal::wasm::WasmCode::signature_hash_
private

Definition at line 438 of file wasm-code-manager.h.

◆ source_positions_size_

const int v8::internal::wasm::WasmCode::source_positions_size_
private

Definition at line 448 of file wasm-code-manager.h.

◆ stack_slots_

const int v8::internal::wasm::WasmCode::stack_slots_
private

Definition at line 454 of file wasm-code-manager.h.

◆ tagged_parameter_slots_

const uint32_t v8::internal::wasm::WasmCode::tagged_parameter_slots_
private

Definition at line 459 of file wasm-code-manager.h.

◆ trap_handler_index_

int v8::internal::wasm::WasmCode::trap_handler_index_ = -1
private

Definition at line 466 of file wasm-code-manager.h.

◆ unpadded_binary_size_

const int v8::internal::wasm::WasmCode::unpadded_binary_size_
private

Definition at line 465 of file wasm-code-manager.h.


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