aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-01-24 22:55:39 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-31 11:13:48 +0100
commita78a48c5328ea746dfd161599894a4a5b11041bd (patch)
tree1e38f4334a8e3efdb5761d862baaa465141bf543 /src
parentd96478044ae0dfbcc35113e3941aa79604ba83a0 (diff)
Cleanups
Remove SafeValue, it was used to port over to an exact GC. Since we now have that, we can now safely merge it with QV4::Value again. Also rename SafeString to StringValue for better naming consistency. Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp8
-rw-r--r--src/qml/compiler/qv4compileddata_p.h8
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp12
-rw-r--r--src/qml/compiler/qv4isel_masm_p.h18
-rw-r--r--src/qml/compiler/qv4isel_moth_p.h2
-rw-r--r--src/qml/jsapi/qjsvalueiterator_p.h4
-rw-r--r--src/qml/jsruntime/qv4argumentsobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp28
-rw-r--r--src/qml/jsruntime/qv4arraydata_p.h14
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp4
-rw-r--r--src/qml/jsruntime/qv4context.cpp6
-rw-r--r--src/qml/jsruntime/qv4context_p.h6
-rw-r--r--src/qml/jsruntime/qv4dateobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp6
-rw-r--r--src/qml/jsruntime/qv4engine_p.h106
-rw-r--r--src/qml/jsruntime/qv4function_p.h2
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp14
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h8
-rw-r--r--src/qml/jsruntime/qv4mm.cpp6
-rw-r--r--src/qml/jsruntime/qv4object.cpp4
-rw-r--r--src/qml/jsruntime/qv4object_p.h6
-rw-r--r--src/qml/jsruntime/qv4objectiterator_p.h2
-rw-r--r--src/qml/jsruntime/qv4property_p.h4
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h2
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4regexpobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp12
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h2
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h69
-rw-r--r--src/qml/jsruntime/qv4stringobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4value_inl_p.h2
-rw-r--r--src/qml/jsruntime/qv4value_p.h70
-rw-r--r--src/qml/jsruntime/qv4variantobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp36
-rw-r--r--src/qml/jsruntime/qv4vme_moth_p.h2
-rw-r--r--src/qml/qml/qqmlcomponent.cpp6
-rw-r--r--src/qml/qml/qqmlvme.cpp4
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp2
39 files changed, 238 insertions, 253 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 367ada194b..aa8db06fd5 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -67,15 +67,15 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
assert(!runtimeStrings);
assert(data);
- runtimeStrings = (QV4::SafeString *)malloc(data->stringTableSize * sizeof(QV4::SafeString));
+ runtimeStrings = (QV4::StringValue *)malloc(data->stringTableSize * sizeof(QV4::StringValue));
// memset the strings to 0 in case a GC run happens while we're within the loop below
- memset(runtimeStrings, 0, data->stringTableSize * sizeof(QV4::SafeString));
+ memset(runtimeStrings, 0, data->stringTableSize * sizeof(QV4::StringValue));
for (uint i = 0; i < data->stringTableSize; ++i)
runtimeStrings[i] = engine->newIdentifier(data->stringAt(i));
- runtimeRegularExpressions = new QV4::SafeValue[data->regexpTableSize];
+ runtimeRegularExpressions = new QV4::Value[data->regexpTableSize];
// memset the regexps to 0 in case a GC run happens while we're within the loop below
- memset(runtimeRegularExpressions, 0, data->regexpTableSize * sizeof(QV4::SafeValue));
+ memset(runtimeRegularExpressions, 0, data->regexpTableSize * sizeof(QV4::Value));
for (uint i = 0; i < data->regexpTableSize; ++i) {
const CompiledData::RegExp *re = data->regexpAt(i);
int flags = 0;
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 385a650d8e..c953f6413d 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -201,8 +201,8 @@ struct Unit
const RegExp *regexpAt(int index) const {
return reinterpret_cast<const RegExp*>(reinterpret_cast<const char *>(this) + offsetToRegexpTable + index * sizeof(RegExp));
}
- const QV4::SafeValue *constants() const {
- return reinterpret_cast<const QV4::SafeValue*>(reinterpret_cast<const char *>(this) + offsetToConstantTable);
+ const QV4::Value *constants() const {
+ return reinterpret_cast<const QV4::Value*>(reinterpret_cast<const char *>(this) + offsetToConstantTable);
}
const JSClassMember *jsClassAt(int idx, int *nMembers) const {
@@ -508,9 +508,9 @@ struct Q_QML_EXPORT CompilationUnit
QString fileName() const { return data->stringAt(data->sourceFileIndex); }
- QV4::SafeString *runtimeStrings; // Array
+ QV4::StringValue *runtimeStrings; // Array
QV4::Lookup *runtimeLookups;
- QV4::SafeValue *runtimeRegularExpressions;
+ QV4::Value *runtimeRegularExpressions;
QV4::InternalClass **runtimeClasses;
QVector<QV4::Function *> runtimeFunctions;
// QVector<QV4::Function *> runtimeFunctionsSortedByAddress;
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index 427a6b7d56..a1145c2f10 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -245,12 +245,12 @@ Assembler::Pointer Assembler::loadTempAddress(RegisterID baseReg, V4IR::Temp *t)
case V4IR::Temp::Formal:
case V4IR::Temp::ScopedFormal: {
loadPtr(Address(context, qOffsetOf(ExecutionContext, callData)), baseReg);
- offset = sizeof(CallData) + (t->index - 1) * sizeof(SafeValue);
+ offset = sizeof(CallData) + (t->index - 1) * sizeof(Value);
} break;
case V4IR::Temp::Local:
case V4IR::Temp::ScopedLocal: {
loadPtr(Address(context, qOffsetOf(CallContext, locals)), baseReg);
- offset = t->index * sizeof(SafeValue);
+ offset = t->index * sizeof(Value);
} break;
case V4IR::Temp::StackSlot: {
return stackSlotPointer(t);
@@ -266,7 +266,7 @@ Assembler::Pointer Assembler::loadStringAddress(RegisterID reg, const QString &s
loadPtr(Address(Assembler::ContextRegister, qOffsetOf(QV4::ExecutionContext, compilationUnit)), Assembler::ScratchRegister);
loadPtr(Address(Assembler::ScratchRegister, qOffsetOf(QV4::CompiledData::CompilationUnit, runtimeStrings)), reg);
const int id = _isel->registerString(string);
- return Pointer(reg, id * sizeof(QV4::SafeString));
+ return Pointer(reg, id * sizeof(QV4::StringValue));
}
void Assembler::loadStringRef(RegisterID reg, const QString &string)
@@ -274,7 +274,7 @@ void Assembler::loadStringRef(RegisterID reg, const QString &string)
loadPtr(Address(Assembler::ContextRegister, qOffsetOf(QV4::ExecutionContext, compilationUnit)), reg);
loadPtr(Address(reg, qOffsetOf(QV4::CompiledData::CompilationUnit, runtimeStrings)), reg);
const int id = _isel->registerString(string);
- addPtr(TrustedImmPtr(id * sizeof(QV4::SafeString)), reg);
+ addPtr(TrustedImmPtr(id * sizeof(QV4::StringValue)), reg);
}
template <typename Result, typename Source>
@@ -615,7 +615,7 @@ void InstructionSelection::run(int functionIndex)
const int locals = _as->stackLayout().calculateJSStackFrameSize();
_as->loadPtr(Address(Assembler::ContextRegister, qOffsetOf(ExecutionContext, engine)), Assembler::ScratchRegister);
_as->loadPtr(Address(Assembler::ScratchRegister, qOffsetOf(ExecutionEngine, jsStackTop)), Assembler::LocalsRegister);
- _as->addPtr(Assembler::TrustedImm32(sizeof(QV4::SafeValue)*locals), Assembler::LocalsRegister);
+ _as->addPtr(Assembler::TrustedImm32(sizeof(QV4::Value)*locals), Assembler::LocalsRegister);
_as->storePtr(Assembler::LocalsRegister, Address(Assembler::ScratchRegister, qOffsetOf(ExecutionEngine, jsStackTop)));
int lastLine = -1;
@@ -1931,7 +1931,7 @@ void InstructionSelection::visitRet(V4IR::Ret *s)
_as->exceptionReturnLabel = _as->label();
const int locals = _as->stackLayout().calculateJSStackFrameSize();
- _as->subPtr(Assembler::TrustedImm32(sizeof(QV4::SafeValue)*locals), Assembler::LocalsRegister);
+ _as->subPtr(Assembler::TrustedImm32(sizeof(QV4::Value)*locals), Assembler::LocalsRegister);
_as->loadPtr(Address(Assembler::ContextRegister, qOffsetOf(ExecutionContext, engine)), Assembler::ScratchRegister);
_as->storePtr(Assembler::LocalsRegister, Address(Assembler::ScratchRegister, qOffsetOf(ExecutionEngine, jsStackTop)));
diff --git a/src/qml/compiler/qv4isel_masm_p.h b/src/qml/compiler/qv4isel_masm_p.h
index eb4a2b9cb6..b1e981533b 100644
--- a/src/qml/compiler/qv4isel_masm_p.h
+++ b/src/qml/compiler/qv4isel_masm_p.h
@@ -351,7 +351,7 @@ public:
// space for the callee saved registers
int frameSize = RegisterSize * calleeSavedRegisterCount;
- frameSize += savedRegCount * sizeof(QV4::SafeValue); // these get written out as Values, not as native registers
+ frameSize += savedRegCount * sizeof(QV4::Value); // these get written out as Values, not as native registers
frameSize = WTF::roundUpToMultipleOf(StackAlignment, frameSize + stackSpaceAllocatedOtherwise);
frameSize -= stackSpaceAllocatedOtherwise;
@@ -361,8 +361,8 @@ public:
int calculateJSStackFrameSize() const
{
- const int locals = (localCount + sizeof(QV4::CallData)/sizeof(QV4::SafeValue) - 1 + maxOutgoingArgumentCount) + 1;
- int frameSize = locals * sizeof(QV4::SafeValue);
+ const int locals = (localCount + sizeof(QV4::CallData)/sizeof(QV4::Value) - 1 + maxOutgoingArgumentCount) + 1;
+ int frameSize = locals * sizeof(QV4::Value);
return frameSize;
}
@@ -372,7 +372,7 @@ public:
Q_ASSERT(idx < localCount);
Pointer addr = callDataAddress(0);
- addr.offset -= sizeof(QV4::SafeValue) * (idx + 1);
+ addr.offset -= sizeof(QV4::Value) * (idx + 1);
return addr;
}
@@ -384,11 +384,11 @@ public:
Q_ASSERT(argument < maxOutgoingArgumentCount);
const int index = maxOutgoingArgumentCount - argument;
- return Pointer(Assembler::LocalsRegister, sizeof(QV4::SafeValue) * (-index));
+ return Pointer(Assembler::LocalsRegister, sizeof(QV4::Value) * (-index));
}
Pointer callDataAddress(int offset = 0) const {
- return Pointer(Assembler::LocalsRegister, -(sizeof(QV4::CallData) + sizeof(QV4::SafeValue) * (maxOutgoingArgumentCount - 1)) + offset);
+ return Pointer(Assembler::LocalsRegister, -(sizeof(QV4::CallData) + sizeof(QV4::Value) * (maxOutgoingArgumentCount - 1)) + offset);
}
Address savedRegPointer(int offset) const
@@ -396,7 +396,7 @@ public:
Q_ASSERT(offset >= 0);
Q_ASSERT(offset < savedRegCount);
- const int off = offset * sizeof(QV4::SafeValue);
+ const int off = offset * sizeof(QV4::Value);
return Address(Assembler::StackFrameRegister, - calleeSavedRegisterSpace() - off);
}
@@ -657,7 +657,7 @@ public:
void storeUInt32ReturnValue(RegisterID dest)
{
- Pointer tmp(StackPointerRegister, -int(sizeof(QV4::SafeValue)));
+ Pointer tmp(StackPointerRegister, -int(sizeof(QV4::Value)));
storeReturnValue(tmp);
toUInt32Register(tmp, dest);
}
@@ -669,7 +669,7 @@ public:
xor64(ScratchRegister, ReturnValueRegister);
move64ToDouble(ReturnValueRegister, dest);
#else
- Pointer tmp(StackPointerRegister, -int(sizeof(QV4::SafeValue)));
+ Pointer tmp(StackPointerRegister, -int(sizeof(QV4::Value)));
storeReturnValue(tmp);
loadDouble(tmp, dest);
#endif
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h
index 65c706a7b0..b43868d186 100644
--- a/src/qml/compiler/qv4isel_moth_p.h
+++ b/src/qml/compiler/qv4isel_moth_p.h
@@ -160,7 +160,7 @@ private:
int scratchTempIndex() const { return _function->tempCount; }
int callDataStart() const { return scratchTempIndex() + 1; }
- int outgoingArgumentTempStart() const { return callDataStart() + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue); }
+ int outgoingArgumentTempStart() const { return callDataStart() + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value); }
int frameSize() const { return outgoingArgumentTempStart() + _function->maxNumberOfArguments; }
template <int Instr>
diff --git a/src/qml/jsapi/qjsvalueiterator_p.h b/src/qml/jsapi/qjsvalueiterator_p.h
index 80d1885811..882c779c00 100644
--- a/src/qml/jsapi/qjsvalueiterator_p.h
+++ b/src/qml/jsapi/qjsvalueiterator_p.h
@@ -58,11 +58,11 @@ public:
QV4::PersistentValue iterator;
QV4::Property currentProperty;
QV4::PropertyAttributes currentAttributes;
- QV4::SafeString currentName;
+ QV4::StringValue currentName;
uint currentIndex;
QV4::Property nextProperty;
QV4::PropertyAttributes nextAttributes;
- QV4::SafeString nextName;
+ QV4::StringValue nextName;
uint nextIndex;
};
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h
index 20354272f2..b50c4f081d 100644
--- a/src/qml/jsruntime/qv4argumentsobject_p.h
+++ b/src/qml/jsruntime/qv4argumentsobject_p.h
@@ -80,7 +80,7 @@ struct ArgumentsObject: Object {
Q_MANAGED_TYPE(ArgumentsObject)
CallContext *context;
bool fullyCreated;
- QVector<SafeValue> mappedArguments;
+ QVector<Value> mappedArguments;
ArgumentsObject(CallContext *context);
~ArgumentsObject() {}
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index 63fe650cd5..44727cba17 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -110,7 +110,7 @@ void ArrayData::realloc(Object *o, Type newType, uint offset, uint alloc, bool e
newType = Complex;
alloc = qMax(alloc, 2*oldAlloc) + offset;
- size_t size = alloc*sizeof(SafeValue);
+ size_t size = alloc*sizeof(Value);
if (enforceAttributes)
size += alloc*sizeof(PropertyAttributes);
@@ -120,7 +120,7 @@ void ArrayData::realloc(Object *o, Type newType, uint offset, uint alloc, bool e
new (newData) SimpleArrayData(o->engine());
newData->alloc = alloc - offset;
newData->type = newType;
- newData->data = reinterpret_cast<SafeValue *>(newData + 1) + offset;
+ newData->data = reinterpret_cast<Value *>(newData + 1) + offset;
newData->attrs = enforceAttributes ? reinterpret_cast<PropertyAttributes *>(newData->data + alloc) + offset : 0;
newData->offset = offset;
newData->len = d ? static_cast<SimpleArrayData *>(d)->len : 0;
@@ -131,13 +131,13 @@ void ArrayData::realloc(Object *o, Type newType, uint offset, uint alloc, bool e
new (newData) SparseArrayData(o->engine());
newData->alloc = alloc;
newData->type = newType;
- newData->data = reinterpret_cast<SafeValue *>(newData + 1);
+ newData->data = reinterpret_cast<Value *>(newData + 1);
newData->attrs = enforceAttributes ? reinterpret_cast<PropertyAttributes *>(newData->data + alloc) : 0;
o->arrayData = newData;
}
if (d) {
- memcpy(o->arrayData->data, d->data, sizeof(SafeValue)*toCopy);
+ memcpy(o->arrayData->data, d->data, sizeof(Value)*toCopy);
if (enforceAttributes) {
if (d->attrs)
memcpy(o->arrayData->attrs, d->attrs, sizeof(PropertyAttributes)*toCopy);
@@ -267,7 +267,7 @@ PropertyAttributes SimpleArrayData::attribute(const ArrayData *d, uint index)
return d->attrs[index];
}
-void SimpleArrayData::push_front(Object *o, SafeValue *values, uint n)
+void SimpleArrayData::push_front(Object *o, Value *values, uint n)
{
SimpleArrayData *dd = static_cast<SimpleArrayData *>(o->arrayData);
Q_ASSERT(!dd->attrs);
@@ -309,8 +309,8 @@ uint SimpleArrayData::truncate(Object *o, uint newLen)
return newLen;
if (dd->attrs) {
- SafeValue *it = dd->data + dd->len;
- const SafeValue *begin = dd->data + newLen;
+ Value *it = dd->data + dd->len;
+ const Value *begin = dd->data + newLen;
while (--it >= begin) {
if (!it->isEmpty() && !dd->attrs[it - dd->data].isConfigurable()) {
newLen = it - dd->data + 1;
@@ -328,7 +328,7 @@ uint SimpleArrayData::length(const ArrayData *d)
return static_cast<const SimpleArrayData *>(d)->len;
}
-bool SimpleArrayData::putArray(Object *o, uint index, SafeValue *values, uint n)
+bool SimpleArrayData::putArray(Object *o, uint index, Value *values, uint n)
{
SimpleArrayData *dd = static_cast<SimpleArrayData *>(o->arrayData);
if (index + n > dd->alloc) {
@@ -347,7 +347,7 @@ void SparseArrayData::free(ArrayData *d, uint idx)
{
Q_ASSERT(d && d->type == ArrayData::Sparse);
SparseArrayData *dd = static_cast<SparseArrayData *>(d);
- SafeValue *v = dd->data + idx;
+ Value *v = dd->data + idx;
if (dd->attrs && dd->attrs[idx].isAccessor()) {
// double slot, free both. Order is important, so we have a double slot for allocation again afterwards.
v[1].tag = Value::Empty_Type;
@@ -502,7 +502,7 @@ PropertyAttributes SparseArrayData::attribute(const ArrayData *d, uint index)
return d->attrs[n->value];
}
-void SparseArrayData::push_front(Object *o, SafeValue *values, uint n)
+void SparseArrayData::push_front(Object *o, Value *values, uint n)
{
Q_ASSERT(!o->arrayData->attrs);
for (int i = n - 1; i >= 0; --i) {
@@ -561,7 +561,7 @@ uint SparseArrayData::length(const ArrayData *d)
return n ? n->key() + 1 : 0;
}
-bool SparseArrayData::putArray(Object *o, uint index, SafeValue *values, uint n)
+bool SparseArrayData::putArray(Object *o, uint index, Value *values, uint n)
{
for (uint i = 0; i < n; ++i)
put(o, index + i, values[i]);
@@ -637,7 +637,7 @@ public:
inline ArrayElementLessThan(ExecutionContext *context, ObjectRef thisObject, const ValueRef comparefn)
: m_context(context), thisObject(thisObject), m_comparefn(comparefn) {}
- bool operator()(const SafeValue &v1, const SafeValue &v2) const;
+ bool operator()(const Value &v1, const Value &v2) const;
private:
ExecutionContext *m_context;
@@ -646,7 +646,7 @@ private:
};
-bool ArrayElementLessThan::operator()(const SafeValue &v1, const SafeValue &v2) const
+bool ArrayElementLessThan::operator()(const Value &v1, const Value &v2) const
{
Scope scope(m_context);
@@ -761,7 +761,7 @@ void ArrayData::sort(ExecutionContext *context, ObjectRef thisObject, const Valu
ArrayElementLessThan lessThan(context, thisObject, comparefn);
- SafeValue *begin = thisObject->arrayData->data;
+ Value *begin = thisObject->arrayData->data;
std::sort(begin, begin + len, lessThan);
#ifdef CHECK_SPARSE_ARRAYS
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h
index 48b17a239f..f127c75fb0 100644
--- a/src/qml/jsruntime/qv4arraydata_p.h
+++ b/src/qml/jsruntime/qv4arraydata_p.h
@@ -67,11 +67,11 @@ struct ArrayVTable
ArrayData *(*reallocate)(Object *o, uint n, bool enforceAttributes);
ReturnedValue (*get)(const ArrayData *d, uint index);
bool (*put)(Object *o, uint index, ValueRef value);
- bool (*putArray)(Object *o, uint index, SafeValue *values, uint n);
+ bool (*putArray)(Object *o, uint index, Value *values, uint n);
bool (*del)(Object *o, uint index);
void (*setAttribute)(Object *o, uint index, PropertyAttributes attrs);
PropertyAttributes (*attribute)(const ArrayData *d, uint index);
- void (*push_front)(Object *o, SafeValue *values, uint n);
+ void (*push_front)(Object *o, Value *values, uint n);
ReturnedValue (*pop_front)(Object *o);
uint (*truncate)(Object *o, uint newLen);
uint (*length)(const ArrayData *d);
@@ -95,7 +95,7 @@ struct Q_QML_EXPORT ArrayData : public Managed
uint alloc;
Type type;
PropertyAttributes *attrs;
- SafeValue *data;
+ Value *data;
const ArrayVTable *vtable() const { return reinterpret_cast<const ArrayVTable *>(internalClass->vtable); }
bool isSparse() const { return this && type == Sparse; }
@@ -154,11 +154,11 @@ struct Q_QML_EXPORT SimpleArrayData : public ArrayData
static ReturnedValue get(const ArrayData *d, uint index);
static bool put(Object *o, uint index, ValueRef value);
- static bool putArray(Object *o, uint index, SafeValue *values, uint n);
+ static bool putArray(Object *o, uint index, Value *values, uint n);
static bool del(Object *o, uint index);
static void setAttribute(Object *o, uint index, PropertyAttributes attrs);
static PropertyAttributes attribute(const ArrayData *d, uint index);
- static void push_front(Object *o, SafeValue *values, uint n);
+ static void push_front(Object *o, Value *values, uint n);
static ReturnedValue pop_front(Object *o);
static uint truncate(Object *o, uint newLen);
static uint length(const ArrayData *d);
@@ -184,11 +184,11 @@ struct Q_QML_EXPORT SparseArrayData : public ArrayData
static ArrayData *reallocate(Object *o, uint n, bool enforceAttributes);
static ReturnedValue get(const ArrayData *d, uint index);
static bool put(Object *o, uint index, ValueRef value);
- static bool putArray(Object *o, uint index, SafeValue *values, uint n);
+ static bool putArray(Object *o, uint index, Value *values, uint n);
static bool del(Object *o, uint index);
static void setAttribute(Object *o, uint index, PropertyAttributes attrs);
static PropertyAttributes attribute(const ArrayData *d, uint index);
- static void push_front(Object *o, SafeValue *values, uint n);
+ static void push_front(Object *o, Value *values, uint n);
static ReturnedValue pop_front(Object *o);
static uint truncate(Object *o, uint newLen);
static uint length(const ArrayData *d);
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 9a2407fe2c..652c0f00ac 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -629,8 +629,8 @@ ReturnedValue ArrayPrototype::method_indexOf(CallContext *ctx)
Q_ASSERT(instance->arrayType() == ArrayData::Simple || instance->arrayType() == ArrayData::Complex);
if (len > instance->arrayData->length())
len = instance->arrayData->length();
- SafeValue *val = instance->arrayData->data;
- SafeValue *end = val + len;
+ Value *val = instance->arrayData->data;
+ Value *end = val + len;
val += fromIndex;
while (val < end) {
if (!val->isEmpty()) {
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index cc712c759b..15fea72b25 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -71,13 +71,13 @@ CallContext *ExecutionContext::newCallContext(FunctionObject *function, CallData
c->lookups = c->compilationUnit->runtimeLookups;
}
- c->locals = (SafeValue *)(c + 1);
+ c->locals = (Value *)(c + 1);
if (function->varCount)
std::fill(c->locals, c->locals + function->varCount, Primitive::undefinedValue());
c->callData = reinterpret_cast<CallData *>(c->locals + function->varCount);
- ::memcpy(c->callData, callData, sizeof(CallData) + (callData->argc - 1) * sizeof(SafeValue));
+ ::memcpy(c->callData, callData, sizeof(CallData) + (callData->argc - 1) * sizeof(Value));
if (callData->argc < static_cast<int>(function->formalParameterCount))
std::fill(c->callData->args + c->callData->argc, c->callData->args + function->formalParameterCount, Primitive::undefinedValue());
c->callData->argc = qMax((uint)callData->argc, function->formalParameterCount);
@@ -214,7 +214,7 @@ CallContext::CallContext(ExecutionEngine *engine, ObjectRef qml, FunctionObject
lookups = compilationUnit->runtimeLookups;
}
- locals = (SafeValue *)(this + 1);
+ locals = (Value *)(this + 1);
if (function->varCount)
std::fill(locals, locals + function->varCount, Primitive::undefinedValue());
}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 2d782f9a31..b5c9736725 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -174,7 +174,7 @@ struct CallContext : public ExecutionContext
FunctionObject *function;
int realArgumentCount;
- SafeValue *locals;
+ Value *locals;
Object *activation;
inline ReturnedValue argument(int i);
@@ -192,8 +192,8 @@ struct CatchContext : public ExecutionContext
{
CatchContext(ExecutionEngine *engine, const StringRef exceptionVarName, const ValueRef exceptionValue);
- SafeString exceptionVarName;
- SafeValue exceptionValue;
+ StringValue exceptionVarName;
+ Value exceptionValue;
};
struct WithContext : public ExecutionContext
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index ad8dec87c9..c52e8c3ee1 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -54,7 +54,7 @@ namespace QV4 {
struct DateObject: Object {
V4_OBJECT
Q_MANAGED_TYPE(DateObject)
- SafeValue value;
+ Value value;
DateObject(ExecutionEngine *engine, const ValueRef date): Object(engine->dateClass) {
value = date;
}
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 66216e6d85..6768de27f1 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -197,11 +197,11 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory)
// we allow it to grow to 2 times JSStackLimit, as we can overshoot due to garbage collection
// and ScopedValues allocated outside of JIT'ed methods.
*jsStack = WTF::PageAllocation::allocate(2*JSStackLimit, WTF::OSAllocator::JSVMStackPages, true);
- jsStackBase = (SafeValue *)jsStack->base();
+ jsStackBase = (Value *)jsStack->base();
jsStackTop = jsStackBase;
// set up stack limits
- jsStackLimit = jsStackBase + JSStackLimit/sizeof(SafeValue);
+ jsStackLimit = jsStackBase + JSStackLimit/sizeof(Value);
cStackLimit = getStackLimit();
Scope scope(this);
@@ -457,7 +457,7 @@ Returned<FunctionObject> *ExecutionEngine::newBuiltinFunction(ExecutionContext *
return f->asReturned<FunctionObject>();
}
-Returned<BoundFunction> *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<SafeValue> &boundArgs)
+Returned<BoundFunction> *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<Value> &boundArgs)
{
Q_ASSERT(target);
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index ecb5f2b4d5..8a7cd75a7b 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -135,18 +135,18 @@ public:
GlobalContext *rootContext;
- SafeValue *jsStackTop;
- SafeValue *jsStackLimit;
+ Value *jsStackTop;
+ Value *jsStackLimit;
quintptr cStackLimit;
WTF::BumpPointerAllocator *bumperPointerAllocator; // Used by Yarr Regex engine.
enum { JSStackLimit = 4*1024*1024 };
WTF::PageAllocation *jsStack;
- SafeValue *jsStackBase;
+ Value *jsStackBase;
- SafeValue *stackPush(uint nValues) {
- SafeValue *ptr = jsStackTop;
+ Value *stackPush(uint nValues) {
+ Value *ptr = jsStackTop;
jsStackTop = ptr + nValues;
return ptr;
}
@@ -174,22 +174,22 @@ public:
QV8Engine *v8Engine;
- 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;
- SafeValue sequencePrototype;
+ 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;
+ Value sequencePrototype;
QQmlJS::MemoryPool classPool;
InternalClass *emptyClass;
@@ -228,36 +228,36 @@ public:
QVector<Property> argumentsAccessors;
- SafeString id_undefined;
- SafeString id_null;
- SafeString id_true;
- SafeString id_false;
- SafeString id_boolean;
- SafeString id_number;
- SafeString id_string;
- SafeString id_object;
- SafeString id_function;
- SafeString id_length;
- SafeString id_prototype;
- SafeString id_constructor;
- SafeString id_arguments;
- SafeString id_caller;
- SafeString id_callee;
- SafeString id_this;
- SafeString id___proto__;
- SafeString id_enumerable;
- SafeString id_configurable;
- SafeString id_writable;
- SafeString id_value;
- SafeString id_get;
- SafeString id_set;
- SafeString id_eval;
- SafeString id_uintMax;
- SafeString id_name;
- SafeString id_index;
- SafeString id_input;
- SafeString id_toString;
- SafeString id_valueOf;
+ StringValue id_undefined;
+ StringValue id_null;
+ StringValue id_true;
+ StringValue id_false;
+ StringValue id_boolean;
+ StringValue id_number;
+ StringValue id_string;
+ StringValue id_object;
+ StringValue id_function;
+ StringValue id_length;
+ StringValue id_prototype;
+ StringValue id_constructor;
+ StringValue id_arguments;
+ StringValue id_caller;
+ StringValue id_callee;
+ StringValue id_this;
+ StringValue id___proto__;
+ StringValue id_enumerable;
+ StringValue id_configurable;
+ StringValue id_writable;
+ StringValue id_value;
+ StringValue id_get;
+ StringValue id_set;
+ StringValue id_eval;
+ StringValue id_uintMax;
+ StringValue id_name;
+ StringValue id_index;
+ StringValue id_input;
+ StringValue id_toString;
+ StringValue id_valueOf;
QSet<CompiledData::CompilationUnit*> compilationUnits;
QMap<quintptr, QV4::Function*> allFunctions;
@@ -295,7 +295,7 @@ public:
ExecutionContext *popContext();
Returned<FunctionObject> *newBuiltinFunction(ExecutionContext *scope, const StringRef name, ReturnedValue (*code)(CallContext *));
- Returned<BoundFunction> *newBoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<SafeValue> &boundArgs);
+ Returned<BoundFunction> *newBoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<Value> &boundArgs);
Returned<Object> *newObject();
Returned<Object> *newObject(InternalClass *internalClass);
@@ -352,7 +352,7 @@ public:
bool recheckCStackLimits();
// Exception handling
- SafeValue exceptionValue;
+ Value exceptionValue;
quint32 hasException;
StackTrace exceptionStackTrace;
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index 8a14665e42..377b45bfa3 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -81,7 +81,7 @@ struct InternalClass;
struct Lookup;
struct Function {
- SafeString name;
+ StringValue name;
const CompiledData::Function *compiledFunction;
CompiledData::CompilationUnit *compilationUnit;
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index a6ed03cea8..a3e47c42ca 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -352,7 +352,7 @@ ReturnedValue FunctionPrototype::method_apply(CallContext *ctx)
} else {
int alen = qMin(len, arr->arrayData->length());
if (alen)
- memcpy(callData->args, arr->arrayData->data, alen*sizeof(SafeValue));
+ memcpy(callData->args, arr->arrayData->data, alen*sizeof(Value));
for (quint32 i = alen; i < len; ++i)
callData->args[i] = Primitive::undefinedValue();
}
@@ -387,7 +387,7 @@ ReturnedValue FunctionPrototype::method_bind(CallContext *ctx)
return ctx->throwTypeError();
ScopedValue boundThis(scope, ctx->argument(0));
- QVector<SafeValue> boundArgs;
+ QVector<Value> boundArgs;
for (int i = 1; i < ctx->callData->argc; ++i)
boundArgs += ctx->callData->args[i];
@@ -643,7 +643,7 @@ DEFINE_OBJECT_VTABLE(IndexedBuiltinFunction);
DEFINE_OBJECT_VTABLE(BoundFunction);
-BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<SafeValue> &boundArgs)
+BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<Value> &boundArgs)
: FunctionObject(scope, QStringLiteral("__bound function__"))
, target(target)
, boundArgs(boundArgs)
@@ -683,8 +683,8 @@ ReturnedValue BoundFunction::call(Managed *that, CallData *dd)
ScopedCallData callData(scope, f->boundArgs.size() + dd->argc);
callData->thisObject = f->boundThis;
- memcpy(callData->args, f->boundArgs.constData(), f->boundArgs.size()*sizeof(SafeValue));
- memcpy(callData->args + f->boundArgs.size(), dd->args, dd->argc*sizeof(SafeValue));
+ memcpy(callData->args, f->boundArgs.constData(), f->boundArgs.size()*sizeof(Value));
+ memcpy(callData->args + f->boundArgs.size(), dd->args, dd->argc*sizeof(Value));
return f->target->call(callData);
}
@@ -696,8 +696,8 @@ ReturnedValue BoundFunction::construct(Managed *that, CallData *dd)
return Encode::undefined();
ScopedCallData callData(scope, f->boundArgs.size() + dd->argc);
- memcpy(callData->args, f->boundArgs.constData(), f->boundArgs.size()*sizeof(SafeValue));
- memcpy(callData->args + f->boundArgs.size(), dd->args, dd->argc*sizeof(SafeValue));
+ memcpy(callData->args, f->boundArgs.constData(), f->boundArgs.size()*sizeof(Value));
+ memcpy(callData->args + f->boundArgs.size(), dd->args, dd->argc*sizeof(Value));
return f->target->construct(callData);
}
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index 64a1dc92d2..d1fc56adad 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -111,7 +111,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
};
ExecutionContext *scope;
- SafeString name;
+ StringValue name;
unsigned int formalParameterCount;
unsigned int varCount;
Function *function;
@@ -228,10 +228,10 @@ struct SimpleScriptFunction: FunctionObject {
struct BoundFunction: FunctionObject {
V4_OBJECT
FunctionObject *target;
- SafeValue boundThis;
- QVector<SafeValue> boundArgs;
+ Value boundThis;
+ QVector<Value> boundArgs;
- BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<SafeValue> &boundArgs);
+ BoundFunction(ExecutionContext *scope, FunctionObjectRef target, const ValueRef boundThis, const QVector<Value> &boundArgs);
~BoundFunction() {}
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index 0ba0b18cda..7bb41f1eec 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -355,7 +355,7 @@ Managed *MemoryManager::alloc(std::size_t size)
void MemoryManager::mark()
{
- SafeValue *markBase = m_d->engine->jsStackTop;
+ Value *markBase = m_d->engine->jsStackTop;
m_d->engine->markObjects();
@@ -698,8 +698,8 @@ void MemoryManager::collectFromStack() const
void MemoryManager::collectFromJSStack() const
{
- SafeValue *v = engine()->jsStackBase;
- SafeValue *top = engine()->jsStackTop;
+ Value *v = engine()->jsStackBase;
+ Value *top = engine()->jsStackTop;
while (v < top) {
Managed *m = v->asManaged();
if (m && m->inUse)
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 93ad51d26f..e9775cc1ed 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -581,7 +581,7 @@ void Object::advanceIterator(Managed *m, ObjectIterator *it, StringRef name, uin
}
// dense arrays
while (it->arrayIndex < o->arrayData->length()) {
- SafeValue *val = o->arrayData->data + it->arrayIndex;
+ Value *val = o->arrayData->data + it->arrayIndex;
PropertyAttributes a = o->arrayData->attributes(it->arrayIndex);
++it->arrayIndex;
if (!val->isEmpty()
@@ -1118,7 +1118,7 @@ void Object::copyArrayData(Object *other)
d->len = static_cast<SimpleArrayData *>(other->arrayData)->len;
d->offset = 0;
}
- memcpy(arrayData->data, other->arrayData->data, arrayData->alloc*sizeof(SafeValue));
+ memcpy(arrayData->data, other->arrayData->data, arrayData->alloc*sizeof(Value));
}
setArrayLengthUnchecked(other->getLength());
}
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 7541178dc1..1df388d5b8 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -191,7 +191,7 @@ public:
bool arrayPut(uint index, ValueRef value) {
return arrayData->vtable()->put(this, index, value);
}
- bool arrayPut(uint index, SafeValue *values, uint n) {
+ bool arrayPut(uint index, Value *values, uint n) {
return arrayData->vtable()->putArray(this, index, values, n);
}
void setArrayAttributes(uint i, PropertyAttributes a) {
@@ -304,7 +304,7 @@ private:
struct BooleanObject: Object {
V4_OBJECT
Q_MANAGED_TYPE(BooleanObject)
- SafeValue value;
+ Value value;
BooleanObject(ExecutionEngine *engine, const ValueRef val)
: Object(engine->booleanClass) {
value = val;
@@ -320,7 +320,7 @@ protected:
struct NumberObject: Object {
V4_OBJECT
Q_MANAGED_TYPE(NumberObject)
- SafeValue value;
+ Value value;
NumberObject(ExecutionEngine *engine, const ValueRef val)
: Object(engine->numberClass) {
value = val;
diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h
index 6d0b5fcc80..dafd269590 100644
--- a/src/qml/jsruntime/qv4objectiterator_p.h
+++ b/src/qml/jsruntime/qv4objectiterator_p.h
@@ -97,7 +97,7 @@ struct ForEachIteratorObject: Object {
protected:
static void markObjects(Managed *that, ExecutionEngine *e);
- SafeValue workArea[2];
+ Value workArea[2];
};
diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h
index bc2b961d22..aceb6022f8 100644
--- a/src/qml/jsruntime/qv4property_p.h
+++ b/src/qml/jsruntime/qv4property_p.h
@@ -52,8 +52,8 @@ namespace QV4 {
struct FunctionObject;
struct Property {
- SafeValue value;
- SafeValue set;
+ Value value;
+ Value set;
// Section 8.10
inline void fullyPopulated(PropertyAttributes *attrs) {
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 235aaf94db..25b1aee281 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -694,7 +694,7 @@ PropertyAttributes QObjectWrapper::query(const Managed *m, StringRef name)
QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(engine);
QQmlPropertyData local;
if (that->findProperty(engine, qmlContext, name, IgnoreRevision, &local)
- || name->equals(const_cast<SafeString &>(that->m_destroy)) || name->equals(engine->id_toString))
+ || name->equals(const_cast<StringValue &>(that->m_destroy)) || name->equals(engine->id_toString))
return QV4::Attr_Data;
else
return QV4::Object::query(m, name);
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index 75cfa26cdd..38003eb3c2 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -111,7 +111,7 @@ private:
QQmlPropertyData *findProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, String *name, RevisionMode revisionMode, QQmlPropertyData *local) const;
QPointer<QObject> m_object;
- SafeString m_destroy;
+ StringValue m_destroy;
static ReturnedValue get(Managed *m, const StringRef name, bool *hasProperty);
static void put(Managed *m, const StringRef name, const ValueRef value);
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 1b93542f8a..3b1dc02194 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -433,7 +433,7 @@ ReturnedValue RegExpPrototype::method_compile(CallContext *ctx)
return ctx->throwTypeError();
ScopedCallData callData(scope, ctx->callData->argc);
- memcpy(callData->args, ctx->callData->args, ctx->callData->argc*sizeof(SafeValue));
+ memcpy(callData->args, ctx->callData->args, ctx->callData->argc*sizeof(Value));
Scoped<RegExpObject> re(scope, ctx->engine->regExpCtor.asFunctionObject()->construct(callData));
diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h
index a4cb4b9fb5..cf699509cd 100644
--- a/src/qml/jsruntime/qv4regexpobject_p.h
+++ b/src/qml/jsruntime/qv4regexpobject_p.h
@@ -107,8 +107,8 @@ struct RegExpCtor: FunctionObject
V4_OBJECT
RegExpCtor(ExecutionContext *scope);
- SafeValue lastMatch;
- SafeString lastInput;
+ Value lastMatch;
+ StringValue lastInput;
int lastMatchStart;
int lastMatchEnd;
void clearLastMatch();
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index a991940c6b..a3cae3382d 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -383,8 +383,8 @@ ReturnedValue __qmljs_object_default_value(Object *object, int typeHint)
if (engine->hasException)
return Encode::undefined();
- SafeString *meth1 = &engine->id_toString;
- SafeString *meth2 = &engine->id_valueOf;
+ StringValue *meth1 = &engine->id_toString;
+ StringValue *meth2 = &engine->id_valueOf;
if (typeHint == NUMBER_HINT)
qSwap(meth1, meth2);
@@ -894,7 +894,7 @@ ReturnedValue __qmljs_call_property(ExecutionContext *context, const StringRef n
ReturnedValue __qmljs_call_property_lookup(ExecutionContext *context, uint index, CallDataRef callData)
{
Lookup *l = context->lookups + index;
- SafeValue v;
+ Value v;
v = l->getter(l, callData->thisObject);
if (!v.isObject())
return context->throwTypeError();
@@ -982,7 +982,7 @@ ReturnedValue __qmljs_construct_property(ExecutionContext *context, const String
ReturnedValue __qmljs_construct_property_lookup(ExecutionContext *context, uint index, CallDataRef callData)
{
Lookup *l = context->lookups + index;
- SafeValue v;
+ Value v;
v = l->getter(l, callData->thisObject);
if (!v.isObject())
return context->throwTypeError();
@@ -1102,7 +1102,7 @@ void __qmljs_builtin_define_property(ExecutionContext *ctx, const ValueRef objec
}
}
-ReturnedValue __qmljs_builtin_define_array(ExecutionContext *ctx, SafeValue *values, uint length)
+ReturnedValue __qmljs_builtin_define_array(ExecutionContext *ctx, Value *values, uint length)
{
Scope scope(ctx);
Scoped<ArrayObject> a(scope, ctx->engine->newArrayObject());
@@ -1308,7 +1308,7 @@ QV4::ReturnedValue __qmljs_get_qml_singleton(QV4::NoThrowContext *ctx, const QV4
void __qmljs_builtin_convert_this_to_object(ExecutionContext *ctx)
{
- SafeValue *t = &ctx->callData->thisObject;
+ Value *t = &ctx->callData->thisObject;
if (t->isObject())
return;
if (t->isNullOrUndefined()) {
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h
index 4437198a7b..a7b21f506a 100644
--- a/src/qml/jsruntime/qv4runtime_p.h
+++ b/src/qml/jsruntime/qv4runtime_p.h
@@ -141,7 +141,7 @@ QV4::ExecutionContext *__qmljs_builtin_pop_scope(QV4::ExecutionContext *ctx);
ReturnedValue __qmljs_builtin_unwind_exception(ExecutionContext *ctx);
void __qmljs_builtin_declare_var(QV4::ExecutionContext *ctx, bool deletable, const QV4::StringRef name);
void __qmljs_builtin_define_property(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::StringRef name, QV4::ValueRef val);
-QV4::ReturnedValue __qmljs_builtin_define_array(QV4::ExecutionContext *ctx, SafeValue *values, uint length);
+QV4::ReturnedValue __qmljs_builtin_define_array(QV4::ExecutionContext *ctx, Value *values, uint length);
void __qmljs_builtin_define_getter_setter(QV4::ExecutionContext *ctx, const QV4::ValueRef object, const QV4::StringRef name, const QV4::ValueRef getter, const QV4::ValueRef setter);
QV4::ReturnedValue __qmljs_builtin_define_object_literal(QV4::ExecutionContext *ctx, const QV4::Value *args, int classId);
QV4::ReturnedValue __qmljs_builtin_setup_arguments_object(ExecutionContext *ctx);
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 37a61eb2fe..902f1f160a 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -75,13 +75,13 @@ struct Scope {
~Scope() {
#ifndef QT_NO_DEBUG
Q_ASSERT(engine->jsStackTop >= mark);
- memset(mark, 0, (engine->jsStackTop - mark)*sizeof(SafeValue));
+ memset(mark, 0, (engine->jsStackTop - mark)*sizeof(Value));
#endif
engine->jsStackTop = mark;
}
- SafeValue *alloc(int nValues) {
- SafeValue *ptr = engine->jsStackTop;
+ Value *alloc(int nValues) {
+ Value *ptr = engine->jsStackTop;
engine->jsStackTop += nValues;
#ifndef QT_NO_DEBUG
size += nValues;
@@ -94,7 +94,7 @@ struct Scope {
}
ExecutionEngine *engine;
- SafeValue *mark;
+ Value *mark;
#ifndef QT_NO_DEBUG
mutable int size;
#endif
@@ -178,17 +178,17 @@ struct ScopedValue
return *this;
}
- SafeValue *operator->() {
+ Value *operator->() {
return ptr;
}
- const SafeValue *operator->() const {
+ const Value *operator->() const {
return ptr;
}
ReturnedValue asReturnedValue() const { return ptr->val; }
- SafeValue *ptr;
+ Value *ptr;
};
template<typename T>
@@ -339,7 +339,7 @@ struct Scoped
#endif
}
- SafeValue *ptr;
+ Value *ptr;
};
struct CallData
@@ -356,14 +356,14 @@ struct CallData
return i < argc ? args[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue();
}
- SafeValue thisObject;
- SafeValue args[1];
+ Value thisObject;
+ Value args[1];
};
struct ScopedCallData {
ScopedCallData(Scope &scope, int argc)
{
- int size = qMax(argc, (int)QV4::Global::ReservedArgumentCount) + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue);
+ int size = qMax(argc, (int)QV4::Global::ReservedArgumentCount) + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value);
ptr = reinterpret_cast<CallData *>(scope.engine->stackPush(size));
ptr->tag = QV4::Value::Integer_Type;
ptr->argc = argc;
@@ -395,7 +395,7 @@ struct ValueRef {
: ptr(&v.d->value) {}
ValueRef(PersistentValuePrivate *p)
: ptr(&p->value) {}
- ValueRef(SafeValue &v) { ptr = &v; }
+ ValueRef(Value &v) { ptr = &v; }
// Important: Do NOT add a copy constructor to this class
// adding a copy constructor actually changes the calling convention, ie.
// is not even binary compatible. Adding it would break assumptions made
@@ -426,7 +426,7 @@ struct ValueRef {
operator Value *() {
return ptr;
}
- SafeValue *operator->() {
+ Value *operator->() {
return ptr;
}
@@ -440,9 +440,9 @@ struct ValueRef {
ReturnedValue asReturnedValue() const { return ptr->val; }
// ### get rid of this one!
- ValueRef(Value *v) { ptr = reinterpret_cast<SafeValue *>(v); }
+ ValueRef(Value *v) { ptr = reinterpret_cast<Value *>(v); }
private:
- SafeValue *ptr;
+ Value *ptr;
};
@@ -454,11 +454,11 @@ struct Referenced {
// in the jit'ed code.
Referenced(const Scoped<T> &v)
: ptr(v.ptr) {}
- Referenced(Safe<T> &v) { ptr = &v; }
- Referenced(SafeValue &v) {
+ Referenced(TypedValue<T> &v) { ptr = &v; }
+ Referenced(Value &v) {
ptr = value_cast<T>(v) ? &v : 0;
}
- static Referenced fromValuePointer(SafeValue *s) {
+ static Referenced fromValuePointer(Value *s) {
return Referenced(s);
}
@@ -515,7 +515,7 @@ struct Referenced {
static Referenced null() { return Referenced(Null); }
bool isNull() const { return !ptr; }
private:
- Referenced(SafeValue *v) {
+ Referenced(Value *v) {
ptr = v;
#if QT_POINTER_SIZE == 8
ptr->val = 0;
@@ -525,7 +525,7 @@ private:
}
enum _Null { Null };
Referenced(_Null) { ptr = 0; }
- SafeValue *ptr;
+ Value *ptr;
};
typedef Referenced<String> StringRef;
@@ -633,81 +633,74 @@ inline Value &Value::operator=(Returned<T> *t)
return *this;
}
-inline SafeValue &SafeValue::operator =(const ScopedValue &v)
+inline Value &Value::operator =(const ScopedValue &v)
{
val = v.ptr->val;
return *this;
}
template<typename T>
-inline SafeValue &SafeValue::operator=(Returned<T> *t)
-{
- val = t->getPointer()->asReturnedValue();
- return *this;
-}
-
-template<typename T>
-inline SafeValue &SafeValue::operator=(const Scoped<T> &t)
+inline Value &Value::operator=(const Scoped<T> &t)
{
val = t.ptr->val;
return *this;
}
-inline SafeValue &SafeValue::operator=(const ValueRef v)
+inline Value &Value::operator=(const ValueRef v)
{
val = v.asReturnedValue();
return *this;
}
template<typename T>
-inline Returned<T> *SafeValue::as()
+inline Returned<T> *Value::as()
{
return Returned<T>::create(value_cast<T>(*this));
}
template<typename T> inline
-Referenced<T> SafeValue::asRef()
+Referenced<T> Value::asRef()
{
return Referenced<T>(*this);
}
template<typename T>
-inline Safe<T> &Safe<T>::operator =(T *t)
+inline TypedValue<T> &TypedValue<T>::operator =(T *t)
{
val = t->asReturnedValue();
return *this;
}
template<typename T>
-inline Safe<T> &Safe<T>::operator =(const Scoped<T> &v)
+inline TypedValue<T> &TypedValue<T>::operator =(const Scoped<T> &v)
{
val = v.ptr->val;
return *this;
}
template<typename T>
-inline Safe<T> &Safe<T>::operator=(Returned<T> *t)
+inline TypedValue<T> &TypedValue<T>::operator=(Returned<T> *t)
{
val = t->getPointer()->asReturnedValue();
return *this;
}
template<typename T>
-inline Safe<T> &Safe<T>::operator =(const Referenced<T> &v)
+inline TypedValue<T> &TypedValue<T>::operator =(const Referenced<T> &v)
{
val = v.asReturnedValue();
return *this;
}
template<typename T>
-inline Safe<T> &Safe<T>::operator=(const Safe<T> &t)
+inline TypedValue<T> &TypedValue<T>::operator=(const TypedValue<T> &t)
{
val = t.val;
return *this;
}
template<typename T>
-inline Returned<T> * Safe<T>::ret() const
+inline Returned<T> * TypedValue<T>::ret() const
{
return Returned<T>::create(static_cast<T *>(managed()));
}
diff --git a/src/qml/jsruntime/qv4stringobject_p.h b/src/qml/jsruntime/qv4stringobject_p.h
index 9b26343c63..c38fd5b75f 100644
--- a/src/qml/jsruntime/qv4stringobject_p.h
+++ b/src/qml/jsruntime/qv4stringobject_p.h
@@ -53,7 +53,7 @@ struct StringObject: Object {
V4_OBJECT
Q_MANAGED_TYPE(StringObject)
- SafeValue value;
+ Value value;
mutable Property tmpProperty;
StringObject(ExecutionEngine *engine, const ValueRef value);
diff --git a/src/qml/jsruntime/qv4value_inl_p.h b/src/qml/jsruntime/qv4value_inl_p.h
index 2618ef3faa..7ec7e12b16 100644
--- a/src/qml/jsruntime/qv4value_inl_p.h
+++ b/src/qml/jsruntime/qv4value_inl_p.h
@@ -280,7 +280,7 @@ struct Q_QML_PRIVATE_EXPORT PersistentValuePrivate
{
PersistentValuePrivate(ReturnedValue v, ExecutionEngine *engine = 0, bool weak = false);
virtual ~PersistentValuePrivate();
- SafeValue value;
+ Value value;
uint refcount;
bool weak;
QV4::ExecutionEngine *engine;
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 2cc6a0b32b..e20cc66d08 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -328,14 +328,34 @@ struct Q_QML_EXPORT Value
ReturnedValue asReturnedValue() const { return val; }
static Value fromReturnedValue(ReturnedValue val) { Value v; v.val = val; return v; }
- Value &operator=(ReturnedValue v) { val = v; return *this; }
- template <typename T>
- inline Value &operator=(Returned<T> *t);
// Section 9.12
bool sameValue(Value other) const;
inline void mark(ExecutionEngine *e) const;
+
+ Value &operator =(const ScopedValue &v);
+ Value &operator=(ReturnedValue v) { val = v; return *this; }
+ template<typename T>
+ Value &operator=(Returned<T> *t);
+ template<typename T>
+ Value &operator=(T *t) {
+ val = Value::fromManaged(t).val;
+ return *this;
+ }
+
+ template<typename T>
+ Value &operator=(const Scoped<T> &t);
+ Value &operator=(const ValueRef v);
+ Value &operator=(const Value &v) {
+ val = v.val;
+ return *this;
+ }
+ template<typename T>
+ inline Returned<T> *as();
+ template<typename T>
+ inline Referenced<T> asRef();
+
};
inline Managed *Value::asManaged() const
@@ -404,47 +424,19 @@ inline Value Value::fromManaged(Managed *m)
return v;
}
-struct SafeValue : public Value
-{
- SafeValue &operator =(const ScopedValue &v);
- template<typename T>
- SafeValue &operator=(Returned<T> *t);
- SafeValue &operator=(ReturnedValue v) {
- val = v;
- return *this;
- }
- template<typename T>
- SafeValue &operator=(T *t) {
- val = Value::fromManaged(t).val;
- return *this;
- }
-
- template<typename T>
- SafeValue &operator=(const Scoped<T> &t);
- SafeValue &operator=(const ValueRef v);
- SafeValue &operator=(const Value &v) {
- val = v.val;
- return *this;
- }
- template<typename T>
- inline Returned<T> *as();
- template<typename T>
- inline Referenced<T> asRef();
-};
-
template <typename T>
-struct Safe : public SafeValue
+struct TypedValue : public Value
{
template<typename X>
- Safe &operator =(X *x) {
+ TypedValue &operator =(X *x) {
val = Value::fromManaged(x).val;
}
- Safe &operator =(T *t);
- Safe &operator =(const Scoped<T> &v);
- Safe &operator =(const Referenced<T> &v);
- Safe &operator =(Returned<T> *t);
+ TypedValue &operator =(T *t);
+ TypedValue &operator =(const Scoped<T> &v);
+ TypedValue &operator =(const Referenced<T> &v);
+ TypedValue &operator =(Returned<T> *t);
- Safe &operator =(const Safe<T> &t);
+ TypedValue &operator =(const TypedValue<T> &t);
bool operator!() const { return !managed(); }
@@ -455,7 +447,7 @@ struct Safe : public SafeValue
void mark(ExecutionEngine *e) { if (managed()) managed()->mark(e); }
};
-typedef Safe<String> SafeString;
+typedef TypedValue<String> StringValue;
template<typename T>
T *value_cast(const Value &v)
diff --git a/src/qml/jsruntime/qv4variantobject.cpp b/src/qml/jsruntime/qv4variantobject.cpp
index 5bfd7786e9..92cc19d8b9 100644
--- a/src/qml/jsruntime/qv4variantobject.cpp
+++ b/src/qml/jsruntime/qv4variantobject.cpp
@@ -77,7 +77,7 @@ QVariant VariantObject::toVariant(const QV4::ValueRef v)
if (v->isBoolean())
return QVariant(v->booleanValue());
if (v->isNumber()) {
- QV4::SafeValue val;
+ QV4::Value val;
val = v;
if (val.isInt32())
return QVariant(val.integerValue());
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 030e45045f..853328b652 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -170,7 +170,7 @@ Param traceParam(const Param &param)
goto catchException
QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
- QV4::SafeValue *stack, unsigned stackSize
+ QV4::Value *stack, unsigned stackSize
#ifdef MOTH_THREADED_INTERPRETER
, void ***storeJumpTable
#endif
@@ -200,7 +200,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
qDebug("Starting VME with context=%p and code=%p", context, code);
#endif // DO_TRACE_INSTR
- QV4::SafeString * const runtimeStrings = context->compilationUnit->runtimeStrings;
+ QV4::StringValue * const runtimeStrings = context->compilationUnit->runtimeStrings;
context->interpreterInstructionPointer = &code;
// setup lookup scopes
@@ -213,9 +213,9 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
}
}
- QV4::SafeValue **scopes = static_cast<QV4::SafeValue **>(alloca(sizeof(QV4::SafeValue *)*(2 + 2*scopeDepth)));
+ QV4::Value **scopes = static_cast<QV4::Value **>(alloca(sizeof(QV4::Value *)*(2 + 2*scopeDepth)));
{
- scopes[0] = const_cast<QV4::SafeValue *>(context->compilationUnit->data->constants());
+ scopes[0] = const_cast<QV4::Value *>(context->compilationUnit->data->constants());
// stack gets setup in push instruction
scopes[1] = 0;
QV4::ExecutionContext *scope = context;
@@ -328,7 +328,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
TRACE(inline, "stack size: %u", instr.value);
stackSize = instr.value;
stack = context->engine->stackPush(stackSize);
- memset(stack, 0, stackSize * sizeof(QV4::SafeValue));
+ memset(stack, 0, stackSize * sizeof(QV4::Value));
scopes[1] = stack;
MOTH_END_INSTR(Push)
@@ -343,7 +343,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
}
}
#endif // DO_TRACE_INSTR
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -353,7 +353,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(CallProperty)
TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(context)->toQString().toUtf8().constData());
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -363,7 +363,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(CallPropertyLookup)
TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(context)->toQString().toUtf8().constData());
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -372,7 +372,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_END_INSTR(CallPropertyLookup)
MOTH_BEGIN_INSTR(CallElement)
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -382,7 +382,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(CallActivationProperty)
TRACE(args, "starting at %d, length %d", instr.args, instr.argc);
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -392,7 +392,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(CallGlobalLookup)
TRACE(args, "starting at %d, length %d", instr.args, instr.argc);
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -475,12 +475,12 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(CallBuiltinDefineArray)
Q_ASSERT(instr.args + instr.argc <= stackSize);
- QV4::SafeValue *args = stack + instr.args;
+ QV4::Value *args = stack + instr.args;
STOREVALUE(instr.result, __qmljs_builtin_define_array(context, args, instr.argc));
MOTH_END_INSTR(CallBuiltinDefineArray)
MOTH_BEGIN_INSTR(CallBuiltinDefineObjectLiteral)
- QV4::SafeValue *args = stack + instr.args;
+ QV4::Value *args = stack + instr.args;
STOREVALUE(instr.result, __qmljs_builtin_define_object_literal(context, args, instr.internalClassId));
MOTH_END_INSTR(CallBuiltinDefineObjectLiteral)
@@ -494,7 +494,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_END_INSTR(CallBuiltinConvertThisToObject)
MOTH_BEGIN_INSTR(CreateValue)
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -503,7 +503,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_END_INSTR(CreateValue)
MOTH_BEGIN_INSTR(CreateProperty)
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -512,7 +512,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_END_INSTR(CreateProperty)
MOTH_BEGIN_INSTR(ConstructPropertyLookup)
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -522,7 +522,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(CreateActivationProperty)
TRACE(inline, "property name = %s, args = %d, argc = %d", runtimeStrings[instr.name]->toQString().toUtf8().constData(), instr.args, instr.argc);
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
@@ -532,7 +532,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_BEGIN_INSTR(ConstructGlobalLookup)
TRACE(inline, "property name = %s, args = %d, argc = %d", runtimeStrings[instr.name]->toQString().toUtf8().constData(), instr.args, instr.argc);
- Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::SafeValue) <= stackSize);
+ Q_ASSERT(instr.callData + instr.argc + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = QV4::Value::Integer_Type;
callData->argc = instr.argc;
diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h
index 974dfdd615..6c6b49d49f 100644
--- a/src/qml/jsruntime/qv4vme_moth_p.h
+++ b/src/qml/jsruntime/qv4vme_moth_p.h
@@ -61,7 +61,7 @@ public:
private:
QV4::ReturnedValue run(QV4::ExecutionContext *, const uchar *code,
- QV4::SafeValue *stack = 0, unsigned stackSize = 0
+ QV4::Value *stack = 0, unsigned stackSize = 0
#ifdef MOTH_THREADED_INTERPRETER
, void ***storeJumpTable = 0
#endif
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index a36150ee42..898a00a9bb 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -1085,9 +1085,9 @@ public:
QScopedPointer<QQmlComponentIncubator> incubator;
QV8Engine *v8;
QPointer<QObject> parent;
- QV4::SafeValue valuemap;
- QV4::SafeValue qmlGlobal;
- QV4::SafeValue m_statusChanged;
+ QV4::Value valuemap;
+ QV4::Value qmlGlobal;
+ QV4::Value m_statusChanged;
void statusChanged(QQmlIncubator::Status);
void setInitialState(QObject *);
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index e60413327a..58d656a846 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -226,7 +226,7 @@ static QVariant variantFromString(const QString &string)
return QQmlStringConverters::variantFromString(string);
}
-static QV4::ExecutionContext *qmlBindingContext(QQmlEngine *engine, QV4::ExecutionEngine *v4, QV4::SafeValue *qmlBindingWrappers, QQmlContextData *context, QObject *scope, int objIdx)
+static QV4::ExecutionContext *qmlBindingContext(QQmlEngine *engine, QV4::ExecutionEngine *v4, QV4::Value *qmlBindingWrappers, QQmlContextData *context, QObject *scope, int objIdx)
{
QV4::Scope valueScope(v4);
QV4::Scoped<QV4::QmlBindingWrapper> wrapper(valueScope, qmlBindingWrappers[objIdx]);
@@ -355,7 +355,7 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
QV4::ExecutionEngine *v4 = ep->v4engine();
QV4::Scope valueScope(v4);
QV4::ScopedValue tmpValue(valueScope);
- QV4::SafeValue *qmlBindingWrappers = valueScope.alloc(objects.capacity());
+ QV4::Value *qmlBindingWrappers = valueScope.alloc(objects.capacity());
std::fill(qmlBindingWrappers, qmlBindingWrappers + objects.capacity(), QV4::Primitive::undefinedValue());
int status = -1; // needed for dbus
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 1d22a6b483..a01ce5db90 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -915,7 +915,7 @@ struct QQuickJSContext2DImageData : public QV4::Object
- QV4::SafeValue pixelData;
+ QV4::Value pixelData;
};
DEFINE_OBJECT_VTABLE(QQuickJSContext2DImageData);