aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4argumentsobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-11-04 15:25:09 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-08 19:48:00 +0100
commit980e7fae0a010d519907a58ab891cc6ca94eb56a (patch)
tree3d0aec781e52b49beeaf3ef990e9196746fb6a06 /src/qml/jsruntime/qv4argumentsobject_p.h
parentf3f86c5eaed6940c6b90132c811cbf04ff9a8e81 (diff)
Move Data of Variant and ArgumentsObject into Heap namespace
Change-Id: Id2092a15c9fb5341d9b5cf4a9ac7a978308e4174 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject_p.h')
-rw-r--r--src/qml/jsruntime/qv4argumentsobject_p.h79
1 files changed, 45 insertions, 34 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h
index f215d986be..38ba741bc5 100644
--- a/src/qml/jsruntime/qv4argumentsobject_p.h
+++ b/src/qml/jsruntime/qv4argumentsobject_p.h
@@ -40,51 +40,67 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
+namespace Heap {
+
+struct ArgumentsGetterFunction : FunctionObject {
+ inline ArgumentsGetterFunction(QV4::ExecutionContext *scope, uint index);
+ uint index;
+};
+
+struct ArgumentsSetterFunction : FunctionObject {
+ inline ArgumentsSetterFunction(QV4::ExecutionContext *scope, uint index);
+ uint index;
+};
+
+struct ArgumentsObject : Object {
+ enum {
+ LengthPropertyIndex = 0,
+ CalleePropertyIndex = 1,
+ CallerPropertyIndex = 3
+ };
+ ArgumentsObject(QV4::CallContext *context);
+ QV4::CallContext *context;
+ bool fullyCreated;
+ MemberData *mappedArguments;
+};
+
+}
+
struct ArgumentsGetterFunction: FunctionObject
{
- struct Data : Heap::FunctionObject {
- Data(ExecutionContext *scope, uint index)
- : Heap::FunctionObject(scope)
- , index(index)
- {
- setVTable(staticVTable());
- }
- uint index;
- };
- V4_OBJECT(FunctionObject)
+ V4_OBJECT2(ArgumentsGetterFunction, FunctionObject)
uint index() const { return d()->index; }
-
static ReturnedValue call(Managed *that, CallData *d);
};
+inline
+Heap::ArgumentsGetterFunction::ArgumentsGetterFunction(QV4::ExecutionContext *scope, uint index)
+ : Heap::FunctionObject(scope)
+ , index(index)
+{
+ setVTable(QV4::ArgumentsGetterFunction::staticVTable());
+}
+
struct ArgumentsSetterFunction: FunctionObject
{
- struct Data : Heap::FunctionObject {
- Data(ExecutionContext *scope, uint index)
- : Heap::FunctionObject(scope)
- , index(index)
- {
- setVTable(staticVTable());
- }
- uint index;
- };
- V4_OBJECT(FunctionObject)
+ V4_OBJECT2(ArgumentsSetterFunction, FunctionObject)
uint index() const { return d()->index; }
-
static ReturnedValue call(Managed *that, CallData *callData);
};
+inline
+Heap::ArgumentsSetterFunction::ArgumentsSetterFunction(QV4::ExecutionContext *scope, uint index)
+ : Heap::FunctionObject(scope)
+ , index(index)
+{
+ setVTable(QV4::ArgumentsSetterFunction::staticVTable());
+}
+
struct ArgumentsObject: Object {
- struct Data : Heap::Object {
- Data(CallContext *context);
- CallContext *context;
- bool fullyCreated;
- Heap::MemberData *mappedArguments;
- };
- V4_OBJECT(Object)
+ V4_OBJECT2(ArgumentsObject, Object)
Q_MANAGED_TYPE(ArgumentsObject)
CallContext *context() const { return d()->context; }
@@ -96,11 +112,6 @@ struct ArgumentsObject: Object {
!static_cast<ArgumentsObject *>(m)->context()->d()->strictMode;
}
- enum {
- LengthPropertyIndex = 0,
- CalleePropertyIndex = 1,
- CallerPropertyIndex = 3
- };
bool defineOwnProperty(ExecutionContext *ctx, uint index, const Property &desc, PropertyAttributes attrs);
static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty);
static void putIndexed(Managed *m, uint index, const ValueRef value);