Remove wtf dependencies from the v4 headers
authorLars Knoll <lars.knoll@digia.com>
Fri, 19 Apr 2013 09:47:50 +0000 (11:47 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Fri, 19 Apr 2013 11:07:31 +0000 (13:07 +0200)
Change-Id: I94a326a333067657319a8edeff76b3411c66856d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/v4vm/qv4engine.cpp
src/qml/qml/v4vm/qv4engine_p.h
src/qml/qml/v4vm/qv4regexp.cpp
src/qml/qml/v4vm/qv4regexpobject_p.h
src/qml/qml/v4vm/qv4runtime_p.h

index a81b492..cd0a16b 100644 (file)
@@ -68,6 +68,7 @@ namespace VM {
 ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
     : memoryManager(new QQmlJS::VM::MemoryManager)
     , executableAllocator(new QQmlJS::VM::ExecutableAllocator)
+    , bumperPointerAllocator(new WTF::BumpPointerAllocator)
     , debugger(0)
     , globalObject(0)
     , globalCode(0)
@@ -237,6 +238,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
 
 ExecutionEngine::~ExecutionEngine()
 {
+    delete bumperPointerAllocator;
     delete regExpCache;
     UnwindHelper::deregisterFunctions(functions);
     qDeleteAll(functions);
index 7777ca5..0046665 100644 (file)
@@ -49,7 +49,9 @@
 #include "qv4property_p.h"
 #include <setjmp.h>
 
-#include <wtf/BumpPointerAllocator.h>
+namespace WTF {
+class BumpPointerAllocator;
+}
 
 QT_BEGIN_NAMESPACE
 
@@ -115,7 +117,7 @@ struct Q_QML_EXPORT ExecutionEngine
     ExecutionContext *current;
     GlobalContext *rootContext;
 
-    WTF::BumpPointerAllocator bumperPointerAllocator; // Used by Yarr Regex engine.
+    WTF::BumpPointerAllocator *bumperPointerAllocator; // Used by Yarr Regex engine.
 
     Identifiers *identifierCache;
 
index 0ca3ae9..4ad04b9 100644 (file)
@@ -109,7 +109,7 @@ RegExp::RegExp(ExecutionEngine* engine, const QString &pattern, bool ignoreCase,
     if (error)
         return;
     m_subPatternCount = yarrPattern.m_numSubpatterns;
-    m_byteCode = JSC::Yarr::byteCompile(yarrPattern, &engine->bumperPointerAllocator);
+    m_byteCode = JSC::Yarr::byteCompile(yarrPattern, engine->bumperPointerAllocator);
 #if ENABLE(YARR_JIT)
     if (!yarrPattern.m_containsBackreferences) {
         JSC::JSGlobalData dummy(engine->executableAllocator);
index af30027..4c2e290 100644 (file)
@@ -51,7 +51,6 @@
 #include "qv4managed_p.h"
 #include "qv4property_p.h"
 #include "qv4objectiterator_p.h"
-#include "qv4regexp_p.h"
 
 #include <QtCore/QString>
 #include <QtCore/QHash>
@@ -64,6 +63,8 @@ QT_BEGIN_NAMESPACE
 namespace QQmlJS {
 namespace VM {
 
+struct RegExp;
+
 struct RegExpObject: Object {
     RegExp* value;
     Property *lastIndexProperty(ExecutionContext *ctx);
index b4cd826..c718efc 100644 (file)
@@ -53,7 +53,7 @@
 #include <cmath>
 #include <cassert>
 
-#include <wtf/MathExtras.h>
+//#include <wtf/MathExtras.h>
 
 #ifdef DO_TRACE_INSTR
 #  define TRACE1(x) fprintf(stderr, "    %s\n", __FUNCTION__);