Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Types

Various basic types used throughout the Bond Runtime Library. More...

Files

file  include/bond/types/types.h
 Fixed-size integer types and the sizes, signature types and mnemonics of Bond types.

Classes

class  Bond::DataView
 An immutable object that encapsulates a pointer to a constant contiguous block of memory representing arbitrary binary data and a count of the number of bytes of data. More...
class  Bond::DataViewIndex
 An immutable object that encapsulates an array of named constant DataView objects. More...
class  Bond::QualifiedName
 An immutable wrapper around a constant array of C-style strings to represent the fully qualified name of a symbol in compiled Bond bytecode. More...
union  Bond::Value
 Union of all value types representable by a Token in the Bond compiler. More...
union  Bond::Value16
 Union of all 16 bit value types used within the Bond compiler, the CBO file format, and the Bond Virtual Machine. More...
union  Bond::Value32
 Union of all 32 bit value types used within the Bond compiler, the CBO file format, and the Bond Virtual Machine. More...
union  Bond::Value64
 Union of all 64 bit value types used within the Bond compiler, the CBO file format, and the Bond Virtual Machine. More...
struct  Bond::Value::[struct].mString
 The value as a string, which is not null terminated. More...

Macros

#define BOND_OPCODE_LIST
 An X-macro that lists every opcode in the Bond Virtual Machine instruction set.
#define BOND_SIGNATURE_TYPE_LIST
 An X-macro that lists the signature types used to describe the parameters and return values of functions in CBO files.
#define BOND_NATIVE_GETTER_SUFFIX   "@get"
 Suffix appended to the qualified name of a native struct member to form the name of the native function that reads its value.
#define BOND_NATIVE_SETTER_SUFFIX   "@set"
 Suffix appended to the qualified name of a native struct member to form the name of the native function that writes its value.

Enumerations

