diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-01-24 22:55:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-31 11:13:48 +0100 |
commit | a78a48c5328ea746dfd161599894a4a5b11041bd (patch) | |
tree | 1e38f4334a8e3efdb5761d862baaa465141bf543 /src/qml/compiler | |
parent | d96478044ae0dfbcc35113e3941aa79604ba83a0 (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/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 8 | ||||
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 8 | ||||
-rw-r--r-- | src/qml/compiler/qv4isel_masm.cpp | 12 | ||||
-rw-r--r-- | src/qml/compiler/qv4isel_masm_p.h | 18 | ||||
-rw-r--r-- | src/qml/compiler/qv4isel_moth_p.h | 2 |
5 files changed, 24 insertions, 24 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> |