diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-15 15:54:36 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-08-16 10:14:13 +0200 |
commit | b88626a3a59f7dcd01be6fe2a8236b14ca1176f5 (patch) | |
tree | f3a1f6db220f2d6a7d71f2ddc7b466e205658f40 /src/qml/compiler/qv4compileddata_p.h | |
parent | 214680abec598bc01c4f90b3cecc60c7968c0c41 (diff) |
Ported regular expressions over to be run-time generated data
Change-Id: I04e693d4923c97c3d869a5beb17011f6aad85f03
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index cd8a76b7c1..e267f0fecb 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -65,6 +65,20 @@ namespace CompiledData { struct String; struct Function; struct Lookup; +struct RegExp; + +struct RegExp +{ + enum Flags { + RegExp_Global = 0x01, + RegExp_IgnoreCase = 0x02, + RegExp_Multiline = 0x04 + }; + quint32 flags; + quint32 stringIndex; + + static int calculateSize() { return sizeof(RegExp); } +}; static const char magic_str[] = "qv4cdata"; @@ -85,6 +99,8 @@ struct Unit uint offsetToFunctionTable; uint lookupTableSize; uint offsetToLookupTable; + uint regexpTableSize; + uint offsetToRegexpTable; uint indexOfRootFunction; quint32 sourceFileIndex; @@ -101,8 +117,11 @@ struct Unit } const Lookup *lookupTable() const { return reinterpret_cast<const Lookup*>(reinterpret_cast<const char *>(this) + offsetToLookupTable); } + const RegExp *regexpAt(int index) const { + return reinterpret_cast<const RegExp*>(reinterpret_cast<const char *>(this) + offsetToRegexpTable + index * sizeof(RegExp)); + } - static int calculateSize(uint nStrings, uint nFunctions) { return (sizeof(Unit) + (nStrings + nFunctions) * sizeof(uint) + 7) & ~7; } + static int calculateSize(uint nStrings, uint nFunctions, uint nRegExps) { return (sizeof(Unit) + (nStrings + nFunctions ) * sizeof(uint) + nRegExps * RegExp::calculateSize() + 7) & ~7; } }; struct Function @@ -274,6 +293,7 @@ struct CompilationUnit QV4::String **runtimeStrings; // Array QV4::Lookup *runtimeLookups; + QV4::Value *runtimeRegularExpressions; QV4::Function *linkToEngine(QV4::ExecutionEngine *engine); |