aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-08-18 20:17:07 +0200
committerSverker Eriksson <[email protected]>2014-08-29 16:18:35 +0200
commitfb25e93d290138251d0305bd2698ad29575c661c (patch)
tree82ec47bd1775fa0818c9f73f023193d04a4895b5 /erts/emulator/beam
parentac2eba5ea214152d806a73a8c992911cdf3aae1d (diff)
downloadotp-fb25e93d290138251d0305bd2698ad29575c661c.tar.gz
otp-fb25e93d290138251d0305bd2698ad29575c661c.tar.bz2
otp-fb25e93d290138251d0305bd2698ad29575c661c.zip
erts: Remove unnecessary goto for fun encoding
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/external.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index c6e6a8a954..914214c5b5 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -2754,10 +2754,9 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep,
case FUN_DEF:
{
ErlFunThing* funp = (ErlFunThing *) fun_val(obj);
+ int ei;
if ((dflags & DFLAG_NEW_FUN_TAGS) != 0) {
- int ei;
-
*ep++ = NEW_FUN_EXT;
WSTACK_PUSH(s, ENC_PATCH_FUN_SIZE);
WSTACK_PUSH(s, (UWord) ep); /* Position for patching in size */
@@ -2774,16 +2773,6 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep,
ep = enc_term(acmp, make_small(funp->fe->old_index), ep, dflags, off_heap);
ep = enc_term(acmp, make_small(funp->fe->old_uniq), ep, dflags, off_heap);
ep = enc_pid(acmp, funp->creator, ep, dflags);
-
- fun_env:
- for (ei = funp->num_free-1; ei > 0; ei--) {
- WSTACK_PUSH(s, ENC_TERM);
- WSTACK_PUSH(s, (UWord) funp->env[ei]);
- }
- if (funp->num_free != 0) {
- obj = funp->env[0];
- goto L_jump_start;
- }
} else {
/*
* Communicating with an obsolete erl_interface or
@@ -2815,7 +2804,14 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep,
*ep++ = SMALL_TUPLE_EXT;
put_int8(funp->num_free, ep);
ep += 1;
- goto fun_env;
+ }
+ for (ei = funp->num_free-1; ei > 0; ei--) {
+ WSTACK_PUSH(s, ENC_TERM);
+ WSTACK_PUSH(s, (UWord) funp->env[ei]);
+ }
+ if (funp->num_free != 0) {
+ obj = funp->env[0];
+ goto L_jump_start;
}
}
break;