Commit Graph

133 Commits

Author SHA1 Message Date
Oswald Buddenhagen
0e6fe766dd optimize function scoping
previously, the entire value hash was simply pushed on a stack upon
entering a custom function. the problem with that was that setting the
function's argument already detached (i.e., copied) the entire hash.
so instead store only actually modified values in nested scopes and let
lookups cascade to parent scopes.

improvement: 2% for qt, 15% for creator ...
2010-02-09 20:48:34 +01:00
Oswald Buddenhagen
62270c1c5b do not scope the per-file variable values
it is extremely unlikely that a function would change one of the
interesting variables (all types of source file lists) but not re-export
them subsequently. thus the scoping only complicates matters and burns
cpu cycles.

we ignore the tiny possibility that this could illegitimately reset a
list while doing exact parsing - the subsequent cumulative parsing would
most likely catch these files again anyway.
2010-02-09 20:48:33 +01:00
Oswald Buddenhagen
de3d24741d simplify parameter passing to insertUnique and removeEach 2010-02-09 20:48:33 +01:00
Oswald Buddenhagen
bc4e63a310 simplify returning per-file variable values
these values do not require evaluating magic variables. the semantics
would be totally unclear anyway.
2010-02-09 20:48:33 +01:00
Oswald Buddenhagen
4c9aca0cfc optimization: turn more constants into global statics 2010-02-08 17:24:18 +01:00
Oswald Buddenhagen
1f088a70ba make profile evaluator re-entrant
the last step was moving the statics to a common class which is
initialized at startup.
2010-02-08 17:24:18 +01:00
Oswald Buddenhagen
a4e4c44ac2 re-entrancy: $$list() counter cannot be static 2010-02-08 17:24:18 +01:00
Oswald Buddenhagen
cfa6203e52 BlockCursor was meant to be a Q_MOVABLE_TYPE ... 2010-02-08 17:24:18 +01:00
Kai Koehne
6c4b9ba227 Reapply unconnected changes from reverted commit
Only revert stuff that is linked to fast string concat.
2010-02-08 11:13:55 +01:00
Kai Koehne
999c73ad9d Revert "compile everything with QT_USE_FAST_CONCATENATION"
This reverts commit e70530c5ad. It
did break builds on older gcc versions (gcc 4.1.2 64 bit Linux,
gcc 4.0.1 on Mac OS X):

parser/qmljsgrammar_p.h: In static member function ???static int
QmlJSGrammar::nt_action(int, int)???:
parser/qmljsgrammar_p.h:188: error: ???QmlJSGrammar::<anonymous enum>???
is/uses anonymous type
parser/qmljsgrammar_p.h:188: error:   trying to instantiate
???template<class T> struct QConcatenable???
...
2010-02-08 10:56:50 +01:00
Oswald Buddenhagen
7cdb15e7fc try hard to ensure that feature paths are absolute 2010-02-05 19:25:43 +01:00
Robert Loehning
a5252a4463 Compile fixes.
Reviewed-by: Oswald Buddenhagen
2010-02-05 16:20:33 +01:00
Oswald Buddenhagen
e70530c5ad compile everything with QT_USE_FAST_CONCATENATION 2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
7df3082b6c optimize $$unique() 2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
938fb0af10 do not change current working directory while evaluating files
this makes the i/o part of the evaluator thread-safe.
for safety, assert absolute paths in IoUtils::exists().

on the way, i "stole" some code i wrote for KDE. there have been no
copyright-worthy contributions from others to it, so this is legal.
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
b309f9449a directly link ProItems instead of using QList<ProItem*>
somewhat faster again
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
42fd31fb12 remove unused functions 2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
a2dbeecdec remove visitor pattern
it's overengineered for our purpose and would just get in the way of
planned optimizations.
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
b891afbe27 optimize values()
use a hash of magic variable names to ints, which allows fast lookup
followed by a jump table dispatch
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen
45cc9df8a2 eliminate duplicates from qmake spec and feature paths
potentially reduces the number of file::exists() calls
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
b5fd00955f get rid of lots of qfileinfo and qfile calls
partly by removing unnecessary calls, partly by providing minimalistic
reimplementations.
this gives a quite incredible performance boost ...
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
18a515652a drastically cut down qregexp use
this gives a rather impressive speed boost.
if qmake wasn't trying to be so clever, we could get even more
out of this.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
3cdecdd9e1 integrate function argument splitting into expandVariableReferences()
that way we save the creation of a temporary stringlist
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
9b8a09b881 get rid of m_proitem
now that we know the size of the entire file, we can use a single fixed
buffer instead of growing one on-demand - in the case where we just read
the file, we can even re-use the file buffer itself.
this should improve performance for files with very many line
continuations, but the practical impact drowns in the noise.
anyway, the code is nicer, as we don't abuse qstring that obviously any
more.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
cac522b761 read file at once instead of line-wise
again several percent faster ...
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
cc635e2642 avoid QChar::unicode() calls in debug builds
in release mode they expand to nothing ... not so in debug mode.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
714e981c69 optimize expandVariableReferences()
- nest conditionals properly to avoid unnecessary tests
- avoid usage of QString::append(QChar) to save allocations
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
48d15b8a66 don't split value list right before expanding variables
the latter will do it anyway.
this eradicates the performance penalty from the previous commit at its
root.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
9c7d803aec don't pre-split RHS of variable assignments
creating tons of items is a tad allocation-intensive and thus slow.