enum  Bond::OpCode {
  Bond::OPCODE_NOP , Bond::OPCODE_CONSTC , Bond::OPCODE_CONSTUC , Bond::OPCODE_CONSTS ,
  Bond::OPCODE_CONSTUS , Bond::OPCODE_CONST32 , Bond::OPCODE_CONST64 , Bond::OPCODE_CONSTI_N2 ,
  Bond::OPCODE_CONSTI_N1 , Bond::OPCODE_CONSTI_0 , Bond::OPCODE_CONSTI_1 , Bond::OPCODE_CONSTI_2 ,
  Bond::OPCODE_CONSTI_3 , Bond::OPCODE_CONSTI_4 , Bond::OPCODE_CONSTI_8 , Bond::OPCODE_CONSTL_N2 ,
  Bond::OPCODE_CONSTL_N1 , Bond::OPCODE_CONSTL_0 , Bond::OPCODE_CONSTL_1 , Bond::OPCODE_CONSTL_2 ,
  Bond::OPCODE_CONSTL_3 , Bond::OPCODE_CONSTL_4 , Bond::OPCODE_CONSTL_8 , Bond::OPCODE_CONSTF_N2 ,
  Bond::OPCODE_CONSTF_N1 , Bond::OPCODE_CONSTF_NH , Bond::OPCODE_CONSTF_0 , Bond::OPCODE_CONSTF_H ,
  Bond::OPCODE_CONSTF_1 , Bond::OPCODE_CONSTF_2 , Bond::OPCODE_CONSTD_N2 , Bond::OPCODE_CONSTD_N1 ,
  Bond::OPCODE_CONSTD_NH , Bond::OPCODE_CONSTD_0 , Bond::OPCODE_CONSTD_H , Bond::OPCODE_CONSTD_1 ,
  Bond::OPCODE_CONSTD_2 , Bond::OPCODE_LOADFP , Bond::OPCODE_LOADFPW , Bond::OPCODE_LOADEA ,
  Bond::OPCODE_LOADSTR , Bond::OPCODE_LOADC , Bond::OPCODE_LOADUC , Bond::OPCODE_LOADS ,
  Bond::OPCODE_LOADUS , Bond::OPCODE_LOAD32 , Bond::OPCODE_LOAD64 , Bond::OPCODE_LOADMEMW ,
  Bond::OPCODE_STOREC , Bond::OPCODE_STORES , Bond::OPCODE_STORE32 , Bond::OPCODE_STORE64 ,
  Bond::OPCODE_PUSHC , Bond::OPCODE_PUSHCW , Bond::OPCODE_PUSHUC , Bond::OPCODE_PUSHUCW ,
  Bond::OPCODE_PUSHS , Bond::OPCODE_PUSHSW , Bond::OPCODE_PUSHUS , Bond::OPCODE_PUSHUSW ,
  Bond::OPCODE_PUSH32 , Bond::OPCODE_PUSH32W , Bond::OPCODE_PUSH32_P0 , Bond::OPCODE_PUSH32_P1 ,
  Bond::OPCODE_PUSH32_P2 , Bond::OPCODE_PUSH32_P3 , Bond::OPCODE_PUSH32_L0 , Bond::OPCODE_PUSH32_L1 ,
  Bond::OPCODE_PUSH32_L2 , Bond::OPCODE_PUSH32_L3 , Bond::OPCODE_PUSH64 , Bond::OPCODE_PUSH64W ,
  Bond::OPCODE_PUSH64_P0 , Bond::OPCODE_PUSH64_P1 , Bond::OPCODE_PUSH64_P2 , Bond::OPCODE_PUSH64_P3 ,
  Bond::OPCODE_PUSH64_L0 , Bond::OPCODE_PUSH64_L1 , Bond::OPCODE_PUSH64_L2 , Bond::OPCODE_PUSH64_L3 ,
  Bond::OPCODE_POP , Bond::OPCODE_POPC , Bond::OPCODE_POPCW , Bond::OPCODE_POPS ,
  Bond::OPCODE_POPSW , Bond::OPCODE_POP32 , Bond::OPCODE_POP32W , Bond::OPCODE_POP32_P0 ,
  Bond::OPCODE_POP32_P1 , Bond::OPCODE_POP32_P2 , Bond::OPCODE_POP32_P3 , Bond::OPCODE_POP32_L0 ,
  Bond::OPCODE_POP32_L1 , Bond::OPCODE_POP32_L2 , Bond::OPCODE_POP32_L3 , Bond::OPCODE_POP64 ,
  Bond::OPCODE_POP64W , Bond::OPCODE_POP64_P0 , Bond::OPCODE_POP64_P1 , Bond::OPCODE_POP64_P2 ,
  Bond::OPCODE_POP64_P3 , Bond::OPCODE_POP64_L0 , Bond::OPCODE_POP64_L1 , Bond::OPCODE_POP64_L2 ,
  Bond::OPCODE_POP64_L3 , Bond::OPCODE_MEMCOPYW , Bond::OPCODE_MEMZEROW , Bond::OPCODE_DUP ,
  Bond::OPCODE_DUPINS , Bond::OPCODE_SWAP , Bond::OPCODE_ITOC , Bond::OPCODE_UITOUC ,
  Bond::OPCODE_ITOS , Bond::OPCODE_UITOUS , Bond::OPCODE_ITOL , Bond::OPCODE_UITOUL ,
  Bond::OPCODE_ITOF , Bond::OPCODE_UITOF , Bond::OPCODE_ITOD , Bond::OPCODE_UITOD ,
  Bond::OPCODE_LTOI , Bond::OPCODE_LTOF , Bond::OPCODE_ULTOF , Bond::OPCODE_LTOD ,
  Bond::OPCODE_ULTOD , Bond::OPCODE_FTOI , Bond::OPCODE_FTOUI , Bond::OPCODE_FTOL ,
  Bond::OPCODE_FTOUL , Bond::OPCODE_FTOD , Bond::OPCODE_DTOI , Bond::OPCODE_DTOUI ,
  Bond::OPCODE_DTOL , Bond::OPCODE_DTOUL , Bond::OPCODE_DTOF , Bond::OPCODE_PTROFFI ,
  Bond::OPCODE_PTROFFL , Bond::OPCODE_PTRDIFF , Bond::OPCODE_INCI , Bond::OPCODE_INCL ,
  Bond::OPCODE_ADDI , Bond::OPCODE_ADDL , Bond::OPCODE_ADDF , Bond::OPCODE_ADDD ,
  Bond::OPCODE_SUBI , Bond::OPCODE_SUBL , Bond::OPCODE_SUBF , Bond::OPCODE_SUBD ,
  Bond::OPCODE_MULI , Bond::OPCODE_MULL , Bond::OPCODE_MULF , Bond::OPCODE_MULD ,
  Bond::OPCODE_DIVI , Bond::OPCODE_DIVUI , Bond::OPCODE_DIVL , Bond::OPCODE_DIVUL ,
  Bond::OPCODE_DIVF , Bond::OPCODE_DIVD , Bond::OPCODE_REMI , Bond::OPCODE_REMUI ,
  Bond::OPCODE_REML , Bond::OPCODE_REMUL , Bond::OPCODE_LSHI , Bond::OPCODE_LSHL ,
  Bond::OPCODE_RSHI , Bond::OPCODE_RSHUI , Bond::OPCODE_RSHL , Bond::OPCODE_RSHUL ,
  Bond::OPCODE_ANDI , Bond::OPCODE_ANDL , Bond::OPCODE_ORI , Bond::OPCODE_ORL ,
  Bond::OPCODE_XORI , Bond::OPCODE_XORL , Bond::OPCODE_NEGI , Bond::OPCODE_NEGL ,
  Bond::OPCODE_NEGF , Bond::OPCODE_NEGD , Bond::OPCODE_NOT , Bond::OPCODE_CMPEQI ,
  Bond::OPCODE_CMPEQL , Bond::OPCODE_CMPEQF , Bond::OPCODE_CMPEQD , Bond::OPCODE_CMPNEQI ,
  Bond::OPCODE_CMPNEQL , Bond::OPCODE_CMPNEQF , Bond::OPCODE_CMPNEQD , Bond::OPCODE_CMPLTI ,
  Bond::OPCODE_CMPLTUI , Bond::OPCODE_CMPLTL , Bond::OPCODE_CMPLTUL , Bond::OPCODE_CMPLTF ,
  Bond::OPCODE_CMPLTD , Bond::OPCODE_CMPLEI , Bond::OPCODE_CMPLEUI , Bond::OPCODE_CMPLEL ,
  Bond::OPCODE_CMPLEUL , Bond::OPCODE_CMPLEF , Bond::OPCODE_CMPLED , Bond::OPCODE_CMPGTI ,
  Bond::OPCODE_CMPGTUI , Bond::OPCODE_CMPGTL , Bond::OPCODE_CMPGTUL , Bond::OPCODE_CMPGTF ,
  Bond::OPCODE_CMPGTD , Bond::OPCODE_CMPGEI , Bond::OPCODE_CMPGEUI , Bond::OPCODE_CMPGEL ,
  Bond::OPCODE_CMPGEUL , Bond::OPCODE_CMPGEF , Bond::OPCODE_CMPGED , Bond::OPCODE_BRZ ,
  Bond::OPCODE_BRZW , Bond::OPCODE_BRNZ , Bond::OPCODE_BRNZW , Bond::OPCODE_NBRZ ,
  Bond::OPCODE_NBRZW , Bond::OPCODE_NBRNZ , Bond::OPCODE_NBRNZW , Bond::OPCODE_IFZ ,
  Bond::OPCODE_IFZW , Bond::OPCODE_IFNZ , Bond::OPCODE_IFNZW , Bond::OPCODE_GOTO ,
  Bond::OPCODE_GOTOW , Bond::OPCODE_LOOKUPSWITCH , Bond::OPCODE_TABLESWITCH , Bond::OPCODE_INVOKE ,
  Bond::OPCODE_INVOKEUNPACK , Bond::OPCODE_RETURN , Bond::OPCODE_RETURN32 , Bond::OPCODE_RETURN64 ,
  Bond::OPCODE_RETURNMEMW , Bond::OPCODE_MAX
}
 Enumeration of all opcodes in the Bond Virtual Machine instruction set. More...
