Added "dexopt for SMP" flag.

Currently, dexopt always runs on the target device, which means that
decisions about whether or not to convert certain opcodes to SMP-safe
variants could be made based on #ifdefs.

Since we are planning to run dexopt on the host, we need to be able
to configure SMP-mode independently.  This change adds a global variable
that the dexopt code can check.

There is currently no command-line argument to set this, since it will
be set by "dexopt" rather than "dalvikvm", and the exact method of
launching dexopt from the host build is still mildly TBD.

Bug 2981136.

Change-Id: If20aa6f513896fd8b35394388eaca6214f0449a7
diff --git a/vm/Init.c b/vm/Init.c
index 1a3d359..2b21130 100644
--- a/vm/Init.c
+++ b/vm/Init.c
@@ -1067,6 +1067,12 @@
 #else
     gDvm.executionMode = kExecutionModeInterpFast;
 #endif
+
+    /*
+     * SMP support is a compile-time define, but we may want to have
+     * dexopt target a differently-configured device.
+     */
+    gDvm.dexOptForSmp = (ANDROID_SMP != 0);
 }