hasmer
Public Member Functions | Properties | List of all members
Hasmer.HbcFuncHeader Class Reference

Represents a function header definition in a Hermes bytecode file. More...

Inheritance diagram for Hasmer.HbcFuncHeader:
Hasmer.HbcEncodedItem Hasmer.HbcSmallFuncHeader

Public Member Functions

virtual HbcFuncHeader GetAssemblerHeader ()
 Gets the header that should be used for disassembly and decompilation, i.e. the header that contains instructions. HbcSmallFuncHeader objects do not contain bodies, so this returns the large header for such objects. More...
 
string GetFunctionName (HbcFile source)
 Gets the name of a function, or the autogenerated name of a closure if it's an unnamed closure. More...
 
void ClearInstructionCache ()
 Clears the instructions cache so that a future call to Disassemble will disassemble and re-cache the data from scratch. More...
 
List< HbcInstructionDisassemble ()
 Disassembles the function, parsing the bytecode into an HbcInstruction object for each instruction.
The instructions will be cached. To clear the cache and have this function re-parse the instructions, see ClearInstructionCache. More...
 

Properties

uint FunctionId [get, set]
 The sequential ID of the function. More...
 
uint Offset [get, set]
 The offset in the HbcFile of the function. More...
 
uint ParamCount [get, set]
 The amount of parameters that the function takes. More...
 
uint BytecodeSizeInBytes [get, set]
 The amount of bytes that the function's bytecode takes up. More...
 
uint FunctionName [get, set]
 The index in the string table of the function's name (i.e. HbcFile.GetStringTableEntry(FunctionName)). More...
 
uint InfoOffset [get, set]
 The offset in the HbcFile of additional (i.e. debug) information about the function. More...
 
uint FrameSize [get, set]
 The amount of registers that the function has. More...
 
uint EnvironmentSize [get, set]
 The amount of symbols that the function has. More...
 
uint HighestReadCacheIndex [get, set]
 
uint HighestWriteCacheIndex [get, set]
 
HbcFuncHeaderFlags Flags [get, set]
 The flags of the function. More...
 
HbcFile DeclarationFile [get, set]
 

Additional Inherited Members

- Static Public Member Functions inherited from Hasmer.HbcEncodedItem
static void WriteFromDefinition (HbcWriter writer, JToken def, object value)
 Writes a complex value given the definition and corresponding object. More...
 
static object ReadFromDefinition (HbcReader reader, JToken def)
 Reads a simple value given its definition. More...
 
static T Decode< T > (HbcReader reader, JObject obj)
 Reads a complex value from a stream given its definition. More...
 
static void Encode< T > (HbcWriter writer, JObject obj, T item)
 Encodes a complex value to a stream given its definition. More...
 

Detailed Description

Represents a function header definition in a Hermes bytecode file.

Member Function Documentation

◆ ClearInstructionCache()

void Hasmer.HbcFuncHeader.ClearInstructionCache ( )
inline

Clears the instructions cache so that a future call to Disassemble will disassemble and re-cache the data from scratch.

◆ Disassemble()

List<HbcInstruction> Hasmer.HbcFuncHeader.Disassemble ( )
inline

Disassembles the function, parsing the bytecode into an HbcInstruction object for each instruction.
The instructions will be cached. To clear the cache and have this function re-parse the instructions, see ClearInstructionCache.

◆ GetAssemblerHeader()

virtual HbcFuncHeader Hasmer.HbcFuncHeader.GetAssemblerHeader ( )
inlinevirtual

Gets the header that should be used for disassembly and decompilation, i.e. the header that contains instructions. HbcSmallFuncHeader objects do not contain bodies, so this returns the large header for such objects.

Reimplemented in Hasmer.HbcSmallFuncHeader.

◆ GetFunctionName()

string Hasmer.HbcFuncHeader.GetFunctionName ( HbcFile  source)
inline

Gets the name of a function, or the autogenerated name of a closure if it's an unnamed closure.

Property Documentation

◆ BytecodeSizeInBytes

uint Hasmer.HbcFuncHeader.BytecodeSizeInBytes
getset

The amount of bytes that the function's bytecode takes up.

◆ EnvironmentSize

uint Hasmer.HbcFuncHeader.EnvironmentSize
getset

The amount of symbols that the function has.

◆ Flags

HbcFuncHeaderFlags Hasmer.HbcFuncHeader.Flags
getset

The flags of the function.

◆ FrameSize

uint Hasmer.HbcFuncHeader.FrameSize
getset

The amount of registers that the function has.

◆ FunctionId

uint Hasmer.HbcFuncHeader.FunctionId
getset

The sequential ID of the function.

◆ FunctionName

uint Hasmer.HbcFuncHeader.FunctionName
getset

The index in the string table of the function's name (i.e. HbcFile.GetStringTableEntry(FunctionName)).

◆ InfoOffset

uint Hasmer.HbcFuncHeader.InfoOffset
getset

The offset in the HbcFile of additional (i.e. debug) information about the function.

◆ Offset

uint Hasmer.HbcFuncHeader.Offset
getset

The offset in the HbcFile of the function.

◆ ParamCount

uint Hasmer.HbcFuncHeader.ParamCount
getset

The amount of parameters that the function takes.


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