diff options
Diffstat (limited to 'lib/hipe')
-rw-r--r-- | lib/hipe/cerl/erl_bif_types.erl | 45 | ||||
-rw-r--r-- | lib/hipe/icode/hipe_beam_to_icode.erl | 2 | ||||
-rw-r--r-- | lib/hipe/regalloc/hipe_node_sets.erl | 2 | ||||
-rw-r--r-- | lib/hipe/rtl/hipe_rtl_lcm.erl | 2 |
4 files changed, 29 insertions, 22 deletions
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 10d60a4c9a..4163f2dae2 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -1203,6 +1203,7 @@ type(erlang, process_flag, 2, Xs) -> case t_atom_vals(Flag) of ['error_handler'] -> t_atom(); ['min_heap_size'] -> t_non_neg_integer(); + ['scheduler'] -> t_non_neg_integer(); ['monitor_nodes'] -> t_boolean(); ['priority'] -> t_process_priority_level(); ['save_calls'] -> t_non_neg_integer(); @@ -1903,7 +1904,7 @@ type(prim_file, internal_native2name, 1, Xs) -> fun (_) -> t_prim_file_name() end); type(prim_file, internal_normalize_utf8, 1, Xs) -> strict(arg_types(prim_file, internal_normalize_utf8, 1), Xs, - fun (_) -> t_binary() end); + fun (_) -> t_unicode_string() end); %%-- gen_tcp ------------------------------------------------------------------ %% NOTE: All type information for this module added to avoid loss of precision type(gen_tcp, accept, 1, Xs) -> @@ -2328,10 +2329,7 @@ type(lists, keyfind, 3, Xs) -> case t_tuple_subtypes(Tuple) of unknown -> Ret; List -> - Keys = [type(erlang, element, 2, [Y, S]) - || S <- List], - Infs = [t_inf(Key, X) || Key <- Keys], - case all_is_none(Infs) of + case key_comparisons_fail(X, Y, List) of true -> t_atom('false'); false -> Ret end @@ -2361,9 +2359,7 @@ type(lists, keymember, 3, Xs) -> case t_tuple_subtypes(Tuple) of unknown -> t_boolean(); List -> - Keys = [type(erlang, element, 2, [Y,S]) || S <- List], - Infs = [t_inf(Key, X) || Key <- Keys], - case all_is_none(Infs) of + case key_comparisons_fail(X, Y, List) of true -> t_atom('false'); false -> t_boolean() end @@ -2393,10 +2389,7 @@ type(lists, keysearch, 3, Xs) -> case t_tuple_subtypes(Tuple) of unknown -> Ret; List -> - Keys = [type(erlang, element, 2, [Y, S]) - || S <- List], - Infs = [t_inf(Key, X) || Key <- Keys], - case all_is_none(Infs) of + case key_comparisons_fail(X, Y, List) of true -> t_atom('false'); false -> Ret end @@ -2824,9 +2817,6 @@ list_replace(1, E, [_X | Xs]) -> any_is_none_or_unit(Ts) -> lists:any(fun erl_types:t_is_none_or_unit/1, Ts). -all_is_none(Ts) -> - lists:all(fun erl_types:t_is_none/1, Ts). - check_guard([X], Test, Type) -> check_guard_single(X, Test, Type). @@ -3221,6 +3211,15 @@ type_order() -> [t_number(), t_atom(), t_reference(), t_fun(), t_port(), t_pid(), t_tuple(), t_list(), t_binary()]. +key_comparisons_fail(X0, KeyPos, TupleList) -> + X = case t_is_number(t_inf(X0, t_number())) of + false -> X0; + true -> t_number() + end, + lists:all(fun(Tuple) -> + Key = type(erlang, element, 2, [KeyPos, Tuple]), + t_is_none(t_inf(Key, X)) + end, TupleList). %%============================================================================= @@ -3747,6 +3746,7 @@ arg_types(erlang, process_display, 2) -> arg_types(erlang, process_flag, 2) -> [t_sup([t_atom('trap_exit'), t_atom('error_handler'), t_atom('min_heap_size'), t_atom('priority'), t_atom('save_calls'), + t_atom('scheduler'), % undocumented t_atom('monitor_nodes'), % undocumented t_tuple([t_atom('monitor_nodes'), t_list()])]), % undocumented t_sup([t_boolean(), t_atom(), t_non_neg_integer()])]; @@ -3785,7 +3785,7 @@ arg_types(erlang, send, 3) -> arg_types(erlang, send_after, 3) -> [t_non_neg_integer(), t_sup(t_pid(), t_atom()), t_any()]; arg_types(erlang, seq_trace, 2) -> - [t_atom(), t_sup([t_boolean(), t_tuple([t_fixnum(), t_fixnum()]), t_nil()])]; + [t_atom(), t_sup([t_boolean(), t_tuple([t_fixnum(), t_fixnum()]), t_fixnum(), t_nil()])]; arg_types(erlang, seq_trace_info, 1) -> [t_seq_trace_info()]; arg_types(erlang, seq_trace_print, 1) -> @@ -4034,7 +4034,7 @@ arg_types(ets, match_object, 3) -> arg_types(ets, match_spec_compile, 1) -> [t_matchspecs()]; arg_types(ets, match_spec_run_r, 3) -> - [t_matchspecs(), t_any(), t_list()]; + [t_list(t_tuple()),t_matchspecs(), t_list()]; arg_types(ets, member, 2) -> [t_tab(), t_any()]; arg_types(ets, new, 2) -> @@ -4066,8 +4066,12 @@ arg_types(ets, select_reverse, 3) -> arg_types(ets, slot, 2) -> [t_tab(), t_non_neg_fixnum()]; % 2nd arg can be 0 arg_types(ets, setopts, 2) -> - Opt = t_sup(t_tuple([t_atom('heir'), t_pid(), t_any()]), - t_tuple([t_atom('heir'), t_atom('none')])), + Opt = t_sup([t_tuple([t_atom('heir'), t_pid(), t_any()]), + t_tuple([t_atom('heir'), t_atom('none')]), + t_tuple([t_atom('protection'), + t_sup([t_atom('protected'), + t_atom('private'), + t_atom('public')])])]), [t_tab(), t_sup(Opt, t_list(Opt))]; arg_types(ets, update_counter, 3) -> Int = t_integer(), @@ -4859,6 +4863,9 @@ t_ets_info_items() -> t_atom('owner'), t_atom('protection'), t_atom('size'), + t_atom('compressed'), + t_atom('heir'), + t_atom('stats'), t_atom('type')]). %% ===================================================================== diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl index d7eb035551..cfed410240 100644 --- a/lib/hipe/icode/hipe_beam_to_icode.erl +++ b/lib/hipe/icode/hipe_beam_to_icode.erl @@ -720,7 +720,7 @@ trans_fun([{test,bs_get_float2,{f,Lbl},[Ms,_Live,Size,Unit,{field_flags,Flags0}, ?EXIT({bad_bs_size_constant,Size}); BitReg -> Bits = mk_var(BitReg), - {{bs_get_float,Unit,Flags}, [Bits,MsVar]} + {{bs_get_float,Unit,Flags}, [MsVar,Bits]} end, trans_op_call({hipe_bs_primop,Name}, Lbl, Args, [Dst,MsVar], Env, Instructions); trans_fun([{test,bs_get_integer2,{f,Lbl},[Ms,_Live,Size,Unit,{field_flags,Flags0},X]}| diff --git a/lib/hipe/regalloc/hipe_node_sets.erl b/lib/hipe/regalloc/hipe_node_sets.erl index b5e2971c4d..0bb21d7506 100644 --- a/lib/hipe/regalloc/hipe_node_sets.erl +++ b/lib/hipe/regalloc/hipe_node_sets.erl @@ -29,7 +29,7 @@ -record(node_sets, {spilled, % Nodes marked for spilling - colored % Nodes succesfully colored + colored % Nodes successfully colored }). spilled(Node_sets) -> Node_sets#node_sets.spilled. diff --git a/lib/hipe/rtl/hipe_rtl_lcm.erl b/lib/hipe/rtl/hipe_rtl_lcm.erl index 5d65389d48..d45ab4ed46 100644 --- a/lib/hipe/rtl/hipe_rtl_lcm.erl +++ b/lib/hipe/rtl/hipe_rtl_lcm.erl @@ -269,7 +269,7 @@ insert_expr_last(CFG0, Label, Instr) -> %% is a branch operation). insert_expr_last_work(_, Instr, []) -> %% This case should not happen since this means that block was completely - %% empty when the function was called. For compability we insert it last. + %% empty when the function was called. For compatibility we insert it last. [Instr]; insert_expr_last_work(_, Instr, [Code1]) -> %% We insert the code next to last. |