From aa300de27583b13c13be178466e76ae1ae58b806 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 18 Aug 2013 06:42:09 -0700 Subject: [PATCH 1/3] add --optimize development option (alias for --optimize release --disable-optimize no-log,no-assert,no-debug) --- src/jsx-command.jsx | 2 ++ src/optimizer.jsx | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/jsx-command.jsx b/src/jsx-command.jsx index b95d3df3..aefa4d5a 100644 --- a/src/jsx-command.jsx +++ b/src/jsx-command.jsx @@ -189,6 +189,8 @@ class JSXCommand { } if (optarg == "release") { optimizeCommands = Optimizer.getReleaseOptimizationCommands(); + } else if (optarg = "development") { + optimizeCommands = Optimizer.getDevelopmentOptimizationCommands(); } else { optimizeCommands = optimizeCommands.concat(optarg.split(",")); } diff --git a/src/optimizer.jsx b/src/optimizer.jsx index faf9261f..b2a38200 100644 --- a/src/optimizer.jsx +++ b/src/optimizer.jsx @@ -251,6 +251,25 @@ class Optimizer { ]; } + static function getDevelopmentOptimizationCommands() : string[] { + return [ + "lto", + "fold-const", + "tail-rec", + "return-if", + "inline", + "dce", + "unbox", + "fold-const", + "lcse", + "dce", + "fold-const", + "array-length", + "unclassify", + "staticize" + ]; + } + function constructor () { this._compiler = null; this._commands = new _OptimizeCommand[]; From 105f30f270656570240236cb7daccaaf285a1643 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 18 Aug 2013 06:55:14 -0700 Subject: [PATCH 2/3] fix a bug(typo) introduced in the prev commit --- src/jsx-command.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jsx-command.jsx b/src/jsx-command.jsx index aefa4d5a..784d254e 100644 --- a/src/jsx-command.jsx +++ b/src/jsx-command.jsx @@ -189,7 +189,7 @@ class JSXCommand { } if (optarg == "release") { optimizeCommands = Optimizer.getReleaseOptimizationCommands(); - } else if (optarg = "development") { + } else if (optarg == "development") { optimizeCommands = Optimizer.getDevelopmentOptimizationCommands(); } else { optimizeCommands = optimizeCommands.concat(optarg.split(",")); From 8ab111cfecbb1d6b092be760697016f53ac86f06 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 18 Aug 2013 06:57:23 -0700 Subject: [PATCH 3/3] getDevelOptCmds to use the result of getReleaseOptCmds --- src/optimizer.jsx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/optimizer.jsx b/src/optimizer.jsx index b2a38200..5d63ec99 100644 --- a/src/optimizer.jsx +++ b/src/optimizer.jsx @@ -252,22 +252,14 @@ class Optimizer { } static function getDevelopmentOptimizationCommands() : string[] { - return [ - "lto", - "fold-const", - "tail-rec", - "return-if", - "inline", - "dce", - "unbox", - "fold-const", - "lcse", - "dce", - "fold-const", - "array-length", - "unclassify", - "staticize" + var disabled = [ + "no-assert", + "no-log", + "no-debug" ]; + return Optimizer.getReleaseOptimizationCommands().filter(function (cmd) { + return disabled.indexOf(cmd) == -1; + }); } function constructor () {