+DEFINES += V4_ENABLE_JIT
DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""
#include <private/qv4global_p.h>
#include <private/qv4isel_p.h>
+#include <private/qv4isel_util_p.h>
#include <private/qv4jsir_p.h>
#include <private/qv4object_p.h>
#include "qv4instr_moth_p.h"
virtual ~ISelFactory() {}
virtual EvalInstructionSelection *create(QV4::ExecutionEngine *engine, V4IR::Module *module)
{ return new InstructionSelection(engine, module); }
+ virtual bool jitCompileRegexps() const
+ { return false; }
};
template<int InstrT>
#include <qv4stringobject_p.h>
#include <qv4identifier_p.h>
#include <qv4unwindhelper_p.h>
-#include "qv4isel_masm_p.h"
#include "qv4debugging_p.h"
#include "qv4executableallocator_p.h"
+#ifdef V4_ENABLE_JIT
+# include "qv4isel_masm_p.h"
+#else // !V4_ENABLE_JIT
+# include "qv4isel_moth_p.h"
+#endif // V4_ENABLE_JIT
+
using namespace QV4;
ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory)
{
MemoryManager::GCBlocker gcBlocker(memoryManager);
- if (!factory)
+ if (!factory) {
+#ifdef V4_ENABLE_JIT
factory = new QQmlJS::MASM::ISelFactory;
+#else // !V4_ENABLE_JIT
+ factory = new QQmlJS::Moth::ISelFactory;
+#endif // V4_ENABLE_JIT
+ }
iselFactory.reset(factory);
memoryManager->setExecutionEngine(this);
virtual ~ISelFactory() {}
virtual EvalInstructionSelection *create(QV4::ExecutionEngine *engine, V4IR::Module *module)
{ return new InstructionSelection(engine, module); }
+ virtual bool jitCompileRegexps() const
+ { return true; }
};
} // end of namespace MASM
public:
virtual ~EvalISelFactory() = 0;
virtual EvalInstructionSelection *create(QV4::ExecutionEngine *engine, V4IR::Module *module) = 0;
+ virtual bool jitCompileRegexps() const = 0;
};
namespace V4IR {
m_subPatternCount = yarrPattern.m_numSubpatterns;
m_byteCode = JSC::Yarr::byteCompile(yarrPattern, engine->bumperPointerAllocator);
#if ENABLE(YARR_JIT)
- if (!yarrPattern.m_containsBackreferences) {
+ if (!yarrPattern.m_containsBackreferences && engine->iselFactory->jitCompileRegexps()) {
JSC::JSGlobalData dummy(engine->executableAllocator);
JSC::Yarr::jitCompile(yarrPattern, JSC::Yarr::Char16, &dummy, m_jitCode);
}
#include "private/qv4errorobject_p.h"
#include "private/qv4globalobject_p.h"
#include "private/qv4codegen_p.h"
-#include "private/qv4isel_masm_p.h"
#include "private/qv4isel_moth_p.h"
#include "private/qv4vme_moth_p.h"
#include "private/qv4syntaxchecker_p.h"
#include "private/qv4mm_p.h"
#include "private/qv4context_p.h"
+#ifdef V4_ENABLE_JIT
+# include "private/qv4isel_masm_p.h"
+#endif // V4_ENABLE_JIT
+
#include <QtCore>
#include <private/qqmljsengine_p.h>
#include <private/qqmljslexer_p.h>
QQmlJS::EvalISelFactory* iSelFactory = 0;
if (mode == use_moth) {
iSelFactory = new QQmlJS::Moth::ISelFactory;
+#ifdef V4_ENABLE_JIT
} else {
iSelFactory = new QQmlJS::MASM::ISelFactory;
+#endif // V4_ENABLE_JIT
}
QV4::ExecutionEngine vm(iSelFactory);