Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | #ifndef QV4LOOKUP_H | - |
40 | #define QV4LOOKUP_H | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
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 | | - |
63 | QT_BEGIN_NAMESPACE | - |
64 | | - |
65 | namespace QV4 { | - |
66 | | - |
67 | struct 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 | | - |
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))TRUE | evaluated 329030 times by 1 test | FALSE | evaluated 406304 times by 1 test |
TRUE | evaluated 73155 times by 1 test | FALSE | evaluated 255884 times by 1 test |
| 73155-406304 |
163 | markDef.h1->mark(stack);executed 73155 times by 1 test: markDef.h1->mark(stack); | 73155 |
164 | if (markDef.h2 && !(reinterpret_cast<quintptr>(markDef.h2) & 1))TRUE | evaluated 49216 times by 1 test | FALSE | evaluated 686079 times by 1 test |
TRUE | evaluated 8116 times by 1 test | FALSE | evaluated 41100 times by 1 test |
| 8116-686079 |
165 | markDef.h2->mark(stack);executed 8116 times by 1 test: markDef.h2->mark(stack); | 8116 |
166 | }executed 735288 times by 1 test: end of block | 735288 |
167 | | - |
168 | void clear() { | - |
169 | memset(&markDef, 0, sizeof(markDef)); | - |
170 | } never executed: end of block | 0 |
171 | }; | - |
172 | | - |
173 | Q_STATIC_ASSERT(std::is_standard_layout<Lookup>::value); | - |
174 | | - |
175 | | - |
176 | Q_STATIC_ASSERT(offsetof(Lookup, getter) == 0); | - |
177 | | - |
178 | } | - |
179 | | - |
180 | QT_END_NAMESPACE | - |
181 | | - |
182 | #endif | - |
| | |