~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/compiler/src/beam_disasm.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%=======================================================================
19
19
%% Notes:
621
621
 
622
622
%%
623
623
%% New make_fun2/4 instruction added in August 2001 (R8).
624
 
%% New put_literal/2 instruction added in Feb 2006 R11B-4.
625
 
%% We handle them specially here to avoid adding an argument to
 
624
%% We handle it specially here to avoid adding an argument to
626
625
%% the clause for every instruction.
627
626
%%
628
627
 
631
630
    {OldIndex,{F,A,_Lbl,_Index,NumFree,OldUniq}} =
632
631
        lists:keyfind(OldIndex, 1, Lambdas),
633
632
    {make_fun2,{M,F,A},OldIndex,OldUniq,NumFree};
634
 
resolve_inst({put_literal,[{u,Index},Dst]},_,_,_,_,Literals,_) ->
635
 
    {put_literal,{literal,gb_trees:get(Index, Literals)},Dst};
636
633
resolve_inst(Instr, Imports, Str, Lbls, _Lambdas, _Literals, _M) ->
637
634
    %% io:format(?MODULE_STRING":resolve_inst ~p.~n", [Instr]),
638
635
    resolve_inst(Instr, Imports, Str, Lbls).
1004
1001
    [F,Live,Bif,A1,A2,Reg] = resolve_args(Args),
1005
1002
    {extfunc,_Mod,BifName,_Arity} = lookup(Bif+1,Imports),
1006
1003
    {gc_bif,BifName,F,Live,[A1,A2],Reg};
 
1004
%%
 
1005
%% New instruction in R14, gc_bif with 3 arguments
 
1006
%%
 
1007
resolve_inst({gc_bif3,Args},Imports,_,_) ->
 
1008
    [F,Live,Bif,A1,A2,A3,Reg] = resolve_args(Args),
 
1009
    {extfunc,_Mod,BifName,_Arity} = lookup(Bif+1,Imports),
 
1010
    {gc_bif,BifName,F,Live,[A1,A2,A3],Reg};
1007
1011
 
1008
1012
%%
1009
1013
%% New instructions for creating non-byte aligned binaries.
1010
1014
%%
1011
 
resolve_inst({bs_bits_to_bytes2,[_Arg2,_Arg3]=Args},_,_,_) ->
1012
 
    [A2,A3] = resolve_args(Args),
1013
 
    {bs_bits_to_bytes2,A2,A3};
1014
1015
resolve_inst({bs_final2,[X,Y]},_,_,_) ->
1015
1016
    {bs_final2,X,Y};
1016
1017
 
1096
1097
    on_load;
1097
1098
 
1098
1099
%%
 
1100
%% R14A.
 
1101
%%
 
1102
resolve_inst({recv_mark,[Lbl]},_,_,_) ->
 
1103
    {recv_mark,Lbl};
 
1104
resolve_inst({recv_set,[Lbl]},_,_,_) ->
 
1105
    {recv_set,Lbl};
 
1106
 
 
1107
%%
1099
1108
%% Catches instructions that are not yet handled.
1100
1109
%%
1101
1110
resolve_inst(X,_,_,_) -> ?exit({resolve_inst,X}).