OpenCoverage

qv4lookup_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4lookup_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39#ifndef QV4LOOKUP_H-
40#define QV4LOOKUP_H-
41-
42//-
43// W A R N I N G-
44// --------------
45//-
46// This file is not part of the Qt API. It exists purely as an-
47// implementation detail. This header file may change from version to-
48// version without notice, or even be removed.-
49//-
50// We mean it.-
51//-
52-
53#include "qv4global_p.h"-
54#include "qv4runtime_p.h"-
55#include "qv4engine_p.h"-
56#include "qv4context_p.h"-
57-
58#if !defined(V4_BOOTSTRAP)-
59#include "qv4object_p.h"-
60#include "qv4internalclass_p.h"-
61#endif-
62-
63QT_BEGIN_NAMESPACE-
64-
65namespace QV4 {-
66-
67struct Lookup {-
68 union {-
69 ReturnedValue (*getter)(Lookup *l, ExecutionEngine *engine, const Value &object);-
70 ReturnedValue (*globalGetter)(Lookup *l, ExecutionEngine *engine);-
71 bool (*setter)(Lookup *l, ExecutionEngine *engine, Value &object, const Value &v);-
72 };-
73 union {-
74 struct {-
75 Heap::Base *h1;-
76 Heap::Base *h2;-
77 quintptr unused;-
78 quintptr unused2;-
79 } markDef;-
80 struct {-
81 Heap::InternalClass *ic;-
82 quintptr _unused;-
83 int offset;-
84 } objectLookup;-
85 struct {-
86 quintptr protoId;-
87 quintptr _unused;-
88 const Value *data;-
89 } protoLookup;-
90 struct {-
91 Heap::InternalClass *ic;-
92 Heap::InternalClass *ic2;-
93 int offset;-
94 int offset2;-
95 } objectLookupTwoClasses;-
96 struct {-
97 quintptr protoId;-
98 quintptr protoId2;-
99 const Value *data;-
100 const Value *data2;-
101 } protoLookupTwoClasses;-
102 struct {-
103 // Make sure the next two values are in sync with protoLookup-
104 quintptr protoId;-
105 Heap::Object *proto;-
106 const Value *data;-
107 quintptr type;-
108 } primitiveLookup;-
109 struct {-
110 Heap::InternalClass *newClass;-
111 quintptr protoId;-
112 int offset;-
113 } insertionLookup;-
114 struct {-
115 quintptr _unused;-
116 quintptr _unused2;-
117 uint index;-
118 } indexedLookup;-
119 };-
120 uint nameIndex;-
121-
122 ReturnedValue resolveGetter(ExecutionEngine *engine, const Object *object);-
123 ReturnedValue resolvePrimitiveGetter(ExecutionEngine *engine, const Value &object);-
124 ReturnedValue resolveGlobalGetter(ExecutionEngine *engine);-
125 void resolveProtoGetter(PropertyKey name, const Heap::Object *proto);-
126-
127 static ReturnedValue getterGeneric(Lookup *l, ExecutionEngine *engine, const Value &object);-
128 static ReturnedValue getterTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);-
129 static ReturnedValue getterFallback(Lookup *l, ExecutionEngine *engine, const Value &object);-
130-
131 static ReturnedValue getter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);-
132 static ReturnedValue getter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);-
133 static ReturnedValue getterProto(Lookup *l, ExecutionEngine *engine, const Value &object);-
134 static ReturnedValue getter0Inlinegetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);-
135 static ReturnedValue getter0Inlinegetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);-
136 static ReturnedValue getter0MemberDatagetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);-
137 static ReturnedValue getterProtoTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);-
138 static ReturnedValue getterAccessor(Lookup *l, ExecutionEngine *engine, const Value &object);-
139 static ReturnedValue getterProtoAccessor(Lookup *l, ExecutionEngine *engine, const Value &object);-
140 static ReturnedValue getterProtoAccessorTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);-
141 static ReturnedValue getterIndexed(Lookup *l, ExecutionEngine *engine, const Value &object);-
142-
143 static ReturnedValue primitiveGetterProto(Lookup *l, ExecutionEngine *engine, const Value &object);-
144 static ReturnedValue primitiveGetterAccessor(Lookup *l, ExecutionEngine *engine, const Value &object);-
145 static ReturnedValue stringLengthGetter(Lookup *l, ExecutionEngine *engine, const Value &object);-
146-
147 static ReturnedValue globalGetterGeneric(Lookup *l, ExecutionEngine *engine);-
148 static ReturnedValue globalGetterProto(Lookup *l, ExecutionEngine *engine);-
149 static ReturnedValue globalGetterProtoAccessor(Lookup *l, ExecutionEngine *engine);-
150-
151 bool resolveSetter(ExecutionEngine *engine, Object *object, const Value &value);-
152 static bool setterGeneric(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
153 static bool setterTwoClasses(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
154 static bool setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
155 static bool setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
156 static bool setter0Inline(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
157 static bool setter0setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
158 static bool setterInsert(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
159 static bool arrayLengthSetter(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);-
160-
161 void markObjects(MarkStack *stack) {-
162 if (markDef.h1 && !(reinterpret_cast<quintptr>(markDef.h1) & 1))
markDef.h1Description
TRUEevaluated 329030 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 406304 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!(reinterpret_...rkDef.h1) & 1)Description
TRUEevaluated 73155 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 255884 times by 1 test
Evaluated by:
  • tst_ecmascripttests
73155-406304
163 markDef.h1->mark(stack);
executed 73155 times by 1 test: markDef.h1->mark(stack);
Executed by:
  • tst_ecmascripttests
73155
164 if (markDef.h2 && !(reinterpret_cast<quintptr>(markDef.h2) & 1))
markDef.h2Description
TRUEevaluated 49216 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 686079 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!(reinterpret_...rkDef.h2) & 1)Description
TRUEevaluated 8116 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 41100 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8116-686079
165 markDef.h2->mark(stack);
executed 8116 times by 1 test: markDef.h2->mark(stack);
Executed by:
  • tst_ecmascripttests
8116
166 }
executed 735288 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
735288
167-
168 void clear() {-
169 memset(&markDef, 0, sizeof(markDef));-
170 }
never executed: end of block
0
171};-
172-
173Q_STATIC_ASSERT(std::is_standard_layout<Lookup>::value);-
174// Ensure that these offsets are always at this point to keep generated code compatible-
175// across 32-bit and 64-bit (matters when cross-compiling).-
176Q_STATIC_ASSERT(offsetof(Lookup, getter) == 0);-
177-
178}-
179-
180QT_END_NAMESPACE-
181-
182#endif-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0