enum  Bond::OpCodeParam {
  Bond::OC_PARAM_NONE , Bond::OC_PARAM_CHAR , Bond::OC_PARAM_UCHAR , Bond::OC_PARAM_CHAR_CHAR ,
  Bond::OC_PARAM_SHORT , Bond::OC_PARAM_USHORT , Bond::OC_PARAM_INT , Bond::OC_PARAM_VAL32 ,
  Bond::OC_PARAM_VAL64 , Bond::OC_PARAM_OFF16 , Bond::OC_PARAM_OFF32 , Bond::OC_PARAM_STRING ,
  Bond::OC_PARAM_NAME , Bond::OC_PARAM_LOOKUPSWITCH , Bond::OC_PARAM_TABLESWITCH
}
 Enumeration describing all combinations of parameter types for the instructions in the Bond Virtual Machine instruction set. More...
enum  Bond::PointerSize { Bond::POINTER_32BIT , Bond::POINTER_64BIT }
 The size of pointers on a target platform. More...
enum  Bond::SignatureType {
  Bond::SIG_VOID , Bond::SIG_BOOL , Bond::SIG_CHAR , Bond::SIG_UCHAR ,
  Bond::SIG_SHORT , Bond::SIG_USHORT , Bond::SIG_INT , Bond::SIG_UINT ,
  Bond::SIG_LONG , Bond::SIG_ULONG , Bond::SIG_FLOAT , Bond::SIG_DOUBLE ,
  Bond::SIG_POINTER , Bond::SIG_AGGREGATE
}
 Enumeration of the types of function parameters and return values in CBO files. More...

Functions

BOND_API const char * Bond::GetOpCodeMnemonic (OpCode opCode)
 Returns the mnemonic of the given opcode, e.g. "addi" for OPCODE_ADDI.
BOND_API OpCodeParam Bond::GetOpCodeParamType (OpCode opCode)
 Returns a value of the OpCodeParam enumeration describing the parameter types for the given opcode.
BOND_API int32_t Bond::GetStackDelta (OpCode opCode)
 Returns how much the given opcode moves the stack pointer in multiples of BOND_SLOT_SIZE bytes.
