5e60a60 | Mihai Bazon | 17 September 2012, 08:16:44 UTC | try negating AST_Binary | 17 September 2012, 08:16:44 UTC |
5d781ec | Mihai Bazon | 16 September 2012, 15:05:15 UTC | some cleanup | 16 September 2012, 15:10:54 UTC |
0f418d6 | Mihai Bazon | 16 September 2012, 13:29:17 UTC | more sequencesizing (WIP) | 16 September 2012, 13:29:17 UTC |
21c34a1 | Mihai Bazon | 16 September 2012, 12:46:47 UTC | drop unused function | 16 September 2012, 12:46:47 UTC |
7b6a402 | Mihai Bazon | 16 September 2012, 12:46:20 UTC | rewrite handle_if_return optimizations of if/return/continue seem to be even better now | 16 September 2012, 12:46:20 UTC |
397bf56 | Mihai Bazon | 15 September 2012, 13:06:09 UTC | other small optimization: if (foo) continue; ...body... ==> if (!foo) { ...body ... } Only when the parent block is the target loop of the `continue` statement. | 15 September 2012, 13:10:35 UTC |
4e0262b | Mihai Bazon | 15 September 2012, 13:05:01 UTC | figure out label targets | 15 September 2012, 13:05:17 UTC |
86c14d0 | Mihai Bazon | 15 September 2012, 07:54:59 UTC | join_vars: var XXX; for (var YYY; ...) ==> for (var XXX,YYY; ...) | 15 September 2012, 07:54:59 UTC |
43fd451 | Mihai Bazon | 14 September 2012, 16:56:59 UTC | compress typeof x == "undefined" to x === undefined, which further gets shortened to x === void 0 (or x === [][0] in unsafe mode) | 14 September 2012, 16:56:59 UTC |
50d1670 | Mihai Bazon | 14 September 2012, 16:04:18 UTC | minor when unsafe, compress undefined as [][0] | 14 September 2012, 16:04:18 UTC |
5e83e7e | Mihai Bazon | 14 September 2012, 13:26:30 UTC | adding an imaginary "return undefined" can sometimes help function f() { if (foo) return x(); if (!bar) return y(); } ==> function f() { return foo ? x() : bar ? void 0 : y(); } | 14 September 2012, 13:26:30 UTC |
924aa58 | Mihai Bazon | 14 September 2012, 12:36:38 UTC | more optimizations that v1 does and some cleanups - a = a + x ==> a+=x - joining consecutive var statements (hoisting is not always desirable) - x == false ==> x == 0, x != true ==> x != 1 - x, x ==> x; x = exp(), x ==> x = exp() - discarding useless break-s | 14 September 2012, 12:36:38 UTC |
93b973c | Mihai Bazon | 13 September 2012, 16:45:16 UTC | added -m and -c options | 13 September 2012, 16:45:16 UTC |
d72c1d1 | Mihai Bazon | 13 September 2012, 12:20:57 UTC | few more optimizations: - do multiple passes in tighten_body if it was changed - transform if (foo) return x; return y; ==> return foo?x:y - don't optimize !0 as true (use best_of after evaluation of constant expr) With hoist_vars off we now beat UglifyJS v1 on jQuery-1.8.1 | 13 September 2012, 12:20:57 UTC |
f5027ec | Mihai Bazon | 12 September 2012, 13:29:20 UTC | minor | 12 September 2012, 13:29:20 UTC |
a132841 | Mihai Bazon | 12 September 2012, 13:10:03 UTC | more AST_If optimizations | 12 September 2012, 13:10:03 UTC |
2b1e462 | Mihai Bazon | 12 September 2012, 10:23:24 UTC | side effect fixes and small optimization for gzip prefer to always use > and >= operators (idea from Closure) | 12 September 2012, 10:41:46 UTC |
2b4093b | Mihai Bazon | 12 September 2012, 10:00:13 UTC | fixed run-tests and an issue about reversing the condition in AST_If | 12 September 2012, 10:00:13 UTC |
9a629ab | Mihai Bazon | 11 September 2012, 15:37:08 UTC | minor | 11 September 2012, 15:37:08 UTC |
8e82d8d | Mihai Bazon | 11 September 2012, 12:42:28 UTC | fixed some mess with symbols/scope - all symbols now have a `thedef` property which is a SymbolDef object, instead of the `uniq` that we had before (pointing to the first occurrence of the name as declaration). - for undeclared symbols we still create a SymbolDef object in the toplevel scope but mark it "undeclared" - we can now call figure_out_scope after squeezing, which is useful in order not to mangle names that were dropped by the squeezer | 11 September 2012, 12:42:28 UTC |
da407d4 | Mihai Bazon | 11 September 2012, 10:15:55 UTC | checkpoint - discard statements with no side effects (unsafe? could be) - safer hoist_vars (needs some revamping of scope/mangling) | 11 September 2012, 10:15:55 UTC |
1579c0f | Mihai Bazon | 10 September 2012, 19:40:18 UTC | hoist_vars is pretty bad, it seems. cancelled it for now. | 10 September 2012, 19:40:18 UTC |
6b9aeb5 | Mihai Bazon | 10 September 2012, 15:25:52 UTC | adaptive base54 digits depending on char frequency (WIP) | 10 September 2012, 19:29:18 UTC |
a41e6cf | Mihai Bazon | 10 September 2012, 12:54:17 UTC | more progress on the compressor (WIP) | 10 September 2012, 13:37:05 UTC |
16b12c6 | Mihai Bazon | 10 September 2012, 12:52:53 UTC | fix "file" in the source map | 10 September 2012, 12:52:53 UTC |
1c8ba35 | Mihai Bazon | 08 September 2012, 14:03:09 UTC | minor | 08 September 2012, 19:51:59 UTC |
5a8e6ce | Mihai Bazon | 08 September 2012, 12:38:58 UTC | fix output for division followed by regexp ( v1 report: https://github.com/mishoo/UglifyJS/pull/458 ) | 08 September 2012, 12:38:58 UTC |
43c75c9 | Mihai Bazon | 07 September 2012, 15:55:13 UTC | checkpoint | 07 September 2012, 15:55:13 UTC |
048d690 | Mihai Bazon | 07 September 2012, 13:02:08 UTC | fix bug (forgot arg name) | 07 September 2012, 13:02:08 UTC |
919b273 | Mihai Bazon | 07 September 2012, 12:18:32 UTC | always keep declarations found in unreachable code a few more tests and some cleanups. | 07 September 2012, 12:18:32 UTC |
b77574e | Mihai Bazon | 07 September 2012, 08:22:01 UTC | fixed tests (need to drop the toplevel block in "expected" if it's a single statement) | 07 September 2012, 08:22:01 UTC |
9bb1a84 | Mihai Bazon | 05 September 2012, 15:19:30 UTC | don't duplicate argument names | 05 September 2012, 15:19:30 UTC |
0afafe6 | Mihai Bazon | 05 September 2012, 15:19:24 UTC | declared `--stats` as boolean | 05 September 2012, 15:19:24 UTC |
c7b484b | Mihai Bazon | 05 September 2012, 11:31:05 UTC | fix for variable names like `toString` | 05 September 2012, 11:31:05 UTC |
0503513 | Mihai Bazon | 05 September 2012, 10:43:34 UTC | support for hoisting declarations and finally it seems we beat v1 in terms of compression | 05 September 2012, 10:43:34 UTC |
8633b00 | Mihai Bazon | 05 September 2012, 08:31:02 UTC | cleaned up usage of AST_BlockStatement The following nodes were instances of AST_BlockStatement: AST_Scope, AST_SwitchBlock, AST_SwitchBranch. Also, AST_Try, AST_Catch, AST_Finally were having a body instanceof AST_BlockStatement. Overloading the meaning of AST_BlockStatement this way turned out to be a mess; we now have an AST_Block class that is the base class for things having a block of statements (might or might not be bracketed). The `this.body` of AST_Scope, AST_Try, AST_Catch, AST_Finally is now an array of statements (as they inherit from AST_Block). Avoiding calling superclass's _walk function in walkers (turns out we walked a node multiple times). | 05 September 2012, 08:39:43 UTC |
1b5183d | Mihai Bazon | 04 September 2012, 12:36:14 UTC | checkpoint | 04 September 2012, 12:36:14 UTC |
376667a | Mihai Bazon | 04 September 2012, 10:20:28 UTC | more fiddling with boolean expressions, etc. optimize away while(false), and transform while(true) ==> for(;;). UNSAFE: some expressions are optimized away when we're in boolean context and can determine that the value will always be true or false. For example: x() || true ==> always `true` in boolean context x() && false ==> always `false` in boolean context It's not technically correct to drop these expressions since we drop the function call too (that might have side effects); on the other hand, I can't see any legitimate use for such expressions and they might simply indicate a bug (we do warn about it). | 04 September 2012, 10:20:28 UTC |
3459c40 | Mihai Bazon | 04 September 2012, 10:17:13 UTC | if present, the `else` in an `if` should always be forced statement | 04 September 2012, 10:17:13 UTC |
86cfb5b | Mihai Bazon | 03 September 2012, 20:49:57 UTC | boolean and if/exit optimizations | 03 September 2012, 20:49:57 UTC |
e5f1cec | Mihai Bazon | 03 September 2012, 16:43:46 UTC | minor | 03 September 2012, 20:25:30 UTC |
37eecc1 | Mihai Bazon | 03 September 2012, 16:38:45 UTC | more optimizations for ifs/conditionals (XXX: should add tests before anything else) | 03 September 2012, 16:38:45 UTC |
f03138d | Mihai Bazon | 03 September 2012, 12:47:15 UTC | resolve constant expressions | 03 September 2012, 12:47:15 UTC |
f702264 | Mihai Bazon | 03 September 2012, 09:39:02 UTC | jumps, try and definitions are statements too | 03 September 2012, 09:39:02 UTC |
6d0db4c | Mihai Bazon | 03 September 2012, 09:11:44 UTC | an AST_If is too a StatementWithBody | 03 September 2012, 09:11:44 UTC |
d7c1dc6 | Mihai Bazon | 03 September 2012, 09:05:10 UTC | a LabeledStatement should be in fact a StatementWithBody This fixes output for: if (foo) { moo: if (bar) { break moo; } } else { baz(); } (the labeled statement must be outputted inside brackets) | 03 September 2012, 09:05:10 UTC |
d6efa8b | Mihai Bazon | 03 September 2012, 09:03:45 UTC | declare boolean options | 03 September 2012, 09:03:45 UTC |
66c869c | Mihai Bazon | 03 September 2012, 08:05:59 UTC | switch branches must be declared `required` so that the compressor doesn't replace nodes with a single statement. looks stable for now, though mess begins to sink in. need to review the AST hierarchy. | 03 September 2012, 08:05:59 UTC |
1bf5928 | Mihai Bazon | 03 September 2012, 07:26:23 UTC | Reverting "minor perf. improvements" Revert "minor perf. improvements" This reverts commit 24bfd55a22afd791d4a97694641831cfbd27fb14. broke the parser somehow; too early to optimize, let's get the other stuff running. | 03 September 2012, 07:26:23 UTC |
596af60 | Mihai Bazon | 03 September 2012, 07:14:15 UTC | add -b | 03 September 2012, 07:14:15 UTC |
f2f370c | Mihai Bazon | 02 September 2012, 11:32:00 UTC | add source mappings for more node types; started CLI utility | 02 September 2012, 11:32:00 UTC |
24bfd55 | Mihai Bazon | 02 September 2012, 08:11:39 UTC | minor perf. improvements | 02 September 2012, 08:11:39 UTC |
52bcca2 | Mihai Bazon | 29 August 2012, 16:39:19 UTC | started support for generating source maps (WIP) plugged in @fitzgen's source-map library | 29 August 2012, 16:39:19 UTC |
48440dc | Mihai Bazon | 29 August 2012, 16:26:48 UTC | don't mangle names of setters/getters | 29 August 2012, 16:26:48 UTC |
6569e66 | Mihai Bazon | 29 August 2012, 08:18:05 UTC | update with link to discussion about Esprima vs. UglifyJS speed | 29 August 2012, 08:18:05 UTC |
86cff20 | Mihai Bazon | 28 August 2012, 12:39:53 UTC | docstring for AST_StatementWithBody | 28 August 2012, 12:39:53 UTC |
1b6bcca | Mihai Bazon | 28 August 2012, 12:38:35 UTC | fix output for arrays containing undefined values [1,,2,] ==> [1,,2] instead of [1,undefined,2] | 28 August 2012, 12:38:35 UTC |
7fcb6bc | Mihai Bazon | 28 August 2012, 12:29:58 UTC | fix code generator for this case: if (foo) { with (bar) if (baz) x(); } else y(); (the compressor removes the brackets since the consequent consists of a single statement, but the codegen must include the brackets because otherwise the `else` would refer to the inner `if`) | 28 August 2012, 12:29:58 UTC |
ce8e8d5 | Mihai Bazon | 27 August 2012, 09:29:53 UTC | added README | 27 August 2012, 09:29:53 UTC |
bf70205 | Mihai Bazon | 27 August 2012, 08:48:07 UTC | minor | 27 August 2012, 08:48:07 UTC |
58a3b5e | Mihai Bazon | 27 August 2012, 08:01:27 UTC | update (c) years | 27 August 2012, 08:01:41 UTC |
8dfa9fe | Mihai Bazon | 27 August 2012, 08:00:26 UTC | minor | 27 August 2012, 08:00:26 UTC |
4437e7a | Mihai Bazon | 27 August 2012, 08:00:22 UTC | fix compressing `a,b; return c;` into `return a,b,c;` | 27 August 2012, 08:00:22 UTC |
a8e49f1 | Mihai Bazon | 27 August 2012, 07:59:33 UTC | added print_to_string helper method | 27 August 2012, 07:59:33 UTC |
8d233c3 | Mihai Bazon | 23 August 2012, 07:39:33 UTC | fix current_col and force a newline every 32K (support options.max_line_len) | 23 August 2012, 07:39:33 UTC |
95b18e5 | Mihai Bazon | 22 August 2012, 18:28:59 UTC | added license | 22 August 2012, 18:28:59 UTC |
159a6f0 | Mihai Bazon | 22 August 2012, 12:21:58 UTC | wrote more of the compressor and added some tests | 22 August 2012, 12:21:58 UTC |
f53e139 | Mihai Bazon | 22 August 2012, 10:20:05 UTC | fix output for certain edge cases the statements if, for, do, while and with might have an AST_EmptyStatement as body; if that's the case, we need to make sure that the semicolon gets in the output. | 22 August 2012, 10:20:05 UTC |
fb8c9e3 | Mihai Bazon | 21 August 2012, 17:06:57 UTC | declare some properties in the node constructor so that they're copied in clone | 21 August 2012, 21:01:55 UTC |
1b839eb | Mihai Bazon | 21 August 2012, 13:27:57 UTC | hint that brackets may be required in AST_BlockStatement | 21 August 2012, 16:16:05 UTC |
ffe58a9 | Mihai Bazon | 21 August 2012, 12:45:05 UTC | cleaned up some mess and started the actual compressor | 21 August 2012, 13:14:43 UTC |
7ae1c60 | Mihai Bazon | 21 August 2012, 09:55:56 UTC | some reorganization (moved pretty much everything that relates to scope in scope.js, added a module for NodeJS that can be used with require() and exports everything.) | 21 August 2012, 10:53:16 UTC |
92bd53b | Mihai Bazon | 21 August 2012, 09:37:05 UTC | handle labels properly (they can't be handled the same way as variables in a scope) | 21 August 2012, 09:45:06 UTC |
159333f | Mihai Bazon | 21 August 2012, 08:53:19 UTC | warn about unreferenced symbols | 21 August 2012, 09:07:34 UTC |
99456c6 | Mihai Bazon | 21 August 2012, 08:38:49 UTC | more fixes: - added walker for AST_ObjectProperty - handle redefinitions properly (only mangle one symbol, make them all point to a single definition) DynarchLIB seems to run fine after mangling + compressed output. | 21 August 2012, 08:38:49 UTC |
458e251 | Mihai Bazon | 20 August 2012, 14:19:30 UTC | added mangler and other stuff | 20 August 2012, 14:32:35 UTC |
1fe0ff9 | Mihai Bazon | 19 August 2012, 19:46:00 UTC | doc (WIP) | 19 August 2012, 21:35:54 UTC |
6c35135 | Mihai Bazon | 19 August 2012, 12:57:50 UTC | simple visitor API and code to figure out scope and references | 19 August 2012, 12:57:50 UTC |
4488758 | Mihai Bazon | 18 August 2012, 09:29:57 UTC | some fixes (need testing) in AST_If codegen | 18 August 2012, 09:29:57 UTC |
cd8ae5f | Mihai Bazon | 17 August 2012, 20:08:09 UTC | minor whitespace issues | 17 August 2012, 20:08:09 UTC |
ef87c9f | Mihai Bazon | 17 August 2012, 16:04:23 UTC | big speed improvement (observable when beautify = false) who would have thought that str.charAt(str.length - 1) is not a constant, instant operation? seems to get slower and slower as the string grows. 0.6s vs. 3s | 17 August 2012, 16:04:23 UTC |
901f770 | Mihai Bazon | 17 August 2012, 15:33:26 UTC | don't output both space and semicolon when beautify=false | 17 August 2012, 15:33:26 UTC |
07cbc8d | Mihai Bazon | 17 August 2012, 14:56:16 UTC | added some comments about the rules governing parens | 17 August 2012, 15:06:29 UTC |
4fb6021 | Mihai Bazon | 17 August 2012, 13:27:43 UTC | fix one more glitch | 17 August 2012, 13:27:43 UTC |
13f7b11 | Mihai Bazon | 17 August 2012, 12:59:42 UTC | code generator finally seems to work properly | 17 August 2012, 12:59:42 UTC |
c7c163b | Mihai Bazon | 16 August 2012, 16:54:37 UTC | lots'o'fixes in the output routines; still a looong way to go. | 16 August 2012, 18:36:16 UTC |
7f273c3 | Mihai Bazon | 16 August 2012, 15:11:04 UTC | codegen and dropped the useless walker | 16 August 2012, 15:11:04 UTC |
c0ba9e2 | Mihai Bazon | 15 August 2012, 10:32:37 UTC | WIP | 15 August 2012, 11:50:27 UTC |
861e26a | Mihai Bazon | 27 May 2012, 14:25:31 UTC | WIP | 03 June 2012, 20:10:31 UTC |
22bb5e8 | Mihai Bazon | 27 May 2012, 11:36:51 UTC | added small node test script | 27 May 2012, 11:36:51 UTC |
46e7507 | Mihai Bazon | 27 May 2012, 11:36:44 UTC | Fixes some gotchas. DynarchLIB (660K) now passes parsing in 440ms (about 30% slower than the parser in UglifyJS v1). | 27 May 2012, 11:36:44 UTC |
562b12f | Mihai Bazon | 27 May 2012, 11:09:01 UTC | init repo | 27 May 2012, 11:13:26 UTC |