Skip to content

Commit 3b16807

Browse files
author
José Valim
committed
Reduce the amount of data sent between compilation processes
1 parent 2a3a38e commit 3b16807

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/elixir/src/elixir_erl.erl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ consolidate(Map, TypeSpecs, Chunks) ->
128128

129129
%% Dynamic compilation hook, used in regular compiler
130130

131-
compile(#{module := Module} = Map) ->
131+
compile(Map) ->
132+
elixir_erl_compiler:spawn(fun spawned_compile/1, [Map]).
133+
134+
spawned_compile(#{module := Module, line := Line} = Map) ->
132135
{Set, Bag} = elixir_module:data_tables(Module),
133136

134137
TranslatedTypespecs =
@@ -138,13 +141,9 @@ compile(#{module := Module} = Map) ->
138141
false -> ?typespecs:translate_typespecs_for_module(Set, Bag)
139142
end,
140143

141-
elixir_erl_compiler:spawn(fun spawned_compile/4, [Map, Set, Bag, TranslatedTypespecs]).
142-
143-
spawned_compile(Map, Set, _Bag, TranslatedTypespecs) ->
144144
{Prefix, Forms, Def, Defmacro, Macros, NoWarnUndefined} = dynamic_form(Map),
145145
{Types, Callbacks, TypeSpecs} = typespecs_form(Map, TranslatedTypespecs, Macros),
146146

147-
#{module := Module, line := Line} = Map,
148147
DocsChunk = docs_chunk(Set, Module, Line, Def, Defmacro, Types, Callbacks),
149148
CheckerChunk = checker_chunk(Map, NoWarnUndefined),
150149
load_form(Map, Prefix, Forms, TypeSpecs, DocsChunk ++ CheckerChunk).

0 commit comments

Comments
 (0)