aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4managed_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4managed_p.h')
-rw-r--r--src/qml/jsruntime/qv4managed_p.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 227cd4bdb0..b77b1cd638 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -74,10 +74,30 @@ struct GCDeletable
bool lastCall;
};
+struct CallData
+{
+ Value thisObject;
+ Value *args;
+ int argc;
+};
+
+#ifdef QT_NO_DEBUG
+#define CALLDATA(argc_) \
+ QV4::CallData d; \
+ d.argc = argc_; \
+ d.args = (QV4::Value *)alloca(qMax((int)(argc_), (int)QV4::Global::ReservedArgumentCount)*sizeof(QV4::Value))
+#else
+#define CALLDATA(argc_) \
+ QV4::CallData d; \
+ d.argc = argc_; \
+ d.args = (QV4::Value *)alloca(qMax((int)(argc_), (int)QV4::Global::ReservedArgumentCount)*sizeof(QV4::Value)); \
+ for (int iii = 0; iii < qMax((int)(argc_), (int)QV4::Global::ReservedArgumentCount); ++iii) d.args[iii] = QV4::Value::undefinedValue()
+#endif
+
struct ManagedVTable
{
- Value (*call)(Managed *, const Value &thisObject, Value *args, int argc);
- Value (*construct)(Managed *, Value *args, int argc);
+ Value (*call)(Managed *, const CallData &data);
+ Value (*construct)(Managed *, const CallData &data);
void (*markObjects)(Managed *);
void (*destroy)(Managed *);
void (*collectDeletables)(Managed *, GCDeletable **deletable);
@@ -237,8 +257,8 @@ public:
inline bool hasInstance(const Value &v) {
return vtbl->hasInstance(this, v);
}
- Value construct(Value *args, int argc);
- Value call(const Value &thisObject, Value *args, int argc);
+ Value construct(const CallData &d);
+ Value call(const CallData &d);
Value get(String *name, bool *hasProperty = 0);
Value getIndexed(uint index, bool *hasProperty = 0);
void put(String *name, const Value &value)
@@ -266,8 +286,8 @@ public:
static void destroy(Managed *that) { that->_data = 0; }
static bool hasInstance(Managed *that, const Value &value);
- static Value construct(Managed *m, Value *, int);
- static Value call(Managed *m, const Value &, Value *, int);
+ static Value construct(Managed *m, const CallData &d);
+ static Value call(Managed *m, const CallData &);
static void getLookup(Managed *m, Lookup *, Value *);
static void setLookup(Managed *m, Lookup *l, const Value &v);
static bool isEqualTo(Managed *m, Managed *other);