aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-25 11:53:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:19 +0200
commit7872b380063d0497ba62fecfdc92148f1ea947af (patch)
treefeb551ff3e60428b0623603b250136d8b98719d1
parent4d49787af4ed146636a1b5209f19946988a93863 (diff)
Use SafeValue in more places
Change-Id: Ic15c1419c74f22bd7639ce8746ff11b15240b718 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp2
-rw-r--r--src/qml/jsruntime/qv4engine_p.h38
-rw-r--r--src/qml/jsruntime/qv4function_p.h2
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h14
-rw-r--r--src/qml/jsruntime/qv4value_def_p.h2
6 files changed, 30 insertions, 30 deletions
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index 6895205eaf..c6e5385a3f 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -796,7 +796,7 @@ static void *tryWrapper(ExecutionContext *context, void *localsPtr, MiddleOfFunc
{
exceptionVar = Value::undefinedValue();
void *addressToContinueAt = 0;
- Value *jsStackTop = context->engine->jsStackTop;
+ SafeValue *jsStackTop = context->engine->jsStackTop;
try {
addressToContinueAt = tryBody(context, localsPtr);
} catch (Exception& ex) {
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 62738c23bf..1721e59abb 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -121,7 +121,7 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory)
// reserve 8MB for the JS stack
*jsStack = WTF::PageAllocation::allocate(8*1024*1024, WTF::OSAllocator::JSVMStackPages, true);
- jsStackBase = (Value *)jsStack->base();
+ jsStackBase = (SafeValue *)jsStack->base();
jsStackTop = jsStackBase;
identifierTable = new IdentifierTable(this);
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 90639d582c..fdfbfc38e1 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -125,11 +125,11 @@ struct Q_QML_EXPORT ExecutionEngine
WTF::BumpPointerAllocator *bumperPointerAllocator; // Used by Yarr Regex engine.
WTF::PageAllocation *jsStack;
- Value *jsStackBase;
- Value *jsStackTop;
+ SafeValue *jsStackBase;
+ SafeValue *jsStackTop;
- Value *stackPush(uint nValues) {
- Value *ptr = jsStackTop;
+ SafeValue *stackPush(uint nValues) {
+ SafeValue *ptr = jsStackTop;
jsStackTop = ptr + nValues;
return ptr;
}
@@ -148,21 +148,21 @@ struct Q_QML_EXPORT ExecutionEngine
QV8Engine *v8Engine;
- Value objectCtor;
- Value stringCtor;
- Value numberCtor;
- Value booleanCtor;
- Value arrayCtor;
- Value functionCtor;
- Value dateCtor;
- Value regExpCtor;
- Value errorCtor;
- Value evalErrorCtor;
- Value rangeErrorCtor;
- Value referenceErrorCtor;
- Value syntaxErrorCtor;
- Value typeErrorCtor;
- Value uRIErrorCtor;
+ SafeValue objectCtor;
+ SafeValue stringCtor;
+ SafeValue numberCtor;
+ SafeValue booleanCtor;
+ SafeValue arrayCtor;
+ SafeValue functionCtor;
+ SafeValue dateCtor;
+ SafeValue regExpCtor;
+ SafeValue errorCtor;
+ SafeValue evalErrorCtor;
+ SafeValue rangeErrorCtor;
+ SafeValue referenceErrorCtor;
+ SafeValue syntaxErrorCtor;
+ SafeValue typeErrorCtor;
+ SafeValue uRIErrorCtor;
QQmlJS::MemoryPool classPool;
InternalClass *emptyClass;
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index 746abe910d..ca984e0059 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -86,7 +86,7 @@ struct Function {
const CompiledData::Function *compiledFunction;
CompiledData::CompilationUnit *compilationUnit;
inline ReturnedValue code(ExecutionContext *ctx, const uchar *data) {
- Value *stack = ctx->engine->jsStackTop;
+ SafeValue *stack = ctx->engine->jsStackTop;
try {
return codePtr(ctx, data);
} catch (...) {
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 30a9aa8b38..30b53e7e49 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -78,7 +78,7 @@ struct Scope {
}
Value *alloc(int nValues) {
- Value *ptr = engine->jsStackTop;
+ SafeValue *ptr = engine->jsStackTop;
engine->jsStackTop += nValues;
#ifndef QT_NO_DEBUG
size += nValues;
@@ -87,7 +87,7 @@ struct Scope {
}
ExecutionEngine *engine;
- Value *mark;
+ SafeValue *mark;
#ifndef QT_NO_DEBUG
mutable int size;
#endif
@@ -183,7 +183,7 @@ struct ScopedValue
ReturnedValue asReturnedValue() const { return ptr->val; }
- Value *ptr;
+ SafeValue *ptr;
};
template<typename T>
@@ -342,7 +342,7 @@ struct Scoped
#endif
}
- Value *ptr;
+ SafeValue *ptr;
};
struct CallData
@@ -433,9 +433,9 @@ struct ValueRef {
ReturnedValue asReturnedValue() const { return ptr->val; }
// ### get rid of this one!
- ValueRef(Value *v) { ptr = v; }
+ ValueRef(Value *v) { ptr = reinterpret_cast<SafeValue *>(v); }
private:
- Value *ptr;
+ SafeValue *ptr;
};
@@ -485,7 +485,7 @@ struct Referenced {
private:
enum _Null { Null };
Referenced(_Null) { ptr = 0; }
- Value *ptr;
+ SafeValue *ptr;
};
typedef Referenced<String> StringRef;
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h
index 5cf1581588..ae176292da 100644
--- a/src/qml/jsruntime/qv4value_def_p.h
+++ b/src/qml/jsruntime/qv4value_def_p.h
@@ -363,7 +363,7 @@ struct SafeValue : public Value
};
template <typename T>
-struct Safe : public Value
+struct Safe : public SafeValue
{
Safe &operator =(T *t);
Safe &operator =(const Scoped<T> &v);