this is probably slower for often-included files, as now the splitting
is done in every evaluation pass.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
61772da250 omit comments from the "AST"
now that the tree will not be written out any more, we can save some
cpu and memory by not recording the information.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
f9d955eb6c cache parsed pri & prf files
no point in re-parsing them over and over during the scan of a bigger
project ...

shaves off another 20% of the loading time of Qt 4.6.
2009-12-08 17:36:41 +01:00
Oswald Buddenhagen
0682dae77c ProfileEvaluator::Option => ProfileOption
makes forward delcs in headers possible
2009-12-08 17:36:41 +01:00
con
f3bdeb8c9a Share the code for determining used qmake arguments.
Move the code that compares the Qt version's debug|release property
with the build configuration's debug|release property
to the new build configuration class.

Reviewed-by: dt
2009-12-02 18:16:34 +01:00
Oswald Buddenhagen
8b9f29f923 implement eval() 2009-10-02 17:37:20 +02:00
Oswald Buddenhagen
9cb9f29d63 implement infile() and $$fromfile() 2009-09-23 18:19:58 +02:00
Oswald Buddenhagen
2513c0a93f don't attempt to read qmake cache if there is none
evaluating a file (which might not exist) is a bit different than just
merging a (possibly empty) map ...
2009-09-09 10:14:15 +02:00
Oswald Buddenhagen
37c5e2ddd3 revert acd090200 - no crash or even memory corruption reproducible 2009-09-09 02:56:36 +02:00
Oswald Buddenhagen
f1c881c4e0 cache_valuemap doesn't have to be a member any more 2009-09-09 02:56:36 +02:00
dt
acd090200a Fix crash. 2009-09-01 17:27:53 +02:00
dt
dad4aa05b7 Remove now dead code. 2009-09-01 16:13:56 +02:00
dt
f4c10deeb3 Fix parsing of .qmake.cache Fixes DESTDIR for debug_and_release_targets
Closer again to qmake, ossi won't like it, but this is exactly what
qmake does, even it it looks a little bit strange. He can come up with
a better fix after he is back from vacation.
2009-09-01 15:59:12 +02:00
Oswald Buddenhagen
002cc5b517 fix function argument evaluation
i think it is finally identical to qmake (i.e., equally braindamaged)
2009-08-14 17:38:13 +02:00
Oswald Buddenhagen
e13a55ce52 don't skip unconditional scopes 2009-08-14 17:38:13 +02:00
Oswald Buddenhagen
695ac13cdc remove some superfluous braces 2009-08-14 11:48:05 +02:00
Oswald Buddenhagen
3a24a6992b fix message reporting in derived classes
{log,error,file}Message() cannot contain logic which makes the output
conditional on private evaluator state, as they are virtual and thus
derived classes could receive messages which they are not supposed to
receive. so put the logic into likewise named functions in the private
class and call these throughout.
2009-08-14 11:48:05 +02:00
Oswald Buddenhagen
f1f2d0cd88 remove forgotten enum 2009-08-14 11:45:49 +02:00
Oswald Buddenhagen
7f50d949a9 fix line continuation parsing ... again 2009-08-14 11:45:49 +02:00
hjk
93cbef8724 long live the king 2009-08-14 09:30:56 +02:00
Keith Isdale
c2a1d75daa qmake's include function now supports three arguments
The second and third arguments to qmake's include function are
optional

Task-number: 259398
Reviewed-by: Stian Sandvik Thomassen
2009-08-14 15:41:26 +10:00
Oswald Buddenhagen
94c4ea83bc inherit functions from the base config
the base config is read with a separate reader. we saved its variables,
but not its custom function definitions.
2009-08-11 20:37:24 +02:00