diff options
author | Björn Gustavsson <[email protected]> | 2012-06-25 15:37:43 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-06-25 15:37:43 +0200 |
commit | 2af66d1761c54e0bc2811a2ad2950f62d9ceccdc (patch) | |
tree | 8462176f1ed1ea898cd9a6681c855aea7046e7d6 | |
parent | b81fcd916e10ca10f3e65c02f005bfe770275dce (diff) | |
parent | 5a12a0605b06a4971f7005b26f6591de9c69837d (diff) | |
download | otp-2af66d1761c54e0bc2811a2ad2950f62d9ceccdc.tar.gz otp-2af66d1761c54e0bc2811a2ad2950f62d9ceccdc.tar.bz2 otp-2af66d1761c54e0bc2811a2ad2950f62d9ceccdc.zip |
Merge branch 'maint'
* maint:
Update primary bootstrap
sys_pre_expand: Eliminate bottleneck for modules with many functions
Conflicts:
bootstrap/bin/start.boot
bootstrap/bin/start_clean.boot
bootstrap/lib/kernel/ebin/file.beam
bootstrap/lib/kernel/ebin/hipe_unified_loader.beam
17 files changed, 360 insertions, 9 deletions
diff --git a/bootstrap/bin/start.boot b/bootstrap/bin/start.boot Binary files differindex 6d62af557e..c6ebc852a2 100644 --- a/bootstrap/bin/start.boot +++ b/bootstrap/bin/start.boot diff --git a/bootstrap/bin/start_clean.boot b/bootstrap/bin/start_clean.boot Binary files differindex 6d62af557e..c6ebc852a2 100644 --- a/bootstrap/bin/start_clean.boot +++ b/bootstrap/bin/start_clean.boot diff --git a/bootstrap/lib/compiler/ebin/beam_asm.beam b/bootstrap/lib/compiler/ebin/beam_asm.beam Binary files differindex 4da4c26d92..7b1ee38ef8 100644 --- a/bootstrap/lib/compiler/ebin/beam_asm.beam +++ b/bootstrap/lib/compiler/ebin/beam_asm.beam diff --git a/bootstrap/lib/compiler/ebin/compiler.app b/bootstrap/lib/compiler/ebin/compiler.app new file mode 100644 index 0000000000..5170231c59 --- /dev/null +++ b/bootstrap/lib/compiler/ebin/compiler.app @@ -0,0 +1,69 @@ +% This is an -*- erlang -*- file. +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% + +{application, compiler, + [{description, "ERTS CXC 138 10"}, + {vsn, "4.8.1"}, + {modules, [ + beam_asm, + beam_block, + beam_bool, + beam_bsm, + beam_clean, + beam_dead, + beam_dict, + beam_disasm, + beam_except, + beam_flatten, + beam_jump, + beam_listing, + beam_opcodes, + beam_peep, + beam_receive, + beam_split, + beam_trim, + beam_type, + beam_utils, + beam_validator, + cerl, + cerl_clauses, + cerl_inline, + cerl_trees, + compile, + core_scan, + core_lint, + core_parse, + core_pp, + core_lib, + erl_bifs, + rec_env, + sys_core_dsetel, + sys_core_fold, + sys_core_inline, + sys_expand_pmod, + sys_pre_attributes, + sys_pre_expand, + v3_codegen, + v3_core, + v3_kernel, + v3_kernel_pp, + v3_life + ]}, + {registered, []}, + {applications, [kernel, stdlib]}, + {env, []}]}. diff --git a/bootstrap/lib/compiler/ebin/compiler.appup b/bootstrap/lib/compiler/ebin/compiler.appup new file mode 100644 index 0000000000..887d074b16 --- /dev/null +++ b/bootstrap/lib/compiler/ebin/compiler.appup @@ -0,0 +1 @@ +{"4.8.1",[],[]}. diff --git a/bootstrap/lib/compiler/ebin/sys_pre_expand.beam b/bootstrap/lib/compiler/ebin/sys_pre_expand.beam Binary files differindex d716583b97..f7e9541e4c 100644 --- a/bootstrap/lib/compiler/ebin/sys_pre_expand.beam +++ b/bootstrap/lib/compiler/ebin/sys_pre_expand.beam diff --git a/bootstrap/lib/kernel/ebin/file.beam b/bootstrap/lib/kernel/ebin/file.beam Binary files differindex 00725935d8..243be75c43 100644 --- a/bootstrap/lib/kernel/ebin/file.beam +++ b/bootstrap/lib/kernel/ebin/file.beam diff --git a/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam b/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam Binary files differindex fb71997f32..1574686ba6 100644 --- a/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam +++ b/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam diff --git a/bootstrap/lib/kernel/ebin/inet.beam b/bootstrap/lib/kernel/ebin/inet.beam Binary files differindex e47766329b..ddb1f2a24b 100644 --- a/bootstrap/lib/kernel/ebin/inet.beam +++ b/bootstrap/lib/kernel/ebin/inet.beam diff --git a/bootstrap/lib/kernel/ebin/kernel.app b/bootstrap/lib/kernel/ebin/kernel.app new file mode 100644 index 0000000000..48f6250828 --- /dev/null +++ b/bootstrap/lib/kernel/ebin/kernel.app @@ -0,0 +1,120 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% This is an -*- erlang -*- file. +%% +{application, kernel, + [ + {description, "ERTS CXC 138 10"}, + {vsn, "2.16"}, + {modules, [application, + application_controller, + application_master, + application_starter, + auth, + code, + packages, + code_server, + dist_util, + erl_boot_server, + erl_distribution, + erl_reply, + error_handler, + error_logger, + file, + file_server, + file_io_server, + global, + global_group, + global_search, + group, + heart, + hipe_unified_loader, + inet6_tcp, + inet6_tcp_dist, + inet6_udp, + inet6_sctp, + inet_config, + inet_hosts, + inet_gethost_native, + inet_tcp_dist, + kernel, + kernel_config, + net, + net_adm, + net_kernel, + os, + ram_file, + rpc, + user, + user_drv, + user_sup, + disk_log, + disk_log_1, + disk_log_server, + disk_log_sup, + dist_ac, + erl_ddll, + erl_epmd, + erts_debug, + gen_tcp, + gen_udp, + gen_sctp, + inet, + inet_db, + inet_dns, + inet_parse, + inet_res, + inet_tcp, + inet_udp, + inet_sctp, + pg2, + seq_trace, + standard_error, + wrap_log_reader]}, + {registered, [application_controller, + erl_reply, + auth, + boot_server, + code_server, + disk_log_server, + disk_log_sup, + erl_prim_loader, + error_logger, + file_server_2, + fixtable_server, + global_group, + global_name_server, + heart, + init, + kernel_config, + kernel_sup, + net_kernel, + net_sup, + rex, + user, + os_server, + ddll_server, + erl_epmd, + inet_db, + pg2]}, + {applications, []}, + {env, [{error_logger, tty}]}, + {mod, {kernel, []}} + ] +}. diff --git a/bootstrap/lib/kernel/ebin/kernel.appup b/bootstrap/lib/kernel/ebin/kernel.appup new file mode 100644 index 0000000000..b534b736be --- /dev/null +++ b/bootstrap/lib/kernel/ebin/kernel.appup @@ -0,0 +1,27 @@ +%% -*- erlang -*- +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +{"2.16", + %% Up from - max two major revisions back + [{<<"2\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16 + {<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15 + {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R14 + %% Down to - max two major revisions back + [{<<"2\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16 + {<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15 + {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R14 +}. diff --git a/bootstrap/lib/stdlib/ebin/filelib.beam b/bootstrap/lib/stdlib/ebin/filelib.beam Binary files differindex 5d8a6f7b07..20f48fe18e 100644 --- a/bootstrap/lib/stdlib/ebin/filelib.beam +++ b/bootstrap/lib/stdlib/ebin/filelib.beam diff --git a/bootstrap/lib/stdlib/ebin/lib.beam b/bootstrap/lib/stdlib/ebin/lib.beam Binary files differindex 4b67bbb774..3865cfb227 100644 --- a/bootstrap/lib/stdlib/ebin/lib.beam +++ b/bootstrap/lib/stdlib/ebin/lib.beam diff --git a/bootstrap/lib/stdlib/ebin/otp_internal.beam b/bootstrap/lib/stdlib/ebin/otp_internal.beam Binary files differindex 1a9a55dc24..270d35ef33 100644 --- a/bootstrap/lib/stdlib/ebin/otp_internal.beam +++ b/bootstrap/lib/stdlib/ebin/otp_internal.beam diff --git a/bootstrap/lib/stdlib/ebin/stdlib.app b/bootstrap/lib/stdlib/ebin/stdlib.app new file mode 100644 index 0000000000..461531e1df --- /dev/null +++ b/bootstrap/lib/stdlib/ebin/stdlib.app @@ -0,0 +1,105 @@ +%% This is an -*- erlang -*- file. +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +{application, stdlib, + [{description, "ERTS CXC 138 10"}, + {vsn, "1.19"}, + {modules, [array, + base64, + beam_lib, + binary, + c, + calendar, + dets, + dets_server, + dets_sup, + dets_utils, + dets_v8, + dets_v9, + dict, + digraph, + digraph_utils, + edlin, + edlin_expand, + epp, + eval_bits, + erl_bits, + erl_compile, + erl_eval, + erl_expand_records, + erl_internal, + erl_lint, + erl_parse, + erl_posix_msg, + erl_pp, + erl_scan, + erl_tar, + error_logger_file_h, + error_logger_tty_h, + escript, + ets, + file_sorter, + filelib, + filename, + gb_trees, + gb_sets, + gen, + gen_event, + gen_fsm, + gen_server, + io, + io_lib, + io_lib_format, + io_lib_fread, + io_lib_pretty, + lib, + lists, + log_mf_h, + math, + ms_transform, + orddict, + ordsets, + otp_internal, + pg, + pool, + proc_lib, + proplists, + qlc, + qlc_pt, + queue, + random, + re, + sets, + shell, + shell_default, + slave, + sofs, + string, + supervisor, + supervisor_bridge, + sys, + timer, + unicode, + win32reg, + zip]}, + {registered,[timer_server,rsh_starter,take_over_monitor,pool_master, + dets]}, + {applications, [kernel]}, + {env, []}]}. + diff --git a/bootstrap/lib/stdlib/ebin/stdlib.appup b/bootstrap/lib/stdlib/ebin/stdlib.appup new file mode 100644 index 0000000000..ff9b5387c9 --- /dev/null +++ b/bootstrap/lib/stdlib/ebin/stdlib.appup @@ -0,0 +1,27 @@ +%% -*- erlang -*- +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +{"1.19", + %% Up from - max two major revisions back + [{<<"1\\.19(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16 + {<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15 + {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R14 + %% Down to - max two major revisions back + [{<<"1\\.19(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16 + {<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15 + {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R14 +}. diff --git a/lib/compiler/src/sys_pre_expand.erl b/lib/compiler/src/sys_pre_expand.erl index ba9cde1de0..68bc83433e 100644 --- a/lib/compiler/src/sys_pre_expand.erl +++ b/lib/compiler/src/sys_pre_expand.erl @@ -42,7 +42,7 @@ compile=[], %Compile flags attributes=[], %Attributes callbacks=[], %Callbacks - defined=[], %Defined functions + defined, %Defined functions (gb_set) vcount=0, %Variable counter func=[], %Current function arity=[], %Arity for current function @@ -83,7 +83,7 @@ module(Fs0, Opts0) -> {Efs,St2} = expand_pmod(Tfs, St1), %% Get the correct list of exported functions. Exports = case member(export_all, St2#expand.compile) of - true -> St2#expand.defined; + true -> gb_sets:to_list(St2#expand.defined); false -> St2#expand.exports end, %% Generate all functions from stored info. @@ -106,10 +106,11 @@ expand_pmod(Fs0, St0) -> true -> Ps0 end, + Def = gb_sets:to_list(St0#expand.defined), {Fs1,Xs,Ds} = sys_expand_pmod:forms(Fs0, Ps, St0#expand.exports, - St0#expand.defined), - St1 = St0#expand{exports=Xs, defined=Ds}, + Def), + St1 = St0#expand{exports=Xs,defined=gb_sets:from_list(Ds)}, {Fs2,St2} = add_instance(Ps, Fs1, St1), {Fs3,St3} = ensure_new(Base, Ps0, Fs2, St2), {Fs3,St3#expand{attributes = [{abstract, 0, [true]} @@ -159,7 +160,7 @@ add_func(Name, Args, Body, Fs, St) -> F = {function,0,Name,A,[{clause,0,Args,[],Body}]}, NA = {Name,A}, {[F|Fs],St#expand{exports=add_element(NA, St#expand.exports), - defined=add_element(NA, St#expand.defined)}}. + defined=gb_sets:add_element(NA, St#expand.defined)}}. %% define_function(Form, State) -> State. %% Add function to defined if form is a function. @@ -168,7 +169,7 @@ define_functions(Forms, #expand{defined=Predef}=St) -> Fs = foldl(fun({function,_,N,A,_Cs}, Acc) -> [{N,A}|Acc]; (_, Acc) -> Acc end, Predef, Forms), - St#expand{defined=ordsets:from_list(Fs)}. + St#expand{defined=gb_sets:from_list(Fs)}. module_attrs(#expand{attributes=Attributes}=St) -> Attrs = [{attribute,Line,Name,Val} || {Name,Line,Val} <- Attributes], @@ -187,7 +188,7 @@ module_predef_func_beh_info(#expand{callbacks=Callbacks,defined=Defined, PreDef=[{behaviour_info,1}], PreExp=PreDef, {[gen_beh_info(Callbacks)], - St#expand{defined=union(from_list(PreDef), Defined), + St#expand{defined=gb_sets:union(gb_sets:from_list(PreDef), Defined), exports=union(from_list(PreExp), Exports)}}. gen_beh_info(Callbacks) -> @@ -215,7 +216,8 @@ module_predef_funcs_mod_info(St) -> [{clause,0,[{var,0,'X'}],[], [{call,0,{remote,0,{atom,0,erlang},{atom,0,get_module_info}}, [{atom,0,St#expand.module},{var,0,'X'}]}]}]}], - St#expand{defined=union(from_list(PreDef), St#expand.defined), + St#expand{defined=gb_sets:union(gb_sets:from_list(PreDef), + St#expand.defined), exports=union(from_list(PreExp), St#expand.exports)}}. %% forms(Forms, State) -> @@ -721,4 +723,4 @@ imported(F, A, St) -> end. defined(F, A, St) -> - ordsets:is_element({F,A}, St#expand.defined). + gb_sets:is_element({F,A}, St#expand.defined). |