aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4identifiertable_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-11-11 15:08:30 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-12 20:44:13 +0100
commitafbf1f74af678af0eda76035133406aa8883408a (patch)
tree2bc7b93256cad8691baa0079e60ba4cf2d52fa93 /src/qml/jsruntime/qv4identifiertable_p.h
parentfaf13a3aa0c97b7386e44d02f323a9156a733c9f (diff)
Ported ExecutionEngine::newString and newIdentifier to Heap::String
Avoid the use of Returned<String> for newString and changed the identifier table to use Heap::String. This required moving some code back into Heap::String, but that's code that doesn't call back into the GC, so allocations and therefore future object moves aren't possible. Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4identifiertable_p.h')
-rw-r--r--src/qml/jsruntime/qv4identifiertable_p.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4identifiertable_p.h b/src/qml/jsruntime/qv4identifiertable_p.h
index cc792fa3b4..fe88584c2e 100644
--- a/src/qml/jsruntime/qv4identifiertable_p.h
+++ b/src/qml/jsruntime/qv4identifiertable_p.h
@@ -49,36 +49,39 @@ struct IdentifierTable
int alloc;
int size;
int numBits;
- String **entries;
+ Heap::String **entries;
- void addEntry(String *str);
+ void addEntry(Heap::String *str);
public:
IdentifierTable(ExecutionEngine *engine);
~IdentifierTable();
- String *insertString(const QString &s);
+ Heap::String *insertString(const QString &s);
- Identifier *identifier(const String *str) {
- if (str->d()->identifier)
- return str->d()->identifier;
+ Identifier *identifier(const Heap::String *str) {
+ if (str->identifier)
+ return str->identifier;
return identifierImpl(str);
}
+ Identifier *identifier(const QV4::String *str) {
+ return identifier(str->d());
+ }
Identifier *identifier(const QString &s);
Identifier *identifier(const char *s, int len);
- Identifier *identifierImpl(const String *str);
+ Identifier *identifierImpl(const Heap::String *str);
void mark(ExecutionEngine *e) {
for (int i = 0; i < alloc; ++i) {
- String *entry = entries[i];
- if (!entry || entry->markBit())
+ Heap::String *entry = entries[i];
+ if (!entry || entry->markBit)
continue;
- entry->d()->markBit = 1;
- Q_ASSERT(entry->internalClass()->vtable->markObjects);
- entry->internalClass()->vtable->markObjects(entry->d(), e);
+ entry->markBit = 1;
+ Q_ASSERT(entry->internalClass->vtable->markObjects);
+ entry->internalClass->vtable->markObjects(entry, e);
}
}
};