Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qv4vme_moth.cpp File Reference

(8bf5aae19b77b618f3f7a55a59e87c8a319475a8)

#include "qv4vme_moth_p.h"
#include <QtCore/qjsondocument.h>
#include <QtCore/qjsonobject.h>
#include <private/qv4alloca_p.h>
#include <private/qv4instr_moth_p.h>
#include <private/qv4value_p.h>
#include <private/qv4debugging_p.h>
#include <private/qv4function_p.h>
#include <private/qv4functionobject_p.h>
#include <private/qv4math_p.h>
#include <private/qv4scopedvalue_p.h>
#include <private/qv4lookup_p.h>
#include <private/qv4regexp_p.h>
#include <private/qv4regexpobject_p.h>
#include <private/qv4string_p.h>
#include <private/qv4profiling_p.h>
#include <private/qv4jscall_p.h>
#include <private/qv4generatorobject_p.h>
#include <private/qqmljavascriptexpression_p.h>
#include <private/qv4qmlcontext_p.h>
#include <QtQml/private/qv4runtime_p.h>
#include <iostream>
#include <qtqml_tracepoints_p.h>
+ Include dependency graph for qv4vme_moth.cpp:

Go to the source code of this file.

Classes

struct  AOTCompiledMetaMethod
 

Macros

#define MOTH_BEGIN_INSTR_COMMON(instr)
 
#define MOTH_BEGIN_INSTR(instr)    MOTH_BEGIN_INSTR_COMMON(instr)
 
#define MOTH_END_INSTR(instr)
 
#define STACK_VALUE(temp)   stackValue(stack, temp, frame)
 
#define CHECK_EXCEPTION
 
#define STORE_IP()   frame->instructionPointer = int(code - function->codeData);
 
#define STORE_ACC()   accumulator = acc;
 
#define ACC   Value::fromReturnedValue(acc)
 
#define VALUE_TO_INT(i, val)
 

Enumerations

enum  { ShowWhenDeoptimiationHappens = 0 }
 

Functions

Q_QML_EXPORT void qt_v4ResolvePendingBreakpointsHook ()
 
Q_QML_EXPORT void qt_v4TriggeredBreakpointHook ()
 
Q_QML_EXPORT int qt_v4DebuggerHook (const char *json)
 
static QV4::ValuestackValue (QV4::Value *stack, size_t slot, const JSTypesStackFrame *frame)
 
static Heap::CallContext * getScope (QV4::Value *stack, int level)
 
static const QV4::Valueconstant (Function *function, int index)
 
static bool compareEqualInt (QV4::Value &accumulator, QV4::Value lhs, int rhs)
 

Macro Definition Documentation

◆ ACC

#define ACC   Value::fromReturnedValue(acc)

Definition at line 379 of file qv4vme_moth.cpp.

Referenced by QV4::Moth::VME::interpret().

◆ CHECK_EXCEPTION

#define CHECK_EXCEPTION
Value:
if (engine->hasException || engine->isInterrupted.loadRelaxed()) \
goto handleUnwind
bool isInterrupted() const
QJSEngine engine
[0]

Definition at line 330 of file qv4vme_moth.cpp.

◆ MOTH_BEGIN_INSTR

#define MOTH_BEGIN_INSTR ( instr)     MOTH_BEGIN_INSTR_COMMON(instr)

Definition at line 300 of file qv4vme_moth.cpp.

◆ MOTH_BEGIN_INSTR_COMMON

#define MOTH_BEGIN_INSTR_COMMON ( instr)
Value:
{ \
INSTR_##instr(MOTH_DECODE)

Definition at line 291 of file qv4vme_moth.cpp.

◆ MOTH_END_INSTR

#define MOTH_END_INSTR ( instr)
Value:
continue; \
}

Definition at line 309 of file qv4vme_moth.cpp.

◆ STACK_VALUE

#define STACK_VALUE ( temp)    stackValue(stack, temp, frame)

Definition at line 324 of file qv4vme_moth.cpp.

Referenced by QV4::Moth::VME::interpret().

◆ STORE_ACC

#define STORE_ACC ( )    accumulator = acc;

Definition at line 378 of file qv4vme_moth.cpp.

Referenced by QV4::Moth::VME::interpret().

◆ STORE_IP

#define STORE_IP ( )    frame->instructionPointer = int(code - function->codeData);

