MOSA runtime tables

This diagram represents the internal runtime tables within the MOSA virtual machine:

digraph "MOSA Runtime Tables" { graph [rankdir = "LR"]; node [fontsize = "16" shape = "ellipse"]; edge [minlen = "4"]; "Key" [ label = "<f0>Key|<f1>~ Denotes field may be zero filled\ndue to no value being available." shape = "record" ]; "NameString" [ label = "<f0>Internal String Object|<f1>Object Header|<f2>Pointer to Method Table|<f3>String Length|<f4>Unicode String" shape = "record" color = "red" ]; "AssemblyListTable" [ label = "<f0>Assembly Table|<f1>Number of Assemblies|<f2>Pointer to Assembly 1|..|Pointer to Assembly N" shape = "record" ]; "AssemblyListTable":f2 -> "AssemblyDefinition":f0 [ id = 0 ]; "AssemblyDefinition" [ label = "<f0>Assembly|<f1>Pointer to Assembly Name|<f2>~Pointer to Custom Attributes|<f3>Flags: IsReflectionOnly|<f4>Number of Types|<f5>Pointer to Type Definition 1|...|Pointer to Type Definition N" shape = "record" ]; "AssemblyDefinition":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "AssemblyDefinition":f2 -> "CustomAttributesTable":f0 [ id = 0 ]; "AssemblyDefinition":f5 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "TypeDefinition" [ label = "<f0>Type Definition\n(contains Method Table)|<f1>Pointer to Type Name|<f2>~Pointer to Custom Attributes|<f3>Type Code & Attributes|<f4>Type Size|<f5>Pointer to Assembly|<f6>~Pointer to Parent Type|<f7>~Pointer to Declaring Type|<f8>~Pointer to Element Type|<f9>~Pointer to Default Constructor Method|<f10>~Pointer to Properties Table|<f11>~Pointer to Fields Table|<f12>~Pointer to Interface Slot Table|<f13>~Pointer to Interface Bitmap|<f14>Number of Methods|<f15>Pointer to Method 1|...|Pointer to Method N|<f16>Pointer to Method Definition 1|...|Pointer to Method Definition N" shape = "record" color = "blue" ]; "TypeDefinition":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "TypeDefinition":f2 -> "CustomAttributesTable":f0 [ id = 0 ]; "TypeDefinition":f5 -> "AssemblyDefinition":f0 [ id = 0 ]; "TypeDefinition":f6 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "TypeDefinition":f9 -> "MethodDefinition":f0 [ id = 0 color = "purple" ]; "TypeDefinition":f10 -> "PropertiesTable":f0 [ id = 0 ]; "TypeDefinition":f11 -> "FieldsTable":f0 [ id = 0 ]; "TypeDefinition":f12 -> "InterfaceSlotTable":f0 [ id = 0 ]; "TypeDefinition":f16 -> "MethodDefinition":f0 [ id = 0 ]; "FieldsTable" [ label = "<f0>Fields Table|<f1>Number of Fields|<f1>Pointer to Field Definition 1|...|Pointer to Field Definition N" shape = "record" ]; "FieldsTable":f2 -> "FieldDefinition":f0 [ id = 0 ]; "FieldDefinition" [ label = "<f0>Field Definition|<f1>Pointer to Field Name|<f2>~Pointer to Custom Attributes|<f3>Field Attributes|<f4>Pointer to Field Type|<f5>~Address|<f6>Offset / Size" shape = "record" ]; "FieldDefinition":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "FieldDefinition":f2 -> "CustomAttributesTable":f0 [ id = 0 ]; "FieldDefinition":f4 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "PropertiesTable" [ label = "<f0>Properties Table|<f1>Number of Properties|<f1>Pointer to Property Definition 1|...|Pointer to Property Definition N" shape = "record" ]; "PropertiesTable":f2 -> "PropertyDefinition":f0 [ id = 0 ]; "PropertyDefinition" [ label = "<f0>Property Definition|<f1>Pointer to Property Name|<f2>~Pointer to Custom Attributes|<f3>Property Attributes|<f4>Pointer to Property Type|<f5>~Pointer to Getter Method Definition|<f6>~Pointer to Setter Method Defiinition" shape = "record" ]; "PropertyDefinition":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "PropertyDefinition":f2 -> "CustomAttributesTable":f0 [ id = 0 ]; "PropertyDefinition":f4 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "PropertyDefinition":f5 -> "MethodDefinition":f0 [ id = 0 color = "purple" ]; "PropertyDefinition":f6 -> "MethodDefinition":f0 [ id = 0 color = "purple" ]; "MethodLookupTable" [ label = "<f0>Method Lookup Table|Number of Methods|<f1>Pointer to Method (Starting Address)|<f2>Method Size|<f3>Pointer to Method Definition" shape = "record" ]; "MethodLookupTable":f3 -> "MethodDefinition":f0 [ id = 0 color = "purple" ]; "ProtectedRegionTable" [ label = "<f0>Protected Region Table|<f1>Number of Regions|<f2>Pointer to Protected Region Definition 1|...|Pointer to Protected Region Definition N" shape = "record" ]; "ProtectedRegionTable":f2 -> "ProtectedRegionDefinition":f0 [ id = 0 ]; "ProtectedRegionDefinition" [ label = "<f0>Protected Region Definition|<f1>Region Start|<f2>Region End|<f3>Region Handler|<f4>Exception Handler Type|<f5>Pointer to Exception Type" shape = "record" ]; "ProtectedRegionDefinition":f5 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "InterfaceSlotTable" [ label = "<f0>Interface Slot Table|<f1>Number of Interface Method Tables|<f2>Pointer to Interface Method Table 1|...|Pointer to Interface Method Table N" shape = "record" ]; "InterfaceSlotTable":f2 -> "InterfaceMethodTable":f0 [ id = 0 ]; "InterfaceMethodTable" [ label = "<f0>Interface Method Table|<f1>Pointer to Interface Type|<f2>Number of Methods|<f3>Pointer to Method Definition 1|..|Pointer to Method Definition N" shape = "record" ]; "InterfaceMethodTable":f1 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "InterfaceMethodTable":f3 -> "MethodDefinition":f0 [ id = 0 color = "purple" ]; "MethodDefinition" [ label = "<f0>Method Definition|<f1>Pointer to Method Name|<f2>~Pointer to Custom Attributes|<f3>Method Attributes|<f4>Local & Parameter Stack Size|<f5>Pointer to Method|<f6>Pointer to Return Type Definition|<f7>~Pointer to Protected Region Table|<f8>Pointer to Method GC Data|<f9>Number of Parameters|<f10>Pointer to Parameter Definition 1|...|Pointer to Parameter Definition N" shape = "record" color = "purple" ]; "MethodDefinition":f7 -> "ProtectedRegionTable":f0 [ id = 0 ]; "MethodDefinition":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "MethodDefinition":f2 -> "CustomAttributesTable":f0 [ id = 0 ]; "MethodDefinition":f6 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "MethodDefinition":f8 -> "Method GC Data":f0 [ id = 0 ]; "MethodDefinition":f10 -> "ParameterDefinition":f0 [ id = 0 ]; "ParameterDefinition" [ label = "<f0>Parameter Definition|<f1>Pointer to Parameter Name|<f2>~Pointer to Custom Attributes|<f3>Parameter Attributes|<f4>Pointer to Parameter Type" shape = "record" ]; "ParameterDefinition":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "ParameterDefinition":f2 -> "CustomAttributesTable":f0 [ id = 0 ]; "ParameterDefinition":f4 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "Method GC Data" [ label = "<f0>Method GC Data|<f1>Pointer to SafePoint Table|<f2>Pointer to Method GC Stack Data" shape = "record" ]; "Method GC Data":f1 -> "SafePoint":f0 [ id = 0 style = "dotted" ]; "SafePointTable" [ label = "<f0>SafePoint Table|<f1>Number of SafePoints|<f2>SafePoint 1|..|SafePoint N" shape = "record" ]; "SafePoint" [ label = "<f0>SafePoint|<f1>Address Offset|<f2>Address Range (signed)|<f3>Breakpoint Indicator|<f4>CPU Registers Bitmap (32 bit)" shape = "record" ]; "SafePointTable":f2 -> "SafePoint":f0 [ id = 0 style = "dotted" ]; "CustomAttributesTable" [ label = "<f0>Custom Attributes Table|<f1>Number of Attributes|<f2>Pointer to Custom Attribute 1|...|Pointer to Custom Attribute N" shape = "record" ]; "CustomAttributesTable":f2 -> "CustomAttribute":f0 [ id = 0 ]; "CustomAttribute" [ label = "<f0>Custom Attribute|<f1>Pointer to Attribute Type|<f2>Pointer to Constructor Method|<f3>Number of Arguments|<f4>Pointer to Argument 1|...|Pointer to Argument N" shape = "record" ]; "CustomAttribute":f1 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; "CustomAttribute":f2 -> "MethodDefinition":f0 [ id = 0 color = "purple" ]; "CustomAttribute":f4 -> "CustomAttributeArgument":f0 [ id = 0 ]; "CustomAttributeArgument" [ label = "<f0>Custom Attribute Argument|<f1>~Pointer to Argument Name|<f2>Is Argument a Field|<f3>Pointer to Argument Type|<f4>Argument Size|<f3>Argument" shape = "record" ]; "CustomAttributeArgument":f1 -> "NameString":f0 [ id = 0 color = "red" ]; "CustomAttributeArgument":f3 -> "TypeDefinition":f0 [ id = 0 color = "blue" ]; }