uint32_t Bond::GetPointerSize (PointerSize pointerSize)
 Returns the number of bytes in a pointer of the given size.
BOND_API const char * Bond::GetBondTypeMnemonic (SignatureType signatureType)
 Returns the mnemonic of the given signature type as it is named in Bond, e.g. "int".
BOND_API char * Bond::ExpandBondTypeMnemonic (char *buffer, size_t length, SignatureType signatureType, uint32_t size)
 Writes the mnemonic of the given signature type as it is named in Bond to the given buffer, expanding the size of an aggregate, e.g. "aggr<12>".
BOND_API const char * Bond::GetApiTypeMnemonic (SignatureType signatureType)
 Returns the mnemonic of the given signature type as it is named in the C++ API, e.g. "int32_t".
BOND_API char * Bond::ExpandApiTypeMnemonic (char *buffer, size_t length, SignatureType signatureType, uint32_t size)
 Writes the mnemonic of the given signature type as it is named in the C++ API to the given buffer, expanding the size of an aggregate, e.g. "aggr<12>".
bool Bond::operator< (const Value16 &a, const Value16 &b)
 Returns the result of the expression: a.mUShort < b.mUShort.
bool Bond::operator< (const Value32 &a, const Value32 &b)
 Returns the result of the expression: a.mUInt < b.mUInt.
bool Bond::operator< (const Value64 &a, const Value64 &b)
 Returns the result of the expression: a.mULong < b.mULong.

Variables

const uint32_t Bond::BOND_VOID_SIZE = 0
 Size in bytes of the Bond void type.
const uint32_t Bond::BOND_BOOL_SIZE = 1
 Size in bytes of the Bond bool type.
const uint32_t Bond::BOND_CHAR_SIZE = 1
 Size in bytes of the Bond char type.
const uint32_t Bond::BOND_UCHAR_SIZE = 1
 Size in bytes of the Bond uchar type.
const uint32_t Bond::BOND_SHORT_SIZE = 2
 Size in bytes of the Bond short type.
const uint32_t Bond::BOND_USHORT_SIZE = 2
 Size in bytes of the Bond ushort type.
const uint32_t Bond::BOND_INT_SIZE = 4
 Size in bytes of the Bond int type.
const uint32_t Bond::BOND_UINT_SIZE = 4
 Size in bytes of the Bond uint type.
const uint32_t Bond::BOND_LONG_SIZE = 8
 Size in bytes of the Bond long type.
const uint32_t Bond::BOND_ULONG_SIZE = 8
 Size in bytes of the Bond ulong type.
const uint32_t Bond::BOND_FLOAT_SIZE = 4
 Size in bytes of the Bond float type.
const uint32_t Bond::BOND_DOUBLE_SIZE = 8
 Size in bytes of the Bond double type.
const uint32_t Bond::BOND_DEFAULT_STRUCT_SIZE = 4
 Minimum size in bytes of a struct whose layout is computed by the compiler.
const uint32_t Bond::BOND_DEFAULT_STRUCT_ALIGN = BOND_DEFAULT_STRUCT_SIZE
 Minimum alignment in bytes of a struct whose layout is computed by the compiler.
const int32_t Bond::BOND_SLOT_SIZE = 8
 Size in bytes of a slot on the operand stack of the VM.
const PointerSize Bond::BOND_NATIVE_POINTER_SIZE = (sizeof(void *) == 8) ? POINTER_64BIT : POINTER_32BIT
 The size of pointers on the platform for which the code is compiled.

Detailed Description

Various basic types used throughout the Bond Runtime Library.

Macro Definition Documentation

◆ BOND_NATIVE_GETTER_SUFFIX

#define BOND_NATIVE_GETTER_SUFFIX   "@get"

Suffix appended to the qualified name of a native struct member to form the name of the native function that reads its value.

◆ BOND_NATIVE_SETTER_SUFFIX

#define BOND_NATIVE_SETTER_SUFFIX   "@set"

Suffix appended to the qualified name of a native struct member to form the name of the native function that writes its value.

◆ BOND_OPCODE_LIST

#define BOND_OPCODE_LIST

An X-macro that lists every opcode in the Bond Virtual Machine instruction set.

To use it, define BOND_OPCODE_ITEM(opCode, mnemonic, param, stackDelta), expand BOND_OPCODE_LIST and then undefine BOND_OPCODE_ITEM. The arguments of each item are the opcode name without its OPCODE_ prefix, its mnemonic as an unquoted identifier, its parameter type without its OC_PARAM_ prefix, and how much it moves the stack pointer in multiples of BOND_SLOT_SIZE bytes. The instructions are described in docs/instruction-set.txt.

◆ BOND_SIGNATURE_TYPE_LIST

