diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-03 13:27:13 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-03 13:27:13 +0100 |
commit | f2244103ff7a9b61fc7bcb7e920d8cc6b2f5f226 (patch) | |
tree | 8fe753743c46d4a652f582a7a2a49e5709eaa6e0 /src/qml/jsruntime | |
parent | 57430b2bdad32150e0ed8ceb6893430363ee6670 (diff) | |
parent | 164af37710e5721cbc7d79a0af20f2387181c59c (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
tools/qmlprofiler/qmlprofilerclient.cpp
Change-Id: I1de8832fefd0e45fea16ca072b6c7ae44fa376d4
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 26 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4runtime_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 8 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 8 |
6 files changed, 40 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 82d94f569e..e31d9b1481 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -218,7 +218,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) if (!factory) { #ifdef V4_ENABLE_JIT - static const bool forceMoth = !qgetenv("QV4_FORCE_INTERPRETER").isEmpty(); + static const bool forceMoth = !qEnvironmentVariableIsEmpty("QV4_FORCE_INTERPRETER"); if (forceMoth) factory = new Moth::ISelFactory; else diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index 7f97872092..1413f439b1 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -68,7 +68,7 @@ void ObjectIterator::init(const Object *o) object->setM(o ? o->m() : 0); current->setM(o ? o->m() : 0); -#if QT_POINTER_SIZE == 4 +#ifndef QV4_USE_64_BIT_VALUE_ENCODING object->setTag(QV4::Value::Managed_Type); current->setTag(QV4::Value::Managed_Type); #endif diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 0d7a1851b8..a988313f5f 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1146,6 +1146,28 @@ QV4::ReturnedValue Runtime::typeofName(ExecutionEngine *engine, int nameIndex) return Runtime::typeofValue(engine, prop); } +#ifndef V4_BOOTSTRAP +ReturnedValue Runtime::typeofScopeObjectProperty(ExecutionEngine *engine, const Value &context, + int propertyIndex) +{ + Scope scope(engine); + ScopedValue prop(scope, getQmlScopeObjectProperty(engine, context, propertyIndex)); + if (scope.engine->hasException) + return Encode::undefined(); + return Runtime::typeofValue(engine, prop); +} + +ReturnedValue Runtime::typeofContextObjectProperty(ExecutionEngine *engine, const Value &context, + int propertyIndex) +{ + Scope scope(engine); + ScopedValue prop(scope, getQmlContextObjectProperty(engine, context, propertyIndex)); + if (scope.engine->hasException) + return Encode::undefined(); + return Runtime::typeofValue(engine, prop); +} +#endif // V4_BOOTSTRAP + QV4::ReturnedValue Runtime::typeofMember(ExecutionEngine *engine, const Value &base, int nameIndex) { Scope scope(engine); @@ -1341,13 +1363,13 @@ unsigned Runtime::doubleToUInt(const double &d) return Primitive::toUInt32(d); } +#ifndef V4_BOOTSTRAP + ReturnedValue Runtime::getQmlContext(NoThrowEngine *engine) { return engine->qmlContext()->asReturnedValue(); } -#ifndef V4_BOOTSTRAP - ReturnedValue Runtime::regexpLiteral(ExecutionEngine *engine, int id) { return engine->current->compilationUnit->runtimeRegularExpressions[id].asReturnedValue(); diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index 571abac21e..0d81edca1e 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -127,6 +127,8 @@ struct Q_QML_PRIVATE_EXPORT Runtime { // typeof static ReturnedValue typeofValue(ExecutionEngine *engine, const Value &val); static ReturnedValue typeofName(ExecutionEngine *engine, int nameIndex); + static ReturnedValue typeofScopeObjectProperty(ExecutionEngine *engine, const Value &context, int propertyIndex); + static ReturnedValue typeofContextObjectProperty(ExecutionEngine *engine, const Value &context, int propertyIndex); static ReturnedValue typeofMember(ExecutionEngine *engine, const Value &base, int nameIndex); static ReturnedValue typeofElement(ExecutionEngine *engine, const Value &base, const Value &index); diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index 101d3dcb3c..f6361681a5 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -120,7 +120,7 @@ struct ScopedValue { ptr = scope.engine->jsStackTop++; ptr->setM(o); -#if QT_POINTER_SIZE == 4 +#ifndef QV4_USE_64_BIT_VALUE_ENCODING ptr->setTag(QV4::Value::Managed_Type); #endif } @@ -144,7 +144,7 @@ struct ScopedValue ScopedValue &operator=(Heap::Base *o) { ptr->setM(o); -#if QT_POINTER_SIZE == 4 +#ifndef QV4_USE_64_BIT_VALUE_ENCODING ptr->setTag(QV4::Value::Managed_Type); #endif return *this; @@ -186,7 +186,7 @@ struct Scoped inline void setPointer(const Managed *p) { ptr->setM(p ? p->m() : 0); -#if QT_POINTER_SIZE == 4 +#ifndef QV4_USE_64_BIT_VALUE_ENCODING ptr->setTag(QV4::Value::Managed_Type); #endif } @@ -195,7 +195,7 @@ struct Scoped { ptr = scope.engine->jsStackTop++; ptr->setM(0); -#if QT_POINTER_SIZE == 4 +#ifndef QV4_USE_64_BIT_VALUE_ENCODING ptr->setTag(QV4::Value::Managed_Type); #endif } diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 68f996c4c7..024a72bde2 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -684,6 +684,14 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code STOREVALUE(instr.result, Runtime::deleteName(engine, instr.name)); MOTH_END_INSTR(CallBuiltinDeleteName) + MOTH_BEGIN_INSTR(CallBuiltinTypeofScopeObjectProperty) + STOREVALUE(instr.result, Runtime::typeofScopeObjectProperty(engine, VALUE(instr.base), instr.index)); + MOTH_END_INSTR(CallBuiltinTypeofMember) + + MOTH_BEGIN_INSTR(CallBuiltinTypeofContextObjectProperty) + STOREVALUE(instr.result, Runtime::typeofContextObjectProperty(engine, VALUE(instr.base), instr.index)); + MOTH_END_INSTR(CallBuiltinTypeofMember) + MOTH_BEGIN_INSTR(CallBuiltinTypeofMember) STOREVALUE(instr.result, Runtime::typeofMember(engine, VALUE(instr.base), instr.member)); MOTH_END_INSTR(CallBuiltinTypeofMember) |