Compare commits

..

7 Commits

Author SHA1 Message Date
sennui d96f1a80d5 change version of bytecode to the one full node pulls at a time (not head of the master!) 2019-08-14 12:09:28 +02:00
sennui 6c0ea774c4 add extra argument to claim for bidding 2019-08-14 11:22:33 +02:00
Ulf Norell 69ad8ce9bc Merge pull request #121 from aeternity/PT-166788647-fate-efficient-maps
Don't generate remote tail calls
2019-08-14 08:58:54 +02:00
Ulf Norell 3877174acb aebytecode commit 2019-08-13 15:53:49 +02:00
Ulf Norell 448adb8890 Don't generate remote tail calls 2019-08-13 15:52:47 +02:00
Hans Svensson 864a94c59e Merge pull request #119 from radrow/patch-2
Mention tuple syntax change in changelog
2019-08-12 16:59:58 +02:00
Radosław Rowicki 518ae8e659 Mention tuple syntax change in changelog 2019-08-12 16:42:34 +02:00
2 changed files with 14 additions and 20 deletions
+5
View File
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
### Changed
- New syntax for tuple types. Now 0-tuple type is encoded as `unit` instead of `()` and
regular tuples are encoded by interspersing inner types with `*`, for instance `int * string`.
Parens are not necessary. Note it only affects the types, values remain as their were before,
so `(1, "a") : int * string`
### Removed
## [3.2.0] - 2019-06-28
+9 -20
View File
@@ -329,18 +329,14 @@ to_scode(Env, {builtin, B, Args}) ->
to_scode(Env, {remote, Ct, Fun, [{builtin, call_gas_left, _}, Value | Args]}) ->
%% Gas is not limited.
Lbl = make_function_id(Fun),
Call = if Env#env.tailpos -> aeb_fate_ops:call_tr(?a, Lbl, ?a);
true -> aeb_fate_ops:call_r(?a, Lbl, ?a)
end,
Lbl = make_function_id(Fun),
Call = aeb_fate_ops:call_r(?a, Lbl, length(Args), ?a), %% No remote tail calls
call_to_scode(Env, Call, [Ct, Value | Args]);
to_scode(Env, {remote, Ct, Fun, [Gas, Value | Args]}) ->
%% Gas is limited.
Lbl = make_function_id(Fun),
Call = if Env#env.tailpos -> aeb_fate_ops:call_gtr(?a, Lbl, ?a, ?a);
true -> aeb_fate_ops:call_gr(?a, Lbl, ?a, ?a)
end,
Call = aeb_fate_ops:call_gr(?a, Lbl, length(Args), ?a, ?a), %% No remote tail calls
call_to_scode(Env, Call, [Ct, Value, Gas | Args]);
to_scode(Env, {closure, Fun, FVs}) ->
@@ -747,11 +743,9 @@ attributes(I) ->
'RETURN' -> Impure(pc, []);
{'RETURNR', A} -> Impure(pc, A);
{'CALL', _} -> Impure(?a, []);
{'CALL_R', A, _, B} -> Impure(?a, [A, B]);
{'CALL_GR', A, _, B, C} -> Impure(?a, [A, B, C]);
{'CALL_R', A, _, _, B} -> Impure(?a, [A, B]);
{'CALL_GR', A, _, _, B, C} -> Impure(?a, [A, B, C]);
{'CALL_T', _} -> Impure(pc, []);
{'CALL_TR', A, _, B} -> Impure(pc, [A, B]);
{'CALL_GTR', A, _, B, C} -> Impure(pc, [A, B, C]);
{'CALL_VALUE', A} -> Pure(A, []);
{'JUMP', _} -> Impure(pc, []);
{'JUMPIF', A, _} -> Impure(pc, A);
@@ -1413,8 +1407,6 @@ reorder_blocks(Ref, Code, Blocks, Acc) ->
['RETURN'|_] -> reorder_blocks(Blocks, Acc1);
[{'RETURNR', _}|_] -> reorder_blocks(Blocks, Acc1);
[{'CALL_T', _}|_] -> reorder_blocks(Blocks, Acc1);
[{'CALL_TR', _, _, _}|_] -> reorder_blocks(Blocks, Acc1);
[{'CALL_GTR', _, _, _}|_] -> reorder_blocks(Blocks, Acc1);
[{'EXIT', _}|_] -> reorder_blocks(Blocks, Acc1);
[{'ABORT', _}|_] -> reorder_blocks(Blocks, Acc1);
[{switch, _, _}|_] -> reorder_blocks(Blocks, Acc1);
@@ -1454,13 +1446,10 @@ chase_labels([L | Ls], Map, Live) ->
chase_labels(New ++ Ls, Map, Live#{ L => true }).
%% Replace PUSH, RETURN by RETURNR, drop returns after tail calls.
tweak_returns(['RETURN', {'PUSH', A} | Code]) -> [{'RETURNR', A} | Code];
tweak_returns(['RETURN' | Code = [{'CALL_T', _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'CALL_TR', _, _, _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'CALL_GT', _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'CALL_GTR', _, _, _, _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'ABORT', _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'EXIT', _} | _]]) -> Code;
tweak_returns(['RETURN', {'PUSH', A} | Code]) -> [{'RETURNR', A} | Code];
tweak_returns(['RETURN' | Code = [{'CALL_T', _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'ABORT', _} | _]]) -> Code;
tweak_returns(['RETURN' | Code = [{'EXIT', _} | _]]) -> Code;
tweak_returns(Code) -> Code.
%% -- Split basic blocks at CALL instructions --