Merge autoland to mozilla-central. a=merge
authorGurzau Raul <rgurzau@mozilla.com>
Sun, 20 Oct 2019 12:43:54 +0300
changeset 498396 4b332005f92551e4c96e74a150a601764f76aa02
parent 498395 11d13005c8767500d6a20858e9db82603e8fb808 (current diff)
parent 498286 a6e168c78b26cdf69e7a151948c277b4c9d8fea9 (diff)
child 498397 b34beb21e1cf9d283ef0d855f68f63bcc15e40fb
push id114157
push usernbeleuzu@mozilla.com
push dateMon, 21 Oct 2019 22:00:13 +0000
treeherdermozilla-inbound@563f437f24b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone71.0a1
first release with
nightly linux32
4b332005f925 / 71.0a1 / 20191020094538 / files
nightly linux64
4b332005f925 / 71.0a1 / 20191020094538 / files
nightly mac
4b332005f925 / 71.0a1 / 20191020094538 / files
nightly win32
4b332005f925 / 71.0a1 / 20191020094538 / files
nightly win64
4b332005f925 / 71.0a1 / 20191020094538 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge autoland to mozilla-central. a=merge
--- a/dom/bindings/DOMJSProxyHandler.h
+++ b/dom/bindings/DOMJSProxyHandler.h
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_DOMJSProxyHandler_h
 #define mozilla_dom_DOMJSProxyHandler_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Likely.h"
+#include "mozilla/TextUtils.h"
 
 #include "jsapi.h"
 #include "js/Proxy.h"
 #include "nsString.h"
 
 namespace mozilla {
 namespace dom {
 
@@ -179,26 +180,24 @@ inline uint32_t GetArrayIndexFromId(JS::
   if (MOZ_LIKELY(id.get() == s_length_id)) {
     return UINT32_MAX;
   }
   if (MOZ_UNLIKELY(!JSID_IS_ATOM(id))) {
     return UINT32_MAX;
   }
 
   JSLinearString* str = js::AtomToLinearString(JSID_TO_ATOM(id));
-  char16_t s;
-  {
-    JS::AutoCheckCannotGC nogc;
-    if (js::LinearStringHasLatin1Chars(str)) {
-      s = *js::GetLatin1LinearStringChars(nogc, str);
-    } else {
-      s = *js::GetTwoByteLinearStringChars(nogc, str);
-    }
+  if (MOZ_UNLIKELY(js::GetLinearStringLength(str) == 0)) {
+    return UINT32_MAX;
   }
-  if (MOZ_LIKELY((unsigned)s >= 'a' && (unsigned)s <= 'z')) return UINT32_MAX;
+
+  char16_t firstChar = js::GetLinearStringCharAt(str, 0);
+  if (MOZ_LIKELY(IsAsciiLowercaseAlpha(firstChar))) {
+    return UINT32_MAX;
+  }
 
   uint32_t i;
   return js::StringIsArrayIndex(str, &i) ? i : UINT32_MAX;
 }
 
 inline bool IsArrayIndex(uint32_t index) { return index < UINT32_MAX; }
 
 inline void FillPropertyDescriptor(
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -694,24 +694,16 @@ static inline MIRType ScalarTypeToMIRTyp
     case Scalar::BigUint64:
       MOZ_CRASH("NYI");
     case Scalar::MaxTypedArrayViewType:
       break;
   }
   MOZ_CRASH("unexpected kind");
 }
 
-static inline const char* PropertyNameToExtraName(PropertyName* name) {
-  JS::AutoCheckCannotGC nogc;
-  if (!name->hasLatin1Chars()) {
-    return nullptr;
-  }
-  return reinterpret_cast<const char*>(name->latin1Chars(nogc));
-}
-
 #ifdef DEBUG
 
 // Track the pipeline of opcodes which has produced a snapshot.
 #  define TRACK_SNAPSHOTS 1
 
 // Make sure registers are not modified between an instruction and
 // its OsiPoint.
 #  define CHECK_OSIPOINT_REGISTERS 1
--- a/js/src/jit/shared/LIR-shared.h
+++ b/js/src/jit/shared/LIR-shared.h
@@ -4917,19 +4917,16 @@ class LGetPropertyPolymorphicV : public 
     setOperand(0, obj);
     setTemp(0, temp);
   }
   const LAllocation* obj() { return getOperand(0); }
   const LDefinition* temp() { return getTemp(0); }
   const MGetPropertyPolymorphic* mir() const {
     return mir_->toGetPropertyPolymorphic();
   }
-  const char* extraName() const {
-    return PropertyNameToExtraName(mir()->name());
-  }
 };
 
 // Emit code to load a typed value from an object's slots if its shape matches
 // one of the shapes observed by the baseline IC, else bails out.
 class LGetPropertyPolymorphicT : public LInstructionHelper<1, 1, 1> {
  public:
   LIR_HEADER(GetPropertyPolymorphicT)
 
@@ -4938,19 +4935,16 @@ class LGetPropertyPolymorphicT : public 
     setOperand(0, obj);
     setTemp(0, temp);
   }
   const LAllocation* obj() { return getOperand(0); }
   const LDefinition* temp() { return getTemp(0); }
   const MGetPropertyPolymorphic* mir() const {
     return mir_->toGetPropertyPolymorphic();
   }
