diff options
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r-- | lib/hipe/cerl/Makefile | 3 | ||||
-rw-r--r-- | lib/hipe/cerl/cerl_hipe_primops.hrl | 1 | ||||
-rw-r--r-- | lib/hipe/cerl/cerl_hipeify.erl | 1 | ||||
-rw-r--r-- | lib/hipe/cerl/cerl_messagean.erl | 1 | ||||
-rw-r--r-- | lib/hipe/cerl/cerl_to_icode.erl | 3 | ||||
-rw-r--r-- | lib/hipe/cerl/erl_bif_types.erl | 100 | ||||
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 11 |
7 files changed, 92 insertions, 28 deletions
diff --git a/lib/hipe/cerl/Makefile b/lib/hipe/cerl/Makefile index 7fcc44d27d..d0a0ea1f59 100644 --- a/lib/hipe/cerl/Makefile +++ b/lib/hipe/cerl/Makefile @@ -82,6 +82,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/cerl/cerl_hipe_primops.hrl b/lib/hipe/cerl/cerl_hipe_primops.hrl index 36b1b62901..1d82f7bfc7 100644 --- a/lib/hipe/cerl/cerl_hipe_primops.hrl +++ b/lib/hipe/cerl/cerl_hipe_primops.hrl @@ -59,7 +59,6 @@ -define(PRIMOP_IS_ATOM, 'is_atom'). % arity 1 -define(PRIMOP_IS_BIGNUM, 'is_bignum'). % arity 1 -define(PRIMOP_IS_BINARY, 'is_binary'). % arity 1 --define(PRIMOP_IS_CONSTANT, 'is_constant'). % arity 1 -define(PRIMOP_IS_FIXNUM, 'is_fixnum'). % arity 1 -define(PRIMOP_IS_FLOAT, 'is_float'). % arity 1 -define(PRIMOP_IS_FUNCTION, 'is_function'). % arity 1 diff --git a/lib/hipe/cerl/cerl_hipeify.erl b/lib/hipe/cerl/cerl_hipeify.erl index 8f6c3561c9..89b4ec147d 100644 --- a/lib/hipe/cerl/cerl_hipeify.erl +++ b/lib/hipe/cerl/cerl_hipeify.erl @@ -392,7 +392,6 @@ call_to_primop(erlang, '=<', 2) -> {yes, ?PRIMOP_LE}; call_to_primop(erlang, '>=', 2) -> {yes, ?PRIMOP_GE}; call_to_primop(erlang, is_atom, 1) -> {yes, ?PRIMOP_IS_ATOM}; call_to_primop(erlang, is_binary, 1) -> {yes, ?PRIMOP_IS_BINARY}; -call_to_primop(erlang, is_constant, 1) -> {yes, ?PRIMOP_IS_CONSTANT}; call_to_primop(erlang, is_float, 1) -> {yes, ?PRIMOP_IS_FLOAT}; call_to_primop(erlang, is_function, 1) -> {yes, ?PRIMOP_IS_FUNCTION}; call_to_primop(erlang, is_integer, 1) -> {yes, ?PRIMOP_IS_INTEGER}; diff --git a/lib/hipe/cerl/cerl_messagean.erl b/lib/hipe/cerl/cerl_messagean.erl index 6dd93adaa3..b9f82f2a43 100644 --- a/lib/hipe/cerl/cerl_messagean.erl +++ b/lib/hipe/cerl/cerl_messagean.erl @@ -1083,7 +1083,6 @@ is_imm_op(erlang, is_alive, 0) -> true; is_imm_op(erlang, is_atom, 1) -> true; is_imm_op(erlang, is_binary, 1) -> true; is_imm_op(erlang, is_builtin, 3) -> true; -is_imm_op(erlang, is_constant, 1) -> true; is_imm_op(erlang, is_float, 1) -> true; is_imm_op(erlang, is_function, 1) -> true; is_imm_op(erlang, is_integer, 1) -> true; diff --git a/lib/hipe/cerl/cerl_to_icode.erl b/lib/hipe/cerl/cerl_to_icode.erl index 362c427cbe..089e3f021e 100644 --- a/lib/hipe/cerl/cerl_to_icode.erl +++ b/lib/hipe/cerl/cerl_to_icode.erl @@ -88,7 +88,6 @@ -define(TYPE_IS_ATOM, atom). -define(TYPE_IS_BIGNUM, bignum). -define(TYPE_IS_BINARY, binary). --define(TYPE_IS_CONSTANT, constant). -define(TYPE_IS_FIXNUM, fixnum). -define(TYPE_IS_FLOAT, float). -define(TYPE_IS_FUNCTION, function). @@ -2051,7 +2050,6 @@ is_record_test(T, A, N, True, False, Ctxt, Env, S) -> type_test(?PRIMOP_IS_ATOM) -> ?TYPE_IS_ATOM; type_test(?PRIMOP_IS_BIGNUM) -> ?TYPE_IS_BIGNUM; type_test(?PRIMOP_IS_BINARY) -> ?TYPE_IS_BINARY; -type_test(?PRIMOP_IS_CONSTANT) -> ?TYPE_IS_CONSTANT; type_test(?PRIMOP_IS_FIXNUM) -> ?TYPE_IS_FIXNUM; type_test(?PRIMOP_IS_FLOAT) -> ?TYPE_IS_FLOAT; type_test(?PRIMOP_IS_FUNCTION) -> ?TYPE_IS_FUNCTION; @@ -2082,7 +2080,6 @@ is_bool_op(Op, A) when is_atom(Op), is_integer(A) -> false. is_type_test(?PRIMOP_IS_ATOM, 1) -> true; is_type_test(?PRIMOP_IS_BIGNUM, 1) -> true; is_type_test(?PRIMOP_IS_BINARY, 1) -> true; -is_type_test(?PRIMOP_IS_CONSTANT, 1) -> true; is_type_test(?PRIMOP_IS_FIXNUM, 1) -> true; is_type_test(?PRIMOP_IS_FLOAT, 1) -> true; is_type_test(?PRIMOP_IS_FUNCTION, 1) -> true; diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index cee399e861..0c2e846010 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2011. All Rights Reserved. +%% Copyright Ericsson AB 2003-2012. 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 @@ -54,7 +54,6 @@ t_cons/2, t_cons_hd/1, t_cons_tl/1, - t_constant/0, t_fixnum/0, t_non_neg_fixnum/0, t_pos_fixnum/0, @@ -81,7 +80,6 @@ t_is_bitstr/1, t_is_boolean/1, t_is_cons/1, - t_is_constant/1, t_is_float/1, t_is_float/1, t_is_fun/1, @@ -243,6 +241,7 @@ type(erl_ddll, try_unload, 2, Xs) -> %%-- erlang ------------------------------------------------------------------- type(erlang, halt, 0, _) -> t_none(); type(erlang, halt, 1, _) -> t_none(); +type(erlang, halt, 2, _) -> t_none(); type(erlang, exit, 1, _) -> t_none(); %% Note that exit/2 sends an exit signal to another process. type(erlang, exit, 2, _) -> t_atom('true'); @@ -711,6 +710,27 @@ type(erlang, display_nl, 0, _) -> t_atom('true'); type(erlang, dist_exit, 3, Xs) -> strict(arg_types(erlang, dist_exit, 3), Xs, fun (_) -> t_atom('true') end); +type(erlang, dt_append_vm_tag_data, 1, Xs) -> + strict(arg_types(erlang, dt_append_vm_tag_data, 1), + Xs, + fun(_) -> t_iodata() end); +type(erlang, dt_get_tag, 0, _) -> + t_sup(t_binary(), t_atom('undefined')); +type(erlang, dt_get_tag_data, 0, _) -> + t_sup(t_binary(), t_atom('undefined')); +type(erlang, dt_prepend_vm_tag_data, 1, Xs) -> + strict(arg_types(erlang, dt_prepend_vm_tag_data, 1), + Xs, + fun(_) -> t_iodata() end); +type(erlang, dt_put_tag, 1, Xs) -> + strict(arg_types(erlang, dt_put_tag, 1), Xs, + fun(_) -> t_sup(t_binary(), t_atom('undefined')) end); +type(erlang, dt_restore_tag, 1, Xs) -> + strict(arg_types(erlang, dt_restore_tag, 1), Xs, fun(_) -> t_atom('true') end); +type(erlang, dt_spread_tag, 1, Xs) -> + strict(arg_types(erlang, dt_spread_tag, 1), Xs, + fun(_) -> t_sup(t_tuple([t_non_neg_integer(), t_sup(t_binary(), t_nil())]), + t_atom('true')) end); type(erlang, element, 2, Xs) -> strict(arg_types(erlang, element, 2), Xs, fun ([X1, X2]) -> @@ -845,11 +865,6 @@ type(erlang, is_boolean, 1, Xs) -> strict(arg_types(erlang, is_boolean, 1), Xs, Fun); type(erlang, is_builtin, 3, Xs) -> strict(arg_types(erlang, is_builtin, 3), Xs, fun (_) -> t_boolean() end); -type(erlang, is_constant, 1, Xs) -> - Fun = fun (X) -> - check_guard(X, fun (Y) -> t_is_constant(Y) end, t_constant()) - end, - strict(arg_types(erlang, is_constant, 1), Xs, Fun); type(erlang, is_float, 1, Xs) -> Fun = fun (X) -> check_guard(X, fun (Y) -> t_is_float(Y) end, t_float()) @@ -1202,11 +1217,13 @@ type(erlang, process_flag, 2, Xs) -> case t_atom_vals(Flag) of ['error_handler'] -> t_atom(); ['min_heap_size'] -> t_non_neg_integer(); + ['min_bin_vheap_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(); ['trap_exit'] -> t_boolean(); + ['sensitive'] -> t_boolean(); List when is_list(List) -> T_process_flag_returns; unknown -> @@ -1503,6 +1520,8 @@ type(erlang, system_flag, 2, Xs) -> t_non_neg_fixnum(); ['min_heap_size'] -> t_non_neg_fixnum(); + ['min_bin_vheap_size'] -> + t_non_neg_fixnum(); ['multi_scheduling'] -> t_system_multi_scheduling(); ['schedulers_online'] -> @@ -1546,8 +1565,12 @@ type(erlang, system_info, 1, Xs) -> t_list(t_tuple([t_atom(), t_list(t_tuple([t_atom(), t_any()]))]))]); + ['build_type'] -> + t_system_build_type_return(); ['break_ignored'] -> t_boolean(); + ['c_compiler_used'] -> + t_tuple([t_atom(), t_any()]); ['cpu_topology'] -> t_system_cpu_topology(); ['compat_rel'] -> @@ -1560,6 +1583,8 @@ type(erlang, system_info, 1, Xs) -> t_binary(); ['dist_ctrl'] -> t_list(t_tuple([t_atom(), t_sup([t_pid(), t_port])])); + ['driver_version'] -> + t_string(); %% elib_malloc is intentionally not included, %% because it scheduled for removal in R15. ['endian'] -> @@ -1573,7 +1598,9 @@ type(erlang, system_info, 1, Xs) -> ['heap_sizes'] -> t_list(t_integer()); ['heap_type'] -> - t_sup([t_atom('private'), t_atom('hybrid')]); + t_sup([t_atom('private'), + t_atom('shared'), + t_atom('hybrid')]); ['hipe_architecture'] -> t_atoms(['amd64', 'arm', 'powerpc', 'ppc64', 'undefined', 'ultrasparc', 'x86']); @@ -1581,12 +1608,20 @@ type(erlang, system_info, 1, Xs) -> t_binary(); ['internal_cpu_topology'] -> %% Undocumented internal feature t_internal_cpu_topology(); + ['kernel_poll'] -> + t_boolean(); ['loaded'] -> t_binary(); ['logical_processors'] -> t_non_neg_fixnum(); ['machine'] -> t_string(); + ['min_heap_size'] -> + t_tuple([t_atom('min_heap_size'), + t_non_neg_integer()]); + ['min_bin_vheap_size'] -> + t_tuple([t_atom('min_bin_vheap_size'), + t_non_neg_integer()]); ['multi_scheduling'] -> t_system_multi_scheduling(); ['multi_scheduling_blockers'] -> @@ -1601,6 +1636,8 @@ type(erlang, system_info, 1, Xs) -> t_non_neg_fixnum(), t_non_neg_fixnum()]), t_string()); + ['otp_release'] -> + t_string(); ['process_count'] -> t_non_neg_fixnum(); ['process_limit'] -> @@ -1630,6 +1667,8 @@ type(erlang, system_info, 1, Xs) -> t_non_neg_fixnum(); ['trace_control_word'] -> t_integer(); + ['update_cpu_info'] -> + t_sup([t_atom('changed'), t_atom('unchanged')]); ['version'] -> t_string(); ['wordsize'] -> @@ -3477,6 +3516,20 @@ arg_types(erlang, display_string, 1) -> [t_string()]; arg_types(erlang, dist_exit, 3) -> [t_pid(), t_dist_exit(), t_sup(t_pid(), t_port())]; +arg_types(erlang, dt_append_vm_tag_data, 1) -> + [t_iodata()]; +arg_types(erlang, dt_get_tag, 0) -> + []; +arg_types(erlang, dt_get_tag_data, 0) -> + []; +arg_types(erlang, dt_prepend_vm_tag_data, 1) -> + [t_iodata()]; +arg_types(erlang, dt_put_tag, 1) -> + [t_sup(t_binary(), t_atom('undefined'))]; +arg_types(erlang, dt_restore_tag, 1) -> + [t_sup(t_tuple([t_non_neg_integer(), t_sup(t_binary(), t_nil())]), t_atom('true'))]; +arg_types(erlang, dt_spread_tag, 1) -> + [t_boolean()]; arg_types(erlang, element, 2) -> [t_pos_fixnum(), t_tuple()]; arg_types(erlang, erase, 0) -> @@ -3536,7 +3589,10 @@ arg_types(erlang, group_leader, 2) -> arg_types(erlang, halt, 0) -> []; arg_types(erlang, halt, 1) -> - [t_sup(t_non_neg_fixnum(), t_string())]; + [t_sup([t_non_neg_fixnum(), t_atom('abort'), t_string()])]; +arg_types(erlang, halt, 2) -> + [t_sup([t_non_neg_fixnum(), t_atom('abort'), t_string()]), + t_list(t_tuple([t_atom('flush'), t_boolean()]))]; arg_types(erlang, hash, 2) -> [t_any(), t_integer()]; arg_types(erlang, hd, 1) -> @@ -3567,8 +3623,6 @@ arg_types(erlang, is_boolean, 1) -> [t_any()]; arg_types(erlang, is_builtin, 3) -> [t_atom(), t_atom(), t_arity()]; -arg_types(erlang, is_constant, 1) -> - [t_any()]; arg_types(erlang, is_float, 1) -> [t_any()]; arg_types(erlang, is_function, 1) -> @@ -3747,8 +3801,13 @@ arg_types(erlang, pre_loaded, 0) -> arg_types(erlang, process_display, 2) -> [t_pid(), t_atom('backtrace')]; 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_sup([t_atom('trap_exit'), + t_atom('error_handler'), + t_atom('min_heap_size'), + t_atom('min_bin_vheap_size'), + t_atom('priority'), + t_atom('save_calls'), + t_atom('sensitive'), t_atom('scheduler'), % undocumented t_atom('monitor_nodes'), % undocumented t_tuple([t_atom('monitor_nodes'), t_list()])]), % undocumented @@ -3861,6 +3920,7 @@ arg_types(erlang, system_flag, 2) -> t_atom('display_items'), % undocumented t_atom('fullsweep_after'), t_atom('min_heap_size'), + t_atom('min_bin_vheap_size'), t_atom('multi_scheduling'), t_atom('schedulers_online'), t_atom('scheduler_bind_type'), @@ -4733,6 +4793,7 @@ t_spawn_options() -> t_atom('monitor'), t_tuple([t_atom('priority'), t_process_priority_level()]), t_tuple([t_atom('min_heap_size'), t_fixnum()]), + t_tuple([t_atom('min_bin_vheap_size'), t_fixnum()]), t_tuple([t_atom('fullsweep_after'), t_fixnum()])]). t_spawn_opt_return(List) -> @@ -4821,6 +4882,17 @@ t_system_profile_return() -> t_sup(t_atom('undefined'), t_tuple([t_sup(t_pid(), t_port()), t_system_profile_options()])). +t_system_build_type_return() -> + t_sup([t_atom('opt'), + t_atom('debug'), + t_atom('purify'), + t_atom('quantify'), + t_atom('purecov'), + t_atom('gcov'), + t_atom('valgrind'), + t_atom('gprof'), + t_atom('lcnt')]). + %% ===================================================================== %% These are used for the built-in functions of 'ets' %% ===================================================================== diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 620fed365e..65b9a057de 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -424,12 +424,7 @@ t_has_opaque_subtype(T) -> -spec t_opaque_structure(erl_type()) -> erl_type(). t_opaque_structure(?opaque(Elements)) -> - case ordsets:size(Elements) of - 1 -> - [#opaque{struct = Struct}] = ordsets:to_list(Elements), - Struct; - _ -> throw({error, "Unexpected multiple opaque types"}) - end. + t_sup([Struct || #opaque{struct = Struct} <- ordsets:to_list(Elements)]). -spec t_opaque_module(erl_type()) -> module(). @@ -688,9 +683,9 @@ t_solve_remote(?opaque(Set), ET, R, C) -> {NewList, RR} = opaques_solve_remote(List, ET, R, C), {?opaque(ordsets:from_list(NewList)), RR}; t_solve_remote(?tuple(?any, _, _) = T, _ET, _R, _C) -> {T, []}; -t_solve_remote(?tuple(Types, Arity, Tag), ET, R, C) -> +t_solve_remote(?tuple(Types, _Arity, _Tag), ET, R, C) -> {RL, RR} = list_solve_remote(Types, ET, R, C), - {?tuple(RL, Arity, Tag), RR}; + {t_tuple(RL), RR}; t_solve_remote(?tuple_set(Set), ET, R, C) -> {NewSet, RR} = tuples_solve_remote(Set, ET, R, C), {?tuple_set(NewSet), RR}; |