| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4lookup.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | using namespace QV4; | - | ||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | void Lookup::resolveProtoGetter(PropertyKey name, const Heap::Object *proto) | - | ||||||||||||||||||
| 9 | { | - | ||||||||||||||||||
| 10 | while (proto
| 15065-1460102 | ||||||||||||||||||
| 11 | uint index = proto->internalClass->find(name); | - | ||||||||||||||||||
| 12 | if (index !=
| 40012-1421618 | ||||||||||||||||||
| 13 | (0x7fffffff * 2U + 1U)
| 40012-1421618 | ||||||||||||||||||
| 14 | ) { | - | ||||||||||||||||||
| 15 | PropertyAttributes attrs = proto->internalClass->propertyData.at(index); | - | ||||||||||||||||||
| 16 | protoLookup.data = proto->propertyData(index); | - | ||||||||||||||||||
| 17 | if (attrs.isData()
| 2394-1417795 | ||||||||||||||||||
| 18 | getter = getterProto; | - | ||||||||||||||||||
| 19 | } executed 1417740 times by 7 tests: else {end of blockExecuted by:
| 1417740 | ||||||||||||||||||
| 20 | getter = getterProtoAccessor; | - | ||||||||||||||||||
| 21 | } executed 2394 times by 1 test: end of blockExecuted by:
| 2394 | ||||||||||||||||||
| 22 | return; executed 1420239 times by 7 tests: return;Executed by:
| 1420239 | ||||||||||||||||||
| 23 | } | - | ||||||||||||||||||
| 24 | proto = proto->prototype(); | - | ||||||||||||||||||
| 25 | } executed 40005 times by 3 tests: end of blockExecuted by:
| 40005 | ||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | getter = getterFallback; | - | ||||||||||||||||||
| 28 | } executed 15065 times by 3 tests: end of blockExecuted by:
| 15065 | ||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | ReturnedValue Lookup::resolveGetter(ExecutionEngine *engine, const Object *object) | - | ||||||||||||||||||
| 31 | { | - | ||||||||||||||||||
| 32 | Heap::Object *obj = object->d(); | - | ||||||||||||||||||
| 33 | PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); | - | ||||||||||||||||||
| 34 | if (name.isArrayIndex()
| 679-680405 | ||||||||||||||||||
| 35 | indexedLookup.index = name.asArrayIndex(); | - | ||||||||||||||||||
| 36 | getter = getterIndexed; | - | ||||||||||||||||||
| 37 | return executed 680 times by 1 test: getter(this, engine, *object);return getter(this, engine, *object);Executed by:
executed 680 times by 1 test: return getter(this, engine, *object);Executed by:
| 680 | ||||||||||||||||||
| 38 | } | - | ||||||||||||||||||
| 39 | - | |||||||||||||||||||
| 40 | uint index = obj->internalClass->find(name); | - | ||||||||||||||||||
| 41 | if (index !=
| 101618-579213 | ||||||||||||||||||
| 42 | (0x7fffffff * 2U + 1U)
| 101618-579213 | ||||||||||||||||||
| 43 | ) { | - | ||||||||||||||||||
| 44 | PropertyAttributes attrs = obj->internalClass->propertyData.at(index); | - | ||||||||||||||||||
| 45 | uint nInline = obj->vtable()->nInlineProperties; | - | ||||||||||||||||||
| 46 | if (attrs.isData()
| 1561-577918 | ||||||||||||||||||
| 47 | if (index < obj->vtable()->nInlineProperties
| 279143-298779 | ||||||||||||||||||
| 48 | index += obj->vtable()->inlinePropertyOffset; | - | ||||||||||||||||||
| 49 | getter = getter0Inline; | - | ||||||||||||||||||
| 50 | } executed 279168 times by 7 tests: else {end of blockExecuted by:
| 279168 | ||||||||||||||||||
| 51 | index -= nInline; | - | ||||||||||||||||||
| 52 | getter = getter0MemberData; | - | ||||||||||||||||||
| 53 | } executed 298799 times by 2 tests: end of blockExecuted by:
| 298799 | ||||||||||||||||||
| 54 | } else { | - | ||||||||||||||||||
| 55 | getter = getterAccessor; | - | ||||||||||||||||||
| 56 | } executed 1561 times by 1 test: end of blockExecuted by:
| 1561 | ||||||||||||||||||
| 57 | objectLookup.ic = obj->internalClass; | - | ||||||||||||||||||
| 58 | objectLookup.offset = index; | - | ||||||||||||||||||
| 59 | return executed 579315 times by 7 tests: getter(this, engine, *object);return getter(this, engine, *object);Executed by:
executed 579315 times by 7 tests: return getter(this, engine, *object);Executed by:
| 579315 | ||||||||||||||||||
| 60 | } | - | ||||||||||||||||||
| 61 | - | |||||||||||||||||||
| 62 | protoLookup.protoId = obj->internalClass->protoId; | - | ||||||||||||||||||
| 63 | resolveProtoGetter(name, obj->prototype()); | - | ||||||||||||||||||
| 64 | return executed 101576 times by 2 tests: getter(this, engine, *object);return getter(this, engine, *object);Executed by:
executed 101576 times by 2 tests: return getter(this, engine, *object);Executed by:
| 101576 | ||||||||||||||||||
| 65 | } | - | ||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | ReturnedValue Lookup::resolvePrimitiveGetter(ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 68 | { | - | ||||||||||||||||||
| 69 | primitiveLookup.type = object.type(); | - | ||||||||||||||||||
| 70 | switch (primitiveLookup.type) { | - | ||||||||||||||||||
| 71 | case executed 2407 times by 1 test: Value::Undefined_Type:case Value::Undefined_Type:Executed by:
executed 2407 times by 1 test: case Value::Undefined_Type:Executed by:
| 2407 | ||||||||||||||||||
| 72 | case executed 344 times by 1 test: Value::Null_Type:case Value::Null_Type:Executed by:
executed 344 times by 1 test: case Value::Null_Type:Executed by:
| 344 | ||||||||||||||||||
| 73 | return executed 2750 times by 1 test: engine->throwTypeError();return engine->throwTypeError();Executed by:
executed 2750 times by 1 test: return engine->throwTypeError();Executed by:
| 2750 | ||||||||||||||||||
| 74 | case executed 56 times by 1 test: Value::Boolean_Type:case Value::Boolean_Type:Executed by:
executed 56 times by 1 test: case Value::Boolean_Type:Executed by:
| 56 | ||||||||||||||||||
| 75 | primitiveLookup.proto = engine->booleanPrototype()->d(); | - | ||||||||||||||||||
| 76 | break; executed 56 times by 1 test: break;Executed by:
| 56 | ||||||||||||||||||
| 77 | case executed 8134 times by 1 test: Value::Managed_Type:case Value::Managed_Type:Executed by:
executed 8134 times by 1 test: {case Value::Managed_Type:Executed by:
| 8134 | ||||||||||||||||||
| 78 | - | |||||||||||||||||||
| 79 | ((object.isStringOrSymbol()) ? static_cast<void>(0) : qt_assert("object.isStringOrSymbol()", __FILE__, 117)); | - | ||||||||||||||||||
| 80 | primitiveLookup.proto = static_cast<const Managed &>(object).internalClass()->prototype; | - | ||||||||||||||||||
| 81 | ((primitiveLookup.proto) ? static_cast<void>(0) : qt_assert("primitiveLookup.proto", __FILE__, 119)); | - | ||||||||||||||||||
| 82 | Scope scope(engine); | - | ||||||||||||||||||
| 83 | ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); | - | ||||||||||||||||||
| 84 | if (object.isString()
| 54-8087 | ||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | getter = stringLengthGetter; | - | ||||||||||||||||||
| 87 | return executed 280 times by 1 test: stringLengthGetter(this, engine, object);return stringLengthGetter(this, engine, object);Executed by:
executed 280 times by 1 test: return stringLengthGetter(this, engine, object);Executed by:
| 280 | ||||||||||||||||||
| 88 | } | - | ||||||||||||||||||
| 89 | break; executed 7864 times by 1 test: break;Executed by:
| 7864 | ||||||||||||||||||
| 90 | } | - | ||||||||||||||||||
| 91 | case executed 400 times by 1 test: Value::Integer_Type:case Value::Integer_Type:Executed by:
executed 400 times by 1 test: case Value::Integer_Type:Executed by:
| 400 | ||||||||||||||||||
| 92 | default executed 624 times by 1 test: :default:Executed by:
executed 624 times by 1 test: default:Executed by:
| 624 | ||||||||||||||||||
| 93 | primitiveLookup.proto = engine->numberPrototype()->d(); | - | ||||||||||||||||||
| 94 | } executed 1024 times by 1 test: end of blockExecuted by:
| 1024 | ||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); | - | ||||||||||||||||||
| 97 | protoLookup.protoId = primitiveLookup.proto->internalClass->protoId; | - | ||||||||||||||||||
| 98 | resolveProtoGetter(name, primitiveLookup.proto); | - | ||||||||||||||||||
| 99 | - | |||||||||||||||||||
| 100 | if (getter == getterProto
| 174-8780 | ||||||||||||||||||
| 101 | getter = primitiveGetterProto; executed 8780 times by 1 test: getter = primitiveGetterProto;Executed by:
| 8780 | ||||||||||||||||||
| 102 | else if (getter == getterProtoAccessor
| 16-158 | ||||||||||||||||||
| 103 | getter = primitiveGetterAccessor; executed 16 times by 1 test: getter = primitiveGetterAccessor;Executed by:
| 16 | ||||||||||||||||||
| 104 | return executed 8954 times by 1 test: getter(this, engine, object);return getter(this, engine, object);Executed by:
executed 8954 times by 1 test: return getter(this, engine, object);Executed by:
| 8954 | ||||||||||||||||||
| 105 | } | - | ||||||||||||||||||
| 106 | - | |||||||||||||||||||
| 107 | ReturnedValue Lookup::resolveGlobalGetter(ExecutionEngine *engine) | - | ||||||||||||||||||
| 108 | { | - | ||||||||||||||||||
| 109 | Object *o = engine->globalObject; | - | ||||||||||||||||||
| 110 | PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); | - | ||||||||||||||||||
| 111 | protoLookup.protoId = o->internalClass()->protoId; | - | ||||||||||||||||||
| 112 | resolveProtoGetter(name, o->d()); | - | ||||||||||||||||||
| 113 | - | |||||||||||||||||||
| 114 | if (getter == getterProto
| 7031-1318625 | ||||||||||||||||||
| 115 | globalGetter = globalGetterProto; executed 1317597 times by 7 tests: globalGetter = globalGetterProto;Executed by:
| 1317597 | ||||||||||||||||||
| 116 | else if (getter == getterProtoAccessor
| 60-6971 | ||||||||||||||||||
| 117 | globalGetter = globalGetterProtoAccessor; executed 60 times by 1 test: globalGetter = globalGetterProtoAccessor;Executed by:
| 60 | ||||||||||||||||||
| 118 | else { | - | ||||||||||||||||||
| 119 | globalGetter = globalGetterGeneric; | - | ||||||||||||||||||
| 120 | Scope scope(engine); | - | ||||||||||||||||||
| 121 | ScopedString n(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); | - | ||||||||||||||||||
| 122 | return executed 6962 times by 2 tests: engine->throwReferenceError(n);return engine->throwReferenceError(n);Executed by:
executed 6962 times by 2 tests: return engine->throwReferenceError(n);Executed by:
| 6962 | ||||||||||||||||||
| 123 | } | - | ||||||||||||||||||
| 124 | return executed 1317890 times by 7 tests: globalGetter(this, engine);return globalGetter(this, engine);Executed by:
executed 1317890 times by 7 tests: return globalGetter(this, engine);Executed by:
| 1317890 | ||||||||||||||||||
| 125 | } | - | ||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 128 | { | - | ||||||||||||||||||
| 129 | if (const
| 11977-678473 | ||||||||||||||||||
| 130 | return executed 678495 times by 7 tests: l->resolveGetter(engine, o);return l->resolveGetter(engine, o);Executed by:
executed 678495 times by 7 tests: return l->resolveGetter(engine, o);Executed by:
| 678495 | ||||||||||||||||||
| 131 | return executed 11972 times by 1 test: l->resolvePrimitiveGetter(engine, object);return l->resolvePrimitiveGetter(engine, object);Executed by:
executed 11972 times by 1 test: return l->resolvePrimitiveGetter(engine, object);Executed by:
| 11972 | ||||||||||||||||||
| 132 | } | - | ||||||||||||||||||
| 133 | - | |||||||||||||||||||
| 134 | ReturnedValue Lookup::getterTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 135 | { | - | ||||||||||||||||||
| 136 | if (const
| 0-1884 | ||||||||||||||||||
| 137 | Lookup first = *l; | - | ||||||||||||||||||
| 138 | Lookup second = *l; | - | ||||||||||||||||||
| 139 | - | |||||||||||||||||||
| 140 | ReturnedValue result = second.resolveGetter(engine, o); | - | ||||||||||||||||||
| 141 | - | |||||||||||||||||||
| 142 | if (first.getter == getter0Inline
| 0-1663 | ||||||||||||||||||
| 143 | l->objectLookupTwoClasses.ic = first.objectLookup.ic; | - | ||||||||||||||||||
| 144 | l->objectLookupTwoClasses.ic2 = second.objectLookup.ic; | - | ||||||||||||||||||
| 145 | l->objectLookupTwoClasses.offset = first.objectLookup.offset; | - | ||||||||||||||||||
| 146 | l->objectLookupTwoClasses.offset2 = second.objectLookup.offset; | - | ||||||||||||||||||
| 147 | l->getter = second.getter == getter0Inline
| 0-188 | ||||||||||||||||||
| 148 | return executed 188 times by 2 tests: result;return result;Executed by:
executed 188 times by 2 tests: return result;Executed by:
| 188 | ||||||||||||||||||
| 149 | } | - | ||||||||||||||||||
| 150 | if (first.getter == getter0MemberData
| 0-1697 | ||||||||||||||||||
| 151 | l->objectLookupTwoClasses.ic = second.objectLookup.ic; | - | ||||||||||||||||||
| 152 | l->objectLookupTwoClasses.ic2 = first.objectLookup.ic; | - | ||||||||||||||||||
| 153 | l->objectLookupTwoClasses.offset = second.objectLookup.offset; | - | ||||||||||||||||||
| 154 | l->objectLookupTwoClasses.offset2 = first.objectLookup.offset; | - | ||||||||||||||||||
| 155 | l->getter = second.getter == getter0Inline
| 0 | ||||||||||||||||||
| 156 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||
| 157 | } | - | ||||||||||||||||||
| 158 | if (first.getter == getterProto
| 0-1203 | ||||||||||||||||||
| 159 | l->protoLookupTwoClasses.protoId = first.protoLookup.protoId; | - | ||||||||||||||||||
| 160 | l->protoLookupTwoClasses.protoId2 = second.protoLookup.protoId; | - | ||||||||||||||||||
| 161 | l->protoLookupTwoClasses.data = first.protoLookup.data; | - | ||||||||||||||||||
| 162 | l->protoLookupTwoClasses.data2 = second.protoLookup.data; | - | ||||||||||||||||||
| 163 | l->getter = getterProtoTwoClasses; | - | ||||||||||||||||||
| 164 | return executed 1202 times by 1 test: result;return result;Executed by:
executed 1202 times by 1 test: return result;Executed by:
| 1202 | ||||||||||||||||||
| 165 | } | - | ||||||||||||||||||
| 166 | if (first.getter == getterProtoAccessor
| 0-460 | ||||||||||||||||||
| 167 | l->protoLookupTwoClasses.protoId = first.protoLookup.protoId; | - | ||||||||||||||||||
| 168 | l->protoLookupTwoClasses.protoId2 = second.protoLookup.protoId; | - | ||||||||||||||||||
| 169 | l->protoLookupTwoClasses.data = first.protoLookup.data; | - | ||||||||||||||||||
| 170 | l->protoLookupTwoClasses.data2 = second.protoLookup.data; | - | ||||||||||||||||||
| 171 | l->getter = getterProtoAccessorTwoClasses; | - | ||||||||||||||||||
| 172 | return executed 460 times by 1 test: result;return result;Executed by:
executed 460 times by 1 test: return result;Executed by:
| 460 | ||||||||||||||||||
| 173 | } | - | ||||||||||||||||||
| 174 | - | |||||||||||||||||||
| 175 | } executed 34 times by 2 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||
| 176 | - | |||||||||||||||||||
| 177 | l->getter = getterFallback; | - | ||||||||||||||||||
| 178 | return executed 34 times by 2 tests: getterFallback(l, engine, object);return getterFallback(l, engine, object);Executed by:
executed 34 times by 2 tests: return getterFallback(l, engine, object);Executed by:
| 34 | ||||||||||||||||||
| 179 | } | - | ||||||||||||||||||
| 180 | - | |||||||||||||||||||
| 181 | ReturnedValue Lookup::getterFallback(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 182 | { | - | ||||||||||||||||||
| 183 | QV4::Scope scope(engine); | - | ||||||||||||||||||
| 184 | QV4::ScopedObject o(scope, object.toObject(scope.engine)); | - | ||||||||||||||||||
| 185 | if (!o
| 0-44582 | ||||||||||||||||||
| 186 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||
| 187 | ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); | - | ||||||||||||||||||
| 188 | return executed 44589 times by 3 tests: o->get(name);return o->get(name);Executed by:
executed 44589 times by 3 tests: return o->get(name);Executed by:
| 44589 | ||||||||||||||||||
| 189 | } | - | ||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | ReturnedValue Lookup::getter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 192 | { | - | ||||||||||||||||||
| 193 | - | |||||||||||||||||||
| 194 | - | |||||||||||||||||||
| 195 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 196 | if (o
| 0-22363577 | ||||||||||||||||||
| 197 | if (l->objectLookup.ic == o->internalClass
| 0-22471102 | ||||||||||||||||||
| 198 | return executed 22470852 times by 2 tests: o->memberData->values.data()[l->objectLookup.offset].asReturnedValue();return o->memberData->values.data()[l->objectLookup.offset].asReturnedValue();Executed by:
executed 22470852 times by 2 tests: return o->memberData->values.data()[l->objectLookup.offset].asReturnedValue();Executed by:
| 22470852 | ||||||||||||||||||
| 199 | } never executed: end of block | 0 | ||||||||||||||||||
| 200 | return never executed: getterTwoClasses(l, engine, object);return getterTwoClasses(l, engine, object);never executed: return getterTwoClasses(l, engine, object); | 0 | ||||||||||||||||||
| 201 | } | - | ||||||||||||||||||
| 202 | - | |||||||||||||||||||
| 203 | ReturnedValue Lookup::getter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 204 | { | - | ||||||||||||||||||
| 205 | - | |||||||||||||||||||
| 206 | - | |||||||||||||||||||
| 207 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 208 | if (o
| 0-2703476 | ||||||||||||||||||
| 209 | if (l->objectLookup.ic == o->internalClass
| 222-2703887 | ||||||||||||||||||
| 210 | return executed 2703409 times by 7 tests: o->inlinePropertyDataWithOffset(l->objectLookup.offset)->asReturnedValue();return o->inlinePropertyDataWithOffset(l->objectLookup.offset)->asReturnedValue();Executed by:
executed 2703409 times by 7 tests: return o->inlinePropertyDataWithOffset(l->objectLookup.offset)->asReturnedValue();Executed by:
| 2703409 | ||||||||||||||||||
| 211 | } executed 222 times by 3 tests: end of blockExecuted by:
| 222 | ||||||||||||||||||
| 212 | return executed 222 times by 3 tests: getterTwoClasses(l, engine, object);return getterTwoClasses(l, engine, object);Executed by:
executed 222 times by 3 tests: return getterTwoClasses(l, engine, object);Executed by:
| 222 | ||||||||||||||||||
| 213 | } | - | ||||||||||||||||||
| 214 | - | |||||||||||||||||||
| 215 | ReturnedValue Lookup::getterProto(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 216 | { | - | ||||||||||||||||||
| 217 | - | |||||||||||||||||||
| 218 | - | |||||||||||||||||||
| 219 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 220 | if (o
| 0-127837 | ||||||||||||||||||
| 221 | if (l->protoLookup.protoId == o->internalClass->protoId
| 1204-126767 | ||||||||||||||||||
| 222 | return executed 126710 times by 1 test: l->protoLookup.data->asReturnedValue();return l->protoLookup.data->asReturnedValue();Executed by:
executed 126710 times by 1 test: return l->protoLookup.data->asReturnedValue();Executed by:
| 126710 | ||||||||||||||||||
| 223 | } executed 1203 times by 1 test: end of blockExecuted by:
| 1203 | ||||||||||||||||||
| 224 | return executed 1203 times by 1 test: getterTwoClasses(l, engine, object);return getterTwoClasses(l, engine, object);Executed by:
executed 1203 times by 1 test: return getterTwoClasses(l, engine, object);Executed by:
| 1203 | ||||||||||||||||||
| 225 | } | - | ||||||||||||||||||
| 226 | - | |||||||||||||||||||
| 227 | ReturnedValue Lookup::getter0Inlinegetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 228 | { | - | ||||||||||||||||||
| 229 | - | |||||||||||||||||||
| 230 | - | |||||||||||||||||||
| 231 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 232 | if (o
| 0-196 | ||||||||||||||||||
| 233 | if (l->objectLookupTwoClasses.ic == o->internalClass
| 32-164 | ||||||||||||||||||
| 234 | return executed 32 times by 1 test: o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();Executed by:
executed 32 times by 1 test: return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();Executed by:
| 32 | ||||||||||||||||||
| 235 | if (l->objectLookupTwoClasses.ic2 == o->internalClass
| 32-132 | ||||||||||||||||||
| 236 | return executed 32 times by 1 test: o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset2)->asReturnedValue();return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset2)->asReturnedValue();Executed by:
executed 32 times by 1 test: return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset2)->asReturnedValue();Executed by:
| 32 | ||||||||||||||||||
| 237 | } executed 132 times by 2 tests: end of blockExecuted by:
| 132 | ||||||||||||||||||
| 238 | l->getter = getterFallback; | - | ||||||||||||||||||
| 239 | return executed 132 times by 2 tests: getterFallback(l, engine, object);return getterFallback(l, engine, object);Executed by:
executed 132 times by 2 tests: return getterFallback(l, engine, object);Executed by:
| 132 | ||||||||||||||||||
| 240 | } | - | ||||||||||||||||||
| 241 | - | |||||||||||||||||||
| 242 | ReturnedValue Lookup::getter0Inlinegetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 243 | { | - | ||||||||||||||||||
| 244 | - | |||||||||||||||||||
| 245 | - | |||||||||||||||||||
| 246 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 247 | if (o
| 0 | ||||||||||||||||||
| 248 | if (l->objectLookupTwoClasses.ic == o->internalClass
| 0 | ||||||||||||||||||
| 249 | return never executed: o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();never executed: return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue(); | 0 | ||||||||||||||||||
| 250 | if (l->objectLookupTwoClasses.ic2 == o->internalClass
| 0 | ||||||||||||||||||
| 251 | return never executed: o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue();return o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue();never executed: return o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue(); | 0 | ||||||||||||||||||
| 252 | } never executed: end of block | 0 | ||||||||||||||||||
| 253 | l->getter = getterFallback; | - | ||||||||||||||||||
| 254 | return never executed: getterFallback(l, engine, object);return getterFallback(l, engine, object);never executed: return getterFallback(l, engine, object); | 0 | ||||||||||||||||||
| 255 | } | - | ||||||||||||||||||
| 256 | - | |||||||||||||||||||
| 257 | ReturnedValue Lookup::getter0MemberDatagetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 258 | { | - | ||||||||||||||||||
| 259 | - | |||||||||||||||||||
| 260 | - | |||||||||||||||||||
| 261 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 262 | if (o
| 0 | ||||||||||||||||||
| 263 | if (l->objectLookupTwoClasses.ic == o->internalClass
| 0 | ||||||||||||||||||
| 264 | return never executed: o->memberData->values.data()[l->objectLookupTwoClasses.offset].asReturnedValue();return o->memberData->values.data()[l->objectLookupTwoClasses.offset].asReturnedValue();never executed: return o->memberData->values.data()[l->objectLookupTwoClasses.offset].asReturnedValue(); | 0 | ||||||||||||||||||
| 265 | if (l->objectLookupTwoClasses.ic2 == o->internalClass
| 0 | ||||||||||||||||||
| 266 | return never executed: o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue();return o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue();never executed: return o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue(); | 0 | ||||||||||||||||||
| 267 | } never executed: end of block | 0 | ||||||||||||||||||
| 268 | l->getter = getterFallback; | - | ||||||||||||||||||
| 269 | return never executed: getterFallback(l, engine, object);return getterFallback(l, engine, object);never executed: return getterFallback(l, engine, object); | 0 | ||||||||||||||||||
| 270 | } | - | ||||||||||||||||||
| 271 | - | |||||||||||||||||||
| 272 | ReturnedValue Lookup::getterProtoTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 273 | { | - | ||||||||||||||||||
| 274 | - | |||||||||||||||||||
| 275 | - | |||||||||||||||||||
| 276 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 277 | if (o
| 0-11282 | ||||||||||||||||||
| 278 | if (l->protoLookupTwoClasses.protoId == o->internalClass->protoId
| 16-11269 | ||||||||||||||||||
| 279 | return executed 16 times by 1 test: l->protoLookupTwoClasses.data->asReturnedValue();return l->protoLookupTwoClasses.data->asReturnedValue();Executed by:
executed 16 times by 1 test: return l->protoLookupTwoClasses.data->asReturnedValue();Executed by:
| 16 | ||||||||||||||||||
| 280 | if (l->protoLookupTwoClasses.protoId2 == o->internalClass->protoId
| 628-10646 | ||||||||||||||||||
| 281 | return executed 628 times by 1 test: l->protoLookupTwoClasses.data2->asReturnedValue();return l->protoLookupTwoClasses.data2->asReturnedValue();Executed by:
executed 628 times by 1 test: return l->protoLookupTwoClasses.data2->asReturnedValue();Executed by:
| 628 | ||||||||||||||||||
| 282 | return executed 10646 times by 1 test: getterFallback(l, engine, object);return getterFallback(l, engine, object);Executed by:
executed 10646 times by 1 test: return getterFallback(l, engine, object);Executed by:
| 10646 | ||||||||||||||||||
| 283 | } | - | ||||||||||||||||||
| 284 | l->getter = getterFallback; | - | ||||||||||||||||||
| 285 | return never executed: getterFallback(l, engine, object);return getterFallback(l, engine, object);never executed: return getterFallback(l, engine, object); | 0 | ||||||||||||||||||
| 286 | } | - | ||||||||||||||||||
| 287 | - | |||||||||||||||||||
| 288 | ReturnedValue Lookup::getterAccessor(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 289 | { | - | ||||||||||||||||||
| 290 | - | |||||||||||||||||||
| 291 | - | |||||||||||||||||||
| 292 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 293 | if (o
| 0-1639 | ||||||||||||||||||
| 294 | if (l->objectLookup.ic == o->internalClass
| 12-1631 | ||||||||||||||||||
| 295 | const Value *getter = o->propertyData(l->objectLookup.offset); | - | ||||||||||||||||||
| 296 | if (!getter->isFunctionObject()
| 156-1474 | ||||||||||||||||||
| 297 | return executed 156 times by 1 test: Encode::undefined();return Encode::undefined();Executed by:
executed 156 times by 1 test: return Encode::undefined();Executed by:
| 156 | ||||||||||||||||||
| 298 | - | |||||||||||||||||||
| 299 | return executed 1472 times by 1 test: static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
executed 1472 times by 1 test: return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
| 1472 | ||||||||||||||||||
| 300 | } | - | ||||||||||||||||||
| 301 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||
| 302 | l->getter = getterFallback; | - | ||||||||||||||||||
| 303 | return executed 12 times by 1 test: getterFallback(l, engine, object);return getterFallback(l, engine, object);Executed by:
executed 12 times by 1 test: return getterFallback(l, engine, object);Executed by:
| 12 | ||||||||||||||||||
| 304 | } | - | ||||||||||||||||||
| 305 | - | |||||||||||||||||||
| 306 | ReturnedValue Lookup::getterProtoAccessor(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 307 | { | - | ||||||||||||||||||
| 308 | - | |||||||||||||||||||
| 309 | - | |||||||||||||||||||
| 310 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 311 | if (o
| 0-6050 | ||||||||||||||||||
| 312 | const Value *getter = l->protoLookup.data; | - | ||||||||||||||||||
| 313 | if (!getter->isFunctionObject()
| 4-5587 | ||||||||||||||||||
| 314 | return executed 4 times by 1 test: Encode::undefined();return Encode::undefined();Executed by:
executed 4 times by 1 test: return Encode::undefined();Executed by:
| 4 | ||||||||||||||||||
| 315 | - | |||||||||||||||||||
| 316 | return executed 5587 times by 1 test: static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
executed 5587 times by 1 test: return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
| 5587 | ||||||||||||||||||
| 317 | } | - | ||||||||||||||||||
| 318 | return executed 459 times by 1 test: getterTwoClasses(l, engine, object);return getterTwoClasses(l, engine, object);Executed by:
executed 459 times by 1 test: return getterTwoClasses(l, engine, object);Executed by:
| 459 | ||||||||||||||||||
| 319 | } | - | ||||||||||||||||||
| 320 | - | |||||||||||||||||||
| 321 | ReturnedValue Lookup::getterProtoAccessorTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 322 | { | - | ||||||||||||||||||
| 323 | - | |||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 326 | if (o
| 0-2837 | ||||||||||||||||||
| 327 | const Value *getter = nullptr; | - | ||||||||||||||||||
| 328 | if (l->protoLookupTwoClasses.protoId == o->internalClass->protoId
| 64-2774 | ||||||||||||||||||
| 329 | getter = l->protoLookupTwoClasses.data; executed 64 times by 1 test: getter = l->protoLookupTwoClasses.data;Executed by:
| 64 | ||||||||||||||||||
| 330 | else if (l->protoLookupTwoClasses.protoId2 == o->internalClass->protoId
| 420-2355 | ||||||||||||||||||
| 331 | getter = l->protoLookupTwoClasses.data2; executed 2356 times by 1 test: getter = l->protoLookupTwoClasses.data2;Executed by:
| 2356 | ||||||||||||||||||
| 332 | if (getter
| 419-2417 | ||||||||||||||||||
| 333 | if (!getter->isFunctionObject()
| 0-2419 | ||||||||||||||||||
| 334 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | return executed 2418 times by 1 test: static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
executed 2418 times by 1 test: return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
| 2418 | ||||||||||||||||||
| 337 | } | - | ||||||||||||||||||
| 338 | } executed 419 times by 1 test: end of blockExecuted by:
| 419 | ||||||||||||||||||
| 339 | l->getter = getterFallback; | - | ||||||||||||||||||
| 340 | return executed 419 times by 1 test: getterFallback(l, engine, object);return getterFallback(l, engine, object);Executed by:
executed 419 times by 1 test: return getterFallback(l, engine, object);Executed by:
| 419 | ||||||||||||||||||
| 341 | } | - | ||||||||||||||||||
| 342 | - | |||||||||||||||||||
| 343 | ReturnedValue Lookup::getterIndexed(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 344 | { | - | ||||||||||||||||||
| 345 | Object *o = object.objectValue(); | - | ||||||||||||||||||
| 346 | if (o
| 0-679 | ||||||||||||||||||
| 347 | Heap::Object *ho = o->d(); | - | ||||||||||||||||||
| 348 | if (ho->arrayData && ho->arrayData->type == Heap::ArrayData::Simple
| 0-680 | ||||||||||||||||||
| 349 | Heap::SimpleArrayData *s = ho->arrayData.cast<Heap::SimpleArrayData>(); | - | ||||||||||||||||||
| 350 | if (l->indexedLookup.index < s->values.size
| 168-511 | ||||||||||||||||||
| 351 | if (!s->data(l->indexedLookup.index).isEmpty()
| 0-512 | ||||||||||||||||||
| 352 | return executed 512 times by 1 test: s->data(l->indexedLookup.index).asReturnedValue();return s->data(l->indexedLookup.index).asReturnedValue();Executed by:
executed 512 times by 1 test: return s->data(l->indexedLookup.index).asReturnedValue();Executed by:
| 512 | ||||||||||||||||||
| 353 | } executed 168 times by 1 test: end of blockExecuted by:
| 168 | ||||||||||||||||||
| 354 | return executed 168 times by 1 test: o->get(l->indexedLookup.index);return o->get(l->indexedLookup.index);Executed by:
executed 168 times by 1 test: return o->get(l->indexedLookup.index);Executed by:
| 168 | ||||||||||||||||||
| 355 | } | - | ||||||||||||||||||
| 356 | l->getter = getterFallback; | - | ||||||||||||||||||
| 357 | return never executed: getterFallback(l, engine, object);return getterFallback(l, engine, object);never executed: return getterFallback(l, engine, object); | 0 | ||||||||||||||||||
| 358 | - | |||||||||||||||||||
| 359 | } | - | ||||||||||||||||||
| 360 | - | |||||||||||||||||||
| 361 | ReturnedValue Lookup::primitiveGetterProto(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 362 | { | - | ||||||||||||||||||
| 363 | if (object.type() == l->primitiveLookup.type
| 0-1613308 | ||||||||||||||||||
| 364 | Heap::Object *o = l->primitiveLookup.proto; | - | ||||||||||||||||||
| 365 | if (l->primitiveLookup.protoId == o->internalClass->protoId
| 0-1614000 | ||||||||||||||||||
| 366 | return executed 1614101 times by 1 test: l->primitiveLookup.data->asReturnedValue();return l->primitiveLookup.data->asReturnedValue();Executed by:
executed 1614101 times by 1 test: return l->primitiveLookup.data->asReturnedValue();Executed by:
| 1614101 | ||||||||||||||||||
| 367 | } never executed: end of block | 0 | ||||||||||||||||||
| 368 | l->getter = getterGeneric; | - | ||||||||||||||||||
| 369 | return never executed: getterGeneric(l, engine, object);return getterGeneric(l, engine, object);never executed: return getterGeneric(l, engine, object); | 0 | ||||||||||||||||||
| 370 | } | - | ||||||||||||||||||
| 371 | - | |||||||||||||||||||
| 372 | ReturnedValue Lookup::primitiveGetterAccessor(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 373 | { | - | ||||||||||||||||||
| 374 | if (object.type() == l->primitiveLookup.type
| 0-16 | ||||||||||||||||||
| 375 | Heap::Object *o = l->primitiveLookup.proto; | - | ||||||||||||||||||
| 376 | if (l->primitiveLookup.protoId == o->internalClass->protoId
| 0-16 | ||||||||||||||||||
| 377 | const Value *getter = l->primitiveLookup.data; | - | ||||||||||||||||||
| 378 | if (!getter->isFunctionObject()
| 0-16 | ||||||||||||||||||
| 379 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||
| 380 | - | |||||||||||||||||||
| 381 | return executed 16 times by 1 test: static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
executed 16 times by 1 test: return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);Executed by:
| 16 | ||||||||||||||||||
| 382 | } | - | ||||||||||||||||||
| 383 | } never executed: end of block | 0 | ||||||||||||||||||
| 384 | l->getter = getterGeneric; | - | ||||||||||||||||||
| 385 | return never executed: getterGeneric(l, engine, object);return getterGeneric(l, engine, object);never executed: return getterGeneric(l, engine, object); | 0 | ||||||||||||||||||
| 386 | } | - | ||||||||||||||||||
| 387 | - | |||||||||||||||||||
| 388 | ReturnedValue Lookup::stringLengthGetter(Lookup *l, ExecutionEngine *engine, const Value &object) | - | ||||||||||||||||||
| 389 | { | - | ||||||||||||||||||
| 390 | if (const
| 0-1205284 | ||||||||||||||||||
| 391 | return executed 1205228 times by 1 test: Encode(s->d()->length());return Encode(s->d()->length());Executed by:
executed 1205228 times by 1 test: return Encode(s->d()->length());Executed by:
| 1205228 | ||||||||||||||||||
| 392 | - | |||||||||||||||||||
| 393 | l->getter = getterGeneric; | - | ||||||||||||||||||
| 394 | return never executed: getterGeneric(l, engine, object);return getterGeneric(l, engine, object);never executed: return getterGeneric(l, engine, object); | 0 | ||||||||||||||||||
| 395 | } | - | ||||||||||||||||||
| 396 | - | |||||||||||||||||||
| 397 | ReturnedValue Lookup::globalGetterGeneric(Lookup *l, ExecutionEngine *engine) | - | ||||||||||||||||||
| 398 | { | - | ||||||||||||||||||
| 399 | return executed 1324348 times by 7 tests: l->resolveGlobalGetter(engine);return l->resolveGlobalGetter(engine);Executed by:
executed 1324348 times by 7 tests: return l->resolveGlobalGetter(engine);Executed by:
| 1324348 | ||||||||||||||||||
| 400 | } | - | ||||||||||||||||||
| 401 | - | |||||||||||||||||||
| 402 | ReturnedValue Lookup::globalGetterProto(Lookup *l, ExecutionEngine *engine) | - | ||||||||||||||||||
| 403 | { | - | ||||||||||||||||||
| 404 | Heap::Object *o = engine->globalObject->d(); | - | ||||||||||||||||||
| 405 | if (l->protoLookup.protoId == o->internalClass->protoId
| 112-243663389 | ||||||||||||||||||
| 406 | return executed 243702438 times by 7 tests: l->protoLookup.data->asReturnedValue();return l->protoLookup.data->asReturnedValue();Executed by:
executed 243702438 times by 7 tests: return l->protoLookup.data->asReturnedValue();Executed by:
| 243702438 | ||||||||||||||||||
| 407 | l->globalGetter = globalGetterGeneric; | - | ||||||||||||||||||
| 408 | return executed 112 times by 1 test: globalGetterGeneric(l, engine);return globalGetterGeneric(l, engine);Executed by:
executed 112 times by 1 test: return globalGetterGeneric(l, engine);Executed by:
| 112 | ||||||||||||||||||
| 409 | } | - | ||||||||||||||||||
| 410 | - | |||||||||||||||||||
| 411 | ReturnedValue Lookup::globalGetterProtoAccessor(Lookup *l, ExecutionEngine *engine) | - | ||||||||||||||||||
| 412 | { | - | ||||||||||||||||||
| 413 | Heap::Object *o = engine->globalObject->d(); | - | ||||||||||||||||||
| 414 | if (l->protoLookup.protoId == o->internalClass->protoId
| 0-60 | ||||||||||||||||||
| 415 | const Value *getter = l->protoLookup.data; | - | ||||||||||||||||||
| 416 | if (!getter->isFunctionObject()
| 0-60 | ||||||||||||||||||
| 417 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||
| 418 | - | |||||||||||||||||||
| 419 | return executed 60 times by 1 test: static_cast<const FunctionObject *>(getter)->call(engine->globalObject, nullptr, 0);return static_cast<const FunctionObject *>(getter)->call(engine->globalObject, nullptr, 0);Executed by:
executed 60 times by 1 test: return static_cast<const FunctionObject *>(getter)->call(engine->globalObject, nullptr, 0);Executed by:
| 60 | ||||||||||||||||||
| 420 | } | - | ||||||||||||||||||
| 421 | l->globalGetter = globalGetterGeneric; | - | ||||||||||||||||||
| 422 | return never executed: globalGetterGeneric(l, engine);return globalGetterGeneric(l, engine);never executed: return globalGetterGeneric(l, engine); | 0 | ||||||||||||||||||
| 423 | } | - | ||||||||||||||||||
| 424 | - | |||||||||||||||||||
| 425 | bool Lookup::resolveSetter(ExecutionEngine *engine, Object *object, const Value &value) | - | ||||||||||||||||||
| 426 | { | - | ||||||||||||||||||
| 427 | Scope scope(engine); | - | ||||||||||||||||||
| 428 | ScopedString name(scope, scope.engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); | - | ||||||||||||||||||
| 429 | - | |||||||||||||||||||
| 430 | Heap::InternalClass *c = object->internalClass(); | - | ||||||||||||||||||
| 431 | PropertyKey key = name->toPropertyKey(); | - | ||||||||||||||||||
| 432 | uint idx = c->find(key); | - | ||||||||||||||||||
| 433 | if (idx !=
| 7130-511786 | ||||||||||||||||||
| 434 | (0x7fffffff * 2U + 1U)
| 7130-511786 | ||||||||||||||||||
| 435 | ) { | - | ||||||||||||||||||
| 436 | if (object->isArrayObject()
| 124-6452 | ||||||||||||||||||
| 437 | setter = arrayLengthSetter; | - | ||||||||||||||||||
| 438 | return executed 541 times by 1 test: setter(this, engine, *object, value);return setter(this, engine, *object, value);Executed by:
executed 541 times by 1 test: return setter(this, engine, *object, value);Executed by:
| 541 | ||||||||||||||||||
| 439 | } else if (object->internalClass()->propertyData[idx].isData()
| 49-5719 | ||||||||||||||||||
| 440 | objectLookup.ic = object->internalClass(); | - | ||||||||||||||||||
| 441 | objectLookup.offset = idx; | - | ||||||||||||||||||
| 442 | setter = idx < object->d()->vtable()->nInlineProperties
| 1665-3996 | ||||||||||||||||||
| 443 | return executed 5661 times by 1 test: setter(this, engine, *object, value);return setter(this, engine, *object, value);Executed by:
executed 5661 times by 1 test: return setter(this, engine, *object, value);Executed by:
| 5661 | ||||||||||||||||||
| 444 | } else { | - | ||||||||||||||||||
| 445 | - | |||||||||||||||||||
| 446 | setter = setterFallback; | - | ||||||||||||||||||
| 447 | } executed 909 times by 1 test: end of blockExecuted by:
| 909 | ||||||||||||||||||
| 448 | return executed 910 times by 1 test: setter(this, engine, *object, value);return setter(this, engine, *object, value);Executed by:
executed 910 times by 1 test: return setter(this, engine, *object, value);Executed by:
| 910 | ||||||||||||||||||
| 449 | } | - | ||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | insertionLookup.protoId = c->protoId; | - | ||||||||||||||||||
| 452 | if (!object->put(key, value)
| 205-511615 | ||||||||||||||||||
| 453 | setter = Lookup::setterFallback; | - | ||||||||||||||||||
| 454 | return executed 205 times by 1 test: false;return false;Executed by:
executed 205 times by 1 test: return false;Executed by:
| 205 | ||||||||||||||||||
| 455 | } | - | ||||||||||||||||||
| 456 | - | |||||||||||||||||||
| 457 | if (object->internalClass() == c
| 84-511675 | ||||||||||||||||||
| 458 | - | |||||||||||||||||||
| 459 | setter = setterFallback; | - | ||||||||||||||||||
| 460 | return executed 84 times by 1 test: true;return true;Executed by:
executed 84 times by 1 test: return true;Executed by:
| 84 | ||||||||||||||||||
| 461 | } | - | ||||||||||||||||||
| 462 | idx = object->internalClass()->find(key); | - | ||||||||||||||||||
| 463 | if (idx ==
| 0-511550 | ||||||||||||||||||
| 464 | (0x7fffffff * 2U + 1U)
| 0-511550 | ||||||||||||||||||
| 465 | ) { | - | ||||||||||||||||||
| 466 | setter = setterFallback; | - | ||||||||||||||||||
| 467 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 468 | } | - | ||||||||||||||||||
| 469 | insertionLookup.newClass = object->internalClass(); | - | ||||||||||||||||||
| 470 | insertionLookup.offset = idx; | - | ||||||||||||||||||
| 471 | setter = setterInsert; | - | ||||||||||||||||||
| 472 | return executed 511521 times by 1 test: true;return true;Executed by:
executed 511521 times by 1 test: return true;Executed by:
| 511521 | ||||||||||||||||||
| 473 | } | - | ||||||||||||||||||
| 474 | - | |||||||||||||||||||
| 475 | bool Lookup::setterGeneric(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 476 | { | - | ||||||||||||||||||
| 477 | if (object.isObject()
| 20-517921 | ||||||||||||||||||
| 478 | return executed 517876 times by 1 test: l->resolveSetter(engine, static_cast<Object *>(&object), value);return l->resolveSetter(engine, static_cast<Object *>(&object), value);Executed by:
executed 517876 times by 1 test: return l->resolveSetter(engine, static_cast<Object *>(&object), value);Executed by:
| 517876 | ||||||||||||||||||
| 479 | - | |||||||||||||||||||
| 480 | Scope scope(engine); | - | ||||||||||||||||||
| 481 | ScopedObject o(scope, RuntimeHelpers::convertToObject(scope.engine, object)); | - | ||||||||||||||||||
| 482 | if (!o
| 4-16 | ||||||||||||||||||
| 483 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||
| 484 | ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); | - | ||||||||||||||||||
| 485 | return executed 16 times by 1 test: o->put(name, value);return o->put(name, value);Executed by:
executed 16 times by 1 test: return o->put(name, value);Executed by:
| 16 | ||||||||||||||||||
| 486 | } | - | ||||||||||||||||||
| 487 | - | |||||||||||||||||||
| 488 | bool Lookup::setterTwoClasses(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 489 | { | - | ||||||||||||||||||
| 490 | Lookup first = *l; | - | ||||||||||||||||||
| 491 | Lookup second = *l; | - | ||||||||||||||||||
| 492 | - | |||||||||||||||||||
| 493 | if (object.isObject()
| 0-60 | ||||||||||||||||||
| 494 | if (!l->resolveSetter(engine, static_cast<Object *>(&object), value)
| 0-60 | ||||||||||||||||||
| 495 | l->setter = setterFallback; | - | ||||||||||||||||||
| 496 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 497 | } | - | ||||||||||||||||||
| 498 | - | |||||||||||||||||||
| 499 | if (l->setter == Lookup::setter0
| 0-60 | ||||||||||||||||||
| 500 | l->objectLookupTwoClasses.ic = first.objectLookup.ic; | - | ||||||||||||||||||
| 501 | l->objectLookupTwoClasses.ic2 = second.objectLookup.ic; | - | ||||||||||||||||||
| 502 | l->objectLookupTwoClasses.offset = first.objectLookup.offset; | - | ||||||||||||||||||
| 503 | l->objectLookupTwoClasses.offset2 = second.objectLookup.offset; | - | ||||||||||||||||||
| 504 | l->setter = setter0setter0; | - | ||||||||||||||||||
| 505 | return executed 60 times by 1 test: true;return true;Executed by:
executed 60 times by 1 test: return true;Executed by:
| 60 | ||||||||||||||||||
| 506 | } | - | ||||||||||||||||||
| 507 | } never executed: end of block | 0 | ||||||||||||||||||
| 508 | - | |||||||||||||||||||
| 509 | l->setter = setterFallback; | - | ||||||||||||||||||
| 510 | return never executed: setterFallback(l, engine, object, value);return setterFallback(l, engine, object, value);never executed: return setterFallback(l, engine, object, value); | 0 | ||||||||||||||||||
| 511 | } | - | ||||||||||||||||||
| 512 | - | |||||||||||||||||||
| 513 | bool Lookup::setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 514 | { | - | ||||||||||||||||||
| 515 | QV4::Scope scope(engine); | - | ||||||||||||||||||
| 516 | QV4::ScopedObject o(scope, object.toObject(scope.engine)); | - | ||||||||||||||||||
| 517 | if (!o
| 0-2452 | ||||||||||||||||||
| 518 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 519 | - | |||||||||||||||||||
| 520 | ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); | - | ||||||||||||||||||
| 521 | return executed 2454 times by 1 test: o->put(name, value);return o->put(name, value);Executed by:
executed 2454 times by 1 test: return o->put(name, value);Executed by:
| 2454 | ||||||||||||||||||
| 522 | } | - | ||||||||||||||||||
| 523 | - | |||||||||||||||||||
| 524 | bool Lookup::setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 525 | { | - | ||||||||||||||||||
| 526 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 527 | if (o
| 0-1716 | ||||||||||||||||||
| 528 | o->setProperty(engine, l->objectLookup.offset, value); | - | ||||||||||||||||||
| 529 | return executed 1709 times by 1 test: true;return true;Executed by:
executed 1709 times by 1 test: return true;Executed by:
| 1709 | ||||||||||||||||||
| 530 | } | - | ||||||||||||||||||
| 531 | - | |||||||||||||||||||
| 532 | return never executed: setterTwoClasses(l, engine, object, value);return setterTwoClasses(l, engine, object, value);never executed: return setterTwoClasses(l, engine, object, value); | 0 | ||||||||||||||||||
| 533 | } | - | ||||||||||||||||||
| 534 | - | |||||||||||||||||||
| 535 | bool Lookup::setter0Inline(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 536 | { | - | ||||||||||||||||||
| 537 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 538 | if (o
| 0-4298 | ||||||||||||||||||
| 539 | o->setInlineProperty(engine, l->objectLookup.offset, value); | - | ||||||||||||||||||
| 540 | return executed 4232 times by 1 test: true;return true;Executed by:
executed 4232 times by 1 test: return true;Executed by:
| 4232 | ||||||||||||||||||
| 541 | } | - | ||||||||||||||||||
| 542 | - | |||||||||||||||||||
| 543 | return executed 60 times by 1 test: setterTwoClasses(l, engine, object, value);return setterTwoClasses(l, engine, object, value);Executed by:
executed 60 times by 1 test: return setterTwoClasses(l, engine, object, value);Executed by:
| 60 | ||||||||||||||||||
| 544 | } | - | ||||||||||||||||||
| 545 | - | |||||||||||||||||||
| 546 | bool Lookup::setter0setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 547 | { | - | ||||||||||||||||||
| 548 | Heap::Object *o = static_cast<Heap::Object *>(object.heapObject()); | - | ||||||||||||||||||
| 549 | if (o
| 0-60 | ||||||||||||||||||
| 550 | if (o->internalClass == l->objectLookupTwoClasses.ic
| 0-60 | ||||||||||||||||||
| 551 | o->setProperty(engine, l->objectLookupTwoClasses.offset, value); | - | ||||||||||||||||||
| 552 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 553 | } | - | ||||||||||||||||||
| 554 | if (o->internalClass == l->objectLookupTwoClasses.ic2
| 0-60 | ||||||||||||||||||
| 555 | o->setProperty(engine, l->objectLookupTwoClasses.offset2, value); | - | ||||||||||||||||||
| 556 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 557 | } | - | ||||||||||||||||||
| 558 | } executed 60 times by 1 test: end of blockExecuted by:
| 60 | ||||||||||||||||||
| 559 | - | |||||||||||||||||||
| 560 | l->setter = setterFallback; | - | ||||||||||||||||||
| 561 | return executed 60 times by 1 test: setterFallback(l, engine, object, value);return setterFallback(l, engine, object, value);Executed by:
executed 60 times by 1 test: return setterFallback(l, engine, object, value);Executed by:
| 60 | ||||||||||||||||||
| 562 | } | - | ||||||||||||||||||
| 563 | - | |||||||||||||||||||
| 564 | bool Lookup::setterInsert(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 565 | { | - | ||||||||||||||||||
| 566 | Object *o = static_cast<Object *>(object.managed()); | - | ||||||||||||||||||
| 567 | if (o
| 0-4599 | ||||||||||||||||||
| 568 | o->setInternalClass(l->insertionLookup.newClass); | - | ||||||||||||||||||
| 569 | o->d()->setProperty(engine, l->insertionLookup.offset, value); | - | ||||||||||||||||||
| 570 | return executed 4082 times by 1 test: true;return true;Executed by:
executed 4082 times by 1 test: return true;Executed by:
| 4082 | ||||||||||||||||||
| 571 | } | - | ||||||||||||||||||
| 572 | - | |||||||||||||||||||
| 573 | l->setter = setterFallback; | - | ||||||||||||||||||
| 574 | return executed 520 times by 1 test: setterFallback(l, engine, object, value);return setterFallback(l, engine, object, value);Executed by:
executed 520 times by 1 test: return setterFallback(l, engine, object, value);Executed by:
| 520 | ||||||||||||||||||
| 575 | } | - | ||||||||||||||||||
| 576 | - | |||||||||||||||||||
| 577 | bool Lookup::arrayLengthSetter(Lookup *, ExecutionEngine *engine, Value &object, const Value &value) | - | ||||||||||||||||||
| 578 | { | - | ||||||||||||||||||
| 579 | ((object.isObject() && static_cast<Object &>(object).isArrayObject()) ? static_cast<void>(0) : qt_assert("object.isObject() && static_cast<Object &>(object).isArrayObject()", __FILE__, 613)); | - | ||||||||||||||||||
| 580 | bool ok; | - | ||||||||||||||||||
| 581 | uint len = value.asArrayLength(&ok); | - | ||||||||||||||||||
| 582 | if (!ok
| 40-540 | ||||||||||||||||||
| 583 | engine->throwRangeError(value); | - | ||||||||||||||||||
| 584 | return executed 40 times by 1 test: false;return false;Executed by:
executed 40 times by 1 test: return false;Executed by:
| 40 | ||||||||||||||||||
| 585 | } | - | ||||||||||||||||||
| 586 | ok = static_cast<Object &>(object).setArrayLength(len); | - | ||||||||||||||||||
| 587 | if (!ok
| 22-519 | ||||||||||||||||||
| 588 | return executed 22 times by 1 test: false;return false;Executed by:
executed 22 times by 1 test: return false;Executed by:
| 22 | ||||||||||||||||||
| 589 | return executed 519 times by 1 test: true;return true;Executed by:
executed 519 times by 1 test: return true;Executed by:
| 519 | ||||||||||||||||||
| 590 | } | - | ||||||||||||||||||
| 591 | - | |||||||||||||||||||
| 592 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |