aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/map_instrs.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-08-18 04:06:52 +0200
committerBjörn Gustavsson <[email protected]>2017-08-23 05:57:38 +0200
commit234ef0eb9803d4c4cfb82848e3d3d14d89d1ddf5 (patch)
tree06252248a9abafe6cdd6deab5f34e854c7c010d0 /erts/emulator/beam/map_instrs.tab
parentcbeeed095739223a425649f6085b6959ad905c83 (diff)
downloadotp-234ef0eb9803d4c4cfb82848e3d3d14d89d1ddf5.tar.gz
otp-234ef0eb9803d4c4cfb82848e3d3d14d89d1ddf5.tar.bz2
otp-234ef0eb9803d4c4cfb82848e3d3d14d89d1ddf5.zip
Make map update instruction functions indepedent of instruction format
Having the helper functions for map update knowing all the details of operands for the instruction will make it difficult to make improvements such as better packing.
Diffstat (limited to 'erts/emulator/beam/map_instrs.tab')
-rw-r--r--erts/emulator/beam/map_instrs.tab20
1 files changed, 11 insertions, 9 deletions
diff --git a/erts/emulator/beam/map_instrs.tab b/erts/emulator/beam/map_instrs.tab
index 30c3d7743f..bbb2f49b66 100644
--- a/erts/emulator/beam/map_instrs.tab
+++ b/erts/emulator/beam/map_instrs.tab
@@ -31,22 +31,24 @@ new_map(Dst, Live, N) {
Eterm res;
HEAVY_SWAPOUT;
- res = new_map(c_p, reg, I-1);
+ res = new_map(c_p, reg, $Live, $N, $NEXT_INSTRUCTION);
HEAVY_SWAPIN;
$REFRESH_GEN_DEST();
$Dst = res;
$NEXT($NEXT_INSTRUCTION+$N);
}
-i_new_small_map_lit(Dst, Live, Literal) {
+i_new_small_map_lit(Dst, Live, Keys) {
Eterm res;
Uint n;
+ Eterm keys = $Keys;
HEAVY_SWAPOUT;
- res = new_small_map_lit(c_p, reg, &n, I-1);
+ res = new_small_map_lit(c_p, reg, keys, $Live, $NEXT_INSTRUCTION);
HEAVY_SWAPIN;
$REFRESH_GEN_DEST();
$Dst = res;
+ n = arityval(*tuple_val(keys));
$NEXT($NEXT_INSTRUCTION+n);
}
@@ -127,11 +129,11 @@ i_get_map_elements(Fail, Src, N) {
update_map_assoc(Src, Dst, Live, N) {
Eterm res;
- Eterm map;
+ Uint live = $Live;
- map = $Src;
+ reg[live] = $Src;
HEAVY_SWAPOUT;
- res = update_map_assoc(c_p, reg, map, I);
+ res = update_map_assoc(c_p, reg, live, $N, $NEXT_INSTRUCTION);
HEAVY_SWAPIN;
ASSERT(is_value(res));
$REFRESH_GEN_DEST();
@@ -141,11 +143,11 @@ update_map_assoc(Src, Dst, Live, N) {
update_map_exact(Fail, Src, Dst, Live, N) {
Eterm res;
- Eterm map;
+ Uint live = $Live;
- map = $Src;
+ reg[live] = $Src;
HEAVY_SWAPOUT;
- res = update_map_exact(c_p, reg, map, I);
+ res = update_map_exact(c_p, reg, live, $N, $NEXT_INSTRUCTION);
HEAVY_SWAPIN;
if (is_value(res)) {
$REFRESH_GEN_DEST();