aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-24 07:53:18 +0200
committerBjörn Gustavsson <[email protected]>2017-10-01 07:08:19 +0200
commitf589687e9bd172f6f7841043a8de05d260889c8b (patch)
treeb5f2582f591c2e4f2a1f48cb6d19bf70849e8575 /erts/emulator
parentb597ba86170ee142790e97ae298cf8b7c2797ce2 (diff)
downloadotp-f589687e9bd172f6f7841043a8de05d260889c8b.tar.gz
otp-f589687e9bd172f6f7841043a8de05d260889c8b.tar.bz2
otp-f589687e9bd172f6f7841043a8de05d260889c8b.zip
Move out variables from the head of combined instructions
Move out from the head the variables that are only used in the excute phase.
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/arith_instrs.tab8
-rw-r--r--erts/emulator/beam/bs_instrs.tab28
-rw-r--r--erts/emulator/beam/instrs.tab3
3 files changed, 18 insertions, 21 deletions
diff --git a/erts/emulator/beam/arith_instrs.tab b/erts/emulator/beam/arith_instrs.tab
index 23fdb6d5b5..b828e86788 100644
--- a/erts/emulator/beam/arith_instrs.tab
+++ b/erts/emulator/beam/arith_instrs.tab
@@ -85,9 +85,6 @@ i_increment := increment.fetch.execute;
increment.head() {
Eterm increment_reg_val;
- Eterm increment_val;
- Uint live;
- Eterm result;
}
increment.fetch(Src) {
@@ -95,7 +92,10 @@ increment.fetch(Src) {
}
increment.execute(IncrementVal, Live, Dst) {
- increment_val = $IncrementVal;
+ Eterm increment_val = $IncrementVal;
+ Uint live;
+ Eterm result;
+
if (ERTS_LIKELY(is_small(increment_reg_val))) {
Sint i = signed_val(increment_reg_val) + increment_val;
if (ERTS_LIKELY(IS_SSMALL(i))) {
diff --git a/erts/emulator/beam/bs_instrs.tab b/erts/emulator/beam/bs_instrs.tab
index a4d4afe7d4..9f03b19731 100644
--- a/erts/emulator/beam/bs_instrs.tab
+++ b/erts/emulator/beam/bs_instrs.tab
@@ -364,11 +364,9 @@ i_bs_init_bits_fail := bs_init_bits.fail.verify.execute;
i_bs_init_bits_fail_heap := bs_init_bits.fail_heap.verify.execute;
bs_init_bits.head() {
- Eterm new_binary;
Eterm num_bits_term;
Uint num_bits;
Uint alloc;
- Uint num_bytes;
}
bs_init_bits.plain(NumBits) {
@@ -410,7 +408,9 @@ bs_init_bits.verify(Fail) {
}
bs_init_bits.execute(Live, Dst) {
- num_bytes = ((Uint64)num_bits+(Uint64)7) >> 3;
+ Eterm new_binary;
+ Uint num_bytes = ((Uint64)num_bits+(Uint64)7) >> 3;
+
if (num_bits & 7) {
alloc += ERL_SUB_BIN_SIZE;
}
@@ -709,9 +709,6 @@ i_bs_validate_unicode_retract(Fail, Src, Ms) {
i_bs_start_match2 := bs_start_match.fetch.execute;
bs_start_match.head() {
- Uint slots;
- Uint live;
- Eterm header;
Eterm context;
}
@@ -720,6 +717,9 @@ bs_start_match.fetch(Src) {
}
bs_start_match.execute(Fail, Live, Slots, Dst) {
+ Uint slots;
+ Uint live;
+ Eterm header;
if (!is_boxed(context)) {
$FAIL($Fail);
}
@@ -942,13 +942,10 @@ bs_context_to_binary := ctx_to_bin.fetch.execute;
i_bs_get_binary_all_reuse := ctx_to_bin.fetch_bin.execute;
ctx_to_bin.head() {
- Eterm context;
- ErlBinMatchBuffer* mb;
- ErlSubBin* sb;
- Uint size;
- Uint offs;
- Uint orig;
- Uint hole_size;
+ Eterm context;
+ ErlBinMatchBuffer* mb;
+ Uint size;
+ Uint offs;
}
ctx_to_bin.fetch(Src) {
@@ -976,8 +973,9 @@ ctx_to_bin.fetch_bin(Src, Fail, Unit) {
}
ctx_to_bin.execute() {
- orig = mb->orig;
- sb = (ErlSubBin *) boxed_val(context);
+ Uint hole_size;
+ Uint orig = mb->orig;
+ ErlSubBin* sb = (ErlSubBin *) boxed_val(context);
hole_size = 1 + header_arity(sb->thing_word) - ERL_SUB_BIN_SIZE;
sb->thing_word = HEADER_SUB_BIN;
sb->size = BYTE_OFFSET(size);
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab
index b85e3eaeb5..07cc4bd527 100644
--- a/erts/emulator/beam/instrs.tab
+++ b/erts/emulator/beam/instrs.tab
@@ -375,7 +375,6 @@ i_element := element_group.fetch.execute;
element_group.head() {
- Eterm element_index;
Eterm element_tuple;
}
@@ -384,7 +383,7 @@ element_group.fetch(Src) {
}
element_group.execute(Fail, Index, Dst) {
- element_index = $Index;
+ Eterm element_index = $Index;
if (ERTS_LIKELY(is_small(element_index) && is_tuple(element_tuple))) {
Eterm* tp = tuple_val(element_tuple);