#define BOND_SIGNATURE_TYPE_LIST
Value:
BOND_SIGNATURE_TYPE_ITEM(VOID, "void", "void") \
BOND_SIGNATURE_TYPE_ITEM(BOOL, "bool", "bool") \
BOND_SIGNATURE_TYPE_ITEM(CHAR, "char", "int8_t") \
BOND_SIGNATURE_TYPE_ITEM(UCHAR, "uchar", "uint8_t") \
BOND_SIGNATURE_TYPE_ITEM(SHORT, "short", "int16_t") \
BOND_SIGNATURE_TYPE_ITEM(USHORT, "ushort", "uint16_t") \
BOND_SIGNATURE_TYPE_ITEM(INT, "int", "int32_t") \
BOND_SIGNATURE_TYPE_ITEM(UINT, "uint", "uint32_t") \
BOND_SIGNATURE_TYPE_ITEM(LONG, "long", "int64_t") \
BOND_SIGNATURE_TYPE_ITEM(ULONG, "ulong", "uint64_t") \
BOND_SIGNATURE_TYPE_ITEM(FLOAT, "float", "float") \
BOND_SIGNATURE_TYPE_ITEM(DOUBLE, "double", "double") \
BOND_SIGNATURE_TYPE_ITEM(POINTER, "*", "pointer") \
BOND_SIGNATURE_TYPE_ITEM(AGGREGATE, "aggr<%" BOND_PRIu32 ">", "aggr<%" BOND_PRIu32 ">") \
#define BOND_SIGNATURE_TYPE_ITEM(type, bondType, apiType)
Definition types.h:76

An X-macro that lists the signature types used to describe the parameters and return values of functions in CBO files.

To use it, define BOND_SIGNATURE_TYPE_ITEM(type, bondType, apiType), expand BOND_SIGNATURE_TYPE_LIST and then undefine BOND_SIGNATURE_TYPE_ITEM. The arguments of each item are the signature type name without its SIG_ prefix, the printf format string of its mnemonic in Bond and the printf format string of its mnemonic in the C++ API. The aggregate mnemonics expect the size of the aggregate as a uint32_t argument.

Enumeration Type Documentation

◆ OpCode

Enumeration of all opcodes in the Bond Virtual Machine instruction set.

