ddc-core-salt-0.4.3.1: Disciplined Disciple Compiler C code generator.

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Salt.Runtime

Contents

Description

Bindings to functions exported by the runtime system, and wrappers for related primops.

Synopsis

Runtime Config

data Config Source #

Runtime system configuration

Constructors

Config 

Fields

runtimeImportKinds :: Map Name (ImportType Name (Type Name)) Source #

Kind signatures for runtime types that we use when converting to Salt.

runtimeImportTypes :: Map Name (ImportValue Name (Type Name)) Source #

Type signatures for runtime funtions that we use when converting to Salt.

Runtime Types.

rTop :: Type Name Source #

The top-level region. This region lives for the whole program, and is used to store objects whose types don't have region annotations (like function closures and Unit values).

Runtime Functions

Generic

xGetTag :: a -> Type Name -> Exp a Name -> Exp a Name Source #

Get the constructor tag of an object.

Boxed Objects

xAllocBoxed :: a -> Type Name -> Integer -> Exp a Name -> Exp a Name Source #

Allocate a Boxed object.

xGetFieldOfBoxed Source #

Arguments

:: a 
-> Type Name

Prime region var of object.

-> Type Name

Regino of result object.

-> Exp a Name

Object to update.

-> Integer

Field index.

-> Exp a Name 

Get a field of a Boxed object.

xSetFieldOfBoxed Source #

Arguments

:: a 
-> Type Name

Prime region var of object.

-> Type Name

Region of field object.

-> Exp a Name

Object to update.

-> Integer

Field index.

-> Exp a Name

New field value.

-> Exp a Name 

Set a field in a Boxed Object.

Raw Objects

xAllocRaw :: a -> Type Name -> Integer -> Exp a Name -> Exp a Name Source #

Allocate a Raw object.

xPayloadOfRaw :: a -> Type Name -> Exp a Name -> Exp a Name Source #

Get the payload of a Raw object.

Raw Small Objects

xAllocSmall :: a -> Type Name -> Integer -> Exp a Name -> Exp a Name Source #

Allocate a Small object.

xPayloadOfSmall :: a -> Type Name -> Exp a Name -> Exp a Name Source #

Get the payload of a Small object.

Thunk Objects

xAllocThunk Source #

Arguments

:: a 
-> Type Name 
-> Exp a Name

Function

-> Exp a Name

Value paramters.

-> Exp a Name

Times boxed.

-> Exp a Name

Value args.

-> Exp a Name

Times run.

-> Exp a Name 

Allocate a Thunk object.

xArgsOfThunk :: a -> Type Name -> Exp a Name -> Exp a Name Source #

Get the available arguments in a thunk.

xSetFieldOfThunk Source #

Arguments

:: a 
-> Type Name

Region containing thunk.

-> Type Name

Region containigng new child.

-> Exp a Name

Thunk to set field of.

-> Exp a Name

Base offset.

-> Exp a Name

Index of field from base.

-> Exp a Name

New child value.

-> Exp a Name 

Set one of the argument pointers in a thunk.

xExtendThunk :: a -> Type Name -> Type Name -> Exp a Name -> Exp a Name -> Exp a Name Source #

Copy a thunk while extending the number of available argument slots.

xCopyArgsOfThunk :: a -> Type Name -> Type Name -> Exp a Name -> Exp a Name -> Exp a Name -> Exp a Name -> Exp a Name Source #

Copy the available arguments from one thunk to another.

xApplyThunk :: a -> Int -> [Exp a Name] -> Exp a Name Source #

Apply a thunk to some more arguments.

xRunThunk Source #

Arguments

:: a

Annotation.

-> Type Name

Region containing thunk to run.

-> Type Name

Region containing result object.

-> Exp a Name

Expression of thunk to run.

-> Exp a Name 

Run a thunk.

Error handling

xErrorDefault :: a -> Exp a Name -> Exp a Name -> Exp a Name Source #

Get the payload of a Small object.