mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-10 03:21:37 -07:00
new bake string map gathering/merging passes & async usage in converter
This commit is contained in:
@@ -1227,6 +1227,7 @@ rdim_bake_string_chunk_list_push(RDIM_Arena *arena, RDIM_BakeStringChunkList *li
|
||||
list->chunk_count += 1;
|
||||
}
|
||||
RDIM_BakeString *s = &n->v[n->count];
|
||||
s->chunk = n;
|
||||
n->count += 1;
|
||||
list->total_count += 1;
|
||||
return s;
|
||||
@@ -1235,6 +1236,10 @@ rdim_bake_string_chunk_list_push(RDIM_Arena *arena, RDIM_BakeStringChunkList *li
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_concat_in_place(RDIM_BakeStringChunkList *dst, RDIM_BakeStringChunkList *to_push)
|
||||
{
|
||||
for(RDIM_BakeStringChunkNode *n = to_push->first; n != 0; n = n->next)
|
||||
{
|
||||
n->base_idx += dst->total_count;
|
||||
}
|
||||
if(dst->last != 0 && to_push->first != 0)
|
||||
{
|
||||
dst->last->next = to_push->first;
|
||||
@@ -1336,12 +1341,24 @@ rdim_bake_string_chunk_list_sorted_from_unsorted(RDIM_Arena *arena, RDIM_BakeStr
|
||||
|
||||
//- rjf: bake string chunk list maps
|
||||
|
||||
RDI_PROC RDIM_BakeStringChunkListMap *
|
||||
rdim_bake_string_chunk_list_map_make(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top)
|
||||
{
|
||||
RDIM_BakeStringChunkListMap *map = rdim_push_array(arena, RDIM_BakeStringChunkListMap, 1);
|
||||
map->slots = rdim_push_array(arena, RDIM_BakeStringChunkList *, top->slots_count);
|
||||
return map;
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_insert(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMap *map, RDI_U64 chunk_cap, RDIM_String8 string)
|
||||
{
|
||||
RDI_U64 hash = rdi_hash(string.RDIM_String8_BaseMember, string.RDIM_String8_SizeMember);
|
||||
RDI_U64 slot_idx = hash%map_topology->slots_count;
|
||||
RDIM_BakeStringChunkList *slot = &map->slots[slot_idx];
|
||||
RDIM_BakeStringChunkList *slot = map->slots[slot_idx];
|
||||
if(slot == 0)
|
||||
{
|
||||
slot = map->slots[slot_idx] = rdim_push_array(arena, RDIM_BakeStringChunkList, 1);
|
||||
}
|
||||
RDI_S32 is_duplicate = 0;
|
||||
for(RDIM_BakeStringChunkNode *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
@@ -1368,15 +1385,80 @@ rdim_bake_string_chunk_list_map_join_in_place(RDIM_BakeStringChunkListMapTopolog
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < map_topology->slots_count; idx += 1)
|
||||
{
|
||||
rdim_bake_string_chunk_list_concat_in_place(&dst->slots[idx], &src->slots[idx]);
|
||||
if(dst->slots[idx] == 0)
|
||||
{
|
||||
dst->slots[idx] = src->slots[idx];
|
||||
}
|
||||
else if(src->slots[idx] != 0)
|
||||
{
|
||||
rdim_bake_string_chunk_list_concat_in_place(dst->slots[idx], src->slots[idx]);
|
||||
}
|
||||
}
|
||||
rdim_memzero_struct(src);
|
||||
}
|
||||
|
||||
RDI_PROC RDIM_BakeStringChunkListMapBaseIndices
|
||||
rdim_bake_string_chunk_list_base_indices_from_map(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMap *map)
|
||||
{
|
||||
RDIM_BakeStringChunkListMapBaseIndices indices = {0};
|
||||
indices.slots_base_idxs = rdim_push_array(arena, RDI_U64, map_topology->slots_count+1);
|
||||
RDI_U64 total_count = 0;
|
||||
for(RDI_U64 idx = 0; idx < map_topology->slots_count; idx += 1)
|
||||
{
|
||||
indices.slots_base_idxs[idx] += total_count;
|
||||
if(map->slots[idx] != 0)
|
||||
{
|
||||
total_count += map->slots[idx]->total_count;
|
||||
}
|
||||
}
|
||||
indices.slots_base_idxs[map_topology->slots_count] = total_count;
|
||||
return indices;
|
||||
}
|
||||
|
||||
//- rjf: finalized bake string map
|
||||
|
||||
RDI_PROC RDIM_BakeStringMapFinal
|
||||
rdim_bake_string_map_final_from_chunk_list_map(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMapBaseIndices *map_base_indices, RDIM_BakeStringChunkListMap *map)
|
||||
{
|
||||
RDIM_BakeStringMapFinal m = {0};
|
||||
m.slots_count = map_topology->slots_count;
|
||||
m.slots = rdim_push_array(arena, RDIM_BakeStringChunkList, m.slots_count);
|
||||
m.slots_base_idxs = map_base_indices->slots_base_idxs;
|
||||
for(RDI_U64 idx = 0; idx < m.slots_count; idx += 1)
|
||||
{
|
||||
if(map->slots[idx] != 0)
|
||||
{
|
||||
rdim_memcpy_struct(&m.slots[idx], map->slots[idx]);
|
||||
}
|
||||
}
|
||||
m.total_count = m.slots_base_idxs[m.slots_count];
|
||||
return m;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdim_bake_idx_from_string(RDIM_BakeStringMapFinal *map, RDIM_String8 string)
|
||||
{
|
||||
RDI_U64 hash = rdi_hash(string.RDIM_String8_BaseMember, string.RDIM_String8_SizeMember);
|
||||
RDI_U64 slot_idx = hash%map->slots_count;
|
||||
RDI_U64 idx = 0;
|
||||
for(RDIM_BakeStringChunkNode *n = map->slots[slot_idx].first; n != 0; n = n->next)
|
||||
{
|
||||
for(RDI_U64 chunk_idx = 0; chunk_idx < n->count; chunk_idx += 1)
|
||||
{
|
||||
if(n->v[chunk_idx].hash == hash && rdim_str8_match(n->v[chunk_idx].string, string, 0))
|
||||
{
|
||||
idx = map->slots_base_idxs[slot_idx] + n->base_idx + chunk_idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
//- rjf: bake string map reading/writing
|
||||
|
||||
RDI_PROC RDI_U32
|
||||
rdim_bake_idx_from_string(RDIM_BakeStringMap *map, RDIM_String8 string)
|
||||
rdim_bake_idx_from_string_OLD(RDIM_BakeStringMap *map, RDIM_String8 string)
|
||||
{
|
||||
RDI_U64 hash = rdi_hash(string.RDIM_String8_BaseMember, string.RDIM_String8_SizeMember);
|
||||
RDI_U64 slot_idx = hash%map->slots_count;
|
||||
@@ -1750,6 +1832,160 @@ rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst, RDIM_BakeSecti
|
||||
////////////////////////////////
|
||||
//~ rjf: [Baking] Build Artifacts -> Interned/Deduplicated Data Structures
|
||||
|
||||
//- rjf: basic bake string gathering passes
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_top_level_info(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_TopLevelInfo *tli)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, tli->exe_name);
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_binary_sections(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_BinarySectionList *secs)
|
||||
{
|
||||
for(RDIM_BinarySectionNode *n = secs->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, n->v.name);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_path_tree(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_BakePathTree *path_tree)
|
||||
{
|
||||
for(RDIM_BakePathNode *n = path_tree->first; n != 0; n = n->next_order)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, n->name);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: chunk-granularity bake string gathering passes
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_src_file_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SrcFileChunkNode *chunk)
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < chunk->count; idx += 1)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, chunk->v[idx].normal_full_path);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_unit_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UnitChunkNode *chunk)
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < chunk->count; idx += 1)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 4, chunk->v[idx].unit_name);
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 4, chunk->v[idx].compiler_name);
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 4, chunk->v[idx].source_file);
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 4, chunk->v[idx].object_file);
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 4, chunk->v[idx].archive_file);
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 4, chunk->v[idx].build_path);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_type_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_TypeChunkNode *chunk)
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < chunk->count; idx += 1)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 64, chunk->v[idx].name);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_udt_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UDTChunkNode *chunk)
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < chunk->count; idx += 1)
|
||||
{
|
||||
for(RDIM_UDTMember *mem = chunk->v[idx].first_member; mem != 0; mem = mem->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 64, mem->name);
|
||||
}
|
||||
for(RDIM_UDTEnumVal *mem = chunk->v[idx].first_enum_val; mem != 0; mem = mem->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 64, mem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_symbol_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SymbolChunkNode *chunk)
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < chunk->count; idx += 1)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, chunk->v[idx].name);
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, chunk->v[idx].link_name);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_scope_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_ScopeChunkNode *chunk)
|
||||
{
|
||||
for(RDI_U64 idx = 0; idx < chunk->count; idx += 1)
|
||||
{
|
||||
for(RDIM_Local *local = chunk->v[idx].first_local; local != 0; local = local->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_insert(arena, top, map, 1, local->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: list-granularity bake string gathering passes
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_src_files(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SrcFileChunkList *list)
|
||||
{
|
||||
for(RDIM_SrcFileChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_push_src_file_chunk(arena, top, map, n);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_units(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UnitChunkList *list)
|
||||
{
|
||||
for(RDIM_UnitChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_push_unit_chunk(arena, top, map, n);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_types(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_TypeChunkList *list)
|
||||
{
|
||||
for(RDIM_TypeChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_push_type_chunk(arena, top, map, n);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_udts(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UDTChunkList *list)
|
||||
{
|
||||
for(RDIM_UDTChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_push_udt_chunk(arena, top, map, n);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_symbols(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SymbolChunkList *list)
|
||||
{
|
||||
for(RDIM_SymbolChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_push_symbol_chunk(arena, top, map, n);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_bake_string_chunk_list_map_push_scopes(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_ScopeChunkList *list)
|
||||
{
|
||||
for(RDIM_ScopeChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
rdim_bake_string_chunk_list_map_push_scope_chunk(arena, top, map, n);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: bake string map from params
|
||||
|
||||
RDI_PROC RDIM_BakeStringMap *
|
||||
@@ -2091,7 +2327,7 @@ rdim_bake_path_tree_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
//- rjf: top-level info
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
RDI_TopLevelInfo *dst_tli = rdim_push_array(arena, RDI_TopLevelInfo, 1);
|
||||
@@ -2107,7 +2343,7 @@ rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
|
||||
//- rjf: binary sections
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
RDIM_BinarySectionList *src_list = ¶ms->binary_sections;
|
||||
@@ -2255,7 +2491,7 @@ rdim_bake_section_list_from_unit(RDIM_Arena *arena, RDIM_Unit *unit)
|
||||
}
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params)
|
||||
rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params)
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
RDI_Unit *dst_base = rdim_push_array(arena, RDI_Unit, params->units.total_count+1);
|
||||
@@ -2479,7 +2715,7 @@ rdim_bake_unit_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
|
||||
//- rjf: source files
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params)
|
||||
rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params)
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
|
||||
@@ -2665,7 +2901,7 @@ rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMa
|
||||
//- rjf: type nodes
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params)
|
||||
rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params)
|
||||
{
|
||||
//- rjf: build all type nodes
|
||||
RDI_TypeNode *type_nodes = push_array(arena, RDI_TypeNode, params->types.total_count+1);
|
||||
@@ -2738,7 +2974,7 @@ rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
|
||||
//- rjf: UDTs
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
//- rjf: build tables
|
||||
RDI_UDT * udts = push_array(arena, RDI_UDT, params->udts.total_count+1);
|
||||
@@ -2808,7 +3044,7 @@ rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *st
|
||||
//- rjf: global variables
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
//- rjf: build all global variables
|
||||
RDI_GlobalVariable *global_variables = push_array(arena, RDI_GlobalVariable, params->global_variables.total_count+1);
|
||||
@@ -2929,7 +3165,7 @@ rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParam
|
||||
//- rjf: thread variables
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
//- rjf: build all thread variables
|
||||
RDI_ThreadVariable *thread_variables = push_array(arena, RDI_ThreadVariable, params->thread_variables.total_count+1);
|
||||
@@ -2971,7 +3207,7 @@ rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeS
|
||||
//- rjf: procedures
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
//- rjf: build all procedures
|
||||
RDI_Procedure *procedures = push_array(arena, RDI_Procedure, params->procedures.total_count+1);
|
||||
@@ -3014,7 +3250,7 @@ rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
|
||||
//- rjf: scopes
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params)
|
||||
rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params)
|
||||
{
|
||||
RDIM_Temp scratch = rdim_scratch_begin(&arena, 1);
|
||||
|
||||
@@ -3243,7 +3479,7 @@ rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
|
||||
//- rjf: name maps
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT])
|
||||
rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT])
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
|
||||
@@ -3283,7 +3519,7 @@ rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RD
|
||||
}
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDI_NameMapKind k, RDIM_BakeNameMap *map)
|
||||
rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDI_NameMapKind k, RDIM_BakeNameMap *map)
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
if(map != 0 && map->name_count != 0)
|
||||
@@ -3389,7 +3625,7 @@ rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_Bak
|
||||
//- rjf: file paths
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree)
|
||||
rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakePathTree *path_tree)
|
||||
{
|
||||
RDI_U32 dst_nodes_count = path_tree->count;
|
||||
RDI_FilePathNode *dst_nodes = rdim_push_array(arena, RDI_FilePathNode, dst_nodes_count);
|
||||
@@ -3424,36 +3660,46 @@ rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStri
|
||||
//- rjf: strings
|
||||
|
||||
RDI_PROC RDIM_BakeSectionList
|
||||
rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeStringMap *strings)
|
||||
rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings)
|
||||
{
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
RDI_U32 *str_offs = rdim_push_array_no_zero(arena, RDI_U32, strings->count + 1);
|
||||
RDI_U32 *str_offs = rdim_push_array_no_zero(arena, RDI_U32, strings->total_count + 1);
|
||||
RDI_U32 off_cursor = 0;
|
||||
{
|
||||
RDI_U32 *off_ptr = str_offs;
|
||||
*off_ptr = 0;
|
||||
off_ptr += 1;
|
||||
for(RDIM_BakeStringNode *node = strings->order_first;
|
||||
node != 0;
|
||||
node = node->order_next)
|
||||
for(RDI_U64 slot_idx = 0; slot_idx < strings->slots_count; slot_idx += 1)
|
||||
{
|
||||
off_cursor += node->v.string.size;
|
||||
*off_ptr = off_cursor;
|
||||
off_ptr += 1;
|
||||
for(RDIM_BakeStringChunkNode *n = strings->slots[slot_idx].first; n != 0; n = n->next)
|
||||
{
|
||||
for(RDI_U64 chunk_idx = 0; chunk_idx < n->count; chunk_idx += 1)
|
||||
{
|
||||
RDIM_BakeString *bake_string = &n->v[chunk_idx];
|
||||
off_cursor += bake_string->string.size;
|
||||
*off_ptr = off_cursor;
|
||||
off_ptr += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RDI_U8 *buf = rdim_push_array(arena, RDI_U8, off_cursor);
|
||||
{
|
||||
RDI_U8 *ptr = buf;
|
||||
for(RDIM_BakeStringNode *node = strings->order_first;
|
||||
node != 0;
|
||||
node = node->order_next)
|
||||
for(RDI_U64 slot_idx = 0; slot_idx < strings->slots_count; slot_idx += 1)
|
||||
{
|
||||
rdim_memcpy(ptr, node->v.string.str, node->v.string.size);
|
||||
ptr += node->v.string.size;
|
||||
for(RDIM_BakeStringChunkNode *n = strings->slots[slot_idx].first; n != 0; n = n->next)
|
||||
{
|
||||
for(RDI_U64 chunk_idx = 0; chunk_idx < n->count; chunk_idx += 1)
|
||||
{
|
||||
RDIM_BakeString *bake_string = &n->v[chunk_idx];
|
||||
rdim_memcpy(ptr, bake_string->string.str, bake_string->string.size);
|
||||
ptr += bake_string->string.size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rdim_bake_section_list_push_new(arena, §ions, str_offs, sizeof(RDI_U32)*(strings->count+1), RDI_DataSectionTag_StringTable, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, str_offs, sizeof(RDI_U32)*(strings->total_count+1), RDI_DataSectionTag_StringTable, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, buf, off_cursor, RDI_DataSectionTag_StringData, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -838,13 +838,14 @@ struct RDIM_BakeSectionList
|
||||
RDI_U64 count;
|
||||
};
|
||||
|
||||
//- rjf: interned strings
|
||||
//- rjf: interned string type
|
||||
|
||||
typedef struct RDIM_BakeString RDIM_BakeString;
|
||||
struct RDIM_BakeString
|
||||
{
|
||||
RDIM_String8 string;
|
||||
struct RDIM_BakeStringChunkNode *chunk;
|
||||
RDI_U64 hash;
|
||||
RDIM_String8 string;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeStringChunkNode RDIM_BakeStringChunkNode;
|
||||
@@ -854,6 +855,7 @@ struct RDIM_BakeStringChunkNode
|
||||
RDIM_BakeString *v;
|
||||
RDI_U64 count;
|
||||
RDI_U64 cap;
|
||||
RDI_U64 base_idx;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeStringChunkList RDIM_BakeStringChunkList;
|
||||
@@ -871,10 +873,25 @@ struct RDIM_BakeStringChunkListMapTopology
|
||||
RDI_U64 slots_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeStringChunkListMapBaseIndices RDIM_BakeStringChunkListMapBaseIndices;
|
||||
struct RDIM_BakeStringChunkListMapBaseIndices
|
||||
{
|
||||
RDI_U64 *slots_base_idxs;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeStringChunkListMap RDIM_BakeStringChunkListMap;
|
||||
struct RDIM_BakeStringChunkListMap
|
||||
{
|
||||
RDIM_BakeStringChunkList **slots;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeStringMapFinal RDIM_BakeStringMapFinal;
|
||||
struct RDIM_BakeStringMapFinal
|
||||
{
|
||||
RDIM_BakeStringChunkList *slots;
|
||||
RDI_U64 *slots_base_idxs;
|
||||
RDI_U64 slots_count;
|
||||
RDI_U64 total_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeStringNode RDIM_BakeStringNode;
|
||||
@@ -1137,11 +1154,17 @@ RDI_PROC void rdim_bake_string_chunk_list_concat_in_place(RDIM_BakeStringChunkLi
|
||||
RDI_PROC RDIM_BakeStringChunkList rdim_bake_string_chunk_list_sorted_from_unsorted(RDIM_Arena *arena, RDIM_BakeStringChunkList *src);
|
||||
|
||||
//- rjf: bake string chunk list maps
|
||||
RDI_PROC RDIM_BakeStringChunkListMap *rdim_bake_string_chunk_list_map_make(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_insert(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMap *map, RDI_U64 chunk_cap, RDIM_String8 string);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_join_in_place(RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMap *dst, RDIM_BakeStringChunkListMap *src);
|
||||
RDI_PROC RDIM_BakeStringChunkListMapBaseIndices rdim_bake_string_chunk_list_base_indices_from_map(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMap *map);
|
||||
|
||||
//- rjf: finalized bake string map
|
||||
RDI_PROC RDIM_BakeStringMapFinal rdim_bake_string_map_final_from_chunk_list_map(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *map_topology, RDIM_BakeStringChunkListMapBaseIndices *map_base_indices, RDIM_BakeStringChunkListMap *map);
|
||||
RDI_PROC RDI_U64 rdim_bake_idx_from_string(RDIM_BakeStringMapFinal *map, RDIM_String8 string);
|
||||
|
||||
//- rjf: bake string map reading/writing
|
||||
RDI_PROC RDI_U32 rdim_bake_idx_from_string(RDIM_BakeStringMap *map, RDIM_String8 string);
|
||||
RDI_PROC RDI_U32 rdim_bake_idx_from_string_OLD(RDIM_BakeStringMap *map, RDIM_String8 string);
|
||||
RDI_PROC RDI_U32 rdim_bake_string_map_insert(RDIM_Arena *arena, RDIM_BakeStringMap *map, RDIM_String8 string);
|
||||
|
||||
//- rjf: bake idx run map reading/writing
|
||||
@@ -1167,6 +1190,27 @@ RDI_PROC void rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst,
|
||||
////////////////////////////////
|
||||
//~ rjf: [Baking] Build Artifacts -> Interned/Deduplicated Data Structures
|
||||
|
||||
//- rjf: basic bake string gathering passes
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_top_level_info(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_TopLevelInfo *tli);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_binary_sections(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_BinarySectionList *secs);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_path_tree(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_BakePathTree *path_tree);
|
||||
|
||||
//- rjf: chunk-granularity bake string gathering passes
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_src_file_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SrcFileChunkNode *chunk);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_unit_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UnitChunkNode *chunk);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_type_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_TypeChunkNode *chunk);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_udt_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UDTChunkNode *chunk);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_symbol_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SymbolChunkNode *chunk);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_scope_chunk(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_ScopeChunkNode *chunk);
|
||||
|
||||
//- rjf: list-granularity bake string gathering passes
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_src_files(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SrcFileChunkList *list);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_units(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UnitChunkList *list);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_types(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_TypeChunkList *list);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_udts(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_UDTChunkList *list);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_symbols(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_SymbolChunkList *list);
|
||||
RDI_PROC void rdim_bake_string_chunk_list_map_push_scopes(RDIM_Arena *arena, RDIM_BakeStringChunkListMapTopology *top, RDIM_BakeStringChunkListMap *map, RDIM_ScopeChunkList *list);
|
||||
|
||||
//- rjf: bake string map building
|
||||
RDI_PROC RDIM_BakeStringMap *rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
|
||||
@@ -1183,54 +1227,54 @@ RDI_PROC RDIM_BakePathTree *rdim_bake_path_tree_from_params(RDIM_Arena *arena, R
|
||||
//~ rjf: [Baking] Build Artifacts -> Data Section Lists
|
||||
|
||||
//- rjf: top-level info
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: binary sections
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: units
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_section_list_from_unit(RDIM_Arena *arena, RDIM_Unit *unit);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: unit vmap
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_unit_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: source files
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: type nodes
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: UDTs
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: global variables
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: global vmap
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: thread variables
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: procedures
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: scopes
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeParams *params);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: scope vmap
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: name maps
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT]);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDI_NameMapKind k, RDIM_BakeNameMap *map);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT]);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDI_NameMapKind k, RDIM_BakeNameMap *map);
|
||||
|
||||
//- rjf: file paths
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings, RDIM_BakePathTree *path_tree);
|
||||
|
||||
//- rjf: strings
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeStringMap *strings);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeStringMapFinal *strings);
|
||||
|
||||
//- rjf: index runs
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_idx_run_section_list_from_idx_run_map(RDIM_Arena *arena, RDIM_BakeIdxRunMap *idx_runs);
|
||||
|
||||
@@ -3481,6 +3481,90 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
|
||||
////////////////////////////////
|
||||
//~ rjf: Baking Stage Tasks
|
||||
|
||||
//- rjf: bake string map building
|
||||
|
||||
internal void *
|
||||
p2r_bake_src_files_strings_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_BakeSrcFilesStringsIn *in = (P2R_BakeSrcFilesStringsIn *)p;
|
||||
RDIM_BakeStringChunkListMap *map = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("bake src file strings") rdim_bake_string_chunk_list_map_push_src_files(arena, in->top, map, in->list);
|
||||
return map;
|
||||
}
|
||||
|
||||
internal void *
|
||||
p2r_bake_units_strings_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_BakeUnitsStringsIn *in = (P2R_BakeUnitsStringsIn *)p;
|
||||
RDIM_BakeStringChunkListMap *map = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("bake unit strings") rdim_bake_string_chunk_list_map_push_units(arena, in->top, map, in->list);
|
||||
return map;
|
||||
}
|
||||
|
||||
internal void *
|
||||
p2r_bake_types_strings_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_BakeTypesStringsIn *in = (P2R_BakeTypesStringsIn *)p;
|
||||
RDIM_BakeStringChunkListMap *map = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("bake type strings") rdim_bake_string_chunk_list_map_push_types(arena, in->top, map, in->list);
|
||||
return map;
|
||||
}
|
||||
|
||||
internal void *
|
||||
p2r_bake_udts_strings_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_BakeUDTsStringsIn *in = (P2R_BakeUDTsStringsIn *)p;
|
||||
RDIM_BakeStringChunkListMap *map = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("bake udt strings") rdim_bake_string_chunk_list_map_push_udts(arena, in->top, map, in->list);
|
||||
return map;
|
||||
}
|
||||
|
||||
internal void *
|
||||
p2r_bake_symbols_strings_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_BakeSymbolsStringsIn *in = (P2R_BakeSymbolsStringsIn *)p;
|
||||
RDIM_BakeStringChunkListMap *map = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("bake symbol strings") rdim_bake_string_chunk_list_map_push_symbols(arena, in->top, map, in->list);
|
||||
return map;
|
||||
}
|
||||
|
||||
internal void *
|
||||
p2r_bake_scopes_strings_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_BakeScopesStringsIn *in = (P2R_BakeScopesStringsIn *)p;
|
||||
RDIM_BakeStringChunkListMap *map = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("bake scope strings") rdim_bake_string_chunk_list_map_push_scopes(arena, in->top, map, in->list);
|
||||
return map;
|
||||
}
|
||||
|
||||
//- rjf: bake string map sorting
|
||||
|
||||
internal void *
|
||||
p2r_bake_string_map_sort_task__entry_point(Arena *arena, void *p)
|
||||
{
|
||||
P2R_SortBakeStringMapIn *in = (P2R_SortBakeStringMapIn *)p;
|
||||
RDIM_BakeStringChunkListMap *dst = rdim_bake_string_chunk_list_map_make(arena, in->top);
|
||||
ProfScope("sort bake string chunk list map")
|
||||
{
|
||||
for(U64 slot_idx = 0; slot_idx < in->top->slots_count; slot_idx += 1)
|
||||
{
|
||||
if(in->map->slots[slot_idx] != 0)
|
||||
{
|
||||
if(in->map->slots[slot_idx]->total_count > 1)
|
||||
{
|
||||
dst->slots[slot_idx] = push_array(arena, RDIM_BakeStringChunkList, 1);
|
||||
*dst->slots[slot_idx] = rdim_bake_string_chunk_list_sorted_from_unsorted(arena, in->map->slots[slot_idx]);
|
||||
}
|
||||
else
|
||||
{
|
||||
dst->slots[slot_idx] = in->map->slots[slot_idx];;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
//- rjf: pass 1: interner/deduper map builds
|
||||
|
||||
internal void *
|
||||
@@ -3666,7 +3750,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
path_tree = rdim_bake_path_tree_from_params(arena, params);
|
||||
}
|
||||
|
||||
//- rjf: kick off pass 1 tasks
|
||||
//- rjf: kick off per-unit baking tasks
|
||||
P2R_BakeUnitIn *bake_units_in = push_array(scratch.arena, P2R_BakeUnitIn, params->units.total_count);
|
||||
TS_Ticket *bake_units_tickets = push_array(scratch.arena, TS_Ticket, params->units.total_count);
|
||||
{
|
||||
@@ -3680,8 +3764,80 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
}
|
||||
}
|
||||
}
|
||||
P2R_BuildBakeStringMapIn build_bake_string_map_in = {path_tree, params};
|
||||
TS_Ticket build_bake_string_map_ticket = ts_kickoff(p2r_build_bake_string_map_task__entry_point, 0, &build_bake_string_map_in);
|
||||
|
||||
//- rjf: kick off string map building tasks
|
||||
RDIM_BakeStringChunkListMapTopology bake_string_chunk_list_map_topology = {(params->procedures.total_count*2 +
|
||||
params->global_variables.total_count*2 +
|
||||
params->thread_variables.total_count*2 +
|
||||
params->types.total_count*2)};
|
||||
TS_TicketList bake_string_map_build_tickets = {0};
|
||||
{
|
||||
// rjf: src files
|
||||
{
|
||||
P2R_BakeSrcFilesStringsIn *in = push_array(scratch.arena, P2R_BakeSrcFilesStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->src_files;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_src_files_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: units
|
||||
{
|
||||
P2R_BakeUnitsStringsIn *in = push_array(scratch.arena, P2R_BakeUnitsStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->units;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_units_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: types
|
||||
{
|
||||
P2R_BakeTypesStringsIn *in = push_array(scratch.arena, P2R_BakeTypesStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->types;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_types_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: UDTs
|
||||
{
|
||||
P2R_BakeUDTsStringsIn *in = push_array(scratch.arena, P2R_BakeUDTsStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->udts;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_udts_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: global variables
|
||||
{
|
||||
P2R_BakeSymbolsStringsIn *in = push_array(scratch.arena, P2R_BakeSymbolsStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->global_variables;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_symbols_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: thread variables
|
||||
{
|
||||
P2R_BakeSymbolsStringsIn *in = push_array(scratch.arena, P2R_BakeSymbolsStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->thread_variables;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_symbols_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: procedures
|
||||
{
|
||||
P2R_BakeSymbolsStringsIn *in = push_array(scratch.arena, P2R_BakeSymbolsStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->procedures;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_symbols_strings_task__entry_point, 0, in));
|
||||
}
|
||||
|
||||
// rjf: scope chunks
|
||||
{
|
||||
P2R_BakeScopesStringsIn *in = push_array(scratch.arena, P2R_BakeScopesStringsIn, 1);
|
||||
in->top = &bake_string_chunk_list_map_topology;
|
||||
in->list = ¶ms->scopes;
|
||||
ts_ticket_list_push(scratch.arena, &bake_string_map_build_tickets, ts_kickoff(p2r_bake_scopes_strings_task__entry_point, 0, in));
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: kick off pass 1 tasks
|
||||
P2R_BuildBakeNameMapIn build_bake_name_map_in[RDI_NameMapKind_COUNT] = {0};
|
||||
TS_Ticket build_bake_name_map_ticket[RDI_NameMapKind_COUNT] = {0};
|
||||
for(RDI_NameMapKind k = (RDI_NameMapKind)(RDI_NameMapKind_NULL+1);
|
||||
@@ -3693,50 +3849,65 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
build_bake_name_map_ticket[k] = ts_kickoff(p2r_build_bake_name_map_task__entry_point, 0, &build_bake_name_map_in[k]);
|
||||
}
|
||||
|
||||
//- rjf: join string map build
|
||||
RDIM_BakeStringMap *strings = 0;
|
||||
ProfScope("join string map build")
|
||||
//- rjf: join string map building tasks
|
||||
RDIM_BakeStringChunkListMap *unsorted_bake_string_chunk_list_map = rdim_bake_string_chunk_list_map_make(arena, &bake_string_chunk_list_map_topology);
|
||||
ProfScope("join string map building tasks")
|
||||
{
|
||||
strings = ts_join_struct(build_bake_string_map_ticket, max_U64, RDIM_BakeStringMap);
|
||||
for(TS_TicketNode *n = bake_string_map_build_tickets.first; n != 0; n = n->next)
|
||||
{
|
||||
RDIM_BakeStringChunkListMap *map = ts_join_struct(n->v, max_U64, RDIM_BakeStringChunkListMap);
|
||||
rdim_bake_string_chunk_list_map_join_in_place(&bake_string_chunk_list_map_topology, unsorted_bake_string_chunk_list_map, map);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: kick off string map sorting task
|
||||
P2R_SortBakeStringMapIn sort_bake_string_map_in = {&bake_string_chunk_list_map_topology, unsorted_bake_string_chunk_list_map};
|
||||
TS_Ticket sort_bake_string_map_ticket = ts_kickoff(p2r_bake_string_map_sort_task__entry_point, 0, &sort_bake_string_map_in);
|
||||
|
||||
//- rjf: join string map sorting task
|
||||
RDIM_BakeStringChunkListMap *sorted_bake_string_chunk_list_map = ts_join_struct(sort_bake_string_map_ticket, max_U64, RDIM_BakeStringChunkListMap);
|
||||
|
||||
//- rjf: build finalized string map
|
||||
RDIM_BakeStringChunkListMapBaseIndices bake_string_chunk_list_map_base_idxes = rdim_bake_string_chunk_list_base_indices_from_map(arena, &bake_string_chunk_list_map_topology, sorted_bake_string_chunk_list_map);
|
||||
RDIM_BakeStringMapFinal bake_strings = rdim_bake_string_map_final_from_chunk_list_map(arena, &bake_string_chunk_list_map_topology, &bake_string_chunk_list_map_base_idxes, sorted_bake_string_chunk_list_map);
|
||||
|
||||
//- rjf: kick off pass 2 tasks
|
||||
P2R_BakeUnitsTopLevelIn bake_units_top_level_in = {strings, path_tree, params};
|
||||
P2R_BakeUnitsTopLevelIn bake_units_top_level_in = {&bake_strings, path_tree, params};
|
||||
TS_Ticket bake_units_top_level_ticket = ts_kickoff(p2r_bake_units_top_level_task__entry_point, 0, &bake_units_top_level_in);
|
||||
P2R_BakeUnitVMapIn bake_unit_vmap_in = {params};
|
||||
TS_Ticket bake_unit_vmap_ticket = ts_kickoff(p2r_bake_unit_vmap_task__entry_point, 0, &bake_unit_vmap_in);
|
||||
P2R_BakeSrcFilesIn bake_src_files_in = {strings, path_tree, params};
|
||||
P2R_BakeSrcFilesIn bake_src_files_in = {&bake_strings, path_tree, params};
|
||||
TS_Ticket bake_src_files_ticket = ts_kickoff(p2r_bake_src_files_task__entry_point, 0, &bake_src_files_in);
|
||||
P2R_BakeUDTsIn bake_udts_in = {strings, params};
|
||||
P2R_BakeUDTsIn bake_udts_in = {&bake_strings, params};
|
||||
TS_Ticket bake_udts_ticket = ts_kickoff(p2r_bake_udts_task__entry_point, 0, &bake_udts_in);
|
||||
P2R_BakeGlobalVariablesIn bake_global_variables_in = {strings, params};
|
||||
P2R_BakeGlobalVariablesIn bake_global_variables_in = {&bake_strings, params};
|
||||
TS_Ticket bake_global_variables_ticket = ts_kickoff(p2r_bake_global_variables_task__entry_point, 0, &bake_global_variables_in);
|
||||
P2R_BakeGlobalVMapIn bake_global_vmap_in = {params};
|
||||
TS_Ticket bake_global_vmap_ticket = ts_kickoff(p2r_bake_global_vmap_task__entry_point, 0, &bake_global_vmap_in);
|
||||
P2R_BakeThreadVariablesIn bake_thread_variables_in = {strings, params};
|
||||
P2R_BakeThreadVariablesIn bake_thread_variables_in = {&bake_strings, params};
|
||||
TS_Ticket bake_thread_variables_ticket = ts_kickoff(p2r_bake_thread_variables_task__entry_point, 0, &bake_thread_variables_in);
|
||||
P2R_BakeProceduresIn bake_procedures_in = {strings, params};
|
||||
P2R_BakeProceduresIn bake_procedures_in = {&bake_strings, params};
|
||||
TS_Ticket bake_procedures_ticket = ts_kickoff(p2r_bake_procedures_task__entry_point, 0, &bake_procedures_in);
|
||||
P2R_BakeScopesIn bake_scopes_in = {strings, params};
|
||||
P2R_BakeScopesIn bake_scopes_in = {&bake_strings, params};
|
||||
TS_Ticket bake_scopes_ticket = ts_kickoff(p2r_bake_scopes_task__entry_point, 0, &bake_scopes_in);
|
||||
P2R_BakeScopeVMapIn bake_scope_vmap_in = {params};
|
||||
TS_Ticket bake_scope_vmap_ticket = ts_kickoff(p2r_bake_scope_vmap_task__entry_point, 0, &bake_scope_vmap_in);
|
||||
P2R_BakeFilePathsIn bake_file_paths_in = {strings, path_tree};
|
||||
P2R_BakeFilePathsIn bake_file_paths_in = {&bake_strings, path_tree};
|
||||
TS_Ticket bake_file_paths_ticket = ts_kickoff(p2r_bake_file_paths_task__entry_point, 0, &bake_file_paths_in);
|
||||
P2R_BakeStringsIn bake_strings_in = {strings};
|
||||
P2R_BakeStringsIn bake_strings_in = {&bake_strings};
|
||||
TS_Ticket bake_strings_ticket = ts_kickoff(p2r_bake_strings_task__entry_point, 0, &bake_strings_in);
|
||||
|
||||
//- rjf: top-level info
|
||||
ProfScope("top level info")
|
||||
{
|
||||
RDIM_BakeSectionList s = rdim_bake_top_level_info_section_list_from_params(arena, strings, params);
|
||||
RDIM_BakeSectionList s = rdim_bake_top_level_info_section_list_from_params(arena, &bake_strings, params);
|
||||
rdim_bake_section_list_concat_in_place(§ions, &s);
|
||||
}
|
||||
|
||||
//- rjf: binary sections
|
||||
ProfScope("binary sections")
|
||||
{
|
||||
RDIM_BakeSectionList s = rdim_bake_binary_section_section_list_from_params(arena, strings, params);
|
||||
RDIM_BakeSectionList s = rdim_bake_binary_section_section_list_from_params(arena, &bake_strings, params);
|
||||
rdim_bake_section_list_concat_in_place(§ions, &s);
|
||||
}
|
||||
|
||||
@@ -3760,7 +3931,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
}
|
||||
|
||||
//- rjf: kick off pass 3 tasks
|
||||
P2R_BakeTypeNodesIn bake_type_nodes_in = {strings, idx_runs, params};
|
||||
P2R_BakeTypeNodesIn bake_type_nodes_in = {&bake_strings, idx_runs, params};
|
||||
TS_Ticket bake_type_nodes_ticket = ts_kickoff(p2r_bake_type_nodes_task__entry_point, 0, &bake_type_nodes_in);
|
||||
TS_TicketList bake_name_maps_tickets = {0};
|
||||
for(RDI_NameMapKind k = (RDI_NameMapKind)(RDI_NameMapKind_NULL+1);
|
||||
@@ -3772,7 +3943,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
continue;
|
||||
}
|
||||
P2R_BakeNameMapIn *in = push_array(scratch.arena, P2R_BakeNameMapIn, 1);
|
||||
in->strings = strings;
|
||||
in->strings = &bake_strings;
|
||||
in->idx_runs = idx_runs;
|
||||
in->params = params;
|
||||
in->kind = k;
|
||||
@@ -3785,7 +3956,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
//- rjf: bake top-level name maps section
|
||||
ProfScope("top level name maps section")
|
||||
{
|
||||
RDIM_BakeSectionList s = rdim_bake_top_level_name_map_section_list_from_params_maps(arena, strings, idx_runs, params, name_maps);
|
||||
RDIM_BakeSectionList s = rdim_bake_top_level_name_map_section_list_from_params_maps(arena, &bake_strings, idx_runs, params, name_maps);
|
||||
rdim_bake_section_list_concat_in_place(§ions, &s);
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ struct P2R_CompUnitContributionsParseIn
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Conversion Data Structure Types
|
||||
//~ rjf: Conversion Data Structure & Task Types
|
||||
|
||||
//- rjf: link name map (voff -> string)
|
||||
|
||||
@@ -243,6 +243,61 @@ struct P2R_SymbolStreamConvertOut
|
||||
////////////////////////////////
|
||||
//~ rjf: Baking Task Types
|
||||
|
||||
//- rjf: string map baking task types
|
||||
|
||||
typedef struct P2R_BakeSrcFilesStringsIn P2R_BakeSrcFilesStringsIn;
|
||||
struct P2R_BakeSrcFilesStringsIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_SrcFileChunkList *list;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeUnitsStringsIn P2R_BakeUnitsStringsIn;
|
||||
struct P2R_BakeUnitsStringsIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_UnitChunkList *list;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeTypesStringsIn P2R_BakeTypesStringsIn;
|
||||
struct P2R_BakeTypesStringsIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_TypeChunkList *list;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeUDTsStringsIn P2R_BakeUDTsStringsIn;
|
||||
struct P2R_BakeUDTsStringsIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_UDTChunkList *list;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeSymbolsStringsIn P2R_BakeSymbolsStringsIn;
|
||||
struct P2R_BakeSymbolsStringsIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_SymbolChunkList *list;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeScopesStringsIn P2R_BakeScopesStringsIn;
|
||||
struct P2R_BakeScopesStringsIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_ScopeChunkList *list;
|
||||
};
|
||||
|
||||
//- rjf: string map sorting task types
|
||||
|
||||
typedef struct P2R_SortBakeStringMapIn P2R_SortBakeStringMapIn;
|
||||
struct P2R_SortBakeStringMapIn
|
||||
{
|
||||
RDIM_BakeStringChunkListMapTopology *top;
|
||||
RDIM_BakeStringChunkListMap *map;
|
||||
};
|
||||
|
||||
//- rjf: OLD string map baking types
|
||||
|
||||
typedef struct P2R_BuildBakeStringMapIn P2R_BuildBakeStringMapIn;
|
||||
struct P2R_BuildBakeStringMapIn
|
||||
{
|
||||
@@ -257,10 +312,12 @@ struct P2R_BuildBakeNameMapIn
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
|
||||
//- rjf: debug info baking task types
|
||||
|
||||
typedef struct P2R_BakeUnitsTopLevelIn P2R_BakeUnitsTopLevelIn;
|
||||
struct P2R_BakeUnitsTopLevelIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakePathTree *path_tree;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
@@ -280,7 +337,7 @@ struct P2R_BakeUnitVMapIn
|
||||
typedef struct P2R_BakeSrcFilesIn P2R_BakeSrcFilesIn;
|
||||
struct P2R_BakeSrcFilesIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakePathTree *path_tree;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
@@ -288,14 +345,14 @@ struct P2R_BakeSrcFilesIn
|
||||
typedef struct P2R_BakeUDTsIn P2R_BakeUDTsIn;
|
||||
struct P2R_BakeUDTsIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeGlobalVariablesIn P2R_BakeGlobalVariablesIn;
|
||||
struct P2R_BakeGlobalVariablesIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
|
||||
@@ -308,21 +365,21 @@ struct P2R_BakeGlobalVMapIn
|
||||
typedef struct P2R_BakeThreadVariablesIn P2R_BakeThreadVariablesIn;
|
||||
struct P2R_BakeThreadVariablesIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeProceduresIn P2R_BakeProceduresIn;
|
||||
struct P2R_BakeProceduresIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeScopesIn P2R_BakeScopesIn;
|
||||
struct P2R_BakeScopesIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
|
||||
@@ -335,20 +392,20 @@ struct P2R_BakeScopeVMapIn
|
||||
typedef struct P2R_BakeFilePathsIn P2R_BakeFilePathsIn;
|
||||
struct P2R_BakeFilePathsIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakePathTree *path_tree;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeStringsIn P2R_BakeStringsIn;
|
||||
struct P2R_BakeStringsIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
};
|
||||
|
||||
typedef struct P2R_BakeTypeNodesIn P2R_BakeTypeNodesIn;
|
||||
struct P2R_BakeTypeNodesIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeIdxRunMap *idx_runs;
|
||||
RDIM_BakeParams *params;
|
||||
};
|
||||
@@ -356,7 +413,7 @@ struct P2R_BakeTypeNodesIn
|
||||
typedef struct P2R_BakeNameMapIn P2R_BakeNameMapIn;
|
||||
struct P2R_BakeNameMapIn
|
||||
{
|
||||
RDIM_BakeStringMap *strings;
|
||||
RDIM_BakeStringMapFinal *strings;
|
||||
RDIM_BakeIdxRunMap *idx_runs;
|
||||
RDIM_BakeParams *params;
|
||||
RDI_NameMapKind kind;
|
||||
@@ -446,6 +503,17 @@ internal P2R_Convert2Bake *p2r_convert(Arena *arena, P2R_User2Convert *in);
|
||||
////////////////////////////////
|
||||
//~ rjf: Baking Stage Tasks
|
||||
|
||||
//- rjf: unsorted bake string map building
|
||||
internal void *p2r_bake_src_files_strings_task__entry_point(Arena *arena, void *p);
|
||||
internal void *p2r_bake_units_strings_task__entry_point(Arena *arena, void *p);
|
||||
internal void *p2r_bake_types_strings_task__entry_point(Arena *arena, void *p);
|
||||
internal void *p2r_bake_udts_strings_task__entry_point(Arena *arena, void *p);
|
||||
internal void *p2r_bake_symbols_strings_task__entry_point(Arena *arena, void *p);
|
||||
internal void *p2r_bake_scopes_strings_task__entry_point(Arena *arena, void *p);
|
||||
|
||||
//- rjf: bake string map sorting
|
||||
internal void *p2r_bake_string_map_sort_task__entry_point(Arena *arena, void *p);
|
||||
|
||||
//- rjf: pass 1: interner/deduper map builds
|
||||
internal void *p2r_build_bake_string_map_task__entry_point(Arena *arena, void *p);
|
||||
internal void *p2r_build_bake_name_map_task__entry_point(Arena *arena, void *p);
|
||||
|
||||
@@ -36,7 +36,7 @@ ts_init(void)
|
||||
ts_shared->artifact_stripes[idx].cv = os_condition_variable_alloc();
|
||||
ts_shared->artifact_stripes[idx].rw_mutex = os_rw_mutex_alloc();
|
||||
}
|
||||
ts_shared->u2t_ring_size = KB(1024);
|
||||
ts_shared->u2t_ring_size = MB(1);
|
||||
ts_shared->u2t_ring_base = push_array_no_zero(arena, U8, ts_shared->u2t_ring_size);
|
||||
ts_shared->u2t_ring_mutex = os_mutex_alloc();
|
||||
ts_shared->u2t_ring_cv = os_condition_variable_alloc();
|
||||
|
||||
Reference in New Issue
Block a user