Bug 989414 - Convert BarrieredPtr to take a T* as template parameter instead of T; r=jonco

This commit is contained in:
Terrence Cole
2014-04-25 11:02:44 -07:00
parent a4c8d2b6ee
commit 0bcc19fe6c
18 changed files with 154 additions and 136 deletions

View File

@@ -55,7 +55,7 @@ static const gc::AllocKind ITERATOR_FINALIZE_KIND = gc::FINALIZE_OBJECT2_BACKGRO
void
NativeIterator::mark(JSTracer *trc)
{
for (HeapPtr<JSFlatString> *str = begin(); str < end(); str++)
for (HeapPtrFlatString *str = begin(); str < end(); str++)
MarkString(trc, str, "prop");
if (obj)
MarkObject(trc, &obj, "obj");
@@ -426,7 +426,7 @@ NativeIterator::allocateIterator(JSContext *cx, uint32_t slength, const AutoIdVe
if (!ni)
return nullptr;
AutoValueVector strings(cx);
ni->props_array = ni->props_cursor = (HeapPtr<JSFlatString> *) (ni + 1);
ni->props_array = ni->props_cursor = (HeapPtrFlatString *) (ni + 1);
ni->props_end = ni->props_array + plength;
if (plength) {
for (size_t i = 0; i < plength; i++) {
@@ -1044,9 +1044,9 @@ SuppressDeletedPropertyHelper(JSContext *cx, HandleObject obj, StringPredicate p
/* This only works for identified suppressed keys, not values. */
if (ni->isKeyIter() && ni->obj == obj && ni->props_cursor < ni->props_end) {
/* Check whether id is still to come. */
HeapPtr<JSFlatString> *props_cursor = ni->current();
HeapPtr<JSFlatString> *props_end = ni->end();
for (HeapPtr<JSFlatString> *idp = props_cursor; idp < props_end; ++idp) {
HeapPtrFlatString *props_cursor = ni->current();
HeapPtrFlatString *props_end = ni->end();
for (HeapPtrFlatString *idp = props_cursor; idp < props_end; ++idp) {
if (predicate(*idp)) {
/*
* Check whether another property along the prototype chain
@@ -1091,7 +1091,7 @@ SuppressDeletedPropertyHelper(JSContext *cx, HandleObject obj, StringPredicate p
if (idp == props_cursor) {
ni->incCursor();
} else {
for (HeapPtr<JSFlatString> *p = idp; p + 1 != props_end; p++)
for (HeapPtrFlatString *p = idp; p + 1 != props_end; p++)
*p = *(p + 1);
ni->props_end = ni->end() - 1;