Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/reflections/das2rst.das
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def document_module_rtti(_root : string) {
group_by_regex("Program access", mod, %regex~(program_for_each_module|program_for_each_registered_module|get_this_module|get_module|has_module|module_group_for_each_member)$%%),
group_by_regex("Module access", mod, %regex~(module_for_each_structure|module_for_each_enumeration|module_for_each_function|module_for_each_generic|module_for_each_global|module_for_each_annotation|module_for_each_dependency)$%%),
group_by_regex("Annotation access", mod, %regex~(get_annotation_argument_value|add_annotation_argument|get_annotation|get_annotation_argument|resolve_annotation|each_annotation|each_annotation_argument)$%%),
group_by_regex("Compilation and simulation", mod, %regex~(compile|compile_file|for_each_expected_error|for_each_require_declaration|simulate|create_ast_serializer|create_ast_deserializer|delete_ast_serializer|serialize_program|deserialize_program|ast_serializer_get_data)$%%),
group_by_regex("Compilation and simulation", mod, %regex~(compile|compile_file|for_each_expected_error|for_each_require_declaration|simulate|create_ast_serializer|create_ast_deserializer|delete_ast_serializer|serialize_program|deserialize_program|ast_serializer_get_data|ast_serializer_finalize_usec|ast_serializer_setup_usec)$%%),
group_by_regex("File access", mod, %regex~(make_file_access|set_file_source|add_file_access_root|add_extra_module)$%%),
group_by_regex("Structure access", mod, %regex~(rtti_builtin_structure_for_each_annotation|basic_struct_for_each_field|structure_for_each_annotation|basic_struct_for_each_parent)$%%),
group_by_regex("Data walking and printing", mod, %regex~(sprint_data|sprint_json_at|sscan_json_at|describe|get_mangled_name)$%%),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Microseconds the reads through `deserialize_program` on this deserializer spent inside finalizeModule - the annotations, the macro-module re-simulation and the gc_collect of every program it restored; the decode is the read minus this and `ast_serializer_setup_usec`.
def ast_serializer_finalize_usec (serializer: AstSerializer?) : int64
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Microseconds the reads through `deserialize_program` on this deserializer spent in the program setup that follows the stream - symbol marking and stack allocation - over every program it restored.
def ast_serializer_setup_usec (serializer: AstSerializer?) : int64
40 changes: 20 additions & 20 deletions include/daScript/ast/REVIEW.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# AST Headers Code Review Checklist

**Read `REVIEW_COMMON.md` (repo root) first - its contract binds this checklist.** Architecture doc:
`src/ast/ARCHITECTURE.md` (repo root). A diff that adds, reorders or retypes a data member of a
C++ type that das binds through an annotation applies
`src/builtin/REVIEW.md` too; checklist discovery walks changed paths only, so a header edit
never opens that checklist on its own.
`src/ast/ARCHITECTURE.md` (repo root). Apply `src/builtin/REVIEW.md` too when a diff changes the
offset or type of a data member of a C++ type some `Managed*Annotation` is instantiated over -
adding, removing, reordering or retyping a member all count, and the das-visible name can differ
from the C++ type's, so check the annotation's template argument, not the string. Checklist
discovery walks changed paths only, so a header edit never opens that checklist on its own.

- **A diff that changes what a cached JIT DLL binds - the module a bind registers into or the
name it registers under (`vectorHomeModule`, `typeFactory<vector<TT>>::make`,
`registerVectorFunctions`, the name a `ManagedVectorAnnotation` or
`ManagedStructureAnnotation` takes - all in `ast_handle.h`), or the field layout of a C++ type
das code reads through a binding - bumps `LLVM_JIT_CODEGEN_VERSION` in
`modules/dasLLVM/daslib/llvm_jit_plan.das` (repo root), in the same change.** The key is built
from the codegen version and each function's AST hash, never from the module an extern lives
in nor a bound type's offsets, so a cached DLL binds the old name or the old offset and
crashes on the hit.
- **A diff that changes the module an existing bind registers into or the name it registers
under (`vectorHomeModule`, `typeFactory<vector<TT>>::make`, `registerVectorFunctions`, the name
a `ManagedVectorAnnotation` or `ManagedStructureAnnotation` takes - all in `ast_handle.h`), or
the offset or type of a data member of a C++ type some `Managed*Annotation` is instantiated
over, bumps `LLVM_JIT_CODEGEN_VERSION` in `modules/dasLLVM/daslib/llvm_jit_plan.das` (repo
root), in the same change.** The key is built from the codegen version and each function's AST
hash, never from the module an extern lives in nor a bound type's offsets, so a cached DLL
binds the old name or the old offset and crashes on the hit.

- **A diff that adds a field to `Function` or `Variable` (`ast.h`) holding something one
program's compile decides - whether the program uses it, the slot it holds in that program's
context, whether its JIT selected it - is a defect; the value goes into `Program`'s symbol
tables (`usedFunctions`, `functionIndices` and their variable twins, `jitSelected`)
instead.** A shared module's objects are one
instance for every program in the process, and a compile that runs inside another - a macro's
`compile`, a late `require`, the folding program - would otherwise overwrite the outer
program's answer mid-simulate. The per-compile fields that remain, and why each is tolerated,
are `src/ast/ARCHITECTURE.md` sec.4's.
context, whether this program's JIT selected it - is a defect; the value goes into `Program`'s
symbol tables (`usedFunctions`, `functionIndices`, `usedVariables`, `variableIndices`,
`jitSelected`) instead.** A shared module's objects are one instance for every program in the
process, and a compile that runs inside another - a macro's `compile`, a late `require`, the
folding program - would otherwise overwrite the outer program's answer mid-simulate.
`src/ast/ARCHITECTURE.md` sec.4 lists the per-compile fields that remain and why each is
tolerated.
Loading
Loading