aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-03-23 10:24:56 +0100
committerBjörn Gustavsson <[email protected]>2015-04-13 12:37:54 +0200
commit85afb5e3441e78cd0d572dc809d94cfc810d71ff (patch)
tree943c8473599ff816e100008e73afed7ab5478a79 /erts/emulator/beam/beam_load.c
parentcd4c3e3bc699e73a7bada55a74333e5a09c7f9e4 (diff)
downloadotp-85afb5e3441e78cd0d572dc809d94cfc810d71ff.tar.gz
otp-85afb5e3441e78cd0d572dc809d94cfc810d71ff.tar.bz2
otp-85afb5e3441e78cd0d572dc809d94cfc810d71ff.zip
Fully evaluate is_map/1 for literals at load-time
The compiler will only emit is_map/1 instructions with literal argument if optimization is turned off. Therefore, the only reason for this commit is cleanliness.
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index f140bb54cc..60f4ab5280 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -4052,6 +4052,20 @@ tuple_append_put(LoaderState* stp, GenOpArg Arity, GenOpArg Dst,
}
/*
+ * Predicate to test whether the given literal is a map.
+ */
+
+static int
+literal_is_map(LoaderState* stp, GenOpArg Lit)
+{
+ Eterm term;
+
+ ASSERT(Lit.type == TAG_q);
+ term = stp->literals[Lit.val].term;
+ return is_map(term);
+}
+
+/*
* Predicate to test whether the given literal is an empty map.
*/