aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-18 10:29:10 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-18 10:29:47 +0200
commiteb30e3d7ee81c48cea720e7ecd2ed45647bc70ee (patch)
tree810e8ad0642434eeb4043c3a06c82217314300e1 /src/qml/jsruntime
parent9c9fca5e27bd91da1ea07bebd7569049493c5ccf (diff)
parent521ace713d8e5230d47f3da8cd941699ca085af2 (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4arraybuffer.cpp2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp11
-rw-r--r--src/qml/jsruntime/qv4function.cpp3
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp10
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp7
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp9
-rw-r--r--src/qml/jsruntime/qv4serialize.cpp10
-rw-r--r--src/qml/jsruntime/qv4string.cpp7
-rw-r--r--src/qml/jsruntime/qv4string_p.h8
-rw-r--r--src/qml/jsruntime/qv4typedarray.cpp14
-rw-r--r--src/qml/jsruntime/qv4value_p.h30
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp8
12 files changed, 67 insertions, 52 deletions
diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp
index 3106d3af23..23c9695cf4 100644
--- a/src/qml/jsruntime/qv4arraybuffer.cpp
+++ b/src/qml/jsruntime/qv4arraybuffer.cpp
@@ -79,7 +79,7 @@ ReturnedValue ArrayBufferCtor::method_isView(CallContext *ctx)
QV4::Scoped<DataView> v(scope, ctx->argument(0));
if (!!v)
return Encode(true);
- return Encode(true);
+ return Encode(false);
}
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 320ed59fcc..7424dc4e4c 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -107,6 +107,9 @@ static ReturnedValue throwTypeError(CallContext *ctx)
const int MinimumStackSize = 256; // in kbytes
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_MSVC(4172) // MSVC 2015: warning C4172: returning address of local variable or temporary: dummy
+
quintptr getStackLimit()
{
quintptr stackLimit;
@@ -171,6 +174,7 @@ quintptr getStackLimit()
int dummy;
// this is inexact, as part of the stack is used when being called here,
// but let's simply default to 1MB from where the stack is right now
+ // (Note: triggers warning C4172 as of MSVC 2015, returning address of local variable)
stackLimit = reinterpret_cast<qintptr>(&dummy) - 1024*1024;
#endif
@@ -178,6 +182,7 @@ quintptr getStackLimit()
return stackLimit + MinimumStackSize*1024;
}
+QT_WARNING_POP
QJSEngine *ExecutionEngine::jsEngine() const
{
@@ -540,7 +545,7 @@ Heap::Object *ExecutionEngine::newObject(InternalClass *internalClass, QV4::Obje
Heap::String *ExecutionEngine::newString(const QString &s)
{
Scope scope(this);
- return ScopedString(scope, memoryManager->alloc<String>(s))->d();
+ return ScopedString(scope, memoryManager->allocWithStringData<String>(s.length() * sizeof(QChar), s))->d();
}
Heap::String *ExecutionEngine::newIdentifier(const QString &text)
@@ -1373,7 +1378,7 @@ QV4::ReturnedValue QV4::ExecutionEngine::fromVariant(const QVariant &variant)
QV4::Scope scope(this);
if (type == qMetaTypeId<QQmlListReference>()) {
typedef QQmlListReferencePrivate QDLRP;
- QDLRP *p = QDLRP::get((QQmlListReference*)ptr);
+ QDLRP *p = QDLRP::get((QQmlListReference*)const_cast<void *>(ptr));
if (p->object) {
return QV4::QmlListWrapper::create(scope.engine, p->property, p->propertyType);
} else {
@@ -1385,7 +1390,7 @@ QV4::ReturnedValue QV4::ExecutionEngine::fromVariant(const QVariant &variant)
} else if (type == qMetaTypeId<QList<QObject *> >()) {
// XXX Can this be made more by using Array as a prototype and implementing
// directly against QList<QObject*>?
- const QList<QObject *> &list = *(QList<QObject *>*)ptr;
+ const QList<QObject *> &list = *(const QList<QObject *>*)ptr;
QV4::ScopedArrayObject a(scope, newArrayObject());
a->arrayReserve(list.count());
QV4::ScopedValue v(scope);
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index a18a2d4919..98a4490211 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -66,7 +66,8 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
break;
}
// duplicate arguments, need some trick to store them
- arg = engine->memoryManager->alloc<String>(arg->d(), engine->newString(QString(0xfffe)));
+ MemoryManager *mm = engine->memoryManager;
+ arg = mm->alloc<String>(mm, arg->d(), engine->newString(QString(0xfffe)));
}
}
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index 096fe9fb4c..4ae30a7f35 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -76,14 +76,10 @@ void NumberPrototype::init(ExecutionEngine *engine, Object *ctor)
ctor->defineReadonlyProperty(QStringLiteral("POSITIVE_INFINITY"), Primitive::fromDouble(qInf()));
ctor->defineReadonlyProperty(QStringLiteral("MAX_VALUE"), Primitive::fromDouble(1.7976931348623158e+308));
-#ifdef __INTEL_COMPILER
-# pragma warning( push )
-# pragma warning(disable: 239)
-#endif
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_INTEL(239)
ctor->defineReadonlyProperty(QStringLiteral("MIN_VALUE"), Primitive::fromDouble(5e-324));
-#ifdef __INTEL_COMPILER
-# pragma warning( pop )
-#endif
+QT_WARNING_POP
defineDefaultProperty(QStringLiteral("constructor"), (o = ctor));
defineDefaultProperty(engine->id_toString(), method_toString);
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 529703bda4..e5946d8be6 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -71,14 +71,9 @@
QT_BEGIN_NAMESPACE
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
// The code in this file does not violate strict aliasing, but GCC thinks it does
// so turn off the warnings for us to have a clean build
-# pragma GCC diagnostic ignored "-Wstrict-aliasing"
-# endif
-#endif
-
+QT_WARNING_DISABLE_GCC("-Wstrict-aliasing")
using namespace QV4;
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 089922d03e..b8ea6d7a87 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -524,7 +524,8 @@ QV4::ReturnedValue RuntimeHelpers::addHelper(ExecutionEngine *engine, const Valu
return pright->asReturnedValue();
if (!pright->stringValue()->d()->length())
return pleft->asReturnedValue();
- return (engine->memoryManager->alloc<String>(pleft->stringValue()->d(), pright->stringValue()->d()))->asReturnedValue();
+ MemoryManager *mm = engine->memoryManager;
+ return (mm->alloc<String>(mm, pleft->stringValue()->d(), pright->stringValue()->d()))->asReturnedValue();
}
double x = RuntimeHelpers::toNumber(pleft);
double y = RuntimeHelpers::toNumber(pright);
@@ -540,7 +541,8 @@ QV4::ReturnedValue Runtime::addString(ExecutionEngine *engine, const Value &left
return right.asReturnedValue();
if (!right.stringValue()->d()->length())
return left.asReturnedValue();
- return (engine->memoryManager->alloc<String>(left.stringValue()->d(), right.stringValue()->d()))->asReturnedValue();
+ MemoryManager *mm = engine->memoryManager;
+ return (mm->alloc<String>(mm, left.stringValue()->d(), right.stringValue()->d()))->asReturnedValue();
}
Scope scope(engine);
@@ -557,7 +559,8 @@ QV4::ReturnedValue Runtime::addString(ExecutionEngine *engine, const Value &left
return pright->asReturnedValue();
if (!pright->stringValue()->d()->length())
return pleft->asReturnedValue();
- return (engine->memoryManager->alloc<String>(pleft->stringValue()->d(), pright->stringValue()->d()))->asReturnedValue();
+ MemoryManager *mm = engine->memoryManager;
+ return (mm->alloc<String>(mm, pleft->stringValue()->d(), pright->stringValue()->d()))->asReturnedValue();
}
void Runtime::setProperty(ExecutionEngine *engine, const Value &object, int nameIndex, const Value &value)
diff --git a/src/qml/jsruntime/qv4serialize.cpp b/src/qml/jsruntime/qv4serialize.cpp
index 090e9c7e6a..33b40796a4 100644
--- a/src/qml/jsruntime/qv4serialize.cpp
+++ b/src/qml/jsruntime/qv4serialize.cpp
@@ -116,21 +116,21 @@ static inline void reserve(QByteArray &data, int extra)
static inline quint32 popUint32(const char *&data)
{
- quint32 rv = *((quint32 *)data);
+ quint32 rv = *((const quint32 *)data);
data += sizeof(quint32);
return rv;
}
static inline double popDouble(const char *&data)
{
- double rv = *((double *)data);
+ double rv = *((const double *)data);
data += sizeof(double);
return rv;
}
static inline void *popPtr(const char *&data)
{
- void *rv = *((void **)data);
+ void *rv = *((void *const *)data);
data += sizeof(void *);
return rv;
}
@@ -297,7 +297,7 @@ ReturnedValue Serialize::deserialize(const char *&data, ExecutionEngine *engine)
case WorkerString:
{
quint32 size = headersize(header);
- QString qstr((QChar *)data, size);
+ QString qstr((const QChar *)data, size);
data += ALIGN(size * sizeof(quint16));
return QV4::Encode(engine->newString(qstr));
}
@@ -342,7 +342,7 @@ ReturnedValue Serialize::deserialize(const char *&data, ExecutionEngine *engine)
{
quint32 flags = headersize(header);
quint32 length = popUint32(data);
- QString pattern = QString((QChar *)data, length - 1);
+ QString pattern = QString((const QChar *)data, length - 1);
data += ALIGN(length * sizeof(quint16));
return Encode(engine->newRegExpObject(pattern, flags));
}
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index 2ab608e64e..24a13ddd10 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -117,7 +117,8 @@ bool String::isEqualTo(Managed *t, Managed *o)
}
-Heap::String::String(const QString &t)
+Heap::String::String(MemoryManager *mm, const QString &t)
+ : mm(mm)
{
subtype = String::StringType_Unknown;
@@ -129,7 +130,8 @@ Heap::String::String(const QString &t)
len = text->size;
}
-Heap::String::String(String *l, String *r)
+Heap::String::String(MemoryManager *mm, String *l, String *r)
+ : mm(mm)
{
subtype = String::StringType_Unknown;
@@ -187,6 +189,7 @@ void Heap::String::simplifyString() const
text->ref.ref();
identifier = 0;
largestSubLength = 0;
+ mm->growUnmanagedHeapSizeUsage(size_t(text->size) * sizeof(QChar));
}
void Heap::String::createHashValue() const
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 568c11261a..93a25d7ed5 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -53,8 +53,8 @@ struct Q_QML_PRIVATE_EXPORT String : Base {
StringType_ArrayIndex
};
- String(const QString &text);
- String(String *l, String *n);
+ String(MemoryManager *mm, const QString &text);
+ String(MemoryManager *mm, String *l, String *n);
~String() {
if (!largestSubLength && !text->ref.deref())
QStringData::deallocate(text);
@@ -66,6 +66,9 @@ struct Q_QML_PRIVATE_EXPORT String : Base {
len == (uint)text->size);
return len;
}
+ std::size_t retainedTextSize() const {
+ return largestSubLength ? 0 : (std::size_t(text->size) * sizeof(QChar));
+ }
void createHashValue() const;
inline unsigned hashValue() const {
if (subtype == StringType_Unknown)
@@ -107,6 +110,7 @@ struct Q_QML_PRIVATE_EXPORT String : Base {
mutable uint stringHash;
mutable uint largestSubLength;
uint len;
+ MemoryManager *mm;
private:
static void append(const String *data, QChar *ch);
};
diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp
index fcc6f3dc5d..f06eeb08b9 100644
--- a/src/qml/jsruntime/qv4typedarray.cpp
+++ b/src/qml/jsruntime/qv4typedarray.cpp
@@ -85,7 +85,7 @@ void UInt8ClampedArrayWrite(ExecutionEngine *e, char *data, int index, const Val
return;
}
if (d >= 255) {
- data[index] = (unsigned char)(255);
+ data[index] = (char)(255);
return;
}
double f = std::floor(d);
@@ -107,7 +107,7 @@ void UInt8ClampedArrayWrite(ExecutionEngine *e, char *data, int index, const Val
ReturnedValue Int16ArrayRead(const char *data, int index)
{
- return Encode((int)*(short *)(data + index));
+ return Encode((int)*(const short *)(data + index));
}
void Int16ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &value)
@@ -120,7 +120,7 @@ void Int16ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &val
ReturnedValue UInt16ArrayRead(const char *data, int index)
{
- return Encode((int)*(unsigned short *)(data + index));
+ return Encode((int)*(const unsigned short *)(data + index));
}
void UInt16ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &value)
@@ -133,7 +133,7 @@ void UInt16ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &va
ReturnedValue Int32ArrayRead(const char *data, int index)
{
- return Encode(*(int *)(data + index));
+ return Encode(*(const int *)(data + index));
}
void Int32ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &value)
@@ -146,7 +146,7 @@ void Int32ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &val
ReturnedValue UInt32ArrayRead(const char *data, int index)
{
- return Encode(*(unsigned int *)(data + index));
+ return Encode(*(const unsigned int *)(data + index));
}
void UInt32ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &value)
@@ -159,7 +159,7 @@ void UInt32ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &va
ReturnedValue Float32ArrayRead(const char *data, int index)
{
- return Encode(*(float *)(data + index));
+ return Encode(*(const float *)(data + index));
}
void Float32ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &value)
@@ -172,7 +172,7 @@ void Float32ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &v
ReturnedValue Float64ArrayRead(const char *data, int index)
{
- return Encode(*(double *)(data + index));
+ return Encode(*(const double *)(data + index));
}
void Float64ArrayWrite(ExecutionEngine *e, char *data, int index, const Value &value)
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index c0420a38db..6305e6dfbb 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -39,6 +39,14 @@
#include "qv4global_p.h"
#include <private/qv4heap_p.h>
+/* We cannot rely on QT_POINTER_SIZE to be set correctly on host builds. In qmldevtools the Value objects
+ are only used to store primitives, never object pointers. So we can use the 64-bit encoding. */
+#ifdef V4_BOOTSTRAP
+#define QV4_USE_64_BIT_VALUE_ENCODING
+#elif QT_POINTER_SIZE == 8
+#define QV4_USE_64_BIT_VALUE_ENCODING
+#endif
+
QT_BEGIN_NAMESPACE
namespace QV4 {
@@ -94,10 +102,10 @@ struct Q_QML_PRIVATE_EXPORT Value
Q_ALWAYS_INLINE quint32 value() const { return _val >> 32; }
#endif
-#if QT_POINTER_SIZE == 8
+#ifdef QV4_USE_64_BIT_VALUE_ENCODING
Q_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; memcpy(&b, &_val, 8); return b; }
Q_ALWAYS_INLINE void setM(Heap::Base *b) { memcpy(&_val, &b, 8); }
-#else // QT_POINTER_SIZE == 4
+#else // !QV4_USE_64_BIT_VALUE_ENCODING
Q_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; quint32 v = value(); memcpy(&b, &v, 4); return b; }
Q_ALWAYS_INLINE void setM(Heap::Base *b) { quint32 v; memcpy(&v, &b, 4); setValue(v); }
#endif
@@ -106,7 +114,7 @@ struct Q_QML_PRIVATE_EXPORT Value
Q_ALWAYS_INLINE void setInt_32(int i) { quint32 u; memcpy(&u, &i, 4); setValue(u); }
Q_ALWAYS_INLINE uint uint_32() const { return value(); }
-#if QT_POINTER_SIZE == 4
+#ifndef QV4_USE_64_BIT_VALUE_ENCODING
enum Masks {
SilentNaNBit = 0x00040000,
NaN_Mask = 0x7ff80000,
@@ -186,7 +194,7 @@ struct Q_QML_PRIVATE_EXPORT Value
inline bool isUndefined() const { return tag() == Undefined_Type; }
inline bool isNull() const { return tag() == _Null_Type; }
inline bool isBoolean() const { return tag ()== _Boolean_Type; }
-#if QT_POINTER_SIZE == 8
+#ifdef QV4_USE_64_BIT_VALUE_ENCODING
inline bool isInteger() const { return (_val >> IsNumber_Shift) == 1; }
inline bool isDouble() const { return (_val >> IsDouble_Shift); }
inline bool isNumber() const { return (_val >> IsNumber_Shift); }
@@ -219,7 +227,7 @@ struct Q_QML_PRIVATE_EXPORT Value
Q_ASSERT(isDouble());
double d;
quint64 v = _val;
-#if QT_POINTER_SIZE == 8
+#ifdef QV4_USE_64_BIT_VALUE_ENCODING
v ^= NaNEncodeMask;
#endif
memcpy(&d, &v, 8);
@@ -227,7 +235,7 @@ struct Q_QML_PRIVATE_EXPORT Value
}
Q_ALWAYS_INLINE void setDouble(double d) {
memcpy(&_val, &d, 8);
-#if QT_POINTER_SIZE == 8
+#ifdef QV4_USE_64_BIT_VALUE_ENCODING
_val ^= NaNEncodeMask;
#endif
Q_ASSERT(isDouble());
@@ -287,7 +295,7 @@ struct Q_QML_PRIVATE_EXPORT Value
Value v;
v.setRawValue(0);
v.setM(m);
-#if QT_POINTER_SIZE == 4
+#ifndef QV4_USE_64_BIT_VALUE_ENCODING
v.setTag(Managed_Type);
#endif
return v;
@@ -368,7 +376,7 @@ struct Q_QML_PRIVATE_EXPORT Value
}
Value &operator=(Heap::Base *o) {
setM(o);
-#if QT_POINTER_SIZE == 4
+#ifndef QV4_USE_64_BIT_VALUE_ENCODING
setTag(Managed_Type);
#endif
return *this;
@@ -413,7 +421,7 @@ inline double Value::toNumber() const
#ifndef V4_BOOTSTRAP
inline uint Value::asArrayIndex() const
{
-#if QT_POINTER_SIZE == 8
+#ifdef QV4_USE_64_BIT_VALUE_ENCODING
if (!isNumber())
return UINT_MAX;
if (isInteger())
@@ -461,7 +469,7 @@ struct Q_QML_PRIVATE_EXPORT Primitive : public Value
inline Primitive Primitive::undefinedValue()
{
Primitive v;
-#if QT_POINTER_SIZE == 8
+#ifdef QV4_USE_64_BIT_VALUE_ENCODING
v.setRawValue(quint64(Undefined_Type) << Tag_Shift);
#else
v.setRawValue(0);
@@ -481,7 +489,7 @@ inline Primitive Primitive::emptyValue()
inline Primitive Primitive::nullValue()
{
Primitive v;
-#if QT_POINTER_SIZE == 8
+#ifndef QV4_USE_64_BIT_VALUE_ENCODING
v.setRawValue(quint64(_Null_Type) << Tag_Shift);
#else
v.setTagValue(_Null_Type, 0);
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index d0ae44ccea..0edd7378a7 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -636,7 +636,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(CallGlobalLookup)
MOTH_BEGIN_INSTR(SetExceptionHandler)
- exceptionHandler = instr.offset ? ((uchar *)&instr.offset) + instr.offset : 0;
+ exceptionHandler = instr.offset ? ((const uchar *)&instr.offset) + instr.offset : 0;
MOTH_END_INSTR(SetExceptionHandler)
MOTH_BEGIN_INSTR(CallBuiltinThrow)
@@ -770,21 +770,21 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(ConstructGlobalLookup)
MOTH_BEGIN_INSTR(Jump)
- code = ((uchar *)&instr.offset) + instr.offset;
+ code = ((const uchar *)&instr.offset) + instr.offset;
MOTH_END_INSTR(Jump)
MOTH_BEGIN_INSTR(JumpEq)
bool cond = VALUEPTR(instr.condition)->toBoolean();
TRACE(condition, "%s", cond ? "TRUE" : "FALSE");
if (cond)
- code = ((uchar *)&instr.offset) + instr.offset;
+ code = ((const uchar *)&instr.offset) + instr.offset;
MOTH_END_INSTR(JumpEq)
MOTH_BEGIN_INSTR(JumpNe)
bool cond = VALUEPTR(instr.condition)->toBoolean();
TRACE(condition, "%s", cond ? "TRUE" : "FALSE");
if (!cond)
- code = ((uchar *)&instr.offset) + instr.offset;
+ code = ((const uchar *)&instr.offset) + instr.offset;
MOTH_END_INSTR(JumpNe)
MOTH_BEGIN_INSTR(UNot)