mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1219757 - Part 5: Remove RegExpObject::createNoStatics. r=till
This commit is contained in:
parent
e8d18d12d9
commit
3af98dddbe
@ -5749,8 +5749,8 @@ JS_NewRegExpObjectNoStatics(JSContext* cx, char* bytes, size_t length, unsigned
|
||||
char16_t* chars = InflateString(cx, bytes, &length);
|
||||
if (!chars)
|
||||
return nullptr;
|
||||
RegExpObject* reobj = RegExpObject::createNoStatics(cx, chars, length,
|
||||
RegExpFlag(flags), nullptr, cx->tempLifoAlloc());
|
||||
RegExpObject* reobj = RegExpObject::create(cx, chars, length, RegExpFlag(flags), nullptr,
|
||||
cx->tempLifoAlloc());
|
||||
js_free(chars);
|
||||
return reobj;
|
||||
}
|
||||
@ -5760,8 +5760,7 @@ JS_NewUCRegExpObjectNoStatics(JSContext* cx, char16_t* chars, size_t length, uns
|
||||
{
|
||||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
return RegExpObject::createNoStatics(cx, chars, length,
|
||||
RegExpFlag(flags), nullptr, cx->tempLifoAlloc());
|
||||
return RegExpObject::create(cx, chars, length, RegExpFlag(flags), nullptr, cx->tempLifoAlloc());
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
|
@ -217,24 +217,17 @@ const Class RegExpObject::class_ = {
|
||||
RegExpObject*
|
||||
RegExpObject::create(ExclusiveContext* cx, const char16_t* chars, size_t length, RegExpFlag flags,
|
||||
TokenStream* tokenStream, LifoAlloc& alloc)
|
||||
{
|
||||
return createNoStatics(cx, chars, length, flags, tokenStream, alloc);
|
||||
}
|
||||
|
||||
RegExpObject*
|
||||
RegExpObject::createNoStatics(ExclusiveContext* cx, const char16_t* chars, size_t length, RegExpFlag flags,
|
||||
TokenStream* tokenStream, LifoAlloc& alloc)
|
||||
{
|
||||
RootedAtom source(cx, AtomizeChars(cx, chars, length));
|
||||
if (!source)
|
||||
return nullptr;
|
||||
|
||||
return createNoStatics(cx, source, flags, tokenStream, alloc);
|
||||
return create(cx, source, flags, tokenStream, alloc);
|
||||
}
|
||||
|
||||
RegExpObject*
|
||||
RegExpObject::createNoStatics(ExclusiveContext* cx, HandleAtom source, RegExpFlag flags,
|
||||
TokenStream* tokenStream, LifoAlloc& alloc)
|
||||
RegExpObject::create(ExclusiveContext* cx, HandleAtom source, RegExpFlag flags,
|
||||
TokenStream* tokenStream, LifoAlloc& alloc)
|
||||
{
|
||||
Maybe<CompileOptions> dummyOptions;
|
||||
Maybe<TokenStream> dummyTokenStream;
|
||||
@ -1048,8 +1041,8 @@ js::XDRScriptRegExpObject(XDRState<mode>* xdr, MutableHandle<RegExpObject*> objp
|
||||
return false;
|
||||
if (mode == XDR_DECODE) {
|
||||
RegExpFlag flags = RegExpFlag(flagsword);
|
||||
RegExpObject* reobj = RegExpObject::createNoStatics(xdr->cx(), source, flags, nullptr,
|
||||
xdr->cx()->tempLifoAlloc());
|
||||
RegExpObject* reobj = RegExpObject::create(xdr->cx(), source, flags, nullptr,
|
||||
xdr->cx()->tempLifoAlloc());
|
||||
if (!reobj)
|
||||
return false;
|
||||
|
||||
@ -1070,7 +1063,7 @@ js::CloneScriptRegExpObject(JSContext* cx, RegExpObject& reobj)
|
||||
/* NB: Keep this in sync with XDRScriptRegExpObject. */
|
||||
|
||||
RootedAtom source(cx, reobj.getSource());
|
||||
return RegExpObject::createNoStatics(cx, source, reobj.getFlags(), nullptr, cx->tempLifoAlloc());
|
||||
return RegExpObject::create(cx, source, reobj.getFlags(), nullptr, cx->tempLifoAlloc());
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
|
@ -373,12 +373,8 @@ class RegExpObject : public NativeObject
|
||||
frontend::TokenStream* ts, LifoAlloc& alloc);
|
||||
|
||||
static RegExpObject*
|
||||
createNoStatics(ExclusiveContext* cx, const char16_t* chars, size_t length, RegExpFlag flags,
|
||||
frontend::TokenStream* ts, LifoAlloc& alloc);
|
||||
|
||||
static RegExpObject*
|
||||
createNoStatics(ExclusiveContext* cx, HandleAtom atom, RegExpFlag flags,
|
||||
frontend::TokenStream* ts, LifoAlloc& alloc);
|
||||
create(ExclusiveContext* cx, HandleAtom atom, RegExpFlag flags,
|
||||
frontend::TokenStream* ts, LifoAlloc& alloc);
|
||||
|
||||
/*
|
||||
* Compute the initial shape to associate with fresh RegExp objects,
|
||||
|
@ -2607,7 +2607,7 @@ CloneObject(JSContext* cx, HandleNativeObject selfHostedObject)
|
||||
RegExpObject& reobj = selfHostedObject->as<RegExpObject>();
|
||||
RootedAtom source(cx, reobj.getSource());
|
||||
MOZ_ASSERT(source->isPermanentAtom());
|
||||
clone = RegExpObject::createNoStatics(cx, source, reobj.getFlags(), nullptr, cx->tempLifoAlloc());
|
||||
clone = RegExpObject::create(cx, source, reobj.getFlags(), nullptr, cx->tempLifoAlloc());
|
||||
} else if (selfHostedObject->is<DateObject>()) {
|
||||
clone = JS::NewDateObject(cx, selfHostedObject->as<DateObject>().clippedTime());
|
||||
} else if (selfHostedObject->is<BooleanObject>()) {
|
||||
|
@ -1743,8 +1743,8 @@ JSStructuredCloneReader::startRead(MutableHandleValue vp)
|
||||
if (!atom)
|
||||
return false;
|
||||
|
||||
RegExpObject* reobj = RegExpObject::createNoStatics(context(), atom, flags, nullptr,
|
||||
context()->tempLifoAlloc());
|
||||
RegExpObject* reobj = RegExpObject::create(context(), atom, flags, nullptr,
|
||||
context()->tempLifoAlloc());
|
||||
if (!reobj)
|
||||
return false;
|
||||
vp.setObject(*reobj);
|
||||
|
Loading…
Reference in New Issue
Block a user