Enumerator
OPCODE_NOP 
OPCODE_CONSTC 
OPCODE_CONSTUC 
OPCODE_CONSTS 
OPCODE_CONSTUS 
OPCODE_CONST32 
OPCODE_CONST64 
OPCODE_CONSTI_N2 
OPCODE_CONSTI_N1 
OPCODE_CONSTI_0 
OPCODE_CONSTI_1 
OPCODE_CONSTI_2 
OPCODE_CONSTI_3 
OPCODE_CONSTI_4 
OPCODE_CONSTI_8 
OPCODE_CONSTL_N2 
OPCODE_CONSTL_N1 
OPCODE_CONSTL_0 
OPCODE_CONSTL_1 
OPCODE_CONSTL_2 
OPCODE_CONSTL_3 
OPCODE_CONSTL_4 
OPCODE_CONSTL_8 
OPCODE_CONSTF_N2 
OPCODE_CONSTF_N1 
OPCODE_CONSTF_NH 
OPCODE_CONSTF_0 
OPCODE_CONSTF_H 
OPCODE_CONSTF_1 
OPCODE_CONSTF_2 
OPCODE_CONSTD_N2 
OPCODE_CONSTD_N1 
OPCODE_CONSTD_NH 
OPCODE_CONSTD_0 
OPCODE_CONSTD_H 
OPCODE_CONSTD_1 
OPCODE_CONSTD_2 
OPCODE_LOADFP 
OPCODE_LOADFPW 
OPCODE_LOADEA 
OPCODE_LOADSTR 
OPCODE_LOADC 
OPCODE_LOADUC 
OPCODE_LOADS 
OPCODE_LOADUS 
OPCODE_LOAD32 
OPCODE_LOAD64 
OPCODE_LOADMEMW 
OPCODE_STOREC 
OPCODE_STORES 
OPCODE_STORE32 
OPCODE_STORE64 
OPCODE_PUSHC 
OPCODE_PUSHCW 
OPCODE_PUSHUC 
OPCODE_PUSHUCW 
OPCODE_PUSHS 
OPCODE_PUSHSW 
OPCODE_PUSHUS 
OPCODE_PUSHUSW 
OPCODE_PUSH32 
OPCODE_PUSH32W 
OPCODE_PUSH32_P0 
OPCODE_PUSH32_P1 
OPCODE_PUSH32_P2 
OPCODE_PUSH32_P3 
OPCODE_PUSH32_L0 
OPCODE_PUSH32_L1 
OPCODE_PUSH32_L2 
OPCODE_PUSH32_L3 
OPCODE_PUSH64 
OPCODE_PUSH64W 
OPCODE_PUSH64_P0 
OPCODE_PUSH64_P1 
OPCODE_PUSH64_P2 
OPCODE_PUSH64_P3 
OPCODE_PUSH64_L0 
OPCODE_PUSH64_L1 
OPCODE_PUSH64_L2 
OPCODE_PUSH64_L3 
OPCODE_POP 
OPCODE_POPC 
OPCODE_POPCW 
OPCODE_POPS 
OPCODE_POPSW 
OPCODE_POP32 
OPCODE_POP32W 
OPCODE_POP32_P0 
OPCODE_POP32_P1 
OPCODE_POP32_P2 
OPCODE_POP32_P3 
OPCODE_POP32_L0 
OPCODE_POP32_L1 
OPCODE_POP32_L2 
OPCODE_POP32_L3 
OPCODE_POP64 
OPCODE_POP64W 
OPCODE_POP64_P0 
OPCODE_POP64_P1 
OPCODE_POP64_P2 
OPCODE_POP64_P3 
OPCODE_POP64_L0 
OPCODE_POP64_L1 
OPCODE_POP64_L2 
OPCODE_POP64_L3 
OPCODE_MEMCOPYW 
OPCODE_MEMZEROW 
OPCODE_DUP 
OPCODE_DUPINS 
OPCODE_SWAP 
OPCODE_ITOC 
OPCODE_UITOUC 
OPCODE_ITOS 
OPCODE_UITOUS 
OPCODE_ITOL 
OPCODE_UITOUL 
OPCODE_ITOF 
OPCODE_UITOF 
OPCODE_ITOD 
OPCODE_UITOD 
OPCODE_LTOI 
OPCODE_LTOF 
OPCODE_ULTOF 
OPCODE_LTOD 
OPCODE_ULTOD 
OPCODE_FTOI 
OPCODE_FTOUI 
OPCODE_FTOL 
OPCODE_FTOUL 
OPCODE_FTOD 
OPCODE_DTOI 
OPCODE_DTOUI 
OPCODE_DTOL 
OPCODE_DTOUL 
OPCODE_DTOF 
OPCODE_PTROFFI 
OPCODE_PTROFFL 
OPCODE_PTRDIFF 
OPCODE_INCI 
OPCODE_INCL 
OPCODE_ADDI 
OPCODE_ADDL 
OPCODE_ADDF 
OPCODE_ADDD 
OPCODE_SUBI 
OPCODE_SUBL 
OPCODE_SUBF 
OPCODE_SUBD 
OPCODE_MULI 
OPCODE_MULL 
OPCODE_MULF 
OPCODE_MULD 
OPCODE_DIVI 
OPCODE_DIVUI 
OPCODE_DIVL 
OPCODE_DIVUL 
OPCODE_DIVF 
OPCODE_DIVD 
OPCODE_REMI 
OPCODE_REMUI 
OPCODE_REML 
OPCODE_REMUL 
OPCODE_LSHI 
OPCODE_LSHL 
OPCODE_RSHI 
OPCODE_RSHUI 
OPCODE_RSHL 
OPCODE_RSHUL 
OPCODE_ANDI 
OPCODE_ANDL 
OPCODE_ORI 
OPCODE_ORL 
OPCODE_XORI 
OPCODE_XORL 
OPCODE_NEGI 
OPCODE_NEGL 
OPCODE_NEGF 
OPCODE_NEGD 
OPCODE_NOT 
OPCODE_CMPEQI 
OPCODE_CMPEQL 
OPCODE_CMPEQF 
OPCODE_CMPEQD 
OPCODE_CMPNEQI 
OPCODE_CMPNEQL 
OPCODE_CMPNEQF 
OPCODE_CMPNEQD 
OPCODE_CMPLTI 
OPCODE_CMPLTUI 
OPCODE_CMPLTL 
OPCODE_CMPLTUL 
OPCODE_CMPLTF 
OPCODE_CMPLTD 
OPCODE_CMPLEI 
OPCODE_CMPLEUI 
OPCODE_CMPLEL 
OPCODE_CMPLEUL 
OPCODE_CMPLEF 
OPCODE_CMPLED 
OPCODE_CMPGTI 
OPCODE_CMPGTUI 
OPCODE_CMPGTL 
OPCODE_CMPGTUL 
OPCODE_CMPGTF 
OPCODE_CMPGTD 
OPCODE_CMPGEI 
OPCODE_CMPGEUI 
OPCODE_CMPGEL 
OPCODE_CMPGEUL 
OPCODE_CMPGEF 
OPCODE_CMPGED 
OPCODE_BRZ 
OPCODE_BRZW 
OPCODE_BRNZ 
OPCODE_BRNZW 
OPCODE_NBRZ 
OPCODE_NBRZW 
OPCODE_NBRNZ 
OPCODE_NBRNZW 
OPCODE_IFZ 
OPCODE_IFZW 
OPCODE_IFNZ 
OPCODE_IFNZW 
OPCODE_GOTO 
OPCODE_GOTOW 
OPCODE_LOOKUPSWITCH 
OPCODE_TABLESWITCH 
OPCODE_INVOKE 
OPCODE_INVOKEUNPACK 
OPCODE_RETURN 
OPCODE_RETURN32 
OPCODE_RETURN64 
OPCODE_RETURNMEMW 
OPCODE_MAX 

