Actually substitute token array. init_language_core.
Seems like perf improved
This commit is contained in:
@@ -23,7 +23,6 @@ static void core_init_compiler(Core_Ctx *ctx, Allocator *allocator) {
|
||||
ctx->scope_ids = 1;
|
||||
bigint_allocator = ctx->perm;
|
||||
|
||||
ctx->tokens = array_make<Token>(ctx->heap, 4096 * 4);
|
||||
ctx->interns = intern_table_make(ctx->perm, ctx->heap, 2048);
|
||||
|
||||
/*#import meta
|
||||
@@ -281,12 +280,8 @@ resolve_everything_in_module(Ast_Module *module) {
|
||||
pctx->time.typechecking = os_time() - pctx->time.typechecking;
|
||||
}
|
||||
|
||||
CORE_Static String
|
||||
compile_file_to_string(Allocator *allocator, String filename) {
|
||||
F64 total_time = os_time();
|
||||
core_bootstrap_compiler(allocator);
|
||||
pctx->time.total = total_time;
|
||||
pctx->time.start = total_time;
|
||||
CORE_Static void
|
||||
init_language_core() {
|
||||
{
|
||||
Ast_Module *module = add_module(0, pctx->intern("Language.core"_s), false, true);
|
||||
get(&module->all_loaded_files, 0)->filecontent =
|
||||
@@ -412,6 +407,15 @@ GetTypeInfo :: (type: Type): *Type_Info
|
||||
assert(string_decl->type == pctx->type_type);
|
||||
pctx->type_string = string_decl->type_val;
|
||||
}
|
||||
}
|
||||
|
||||
CORE_Static String
|
||||
compile_file_to_string(Allocator *allocator, String filename) {
|
||||
F64 total_time = os_time();
|
||||
core_bootstrap_compiler(allocator);
|
||||
pctx->time.total = total_time;
|
||||
pctx->time.start = total_time;
|
||||
init_language_core();
|
||||
|
||||
Ast_Module *module = add_module(0, pctx->intern(filename), true);
|
||||
parse_all_modules();
|
||||
|
||||
Reference in New Issue
Block a user