aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/instrs.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-06 05:07:41 +0200
committerBjörn Gustavsson <[email protected]>2017-09-11 15:22:42 +0200
commit9674613dd9d1c5ac026c9bff05ea19df2886a2c3 (patch)
tree27b4a620c4759b2605ed348fe522ab42efd31289 /erts/emulator/beam/instrs.tab
parent3b916092c488ef9d1fe93ab9c0afda88d589d97e (diff)
downloadotp-9674613dd9d1c5ac026c9bff05ea19df2886a2c3.tar.gz
otp-9674613dd9d1c5ac026c9bff05ea19df2886a2c3.tar.bz2
otp-9674613dd9d1c5ac026c9bff05ea19df2886a2c3.zip
Avoid using $Src more than once
The C compiler will probably optimize this, but just to be sure...
Diffstat (limited to 'erts/emulator/beam/instrs.tab')
-rw-r--r--erts/emulator/beam/instrs.tab10
1 files changed, 6 insertions, 4 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab
index b79b960fd7..690bd3a848 100644
--- a/erts/emulator/beam/instrs.tab
+++ b/erts/emulator/beam/instrs.tab
@@ -731,9 +731,10 @@ is_reference(Fail, Src) {
}
is_tagged_tuple(Fail, Src, Arityval, Tag) {
- if (!(BEAM_IS_TUPLE($Src) &&
- (tuple_val($Src))[0] == $Arityval &&
- (tuple_val($Src))[1] == $Tag)) {
+ Eterm term = $Src;
+ if (!(BEAM_IS_TUPLE(term) &&
+ (tuple_val(term))[0] == $Arityval &&
+ (tuple_val(term))[1] == $Tag)) {
$FAIL($Fail);
}
}
@@ -745,7 +746,8 @@ is_tuple(Fail, Src) {
}
is_tuple_of_arity(Fail, Src, Arityval) {
- if (!(BEAM_IS_TUPLE($Src) && *tuple_val($Src) == $Arityval)) {
+ Eterm term = $Src;
+ if (!(BEAM_IS_TUPLE(term) && *tuple_val(term) == $Arityval)) {
$FAIL($Fail);
}
}