diff options
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4global_p.h | 8 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4profiling_p.h | 5 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 3 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 1 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4string.cpp | 12 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4string_p.h | 6 |
8 files changed, 21 insertions, 18 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 8f2c5174da..a11f7f0875 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -158,8 +158,6 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) } Q_ASSERT(maxCallDepth > 0); - MemoryManager::GCBlocker gcBlocker(memoryManager); - if (!factory) { #if QT_CONFIG(qml_interpreter) bool jitDisabled = true; diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index c37ad1668d..1dbc538be2 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -97,19 +97,19 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } // // NOTE: This should match the logic in qv4targetplatform_p.h! -#if defined(Q_PROCESSOR_X86) && !defined(__ILP32__) \ +#if defined(Q_PROCESSOR_X86) && (QT_POINTER_SIZE == 4) \ && (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD)) # define V4_ENABLE_JIT -#elif defined(Q_PROCESSOR_X86_64) && !defined(__ILP32__) \ +#elif defined(Q_PROCESSOR_X86_64) && (QT_POINTER_SIZE == 8) \ && (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)) # define V4_ENABLE_JIT -#elif defined(Q_PROCESSOR_ARM_32) +#elif defined(Q_PROCESSOR_ARM_32) && (QT_POINTER_SIZE == 4) # if defined(thumb2) || defined(__thumb2__) || ((defined(__thumb) || defined(__thumb__)) && __TARGET_ARCH_THUMB-0 == 4) # define V4_ENABLE_JIT # elif defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2 // clang 3.5 and later will set this if the core supports the Thumb-2 ISA. # define V4_ENABLE_JIT # endif -#elif defined(Q_PROCESSOR_ARM_64) +#elif defined(Q_PROCESSOR_ARM_64) && (QT_POINTER_SIZE == 8) # if defined(Q_OS_LINUX) # define V4_ENABLE_JIT # endif diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h index d27e853343..f75ac4d33a 100644 --- a/src/qml/jsruntime/qv4profiling_p.h +++ b/src/qml/jsruntime/qv4profiling_p.h @@ -158,12 +158,11 @@ public: FunctionCall &operator=(const FunctionCall &other) { if (&other != this) { - if (m_function) - m_function->compilationUnit->release(); + other.m_function->compilationUnit->addref(); + m_function->compilationUnit->release(); m_function = other.m_function; m_start = other.m_start; m_end = other.m_end; - m_function->compilationUnit->addref(); } return *this; } diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index 218695624b..41d8010fef 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -307,7 +307,8 @@ void RegExpCtor::markObjects(Heap::Base *that, ExecutionEngine *e) { RegExpCtor::Data *This = static_cast<RegExpCtor::Data *>(that); This->lastMatch.mark(e); - This->lastInput->mark(e); + if (This->lastInput) + This->lastInput->mark(e); FunctionObject::markObjects(that, e); } diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index d6c55926b1..023a739e33 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -499,6 +499,7 @@ Heap::String *RuntimeHelpers::convertToString(ExecutionEngine *engine, const Val { Scope scope(engine); ScopedValue prim(scope, RuntimeHelpers::toPrimitive(value, STRING_HINT)); + Q_ASSERT(!prim->isManaged() || prim->isString()); return RuntimeHelpers::convertToString(engine, prim); } case Value::Integer_Type: diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index b54177bee9..62145f36cc 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -88,8 +88,6 @@ void Script::parse() ExecutionEngine *v4 = scope->engine(); Scope valueScope(v4); - MemoryManager::GCBlocker gcBlocker(v4->memoryManager); - IR::Module module(v4->debugger() != 0); QQmlJS::Engine ee, *engine = ⅇ diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index 1efd8cb714..cde2131aab 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -102,6 +102,7 @@ void Heap::String::init(MemoryManager *mm, String *l, String *r) stringHash = UINT_MAX; largestSubLength = qMax(l->largestSubLength, r->largestSubLength); len = l->len + r->len; + Q_ASSERT(largestSubLength <= len); if (!l->largestSubLength && l->len > largestSubLength) largestSubLength = l->len; @@ -113,6 +114,15 @@ void Heap::String::init(MemoryManager *mm, String *l, String *r) simplifyString(); } +void Heap::String::destroy() { + if (!largestSubLength) { + mm->changeUnmanagedHeapSizeUsage(qptrdiff(-text->size) * (int)sizeof(QChar)); + if (!text->ref.deref()) + QStringData::deallocate(text); + } + Base::destroy(); +} + uint String::toUInt(bool *ok) const { *ok = true; @@ -151,7 +161,7 @@ void Heap::String::simplifyString() const text->ref.ref(); identifier = 0; largestSubLength = 0; - mm->growUnmanagedHeapSizeUsage(size_t(text->size) * sizeof(QChar)); + mm->changeUnmanagedHeapSizeUsage(qptrdiff(text->size) * (qptrdiff)sizeof(QChar)); } void Heap::String::append(const String *data, QChar *ch) diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index 4890a85724..5b0fd292d6 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -73,11 +73,7 @@ struct Q_QML_PRIVATE_EXPORT String : Base { #ifndef V4_BOOTSTRAP void init(MemoryManager *mm, const QString &text); void init(MemoryManager *mm, String *l, String *n); - void destroy() { - if (!largestSubLength && !text->ref.deref()) - QStringData::deallocate(text); - Base::destroy(); - } + void destroy(); void simplifyString() const; int length() const { Q_ASSERT((largestSubLength && |