aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4profiling_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-05-17 16:58:01 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-05-18 10:10:15 +0000
commitc78a4dcb610de48d6d339ca61b38bd1394e11995 (patch)
tree1fd6c273b479a66045c40965da9ab8de90af5ae2 /src/qml/jsruntime/qv4profiling_p.h
parent709f6370884b110def2e4665df8fa7bbf5fae734 (diff)
V4 profiling: Don't needlessly resolve locations
Resolving locations is fairly expensive and we only need to do it once per location. Change-Id: I8716858f45da9c085e50527ada0611531641dafe Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4profiling_p.h')
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index 0b4193204f..bb128b7cf3 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -81,13 +81,23 @@ struct FunctionCallProperties {
};
struct FunctionLocation {
+ FunctionLocation(const QString &name = QString(), const QString &file = QString(),
+ int line = -1, int column = -1) :
+ name(name), file(file), line(line), column(column)
+ {}
+
+ bool isValid()
+ {
+ return !name.isEmpty();
+ }
+
QString name;
QString file;
int line;
int column;
};
-typedef QHash<qint64, QV4::Profiling::FunctionLocation> FunctionLocationHash;
+typedef QHash<quintptr, QV4::Profiling::FunctionLocation> FunctionLocationHash;
struct MemoryAllocationProperties {
qint64 timestamp;