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 ...
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.
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???
...
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.
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.
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.
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
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.
{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.