Commit Graph

168 Commits

Author SHA1 Message Date
Oswald Buddenhagen
dad37b23d8 maintain m_lineNo better during evaluation 2010-06-02 11:05:27 +02:00
Oswald Buddenhagen
b97b53d9bf generalize ALWAYS_INLINE somewhat 2010-06-02 11:05:27 +02:00
Oswald Buddenhagen
0b0bbff094 move and rename ProItemReturn to VisitReturn
it's private to ProFileEvaluator::Private since the getting rid of
the visitor pattern.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
5db91cf5bc add custom string type
ProString is almost a QStringRef, except that it keeps a copy of instead
of a pointer to the QString - to make it refcountable. additionally, it
holds a hash so it can be efficiently used for repetetive hash lookups.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
2fd83af82f optimize assembly of arguments for built-in functions
this function class just joins each string list argument into a
single string. so instead of first building a list and joining it
right afterwards, create a single string in the first place.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
25e6890c93 an empty argument list is still a list with one empty argument
that's actually kinda braindead, but that's qmake as usual.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
d47b00fca8 implement $$size() 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
a98ce55e7b simplify $$quote() implementation 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
95d5ad4ab3 unify parsing of boolean arguments 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
33c5befc7f use QList::contains() instead of iterating 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
a0cc2aec74 complain about unclosed scopes 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
c63453d878 reorganize AST
turn else, for(), defineTest() and defineReplace() into own node
types instead of treating them as magic conditionals/functions.
on top of that, introduce a proper branching node type, so finding
the alternative code paths can be moved into the parser instead of
burdening the evaluator with it.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
583d688ee4 make if() evaluation more qmake-like
... which basically means "break it".
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
a292fb1d77 interpret '!' operator only at start of token 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
f1b591bb06 merge ProFunction into ProCondition
there is no point in the split, given that there is nothing virtual any
more.
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
295e07eadc short-cut evaluation inside if() tests
this is consistent with the top-level scope evaluation.
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
40ffa44b74 inline doVariableReplace()
it's pretty trivial and not used a lot
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
e75092455c eliminate special splitting of INCLUDEPATH and DEPENDPATH
it wouldn't work as expected anyway, as the splitting rule (using the
semicolon in addition to whitespace) applied only to the string literal
from the pro file, but not any expanded [environment] variables, etc.
(i.e., where it might any make sense). so just drop it, as it would
considerably complicate following optimizations.
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
f269f86982 don't double-expand for() arguments
unlike in qmake, the arguments are already expanded at this point
(which is strictly speaking a bug for the iterator variable name),
so it is plain wrong to call doVariableReplace on them.
2010-04-20 12:02:10 +02:00
Oswald Buddenhagen
2af6e73c59 avoid detaching
amazingly enough, qlist::{first,last}() have non-const versions,
which are of course used when you least expect it ...
2010-04-20 12:02:10 +02:00
Oswald Buddenhagen
f26019bed8 fix location info in parsing-error messages 2010-04-20 12:02:10 +02:00
dt
9663067357 Fix deadlock in .pro file evaluation.
We used to indicate that the cache for a file is up to date by having a
Entry with ent->locker == 0. But we first wake up all threads and only
after all the threads who waited for that parse to complete we set
ent->locker to zero. Thus a different thread could get the impression
that it needs to wait for the parse thread, yet get no wake up.

We need a different flag to indicate that we are actually already done
parsing and the cache can simply be used instead of waiting for a wake
up.

Reviewed-By: ossi
2010-03-17 16:27:50 +01:00
hjk
9595504bda Long live the king! 2010-03-05 11:28:13 +01:00
Oswald Buddenhagen
e22e8035c6 make profile cache thread safe
Reviewed-by: thiago
2010-02-26 13:09:20 +01:00
Oswald Buddenhagen
66780cf198 cache failed parses as well 2010-02-26 13:09:20 +01:00
Oswald Buddenhagen
8bb90d47bd fix include() parseInto implementation
the "namespace" created by the prefix is supposed to be cleared before
new values are added.
2010-02-15 17:14:25 +01:00
Oswald Buddenhagen
1d39b04041 add legacy variable name mapping
we are so fast now, we can burn a few cycles again ... :}

variable names are mapped as soon as they become known (and not when
using them). that sprinkles map() calls everywhere, but it's faster.
2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
6060bb5b9e cut down code dupe in count() impl 2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
081f27e3ea process second arg of include() 2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
07abc847e8 expand $()-style env vars in some more places like qmake does
Task-number: QTCREATORBUG-229
2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
35bc0f3609 simplify exists() implementation 2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
5d0f65fc91 don't assert on $$files(/foo) 2010-02-10 16:20:41 +01:00
Oswald Buddenhagen
caedef35e2 fix conditionals on the qmakespec
- match just the spec name without a possible path
- resolve the default spec
2010-02-10 15:40:53 +01:00
Oswald Buddenhagen
e0e4c4d3bf properly evaluate one-arg-variant of CONFIG() 2010-02-10 15:40:53 +01:00
Oswald Buddenhagen
46bc5a80ac make $$files() qmake-compliant again
unfortunately, the efforts to use only absolute paths internally became
externally visible ...
2010-02-10 15:40:53 +01:00
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