Unsolved What js engine qt use under the hood?
-
Hi!
I little bit confuse about what does js engine qt use?
I know about QML and Qt WebKit Widgets.
As I can see Qt WebKit Widgets uses http://doc.qt.io/qt-5/qtwebkit-bridge.html that uses http://code.woboq.org/qt5/qtdeclarative/src/qml/jsapi/qjsengine.cpp.html that uses v8 google js engine.
I wonder that I can debug JS inside QML block in qtcreator. What does engine qt use here?Besides I hear that qt has got own virtual machine/engine for js - v4vm.
But also I see that qt forbid qtwebkit/qtdeclarative and qtscipt http://wiki.qt.io/New-Features-in-Qt-5.5#Deprecated_Functionality
Why?
How do you use js in future qt gui projects? -
Hi and welcome to devnet,
These modules are not forbidden, they are deprecated. You can still use them but should not start new software with them.
As for why, here you have the explanation for QtWebKit. For QtQuick 1, read the following mail thread.
Use the QML module which is the replacement for QtScript
-
@SGaist Thanks, but what are js engine used for debug and executing js code inside QML?
-
The V4 engine
-
Yeah, thanks. I see in code qv4compiler.cpp and in qv8engine.cpp
m_v4Engine = new QV4::ExecutionEngine;
m_v4Engine->v8Engine = this;Why qt doesn't use v8 engine? And Where I can see any information about v4?
-
The old Qt Quick 1 used it. Here you have why it has changed.
What information are you looking for ?
-
I just want to port qt library to new platform. My task is implement js engine for qt. I look for description about it, earlier I going to implement v8 google engine )
-
What platform is that ?
-
Like a intel intanium VLIW + EPIC architecture
-
Then you should check the hpux family of mkspec
-
@SGaist As I can see in the code:
switch (mode) { case use_masm: case use_moth: { QV4::EvalISelFactory* iSelFactory = 0; if (mode == use_moth) { iSelFactory = new QV4::Moth::ISelFactory; #ifdef V4_ENABLE_JIT } else { iSelFactory = new QV4::JIT::ISelFactory; #endif // V4_ENABLE_JIT } QV4::ExecutionEngine vm(iSelFactory); QV4::Scope scope(&vm); QV4::ScopedContext ctx(scope, vm.rootContext());
My purpose are port qtdeclarative on the new platform.
First of all I'm going to add masm classes and some declaration statements in qv4global_p.h and qv4targetplatform_p.h.
My question is - What is Moth? Is it aot compiler for js or interpeter? Why the Moth's files are placed in compiler directory? -
That's something I can't answer, I haven't worked on the internals of the V4 engine. You should rather ask this on the development mailing list. You'll find there Qt's developers/maintainers (this forum is more user oriented). There's also the #qt IRC channel