diff options
author | Björn Gustavsson <[email protected]> | 2012-09-05 12:16:44 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-10-10 15:37:28 +0200 |
commit | 47d109fc4eda1288e8d21a31b603b3cfc300536a (patch) | |
tree | 12c4692c6a4c19147b417cd91925bd26af1a5bd0 /lib/compiler/src/beam_utils.erl | |
parent | 531aa719de264c81876da2db1ca9882f8f5db663 (diff) | |
download | otp-47d109fc4eda1288e8d21a31b603b3cfc300536a.tar.gz otp-47d109fc4eda1288e8d21a31b603b3cfc300536a.tar.bz2 otp-47d109fc4eda1288e8d21a31b603b3cfc300536a.zip |
Represent the 'send' instruction as a call_ext/2 instruction
Somewhat reduce code bloat.
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r-- | lib/compiler/src/beam_utils.erl | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl index 152c242a11..c27e82485d 100644 --- a/lib/compiler/src/beam_utils.erl +++ b/lib/compiler/src/beam_utils.erl @@ -345,15 +345,14 @@ check_liveness(R, [{call,Live,_}|Is], St) -> {x,_} -> {killed,St}; {y,_} -> check_liveness(R, Is, St) end; -check_liveness(R, [{call_ext,Live,Func}|Is], St) -> +check_liveness(R, [{call_ext,Live,_}=I|Is], St) -> case R of {x,X} when X < Live -> {used,St}; {x,_} -> {killed,St}; {y,_} -> - {extfunc,Mod,Name,Arity} = Func, - case erl_bifs:is_exit_bif(Mod, Name, Arity) of + case beam_jump:is_exit_instruction(I) of false -> check_liveness(R, Is, St); true -> @@ -381,12 +380,6 @@ check_liveness(R, [{apply,Args}|Is], St) -> end; check_liveness(R, [{apply_last,Args,_}|_], St) -> check_liveness_live_ret(R, Args+2, St); -check_liveness(R, [send|Is], St) -> - case R of - {x,X} when X < 2 -> {used,St}; - {x,_} -> {killed,St}; - {y,_} -> check_liveness(R, Is, St) - end; check_liveness({x,R}, [{'%live',Live}|Is], St) -> if R < Live -> check_liveness(R, Is, St); @@ -741,8 +734,6 @@ live_opt([{call_ext_only,Arity,_}=I|Is], _, D, Acc) -> live_opt(Is, live_call(Arity), D, [I|Acc]); live_opt([{make_fun2,_,_,_,Arity}=I|Is], _, D, Acc) -> live_opt(Is, live_call(Arity), D, [I|Acc]); -live_opt([send=I|Is], _, D, Acc) -> - live_opt(Is, live_call(2), D, [I|Acc]); live_opt([{test,_,Fail,Ss}=I|Is], Regs0, D, Acc) -> Regs1 = x_live(Ss, Regs0), Regs = live_join_label(Fail, D, Regs1), |