class Savi::Compiler::CodeGen::VeronaRT
- Savi::Compiler::CodeGen::VeronaRT
- Reference
- Object
Defined in:
savi/compiler/code_gen/veronart.crConstant Summary
-
COWN_PAD_SIZE =
8 * ((USE_SYSTEMATIC_TESTING ? 12 : 8) - 1)
-
DESC_FINAL_FN =
3
-
DESC_ID =
0
-
DESC_NOTIFY_FN =
4
-
DESC_TRACE_FN =
1
-
DESC_TRACE_POSSIBLY_ISO_FN =
2
-
OBJECT_PAD_SIZE =
8 * (3 - 1)
-
The size by which every Cown object is padded with runtime-internal data. We cheat the size smaller by point pointer here because we know the first pointer is the type descriptor, which we still try not to touch directly, except in cases where we are mimicking with non-runtime-allocated objects.
-
USE_SYSTEMATIC_TESTING =
true
-
Set to true only for debugging CodeGen of programs; otherwise, false.
TODO Should this be configurable by a flag at runtime?
Constructors
Instance Method Summary
-
#cast_kind_of(g : CodeGen, type_ref : Reach::Ref, llvm_type : LLVM::Type | Nil, pos : Source::Pos) : Symbol
When an assignment cast may need to happen, classify the kind of type.
- #desc : LLVM::Type
- #di_runtime_member_info(debug : DebugInfo)
- #gen_action_desc(g : CodeGen, gtype : GenType, gfunc : GenFunc, action_type)
- #gen_action_func(g : CodeGen, gtype : GenType, gfunc : GenFunc, action_type)
- #gen_action_type(g : CodeGen, gtype : GenType, gfunc : GenFunc, params_types)
- #gen_actor_acquire_into_scope(g : CodeGen, value : LLVM::Value)
- #gen_actor_release_from_scope(g : CodeGen, value : LLVM::Value)
-
#gen_alloc(g : CodeGen, gtype : GenType, from_expr : AST::Node, name : String)
This generates the code that allocates an object of the given type.
- #gen_alloc_action(g : CodeGen, action_desc, name)
- #gen_alloc_actor(g : CodeGen, gtype : GenType, name)
- #gen_alloc_ctx_get(g : CodeGen)
- #gen_alloc_object(g : CodeGen, gtype : GenType, name)
- #gen_alloc_object_iso(g : CodeGen, gtype : GenType, name)
- #gen_alloc_struct(g : CodeGen, llvm_type : LLVM::Type, name)
-
#gen_cast_value(g : CodeGen, value : LLVM::Value, from_kind : Symbol, to_kind : Symbol, from_type : Reach::Ref, to_type : Reach::Ref, from_expr : AST::Node) : LLVM::Value
When an assignment cast needs to happen, take the runtime-appropriate action needed to convert from one type kind to a different type kind.
- #gen_current_root_get(g : CodeGen)
- #gen_current_root_set(g : CodeGen, value : LLVM::Value)
- #gen_current_root_thread_local(g : CodeGen)
-
#gen_desc(g : CodeGen, gtype : GenType)
This defines a global constant for the type descriptor of a type, which is held as the first value in an object, used for identifying its type at runtime, as well as a host of other functions related to dealing with objects in the runtime, such as allocating them and tracing them.
-
#gen_desc_basetype
This defines the generic LLVM struct type for what a type descriptor holds.
- #gen_desc_empty(g : CodeGen)
- #gen_desc_fn_impls(g : CodeGen, gtype : GenType)
-
#gen_desc_init(g : CodeGen, gtype : GenType, vtable)
This populates the descriptor for the given type with its initialized data.
-
#gen_desc_type(g : CodeGen, type_def : Reach::Def, vtable_size : Int32) : LLVM::Type
This defines a more specific struct type than the above function, tailored to the specific type definition and its virtual table size.
-
#gen_expr_post(g : CodeGen, expr : AST::Node, value : LLVM::Value)
For every expression whose value is generated, hook into the value and maybe take an action based on the given lifetime info.
- #gen_get_desc(g : CodeGen, value : LLVM::Value)
-
#gen_hacky_stubs(g)
TODO Remove these when we can stop calling them from Savi programs.
- #gen_intrinsic_cpointer_alloc(g : CodeGen, params, llvm_type, elem_size_value)
- #gen_intrinsic_cpointer_realloc(g : CodeGen, params, llvm_type, elem_size_value)
- #gen_iso_freeze_region(g : CodeGen, value : LLVM::Value)
- #gen_iso_merge_into_current_region(g : CodeGen, value : LLVM::Value)
- #gen_main(g : CodeGen)
- #gen_main_inner(g : CodeGen)
- #gen_runtime_decls(g : CodeGen)
- #gen_send_impl(g : CodeGen, gtype : GenType, gfunc : GenFunc)
- #gen_struct_type(g : CodeGen, gtype : GenType)
- #gen_trace_impl(g : CodeGen, gtype : GenType)
- #gen_trace_possibly_iso_impl(g : CodeGen, gtype : GenType)
- #gen_traits_gep_get(g, desc, name)
- #gen_traits_get(g, desc, name)
- #gen_type_name_get(g, desc, name)
- #gen_val_acquire_into_scope(g : CodeGen, value : LLVM::Value)
- #gen_val_release_from_scope(g : CodeGen, value : LLVM::Value)
- #gen_vtable_gep_get(g, desc, name)
- #obj : LLVM::Type
Constructor Detail
Instance Method Detail
When an assignment cast may need to happen, classify the kind of type.
This generates the code that allocates an object of the given type. This is the first step before actually calling the constructor of it.
When an assignment cast needs to happen, take the runtime-appropriate action needed to convert from one type kind to a different type kind.
This defines a global constant for the type descriptor of a type, which is held as the first value in an object, used for identifying its type at runtime, as well as a host of other functions related to dealing with objects in the runtime, such as allocating them and tracing them.
This defines the generic LLVM struct type for what a type descriptor holds. The type descriptor for each type uses a more specific version of this. The order and sizes here must exactly match what is expected by the runtime, and they should correlate to the constants above.
This populates the descriptor for the given type with its initialized data.
This defines a more specific struct type than the above function, tailored to the specific type definition and its virtual table size. The actual type descriptor value for the type is an instance of this.
For every expression whose value is generated, hook into the value and maybe take an action based on the given lifetime info.