-  const char* extraName() const {
-    return PropertyNameToExtraName(mir()->name());
-  }
 };
 
 // Emit code to store a boxed value to an object's slots if its shape matches
 // one of the shapes observed by the baseline IC, else bails out.
 class LSetPropertyPolymorphicV
     : public LInstructionHelper<0, 1 + BOX_PIECES, 1> {
  public:
   LIR_HEADER(SetPropertyPolymorphicV)
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -794,16 +794,25 @@ MOZ_ALWAYS_INLINE const char16_t* GetTwo
   using JS::shadow::String;
   String* s = reinterpret_cast<String*>(linear);
   if (s->flags() & String::INLINE_CHARS_BIT) {
     return s->inlineStorageTwoByte;
   }
   return s->nonInlineCharsTwoByte;
 }
 
+MOZ_ALWAYS_INLINE char16_t GetLinearStringCharAt(JSLinearString* linear,
+                                                 size_t index) {
+  MOZ_ASSERT(index < GetLinearStringLength(linear));
+  JS::AutoCheckCannotGC nogc;
+  return LinearStringHasLatin1Chars(linear)
+             ? GetLatin1LinearStringChars(nogc, linear)[index]
+             : GetTwoByteLinearStringChars(nogc, linear)[index];
+}
+
 MOZ_ALWAYS_INLINE JSLinearString* AtomToLinearString(JSAtom* atom) {
   return reinterpret_cast<JSLinearString*>(atom);
 }
 
 MOZ_ALWAYS_INLINE const JS::Latin1Char* GetLatin1AtomChars(
     const JS::AutoRequireNoGC& nogc, JSAtom* atom) {
   return GetLatin1LinearStringChars(nogc, AtomToLinearString(atom));
 }
--- a/toolkit/recordreplay/ipc/JSControl.cpp
+++ b/toolkit/recordreplay/ipc/JSControl.cpp
@@ -260,17 +260,17 @@ static bool Middleman_HadRepaint(JSConte
     JS::AutoAssertNoGC nogc(aCx);
     size_t dataLength;
     const JS::Latin1Char* dataChars =
         JS_GetLatin1StringCharsAndLength(aCx, nogc, data, &dataLength);
     if (!dataChars) {
       return false;
     }
 
-    nsDependentCString dataCString((const char*)dataChars, dataLength);
+    nsDependentCSubstring dataCString((const char*)dataChars, dataLength);
     nsresult rv = Base64Decode(dataCString, dataBinary);
     decodeFailed = NS_FAILED(rv);
   }
 
   if (decodeFailed) {
     JS_ReportErrorASCII(aCx, "Base64 decode failed");
     return false;
   }