Store a Heap::EvalFunction pointer in the engine
authorLars Knoll <lars.knoll@digia.com>
Fri, 28 Nov 2014 13:02:06 +0000 (14:02 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Sat, 20 Dec 2014 06:39:32 +0000 (07:39 +0100)
Change-Id: I002eb8f94e168c9faf1ee3521170dfaf442af1a3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4engine_p.h
src/qml/jsruntime/qv4runtime.cpp

index 170670f..3d64540 100644 (file)
@@ -436,7 +436,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
     globalObject()->defineReadonlyProperty(QStringLiteral("Infinity"), Primitive::fromDouble(Q_INFINITY));
 
 
-    evalFunction = Scoped<EvalFunction>(scope, memoryManager->alloc<EvalFunction>(global));
+    evalFunction = memoryManager->alloc<EvalFunction>(global);
     globalObject()->defineDefaultProperty(QStringLiteral("eval"), (o = evalFunction));
 
     globalObject()->defineDefaultProperty(QStringLiteral("parseInt"), GlobalFunctions::method_parseInt, 2);
index 03d471b..4d02b4a 100644 (file)
@@ -196,7 +196,7 @@ public:
     InternalClass *dataViewClass;
     InternalClass *typedArrayClasses[NTypedArrayTypes]; // TypedArray::NValues, avoid including the header here
 
-    EvalFunction *evalFunction;
+    Heap::EvalFunction *evalFunction;
     FunctionObject *thrower;
 
     Property *argumentsAccessors;
index 8044161..e1d8b19 100644 (file)
@@ -910,7 +910,7 @@ ReturnedValue Runtime::callGlobalLookup(ExecutionEngine *engine, uint index, Cal
         return engine->throwTypeError();
 
     ScopedString name(scope, engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]);
-    if (o.getPointer() == scope.engine->evalFunction && name->equals(scope.engine->id_eval))
+    if (o->d() == scope.engine->evalFunction && name->equals(scope.engine->id_eval))
         return static_cast<EvalFunction *>(o.getPointer())->evalCall(callData, true);
 
     return o->call(callData);
@@ -943,7 +943,7 @@ ReturnedValue Runtime::callActivationProperty(ExecutionEngine *engine, int nameI
         return engine->throwTypeError(msg);
     }
 
-    if (o == scope.engine->evalFunction && name->equals(scope.engine->id_eval)) {
+    if (o->d() == scope.engine->evalFunction && name->equals(scope.engine->id_eval)) {
         return static_cast<EvalFunction *>(o)->evalCall(callData, true);
     }