Use update_symbols exported from aebytecode

This commit is contained in:
Gaith Hallak 2022-10-07 13:49:14 +03:00
parent e3335358ee
commit 0af50160fe
3 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,7 @@
{erl_opts, [debug_info]}. {erl_opts, [debug_info]}.
{deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git", {tag, "v3.1.1"}}} {deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git", {tag, "v3.2.0"}}}
, {getopt, "1.0.1"} , {getopt, "1.0.1"}
, {eblake2, "1.0.0"} , {eblake2, "1.0.0"}
, {jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.0"}}} , {jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.0"}}}

View File

@ -1,7 +1,7 @@
{"1.2.0", {"1.2.0",
[{<<"aebytecode">>, [{<<"aebytecode">>,
{git,"https://github.com/aeternity/aebytecode.git", {git,"https://github.com/aeternity/aebytecode.git",
{ref,"8269dbd71e9011921c60141636f1baa270a0e784"}}, {ref,"2a0a397afad6b45da52572170f718194018bf33c"}},
0}, 0},
{<<"aeserialization">>, {<<"aeserialization">>,
{git,"https://github.com/aeternity/aeserialization.git", {git,"https://github.com/aeternity/aeserialization.git",

View File

@ -79,13 +79,12 @@ compile(ChildContracts, FCode, Options) ->
SFuns = functions_to_scode(ChildContracts, ContractName, Functions, Options), SFuns = functions_to_scode(ChildContracts, ContractName, Functions, Options),
SFuns1 = optimize_scode(SFuns, Options), SFuns1 = optimize_scode(SFuns, Options),
FateCode = to_basic_blocks(SFuns1), FateCode = to_basic_blocks(SFuns1),
Symbols = aeb_fate_code:symbols(FateCode),
ChildSymbols = maps:from_list( ChildSymbols = maps:from_list(
[ {make_function_id(FName), make_function_name(FName)} [ {make_function_id(FName), make_function_name(FName)}
|| {_, #{functions := ChildFuns}} <- maps:to_list(ChildContracts), || {_, #{functions := ChildFuns}} <- maps:to_list(ChildContracts),
FName <- maps:keys(ChildFuns) FName <- maps:keys(ChildFuns)
]), ]),
FateCode1 = setelement(3, FateCode, maps:merge(Symbols, ChildSymbols)), FateCode1 = aeb_fate_code:update_symbols(FateCode, ChildSymbols),
?debug(compile, Options, "~s\n", [aeb_fate_asm:pp(FateCode)]), ?debug(compile, Options, "~s\n", [aeb_fate_asm:pp(FateCode)]),
FateCode1. FateCode1.