diff options
author | Björn Gustavsson <[email protected]> | 2017-08-16 10:40:31 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-08-16 10:40:31 +0200 |
commit | 5cbb54cb00d1437b8213bddf0b4e431d0c54f6a8 (patch) | |
tree | a6cc0382be205ef28c73e757aaaf5d1425c5a100 /erts/emulator/beam/beam_load.c | |
parent | a84ddf3f9bc3fc4806ed05232a7e6446590728ca (diff) | |
parent | 17bb6bfa8d435300ee2205f1e0c20b0c6b50591a (diff) | |
download | otp-5cbb54cb00d1437b8213bddf0b4e431d0c54f6a8.tar.gz otp-5cbb54cb00d1437b8213bddf0b4e431d0c54f6a8.tar.bz2 otp-5cbb54cb00d1437b8213bddf0b4e431d0c54f6a8.zip |
Merge pull request #1535 from bjorng/bjorn/erts/opt-map-update
Slightly optimize updating of maps
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index d38e71f489..dcd312f54f 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -306,6 +306,7 @@ typedef struct LoaderState { int on_load; /* Index in the code for the on_load function * (or 0 if there is no on_load function) */ + int otp_20_or_higher; /* Compiled with OTP 20 or higher */ /* * Atom table. @@ -740,6 +741,13 @@ erts_prepare_loading(Binary* magic, Process *c_p, Eterm group_leader, } /* + * Find out whether the code was compiled with OTP 20 + * or higher. + */ + + stp->otp_20_or_higher = stp->chunks[UTF8_ATOM_CHUNK].size > 0; + + /* * Load the code chunk. */ @@ -2731,6 +2739,12 @@ load_code(LoaderState* stp) #define never(St) 0 +static int +compiled_with_otp_20_or_higher(LoaderState* stp) +{ + return stp->otp_20_or_higher; +} + /* * Predicate that tests whether a jump table can be used. */ |