aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-12-14 12:55:13 +0100
committerBjörn Gustavsson <[email protected]>2017-01-12 12:10:10 +0100
commit04e7370eabd3e36345c032139ab185ea64f169ac (patch)
tree3c74cc1dd2cdda8ad812b78fea8e31b77d52be2b /lib/compiler/src
parenta8477127f917e7d660697089e2c8d8a1cd08aae9 (diff)
downloadotp-04e7370eabd3e36345c032139ab185ea64f169ac.tar.gz
otp-04e7370eabd3e36345c032139ab185ea64f169ac.tar.bz2
otp-04e7370eabd3e36345c032139ab185ea64f169ac.zip
beam_dict: Simplify the internal format of the lambda table
Since Index =:= OldIndex and OldUniq =:= 0, there is no need to store OldIndex and OldUniq in the internal data structure for the lambda table.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_dict.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/compiler/src/beam_dict.erl b/lib/compiler/src/beam_dict.erl
index 9565ab74c4..98e0506ba0 100644
--- a/lib/compiler/src/beam_dict.erl
+++ b/lib/compiler/src/beam_dict.erl
@@ -148,10 +148,7 @@ string(Str, Dict) when is_list(Str) ->
lambda(Lbl, NumFree, #asm{lambdas={OldIndex,Lambdas0}}=Dict) ->
%% Set Index the same as OldIndex.
Index = OldIndex,
- %% Initialize OldUniq to 0. It will be set to an unique value
- %% based on the MD5 checksum of the BEAM code for the module.
- OldUniq = 0,
- Lambdas = [{Lbl,{OldIndex,Lbl,Index,NumFree,OldUniq}}|Lambdas0],
+ Lambdas = [{Lbl,{Index,Lbl,NumFree}}|Lambdas0],
{OldIndex,Dict#asm{lambdas={OldIndex+1,Lambdas}}}.
%% Returns the index for a literal (adding it to the literal table if necessary).
@@ -239,8 +236,11 @@ lambda_table(#asm{locals=Loc0,lambdas={NumLambdas,Lambdas0}}) ->
Lambdas1 = sofs:relation(Lambdas0),
Loc = sofs:relation([{Lbl,{F,A}} || {F,A,Lbl} <- Loc0]),
Lambdas2 = sofs:relative_product1(Lambdas1, Loc),
+ %% Initialize OldUniq to 0. It will be set to an unique value
+ %% based on the MD5 checksum of the BEAM code for the module.
+ OldUniq = 0,
Lambdas = [<<F:32,A:32,Lbl:32,Index:32,NumFree:32,OldUniq:32>> ||
- {{_,Lbl,Index,NumFree,OldUniq},{F,A}} <- sofs:to_external(Lambdas2)],
+ {{Index,Lbl,NumFree},{F,A}} <- sofs:to_external(Lambdas2)],
{NumLambdas,Lambdas}.
%% Returns the literal table.