From: Jean Privat Date: Mon, 16 Mar 2020 18:31:54 +0000 (-0400) Subject: Merge: separate_compiler: Refactored class compilation X-Git-Url: http://nitlanguage.org Merge: separate_compiler: Refactored class compilation ## Before Before this update, the method `compile_class_to_c` handled every part of the class compilation process even special case (universal class). By doing so, we can't refined this method efficiently without reimplementing the entire method. This is a pain since each time we need to add universal class we have to modify the original code instead of refining the compiler. ## After The method `compile_class_to_c` has been divided in three main parts: 1. the class's vft compilation (same for every type of class) 2. the compilation of universal class specifics (change alot through time). This part must managed every part of a universal type, except its vft compilation which already handled by the 1st step. 3. the compilation of the default `NEW` allocator (apply only for non-universal type). Moreover, the state of a class compilation is stored in a new class called `ClassCompilationInfo`, which has different flag to specify if the class is dead/alive or need_corpse. This choice was made to prevent dataclump in each method involved with the class compilation. With this new way of managing class compilation, we can add new universal class via refinement instead of code rewriting. Signed-off-by: Louis-Vincent Boudreault Pull-Request: #2808 Reviewed-by: Jean Privat --- a4a01bce6c4ba9719f03fd41a977662554403dc2