diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2012-12-11 10:03:40 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2012-12-11 23:16:32 +0100 |
commit | 5e39d56c0974faa28c5060a12064e1ad7f611ea0 (patch) | |
tree | a2f900ab936799f002e769e9a48d191af773d3d8 /qmljs_engine.h | |
parent | bcdddfda8ca81752b249540b0abaefb46eb5f766 (diff) |
Remove IR::Function from the runtime.
This fixes potential leaks of IR::Functions, lowers the memory usage
of the functions that the VM needs (because the IR fields are not
present in the VM::Function), and makes both managed by the module
respectively the ExecutionEngine.
Change-Id: I6748ad98b062f994eae9dd14f1919aec5aa7c0b0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'qmljs_engine.h')
-rw-r--r-- | qmljs_engine.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qmljs_engine.h b/qmljs_engine.h index 1b4e593200..eef62a3249 100644 --- a/qmljs_engine.h +++ b/qmljs_engine.h @@ -56,6 +56,7 @@ namespace VM { struct Value; class Array; +struct Function; struct Object; struct BooleanObject; struct NumberObject; @@ -156,6 +157,7 @@ struct ExecutionEngine Value exception; struct StringPool *stringPool; + QVector<Function *> functions; ExecutionEngine(MemoryManager *memoryManager, EvalISelFactory *iselFactory); ~ExecutionEngine(); @@ -164,8 +166,10 @@ struct ExecutionEngine String *identifier(const QString &s); + VM::Function *newFunction(const QString &name); + FunctionObject *newNativeFunction(ExecutionContext *scope, String *name, Value (*code)(ExecutionContext *)); - FunctionObject *newScriptFunction(ExecutionContext *scope, IR::Function *function); + FunctionObject *newScriptFunction(ExecutionContext *scope, VM::Function *function); Object *newObject(); FunctionObject *newObjectCtor(ExecutionContext *ctx); |