Bug 1219757 - Part 12: Remove JS_NewRegExpObjectNoStatics and JS_NewUCRegExpObjectNoStatics. r=till
authorTooru Fujisawa <arai_a@mac.com>
Wed, 25 Nov 2015 22:38:05 +0900
changeset 290000 604a180b6cc0e101eef1f974356b613aa0a40146
parent 289999 79925a383bbc06be1a47c730f2d094a5c2a82d07
child 290001 51102a2a44b51fa19ccb8f7504ea07c4a65ebf55
push id30112
push usercbook@mozilla.com
push dateWed, 23 Mar 2016 15:25:32 +0000
treeherdermozilla-central@6202ade0e6d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1219757
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1219757 - Part 12: Remove JS_NewRegExpObjectNoStatics and JS_NewUCRegExpObjectNoStatics. r=till
dom/base/nsContentUtils.cpp
js/src/jsapi.cpp
js/src/jsapi.h
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -6498,19 +6498,19 @@ nsContentUtils::IsPatternMatching(nsAStr
   // regexp evaluation, not actual script execution.
   JSAutoCompartment ac(cx, xpc::UnprivilegedJunkScope());
 
   // The pattern has to match the entire value.
   aPattern.Insert(NS_LITERAL_STRING("^(?:"), 0);
   aPattern.AppendLiteral(")$");
 
   JS::Rooted<JSObject*> re(cx,
-    JS_NewUCRegExpObjectNoStatics(cx,
-                                  static_cast<char16_t*>(aPattern.BeginWriting()),
-                                  aPattern.Length(), JSREG_UNICODE));
+    JS_NewUCRegExpObject(cx,
+                         static_cast<char16_t*>(aPattern.BeginWriting()),
+                         aPattern.Length(), JSREG_UNICODE));
   if (!re) {
     // Remove extra patterns added above to report with the original pattern.
     aPattern.Cut(0, 4);
     aPattern.Cut(aPattern.Length() - 2, 2);
     ReportPatternCompileFailure(aPattern, aDocument, cx);
     return true;
   }
 
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5735,38 +5735,16 @@ JS_ExecuteRegExp(JSContext* cx, HandleOb
 
     RootedLinearString input(cx, NewStringCopyN<CanGC>(cx, chars, length));
     if (!input)
         return false;
 
     return ExecuteRegExpLegacy(cx, res, reobj->as<RegExpObject>(), input, indexp, test, rval);
 }
 
-JS_PUBLIC_API(JSObject*)
-JS_NewRegExpObjectNoStatics(JSContext* cx, char* bytes, size_t length, unsigned flags)
-{
-    AssertHeapIsIdle(cx);
-    CHECK_REQUEST(cx);
-    char16_t* chars = InflateString(cx, bytes, &length);
-    if (!chars)
-        return nullptr;
-    RegExpObject* reobj = RegExpObject::create(cx, chars, length, RegExpFlag(flags), nullptr,
-                                               cx->tempLifoAlloc());
-    js_free(chars);
-    return reobj;
-}
-
-JS_PUBLIC_API(JSObject*)
-JS_NewUCRegExpObjectNoStatics(JSContext* cx, char16_t* chars, size_t length, unsigned flags)
-{
-    AssertHeapIsIdle(cx);
-    CHECK_REQUEST(cx);
-    return RegExpObject::create(cx, chars, length, RegExpFlag(flags), nullptr, cx->tempLifoAlloc());
-}
-
 JS_PUBLIC_API(bool)
 JS_ExecuteRegExpNoStatics(JSContext* cx, HandleObject obj, char16_t* chars, size_t length,
                           size_t* indexp, bool test, MutableHandleValue rval)
 {
     AssertHeapIsIdle(cx);
     CHECK_REQUEST(cx);
 
     RootedLinearString input(cx, NewStringCopyN<CanGC>(cx, chars, length));
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -5315,22 +5315,16 @@ JS_ClearRegExpStatics(JSContext* cx, JS:
 
 extern JS_PUBLIC_API(bool)
 JS_ExecuteRegExp(JSContext* cx, JS::HandleObject obj, JS::HandleObject reobj,
                  char16_t* chars, size_t length, size_t* indexp, bool test,
                  JS::MutableHandleValue rval);
 
 /* RegExp interface for clients without a global object. */
 
-extern JS_PUBLIC_API(JSObject*)
-JS_NewRegExpObjectNoStatics(JSContext* cx, char* bytes, size_t length, unsigned flags);
-
-extern JS_PUBLIC_API(JSObject*)
-JS_NewUCRegExpObjectNoStatics(JSContext* cx, char16_t* chars, size_t length, unsigned flags);
-
 extern JS_PUBLIC_API(bool)
 JS_ExecuteRegExpNoStatics(JSContext* cx, JS::HandleObject reobj, char16_t* chars, size_t length,
                           size_t* indexp, bool test, JS::MutableHandleValue rval);
 
 /**
  * Returns true and sets |*isRegExp| indicating whether |obj| is a RegExp
  * object or a wrapper around one, otherwise returns false on failure.
  *