summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-02-14 14:07:57 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2013-02-14 14:57:00 +0100
commit1056456cb580d6eed1c6344c4114695ef315d7fd (patch)
tree4dbf02b41be95b452fde4df57ac4a39920594d9d /tools
parentbed14ea2680d121f0cd575d5fc1138bee1b7045a (diff)
Move call/construct over into the new vtable.
Change-Id: I4f58a1fac25440695bdc62a49adb51a887616a5c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/v4/main.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp
index 7a6e7361..998a315d 100644
--- a/tools/v4/main.cpp
+++ b/tools/v4/main.cpp
@@ -74,10 +74,11 @@ using namespace QQmlJS::VM;
struct Print: FunctionObject
{
Print(ExecutionContext *scope): FunctionObject(scope) {
+ vtbl = &static_vtbl;
name = scope->engine->newString("print");
}
- virtual Value call(ExecutionContext *ctx, Value, Value *args, int argc)
+ static Value call(Managed *, ExecutionContext *ctx, const Value &, Value *args, int argc)
{
for (int i = 0; i < argc; ++i) {
String *s = args[i].toString(ctx);
@@ -88,22 +89,31 @@ struct Print: FunctionObject
std::cout << std::endl;
return Value::undefinedValue();
}
+
+ static const ManagedVTable static_vtbl;
};
+DEFINE_MANAGED_VTABLE(Print);
+
struct GC: public FunctionObject
{
GC(ExecutionContext* scope)
: FunctionObject(scope)
{
+ vtbl = &static_vtbl;
name = scope->engine->newString("gc");
}
- virtual Value call(ExecutionContext *ctx, Value, Value *, int)
+ static Value call(Managed *, ExecutionContext *ctx, const Value &, Value *args, int argc)
{
ctx->engine->memoryManager->runGC();
return Value::undefinedValue();
}
+
+ static const ManagedVTable static_vtbl;
};
+DEFINE_MANAGED_VTABLE(GC);
+
} // builtins
static void showException(QQmlJS::VM::ExecutionContext *ctx)