Bug 867426 - Remove RawAtom typedef; r=jonco
This commit is contained in:
@@ -233,13 +233,13 @@ enum OwnCharsBehavior
|
||||
* longer owns the memory and this method is responsible for freeing the memory.
|
||||
*/
|
||||
JS_ALWAYS_INLINE
|
||||
static RawAtom
|
||||
static JSAtom *
|
||||
AtomizeAndTakeOwnership(JSContext *cx, const jschar *tbchars, size_t length,
|
||||
InternBehavior ib)
|
||||
{
|
||||
JS_ASSERT(tbchars[length] == 0);
|
||||
|
||||
if (RawAtom s = cx->runtime->staticStrings.lookup(tbchars, length)) {
|
||||
if (JSAtom *s = cx->runtime->staticStrings.lookup(tbchars, length)) {
|
||||
js_free((void*)tbchars);
|
||||
return s;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ AtomizeAndTakeOwnership(JSContext *cx, const jschar *tbchars, size_t length,
|
||||
AtomSet::AddPtr p = atoms.lookupForAdd(AtomHasher::Lookup(tbchars, length));
|
||||
SkipRoot skipHash(cx, &p); /* Prevent the hash from being poisoned. */
|
||||
if (p) {
|
||||
RawAtom atom = p->asPtr();
|
||||
JSAtom *atom = p->asPtr();
|
||||
p->setTagged(bool(ib));
|
||||
js_free((void*)tbchars);
|
||||
return atom;
|
||||
@@ -268,7 +268,7 @@ AtomizeAndTakeOwnership(JSContext *cx, const jschar *tbchars, size_t length,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RawAtom atom = flat->morphAtomizedStringIntoAtom();
|
||||
JSAtom *atom = flat->morphAtomizedStringIntoAtom();
|
||||
|
||||
if (!atoms.relookupOrAdd(p, AtomHasher::Lookup(tbchars, length),
|
||||
AtomStateEntry(atom, bool(ib)))) {
|
||||
@@ -282,10 +282,10 @@ AtomizeAndTakeOwnership(JSContext *cx, const jschar *tbchars, size_t length,
|
||||
/* |tbchars| must not point into an inline or short string. */
|
||||
template <AllowGC allowGC>
|
||||
JS_ALWAYS_INLINE
|
||||
static RawAtom
|
||||
static JSAtom *
|
||||
AtomizeAndCopyChars(JSContext *cx, const jschar *tbchars, size_t length, InternBehavior ib)
|
||||
{
|
||||
if (RawAtom s = cx->runtime->staticStrings.lookup(tbchars, length))
|
||||
if (JSAtom *s = cx->runtime->staticStrings.lookup(tbchars, length))
|
||||
return s;
|
||||
|
||||
/*
|
||||
@@ -299,7 +299,7 @@ AtomizeAndCopyChars(JSContext *cx, const jschar *tbchars, size_t length, InternB
|
||||
AtomSet::AddPtr p = atoms.lookupForAdd(AtomHasher::Lookup(tbchars, length));
|
||||
SkipRoot skipHash(cx, &p); /* Prevent the hash from being poisoned. */
|
||||
if (p) {
|
||||
RawAtom atom = p->asPtr();
|
||||
JSAtom *atom = p->asPtr();
|
||||
p->setTagged(bool(ib));
|
||||
return atom;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ AtomizeAndCopyChars(JSContext *cx, const jschar *tbchars, size_t length, InternB
|
||||
if (!flat)
|
||||
return NULL;
|
||||
|
||||
RawAtom atom = flat->morphAtomizedStringIntoAtom();
|
||||
JSAtom *atom = flat->morphAtomizedStringIntoAtom();
|
||||
|
||||
if (!atoms.relookupOrAdd(p, AtomHasher::Lookup(tbchars, length),
|
||||
AtomStateEntry(atom, bool(ib)))) {
|
||||
@@ -322,7 +322,7 @@ AtomizeAndCopyChars(JSContext *cx, const jschar *tbchars, size_t length, InternB
|
||||
}
|
||||
|
||||
template <AllowGC allowGC>
|
||||
RawAtom
|
||||
JSAtom *
|
||||
js::AtomizeString(JSContext *cx, JSString *str, js::InternBehavior ib /* = js::DoNotInternAtom */)
|
||||
{
|
||||
if (str->isAtom()) {
|
||||
@@ -357,13 +357,13 @@ js::AtomizeString(JSContext *cx, JSString *str, js::InternBehavior ib /* = js::D
|
||||
return AtomizeAndCopyChars<CanGC>(cx, linear->chars(), linear->length(), ib);
|
||||
}
|
||||
|
||||
template RawAtom
|
||||
template JSAtom *
|
||||
js::AtomizeString<CanGC>(JSContext *cx, JSString *str, js::InternBehavior ib);
|
||||
|
||||
template RawAtom
|
||||
template JSAtom *
|
||||
js::AtomizeString<NoGC>(JSContext *cx, JSString *str, js::InternBehavior ib);
|
||||
|
||||
RawAtom
|
||||
JSAtom *
|
||||
js::Atomize(JSContext *cx, const char *bytes, size_t length, InternBehavior ib)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
@@ -393,7 +393,7 @@ js::Atomize(JSContext *cx, const char *bytes, size_t length, InternBehavior ib)
|
||||
}
|
||||
|
||||
template <AllowGC allowGC>
|
||||
RawAtom
|
||||
JSAtom *
|
||||
js::AtomizeChars(JSContext *cx, const jschar *chars, size_t length, InternBehavior ib)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
@@ -404,10 +404,10 @@ js::AtomizeChars(JSContext *cx, const jschar *chars, size_t length, InternBehavi
|
||||
return AtomizeAndCopyChars<allowGC>(cx, chars, length, ib);
|
||||
}
|
||||
|
||||
template RawAtom
|
||||
template JSAtom *
|
||||
js::AtomizeChars<CanGC>(JSContext *cx, const jschar *chars, size_t length, InternBehavior ib);
|
||||
|
||||
template RawAtom
|
||||
template JSAtom *
|
||||
js::AtomizeChars<NoGC>(JSContext *cx, const jschar *chars, size_t length, InternBehavior ib);
|
||||
|
||||
template <AllowGC allowGC>
|
||||
|
||||
Reference in New Issue
Block a user