Table Definitions

Internal String Object

Pointer to Method Table

String Length

Unicode String

Assembly Table

Number of Assemblies

Pointer to Assembly 1..N

Assembly

Pointer to Assembly Name

Pointer to Custom Attributes

Flags: IsReflectionOnly

Number of Types

Pointer to Type Definition 1..N

Type Definition

Pointer to Typeame

Pointer to Custom Attributes

Type Code & Attributes

Type Size

Pointer to Assembly

Pointer to Parent Type

Pointer to Declaring Type

Pointer to Element Type

Pointer to Default Constructor Method

Pointer to Properties Table

Pointer to Fields Table

Pointer to Interface Slot Table

Pointer to Interface Bitmap

Number of Methods

Pointer to Method 1..N

Pointer to Method Definition 1..N

Fields Table

Number of Fields

Pointer to Field Definition 1..N

Field Definition

Pointer to Fieldame

Pointer to Custom Attributes

Field Attributes

Pointer to Field Type

Address

Offset / Size

Properties Table

Number of Properties

Pointer to Property Definition 1..N

Property Definition

Pointer to Propertyame

Pointer to Custom Attributes

Property Attributes

Pointer to Property Type

Pointer to Getter Method Definition

Pointer to Setter Method Defiinition

Method Lookup Table

