Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Inappropriate [embedded specific] |
| 2 | |
| 3 | # when compiling for an embedded system, we need every bit of |
| 4 | # performance we can get. default to optimized with the option |
| 5 | # of opt-out. |
| 6 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> |
| 7 | |
| 8 | |
| 9 | 2012/05/01 |
| 10 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> |
| 11 | |
| 12 | Rebased for 3.4.2 02/2015 |
| 13 | Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> |
| 14 | |
| 15 | Index: Python-3.4.2/Python/compile.c |
| 16 | =================================================================== |
| 17 | --- Python-3.4.2.orig/Python/compile.c |
| 18 | +++ Python-3.4.2/Python/compile.c |
| 19 | @@ -30,7 +30,7 @@ |
| 20 | #include "symtable.h" |
| 21 | #include "opcode.h" |
| 22 | |
| 23 | -int Py_OptimizeFlag = 0; |
| 24 | +int Py_OptimizeFlag = 1; |
| 25 | |
| 26 | #define DEFAULT_BLOCK_SIZE 16 |
| 27 | #define DEFAULT_BLOCKS 8 |
| 28 | Index: Python-3.4.2/Modules/main.c |
| 29 | =================================================================== |
| 30 | --- Python-3.4.2.orig/Modules/main.c |
| 31 | +++ Python-3.4.2/Modules/main.c |
| 32 | @@ -38,7 +38,7 @@ static wchar_t **orig_argv; |
| 33 | static int orig_argc; |
| 34 | |
| 35 | /* command line options */ |
| 36 | -#define BASE_OPTS L"bBc:dEhiIJm:OqRsStuvVW:xX:?" |
| 37 | +#define BASE_OPTS L"bBc:dEhiIJm:NOqRsStuvVW:xX:?" |
| 38 | |
| 39 | #define PROGRAM_OPTS BASE_OPTS |
| 40 | |
| 41 | @@ -64,6 +64,7 @@ static char *usage_2 = "\ |
| 42 | -m mod : run library module as a script (terminates option list)\n\ |
| 43 | -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ |
| 44 | -OO : remove doc-strings in addition to the -O optimizations\n\ |
| 45 | +-N : do NOT optimize generated bytecode\n\ |
| 46 | -q : don't print version and copyright messages on interactive startup\n\ |
| 47 | -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ |
| 48 | -S : don't imply 'import site' on initialization\n\ |
| 49 | @@ -418,8 +419,8 @@ Py_Main(int argc, wchar_t **argv) |
| 50 | |
| 51 | /* case 'J': reserved for Jython */ |
| 52 | |
| 53 | - case 'O': |
| 54 | - Py_OptimizeFlag++; |
| 55 | + case 'N': |
| 56 | + Py_OptimizeFlag=0; |
| 57 | break; |
| 58 | |
| 59 | case 'B': |