Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SHARE_PREFIX ?= $(PREFIX)/share
MAN_PREFIX ?= $(SHARE_PREFIX)/man
CANONICAL := main/
ELIXIRC := bin/elixirc --ignore-module-conflict $(ELIXIRC_OPTS)
ELIXIRC_MIN_SIG := $(ELIXIRC) -e ':elixir_config.put :infer_signatures, []'
ERLC := erlc -I lib/elixir/include
ERL_MAKE := erl -make
ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
Expand Down Expand Up @@ -97,17 +98,17 @@ $(KERNEL): lib/elixir/src/* lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex lib/elixir
"$(MAKE)" unicode; \
fi
@ echo "==> elixir (compile)";
$(Q) cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin;
$(Q) cd lib/elixir && ../../$(ELIXIRC_MIN_SIG) "lib/**/*.ex" -o ebin;

$(APP): lib/elixir/src/elixir.app.src lib/elixir/ebin VERSION $(GENERATE_APP)
$(Q) $(GENERATE_APP) $(VERSION)

unicode: $(UNICODE)
$(UNICODE): lib/elixir/unicode/*
@ echo "==> unicode (compile)";
$(Q) $(ELIXIRC) lib/elixir/unicode/unicode.ex -o lib/elixir/ebin;
$(Q) $(ELIXIRC) lib/elixir/unicode/tokenizer.ex -o lib/elixir/ebin;
$(Q) $(ELIXIRC) lib/elixir/unicode/security.ex -o lib/elixir/ebin;
$(Q) $(ELIXIRC_MIN_SIG) lib/elixir/unicode/unicode.ex -o lib/elixir/ebin;
$(Q) $(ELIXIRC_MIN_SIG) lib/elixir/unicode/tokenizer.ex -o lib/elixir/ebin;
$(Q) $(ELIXIRC_MIN_SIG) lib/elixir/unicode/security.ex -o lib/elixir/ebin;

$(eval $(call APP_TEMPLATE,ex_unit,ExUnit))
$(eval $(call APP_TEMPLATE,logger,Logger))
Expand Down
37 changes: 13 additions & 24 deletions lib/elixir/lib/module/parallel_checker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ defmodule Module.ParallelChecker do
{^ref, :cache} ->
Process.link(pid)

module_tuple =
{mode, module_tuple} =
cond do
is_binary(info) ->
location =
Expand All @@ -86,13 +86,14 @@ defmodule Module.ParallelChecker do
{:ok, module_map} <- backend.debug_info(:elixir_v1, module, data, []) do
cache_from_module_map(table, module_map)
else
_ -> nil
_ -> {:not_found, nil}
end

is_tuple(info) ->
info
end

:ets.insert(table, {module, mode})
send(checker, {ref, :cached})

receive do
Expand Down Expand Up @@ -416,21 +417,22 @@ defmodule Module.ParallelChecker do
true ->
{mode, exports} = info_exports(module)
deprecated = info_deprecated(module)
cache_info(table, module, exports, deprecated, %{}, mode)
cache_info(table, module, exports, deprecated, %{})
mode

false ->
# Or load exports from chunk
with {^module, binary, _filename} <- object_code,
{:ok, {^module, [exports: exports]}} <- :beam_lib.chunks(binary, [:exports]) do
cache_info(table, module, exports, %{}, %{}, :erlang)
cache_info(table, module, exports, %{}, %{})
:erlang
else
_ ->
:ets.insert(table, {module, :not_found})
nil
_ -> :not_found
end
end
end

:ets.insert(table, {module, mode})
unlock(checker, module, mode)
end
end
Expand Down Expand Up @@ -461,26 +463,15 @@ defmodule Module.ParallelChecker do
behaviour_exports(map) ++
for({function, :def, _meta, _clauses} <- map.definitions, do: function)

cache_info(
table,
map.module,
exports,
Map.new(map.deprecated),
map.signatures,
elixir_mode(map.attributes)
)

module_map_to_module_tuple(map)
cache_info(table, map.module, exports, Map.new(map.deprecated), map.signatures)
{elixir_mode(map.attributes), module_map_to_module_tuple(map)}
end

defp cache_info(table, module, exports, deprecated, sigs, mode) do
defp cache_info(table, module, exports, deprecated, sigs) do
Enum.each(exports, fn fa ->
reason = Map.get(deprecated, fa)
:ets.insert(table, {{module, fa}, reason, Map.get(sigs, fa, :none)})
end)

:ets.insert(table, {module, mode})
mode
end

defp cache_chunk(table, module, contents) do
Expand All @@ -497,9 +488,7 @@ defmodule Module.ParallelChecker do
)
end)

mode = Map.get(contents, :mode, :elixir)
:ets.insert(table, {module, mode})
mode
Map.get(contents, :mode, :elixir)
end

defp behaviour_exports(%{defines_behaviour: true}), do: [{:behaviour_info, 1}]
Expand Down
Loading