Number of Methods

Pointer to Method (Starting Address)

Method Size

Pointer to Method Definition

Protected Region Table

Number of Regions

Pointer to Protected Region Definition 1..N

Protected Region Definition

Region Start

Region End

Region Handler

Exception Handler Type

Pointer to Exception Type

Interface Slot Table

Number of Interface Method Tables

Pointer to Interface Method Table 1..N

Interface Method Table

Pointer to Interface Type

Number of Methods

Pointer to Method Definition 1..N

Method Definition

Pointer to Methodame

Pointer to Custom Attributes

Method Attributes

Local & Parameter Stack Size

Pointer to Method

Pointer to Return Type Definition

Pointer to Protected Region Table

Pointer to Method GC Data

Number of Parameters

Pointer to Parameter Definition 1..N

Property Definition

Pointer to Parameterame

Pointer to Custom Attributes

Parameter Attributes

Pointer to Parameter Type

Custom Attributes Table

Number of Attributes

Pointer to Custom Attribute 1..N

Custom Attribute

Pointer to Attribute Type

Pointer to Constructor Method

Number of Arguments

Pointer to Argument 1..N

Custom Attribute Argument

Pointer to Argumentame

Is Argument a Field

Pointer to Argument Type

Argument Size

Argument

Method GC Data

Pointer to SafePoint Table

Pointer to Method GC Stack Data

Method GC Stack Data

Number of Method GC Stack Entries

Pointer to Method GC Stack Entry 1..N

Method GC Stack Entry

Stack Offset

Type (0=Object/1=Managed Pointer)

Live Ranges 1..N

. Address Offset

. Address Range

Method SafePoint Table

Number of SafePoints

SafePoint 1..N

. Address Offset

. Address Range

. CPU Registers Bitmap (32 bit)

. Type Bitmap (32 bit)

. Breakpoint Indicator