The number of opcodes. Not a valid opcode.

◆ OpCodeParam

Enumeration describing all combinations of parameter types for the instructions in the Bond Virtual Machine instruction set.

Parameters are encoded in the bytecode immediately after the opcode byte. Parameters that refer to a constant table are encoded as a 16-bit index into the table of the CBO.

Enumerator
OC_PARAM_NONE 

No parameter.

OC_PARAM_CHAR 

A signed 8-bit value.

OC_PARAM_UCHAR 

An unsigned 8-bit value.

OC_PARAM_CHAR_CHAR 

Two signed 8-bit values: a slot index and an increment.

OC_PARAM_SHORT 

A signed 16-bit value.

OC_PARAM_USHORT 

An unsigned 16-bit value.

OC_PARAM_INT 

A signed 32-bit integer stored in the 32-bit constant table.

OC_PARAM_VAL32 

A 32-bit value stored in the 32-bit constant table.

OC_PARAM_VAL64 

A 64-bit value stored in the 64-bit constant table.

OC_PARAM_OFF16 

A signed 16-bit branch offset relative to the end of the instruction.

OC_PARAM_OFF32 

A signed 32-bit branch offset relative to the end of the instruction, stored in the 32-bit constant table.

OC_PARAM_STRING 

A string stored in the string constant table.

OC_PARAM_NAME 

A qualified name stored in the qualified name table. The CboLoader replaces the index with that of the referenced function or data entry in the CodeSegment.

OC_PARAM_LOOKUPSWITCH 

A 32-bit aligned table holding a default offset, a match count and sorted pairs of match values and branch offsets.

OC_PARAM_TABLESWITCH 

A 32-bit aligned table holding a default offset, a minimum and maximum match value and one branch offset per value in that range.

◆ PointerSize

The size of pointers on a target platform.

Enumerator
POINTER_32BIT 

4-byte pointers.

POINTER_64BIT 

8-byte pointers.

◆ SignatureType

Enumeration of the types of function parameters and return values in CBO files.

Its values are SIG_VOID, SIG_BOOL, SIG_CHAR, SIG_UCHAR, SIG_SHORT, SIG_USHORT, SIG_INT, SIG_UINT, SIG_LONG, SIG_ULONG, SIG_FLOAT, SIG_DOUBLE, SIG_POINTER and SIG_AGGREGATE, the last of which describes structs passed by value.

Enumerator
SIG_VOID 
SIG_BOOL 
SIG_CHAR 
SIG_UCHAR 
SIG_SHORT 
SIG_USHORT 
SIG_INT 
SIG_UINT 
SIG_LONG 
SIG_ULONG 
SIG_FLOAT 
SIG_DOUBLE 
SIG_POINTER 
SIG_AGGREGATE 

Function Documentation

◆ ExpandApiTypeMnemonic()

BOND_API char * Bond::ExpandApiTypeMnemonic ( char * buffer,
size_t length,
SignatureType signatureType,
uint32_t size )

Writes the mnemonic of the given signature type as it is named in the C++ API to the given buffer, expanding the size of an aggregate, e.g. "aggr<12>".

Parameters
bufferThe buffer to which the mnemonic is written.
lengthThe size of the buffer in bytes. The mnemonic is truncated if it does not fit.
signatureTypeThe signature type whose mnemonic is written.
sizeThe size in bytes of the type, used only by SIG_AGGREGATE.
Returns
The given buffer.

◆ ExpandBondTypeMnemonic()

BOND_API char * Bond::ExpandBondTypeMnemonic ( char * buffer,
size_t length,
SignatureType signatureType,
uint32_t size )

Writes the mnemonic of the given signature type as it is named in Bond to the given buffer, expanding the size of an aggregate, e.g. "aggr<12>".

Parameters
bufferThe buffer to which the mnemonic is written.
lengthThe size of the buffer in bytes. The mnemonic is truncated if it does not fit.
signatureTypeThe signature type whose mnemonic is written.
sizeThe size in bytes of the type, used only by SIG_AGGREGATE.
Returns
The given buffer.

◆ GetApiTypeMnemonic()

BOND_API const char * Bond::GetApiTypeMnemonic ( SignatureType signatureType)

Returns the mnemonic of the given signature type as it is named in the C++ API, e.g. "int32_t".

The mnemonic is a printf format string. That of SIG_AGGREGATE expects the size of the aggregate as a uint32_t argument; ExpandApiTypeMnemonic() can be used to expand it.

◆ GetBondTypeMnemonic()

BOND_API const char * Bond::GetBondTypeMnemonic ( SignatureType signatureType)

Returns the mnemonic of the given signature type as it is named in Bond, e.g. "int".

The mnemonic is a printf format string. That of SIG_AGGREGATE expects the size of the aggregate as a uint32_t argument; ExpandBondTypeMnemonic() can be used to expand it.

◆ GetOpCodeMnemonic()

BOND_API const char * Bond::GetOpCodeMnemonic ( OpCode opCode)

Returns the mnemonic of the given opcode, e.g. "addi" for OPCODE_ADDI.

◆ GetOpCodeParamType()

BOND_API OpCodeParam Bond::GetOpCodeParamType ( OpCode opCode)

Returns a value of the OpCodeParam enumeration describing the parameter types for the given opcode.

◆ GetPointerSize()

uint32_t Bond::GetPointerSize ( PointerSize pointerSize)
inline

Returns the number of bytes in a pointer of the given size.

◆ GetStackDelta()

BOND_API int32_t Bond::GetStackDelta ( OpCode opCode)

Returns how much the given opcode moves the stack pointer in multiples of BOND_SLOT_SIZE bytes.

◆ operator<() [1/3]

bool Bond::operator< ( const Value16 & a,
const Value16 & b )
inline

Returns the result of the expression: a.mUShort < b.mUShort.

◆ operator<() [2/3]

bool Bond::operator< ( const Value32 & a,
const Value32 & b )
inline

Returns the result of the expression: a.mUInt < b.mUInt.

◆ operator<() [3/3]

bool Bond::operator< ( const Value64 & a,
const Value64 & b )
inline

Returns the result of the expression: a.mULong < b.mULong.

Variable Documentation

◆ BOND_BOOL_SIZE

const uint32_t Bond::BOND_BOOL_SIZE = 1

Size in bytes of the Bond bool type.

◆ BOND_CHAR_SIZE

const uint32_t Bond::BOND_CHAR_SIZE = 1

Size in bytes of the Bond char type.

◆ BOND_DEFAULT_STRUCT_ALIGN

const uint32_t Bond::BOND_DEFAULT_STRUCT_ALIGN = BOND_DEFAULT_STRUCT_SIZE

Minimum alignment in bytes of a struct whose layout is computed by the compiler.

◆ BOND_DEFAULT_STRUCT_SIZE

const uint32_t Bond::BOND_DEFAULT_STRUCT_SIZE = 4

Minimum size in bytes of a struct whose layout is computed by the compiler.

◆ BOND_DOUBLE_SIZE

const uint32_t Bond::BOND_DOUBLE_SIZE = 8

Size in bytes of the Bond double type.

◆ BOND_FLOAT_SIZE

const uint32_t Bond::BOND_FLOAT_SIZE = 4

Size in bytes of the Bond float type.

◆ BOND_INT_SIZE

const uint32_t Bond::BOND_INT_SIZE = 4

Size in bytes of the Bond int type.

◆ BOND_LONG_SIZE

const uint32_t Bond::BOND_LONG_SIZE = 8

Size in bytes of the Bond long type.

◆ BOND_NATIVE_POINTER_SIZE

const PointerSize Bond::BOND_NATIVE_POINTER_SIZE = (sizeof(void *) == 8) ? POINTER_64BIT : POINTER_32BIT

The size of pointers on the platform for which the code is compiled.

◆ BOND_SHORT_SIZE

const uint32_t Bond::BOND_SHORT_SIZE = 2

Size in bytes of the Bond short type.

◆ BOND_SLOT_SIZE

const int32_t Bond::BOND_SLOT_SIZE = 8

Size in bytes of a slot on the operand stack of the VM.

◆ BOND_UCHAR_SIZE

const uint32_t Bond::BOND_UCHAR_SIZE = 1

Size in bytes of the Bond uchar type.

◆ BOND_UINT_SIZE

const uint32_t Bond::BOND_UINT_SIZE = 4

Size in bytes of the Bond uint type.

◆ BOND_ULONG_SIZE

const uint32_t Bond::BOND_ULONG_SIZE = 8

Size in bytes of the Bond ulong type.

◆ BOND_USHORT_SIZE

const uint32_t Bond::BOND_USHORT_SIZE = 2

Size in bytes of the Bond ushort type.

◆ BOND_VOID_SIZE

const uint32_t Bond::BOND_VOID_SIZE = 0

Size in bytes of the Bond void type.