Definition at line 377 of file qv4vme_moth.cpp.

Referenced by QV4::Moth::VME::interpret().

◆ VALUE_TO_INT

#define VALUE_TO_INT ( i,
val )
Value:
int i; \
do { \
if (Q_LIKELY(val.integerCompatible())) { \
i = val.int_32(); \
} else { \
double d; \
if (val.isDouble()) \
d = val.doubleValue(); \
else { \
STORE_ACC(); \
d = val.toNumberImpl(); \
} \
} \
} while (false)
static constexpr int toInteger(double d)
#define Q_LIKELY(x)
GLuint GLfloat * val
#define CHECK_EXCEPTION

Definition at line 380 of file qv4vme_moth.cpp.

Referenced by QV4::Moth::VME::interpret().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ShowWhenDeoptimiationHappens 

Definition at line 41 of file qv4vme_moth.cpp.

Function Documentation

◆ compareEqualInt()

static bool compareEqualInt ( QV4::Value & accumulator,
QV4::Value lhs,
int rhs )
static

Definition at line 350 of file qv4vme_moth.cpp.

References QV4::StaticValue::doubleValue(), QV4::Value::fromReturnedValue(), QV4::StaticValue::int_32(), QV4::StaticValue::isManagedOrUndefined(), QV4::Value::isString(), QV4::StaticValue::isUndefined(), QV4::RuntimeHelpers::objectDefaultValue(), QV4::PREFERREDTYPE_HINT, QV4::StaticValue::QT_Bool, QV4::StaticValue::QT_Empty, QV4::StaticValue::QT_Int, QV4::StaticValue::QT_Null, QV4::StaticValue::quickType(), and QV4::RuntimeHelpers::stringToNumber().

Referenced by QV4::Moth::VME::interpret().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ constant()

◆ getScope()

static Heap::CallContext * getScope ( QV4::Value * stack,
int level )
inlinestatic

Definition at line 334 of file qv4vme_moth.cpp.

References QV4::CallData::Context, d, and Q_ASSERT.

Referenced by QV4::Moth::VME::interpret(), and propertyBindingFromReferrerScope().

+ Here is the caller graph for this function:

◆ qt_v4DebuggerHook()

Q_QML_EXPORT int qt_v4DebuggerHook ( const char * json)
Since
5.5

The main entry point into "Native Mixed" Debugging.

Commands are passed as UTF-8 encoded JSON data. The data has two compulsory fields: \list

  • version: Version of the protocol (currently 1)
  • command: Name of the command \endlist

Depending on command, more fields can be present.

Error is indicated by negative return values, success by non-negative return values.

protocolVersion: Returns version of implemented protocol.

insertBreakpoint: Sets a breakpoint on a given file and line. \list

  • fullName: Name of the QML/JS file
  • lineNumber: Line number in the file
  • condition: Breakpoint condition \endlist Returns a unique positive number as handle.

removeBreakpoint: Removes a breakpoint from a given file and line. \list

  • fullName: Name of the QML/JS file
  • lineNumber: Line number in the file
  • condition: Breakpoint condition \endlist Returns zero on success, a negative number on failure.

prepareStep: Puts the interpreter in stepping mode. Returns zero.

◆ qt_v4ResolvePendingBreakpointsHook()

Q_QML_EXPORT void qt_v4ResolvePendingBreakpointsHook ( )
Since
5.5

This function is called uncondionally from VME::run().

An attached debugger can set a breakpoint here to intercept calls to VME::run().

Definition at line 56 of file qv4vme_moth.cpp.

Referenced by QV4::Moth::VME::exec(), and QV4::Moth::VME::exec().

+ Here is the caller graph for this function:

◆ qt_v4TriggeredBreakpointHook()

Q_QML_EXPORT void qt_v4TriggeredBreakpointHook ( )
Since
5.5

This function is called when a QML interpreter breakpoint is hit.

An attached debugger can set a breakpoint here.

Definition at line 68 of file qv4vme_moth.cpp.

◆ stackValue()

static QV4::Value & stackValue ( QV4::Value * stack,
size_t slot,
const JSTypesStackFrame * frame )
inlinestatic

Definition at line 314 of file qv4vme_moth.cpp.

References frame, QV4::CallData::HeaderSize(), Q_ASSERT, and Q_UNUSED.

+ Here is the call graph for this function: