diff options
Diffstat (limited to 'src/compiler.c')
-rw-r--r-- | src/compiler.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler.c b/src/compiler.c index 9f003c8..e7b242b 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -510,6 +510,15 @@ int amal_compiler_internal_load_file(amal_compiler *self, const char *filepath, return_if_error(amal_compiler_select_thread_for_work(self, thread_work_data, &parser_thread_data)); if(main_job) { + /*doc(CompilerFlow) + # Compiler flow + (Tokenize&parse -> Resolve AST -> Generate SSA -> Generate bytecode) -> Generate program\ + Each step except the last is done using multiple threads in parallel and the output of each step is used + in the next step. The last step is not done in parallel because the last step is combining all bytecode + and writing it to a file, which is an IO bottlenecked operation and it won't benefit from multithreading + and may even lose performance because of it. + */ + return_if_error(amal_compiler_load_file_join_threads(self)); assert(amal_compiler_check_all_threads_done(self)); amal_log_info("Finished parsing all files, resolving AST"); |