aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4scopedvalue_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-24 15:41:03 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-15 07:37:20 +0000
commitdf7710a2052a205267854f611e12e120b2dfdc26 (patch)
treec1b8f7118a13da8e143fe92472e5fea124d9788a /src/qml/jsruntime/qv4scopedvalue_p.h
parent3a8d6123d1947d18db15bf8b30f59cdea7e31380 (diff)
Get rid of Scope.size
The value was only set in debug builds, but never checked against. As this can't work with how ExecutionContexts are now stacked, let's get rid of it. Change-Id: I20f26afd7872a4783d163f913dde01858c3df792 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 0f0d50bdee..221c4e23c8 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -54,18 +54,12 @@ struct ScopedValue;
struct Scope {
inline Scope(ExecutionContext *ctx)
: engine(ctx->d()->engine)
-#ifndef QT_NO_DEBUG
- , size(0)
-#endif
{
mark = engine->jsStackTop;
}
explicit Scope(ExecutionEngine *e)
: engine(e)
-#ifndef QT_NO_DEBUG
- , size(0)
-#endif
{
mark = engine->jsStackTop;
}
@@ -83,9 +77,6 @@ struct Scope {
}
Value *alloc(int nValues) {
-#ifndef QT_NO_DEBUG
- size += nValues;
-#endif
return engine->jsAlloca(nValues);
}
@@ -95,9 +86,6 @@ struct Scope {
ExecutionEngine *engine;
Value *mark;
-#ifndef QT_NO_DEBUG
- mutable int size;
-#endif
private:
Q_DISABLE_COPY(Scope)
@@ -109,18 +97,12 @@ struct ScopedValue
{
ptr = scope.engine->jsStackTop++;
ptr->setRawValue(0);
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
ScopedValue(const Scope &scope, const Value &v)
{
ptr = scope.engine->jsStackTop++;
*ptr = v;
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
ScopedValue(const Scope &scope, Heap::Base *o)
@@ -130,27 +112,18 @@ struct ScopedValue
#if QT_POINTER_SIZE == 4
ptr->setTag(QV4::Value::Managed_Type);
#endif
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
ScopedValue(const Scope &scope, Managed *m)
{
ptr = scope.engine->jsStackTop++;
ptr->setRawValue(m->asReturnedValue());
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
ScopedValue(const Scope &scope, const ReturnedValue &v)
{
ptr = scope.engine->jsStackTop++;
ptr->setRawValue(v);
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
ScopedValue &operator=(const Value &v) {
@@ -214,18 +187,12 @@ struct Scoped
#if QT_POINTER_SIZE == 4
ptr->setTag(QV4::Value::Managed_Type);
#endif
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, const Value &v)
{
ptr = scope.engine->jsStackTop++;
setPointer(v.as<T>());
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, Heap::Base *o)
{
@@ -233,69 +200,45 @@ struct Scoped
v = o;
ptr = scope.engine->jsStackTop++;
setPointer(v.as<T>());
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, const ScopedValue &v)
{
ptr = scope.engine->jsStackTop++;
setPointer(v.ptr->as<T>());
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, const Value &v, _Convert)
{
ptr = scope.engine->jsStackTop++;
ptr->setRawValue(value_convert<T>(scope.engine, v));
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, const Value *v)
{
ptr = scope.engine->jsStackTop++;
setPointer(v ? v->as<T>() : 0);
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, T *t)
{
ptr = scope.engine->jsStackTop++;
setPointer(t);
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, typename T::Data *t)
{
ptr = scope.engine->jsStackTop++;
*ptr = t;
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, const ReturnedValue &v)
{
ptr = scope.engine->jsStackTop++;
setPointer(QV4::Value::fromReturnedValue(v).as<T>());
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped(const Scope &scope, const ReturnedValue &v, _Convert)
{
ptr = scope.engine->jsStackTop++;
ptr->setRawValue(value_convert<T>(scope.engine, QV4::Value::fromReturnedValue(v)));
-#ifndef QT_NO_DEBUG
- ++scope.size;
-#endif
}
Scoped<T> &operator=(Heap::Base *o) {