Add a fourth --smc-check= variant, --smc-check=all-non-file.  This
adds self-modifying-code checks to all guest code taken from mappings
which are not file backed, but omits checks in code from file backed
mappings.  This has the effect of giving complete smc-coverage of JIT
generated code -- since that is invariably generated into anonymous
mapped areas -- without burdening non-JIT generated code with such
checks.  Running Firefox 6, --smc-check=all-non-file reduces by a
factor of between 3 and 10 the number of translations requiring a self
check, compared to --smc-check=all.  These changes depend on the vex
interface changes in r2158.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11798 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index b27b5ad..1bf66c6 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -171,8 +171,10 @@
 "                              part of the path after 'string'.  Allows removal\n"
 "                              of path prefixes.  Use this flag multiple times\n"
 "                              to specify a set of prefixes to remove.\n"
-"    --smc-check=none|stack|all  checks for self-modifying code: none,\n"
-"                              only for code found in stacks, or all [stack]\n"
+"    --smc-check=none|stack|all|all-non-file [stack]\n"
+"                              checks for self-modifying code: none, only for\n"
+"                              code found in stacks, for all code, or for all\n"
+"                              code except that from file-backed mappings\n"
 "    --read-var-info=yes|no    read debug info on stack and global variables\n"
 "                              and use it to print better error messages in\n"
 "                              tools that make use of it (Memcheck, Helgrind,\n"
@@ -519,6 +521,9 @@
                                                     Vg_SmcStack);
       else if VG_XACT_CLO(arg, "--smc-check=all",   VG_(clo_smc_check),
                                                     Vg_SmcAll);
+      else if VG_XACT_CLO(arg, "--smc-check=all-non-file",
+                                                    VG_(clo_smc_check),
+                                                    Vg_SmcAllNonFile);
 
       else if VG_STR_CLO (arg, "--kernel-variant",  VG_(clo_kernel_variant)) {}