Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4argumentsobject.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | using namespace QV4; | - | ||||||||||||
3 | - | |||||||||||||
4 | const QV4::VTable ArgumentsObject::static_vtbl = { (std::is_same<ArgumentsObject::SuperClass, Object>::value) ? nullptr : &ArgumentsObject::SuperClass::static_vtbl, (sizeof(ArgumentsObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ArgumentsObject::Data) + (ArgumentsObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ArgumentsObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ArgumentsObject::IsExecutionContext, ArgumentsObject::IsString, ArgumentsObject::IsObject, ArgumentsObject::IsFunctionObject, ArgumentsObject::IsErrorObject, ArgumentsObject::IsArrayData, ArgumentsObject::IsStringOrSymbol, ArgumentsObject::MyType, { 0, 0, 0, 0 }, "ArgumentsObject", ArgumentsObject::virtualDestroy, ArgumentsObject::Data::markObjects, ArgumentsObject::virtualIsEqualTo, ArgumentsObject::virtualGet, ArgumentsObject::virtualPut, ArgumentsObject::virtualDeleteProperty, ArgumentsObject::virtualHasProperty, ArgumentsObject::virtualGetOwnProperty, ArgumentsObject::virtualDefineOwnProperty, ArgumentsObject::virtualIsExtensible, ArgumentsObject::virtualPreventExtensions, ArgumentsObject::virtualGetPrototypeOf, ArgumentsObject::virtualSetPrototypeOf, ArgumentsObject::virtualGetLength, ArgumentsObject::virtualAdvanceIterator, ArgumentsObject::virtualInstanceOf, ArgumentsObject::virtualCall, ArgumentsObject::virtualCallAsConstructor, }; | - | ||||||||||||
5 | const QV4::VTable StrictArgumentsObject::static_vtbl = { (std::is_same<StrictArgumentsObject::SuperClass, Object>::value) ? nullptr : &StrictArgumentsObject::SuperClass::static_vtbl, (sizeof(StrictArgumentsObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(StrictArgumentsObject::Data) + (StrictArgumentsObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(StrictArgumentsObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), StrictArgumentsObject::IsExecutionContext, StrictArgumentsObject::IsString, StrictArgumentsObject::IsObject, StrictArgumentsObject::IsFunctionObject, StrictArgumentsObject::IsErrorObject, StrictArgumentsObject::IsArrayData, StrictArgumentsObject::IsStringOrSymbol, StrictArgumentsObject::MyType, { 0, 0, 0, 0 }, "StrictArgumentsObject", StrictArgumentsObject::virtualDestroy, StrictArgumentsObject::Data::markObjects, StrictArgumentsObject::virtualIsEqualTo, StrictArgumentsObject::virtualGet, StrictArgumentsObject::virtualPut, StrictArgumentsObject::virtualDeleteProperty, StrictArgumentsObject::virtualHasProperty, StrictArgumentsObject::virtualGetOwnProperty, StrictArgumentsObject::virtualDefineOwnProperty, StrictArgumentsObject::virtualIsExtensible, StrictArgumentsObject::virtualPreventExtensions, StrictArgumentsObject::virtualGetPrototypeOf, StrictArgumentsObject::virtualSetPrototypeOf, StrictArgumentsObject::virtualGetLength, StrictArgumentsObject::virtualAdvanceIterator, StrictArgumentsObject::virtualInstanceOf, StrictArgumentsObject::virtualCall, StrictArgumentsObject::virtualCallAsConstructor, }; | - | ||||||||||||
6 | - | |||||||||||||
7 | void Heap::ArgumentsObject::init(QV4::CppStackFrame *frame) | - | ||||||||||||
8 | { | - | ||||||||||||
9 | ExecutionEngine *v4 = internalClass->engine; | - | ||||||||||||
10 | - | |||||||||||||
11 | int nFormals = frame->v4Function->nFormals; | - | ||||||||||||
12 | QV4::CallContext *context = static_cast<QV4::CallContext *>(frame->context()); | - | ||||||||||||
13 | - | |||||||||||||
14 | Object::init(); | - | ||||||||||||
15 | fullyCreated = false; | - | ||||||||||||
16 | this->nFormals = nFormals; | - | ||||||||||||
17 | this->context.set(v4, context->d()); | - | ||||||||||||
18 | ((vtable() == QV4::ArgumentsObject::staticVTable()) ? static_cast<void>(0) : qt_assert("vtable() == QV4::ArgumentsObject::staticVTable()", __FILE__, 64)); | - | ||||||||||||
19 | - | |||||||||||||
20 | ((CalleePropertyIndex == internalClass->find(v4->id_callee()->propertyKey())) ? static_cast<void>(0) : qt_assert("CalleePropertyIndex == internalClass->find(v4->id_callee()->propertyKey())", __FILE__, 66)); | - | ||||||||||||
21 | setProperty(v4, CalleePropertyIndex, context->d()->function); | - | ||||||||||||
22 | ((LengthPropertyIndex == internalClass->find(v4->id_length()->propertyKey())) ? static_cast<void>(0) : qt_assert("LengthPropertyIndex == internalClass->find(v4->id_length()->propertyKey())", __FILE__, 68)); | - | ||||||||||||
23 | setProperty(v4, LengthPropertyIndex, Primitive::fromInt32(context->argc())); | - | ||||||||||||
24 | ((SymbolIteratorPropertyIndex == internalClass->find(v4->symbol_iterator()->propertyKey())) ? static_cast<void>(0) : qt_assert("SymbolIteratorPropertyIndex == internalClass->find(v4->symbol_iterator()->propertyKey())", __FILE__, 70)); | - | ||||||||||||
25 | setProperty(v4, SymbolIteratorPropertyIndex, *v4->arrayProtoValues()); | - | ||||||||||||
26 | } executed 4487 times by 11 tests: end of block Executed by:
| 4487 | ||||||||||||
27 | - | |||||||||||||
28 | void Heap::StrictArgumentsObject::init(QV4::CppStackFrame *frame) | - | ||||||||||||
29 | { | - | ||||||||||||
30 | ((vtable() == QV4::StrictArgumentsObject::staticVTable()) ? static_cast<void>(0) : qt_assert("vtable() == QV4::StrictArgumentsObject::staticVTable()", __FILE__, 76)); | - | ||||||||||||
31 | ExecutionEngine *v4 = internalClass->engine; | - | ||||||||||||
32 | - | |||||||||||||
33 | Object::init(); | - | ||||||||||||
34 | - | |||||||||||||
35 | ((CalleePropertyIndex == internalClass->find(v4->id_callee()->propertyKey())) ? static_cast<void>(0) : qt_assert("CalleePropertyIndex == internalClass->find(v4->id_callee()->propertyKey())", __FILE__, 81)); | - | ||||||||||||
36 | ((SymbolIteratorPropertyIndex == internalClass->find(v4->symbol_iterator()->propertyKey())) ? static_cast<void>(0) : qt_assert("SymbolIteratorPropertyIndex == internalClass->find(v4->symbol_iterator()->propertyKey())", __FILE__, 82)); | - | ||||||||||||
37 | setProperty(v4, SymbolIteratorPropertyIndex, *v4->arrayProtoValues()); | - | ||||||||||||
38 | setProperty(v4, CalleePropertyIndex + QV4::Object::GetterOffset, *v4->thrower()); | - | ||||||||||||
39 | setProperty(v4, CalleePropertyIndex + QV4::Object::SetterOffset, *v4->thrower()); | - | ||||||||||||
40 | - | |||||||||||||
41 | Scope scope(v4); | - | ||||||||||||
42 | Scoped<QV4::StrictArgumentsObject> args(scope, this); | - | ||||||||||||
43 | args->arrayReserve(frame->originalArgumentsCount); | - | ||||||||||||
44 | args->arrayPut(0, frame->originalArguments, frame->originalArgumentsCount); | - | ||||||||||||
45 | - | |||||||||||||
46 | ((LengthPropertyIndex == args->internalClass()->find(v4->id_length()->propertyKey())) ? static_cast<void>(0) : qt_assert("LengthPropertyIndex == args->internalClass()->find(v4->id_length()->propertyKey())", __FILE__, 92)); | - | ||||||||||||
47 | setProperty(v4, LengthPropertyIndex, Primitive::fromInt32(frame->originalArgumentsCount)); | - | ||||||||||||
48 | } executed 3836 times by 2 tests: end of block Executed by:
| 3836 | ||||||||||||
49 | - | |||||||||||||
50 | void ArgumentsObject::fullyCreate() | - | ||||||||||||
51 | { | - | ||||||||||||
52 | if (fullyCreated()
| 446-1101 | ||||||||||||
53 | return; executed 1101 times by 1 test: return; Executed by:
| 1101 | ||||||||||||
54 | - | |||||||||||||
55 | Scope scope(engine()); | - | ||||||||||||
56 | - | |||||||||||||
57 | int argCount = context()->argc(); | - | ||||||||||||
58 | uint numAccessors = qMin(d()->nFormals, argCount); | - | ||||||||||||
59 | ArrayData::realloc(this, Heap::ArrayData::Sparse, argCount, true); | - | ||||||||||||
60 | scope.engine->requireArgumentsAccessors(numAccessors); | - | ||||||||||||
61 | - | |||||||||||||
62 | Scoped<MemberData> md(scope, d()->mappedArguments); | - | ||||||||||||
63 | if (numAccessors
| 200-252 | ||||||||||||
64 | d()->mappedArguments.set(scope.engine, md->allocate(scope.engine, numAccessors)); | - | ||||||||||||
65 | for (uint i = 0; i < numAccessors
| 198-403 | ||||||||||||
66 | d()->mappedArguments->values.set(scope.engine, i, context()->args()[i]); | - | ||||||||||||
67 | arraySet(i, scope.engine->argumentsAccessors + i, Attr_Accessor); | - | ||||||||||||
68 | } executed 403 times by 1 test: end of block Executed by:
| 403 | ||||||||||||
69 | } executed 199 times by 1 test: end of block Executed by:
| 199 | ||||||||||||
70 | arrayPut(numAccessors, context()->args() + numAccessors, argCount - numAccessors); | - | ||||||||||||
71 | for (int i = int(numAccessors); i < argCount
| 334-451 | ||||||||||||
72 | setArrayAttributes(i, Attr_Data); executed 334 times by 1 test: setArrayAttributes(i, Attr_Data); Executed by:
| 334 | ||||||||||||
73 | - | |||||||||||||
74 | d()->fullyCreated = true; | - | ||||||||||||
75 | } executed 450 times by 1 test: end of block Executed by:
| 450 | ||||||||||||
76 | - | |||||||||||||
77 | bool ArgumentsObject::virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *desc, PropertyAttributes attrs) | - | ||||||||||||
78 | { | - | ||||||||||||
79 | if (!id.isArrayIndex()
| 188-399 | ||||||||||||
80 | return executed 188 times by 1 test: Object::virtualDefineOwnProperty(m, id, desc, attrs);return Object::virtualDefineOwnProperty(m, id, desc, attrs); Executed by:
executed 188 times by 1 test: return Object::virtualDefineOwnProperty(m, id, desc, attrs); Executed by:
| 188 | ||||||||||||
81 | - | |||||||||||||
82 | ArgumentsObject *a = static_cast<ArgumentsObject *>(m); | - | ||||||||||||
83 | a->fullyCreate(); | - | ||||||||||||
84 | - | |||||||||||||
85 | uint index = id.asArrayIndex(); | - | ||||||||||||
86 | Scope scope(m); | - | ||||||||||||
87 | ScopedProperty map(scope); | - | ||||||||||||
88 | PropertyAttributes mapAttrs; | - | ||||||||||||
89 | uint numAccessors = qMin(a->d()->nFormals, a->context()->argc()); | - | ||||||||||||
90 | bool isMapped = false; | - | ||||||||||||
91 | if (a->arrayData()
| 0-401 | ||||||||||||
92 | a->arrayData()->attributes(index).isAccessor()
| 80-144 | ||||||||||||
93 | a->arrayData()->get(index) == scope.engine->argumentsAccessors[index].getter()->asReturnedValue()
| 20-124 | ||||||||||||
94 | isMapped = true; executed 124 times by 1 test: isMapped = true; Executed by:
| 124 | ||||||||||||
95 | - | |||||||||||||
96 | if (isMapped
| 124-276 | ||||||||||||
97 | ((a->arrayData()) ? static_cast<void>(0) : qt_assert("a->arrayData()", __FILE__, 143)); | - | ||||||||||||
98 | mapAttrs = a->arrayData()->attributes(index); | - | ||||||||||||
99 | a->arrayData()->getProperty(index, map, &mapAttrs); | - | ||||||||||||
100 | a->setArrayAttributes(index, Attr_Data); | - | ||||||||||||
101 | PropertyIndex arrayIndex{ a->arrayData(), a->arrayData()->values.values + a->arrayData()->mappedIndex(index) }; | - | ||||||||||||
102 | arrayIndex.set(scope.engine, a->d()->mappedArguments->values[index]); | - | ||||||||||||
103 | } executed 126 times by 1 test: end of block Executed by:
| 126 | ||||||||||||
104 | - | |||||||||||||
105 | bool result = Object::virtualDefineOwnProperty(m, id, desc, attrs); | - | ||||||||||||
106 | if (!result
| 88-312 | ||||||||||||
107 | return executed 88 times by 1 test: false;return false; Executed by:
executed 88 times by 1 test: return false; Executed by:
| 88 | ||||||||||||
108 | - | |||||||||||||
109 | if (isMapped
| 52-188 | ||||||||||||
110 | ((a->arrayData()) ? static_cast<void>(0) : qt_assert("a->arrayData()", __FILE__, 156)); | - | ||||||||||||
111 | ScopedFunctionObject setter(scope, map->setter()); | - | ||||||||||||
112 | JSCallData jsCallData(scope, 1); | - | ||||||||||||
113 | *jsCallData->thisObject = a->asReturnedValue(); | - | ||||||||||||
114 | jsCallData->args[0] = desc->value; | - | ||||||||||||
115 | setter->call(jsCallData); | - | ||||||||||||
116 | - | |||||||||||||
117 | if (attrs.isWritable()
| 2-49 | ||||||||||||
118 | a->setArrayAttributes(index, mapAttrs); | - | ||||||||||||
119 | a->arrayData()->setProperty(m->engine(), index, map); | - | ||||||||||||
120 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
121 | } executed 51 times by 1 test: end of block Executed by:
| 51 | ||||||||||||
122 | - | |||||||||||||
123 | return executed 313 times by 1 test: result;return result; Executed by:
executed 313 times by 1 test: return result; Executed by:
| 313 | ||||||||||||
124 | } | - | ||||||||||||
125 | - | |||||||||||||
126 | ReturnedValue ArgumentsObject::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) | - | ||||||||||||
127 | { | - | ||||||||||||
128 | const ArgumentsObject *args = static_cast<const ArgumentsObject *>(m); | - | ||||||||||||
129 | if (id.isArrayIndex()
| 525-1601 | ||||||||||||
130 | uint index = id.asArrayIndex(); | - | ||||||||||||
131 | if (index < static_cast<uint>(args->context()->argc())
| 28-1047 | ||||||||||||
132 | if (hasProperty
| 222-825 | ||||||||||||
133 | * executed 222 times by 1 test: hasProperty = true;*hasProperty = true; Executed by:
executed 222 times by 1 test: *hasProperty = true; Executed by:
| 222 | ||||||||||||
134 | return executed 1046 times by 4 tests: args->context()->args()[index].asReturnedValue();return args->context()->args()[index].asReturnedValue(); Executed by:
executed 1046 times by 4 tests: return args->context()->args()[index].asReturnedValue(); Executed by:
| 1046 | ||||||||||||
135 | } | - | ||||||||||||
136 | } executed 28 times by 2 tests: end of block Executed by:
| 28 | ||||||||||||
137 | return executed 1844 times by 6 tests: Object::virtualGet(m, id, receiver, hasProperty);return Object::virtualGet(m, id, receiver, hasProperty); Executed by:
executed 1844 times by 6 tests: return Object::virtualGet(m, id, receiver, hasProperty); Executed by:
| 1844 | ||||||||||||
138 | } | - | ||||||||||||
139 | - | |||||||||||||
140 | bool ArgumentsObject::virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver) | - | ||||||||||||
141 | { | - | ||||||||||||
142 | ArgumentsObject *args = static_cast<ArgumentsObject *>(m); | - | ||||||||||||
143 | if (id.isArrayIndex()
| 237-327 | ||||||||||||
144 | uint index = id.asArrayIndex(); | - | ||||||||||||
145 | if (!args->fullyCreated()
| 16-191 | ||||||||||||
146 | args->fullyCreate(); executed 30 times by 1 test: args->fullyCreate(); Executed by:
| 30 | ||||||||||||
147 | - | |||||||||||||
148 | if (!args->fullyCreated()
| 16-221 | ||||||||||||
149 | args->context()->setArg(index, value); | - | ||||||||||||
150 | return executed 16 times by 1 test: true;return true; Executed by:
executed 16 times by 1 test: return true; Executed by:
| 16 | ||||||||||||
151 | } | - | ||||||||||||
152 | } executed 221 times by 1 test: end of block Executed by:
| 221 | ||||||||||||
153 | return executed 549 times by 1 test: Object::virtualPut(m, id, value, receiver);return Object::virtualPut(m, id, value, receiver); Executed by:
executed 549 times by 1 test: return Object::virtualPut(m, id, value, receiver); Executed by:
| 549 | ||||||||||||
154 | } | - | ||||||||||||
155 | - | |||||||||||||
156 | bool ArgumentsObject::virtualDeleteProperty(Managed *m, PropertyKey id) | - | ||||||||||||
157 | { | - | ||||||||||||
158 | ArgumentsObject *args = static_cast<ArgumentsObject *>(m); | - | ||||||||||||
159 | if (!args->fullyCreated()
| 54-287 | ||||||||||||
160 | args->fullyCreate(); executed 53 times by 1 test: args->fullyCreate(); Executed by:
| 53 | ||||||||||||
161 | return executed 342 times by 1 test: Object::virtualDeleteProperty(m, id);return Object::virtualDeleteProperty(m, id); Executed by:
executed 342 times by 1 test: return Object::virtualDeleteProperty(m, id); Executed by:
| 342 | ||||||||||||
162 | } | - | ||||||||||||
163 | - | |||||||||||||
164 | PropertyAttributes ArgumentsObject::virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p) | - | ||||||||||||
165 | { | - | ||||||||||||
166 | const ArgumentsObject *args = static_cast<const ArgumentsObject *>(m); | - | ||||||||||||
167 | if (!id.isArrayIndex()
| 2-978 | ||||||||||||
168 | return executed 1778 times by 1 test: Object::virtualGetOwnProperty(m, id, p);return Object::virtualGetOwnProperty(m, id, p); Executed by:
executed 1778 times by 1 test: return Object::virtualGetOwnProperty(m, id, p); Executed by:
| 1778 | ||||||||||||
169 | - | |||||||||||||
170 | uint index = id.asArrayIndex(); | - | ||||||||||||
171 | uint argCount = args->context()->argc(); | - | ||||||||||||
172 | if (index >= argCount
| 0-2 | ||||||||||||
173 | return executed 2 times by 1 test: PropertyAttributes();return PropertyAttributes(); Executed by:
executed 2 times by 1 test: return PropertyAttributes(); Executed by:
| 2 | ||||||||||||
174 | if (p
| 0 | ||||||||||||
175 | p->value = args->context()->args()[index]; never executed: p->value = args->context()->args()[index]; | 0 | ||||||||||||
176 | return never executed: Attr_Data;return Attr_Data; never executed: return Attr_Data; | 0 | ||||||||||||
177 | } | - | ||||||||||||
178 | - | |||||||||||||
179 | const QV4::VTable ArgumentsGetterFunction::static_vtbl = { (std::is_same<ArgumentsGetterFunction::SuperClass, Object>::value) ? nullptr : &ArgumentsGetterFunction::SuperClass::static_vtbl, (sizeof(ArgumentsGetterFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ArgumentsGetterFunction::Data) + (ArgumentsGetterFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ArgumentsGetterFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ArgumentsGetterFunction::IsExecutionContext, ArgumentsGetterFunction::IsString, ArgumentsGetterFunction::IsObject, ArgumentsGetterFunction::IsFunctionObject, ArgumentsGetterFunction::IsErrorObject, ArgumentsGetterFunction::IsArrayData, ArgumentsGetterFunction::IsStringOrSymbol, ArgumentsGetterFunction::MyType, { 0, 0, 0, 0 }, "ArgumentsGetterFunction", ArgumentsGetterFunction::virtualDestroy, ArgumentsGetterFunction::Data::markObjects, ArgumentsGetterFunction::virtualIsEqualTo, ArgumentsGetterFunction::virtualGet, ArgumentsGetterFunction::virtualPut, ArgumentsGetterFunction::virtualDeleteProperty, ArgumentsGetterFunction::virtualHasProperty, ArgumentsGetterFunction::virtualGetOwnProperty, ArgumentsGetterFunction::virtualDefineOwnProperty, ArgumentsGetterFunction::virtualIsExtensible, ArgumentsGetterFunction::virtualPreventExtensions, ArgumentsGetterFunction::virtualGetPrototypeOf, ArgumentsGetterFunction::virtualSetPrototypeOf, ArgumentsGetterFunction::virtualGetLength, ArgumentsGetterFunction::virtualAdvanceIterator, ArgumentsGetterFunction::virtualInstanceOf, ArgumentsGetterFunction::virtualCall, ArgumentsGetterFunction::virtualCallAsConstructor, }; | - | ||||||||||||
180 | - | |||||||||||||
181 | ReturnedValue ArgumentsGetterFunction::virtualCall(const FunctionObject *getter, const Value *thisObject, const Value *, int) | - | ||||||||||||
182 | { | - | ||||||||||||
183 | ExecutionEngine *v4 = getter->engine(); | - | ||||||||||||
184 | Scope scope(v4); | - | ||||||||||||
185 | const ArgumentsGetterFunction *g = static_cast<const ArgumentsGetterFunction *>(getter); | - | ||||||||||||
186 | Scoped<ArgumentsObject> o(scope, thisObject->as<ArgumentsObject>()); | - | ||||||||||||
187 | if (!o
| 0-48 | ||||||||||||
188 | return never executed: v4->throwTypeError();return v4->throwTypeError(); never executed: return v4->throwTypeError(); | 0 | ||||||||||||
189 | - | |||||||||||||
190 | ((g->index() < static_cast<unsigned>(o->context()->argc())) ? static_cast<void>(0) : qt_assert("g->index() < static_cast<unsigned>(o->context()->argc())", __FILE__, 236)); | - | ||||||||||||
191 | return executed 48 times by 1 test: o->context()->args()[g->index()].asReturnedValue();return o->context()->args()[g->index()].asReturnedValue(); Executed by:
executed 48 times by 1 test: return o->context()->args()[g->index()].asReturnedValue(); Executed by:
| 48 | ||||||||||||
192 | } | - | ||||||||||||
193 | - | |||||||||||||
194 | const QV4::VTable ArgumentsSetterFunction::static_vtbl = { (std::is_same<ArgumentsSetterFunction::SuperClass, Object>::value) ? nullptr : &ArgumentsSetterFunction::SuperClass::static_vtbl, (sizeof(ArgumentsSetterFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ArgumentsSetterFunction::Data) + (ArgumentsSetterFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ArgumentsSetterFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ArgumentsSetterFunction::IsExecutionContext, ArgumentsSetterFunction::IsString, ArgumentsSetterFunction::IsObject, ArgumentsSetterFunction::IsFunctionObject, ArgumentsSetterFunction::IsErrorObject, ArgumentsSetterFunction::IsArrayData, ArgumentsSetterFunction::IsStringOrSymbol, ArgumentsSetterFunction::MyType, { 0, 0, 0, 0 }, "ArgumentsSetterFunction", ArgumentsSetterFunction::virtualDestroy, ArgumentsSetterFunction::Data::markObjects, ArgumentsSetterFunction::virtualIsEqualTo, ArgumentsSetterFunction::virtualGet, ArgumentsSetterFunction::virtualPut, ArgumentsSetterFunction::virtualDeleteProperty, ArgumentsSetterFunction::virtualHasProperty, ArgumentsSetterFunction::virtualGetOwnProperty, ArgumentsSetterFunction::virtualDefineOwnProperty, ArgumentsSetterFunction::virtualIsExtensible, ArgumentsSetterFunction::virtualPreventExtensions, ArgumentsSetterFunction::virtualGetPrototypeOf, ArgumentsSetterFunction::virtualSetPrototypeOf, ArgumentsSetterFunction::virtualGetLength, ArgumentsSetterFunction::virtualAdvanceIterator, ArgumentsSetterFunction::virtualInstanceOf, ArgumentsSetterFunction::virtualCall, ArgumentsSetterFunction::virtualCallAsConstructor, }; | - | ||||||||||||
195 | - | |||||||||||||
196 | ReturnedValue ArgumentsSetterFunction::virtualCall(const FunctionObject *setter, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||
197 | { | - | ||||||||||||
198 | ExecutionEngine *v4 = setter->engine(); | - | ||||||||||||
199 | Scope scope(v4); | - | ||||||||||||
200 | const ArgumentsSetterFunction *s = static_cast<const ArgumentsSetterFunction *>(setter); | - | ||||||||||||
201 | Scoped<ArgumentsObject> o(scope, thisObject->as<ArgumentsObject>()); | - | ||||||||||||
202 | if (!o
| 0-51 | ||||||||||||
203 | return never executed: v4->throwTypeError();return v4->throwTypeError(); never executed: return v4->throwTypeError(); | 0 | ||||||||||||
204 | - | |||||||||||||
205 | ((s->index() < static_cast<unsigned>(o->context()->argc())) ? static_cast<void>(0) : qt_assert("s->index() < static_cast<unsigned>(o->context()->argc())", __FILE__, 251)); | - | ||||||||||||
206 | o->context()->setArg(s->index(), argc ? argv[0] : Primitive::undefinedValue()); | - | ||||||||||||
207 | return executed 51 times by 1 test: Encode::undefined();return Encode::undefined(); Executed by:
executed 51 times by 1 test: return Encode::undefined(); Executed by:
| 51 | ||||||||||||
208 | } | - | ||||||||||||
209 | - | |||||||||||||
210 | qint64 ArgumentsObject::virtualGetLength(const Managed *m) | - | ||||||||||||
211 | { | - | ||||||||||||
212 | const ArgumentsObject *a = static_cast<const ArgumentsObject *>(m); | - | ||||||||||||
213 | return executed 208 times by 1 test: a->propertyData(Heap::ArgumentsObject::LengthPropertyIndex)->toLength();return a->propertyData(Heap::ArgumentsObject::LengthPropertyIndex)->toLength(); Executed by:
executed 208 times by 1 test: return a->propertyData(Heap::ArgumentsObject::LengthPropertyIndex)->toLength(); Executed by:
| 208 | ||||||||||||
214 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |