Browse Source

backports

Frank-Rainer Grahl 6 months ago
parent
commit
46c8f3fc10
100 changed files with 1032 additions and 26141 deletions
  1. 0 0
      frg/work-js/mozilla-release/patches/1267297-64a1.patch
  2. 0 0
      frg/work-js/mozilla-release/patches/1328820-63a1.patch
  3. 12 12
      frg/work-js/mozilla-release/patches/1437065-4-63a1.patch
  4. 0 0
      frg/work-js/mozilla-release/patches/1437065-5-63a1.patch
  5. 29 25
      frg/work-js/mozilla-release/patches/1442750-63a1.patch
  6. 290 0
      frg/work-js/mozilla-release/patches/1445551-6only-PARTIAL-61a1.patch
  7. 0 0
      frg/work-js/mozilla-release/patches/1449985-63a1.patch
  8. 9 9
      frg/work-js/mozilla-release/patches/1450574-4-61a1.patch
  9. 0 0
      frg/work-js/mozilla-release/patches/1456973-63a1.patch
  10. 0 0
      frg/work-js/mozilla-release/patches/1461374-63a1.patch
  11. 3 27
      frg/work-js/mozilla-release/patches/1461938-04-62a1.patch
  12. 1 23
      frg/work-js/mozilla-release/patches/1468406-4-62a1.patch
  13. 0 0
      frg/work-js/mozilla-release/patches/1471136-63a1.patch
  14. 0 0
      frg/work-js/mozilla-release/patches/1472170-63a1.patch
  15. 0 0
      frg/work-js/mozilla-release/patches/1479391-63a1.patch
  16. 9 9
      frg/work-js/mozilla-release/patches/1479794-63a1.patch
  17. 6 6
      frg/work-js/mozilla-release/patches/1480001-63a1.patch
  18. 0 0
      frg/work-js/mozilla-release/patches/1480552-64a1.patch
  19. 0 0
      frg/work-js/mozilla-release/patches/1480587-63a1.patch
  20. 38 0
      frg/work-js/mozilla-release/patches/1481670-1-63a1.patch
  21. 0 0
      frg/work-js/mozilla-release/patches/1481670-2-63a1.patch
  22. 0 0
      frg/work-js/mozilla-release/patches/1481670-3-63a1.patch
  23. 0 0
      frg/work-js/mozilla-release/patches/1483030-63a1.patch
  24. 9 9
      frg/work-js/mozilla-release/patches/1483962-63a1.patch
  25. 0 0
      frg/work-js/mozilla-release/patches/1485209-63a1.patch
  26. 30 32
      frg/work-js/mozilla-release/patches/1485738-63a1.patch
  27. 0 0
      frg/work-js/mozilla-release/patches/1486027-63a1.patch
  28. 10 10
      frg/work-js/mozilla-release/patches/1486397-63a1.patch
  29. 0 0
      frg/work-js/mozilla-release/patches/1486553-63a1.patch
  30. 0 0
      frg/work-js/mozilla-release/patches/1486584-63a1.patch
  31. 8 8
      frg/work-js/mozilla-release/patches/1486727-63a1.patch
  32. 0 0
      frg/work-js/mozilla-release/patches/1486731-1-63a1.patch
  33. 0 0
      frg/work-js/mozilla-release/patches/1486731-2-63a1.patch
  34. 8 176
      frg/work-js/mozilla-release/patches/1486782-63a1.patch
  35. 42 41
      frg/work-js/mozilla-release/patches/1486829-63a1.patch
  36. 0 0
      frg/work-js/mozilla-release/patches/1487023-63a1.patch
  37. 0 0
      frg/work-js/mozilla-release/patches/1487384-63a1.patch
  38. 0 0
      frg/work-js/mozilla-release/patches/1487483-63a1.patch
  39. 0 0
      frg/work-js/mozilla-release/patches/1487662-63a1.patch
  40. 32 0
      frg/work-js/mozilla-release/patches/1489601-64a1.patch
  41. 6 6
      frg/work-js/mozilla-release/patches/1489698-2-65a1.patch
  42. 5 4
      frg/work-js/mozilla-release/patches/1489698-4-65a1.patch
  43. 63 29
      frg/work-js/mozilla-release/patches/1590907-5-72a1.patch
  44. 0 704
      frg/work-js/mozilla-release/patches/L-1423328-59a1.patch
  45. 0 38
      frg/work-js/mozilla-release/patches/L-1460489-6-63a1.patch
  46. 0 94
      frg/work-js/mozilla-release/patches/TOP-1472170-PARTIAL-NOTESTS-63a1.patch
  47. 77 0
      frg/work-js/mozilla-release/patches/TOP-1541286-68a1.patch
  48. 0 74
      frg/work-js/mozilla-release/patches/TOP-NOBUG-PLASTER-25319.patch
  49. 51 48
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-02-1361856-1-dotall-76a1-25318.patch
  50. 77 61
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-04-1539690-68a1-25318.patch
  51. 29 29
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-09-1627356-77a1-25318.patch
  52. 9 9
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-10-1627838-77a1-25318.patch
  53. 16 18
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-12-1628835-77a1-25318.patch
  54. 16 16
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-14-1629670-77a1-25318.patch
  55. 38 35
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-37-1642493-79a1-25318.patch
  56. 9 9
      frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-46-fixes-25318.patch
  57. 0 83
      frg/work-js/mozilla-release/patches/mozilla-central-push_433250.patch
  58. 0 842
      frg/work-js/mozilla-release/patches/mozilla-central-push_433255.patch
  59. 0 1930
      frg/work-js/mozilla-release/patches/mozilla-central-push_433279.patch
  60. 0 132
      frg/work-js/mozilla-release/patches/mozilla-central-push_433567.patch
  61. 0 111
      frg/work-js/mozilla-release/patches/mozilla-central-push_433568.patch
  62. 0 69
      frg/work-js/mozilla-release/patches/mozilla-central-push_433569.patch
  63. 0 385
      frg/work-js/mozilla-release/patches/mozilla-central-push_433577.patch
  64. 0 153
      frg/work-js/mozilla-release/patches/mozilla-central-push_433584.patch
  65. 0 105
      frg/work-js/mozilla-release/patches/mozilla-central-push_433585.patch
  66. 0 52
      frg/work-js/mozilla-release/patches/mozilla-central-push_433632.patch
  67. 0 64
      frg/work-js/mozilla-release/patches/mozilla-central-push_433701.patch
  68. 0 1045
      frg/work-js/mozilla-release/patches/mozilla-central-push_433712.patch
  69. 0 340
      frg/work-js/mozilla-release/patches/mozilla-central-push_433713.patch
  70. 0 289
      frg/work-js/mozilla-release/patches/mozilla-central-push_433714.patch
  71. 0 283
      frg/work-js/mozilla-release/patches/mozilla-central-push_433715.patch
  72. 0 530
      frg/work-js/mozilla-release/patches/mozilla-central-push_433716.patch
  73. 0 880
      frg/work-js/mozilla-release/patches/mozilla-central-push_433717.patch
  74. 0 1364
      frg/work-js/mozilla-release/patches/mozilla-central-push_433718.patch
  75. 0 875
      frg/work-js/mozilla-release/patches/mozilla-central-push_433719.patch
  76. 0 29
      frg/work-js/mozilla-release/patches/mozilla-central-push_433996.patch
  77. 0 97
      frg/work-js/mozilla-release/patches/mozilla-central-push_433997.patch
  78. 0 323
      frg/work-js/mozilla-release/patches/mozilla-central-push_434095.patch
  79. 0 57
      frg/work-js/mozilla-release/patches/mozilla-central-push_434123.patch
  80. 0 1080
      frg/work-js/mozilla-release/patches/mozilla-central-push_434126.patch
  81. 0 151
      frg/work-js/mozilla-release/patches/mozilla-central-push_434179.patch
  82. 0 218
      frg/work-js/mozilla-release/patches/mozilla-central-push_434306.patch
  83. 0 27
      frg/work-js/mozilla-release/patches/mozilla-central-push_434309.patch
  84. 0 4560
      frg/work-js/mozilla-release/patches/mozilla-central-push_434356.patch
  85. 0 35
      frg/work-js/mozilla-release/patches/mozilla-central-push_434421.patch
  86. 0 67
      frg/work-js/mozilla-release/patches/mozilla-central-push_434424.patch
  87. 0 494
      frg/work-js/mozilla-release/patches/mozilla-central-push_434600.patch
  88. 0 2030
      frg/work-js/mozilla-release/patches/mozilla-central-push_438583.patch
  89. 0 323
      frg/work-js/mozilla-release/patches/mozilla-central2_434095.patch
  90. 0 2030
      frg/work-js/mozilla-release/patches/mozilla-central_438583.patch
  91. 0 459
      frg/work-js/mozilla-release/patches/mozilla-central_443893.patch
  92. 0 985
      frg/work-js/mozilla-release/patches/mozilla-central_443894.patch
  93. 0 47
      frg/work-js/mozilla-release/patches/mozilla-esr60_450803.patch
  94. 0 342
      frg/work-js/mozilla-release/patches/mozilla-esr78-push_444862.patch
  95. 0 343
      frg/work-js/mozilla-release/patches/mozilla-esr78-push_444863.patch
  96. 0 755
      frg/work-js/mozilla-release/patches/mozilla-esr78-push_444864.patch
  97. 0 442
      frg/work-js/mozilla-release/patches/mozilla-esr78-push_444865.patch
  98. 0 37
      frg/work-js/mozilla-release/patches/mozilla-esr78-push_444866.patch
  99. 53 105
      frg/work-js/mozilla-release/patches/series
  100. 47 12
      frg/work-js/mozilla-release/patches/series-test

+ 0 - 0
frg/work-js/mozilla-release/patches/1267297-63a1.patch → frg/work-js/mozilla-release/patches/1267297-64a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433724.patch → frg/work-js/mozilla-release/patches/1328820-63a1.patch


+ 12 - 12
frg/work-js/mozilla-release/patches/mozilla-central-push_433357.patch → frg/work-js/mozilla-release/patches/1437065-4-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535117240 -7200
 #      Fri Aug 24 15:27:20 2018 +0200
 # Node ID 79e9e6a709b04ecb89f2a87bba6e1967a2326cc8
-# Parent  acb4a0fc62ee2f84b0c3d37dacb74e3dfab4d83d
+# Parent  c489c0b67fb0aaacb5089bd41e8ccd6f6c7ea0eb
 Bug 1437065: Inline monomorphic calls to wasm; r=luke, r=jandem
 
 diff --git a/js/src/jit/Bailouts.h b/js/src/jit/Bailouts.h
@@ -48,8 +48,8 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
  #include "jit/shared/Lowering-shared-inl.h"
  #include "jit/TemplateObject-inl.h"
  #include "vm/Interpreter-inl.h"
- #include "vm/JSScript-inl.h"
-@@ -13551,13 +13552,140 @@ CodeGenerator::visitGetPrototypeOf(LGetP
+ 
+@@ -13541,13 +13542,140 @@ CodeGenerator::visitGetPrototypeOf(LGetP
      masm.jump(ool->rejoin());
  
      masm.bind(&hasProto);
@@ -275,7 +275,7 @@ diff --git a/js/src/jit/CompileWrappers.h b/js/src/jit/CompileWrappers.h
 diff --git a/js/src/jit/IonBuilder.h b/js/src/jit/IonBuilder.h
 --- a/js/src/jit/IonBuilder.h
 +++ b/js/src/jit/IonBuilder.h
-@@ -745,16 +745,17 @@ class IonBuilder
+@@ -746,16 +746,17 @@ class IonBuilder
                                    const Class* clasp3 = nullptr,
                                    const Class* clasp4 = nullptr);
      InliningResult inlineGuardToClass(CallInfo& callInfo, const Class* clasp);
@@ -349,7 +349,7 @@ diff --git a/js/src/jit/JSJitFrameIter.h b/js/src/jit/JSJitFrameIter.h
 diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
 --- a/js/src/jit/JitFrames.cpp
 +++ b/js/src/jit/JitFrames.cpp
-@@ -1165,16 +1165,22 @@ TraceJitExitFrame(JSTracer* trc, const J
+@@ -1178,16 +1178,22 @@ TraceJitExitFrame(JSTracer* trc, const J
      if (frame.isExitFrameLayout<CalledFromJitExitFrameLayout>()) {
          auto* layout = frame.exitFrame()->as<CalledFromJitExitFrameLayout>();
          JitFrameLayout* jsLayout = layout->jsFrame();
@@ -375,7 +375,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
 diff --git a/js/src/jit/JitFrames.h b/js/src/jit/JitFrames.h
 --- a/js/src/jit/JitFrames.h
 +++ b/js/src/jit/JitFrames.h
-@@ -466,28 +466,29 @@ class IonICCallFrameLayout : public Comm
+@@ -468,28 +468,29 @@ class IonICCallFrameLayout : public Comm
      }
      static size_t Size() {
          return sizeof(IonICCallFrameLayout);
@@ -417,7 +417,7 @@ diff --git a/js/src/jit/JitFrames.h b/js/src/jit/JitFrames.h
      // Stores the ExitFrameType or, for ExitFrameType::VMFunction, the
      // VMFunction*.
      uintptr_t data_;
-@@ -850,41 +851,50 @@ class LazyLinkExitFrameLayout : public C
+@@ -852,41 +853,50 @@ class LazyLinkExitFrameLayout : public C
  };
  
  class InterpreterStubExitFrameLayout : public CalledFromJitExitFrameLayout
@@ -612,7 +612,7 @@ diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp
          return inlineArrayIsArray(callInfo);
        case InlinableNative::ArrayJoin:
          return inlineArrayJoin(callInfo);
-@@ -3768,15 +3777,92 @@ IonBuilder::inlineConstructTypedObject(C
+@@ -3808,15 +3817,92 @@ IonBuilder::inlineConstructTypedObject(C
      MNewTypedObject* ins = MNewTypedObject::New(alloc(), constraints(), templateObject,
                                                  templateObject->group()->initialHeap(constraints()));
      current->add(ins);
@@ -726,7 +726,7 @@ diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp
  #include "vm/JSScript-inl.h"
  #include "vm/UnboxedObject-inl.h"
  
-@@ -6300,8 +6301,38 @@ jit::PropertyWriteNeedsTypeBarrier(TempA
+@@ -6302,8 +6303,38 @@ jit::PropertyWriteNeedsTypeBarrier(TempA
                  return true;
              excluded->watchStateChangeForUnboxedConvertedToNative(constraints);
          }
@@ -789,7 +789,7 @@ diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h
  #define FORWARD_DECLARE(op) class M##op;
   MIR_OPCODE_LIST(FORWARD_DECLARE)
  #undef FORWARD_DECLARE
-@@ -13961,16 +13965,57 @@ class MUnknownValue : public MNullaryIns
+@@ -13945,16 +13949,57 @@ class MUnknownValue : public MNullaryIns
          setResultType(MIRType::Value);
      }
  
@@ -1011,7 +1011,7 @@ diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h
 diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
 --- a/js/src/jsdate.cpp
 +++ b/js/src/jsdate.cpp
-@@ -31,16 +31,17 @@
+@@ -30,16 +30,17 @@
  #include "jsapi.h"
  #include "jsnum.h"
  #include "jstypes.h"
@@ -1032,7 +1032,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
 diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp
 --- a/js/src/vm/Stack.cpp
 +++ b/js/src/vm/Stack.cpp
-@@ -609,22 +609,23 @@ JitFrameIter::settle()
+@@ -605,22 +605,23 @@ JitFrameIter::settle()
          // [--------------------]
          // [JIT FRAME           ]
          // [WASM JIT ENTRY FRAME] <-- we're here

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433358.patch → frg/work-js/mozilla-release/patches/1437065-5-63a1.patch


+ 29 - 25
frg/work-js/mozilla-release/patches/mozilla-central-push_434101.patch → frg/work-js/mozilla-release/patches/1442750-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1520004694 21600
 #      Fri Mar 02 09:31:34 2018 -0600
 # Node ID 1289f17ab75d08071891f71d34480000e2bb52e1
-# Parent  f22d0641fd3dfa79a87dce3e5068f6eef2f31c6e
+# Parent  8c23898eb87f3ec66197c439ae1136a249727f89
 Bug 1442750 - Slience a few Clang-only warnings in SpiderMonkey. r=jorendorff
 
 The changes in shell/js.cpp silence warnings about unreachable return
@@ -11,32 +11,36 @@ statements.
 
 The constant being removed in testErrorInterceptor.cpp is unused.
 
-diff --git a/js/src/jsapi-tests/testErrorInterceptor.cpp b/js/src/jsapi-tests/testErrorInterceptor.cpp
---- a/js/src/jsapi-tests/testErrorInterceptor.cpp
-+++ b/js/src/jsapi-tests/testErrorInterceptor.cpp
-@@ -3,18 +3,16 @@
- #include "jsapi-tests/tests.h"
- 
- #include "util/StringBuffer.h"
- 
- // Tests for JS_GetErrorInterceptorCallback and JS_SetErrorInterceptorCallback.
- 
- 
- namespace {
--const double EXN_VALUE = 3.14;
--
- static JS::PersistentRootedString gLatestMessage;
- 
- // An interceptor that stores the error in `gLatestMessage`.
- struct SimpleInterceptor: JSErrorInterceptor {
-     virtual void interceptError(JSContext* cx, const JS::Value& val) override {
-         js::StringBuffer buffer(cx);
-         if (!ValueToStringBuffer(cx, val, buffer))
-             MOZ_CRASH("Could not convert to string buffer");
+diff --git a/js/src/jsapi-tests/testErrorInterceptor.cpp.1442750.later b/js/src/jsapi-tests/testErrorInterceptor.cpp.1442750.later
+new file mode 100644
+--- /dev/null
++++ b/js/src/jsapi-tests/testErrorInterceptor.cpp.1442750.later
+@@ -0,0 +1,21 @@
++--- testErrorInterceptor.cpp
+++++ testErrorInterceptor.cpp
++@@ -3,18 +3,16 @@
++ #include "jsapi-tests/tests.h"
++ 
++ #include "util/StringBuffer.h"
++ 
++ // Tests for JS_GetErrorInterceptorCallback and JS_SetErrorInterceptorCallback.
++ 
++ 
++ namespace {
++-const double EXN_VALUE = 3.14;
++-
++ static JS::PersistentRootedString gLatestMessage;
++ 
++ // An interceptor that stores the error in `gLatestMessage`.
++ struct SimpleInterceptor: JSErrorInterceptor {
++     virtual void interceptError(JSContext* cx, const JS::Value& val) override {
++         js::StringBuffer buffer(cx);
++         if (!ValueToStringBuffer(cx, val, buffer))
++             MOZ_CRASH("Could not convert to string buffer");
 diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
 --- a/js/src/shell/js.cpp
 +++ b/js/src/shell/js.cpp
-@@ -714,31 +714,31 @@ GetLine(FILE* file, const char * prompt)
+@@ -705,31 +705,31 @@ GetLine(FILE* file, const char * prompt)
              }
          }
  
@@ -70,7 +74,7 @@ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
      ShellContext* sc = GetShellContext(cx);
      if (!sc->serviceInterrupt)
          return true;
-@@ -7217,17 +7217,19 @@ WasmLoop(JSContext* cx, unsigned argc, V
+@@ -6743,17 +6743,19 @@ WasmLoop(JSContext* cx, unsigned argc, V
          Rooted<TypedArrayObject*> typedArray(cx, &ret->as<TypedArrayObject>());
          RootedWasmInstanceObject instanceObj(cx);
          if (!wasm::Eval(cx, typedArray, importObj, &instanceObj)) {

+ 290 - 0
frg/work-js/mozilla-release/patches/1445551-6only-PARTIAL-61a1.patch

@@ -0,0 +1,290 @@
+# HG changeset patch
+# User Kris Maglione <maglione.k@gmail.com>
+# Date 1521000154 25200
+# Node ID 7585e7acb34b63d21504aefb24a4ba43f90fa169
+# Parent  c12c1148a09601a48cf6621c64fc7b26cba2ac1e
+Bug 1445551: Part 6 - Remove JSAddonId type and addonId compartment flag. r=mccr8
+
+Note: For SeaMonkey 2.53 and up only remove the telemetry reporting for now.
+
+This compartment flag was only ever needed in order to track system-privileged
+add-on code running under the compartment-per-addon system. That system, and
+the legacy add-ons it supported, are gone.
+
+WebExtension compartments have their add-on ID stored on their principal, and
+are tracked in less obtrusive ways, so this code is no longer useful.
+
+MozReview-Commit-ID: NVEd3Oawak
+
+diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp
+--- a/js/src/jsexn.cpp
++++ b/js/src/jsexn.cpp
+@@ -773,77 +773,16 @@ ErrorReport::ErrorReport(JSContext* cx)
+     exnObject(cx)
+ {
+ }
+ 
+ ErrorReport::~ErrorReport()
+ {
+ }
+ 
+-void
+-ErrorReport::ReportAddonExceptionToTelemetry(JSContext* cx)
+-{
+-    MOZ_ASSERT(exnObject);
+-    RootedObject unwrapped(cx, UncheckedUnwrap(exnObject));
+-    MOZ_ASSERT(unwrapped, "UncheckedUnwrap failed?");
+-
+-    // There is not much we can report if the exception is not an ErrorObject, let's ignore those.
+-    if (!unwrapped->is<ErrorObject>())
+-        return;
+-
+-    Rooted<ErrorObject*> errObj(cx, &unwrapped->as<ErrorObject>());
+-    RootedObject stack(cx, errObj->stack());
+-
+-    // Let's ignore TOP level exceptions. For regular add-ons those will not be reported anyway,
+-    // for SDK based once it should not be a valid case either.
+-    // At this point the frame stack is unwound but the exception object stored the stack so let's
+-    // use that for getting the function name.
+-    if (!stack)
+-        return;
+-
+-    JSCompartment* comp = stack->compartment();
+-    JSAddonId* addonId = comp->creationOptions().addonIdOrNull();
+-
+-    // We only want to send the report if the scope that just have thrown belongs to an add-on.
+-    // Let's check the compartment of the youngest function on the stack, to determine that.
+-    if (!addonId)
+-        return;
+-
+-    RootedString funnameString(cx);
+-    JS::SavedFrameResult result = GetSavedFrameFunctionDisplayName(cx, stack, &funnameString);
+-    // AccessDenied should never be the case here for add-ons but let's not risk it.
+-    JSAutoByteString bytes;
+-    const char* funname = nullptr;
+-    bool denied = result == JS::SavedFrameResult::AccessDenied;
+-    funname = denied ? "unknown"
+-                     : funnameString ? AtomToPrintableString(cx,
+-                                                             &funnameString->asAtom(),
+-                                                             &bytes)
+-                                     : "anonymous";
+-
+-    UniqueChars addonIdChars(JS_EncodeString(cx, addonId));
+-
+-    const char* filename = nullptr;
+-    if (reportp && reportp->filename) {
+-        filename = strrchr(reportp->filename, '/');
+-        if (filename)
+-            filename++;
+-    }
+-    if (!filename) {
+-        filename = "FILE_NOT_FOUND";
+-    }
+-    char histogramKey[64];
+-    SprintfLiteral(histogramKey, "%s %s %s %u",
+-                   addonIdChars.get(),
+-                   funname,
+-                   filename,
+-                   (reportp ? reportp->lineno : 0) );
+-    cx->runtime()->addTelemetry(JS_TELEMETRY_ADDON_EXCEPTIONS, 1, histogramKey);
+-}
+-
+ bool
+ ErrorReport::init(JSContext* cx, HandleValue exn,
+                   SniffingBehavior sniffingBehavior)
+ {
+     MOZ_ASSERT(!cx->isExceptionPending());
+     MOZ_ASSERT(!reportp);
+ 
+     if (exn.isObject()) {
+@@ -852,20 +791,16 @@ ErrorReport::init(JSContext* cx, HandleV
+         exnObject = &exn.toObject();
+         reportp = ErrorFromException(cx, exnObject);
+ 
+         if (!reportp && sniffingBehavior == NoSideEffects) {
+             JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
+                                       JSMSG_ERR_DURING_THROW);
+             return false;
+         }
+-
+-        // Let's see if the exception is from add-on code, if so, it should be reported
+-        // to telemetry.
+-        ReportAddonExceptionToTelemetry(cx);
+     }
+ 
+ 
+     // Be careful not to invoke ToString if we've already successfully extracted
+     // an error report, since the exception might be wrapped in a security
+     // wrapper, and ToString-ing it might throw.
+     if (reportp) {
+         str = ErrorReportToString(cx, reportp);
+diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
+--- a/js/src/jsfriendapi.h
++++ b/js/src/jsfriendapi.h
+@@ -155,17 +155,16 @@ enum {
+     JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS,
+     JS_TELEMETRY_GC_MINOR_REASON,
+     JS_TELEMETRY_GC_MINOR_REASON_LONG,
+     JS_TELEMETRY_GC_MINOR_US,
+     JS_TELEMETRY_GC_NURSERY_BYTES,
+     JS_TELEMETRY_GC_PRETENURE_COUNT,
+     JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT,
+     JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS,
+-    JS_TELEMETRY_ADDON_EXCEPTIONS,
+     JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS,
+     JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS,
+     JS_TELEMETRY_END
+ };
+ 
+ typedef void
+ (*JSAccumulateTelemetryDataCallback)(int id, uint32_t sample, const char* key);
+ 
+@@ -1567,19 +1566,16 @@ struct MOZ_STACK_CLASS JS_FRIEND_API(Err
+     // but fills in an ErrorReport instead of reporting it.  Uses varargs to
+     // make it simpler to call js::ExpandErrorArgumentsVA.
+     //
+     // Returns false if we fail to actually populate the ErrorReport
+     // for some reason (probably out of memory).
+     bool populateUncaughtExceptionReportUTF8(JSContext* cx, ...);
+     bool populateUncaughtExceptionReportUTF8VA(JSContext* cx, va_list ap);
+ 
+-    // Reports exceptions from add-on scopes to telemetry.
+-    void ReportAddonExceptionToTelemetry(JSContext* cx);
+-
+     // We may have a provided JSErrorReport, so need a way to represent that.
+     JSErrorReport* reportp;
+ 
+     // Or we may need to synthesize a JSErrorReport one of our own.
+     JSErrorReport ownedReport;
+ 
+     // And we have a string to maybe keep alive that has pointers into
+     // it from ownedReport.
+diff --git a/js/src/vm/JSCompartment.cpp b/js/src/vm/JSCompartment.cpp
+--- a/js/src/vm/JSCompartment.cpp
++++ b/js/src/vm/JSCompartment.cpp
+@@ -1361,17 +1361,17 @@ JSCompartment::reportTelemetry()
+ }
+ 
+ void
+ JSCompartment::addTelemetry(const char* filename, DeprecatedLanguageExtension e)
+ {
+     // Only report telemetry for web content and add-ons, not chrome JS.
+     if (isSystem_)
+         return;
+-    if (!creationOptions_.addonIdOrNull() && (!filename || strncmp(filename, "http", 4) != 0))
++    if (!filename || strncmp(filename, "http", 4) != 0)
+         return;
+ 
+     sawDeprecatedLanguageExtension[size_t(e)] = true;
+ }
+ 
+ HashNumber
+ JSCompartment::randomHashCode()
+ {
+diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp
+--- a/js/xpconnect/src/XPCJSRuntime.cpp
++++ b/js/xpconnect/src/XPCJSRuntime.cpp
+@@ -2655,19 +2655,16 @@ AccumulateTelemetryCallback(int id, uint
+         Telemetry::Accumulate(Telemetry::GC_PRETENURE_COUNT, sample);
+         break;
+       case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT:
+         Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, sample);
+         break;
+       case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS:
+         Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS, sample);
+         break;
+-      case JS_TELEMETRY_ADDON_EXCEPTIONS:
+-        Telemetry::Accumulate(Telemetry::JS_TELEMETRY_ADDON_EXCEPTIONS, nsDependentCString(key), sample);
+-        break;
+       case JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS:
+         Telemetry::Accumulate(Telemetry::JS_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS, sample);
+         break;
+       case JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS:
+         Telemetry::Accumulate(Telemetry::JS_WEB_PARSER_COMPILE_LAZY_AFTER_MS, sample);
+         break;
+       default:
+         MOZ_ASSERT_UNREACHABLE("Unexpected JS_TELEMETRY id");
+diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json
+--- a/toolkit/components/telemetry/Histograms.json
++++ b/toolkit/components/telemetry/Histograms.json
+@@ -5239,23 +5239,16 @@
+     "record_in_processes": ["main", "content"],
+     "alert_emails": ["seceng-telemetry@mozilla.com", "fxprivacyandsecurity@mozilla.com"],
+     "bug_numbers": [767676],
+     "expires_in_version": "never",
+     "kind": "enumerated",
+     "n_values": 100,
+     "description": "Security-related UI events (addons, form submission, TLS certs, Safe Browsing, updates and geolocation). See /security/manager/ssl/nsISecurityUITelemetry.idl for the specific values."
+   },
+-  "JS_TELEMETRY_ADDON_EXCEPTIONS" : {
+-    "record_in_processes": ["main", "content"],
+-    "expires_in_version" : "never",
+-    "kind": "count",
+-    "keyed" : true,
+-    "description" : "Exceptions thrown by add-ons"
+-  },
+   "IPC_TRANSACTION_CANCEL": {
+     "record_in_processes": ["main", "content"],
+     "alert_emails": ["billm@mozilla.com"],
+     "expires_in_version": "never",
+     "kind": "boolean",
+     "description": "True when an IPC transaction is canceled"
+   },
+   "IPC_SAME_PROCESS_MESSAGE_COPY_OOM_KB": {
+diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/components/telemetry/histogram-whitelists.json
+--- a/toolkit/components/telemetry/histogram-whitelists.json
++++ b/toolkit/components/telemetry/histogram-whitelists.json
+@@ -182,17 +182,16 @@
+     "GDI_INITFONTLIST_TOTAL",
+     "GEOLOCATION_ACCURACY_EXPONENTIAL",
+     "GEOLOCATION_ERROR",
+     "GEOLOCATION_OSX_SOURCE_IS_MLS",
+     "GEOLOCATION_WIN8_SOURCE_IS_MLS",
+     "GFX_CRASH",
+     "INNERWINDOWS_WITH_MUTATION_LISTENERS",
+     "IPC_SAME_PROCESS_MESSAGE_COPY_OOM_KB",
+-    "JS_TELEMETRY_ADDON_EXCEPTIONS",
+     "LINK_ICON_SIZES_ATTR_DIMENSION",
+     "LINK_ICON_SIZES_ATTR_USAGE",
+     "LOCALDOMSTORAGE_CLEAR_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETALLKEYS_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETKEY_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETLENGTH_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETVALUE_BLOCKING_MS",
+     "LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS",
+@@ -645,17 +644,16 @@
+     "IMAGE_DECODE_SPEED_JPEG",
+     "IMAGE_DECODE_SPEED_PNG",
+     "IMAGE_DECODE_TIME",
+     "INNERWINDOWS_WITH_MUTATION_LISTENERS",
+     "IPC_SAME_PROCESS_MESSAGE_COPY_OOM_KB",
+     "IPC_TRANSACTION_CANCEL",
+     "JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS",
+     "JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT",
+-    "JS_TELEMETRY_ADDON_EXCEPTIONS",
+     "LINK_ICON_SIZES_ATTR_DIMENSION",
+     "LINK_ICON_SIZES_ATTR_USAGE",
+     "LOCALDOMSTORAGE_CLEAR_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETALLKEYS_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETKEY_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETLENGTH_BLOCKING_MS",
+     "LOCALDOMSTORAGE_GETVALUE_BLOCKING_MS",
+     "LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS",
+@@ -1336,17 +1334,16 @@
+     "FXA_CONFIGURED",
+     "FX_BROWSER_FULLSCREEN_USED",
+     "FX_CONTENT_CRASH_DUMP_UNAVAILABLE",
+     "FX_CONTENT_CRASH_NOT_SUBMITTED",
+     "FX_CONTENT_CRASH_PRESENTED",
+     "FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM",
+     "FX_TOUCH_USED",
+     "GEOLOCATION_ERROR",
+-    "JS_TELEMETRY_ADDON_EXCEPTIONS",
+     "MASTER_PASSWORD_ENABLED",
+     "MEDIA_CODEC_USED",
+     "NUMBER_OF_PROFILES",
+     "ONBEFOREUNLOAD_PROMPT_COUNT",
+     "OPENGL_COMPOSITING_FAILURE_ID",
+     "PERMISSIONS_SQL_CORRUPTED",
+     "PLUGIN_HANG_NOTICE_COUNT",
+     "PRINT_COUNT",

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433561.patch → frg/work-js/mozilla-release/patches/1449985-63a1.patch


+ 9 - 9
frg/work-js/mozilla-release/patches/1450574-4-61a1.patch

@@ -3,7 +3,7 @@
 # Date 1522867267 -7200
 #      Wed Apr 04 20:41:07 2018 +0200
 # Node ID 84acd9df2fe4a6583d5f3cd14106b141c6c6008a
-# Parent  cf44cd70bd4a9eed61fa633cbeb6d45c0dcf837a
+# Parent  5f8336d0438337a3df376c3a421236aa713e360f
 Bug 1450574 - Remove DeprecatedLanguageExtension telemetry code. r=jandem
 
 diff --git a/js/src/frontend/LanguageExtensions.h b/js/src/frontend/LanguageExtensions.h
@@ -141,7 +141,6 @@ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
      JS_TELEMETRY_GC_PRETENURE_COUNT,
 -    JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT,
 -    JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS,
-     JS_TELEMETRY_ADDON_EXCEPTIONS,
      JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS,
      JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS,
      JS_TELEMETRY_END
@@ -149,6 +148,7 @@ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
  
  typedef void
  (*JSAccumulateTelemetryDataCallback)(int id, uint32_t sample, const char* key);
+ 
 diff --git a/js/src/vm/JSCompartment.cpp b/js/src/vm/JSCompartment.cpp
 --- a/js/src/vm/JSCompartment.cpp
 +++ b/js/src/vm/JSCompartment.cpp
@@ -215,7 +215,7 @@ diff --git a/js/src/vm/JSCompartment.cpp b/js/src/vm/JSCompartment.cpp
 -    // Only report telemetry for web content and add-ons, not chrome JS.
 -    if (isSystem_)
 -        return;
--    if (!creationOptions_.addonIdOrNull() && (!filename || strncmp(filename, "http", 4) != 0))
+-    if (!filename || strncmp(filename, "http", 4) != 0)
 -        return;
 -
 -    sawDeprecatedLanguageExtension[size_t(e)] = true;
@@ -295,18 +295,18 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
 -      case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS:
 -        Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS, sample);
 -        break;
-       case JS_TELEMETRY_ADDON_EXCEPTIONS:
-         Telemetry::Accumulate(Telemetry::JS_TELEMETRY_ADDON_EXCEPTIONS, nsDependentCString(key), sample);
-         break;
        case JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS:
          Telemetry::Accumulate(Telemetry::JS_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS, sample);
          break;
        case JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS:
          Telemetry::Accumulate(Telemetry::JS_WEB_PARSER_COMPILE_LAZY_AFTER_MS, sample);
+         break;
+       default:
+         MOZ_ASSERT_UNREACHABLE("Unexpected JS_TELEMETRY id");
 diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json
 --- a/toolkit/components/telemetry/Histograms.json
 +++ b/toolkit/components/telemetry/Histograms.json
-@@ -1245,32 +1245,16 @@
+@@ -1236,32 +1236,16 @@
      "alert_emails": ["cpearce@mozilla.com", "gsquelart@mozilla.com"],
      "expires_in_version": "60",
      "bug_numbers": [1338011],
@@ -342,7 +342,7 @@ diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/t
 diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/components/telemetry/histogram-whitelists.json
 --- a/toolkit/components/telemetry/histogram-whitelists.json
 +++ b/toolkit/components/telemetry/histogram-whitelists.json
-@@ -643,18 +643,16 @@
+@@ -642,18 +642,16 @@
      "IMAGE_DECODE_ON_DRAW_LATENCY",
      "IMAGE_DECODE_SPEED_GIF",
      "IMAGE_DECODE_SPEED_JPEG",
@@ -353,7 +353,6 @@ diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/co
      "IPC_TRANSACTION_CANCEL",
 -    "JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS",
 -    "JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT",
-     "JS_TELEMETRY_ADDON_EXCEPTIONS",
      "LINK_ICON_SIZES_ATTR_DIMENSION",
      "LINK_ICON_SIZES_ATTR_USAGE",
      "LOCALDOMSTORAGE_CLEAR_BLOCKING_MS",
@@ -361,3 +360,4 @@ diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/co
      "LOCALDOMSTORAGE_GETKEY_BLOCKING_MS",
      "LOCALDOMSTORAGE_GETLENGTH_BLOCKING_MS",
      "LOCALDOMSTORAGE_GETVALUE_BLOCKING_MS",
+     "LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS",

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433562.patch → frg/work-js/mozilla-release/patches/1456973-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433995.patch → frg/work-js/mozilla-release/patches/1461374-63a1.patch


+ 3 - 27
frg/work-js/mozilla-release/patches/1461938-04-62a1.patch

@@ -3,7 +3,7 @@
 # Date 1526573078 -7200
 #      Thu May 17 18:04:38 2018 +0200
 # Node ID 01fcd734368770225504097a0f1ec4e5539fc041
-# Parent  48bd8d356a1243f7eadc21b6ea978d01f44c6712
+# Parent  66166ca72a80a978d7fd0a6fc5667269f5ed936b
 Bug 1461938 part 4 - Move RealmOptions from JSCompartment to JS::Realm. r=luke
 
 diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
@@ -494,30 +494,6 @@ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
          asmJSOption = AsmJSOption::DisabledByDebugger;
      else
          asmJSOption = AsmJSOption::Enabled;
-diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp
---- a/js/src/jsexn.cpp
-+++ b/js/src/jsexn.cpp
-@@ -795,18 +795,18 @@ ErrorReport::ReportAddonExceptionToTelem
- 
-     // Let's ignore TOP level exceptions. For regular add-ons those will not be reported anyway,
-     // for SDK based once it should not be a valid case either.
-     // At this point the frame stack is unwound but the exception object stored the stack so let's
-     // use that for getting the function name.
-     if (!stack)
-         return;
- 
--    JSCompartment* comp = stack->compartment();
--    JSAddonId* addonId = comp->creationOptions().addonIdOrNull();
-+    JS::Realm* sr = stack->realm();
-+    JSAddonId* addonId = sr->creationOptions().addonIdOrNull();
- 
-     // We only want to send the report if the scope that just have thrown belongs to an add-on.
-     // Let's check the compartment of the youngest function on the stack, to determine that.
-     if (!addonId)
-         return;
- 
-     RootedString funnameString(cx);
-     JS::SavedFrameResult result = GetSavedFrameFunctionDisplayName(cx, stack, &funnameString);
 diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
 --- a/js/src/jsfriendapi.cpp
 +++ b/js/src/jsfriendapi.cpp
@@ -1170,7 +1146,7 @@ diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
 diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp
 --- a/js/src/vm/NativeObject.cpp
 +++ b/js/src/vm/NativeObject.cpp
-@@ -2267,17 +2267,17 @@ GetNonexistentProperty(JSContext* cx, Ha
+@@ -2269,17 +2269,17 @@ GetNonexistentProperty(JSContext* cx, Ha
          return false;
      }
  
@@ -1189,7 +1165,7 @@ diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp
          return true;
  
      if (*pc != JSOP_GETPROP && *pc != JSOP_GETELEM)
-@@ -2462,17 +2462,17 @@ MaybeReportUndeclaredVarAssignment(JSCon
+@@ -2464,17 +2464,17 @@ MaybeReportUndeclaredVarAssignment(JSCon
          JSScript* script = cx->currentScript(&pc, JSContext::ALLOW_CROSS_COMPARTMENT);
          if (!script)
              return true;

+ 1 - 23
frg/work-js/mozilla-release/patches/1468406-4-62a1.patch

@@ -3,7 +3,7 @@
 # Date 1529485442 -7200
 #      Wed Jun 20 11:04:02 2018 +0200
 # Node ID 77b8ddea1fbd524f0917844f43c21c186262de5b
-# Parent  30a5529ee1b13810092b176df28649e6993d8878
+# Parent  4ed2ded5f499feb3a8f11baa399912f9cc29d986
 Bug 1468406 part 4 - Remove remaining JSObject::realm() calls. r=luke
 
 diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
@@ -215,28 +215,6 @@ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
          if (!origobj->compartment()->putWrapper(cx, CrossCompartmentKey(newIdentity), origv))
              MOZ_CRASH();
      }
-diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp
---- a/js/src/jsexn.cpp
-+++ b/js/src/jsexn.cpp
-@@ -794,17 +794,17 @@ ErrorReport::ReportAddonExceptionToTelem
- 
-     // Let's ignore TOP level exceptions. For regular add-ons those will not be reported anyway,
-     // for SDK based once it should not be a valid case either.
-     // At this point the frame stack is unwound but the exception object stored the stack so let's
-     // use that for getting the function name.
-     if (!stack)
-         return;
- 
--    JS::Realm* sr = stack->realm();
-+    JS::Realm* sr = stack->nonCCWRealm();
-     JSAddonId* addonId = sr->creationOptions().addonIdOrNull();
- 
-     // We only want to send the report if the scope that just have thrown belongs to an add-on.
-     // Let's check the compartment of the youngest function on the stack, to determine that.
-     if (!addonId)
-         return;
- 
-     RootedString funnameString(cx);
 diff --git a/js/src/proxy/CrossCompartmentWrapper.cpp b/js/src/proxy/CrossCompartmentWrapper.cpp
 --- a/js/src/proxy/CrossCompartmentWrapper.cpp
 +++ b/js/src/proxy/CrossCompartmentWrapper.cpp

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_434379.patch → frg/work-js/mozilla-release/patches/1471136-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433628.patch → frg/work-js/mozilla-release/patches/1472170-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433998.patch → frg/work-js/mozilla-release/patches/1479391-63a1.patch


+ 9 - 9
frg/work-js/mozilla-release/patches/mozilla-central-push_433885.patch → frg/work-js/mozilla-release/patches/1479794-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535386573 -7200
 #      Mon Aug 27 18:16:13 2018 +0200
 # Node ID 9fcca8293f56756d32636b9cc36b4ffa9d0e3d0d
-# Parent  24f835f7926dc9e789c9fd8d8e4675adb513d6ec
+# Parent  0d32b5b52aec82f611879baaa1464e5c9f107728
 Bug 1479794 - Do not expose Ref types outside the defining module.  r=luke
 
 For the time being, we do not want to expose struct types outside of
@@ -501,7 +501,7 @@ diff --git a/js/src/jit-test/tests/wasm/gc/ref.js b/js/src/jit-test/tests/wasm/g
 diff --git a/js/src/moz.build b/js/src/moz.build
 --- a/js/src/moz.build
 +++ b/js/src/moz.build
-@@ -700,16 +700,17 @@ DIRS += [
+@@ -703,16 +703,17 @@ DIRS += [
  FINAL_LIBRARY = 'js'
  
  if CONFIG['NIGHTLY_BUILD']:
@@ -512,13 +512,13 @@ diff --git a/js/src/moz.build b/js/src/moz.build
      DEFINES['ENABLE_WASM_GC'] = True
 +    DEFINES['WASM_PRIVATE_REFTYPES'] = True
  
- if CONFIG['JS_BUILD_BINAST']:
-     # Using SOURCES, as UNIFIED_SOURCES causes mysterious bugs on 32-bit platforms.
-     # These parts of BinAST are designed only to test evolutions of the
-     # specification.
-     SOURCES += ['frontend/BinTokenReaderTester.cpp']
-     # These parts of BinAST should eventually move to release.
-     SOURCES += [
+ # Some huge-mapping optimization instead of bounds checks on supported
+ # platforms.
+ if CONFIG['JS_CODEGEN_X64'] or CONFIG['JS_CODEGEN_ARM64']:
+     DEFINES['WASM_HUGE_MEMORY'] = True
+ 
+ if CONFIG['MOZ_DEBUG'] or CONFIG['NIGHTLY_BUILD']:
+     DEFINES['JS_CACHEIR_SPEW'] = True
 diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
 --- a/js/src/shell/moz.build
 +++ b/js/src/shell/moz.build

+ 6 - 6
frg/work-js/mozilla-release/patches/mozilla-central-push_433775.patch → frg/work-js/mozilla-release/patches/1480001-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1534250446 -36000
 #      Tue Aug 14 22:40:46 2018 +1000
 # Node ID 940f9b38540e1ee4f7fc2ea2c601dc1e85d36350
-# Parent  152b2a1144ae5c9d9541c3eda269bb417408ad9a
+# Parent  c20579d031749daa7583263405f774ab221be152
 Bug 1480001 - Enable allocation counts only when the profiler is active. r=jonco
 
 And also no-longer only on Nightly
@@ -36,8 +36,8 @@ diff --git a/js/src/gc/Allocator.cpp b/js/src/gc/Allocator.cpp
 diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
 --- a/js/src/gc/Nursery.cpp
 +++ b/js/src/gc/Nursery.cpp
-@@ -387,19 +387,19 @@ js::Nursery::allocate(size_t size)
-             timeInChunkAlloc_ += ReallyNow() - start;
+@@ -383,19 +383,19 @@ js::Nursery::allocate(size_t size)
+             timeInChunkAlloc_ += TimeStamp::Now() - start;
              MOZ_ASSERT(chunkno < allocatedChunkCount());
          }
          setCurrentChunk(chunkno);
@@ -58,7 +58,7 @@ diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
          auto canary = reinterpret_cast<Canary*>(position() - CanarySize);
          canary->magicValue = CanaryMagicValue;
          canary->next = nullptr;
-@@ -611,22 +611,24 @@ js::Nursery::renderProfileJSON(JSONPrint
+@@ -607,22 +607,24 @@ js::Nursery::renderProfileJSON(JSONPrint
      const size_t newCapacity = spaceToEnd(maxChunkCount());
      if (newCapacity != previousGC.nurseryCapacity)
          json.property("new_capacity", newCapacity);
@@ -92,7 +92,7 @@ diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
 diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
 --- a/js/src/jit/MacroAssembler.cpp
 +++ b/js/src/jit/MacroAssembler.cpp
-@@ -827,22 +827,21 @@ MacroAssembler::freeListAllocate(Registe
+@@ -893,22 +893,21 @@ MacroAssembler::freeListAllocate(Registe
      Push(result);
      // Update the free list to point to the next span (which may be empty).
      load32(Address(result, 0), result);
@@ -120,7 +120,7 @@ diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
      // These registers must match the ones in JitRuntime::generateMallocStub.
      const Register regReturn = CallTempReg0;
      const Register regZone = CallTempReg0;
-@@ -996,30 +995,28 @@ MacroAssembler::bumpPointerAllocate(Regi
+@@ -1062,30 +1061,28 @@ MacroAssembler::bumpPointerAllocate(Regi
      CheckedInt<int32_t> endOffset = (CheckedInt<uintptr_t>(uintptr_t(curEndAddr)) -
          CheckedInt<uintptr_t>(uintptr_t(posAddr))).toChecked<int32_t>();
      MOZ_ASSERT(endOffset.isValid(),

+ 0 - 0
frg/work-js/mozilla-release/patches/1480552-63a1.patch → frg/work-js/mozilla-release/patches/1480552-64a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433615.patch → frg/work-js/mozilla-release/patches/1480587-63a1.patch


+ 38 - 0
frg/work-js/mozilla-release/patches/1481670-1-63a1.patch

@@ -0,0 +1,38 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1534896133 -32400
+# Node ID 5ba2bfc9b269b9dae5818005b3b453e3e54c07d6
+# Parent  e84cc3b42665feab9d84242ce2e249156d276e04
+Bug 1481670 - Add a non-mangled version of the valgrind suppression for SaveWordToEnv. r=njn
+
+This is similar to what was done with SaveToEnv in bug 1457999.
+
+
+diff --git a/build/valgrind/cross-architecture.sup b/build/valgrind/cross-architecture.sup
+--- a/build/valgrind/cross-architecture.sup
++++ b/build/valgrind/cross-architecture.sup
+@@ -21,16 +21,23 @@
+ {
+    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 793549.)
+    Memcheck:Leak
+    ...
+    fun:_ZL13SaveWordToEnvPKcRK12nsTSubstringIcE
+    ...
+ }
+ {
++   PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 793549.)
++   Memcheck:Leak
++   ...
++   fun:SaveWordToEnv
++   ...
++}
++{
+    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 944133.)
+    Memcheck:Leak
+    ...
+    fun:_ZN13CrashReporter14SetRestartArgsEiPPc
+    ...
+ }
+ {
+    PR_SetEnv requires its argument to be leaked, but does not appear on stacks. (See bug 793548.)
+

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433324.patch → frg/work-js/mozilla-release/patches/1481670-2-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433325.patch → frg/work-js/mozilla-release/patches/1481670-3-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433212.patch → frg/work-js/mozilla-release/patches/1483030-63a1.patch


+ 9 - 9
frg/work-js/mozilla-release/patches/mozilla-central-push_434596.patch → frg/work-js/mozilla-release/patches/1483962-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535186275 0
 #      Sat Aug 25 08:37:55 2018 +0000
 # Node ID e2206a13d6d36d17e38b2ebb78d15164884cf5a6
-# Parent  e40357fad1e5109a1977aed6f59b2e31892fb07e
+# Parent  cb2cbc3939fd0b09921bf8aa42a69d9fa17a2de5
 Bug 1483962 - Move helpers of LocalTime UTC TimeZoneComment functions to DateTimeHelper. r=jwalden
 
 Differential Revision: https://phabricator.services.mozilla.com/D3901
@@ -11,7 +11,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D3901
 diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
 --- a/js/src/jsdate.cpp
 +++ b/js/src/jsdate.cpp
-@@ -118,16 +118,43 @@ static Atomic<JS::ReduceMicrosecondTimeP
+@@ -111,16 +111,43 @@ static Atomic<uint32_t, Relaxed> sResolu
   *
   *     setDay
   *     before
@@ -55,10 +55,10 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
      MOZ_ASSERT(divisor > 0);
      MOZ_ASSERT(IsFinite(divisor));
  
-@@ -435,61 +462,61 @@ JS::SetTimeResolutionUsec(uint32_t resol
+@@ -421,61 +448,61 @@ JS_PUBLIC_API(void)
+ JS::SetTimeResolutionUsec(uint32_t resolution)
  {
      sResolutionUsec = resolution;
-     sJitter = jitter;
  }
  
  #if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
@@ -127,7 +127,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
       * Jan 1 appears on Sunday (i == 0), Monday (i == 1), etc.
       *
       * yearStartingWith[1][i] is an example leap year where
-@@ -512,74 +539,86 @@ EquivalentYearForDST(int year)
+@@ -498,74 +525,86 @@ EquivalentYearForDST(int year)
          day += 7;
  
      const auto& yearStartingWith = year < 1970 ? pastYearStartingWith : futureYearStartingWith;
@@ -229,7 +229,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
  }
  
  static double
-@@ -2707,18 +2746,18 @@ date_toJSON(JSContext* cx, unsigned argc
+@@ -2680,18 +2719,18 @@ date_toJSON(JSContext* cx, unsigned argc
          return false;
      }
  
@@ -250,7 +250,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
      }
  
      char16_t tzbuf[100];
-@@ -2742,58 +2781,58 @@ TimeZoneComment(JSContext* cx, double ut
+@@ -2715,58 +2754,58 @@ TimeZoneComment(JSContext* cx, double ut
  
      // Parenthesize the returned display name.
      timeZoneStart[len] = ')';
@@ -320,7 +320,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
          // won't display it correctly.
          bool usetz = true;
          for (size_t i = 0; i < tzlen; i++) {
-@@ -2811,16 +2850,22 @@ TimeZoneComment(JSContext* cx, double ut
+@@ -2784,16 +2823,22 @@ TimeZoneComment(JSContext* cx, double ut
          if (usetz)
              return NewStringCopyN<CanGC>(cx, tzbuf, tzlen);
      }
@@ -343,7 +343,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
  
  static bool
  FormatDate(JSContext* cx, double utcTime, FormatSpec format, MutableHandleValue rval)
-@@ -2919,17 +2964,17 @@ ToLocaleFormatHelper(JSContext* cx, Hand
+@@ -2892,17 +2937,17 @@ ToLocaleFormatHelper(JSContext* cx, Hand
  
      char buf[100];
      if (!IsFinite(utcTime)) {

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433622.patch → frg/work-js/mozilla-release/patches/1485209-63a1.patch


+ 30 - 32
frg/work-js/mozilla-release/patches/mozilla-central-push_434396.patch → frg/work-js/mozilla-release/patches/1485738-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535745582 -10800
 #      Fri Aug 31 22:59:42 2018 +0300
 # Node ID 9d438550d85682669333a5f522c3491dfa1ee2e3
-# Parent  6abe84479a9e01d0a22d318ac9bf14d2a79a4ca9
+# Parent  8cefd03a84b7e77efb6a021c60d08b8b4053509a
 Bug 1485738: Add column number information to the JitSpew r=mgaudet
 
 Summary: It is currently quite difficult to debug minified scripts.  The JitSpew and profiler used to display only line numbers, so all of the output would be emitted as "script:1".  Column number information is now collected by the gecko profiler as of bug 785922.  The JitSpew should also emit column numbers so that it's easy to line up with the profiler output.
@@ -21,7 +21,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D4677
 diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
 --- a/js/src/jit/BaselineBailouts.cpp
 +++ b/js/src/jit/BaselineBailouts.cpp
-@@ -642,17 +642,19 @@ InitFromBailout(JSContext* cx, size_t fr
+@@ -639,17 +639,19 @@ InitFromBailout(JSContext* cx, size_t fr
      // +---------------+
      // |    StackS     |
      // +---------------+  --- IF NOT LAST INLINE FRAME,
@@ -42,7 +42,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
      // address.
      void* prevFramePtr = builder.calculatePrevFramePtr();
      if (!builder.writePtr(prevFramePtr, "PrevFramePtr"))
-@@ -1040,19 +1042,19 @@ InitFromBailout(JSContext* cx, size_t fr
+@@ -1034,19 +1036,19 @@ InitFromBailout(JSContext* cx, size_t fr
                  // arguments in the slots and not be 4.
                  MOZ_ASSERT(exprStackSlots == expectedDepth);
              }
@@ -64,7 +64,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
  
      // If this was the last inline frame, or we are bailing out to a catch or
      // finally block in this frame, then unpacking is almost done.
-@@ -1550,18 +1552,18 @@ jit::BailoutIonToBaseline(JSContext* cx,
+@@ -1540,18 +1542,18 @@ jit::BailoutIonToBaseline(JSContext* cx,
      //      +---------------+
      //      |  ReturnAddr   |
      //      +---------------+
@@ -85,7 +85,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
          catchingException = excInfo->catchingException();
          propagatingExceptionForDebugMode = excInfo->propagatingIonExceptionForDebugMode();
  
-@@ -1606,18 +1608,18 @@ jit::BailoutIonToBaseline(JSContext* cx,
+@@ -1596,18 +1598,18 @@ jit::BailoutIonToBaseline(JSContext* cx,
  
  #ifdef TRACK_SNAPSHOTS
      snapIter.spewBailingFrom();
@@ -106,7 +106,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
          JitSpew(JitSpew_BaselineBailouts, "  Constructing!");
      else
          JitSpew(JitSpew_BaselineBailouts, "  Not constructing!");
-@@ -1732,59 +1734,59 @@ InvalidateAfterBailout(JSContext* cx, Ha
+@@ -1722,59 +1724,59 @@ InvalidateAfterBailout(JSContext* cx, Ha
  
      JitSpew(JitSpew_BaselineBailouts, "Invalidating due to %s", reason);
      Invalidate(cx, outerScript);
@@ -178,7 +178,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
      if (innerScript->hasIonScript())
          Invalidate(cx, innerScript);
  }
-@@ -1988,19 +1990,19 @@ jit::FinishBailoutToBaseline(BaselineBai
+@@ -1978,19 +1980,19 @@ jit::FinishBailoutToBaseline(BaselineBai
      // If we are catching an exception, we need to unwind scopes.
      // See |SettleOnTryNote|
      if (cx->isExceptionPending() && faultPC) {
@@ -405,7 +405,7 @@ diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp
 diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 --- a/js/src/jit/CodeGenerator.cpp
 +++ b/js/src/jit/CodeGenerator.cpp
-@@ -10207,19 +10207,20 @@ CodeGenerator::generateWasm(wasm::FuncTy
+@@ -10200,19 +10200,20 @@ CodeGenerator::generateWasm(wasm::FuncTy
      MOZ_ASSERT(safepoints_.size() == 0);
      MOZ_ASSERT(!scriptCounts_);
      return true;
@@ -431,7 +431,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
 --- a/js/src/jit/Ion.cpp
 +++ b/js/src/jit/Ion.cpp
-@@ -2027,19 +2027,19 @@ IonCompile(JSContext* cx, JSScript* scri
+@@ -2026,19 +2026,19 @@ IonCompile(JSContext* cx, JSScript* scri
  
          return reason;
      }
@@ -453,7 +453,7 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
          if (!StartOffThreadIonCompile(builder, lock)) {
              JitSpew(JitSpew_IonAbort, "Unable to start off-thread ion compilation.");
              builder->graphSpewer().endFunction();
-@@ -2222,17 +2222,18 @@ Compile(JSContext* cx, HandleScript scri
+@@ -2221,17 +2221,18 @@ Compile(JSContext* cx, HandleScript scri
          return Method_Skipped;
  
      if (script->isDebuggee() || (osrFrame && osrFrame->isDebuggee())) {
@@ -473,7 +473,7 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
      if (optimizationLevel == OptimizationLevel::DontCompile)
          return Method_Skipped;
  
-@@ -2492,18 +2493,19 @@ jit::IonCompileScriptForBaseline(JSConte
+@@ -2491,18 +2492,19 @@ jit::IonCompileScriptForBaseline(JSConte
          // TODO: ASSERT that a ion-script-already-exists checker stub doesn't exist.
          // TODO: Clear all optimized stubs.
          // TODO: Add a ion-script-already-exists checker stub.
@@ -495,22 +495,21 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
          stat = BaselineCanEnterAtBranch(cx, script, frame, pc);
      } else if (frame->isFunctionFrame()) {
          JitSpew(JitSpew_BaselineOSR, "  Compile function from top for later entry!");
-@@ -2596,20 +2598,20 @@ InvalidateActivation(FreeOp* fop, const 
-             const char* type = "Unknown";
-             if (frame.isIonJS())
+@@ -2597,19 +2599,19 @@ InvalidateActivation(FreeOp* fop, const 
                  type = "Optimized";
-             else if (frame.isBaselineJS())
+             } else if (frame.isBaselineJS()) {
                  type = "Baseline";
-             else if (frame.isBailoutJS())
+             } else if (frame.isBailoutJS()) {
                  type = "Bailing";
+             }
+             JSScript* script = frame.maybeForwardedScript();
              JitSpew(JitSpew_IonInvalidate,
 -                    "#%zu %s JS frame @ %p, %s:%u (fun: %p, script: %p, pc %p)",
 +                    "#%zu %s JS frame @ %p, %s:%u:%u (fun: %p, script: %p, pc %p)",
-                     frameno, type, frame.fp(), frame.script()->maybeForwardedFilename(),
--                    frame.script()->lineno(), frame.maybeCallee(), (JSScript*)frame.script(),
--                    frame.returnAddressToFp());
-+                    frame.script()->lineno(), frame.script()->column(), frame.maybeCallee(), 
-+                    (JSScript*)frame.script(), frame.returnAddressToFp());
+                     frameno, type, frame.fp(), script->maybeForwardedFilename(),
+-                    script->lineno(), frame.maybeCallee(), script,
++                    script->lineno(), script->column(), frame.maybeCallee(), script,
+                     frame.returnAddressToFp());
              break;
            }
            case FrameType::BaselineStub:
@@ -518,8 +517,7 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
              break;
            case FrameType::Rectifier:
              JitSpew(JitSpew_IonInvalidate, "#%zu rectifier frame @ %p", frameno, frame.fp());
-             break;
-@@ -2753,18 +2755,19 @@ jit::Invalidate(TypeZone& types, FreeOp*
+@@ -2755,18 +2757,19 @@ jit::Invalidate(TypeZone& types, FreeOp*
      for (const RecompileInfo& info : invalid) {
          if (cancelOffThread)
              CancelOffThreadIonCompile(info.script());
@@ -541,7 +539,7 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
          numInvalidations++;
      }
  
-@@ -2845,17 +2848,18 @@ jit::Invalidate(JSContext* cx, JSScript*
+@@ -2847,17 +2850,18 @@ jit::Invalidate(JSContext* cx, JSScript*
          //      "<filename>:<lineno>"
  
          // Get the script filename, if any, and its length.
@@ -561,7 +559,7 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
      }
  
      // RecompileInfoVector has inline space for at least one element.
-@@ -2881,18 +2885,18 @@ jit::FinishInvalidation(FreeOp* fop, JSS
+@@ -2883,18 +2887,18 @@ jit::FinishInvalidation(FreeOp* fop, JSS
      // true. In this case we have to wait until destroying it.
      if (!ion->invalidated())
          jit::IonScript::Destroy(fop, ion);
@@ -659,7 +657,7 @@ diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
          failedBoundsCheck_ = true;
  
      if (callerBuilder->failedShapeGuard_)
-@@ -1218,18 +1219,18 @@ IonBuilder::initEnvironmentChain(MDefini
+@@ -1210,18 +1211,18 @@ IonBuilder::initEnvironmentChain(MDefini
      // See: |InitFromBailout|
      current->setEnvironmentChain(env);
      return Ok();
@@ -680,7 +678,7 @@ diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
      MCreateArgumentsObject* argsObj =
          MCreateArgumentsObject::New(alloc(), current->environmentChain(), templateObj);
      current->add(argsObj);
-@@ -1430,18 +1431,18 @@ GetOrCreateControlFlowGraph(TempAllocato
+@@ -1422,18 +1423,18 @@ GetOrCreateControlFlowGraph(TempAllocato
          return CFGState::Alloc;
  
      if (script->hasBaselineScript()) {
@@ -701,7 +699,7 @@ diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
      return CFGState::Success;
  }
  
-@@ -4029,18 +4030,18 @@ IonBuilder::makeInliningDecision(JSObjec
+@@ -4012,18 +4013,18 @@ IonBuilder::makeInliningDecision(JSObjec
      // Callee must have been called a few times to have somewhat stable
      // type information, except for definite properties analysis,
      // as the caller has not run yet.
@@ -745,11 +743,11 @@ diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp
          if (outerScript->hasIonScript())
              Invalidate(cx, outerScript);
  
-         // We will redo the potentially effectful lookup in Baseline.
+         // IonBuilder::createScriptedThis does not use InvalidedIdempotentCache
 diff --git a/js/src/jit/JitcodeMap.cpp b/js/src/jit/JitcodeMap.cpp
 --- a/js/src/jit/JitcodeMap.cpp
 +++ b/js/src/jit/JitcodeMap.cpp
-@@ -1531,24 +1531,25 @@ JitcodeIonTable::WriteIonTable(CompactBu
+@@ -1528,24 +1528,25 @@ JitcodeIonTable::WriteIonTable(CompactBu
                                 const NativeToBytecode* end,
                                 uint32_t* tableOffsetOut, uint32_t* numRegionsOut)
  {
@@ -782,7 +780,7 @@ diff --git a/js/src/jit/JitcodeMap.cpp b/js/src/jit/JitcodeMap.cpp
 diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp
 --- a/js/src/jit/shared/CodeGenerator-shared.cpp
 +++ b/js/src/jit/shared/CodeGenerator-shared.cpp
-@@ -277,18 +277,19 @@ CodeGeneratorShared::addNativeToBytecode
+@@ -273,18 +273,19 @@ CodeGeneratorShared::addNativeToBytecode
      return true;
  }
  
@@ -804,7 +802,7 @@ diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/Code
  void
  CodeGeneratorShared::dumpNativeToBytecodeEntry(uint32_t idx)
  {
-@@ -300,27 +301,28 @@ CodeGeneratorShared::dumpNativeToBytecod
+@@ -296,27 +297,28 @@ CodeGeneratorShared::dumpNativeToBytecod
      unsigned nativeDelta = 0;
      unsigned pcDelta = 0;
      if (idx + 1 < nativeToBytecodeList_.length()) {

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433385.patch → frg/work-js/mozilla-release/patches/1486027-63a1.patch


+ 10 - 10
frg/work-js/mozilla-release/patches/mozilla-central-push_434411.patch → frg/work-js/mozilla-release/patches/1486397-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535470874 -7200
 #      Tue Aug 28 17:41:14 2018 +0200
 # Node ID 0add114333b9f0ada167bcfcda9c6167fe9079be
-# Parent  34d0f9bc490ceaf2b3331d1f70f49554f0685222
+# Parent  dab52bd9cf89d8e75bab74be73ce3db087392b5a
 Bug 1486397 - Split entries vector in JSStructuredCloneWriter. r=jandem
 
 diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
@@ -24,7 +24,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
 +          otherEntries(out.context()),
            memory(out.context()),
            transferable(out.context(), tVal),
-           transferableObjects(out.context(), TransferableObjectsSet(cx)),
+           transferableObjects(out.context(), GCHashSet<JSObject*>(cx)),
            cloneDataPolicy(cloneDataPolicy)
      {
          out.setCallbacks(cb, cbClosure, OwnTransferablePolicy::NoTransferables);
@@ -54,7 +54,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
                                    uint32_t,
                                    MovableCellHasher<JSObject*>,
                                    SystemAllocPolicy>;
-@@ -1213,19 +1217,19 @@ JSStructuredCloneWriter::checkStack()
+@@ -1199,19 +1203,19 @@ JSStructuredCloneWriter::checkStack()
      size_t limit = Min(counts.length(), MAX);
      MOZ_ASSERT(objs.length() == counts.length());
      size_t total = 0;
@@ -76,7 +76,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
      }
  #endif
  }
-@@ -1365,17 +1369,17 @@ JSStructuredCloneWriter::startObject(Han
+@@ -1351,17 +1355,17 @@ JSStructuredCloneWriter::startObject(Han
                                    "object graph to serialize");
          return false;
      }
@@ -95,7 +95,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
          return true;
  
      HandleNativeObject nobj = obj.as<NativeObject>();
-@@ -1396,60 +1400,58 @@ TryAppendNativeProperties(JSContext* cx,
+@@ -1382,60 +1386,58 @@ TryAppendNativeProperties(JSContext* cx,
      for (Shape::Range<NoGC> r(shape); !r.empty(); r.popFront()) {
          jsid id = r.front().propidRaw();
  
@@ -163,7 +163,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
      // Push obj and count to the stack.
      if (!objs.append(ObjectValue(*obj)) || !counts.append(count))
          return false;
-@@ -1486,17 +1488,17 @@ JSStructuredCloneWriter::traverseMap(Han
+@@ -1472,17 +1474,17 @@ JSStructuredCloneWriter::traverseMap(Han
          JSAutoRealm ar(context(), unwrapped);
          if (!MapObject::getKeysAndValuesInterleaved(unwrapped, &newEntries))
              return false;
@@ -182,7 +182,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
          return false;
  
      checkStack();
-@@ -1516,17 +1518,17 @@ JSStructuredCloneWriter::traverseSet(Han
+@@ -1502,17 +1504,17 @@ JSStructuredCloneWriter::traverseSet(Han
          JSAutoRealm ar(context(), unwrapped);
          if (!SetObject::keys(context(), unwrapped, &keys))
              return false;
@@ -201,7 +201,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
          return false;
  
      checkStack();
-@@ -1562,17 +1564,17 @@ JSStructuredCloneWriter::traverseSavedFr
+@@ -1548,17 +1550,17 @@ JSStructuredCloneWriter::traverseSavedFr
  
      RootedSavedFrame savedFrame(context(), &unwrapped->as<SavedFrame>());
  
@@ -220,13 +220,13 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
      checkStack();
  
      // Write the SavedFrame tag and the SavedFrame's principals.
-@@ -1941,42 +1943,41 @@ JSStructuredCloneWriter::write(HandleVal
+@@ -1927,42 +1929,41 @@ JSStructuredCloneWriter::write(HandleVal
      RootedValue val(context());
      RootedId id(context());
  
      while (!counts.empty()) {
          obj = &objs.back().toObject();
-         context()->check(obj);
+         AutoRealm ar(context(), obj);
          if (counts.back()) {
              counts.back()--;
 -            key = entries.back();

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433884.patch → frg/work-js/mozilla-release/patches/1486553-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433634.patch → frg/work-js/mozilla-release/patches/1486584-63a1.patch


+ 8 - 8
frg/work-js/mozilla-release/patches/mozilla-central-push_433875.patch → frg/work-js/mozilla-release/patches/1486727-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535545436 -3600
 #      Wed Aug 29 13:23:56 2018 +0100
 # Node ID b7dada718ee0f14154562db052bfab83e9999a17
-# Parent  82dc592c7293290a7b17c4473c01a228e42615cd
+# Parent  69df00717f2c56374e18d47a3d70e06af3ddd856
 Bug 1486727 - Move some inline method defintions out of gc/Zone.h into new Zone-inl.h r=sfink
 
 diff --git a/js/src/gc/Barrier.cpp b/js/src/gc/Barrier.cpp
@@ -346,11 +346,11 @@ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h
  #include "vm/MallocProvider.h"
  #include "vm/Runtime.h"
  
+ struct JSContext;
+ 
  namespace js {
  
- class Debugger;
- class RegExpZone;
-@@ -213,22 +212,18 @@ class Zone : public JS::shadow::Zone,
+@@ -214,22 +213,18 @@ class Zone : public JS::shadow::Zone,
      // Iterate over all cells in the zone. See the definition of ZoneCellIter
      // in gc/GC-inl.h for the possible arguments and documentation.
      template <typename T, typename... Args>
@@ -375,7 +375,7 @@ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h
      void scheduleGC() { MOZ_ASSERT(!RuntimeHeapIsBusy()); gcScheduled_ = true; }
      void unscheduleGC() { gcScheduled_ = false; }
      bool isGCScheduled() { return gcScheduled_; }
-@@ -254,49 +249,40 @@ class Zone : public JS::shadow::Zone,
+@@ -255,49 +250,40 @@ class Zone : public JS::shadow::Zone,
  
      bool isCollectingFromAnyThread() const {
          if (RuntimeHeapIsCollecting())
@@ -429,7 +429,7 @@ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h
      void sweepBreakpoints(js::FreeOp* fop);
      void sweepUniqueIds();
      void sweepWeakMaps();
-@@ -438,31 +424,21 @@ class Zone : public JS::shadow::Zone,
+@@ -439,31 +425,21 @@ class Zone : public JS::shadow::Zone,
      void updateMemoryCounter(js::gc::MemoryCounter& counter, size_t nbytes) {
          JSRuntime* rt = runtimeFromAnyThread();
  
@@ -465,7 +465,7 @@ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h
  
      JS::WeakCache<TypeDescrObjectSet>& typeDescrObjects() { return typeDescrObjects_.ref(); }
  
-@@ -479,30 +455,19 @@ class Zone : public JS::shadow::Zone,
+@@ -480,30 +456,19 @@ class Zone : public JS::shadow::Zone,
      }
      size_t GCMaxMallocBytes() const { return gcMallocCounter.maxBytes(); }
      size_t GCMallocBytes() const { return gcMallocCounter.bytes(); }
@@ -499,7 +499,7 @@ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h
      bool hasKeptAtoms() const {
          return keepAtomsCount;
      }
-@@ -601,121 +566,44 @@ class Zone : public JS::shadow::Zone,
+@@ -602,121 +567,44 @@ class Zone : public JS::shadow::Zone,
      js::ZoneData<void*> data;
  
      js::ZoneData<bool> isSystem;

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433778.patch → frg/work-js/mozilla-release/patches/1486731-1-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_433780.patch → frg/work-js/mozilla-release/patches/1486731-2-63a1.patch


+ 8 - 176
frg/work-js/mozilla-release/patches/mozilla-central-push_434127.patch → frg/work-js/mozilla-release/patches/1486782-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535656221 -3600
 #      Thu Aug 30 20:10:21 2018 +0100
 # Node ID fcae304349d841a9bb2850c59dcc70680b857aa7
-# Parent  7d07908ee08acfa5333806b907bce7fb20c59dc1
+# Parent  3581d138d33cd4b2af27a6e2db430597ff82d467
 Bug 1486782 - Remove unnecessary includes of gc/Zone.h r=sfink
 
 diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp
@@ -27,92 +27,6 @@ diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp
  #include "util/Windows.h"
  #include "vm/JSContext.h"
  #include "vm/JSFunction.h"
-diff --git a/js/src/frontend/BinToken.cpp b/js/src/frontend/BinToken.cpp
---- a/js/src/frontend/BinToken.cpp
-+++ b/js/src/frontend/BinToken.cpp
-@@ -7,18 +7,18 @@
- #include "frontend/BinToken.h"
- 
- #include "mozilla/Maybe.h"
- 
- #include <sys/types.h>
- 
- #include "frontend/BinSourceRuntimeSupport.h"
- #include "frontend/TokenStream.h"
--#include "gc/Zone.h"
- #include "js/Result.h"
-+#include "vm/Runtime.h"
- 
- namespace js {
- namespace frontend {
- 
- const BinaryASTSupport::CharSlice BINKIND_DESCRIPTIONS[] = {
- #define WITH_VARIANT(_, SPEC_NAME) BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
-     FOR_EACH_BIN_KIND(WITH_VARIANT)
- #undef WITH_VARIANT
-diff --git a/js/src/frontend/BinTokenReaderBase.cpp b/js/src/frontend/BinTokenReaderBase.cpp
---- a/js/src/frontend/BinTokenReaderBase.cpp
-+++ b/js/src/frontend/BinTokenReaderBase.cpp
-@@ -2,17 +2,16 @@
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "frontend/BinTokenReaderBase.h"
- 
- #include "frontend/BinSource-macros.h"
--#include "gc/Zone.h"
- #include "js/Result.h"
- 
- namespace js {
- namespace frontend {
- 
- template<typename T> using ErrorResult = mozilla::GenericErrorResult<T>;
- 
- // We use signalling NaN (which doesn't exist in the JS syntax)
-diff --git a/js/src/frontend/BinTokenReaderMultipart.cpp b/js/src/frontend/BinTokenReaderMultipart.cpp
---- a/js/src/frontend/BinTokenReaderMultipart.cpp
-+++ b/js/src/frontend/BinTokenReaderMultipart.cpp
-@@ -11,17 +11,16 @@
- #include "mozilla/EndianUtils.h"
- #include "mozilla/Maybe.h"
- 
- #include <utility>
- 
- #include "frontend/BinSource-macros.h"
- #include "frontend/BinSourceRuntimeSupport.h"
- 
--#include "gc/Zone.h"
- #include "js/Result.h"
- 
- namespace js {
- namespace frontend {
- 
- // The magic header, at the start of every binjs file.
- const char MAGIC_HEADER[] = "BINJS";
- // The latest format version understood by this tokenizer.
-diff --git a/js/src/frontend/BinTokenReaderTester.cpp b/js/src/frontend/BinTokenReaderTester.cpp
---- a/js/src/frontend/BinTokenReaderTester.cpp
-+++ b/js/src/frontend/BinTokenReaderTester.cpp
-@@ -8,17 +8,16 @@
- #include "frontend/BinTokenReaderTester.h"
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/Casting.h"
- #include "mozilla/EndianUtils.h"
- #include "mozilla/PodOperations.h"
- 
- #include "frontend/BinSource-macros.h"
--#include "gc/Zone.h"
- #include "js/Result.h"
- 
- namespace js {
- namespace frontend {
- 
- using BinFields = BinTokenReaderTester::BinFields;
- using AutoList = BinTokenReaderTester::AutoList;
- using AutoTaggedTuple = BinTokenReaderTester::AutoTaggedTuple;
 diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h
 --- a/js/src/frontend/TokenStream.h
 +++ b/js/src/frontend/TokenStream.h
@@ -195,48 +109,6 @@ diff --git a/js/src/gc/WeakMap-inl.h b/js/src/gc/WeakMap-inl.h
  static T extractUnbarriered(const WriteBarrieredBase<T>& v)
  {
      return v.get();
-diff --git a/js/src/jsapi-tests/testBinASTReader.cpp b/js/src/jsapi-tests/testBinASTReader.cpp
---- a/js/src/jsapi-tests/testBinASTReader.cpp
-+++ b/js/src/jsapi-tests/testBinASTReader.cpp
-@@ -22,17 +22,16 @@
- #include "mozilla/Maybe.h"
- 
- #include "jsapi.h"
- 
- #include "frontend/BinSource.h"
- #include "frontend/FullParseHandler.h"
- #include "frontend/ParseContext.h"
- #include "frontend/Parser.h"
--#include "gc/Zone.h"
- #include "js/Vector.h"
- 
- #include "jsapi-tests/tests.h"
- 
- #include "vm/Interpreter.h"
- 
- using UsedNameTracker = js::frontend::UsedNameTracker;
- using namespace JS;
-diff --git a/js/src/jsapi-tests/testBinTokenReaderTester.cpp b/js/src/jsapi-tests/testBinTokenReaderTester.cpp
---- a/js/src/jsapi-tests/testBinTokenReaderTester.cpp
-+++ b/js/src/jsapi-tests/testBinTokenReaderTester.cpp
-@@ -13,17 +13,16 @@
- #elif defined(XP_UNIX)
- #include <fcntl.h>
- #include <unistd.h>
- #endif // defined (XP_WIN) || defined (XP_UNIX)
- 
- #include "mozilla/Maybe.h"
- 
- #include "frontend/BinTokenReaderTester.h"
--#include "gc/Zone.h"
- 
- #include "js/Vector.h"
- 
- #include "jsapi-tests/tests.h"
- 
- using mozilla::Maybe;
- 
- using Tokenizer = js::frontend::BinTokenReaderTester;
 diff --git a/js/src/jsapi-tests/testGCUniqueId.cpp b/js/src/jsapi-tests/testGCUniqueId.cpp
 --- a/js/src/jsapi-tests/testGCUniqueId.cpp
 +++ b/js/src/jsapi-tests/testGCUniqueId.cpp
@@ -302,7 +174,7 @@ diff --git a/js/src/jsapi-tests/testIsInsideNursery.cpp b/js/src/jsapi-tests/tes
 diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
 --- a/js/src/jsfriendapi.cpp
 +++ b/js/src/jsfriendapi.cpp
-@@ -214,17 +214,17 @@ js::GetScriptRealm(JSScript* script)
+@@ -219,17 +219,17 @@ js::GetScriptRealm(JSScript* script)
  
  JS_FRIEND_API(bool)
  JS_ScriptHasMutedErrors(JSScript* script)
@@ -321,46 +193,6 @@ diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
  JS_TraceShapeCycleCollectorChildren(JS::CallbackTracer* trc, JS::GCCellPtr shape)
  {
      MOZ_ASSERT(shape.is<Shape>());
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -66,17 +66,16 @@
- #include "builtin/ModuleObject.h"
- #include "builtin/RegExp.h"
- #include "builtin/TestingFunctions.h"
- #if defined(JS_BUILD_BINAST)
- # include "frontend/BinSource.h"
- #endif // defined(JS_BUILD_BINAST)
- #include "frontend/Parser.h"
- #include "gc/PublicIterators.h"
--#include "gc/Zone.h"
- #include "jit/arm/Simulator-arm.h"
- #include "jit/InlinableNatives.h"
- #include "jit/Ion.h"
- #include "jit/JitcodeMap.h"
- #include "jit/JitRealm.h"
- #include "jit/shared/CodeGenerator-shared.h"
- #include "js/AutoByteString.h"
- #include "js/CompilationAndEvaluation.h"
-@@ -4305,17 +4304,17 @@ EnsureModuleLoaderScriptObjectMap(JSCont
- {
-     auto priv = EnsureShellCompartmentPrivate(cx);
-     if (!priv)
-         return nullptr;
- 
-     if (priv->moduleLoaderScriptObjectMap)
-         return priv->moduleLoaderScriptObjectMap.get();
- 
--    Zone* zone = cx->zone();
-+    JS::Zone* zone = cx->zone();
-     auto* map = cx->new_<ScriptObjectMap>(zone);
-     if (!map)
-         return nullptr;
- 
-     priv->moduleLoaderScriptObjectMap.reset(map);
-     return map;
- }
- 
 diff --git a/js/src/vm/Compartment.cpp b/js/src/vm/Compartment.cpp
 --- a/js/src/vm/Compartment.cpp
 +++ b/js/src/vm/Compartment.cpp
@@ -386,13 +218,13 @@ diff --git a/js/src/vm/Compartment.cpp b/js/src/vm/Compartment.cpp
 diff --git a/js/src/vm/Compartment.h b/js/src/vm/Compartment.h
 --- a/js/src/vm/Compartment.h
 +++ b/js/src/vm/Compartment.h
-@@ -12,23 +12,24 @@
- #include "mozilla/MemoryReporting.h"
+@@ -13,23 +13,24 @@
  #include "mozilla/Tuple.h"
  #include "mozilla/Variant.h"
  
  #include <stddef.h>
  
+ #include "builtin/Array.h"
  #include "gc/Barrier.h"
  #include "gc/NurseryAwareHashMap.h"
 -#include "gc/Zone.h"
@@ -413,7 +245,7 @@ diff --git a/js/src/vm/Compartment.h b/js/src/vm/Compartment.h
      enum DebuggerObjectKind : uint8_t { DebuggerSource, DebuggerEnvironment, DebuggerObject,
                                          DebuggerWasmScript, DebuggerWasmSource };
      using DebuggerAndObject = mozilla::Tuple<NativeObject*, JSObject*, DebuggerObjectKind>;
-@@ -441,17 +442,17 @@ class JS::Compartment
+@@ -442,17 +443,17 @@ class JS::Compartment
  
      MOZ_MUST_USE inline bool wrap(JSContext* cx, JS::MutableHandleValue vp);
  
@@ -485,24 +317,24 @@ diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
 diff --git a/js/src/vm/Realm.h b/js/src/vm/Realm.h
 --- a/js/src/vm/Realm.h
 +++ b/js/src/vm/Realm.h
-@@ -15,17 +15,16 @@
+@@ -14,17 +14,16 @@
+ #include "mozilla/TimeStamp.h"
  #include "mozilla/Tuple.h"
  #include "mozilla/Variant.h"
  #include "mozilla/XorShift128PlusRNG.h"
  
  #include <stddef.h>
  
- #include "builtin/Array.h"
  #include "gc/Barrier.h"
 -#include "gc/Zone.h"
  #include "js/UniquePtr.h"
  #include "vm/ArrayBufferObject.h"
  #include "vm/Compartment.h"
+ #include "vm/GlobalObject.h"
  #include "vm/ReceiverGuard.h"
  #include "vm/RegExpShared.h"
  #include "vm/SavedStacks.h"
  #include "vm/Time.h"
- #include "wasm/WasmRealm.h"
 diff --git a/js/src/vm/RegExpConstants.h b/js/src/vm/RegExpConstants.h
 new file mode 100644
 --- /dev/null

+ 42 - 41
frg/work-js/mozilla-release/patches/mozilla-central-push_433761.patch → frg/work-js/mozilla-release/patches/1486829-63a1.patch

@@ -3,7 +3,7 @@
 # Date 1535537230 0
 #      Wed Aug 29 10:07:10 2018 +0000
 # Node ID eff3d90694630f95e35b09ae343fda4ad07e6870
-# Parent  d325fc4bbfc2cedcfa9e9630d3783db221151c11
+# Parent  d86dc67f8c3f410849c9accc43b53e10fc0bc9b9
 Bug 1486829: Make a proper enum class out of jit::FrameType; r=tcampbell
 
 Differential Revision: https://phabricator.services.mozilla.com/D4462
@@ -223,7 +223,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
          //        + ((RectifierFrameLayout*) X)->prevFrameLocalSize()
          //        - BaselineStubFrameLayout::reverseOffsetOfSavedFramePtr()
          size_t extraOffset = RectifierFrameLayout::Size() + priorFrame->prevFrameLocalSize() +
-@@ -1235,17 +1235,17 @@ InitFromBailout(JSContext* cx, size_t fr
+@@ -1225,17 +1225,17 @@ InitFromBailout(JSContext* cx, size_t fr
              cx->runtime()->geckoProfiler().markEvent(buf.get());
          }
  
@@ -242,7 +242,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
      // The icEntry in question MUST have an inlinable fallback stub.
      ICEntry& icEntry = baselineScript->icEntryFromPCOffset(pcOff);
      MOZ_ASSERT(IsInlinableFallback(icEntry.firstStub()->getChainFallback()));
-@@ -1346,17 +1346,17 @@ InitFromBailout(JSContext* cx, size_t fr
+@@ -1336,17 +1336,17 @@ InitFromBailout(JSContext* cx, size_t fr
  
      // In case these arguments need to be copied on the stack again for a rectifier frame,
      // save the framePushed values here for later use.
@@ -261,7 +261,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
  
      // Push callee token (must be a JS Function)
      JitSpew(JitSpew_BaselineBailouts, "      Callee = %016" PRIx64, callee.asRawBits());
-@@ -1459,17 +1459,17 @@ InitFromBailout(JSContext* cx, size_t fr
+@@ -1449,17 +1449,17 @@ InitFromBailout(JSContext* cx, size_t fr
          builder.pointerAtStackOffset<uint8_t>(builder.framePushed() - endOfBaselineStubArgs);
      JitSpew(JitSpew_BaselineBailouts, "      MemCpy from %p", stubArgsEnd.get());
      memcpy(builder.pointerAtStackOffset<uint8_t>(0).get(), stubArgsEnd.get(),
@@ -280,7 +280,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
  
      // Push calleeToken again.
      if (!builder.writePtr(CalleeToToken(calleeFun, pushedNewTarget), "CalleeToken"))
-@@ -1521,20 +1521,20 @@ jit::BailoutIonToBaseline(JSContext* cx,
+@@ -1511,20 +1511,20 @@ jit::BailoutIonToBaseline(JSContext* cx,
      //      IonJS - Ion calling into Ion.
      //      BaselineStub - Baseline calling into Ion.
      //      Entry / WasmToJSJit - Interpreter or other (wasm) calling into Ion.
@@ -308,7 +308,7 @@ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
 diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp
 --- a/js/src/jit/BaselineCompiler.cpp
 +++ b/js/src/jit/BaselineCompiler.cpp
-@@ -4758,17 +4758,17 @@ BaselineCompiler::emit_JSOP_RESUME()
+@@ -4743,17 +4743,17 @@ BaselineCompiler::emit_JSOP_RESUME()
      // Push |undefined| for |this|.
      masm.pushValue(UndefinedValue());
  
@@ -327,7 +327,7 @@ diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp
      regs.add(callee);
  
      // Load the return value.
-@@ -4889,17 +4889,17 @@ BaselineCompiler::emit_JSOP_RESUME()
+@@ -4874,17 +4874,17 @@ BaselineCompiler::emit_JSOP_RESUME()
          pushArg(retVal);
          pushArg(genObj);
          pushArg(scratch2);
@@ -488,7 +488,7 @@ diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp
 diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 --- a/js/src/jit/CodeGenerator.cpp
 +++ b/js/src/jit/CodeGenerator.cpp
-@@ -4631,17 +4631,17 @@ CodeGenerator::visitCallGeneric(LCallGen
+@@ -4623,17 +4623,17 @@ CodeGenerator::visitCallGeneric(LCallGen
          masm.loadJitCodeRaw(calleereg, objreg);
      else
          masm.loadJitCodeNoArgCheck(calleereg, objreg);
@@ -507,7 +507,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
      // Check whether the provided arguments satisfy target argc.
      // We cannot have lowered to LCallGeneric with a known target. Assert that we didn't
      // add any undefineds in IonBuilder. NB: MCall::numStackArgs includes |this|.
-@@ -4753,17 +4753,17 @@ CodeGenerator::visitCallKnown(LCallKnown
+@@ -4745,17 +4745,17 @@ CodeGenerator::visitCallKnown(LCallKnown
          masm.loadJitCodeRaw(calleereg, objreg);
      else
          masm.loadJitCodeNoArgCheck(calleereg, objreg);
@@ -526,7 +526,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
      // Finally call the function in objreg.
      uint32_t callOffset = masm.callJit(objreg);
      markSafepointAt(callOffset, call);
-@@ -5069,17 +5069,17 @@ CodeGenerator::emitApplyGeneric(T* apply
+@@ -5061,17 +5061,17 @@ CodeGenerator::emitApplyGeneric(T* apply
  
          // Knowing that calleereg is a non-native function, load jitcode.
          masm.loadJitCodeRaw(calleereg, objreg);
@@ -548,7 +548,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
 --- a/js/src/jit/Ion.cpp
 +++ b/js/src/jit/Ion.cpp
-@@ -2572,59 +2572,59 @@ InvalidateActivation(FreeOp* fop, const 
+@@ -2571,30 +2571,30 @@ InvalidateActivation(FreeOp* fop, const 
          activations->asJit()->setCheckRegs(false);
  #endif
  
@@ -581,16 +581,17 @@ diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
            {
              MOZ_ASSERT(frame.isScripted());
              const char* type = "Unknown";
-             if (frame.isIonJS())
+             if (frame.isIonJS()) {
                  type = "Optimized";
-             else if (frame.isBaselineJS())
+             } else if (frame.isBaselineJS()) {
                  type = "Baseline";
-             else if (frame.isBailoutJS())
-                 type = "Bailing";
+             } else if (frame.isBailoutJS()) {
+@@ -2603,29 +2603,29 @@ InvalidateActivation(FreeOp* fop, const 
+             JSScript* script = frame.maybeForwardedScript();
              JitSpew(JitSpew_IonInvalidate,
                      "#%zu %s JS frame @ %p, %s:%u (fun: %p, script: %p, pc %p)",
-                     frameno, type, frame.fp(), frame.script()->maybeForwardedFilename(),
-                     frame.script()->lineno(), frame.maybeCallee(), (JSScript*)frame.script(),
+                     frameno, type, frame.fp(), script->maybeForwardedFilename(),
+                     script->lineno(), frame.maybeCallee(), script,
                      frame.returnAddressToFp());
              break;
            }
@@ -819,7 +820,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
  JSJitFrameIter::isFunctionFrame() const
  {
      return CalleeTokenIsFunction(calleeToken());
-@@ -341,69 +341,69 @@ JSJitFrameIter::dumpBaseline() const
+@@ -351,69 +351,69 @@ JSJitFrameIter::dumpBaseline() const
  #endif
      }
  }
@@ -900,7 +901,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
      if (!CurrentThreadCanAccessRuntime(rt))
          return true;
  
-@@ -433,17 +433,17 @@ JSJitFrameIter::verifyReturnAddressUsing
+@@ -443,17 +443,17 @@ JSJitFrameIter::verifyReturnAddressUsing
  
      JitSpew(JitSpew_Profiling, "Found bytecode location of depth %d:", depth);
      for (size_t i = 0; i < location.length(); i++) {
@@ -919,7 +920,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
  
              JitSpew(JitSpew_Profiling,
                      "Match %d: ION %s:%u(%zu) vs N2B %s:%u(%zu)",
-@@ -466,31 +466,31 @@ JSJitFrameIter::verifyReturnAddressUsing
+@@ -476,31 +476,31 @@ JSJitFrameIter::verifyReturnAddressUsing
  }
  #endif // DEBUG
  
@@ -953,7 +954,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
      // Get the fp from the current profilingActivation
      fp_ = (uint8_t*) act->lastProfilingFrame();
  
-@@ -516,17 +516,17 @@ JSJitProfilingFrameIterator::JSJitProfil
+@@ -526,17 +526,17 @@ JSJitProfilingFrameIterator::JSJitProfil
          if (tryInitWithTable(table, lastCallSite, /* forLastCallSite = */ true))
              return;
      }
@@ -972,7 +973,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
  GetPreviousRawFrame(CommonFrameLayout* frame)
  {
      size_t prevSize = frame->prevFrameLocalSize() + frame->headerSize();
-@@ -540,24 +540,24 @@ JSJitProfilingFrameIterator::JSJitProfil
+@@ -550,24 +550,24 @@ JSJitProfilingFrameIterator::JSJitProfil
  
  bool
  JSJitProfilingFrameIterator::tryInitWithPC(void* pc)
@@ -999,7 +1000,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
  }
  
  bool
-@@ -572,62 +572,62 @@ JSJitProfilingFrameIterator::tryInitWith
+@@ -582,62 +582,62 @@ JSJitProfilingFrameIterator::tryInitWith
          return false;
  
      JSScript* callee = frameScript();
@@ -1067,7 +1068,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
      if (BaselineDebugModeOSRInfo* info = bl->getDebugModeOSRInfo()) {
          returnAddressToFp_ = info->resumeAddr;
          return;
-@@ -652,28 +652,28 @@ JSJitProfilingFrameIterator::operator++(
+@@ -662,28 +662,28 @@ JSJitProfilingFrameIterator::operator++(
  
  void
  JSJitProfilingFrameIterator::moveToWasmFrame(CommonFrameLayout* frame)
@@ -1098,7 +1099,7 @@ diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp
      /*
       * fp_ points to a Baseline or Ion frame.  The possible call-stacks
       * patterns occurring between this frame and a previous Ion or Baseline
-@@ -706,92 +706,92 @@ JSJitProfilingFrameIterator::moveToNextF
+@@ -716,92 +716,92 @@ JSJitProfilingFrameIterator::moveToNextF
       *      ^--- Ion
       *      |
       *      ^--- Baseline
@@ -1368,7 +1369,7 @@ diff --git a/js/src/jit/JitFrames-inl.h b/js/src/jit/JitFrames-inl.h
 diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
 --- a/js/src/jit/JitFrames.cpp
 +++ b/js/src/jit/JitFrames.cpp
-@@ -860,17 +860,17 @@ TraceThisAndArguments(JSTracer* trc, con
+@@ -873,17 +873,17 @@ TraceThisAndArguments(JSTracer* trc, con
  
      if (!CalleeTokenIsFunction(layout->calleeToken()))
          return;
@@ -1387,7 +1388,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
  
      size_t newTargetOffset = Max(nargs, fun->nargs());
  
-@@ -1050,29 +1050,29 @@ UpdateIonJSFrameForMinorGC(JSRuntime* rt
+@@ -1063,29 +1063,29 @@ UpdateIonJSFrameForMinorGC(JSRuntime* rt
  }
  
  static void
@@ -1419,7 +1420,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
  uint8_t*
  alignDoubleSpillWithOffset(uint8_t* pointer, int32_t offset)
  {
-@@ -1292,43 +1292,43 @@ TraceJitActivation(JSTracer* trc, JitAct
+@@ -1305,43 +1305,43 @@ TraceJitActivation(JSTracer* trc, JitAct
  
      activation->traceRematerializedFrames(trc);
      activation->traceIonRecovery(trc);
@@ -1472,7 +1473,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
          } else {
              MOZ_ASSERT(frames.isWasm());
              frames.asWasm().instance()->trace(trc);
-@@ -1345,17 +1345,17 @@ TraceJitActivations(JSContext* cx, JSTra
+@@ -1358,17 +1358,17 @@ TraceJitActivations(JSContext* cx, JSTra
  
  void
  UpdateJitActivationsForMinorGC(JSRuntime* rt)
@@ -1491,7 +1492,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
  void
  GetPcScript(JSContext* cx, JSScript** scriptRes, jsbytecode** pcRes)
  {
-@@ -2436,17 +2436,17 @@ AssertJitStackInvariants(JSContext* cx)
+@@ -2449,17 +2449,17 @@ AssertJitStackInvariants(JSContext* cx)
              bool isScriptedCallee = false;
              for (; !frames.done(); ++frames) {
                  size_t calleeFp = reinterpret_cast<size_t>(frames.fp());
@@ -1510,7 +1511,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
                          + sizeof(void*) /* frame pointer */
  #endif
                          + sizeof(Value) * (frames.callee()->nargs() +
-@@ -2477,22 +2477,22 @@ AssertJitStackInvariants(JSContext* cx)
+@@ -2490,22 +2490,22 @@ AssertJitStackInvariants(JSContext* cx)
                      if (isScriptedCallee) {
                          MOZ_RELEASE_ASSERT(prevFrameSize % JitStackAlignment == 0,
                            "The ion frame should keep the alignment");
@@ -1538,7 +1539,7 @@ diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
 diff --git a/js/src/jit/JitFrames.h b/js/src/jit/JitFrames.h
 --- a/js/src/jit/JitFrames.h
 +++ b/js/src/jit/JitFrames.h
-@@ -298,27 +298,28 @@ EncodeFrameHeaderSize(size_t headerSize)
+@@ -300,27 +300,28 @@ EncodeFrameHeaderSize(size_t headerSize)
      uint32_t headerSizeWords = headerSize / sizeof(uintptr_t);
      MOZ_ASSERT(headerSizeWords <= FRAME_HEADER_SIZE_MASK);
      return headerSizeWords;
@@ -1570,7 +1571,7 @@ diff --git a/js/src/jit/JitFrames.h b/js/src/jit/JitFrames.h
      }
  
      MOZ_ASSERT(frame.isScripted());
-@@ -353,17 +354,17 @@ class CommonFrameLayout
+@@ -355,17 +356,17 @@ class CommonFrameLayout
      static size_t offsetOfReturnAddress() {
          return offsetof(CommonFrameLayout, returnAddress_);
      }
@@ -1589,7 +1590,7 @@ diff --git a/js/src/jit/JitFrames.h b/js/src/jit/JitFrames.h
          return sizeof(uintptr_t) *
              ((descriptor_ >> FRAME_HEADER_SIZE_SHIFT) & FRAME_HEADER_SIZE_MASK);
      }
-@@ -894,17 +895,17 @@ class ICStub;
+@@ -896,17 +897,17 @@ class ICStub;
  
  class JitStubFrameLayout : public CommonFrameLayout
  {
@@ -1608,7 +1609,7 @@ diff --git a/js/src/jit/JitFrames.h b/js/src/jit/JitFrames.h
  
    public:
      static size_t Size() {
-@@ -923,17 +924,17 @@ class JitStubFrameLayout : public Common
+@@ -925,17 +926,17 @@ class JitStubFrameLayout : public Common
  
  class BaselineStubFrameLayout : public JitStubFrameLayout
  {
@@ -1671,7 +1672,7 @@ diff --git a/js/src/jit/MacroAssembler-inl.h b/js/src/jit/MacroAssembler-inl.h
 diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
 --- a/js/src/jit/MacroAssembler.cpp
 +++ b/js/src/jit/MacroAssembler.cpp
-@@ -1881,17 +1881,17 @@ MacroAssembler::generateBailoutTail(Regi
+@@ -1947,17 +1947,17 @@ MacroAssembler::generateBailoutTail(Regi
              store32(temp, Address(getStackPointer(), 0));
              jump(&copyLoop);
              bind(&endOfCopy);
@@ -1690,7 +1691,7 @@ diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
  
          // If monitorStub is non-null, handle resumeAddr appropriately.
          Label noMonitor;
-@@ -1979,20 +1979,20 @@ MacroAssembler::generateBailoutTail(Regi
+@@ -2045,20 +2045,20 @@ MacroAssembler::generateBailoutTail(Regi
  
  void
  MacroAssembler::assertRectifierFrameParentType(Register frameType)
@@ -3013,7 +3014,7 @@ diff --git a/js/src/jit/shared/BaselineCompiler-shared.cpp b/js/src/jit/shared/B
 diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp
 --- a/js/src/jit/shared/CodeGenerator-shared.cpp
 +++ b/js/src/jit/shared/CodeGenerator-shared.cpp
-@@ -1374,20 +1374,20 @@ CodeGeneratorShared::callVM(const VMFunc
+@@ -1370,20 +1370,20 @@ CodeGeneratorShared::callVM(const VMFunc
          StoreAllLiveRegs(masm, ins->safepoint()->liveRegs());
  #endif
  
@@ -3634,7 +3635,7 @@ diff --git a/js/src/jit/x86/Trampoline-x86.cpp b/js/src/jit/x86/Trampoline-x86.c
 diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
 --- a/js/src/vm/Debugger.cpp
 +++ b/js/src/vm/Debugger.cpp
-@@ -2620,20 +2620,20 @@ UpdateExecutionObservabilityOfScriptsInZ
+@@ -2618,20 +2618,20 @@ UpdateExecutionObservabilityOfScriptsInZ
      // get discarded. They will be recompiled.
      for (JitActivationIterator actIter(cx); !actIter.done(); ++actIter) {
          if (actIter->compartment()->zone() != zone)
@@ -3660,7 +3661,7 @@ diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
 diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp
 --- a/js/src/vm/Stack.cpp
 +++ b/js/src/vm/Stack.cpp
-@@ -565,17 +565,17 @@ JitFrameIter::done() const
+@@ -561,17 +561,17 @@ JitFrameIter::done() const
      MOZ_CRASH("unhandled case");
  }
  
@@ -3679,7 +3680,7 @@ diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp
          //
          // [--------------------]
          // [WASM FUNC           ]
-@@ -1908,17 +1908,18 @@ JS::ProfilingFrameIterator::operator++()
+@@ -1904,17 +1904,18 @@ JS::ProfilingFrameIterator::operator++()
          ++jsJitIter();
      settle();
  }

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_434011.patch → frg/work-js/mozilla-release/patches/1487023-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_434119.patch → frg/work-js/mozilla-release/patches/1487384-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_434307.patch → frg/work-js/mozilla-release/patches/1487483-63a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_434468.patch → frg/work-js/mozilla-release/patches/1487662-63a1.patch


+ 32 - 0
frg/work-js/mozilla-release/patches/1489601-64a1.patch

@@ -0,0 +1,32 @@
+# HG changeset patch
+# User Nathan Froyd <froydnj@mozilla.com>
+# Date 1536347135 14400
+# Node ID cef9a1ef6b543644623200695b072f01d1d0aff4
+# Parent  7001036f7af1841bd0e42fbc5105c4d3f6cd0214
+Bug 1489601 - fix thinko in AtomicOperations-arm64-msvc.h; r=lth
+
+diff --git a/js/src/jit/arm64/AtomicOperations-arm64-msvc.h b/js/src/jit/arm64/AtomicOperations-arm64-msvc.h
+--- a/js/src/jit/arm64/AtomicOperations-arm64-msvc.h
++++ b/js/src/jit/arm64/AtomicOperations-arm64-msvc.h
+@@ -56,17 +56,19 @@ js::jit::AtomicOperations::isLockfree8()
+ 
+     return true;
+ }
+ 
+ inline void
+ js::jit::AtomicOperations::fenceSeqCst()
+ {
+     _ReadWriteBarrier();
+-    MemoryBarrier();
++    // MemoryBarrier is defined in winnt.h, which we don't want to include here.
++    // This expression is the expansion of MemoryBarrier.
++    __dmb(_ARM64_BARRIER_SY);
+ }
+ 
+ template<typename T>
+ inline T
+ js::jit::AtomicOperations::loadSeqCst(T* addr)
+ {
+     MOZ_ASSERT(tier1Constraints(addr));
+     _ReadWriteBarrier();
+

+ 6 - 6
frg/work-js/mozilla-release/patches/1489698-2-65a1.patch

@@ -3,7 +3,7 @@
 # Date 1536360464 14400
 #      Fri Sep 07 18:47:44 2018 -0400
 # Node ID 6a27ee7d892bbc85ce8b2223724929ce783c5a76
-# Parent  8bb0d578b0035b20c14a9fc411898e3f3576bca3
+# Parent  482511a7af70929f2b1bde5b844480c7c6a2f167
 Bug 1489698 - Move js/src/moz.build defines to own file. r=froydnj
 
 MozReview-Commit-ID: ImcZFI3YlVo
@@ -34,7 +34,7 @@ diff --git a/js/src/js-config.mozbuild b/js/src/js-config.mozbuild
 new file mode 100644
 --- /dev/null
 +++ b/js/src/js-config.mozbuild
-@@ -0,0 +1,38 @@
+@@ -0,0 +1,37 @@
 +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 +# vim: set filetype=python:
 +# This Source Code Form is subject to the terms of the Mozilla Public
@@ -48,8 +48,7 @@ new file mode 100644
 +    DEFINES['ENABLE_WASM_SATURATING_TRUNC_OPS'] = True
 +    DEFINES['ENABLE_WASM_THREAD_OPS'] = True
 +    DEFINES['ENABLE_WASM_GC'] = True
-+#   Later
-+#    DEFINES['WASM_PRIVATE_REFTYPES'] = True
++    DEFINES['WASM_PRIVATE_REFTYPES'] = True
 +
 +# Some huge-mapping optimization instead of bounds checks on supported
 +# platforms.
@@ -93,7 +92,7 @@ diff --git a/js/src/moz.build b/js/src/moz.build
  component_stl    = ('Core', 'JavaScript: Standard Library')
  component_wasm   = ('Core', 'Javascript: Web Assembly')
  
-@@ -708,42 +710,16 @@ ReservedWordsGenerated.inputs += [
+@@ -694,43 +696,16 @@ ReservedWordsGenerated.inputs += [
  ]
  
  DIRS += [
@@ -108,6 +107,7 @@ diff --git a/js/src/moz.build b/js/src/moz.build
 -    DEFINES['ENABLE_WASM_SATURATING_TRUNC_OPS'] = True
 -    DEFINES['ENABLE_WASM_THREAD_OPS'] = True
 -    DEFINES['ENABLE_WASM_GC'] = True
+-    DEFINES['WASM_PRIVATE_REFTYPES'] = True
 -
 -# Some huge-mapping optimization instead of bounds checks on supported
 -# platforms.
@@ -136,7 +136,7 @@ diff --git a/js/src/moz.build b/js/src/moz.build
      # C4661 ("no suitable definition provided for explicit template
      # instantiation request") is emitted for all Parser methods that
      # have a Parser<FullParseHandler> definition but no
-@@ -799,19 +775,16 @@ selfhosted.inputs = [
+@@ -786,19 +761,16 @@ selfhosted.inputs = [
      'builtin/TypedObject.js',
      'builtin/WeakMap.js',
      'builtin/WeakSet.js'

+ 5 - 4
frg/work-js/mozilla-release/patches/1489698-4-65a1.patch

@@ -3,7 +3,7 @@
 # Date 1536363006 14400
 #      Fri Sep 07 19:30:06 2018 -0400
 # Node ID b883684d4ee6b70dcdc76a272c353ecc93ea292d
-# Parent  45198f8e22f996e383091f2dc443573b2515b2ab
+# Parent  76bccbf00420d27578b86b10f4c7d6bb36db17c5
 Bug 1489698 - Use js-*.mozbuild in js/src subdirectories. r=froydnj
 
 MozReview-Commit-ID: zrKnXYGQ5X
@@ -106,7 +106,7 @@ diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build
      'testArrayBufferView.cpp',
      'testAtomicOperations.cpp',
      'testBoundFunction.cpp',
-@@ -148,17 +150,10 @@ USE_LIBS += [
+@@ -149,17 +151,10 @@ USE_LIBS += [
      'static:js',
  ]
  
@@ -127,7 +127,7 @@ diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build
 diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
 --- a/js/src/shell/moz.build
 +++ b/js/src/shell/moz.build
-@@ -5,31 +5,28 @@
+@@ -5,32 +5,28 @@
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  
  if CONFIG['JS_SHELL_NAME']:
@@ -150,6 +150,7 @@ diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
  
 -if CONFIG['NIGHTLY_BUILD']:
 -    DEFINES['ENABLE_WASM_GC'] = True
+-    DEFINES['WASM_PRIVATE_REFTYPES'] = True
 -
 -# Also set in ../moz.build
 -DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
@@ -162,7 +163,7 @@ diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
  
  LOCAL_INCLUDES += [
      '!..',
-@@ -43,23 +40,16 @@ OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
+@@ -44,23 +40,16 @@ OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
  GENERATED_FILES += [('shellmoduleloader.out.h', 'shellmoduleloader.js')]
  shellmoduleloader = GENERATED_FILES[('shellmoduleloader.out.h', 'shellmoduleloader.js')]
  shellmoduleloader.script = '../builtin/embedjs.py:generate_shellmoduleloader'

+ 63 - 29
frg/work-js/mozilla-release/patches/1590907-5-72a1.patch

@@ -2,7 +2,7 @@
 # User Philip Chimento <philip.chimento@gmail.com>
 # Date 1574753135 0
 # Node ID bfdd5f34f2f4a11b84742400bb3130192c89d4fb
-# Parent  1a2c2bfd4f55e66802b85a2a9718295838d5300d
+# Parent  77fdcc6567a5efb3cc83a7f6b945f8d9865db4d1
 Bug 1590907 - Make ENABLE_INTL_API and ENABLE_TYPED_OBJECTS into js-config macros. r=sfink,firefox-build-system-reviewers,mshal
 
 Whether ENABLE_INTL_API and ENABLE_TYPED_OBJECTS are defined, affects
@@ -606,7 +606,7 @@ diff --git a/js/src/builtin/String.js b/js/src/builtin/String.js
 diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
 --- a/js/src/builtin/TestingFunctions.cpp
 +++ b/js/src/builtin/TestingFunctions.cpp
-@@ -277,17 +277,17 @@ GetBuildConfiguration(JSContext* cx, uns
+@@ -293,17 +293,17 @@ GetBuildConfiguration(JSContext* cx, uns
  #ifdef ENABLE_BINARYDATA
      value = BooleanValue(true);
  #else
@@ -827,7 +827,41 @@ new file mode 100644
 diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
 --- a/js/src/jsdate.cpp
 +++ b/js/src/jsdate.cpp
-@@ -417,17 +417,17 @@ JS::DayWithinYear(double time, double ye
+@@ -117,31 +117,31 @@ static Atomic<uint32_t, Relaxed> sResolu
+  */
+ 
+ namespace
+ {
+ 
+ class DateTimeHelper
+ {
+   private:
+-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
++#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
+     static double localTZA(double t, DateTimeInfo::TimeZoneOffset offset);
+ #else
+     static int equivalentYearForDST(int year);
+     static bool isRepresentableAsTime32(double t);
+     static double daylightSavingTA(double t);
+     static double adjustTime(double date);
+     static PRMJTime toPRMJTime(double localTime, double utcTime);
+ #endif
+ 
+   public:
+     static double localTime(double t);
+     static double UTC(double t);
+     static JSString* timeZoneComment(JSContext* cx, double utcTime, double localTime);
+-#if !ENABLE_INTL_API || MOZ_SYSTEM_ICU
++#if !JS_HAS_INTL_API || MOZ_SYSTEM_ICU
+     static size_t formatTime(char* buf, size_t buflen, const char* fmt, double utcTime, double localTime);
+ #endif
+ };
+ 
+ }
+ 
+ // ES2019 draft rev 0ceb728a1adbffe42b26972a6541fd7f398b1557
+ // 5.2.5 Mathematical Operations
+@@ -445,17 +445,17 @@ JS::DayWithinYear(double time, double ye
  }
  
  JS_PUBLIC_API(void)
@@ -840,32 +874,32 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
 +#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
  // ES2019 draft rev 0ceb728a1adbffe42b26972a6541fd7f398b1557
  // 20.3.1.7 LocalTZA ( t, isUTC )
- static double
- LocalTZA(double t, DateTimeInfo::TimeZoneOffset offset)
+ double
+ DateTimeHelper::localTZA(double t, DateTimeInfo::TimeZoneOffset offset)
  {
      MOZ_ASSERT(IsFinite(t));
  
      int64_t milliseconds = static_cast<int64_t>(t);
-@@ -553,17 +553,17 @@ UTC(double t)
+@@ -581,17 +581,17 @@ DateTimeHelper::UTC(double t)
      // transitions. For example when transitioning from PST to PDT,
      // |new Date(2016,2,13,2,0,0).toTimeString()| returns the string value
      // "01:00:00 GMT-0800 (PST)" instead of "03:00:00 GMT-0700 (PDT)". Follow
      // V8 and subtract one hour before computing the offset.
      // Spec bug: https://bugs.ecmascript.org/show_bug.cgi?id=4007
  
-     return t - AdjustTime(t - DateTimeInfo::localTZA() - msPerHour);
+     return t - adjustTime(t - DateTimeInfo::localTZA() - msPerHour);
  }
 -#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
 +#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
  
- /* ES5 15.9.1.10. */
  static double
- HourFromTime(double t)
+ LocalTime(double t)
  {
-     return PositiveModulo(floor(t/msPerHour), HoursPerDay);
+     return DateTimeHelper::localTime(t);
  }
  
-@@ -2678,17 +2678,17 @@ date_toJSON(JSContext* cx, unsigned argc
+ static double
+@@ -2718,17 +2718,17 @@ date_toJSON(JSContext* cx, unsigned argc
          JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_TOISOSTRING_PROP);
          return false;
      }
@@ -876,15 +910,15 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
  
 -#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
 +#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
- static JSString*
- TimeZoneComment(JSContext* cx, double utcTime, double localTime)
+ JSString*
+ DateTimeHelper::timeZoneComment(JSContext* cx, double utcTime, double localTime)
  {
      const char* locale = cx->runtime()->getDefaultLocale();
      if (!locale) {
          JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DEFAULT_LOCALE_ERROR);
          return nullptr;
      }
-@@ -2781,17 +2781,17 @@ TimeZoneComment(JSContext* cx, double ut
+@@ -2821,17 +2821,17 @@ DateTimeHelper::timeZoneComment(JSContex
              usetz = false;
  
          if (usetz)
@@ -896,14 +930,14 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
 -#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
 +#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
  
- enum class FormatSpec {
-     DateTime,
-     Date,
-     Time
- };
+ static JSString*
+ TimeZoneComment(JSContext* cx, double utcTime, double localTime)
+ {
+     return DateTimeHelper::timeZoneComment(cx, utcTime, localTime);
+ }
  
- static bool
-@@ -2878,17 +2878,17 @@ FormatDate(JSContext* cx, double utcTime
+ enum class FormatSpec {
+@@ -2924,17 +2924,17 @@ FormatDate(JSContext* cx, double utcTime
          if (!str)
              return false;
      }
@@ -922,7 +956,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
      char buf[100];
      if (!IsFinite(utcTime)) {
          strcpy(buf, js_InvalidDate_str);
-@@ -2992,17 +2992,17 @@ date_toLocaleTimeString_impl(JSContext* 
+@@ -3038,17 +3038,17 @@ date_toLocaleTimeString_impl(JSContext* 
  }
  
  static bool
@@ -941,7 +975,7 @@ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
      return FormatDate(cx, args.thisv().toObject().as<DateObject>().UTCTime().toNumber(),
                        FormatSpec::Time, args.rval());
  }
-@@ -3148,17 +3148,17 @@ static const JSFunctionSpec date_methods
+@@ -3194,17 +3194,17 @@ static const JSFunctionSpec date_methods
      JS_FN("setUTCHours",         date_setUTCHours,        4,0),
      JS_FN("setMinutes",          date_setMinutes,         3,0),
      JS_FN("setUTCMinutes",       date_setUTCMinutes,      3,0),
@@ -1111,7 +1145,7 @@ diff --git a/js/src/jsnum.h b/js/src/jsnum.h
 diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
 --- a/js/src/shell/js.cpp
 +++ b/js/src/shell/js.cpp
-@@ -1081,17 +1081,17 @@ BindToAsyncStack(JSContext* cx, unsigned
+@@ -1083,17 +1083,17 @@ BindToAsyncStack(JSContext* cx, unsigned
          return false;
      SetFunctionNativeReserved(bound, 0, args[0]);
      SetFunctionNativeReserved(bound, 1, args[1]);
@@ -1130,7 +1164,7 @@ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
          JS_ReportErrorASCII(cx, "addIntlExtras must be passed an object");
          return false;
      }
-@@ -1108,17 +1108,17 @@ AddIntlExtras(JSContext* cx, unsigned ar
+@@ -1110,17 +1110,17 @@ AddIntlExtras(JSContext* cx, unsigned ar
          return false;
  
      if (!js::AddMozDateTimeFormatConstructor(cx, intl))
@@ -1149,7 +1183,7 @@ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
      // Eval.
      JS::CompileOptions options(cx);
      options.setIntroductionType("js shell interactive")
-@@ -7259,25 +7259,25 @@ static const JSFunctionSpecWithHelp shel
+@@ -7406,25 +7406,25 @@ static const JSFunctionSpecWithHelp shel
  "  cause:    A string, supplied as the async cause on the top frame of\n"
  "            captured async stacks.\n"
  "\n"
@@ -1658,7 +1692,7 @@ diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp
      allowContentJS_(true),
      atoms_(nullptr),
      permanentAtomsDuringInit_(nullptr),
-@@ -313,17 +313,17 @@ JSRuntime::destroyRuntime()
+@@ -301,17 +301,17 @@ JSRuntime::destroyRuntime()
      MOZ_ASSERT(!hasHelperThreadZones());
  
      /*
@@ -1677,7 +1711,7 @@ diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp
      js_delete(defaultFreeOp_.ref());
  
      defaultLocale = nullptr;
-@@ -547,17 +547,17 @@ JSRuntime::resetDefaultLocale()
+@@ -535,17 +535,17 @@ JSRuntime::resetDefaultLocale()
  const char*
  JSRuntime::getDefaultLocale()
  {
@@ -1721,7 +1755,7 @@ diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h
 diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp
 --- a/js/src/vm/SelfHosting.cpp
 +++ b/js/src/vm/SelfHosting.cpp
-@@ -2404,17 +2404,17 @@ static const JSFunctionSpec intrinsic_fu
+@@ -2405,17 +2405,17 @@ static const JSFunctionSpec intrinsic_fu
      JS_INLINABLE_FN("std_String_toLowerCase",    str_toLowerCase,              0,0, StringToLowerCase),
      JS_INLINABLE_FN("std_String_toUpperCase",    str_toUpperCase,              0,0, StringToUpperCase),
  

+ 0 - 704
frg/work-js/mozilla-release/patches/L-1423328-59a1.patch

@@ -1,704 +0,0 @@
-# HG changeset patch
-# User Ben Kelly <ben@wanderview.com>
-# Date 1512503650 18000
-# Node ID c0c7f12df75a4cd3c15f904606a017af8bcb9ba7
-# Parent  096055749c605a1f51c0b66d83be81292e93a586
-Bug 1423328 Allow a caller to set a ClientSource controlled by a service worker using a ClientHandle. r=baku
-
-diff --git a/dom/clients/manager/ClientHandle.cpp b/dom/clients/manager/ClientHandle.cpp
---- a/dom/clients/manager/ClientHandle.cpp
-+++ b/dom/clients/manager/ClientHandle.cpp
-@@ -5,16 +5,17 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- #include "ClientHandle.h"
- 
- #include "ClientHandleChild.h"
- #include "ClientHandleOpChild.h"
- #include "ClientManager.h"
- #include "mozilla/dom/PClientManagerChild.h"
-+#include "mozilla/dom/ServiceWorkerDescriptor.h"
- 
- namespace mozilla {
- namespace dom {
- 
- ClientHandle::~ClientHandle()
- {
-   Shutdown();
- }
-@@ -96,10 +97,30 @@ ClientHandle::ExecutionReady(const Clien
- }
- 
- const ClientInfo&
- ClientHandle::Info() const
- {
-   return mClientInfo;
- }
- 
-+RefPtr<GenericPromise>
-+ClientHandle::Control(const ServiceWorkerDescriptor& aServiceWorker)
-+{
-+  RefPtr<GenericPromise::Private> outerPromise =
-+    new GenericPromise::Private(__func__);
-+
-+  RefPtr<ClientOpPromise> innerPromise =
-+    StartOp(ClientControlledArgs(aServiceWorker.ToIPC()));
-+
-+  innerPromise->Then(mSerialEventTarget, __func__,
-+    [outerPromise](const ClientOpResult& aResult) {
-+      outerPromise->Resolve(true, __func__);
-+    },
-+    [outerPromise](const ClientOpResult& aResult) {
-+      outerPromise->Reject(aResult.get_nsresult(), __func__);
-+    });
-+
-+  return outerPromise.forget();
-+}
-+
- } // namespace dom
- } // namespace mozilla
-diff --git a/dom/clients/manager/ClientHandle.h b/dom/clients/manager/ClientHandle.h
---- a/dom/clients/manager/ClientHandle.h
-+++ b/dom/clients/manager/ClientHandle.h
-@@ -4,29 +4,31 @@
-  * 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_ClientHandle_h
- #define _mozilla_dom_ClientHandle_h
- 
- #include "mozilla/dom/ClientInfo.h"
- #include "mozilla/dom/ClientOpPromise.h"
- #include "mozilla/dom/ClientThing.h"
-+#include "mozilla/MozPromise.h"
- 
- #ifdef XP_WIN
- #undef PostMessage
- #endif
- 
- namespace mozilla {
- 
- namespace dom {
- 
- class ClientManager;
- class ClientHandleChild;
- class ClientOpConstructorArgs;
- class PClientManagerChild;
-+class ServiceWorkerDescriptor;
- 
- // The ClientHandle allows code to take a simple ClientInfo struct and
- // convert it into a live actor-backed object attached to a particular
- // ClientSource somewhere in the browser.  If the ClientSource is
- // destroyed then the ClientHandle will simply begin to reject operations.
- // We do not currently provide a way to be notified when the ClientSource
- // is destroyed, but this could be added in the future.
- class ClientHandle final : public ClientThing<ClientHandleChild>
-@@ -57,15 +59,21 @@ class ClientHandle final : public Client
- 
-   void
-   Activate(PClientManagerChild* aActor);
- 
- public:
-   const ClientInfo&
-   Info() const;
- 
-+  // Mark the ClientSource attached to this handle as controlled by the
-+  // given service worker.  The promise will resolve true if the ClientSource
-+  // is successfully marked or reject if the operation could not be completed.
-+  RefPtr<GenericPromise>
-+  Control(const ServiceWorkerDescriptor& aServiceWorker);
-+
-   NS_INLINE_DECL_REFCOUNTING(ClientHandle);
- };
- 
- } // namespace dom
- } // namespace mozilla
- 
- #endif // _mozilla_dom_ClientHandle_h
-diff --git a/dom/clients/manager/ClientHandleOpParent.cpp b/dom/clients/manager/ClientHandleOpParent.cpp
---- a/dom/clients/manager/ClientHandleOpParent.cpp
-+++ b/dom/clients/manager/ClientHandleOpParent.cpp
-@@ -1,23 +1,54 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "ClientHandleOpParent.h"
- 
-+#include "ClientHandleParent.h"
-+#include "ClientSourceParent.h"
-+
- namespace mozilla {
- namespace dom {
- 
-+ClientSourceParent*
-+ClientHandleOpParent::GetSource() const
-+{
-+  auto handle = static_cast<ClientHandleParent*>(Manager());
-+  return handle->GetSource();
-+}
-+
- void
- ClientHandleOpParent::ActorDestroy(ActorDestroyReason aReason)
- {
-+  mPromiseRequestHolder.DisconnectIfExists();
- }
- 
- void
- ClientHandleOpParent::Init(const ClientOpConstructorArgs& aArgs)
- {
-+  ClientSourceParent* source = GetSource();
-+  if (!source) {
-+    Unused << PClientHandleOpParent::Send__delete__(this, NS_ERROR_DOM_ABORT_ERR);
-+    return;
-+  }
-+
-+  RefPtr<ClientOpPromise> p = source->StartOp(aArgs);
-+
-+  // Capturing 'this' is safe here because we disconnect the promise in
-+  // ActorDestroy() which ensures neither lambda is called if the actor
-+  // is destroyed before the source operation completes.
-+  p->Then(GetCurrentThreadSerialEventTarget(), __func__,
-+    [this] (const ClientOpResult& aResult) {
-+      mPromiseRequestHolder.Complete();
-+      Unused << PClientHandleOpParent::Send__delete__(this, aResult);
-+    },
-+    [this] (nsresult aRv) {
-+      mPromiseRequestHolder.Complete();
-+      Unused << PClientHandleOpParent::Send__delete__(this, aRv);
-+    })->Track(mPromiseRequestHolder);
- }
- 
- } // namespace dom
- } // namespace mozilla
-diff --git a/dom/clients/manager/ClientHandleOpParent.h b/dom/clients/manager/ClientHandleOpParent.h
---- a/dom/clients/manager/ClientHandleOpParent.h
-+++ b/dom/clients/manager/ClientHandleOpParent.h
-@@ -1,23 +1,31 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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_ClientHandleOpParent_h
- #define _mozilla_dom_ClientHandleOpParent_h
- 
-+#include "ClientOpPromise.h"
- #include "mozilla/dom/PClientHandleOpParent.h"
- 
- namespace mozilla {
- namespace dom {
- 
-+class ClientSourceParent;
-+
- class ClientHandleOpParent final : public PClientHandleOpParent
- {
-+  MozPromiseRequestHolder<ClientOpPromise> mPromiseRequestHolder;
-+
-+  ClientSourceParent*
-+  GetSource() const;
-+
-   // PClientHandleOpParent interface
-   void
-   ActorDestroy(ActorDestroyReason aReason) override;
- 
- public:
-   ClientHandleOpParent() = default;
-   ~ClientHandleOpParent() = default;
- 
-diff --git a/dom/clients/manager/ClientIPCTypes.ipdlh b/dom/clients/manager/ClientIPCTypes.ipdlh
---- a/dom/clients/manager/ClientIPCTypes.ipdlh
-+++ b/dom/clients/manager/ClientIPCTypes.ipdlh
-@@ -51,22 +51,28 @@ union IPCClientState
- };
- 
- struct ClientSourceExecutionReadyArgs
- {
-   nsCString url;
-   FrameType frameType;
- };
- 
-+struct ClientControlledArgs
-+{
-+  IPCServiceWorkerDescriptor serviceWorker;
-+};
-+
- struct ClientOpenWindowArgs
- {
- };
- 
--struct ClientOpConstructorArgs
-+union ClientOpConstructorArgs
- {
-+  ClientControlledArgs;
- };
- 
- struct ClientNavigateOpConstructorArgs
- {
- };
- 
- union ClientOpResult
- {
-diff --git a/dom/clients/manager/ClientSource.cpp b/dom/clients/manager/ClientSource.cpp
---- a/dom/clients/manager/ClientSource.cpp
-+++ b/dom/clients/manager/ClientSource.cpp
-@@ -252,16 +252,47 @@ ClientSource::Thaw()
- }
- 
- const ClientInfo&
- ClientSource::Info() const
- {
-   return mClientInfo;
- }
- 
-+void
-+ClientSource::SetController(const ServiceWorkerDescriptor& aServiceWorker)
-+{
-+  NS_ASSERT_OWNINGTHREAD(ClientSource);
-+
-+  if (mController.isSome() && mController.ref() == aServiceWorker) {
-+    return;
-+  }
-+
-+  mController.reset();
-+  mController.emplace(aServiceWorker);
-+}
-+
-+RefPtr<ClientOpPromise>
-+ClientSource::Control(const ClientControlledArgs& aArgs)
-+{
-+  NS_ASSERT_OWNINGTHREAD(ClientSource);
-+
-+  SetController(ServiceWorkerDescriptor(aArgs.serviceWorker()));
-+
-+  RefPtr<ClientOpPromise> ref =
-+    ClientOpPromise::CreateAndResolve(NS_OK, __func__);
-+  return ref.forget();
-+}
-+
-+const Maybe<ServiceWorkerDescriptor>&
-+ClientSource::GetController() const
-+{
-+  return mController;
-+}
-+
- nsISerialEventTarget*
- ClientSource::EventTarget() const
- {
-   return mEventTarget;
- }
- 
- void
- ClientSource::Traverse(nsCycleCollectionTraversalCallback& aCallback,
-diff --git a/dom/clients/manager/ClientSource.h b/dom/clients/manager/ClientSource.h
---- a/dom/clients/manager/ClientSource.h
-+++ b/dom/clients/manager/ClientSource.h
-@@ -2,24 +2,29 @@
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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_ClientSource_h
- #define _mozilla_dom_ClientSource_h
- 
- #include "mozilla/dom/ClientInfo.h"
-+#include "mozilla/dom/ClientOpPromise.h"
- #include "mozilla/dom/ClientThing.h"
-+#include "mozilla/dom/ServiceWorkerDescriptor.h"
-+#include "mozilla/Variant.h"
- 
- class nsIDocShell;
-+class nsISerialEventTarget;
- class nsPIDOMWindowInner;
- 
- namespace mozilla {
- namespace dom {
- 
-+class ClientControlledArgs;
- class ClientManager;
- class ClientSourceChild;
- class ClientSourceConstructorArgs;
- class ClientSourceExecutionReadyArgs;
- class PClientManagerChild;
- 
- namespace workers {
- class WorkerPrivate;
-@@ -41,16 +46,17 @@ class ClientSource final : public Client
-   nsCOMPtr<nsISerialEventTarget> mEventTarget;
- 
-   Variant<Nothing,
-           RefPtr<nsPIDOMWindowInner>,
-           nsCOMPtr<nsIDocShell>,
-           mozilla::dom::workers::WorkerPrivate*> mOwner;
- 
-   ClientInfo mClientInfo;
-+  Maybe<ServiceWorkerDescriptor> mController;
- 
-   void
-   Shutdown();
- 
-   void
-   ExecutionReady(const ClientSourceExecutionReadyArgs& aArgs);
- 
-   mozilla::dom::workers::WorkerPrivate*
-@@ -86,16 +92,37 @@ public:
-   Freeze();
- 
-   void
-   Thaw();
- 
-   const ClientInfo&
-   Info() const;
- 
-+  // Synchronously mark the ClientSource as controlled by the given service
-+  // worker.  This can happen as a result of a remote operation or directly
-+  // by local code.  For example, if a client's initial network load is
-+  // intercepted by a controlling service worker then this should be called
-+  // immediately.
-+  //
-+  // Note, there is no way to clear the controlling service worker because
-+  // the specification does not allow that operation.
-+  void
-+  SetController(const ServiceWorkerDescriptor& aServiceWorker);
-+
-+  // Mark the ClientSource as controlled using the remote operation arguments.
-+  // This will in turn call SetController().
-+  RefPtr<ClientOpPromise>
-+  Control(const ClientControlledArgs& aArgs);
-+
-+  // Get the ClientSource's current controlling service worker, if one has
-+  // been set.
-+  const Maybe<ServiceWorkerDescriptor>&
-+  GetController() const;
-+
-   nsISerialEventTarget*
-   EventTarget() const;
- 
-   void
-   Traverse(nsCycleCollectionTraversalCallback& aCallback,
-            const char* aName,
-            uint32_t aFlags);
- };
-diff --git a/dom/clients/manager/ClientSourceChild.cpp b/dom/clients/manager/ClientSourceChild.cpp
---- a/dom/clients/manager/ClientSourceChild.cpp
-+++ b/dom/clients/manager/ClientSourceChild.cpp
-@@ -1,18 +1,18 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "ClientSourceChild.h"
- 
-+#include "ClientSource.h"
- #include "ClientSourceOpChild.h"
--#include "ClientThing.h"
- #include "mozilla/dom/ClientIPCTypes.h"
- #include "mozilla/Unused.h"
- 
- namespace mozilla {
- namespace dom {
- 
- using mozilla::ipc::IPCResult;
- 
-@@ -56,27 +56,33 @@ ClientSourceChild::ClientSourceChild(con
- {
- }
- 
- void
- ClientSourceChild::SetOwner(ClientThing<ClientSourceChild>* aThing)
- {
-   MOZ_DIAGNOSTIC_ASSERT(aThing);
-   MOZ_DIAGNOSTIC_ASSERT(!mSource);
--  mSource = aThing;
-+  mSource = static_cast<ClientSource*>(aThing);
- }
- 
- void
- ClientSourceChild::RevokeOwner(ClientThing<ClientSourceChild>* aThing)
- {
-   MOZ_DIAGNOSTIC_ASSERT(mSource);
--  MOZ_DIAGNOSTIC_ASSERT(mSource == aThing);
-+  MOZ_DIAGNOSTIC_ASSERT(mSource == static_cast<ClientSource*>(aThing));
-   mSource = nullptr;
- }
- 
-+ClientSource*
-+ClientSourceChild::GetSource() const
-+{
-+  return mSource;
-+}
-+
- void
- ClientSourceChild::MaybeStartTeardown()
- {
-   if (mTeardownStarted) {
-     return;
-   }
-   mTeardownStarted = true;
-   Unused << SendTeardown();
-diff --git a/dom/clients/manager/ClientSourceChild.h b/dom/clients/manager/ClientSourceChild.h
---- a/dom/clients/manager/ClientSourceChild.h
-+++ b/dom/clients/manager/ClientSourceChild.h
-@@ -6,22 +6,23 @@
- #ifndef _mozilla_dom_ClientSourceChild_h
- #define _mozilla_dom_ClientSourceChild_h
- 
- #include "mozilla/dom/PClientSourceChild.h"
- 
- namespace mozilla {
- namespace dom {
- 
-+class ClientSource;
- class ClientSourceConstructorArgs;
- template <typename ActorType> class ClientThing;
- 
- class ClientSourceChild final : public PClientSourceChild
- {
--  ClientThing<ClientSourceChild>* mSource;
-+  ClientSource* mSource;
-   bool mTeardownStarted;
- 
-   // PClientSourceChild interface
-   void
-   ActorDestroy(ActorDestroyReason aReason) override;
- 
-   PClientSourceOpChild*
-   AllocPClientSourceOpChild(const ClientOpConstructorArgs& aArgs) override;
-@@ -37,16 +38,19 @@ public:
-   explicit ClientSourceChild(const ClientSourceConstructorArgs& aArgs);
- 
-   void
-   SetOwner(ClientThing<ClientSourceChild>* aThing);
- 
-   void
-   RevokeOwner(ClientThing<ClientSourceChild>* aThing);
- 
-+  ClientSource*
-+  GetSource() const;
-+
-   void
-   MaybeStartTeardown();
- };
- 
- } // namespace dom
- } // namespace mozilla
- 
- #endif // _mozilla_dom_ClientSourceChild_h
-diff --git a/dom/clients/manager/ClientSourceOpChild.cpp b/dom/clients/manager/ClientSourceOpChild.cpp
---- a/dom/clients/manager/ClientSourceOpChild.cpp
-+++ b/dom/clients/manager/ClientSourceOpChild.cpp
-@@ -1,23 +1,91 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "ClientSourceOpChild.h"
- 
-+#include "ClientSource.h"
-+#include "ClientSourceChild.h"
-+#include "mozilla/Unused.h"
-+
- namespace mozilla {
- namespace dom {
- 
-+ClientSource*
-+ClientSourceOpChild::GetSource() const
-+{
-+  auto actor = static_cast<ClientSourceChild*>(Manager());
-+  return actor->GetSource();
-+}
-+
-+template<typename Method, typename Args>
-+void
-+ClientSourceOpChild::DoSourceOp(Method aMethod, const Args& aArgs)
-+{
-+  RefPtr<ClientOpPromise> promise;
-+  nsCOMPtr<nsISerialEventTarget> target;
-+
-+  // Some ClientSource operations can cause the ClientSource to be destroyed.
-+  // This means we should reference the ClientSource pointer for the minimum
-+  // possible to start the operation.  Use an extra block scope here to help
-+  // enforce this and prevent accidental usage later in the method.
-+  {
-+    ClientSource* source = GetSource();
-+    if (!source) {
-+      Unused << PClientSourceOpChild::Send__delete__(this, NS_ERROR_DOM_ABORT_ERR);
-+      return;
-+    }
-+
-+    target = source->EventTarget();
-+
-+    // This may cause the ClientSource object to be destroyed.  Do not
-+    // use the source variable after this call.
-+    promise = (source->*aMethod)(aArgs);
-+  }
-+
-+  // The ClientSource methods are required to always return a promise.  If
-+  // they encounter an error they should just immediately resolve or reject
-+  // the promise as appropriate.
-+  MOZ_DIAGNOSTIC_ASSERT(promise);
-+
-+  // Capture 'this' is safe here because we disconnect the promise
-+  // ActorDestroy() which ensures nethier lambda is called if the
-+  // actor is destroyed before the source operation completes.
-+  promise->Then(target, __func__,
-+    [this, aArgs] (const mozilla::dom::ClientOpResult& aResult) {
-+      mPromiseRequestHolder.Complete();
-+      Unused << PClientSourceOpChild::Send__delete__(this, aResult);
-+    },
-+    [this] (nsresult aRv) {
-+      mPromiseRequestHolder.Complete();
-+      Unused << PClientSourceOpChild::Send__delete__(this, aRv);
-+    })->Track(mPromiseRequestHolder);
-+}
-+
- void
- ClientSourceOpChild::ActorDestroy(ActorDestroyReason aReason)
- {
-+  mPromiseRequestHolder.DisconnectIfExists();
- }
- 
- void
- ClientSourceOpChild::Init(const ClientOpConstructorArgs& aArgs)
- {
-+  switch (aArgs.type()) {
-+    case ClientOpConstructorArgs::TClientControlledArgs:
-+    {
-+      DoSourceOp(&ClientSource::Control, aArgs.get_ClientControlledArgs());
-+      break;
-+    }
-+    default:
-+    {
-+      MOZ_ASSERT_UNREACHABLE("unknown client operation!");
-+      break;
-+    }
-+  }
- }
- 
- } // namespace dom
- } // namespace mozilla
-diff --git a/dom/clients/manager/ClientSourceOpChild.h b/dom/clients/manager/ClientSourceOpChild.h
---- a/dom/clients/manager/ClientSourceOpChild.h
-+++ b/dom/clients/manager/ClientSourceOpChild.h
-@@ -7,18 +7,29 @@
- #define _mozilla_dom_ClientSourceOpChild_h
- 
- #include "mozilla/dom/PClientSourceOpChild.h"
- #include "ClientOpPromise.h"
- 
- namespace mozilla {
- namespace dom {
- 
-+class ClientSource;
-+
- class ClientSourceOpChild final : public PClientSourceOpChild
- {
-+  MozPromiseRequestHolder<ClientOpPromise> mPromiseRequestHolder;
-+
-+  ClientSource*
-+  GetSource() const;
-+
-+  template <typename Method, typename Args>
-+  void
-+  DoSourceOp(Method aMethod, const Args& aArgs);
-+
-   // PClientSourceOpChild interface
-   void
-   ActorDestroy(ActorDestroyReason aReason) override;
- 
- public:
-   ClientSourceOpChild() = default;
-   ~ClientSourceOpChild() = default;
- 
-diff --git a/dom/clients/manager/ClientSourceParent.cpp b/dom/clients/manager/ClientSourceParent.cpp
---- a/dom/clients/manager/ClientSourceParent.cpp
-+++ b/dom/clients/manager/ClientSourceParent.cpp
-@@ -221,10 +221,30 @@ ClientSourceParent::AttachHandle(ClientH
- void
- ClientSourceParent::DetachHandle(ClientHandleParent* aClientHandle)
- {
-   MOZ_DIAGNOSTIC_ASSERT(aClientHandle);
-   MOZ_ASSERT(mHandleList.Contains(aClientHandle));
-   mHandleList.RemoveElement(aClientHandle);
- }
- 
-+RefPtr<ClientOpPromise>
-+ClientSourceParent::StartOp(const ClientOpConstructorArgs& aArgs)
-+{
-+  RefPtr<ClientOpPromise::Private> promise =
-+    new ClientOpPromise::Private(__func__);
-+
-+  // If we are being controlled, remember that data before propagating
-+  // on to the ClientSource.
-+  if (aArgs.type() == ClientOpConstructorArgs::TClientControlledArgs) {
-+    mController.reset();
-+    mController.emplace(aArgs.get_ClientControlledArgs().serviceWorker());
-+  }
-+
-+  // Constructor failure will reject the promise via ActorDestroy().
-+  ClientSourceOpParent* actor = new ClientSourceOpParent(aArgs, promise);
-+  Unused << SendPClientSourceOpConstructor(actor, aArgs);
-+
-+  return promise.forget();
-+}
-+
- } // namespace dom
- } // namespace mozilla
-diff --git a/dom/clients/manager/ClientSourceParent.h b/dom/clients/manager/ClientSourceParent.h
---- a/dom/clients/manager/ClientSourceParent.h
-+++ b/dom/clients/manager/ClientSourceParent.h
-@@ -2,27 +2,30 @@
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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_ClientSourceParent_h
- #define _mozilla_dom_ClientSourceParent_h
- 
- #include "ClientInfo.h"
-+#include "ClientOpPromise.h"
- #include "mozilla/dom/PClientSourceParent.h"
-+#include "mozilla/dom/ServiceWorkerDescriptor.h"
- 
- namespace mozilla {
- namespace dom {
- 
- class ClientHandleParent;
- class ClientManagerService;
- 
- class ClientSourceParent final : public PClientSourceParent
- {
-   ClientInfo mClientInfo;
-+  Maybe<ServiceWorkerDescriptor> mController;
-   RefPtr<ClientManagerService> mService;
-   nsTArray<ClientHandleParent*> mHandleList;
-   bool mExecutionReady;
-   bool mFrozen;
- 
-   void
-   KillInvalidChild();
- 
-@@ -61,14 +64,17 @@ public:
-   bool
-   IsFrozen() const;
- 
-   void
-   AttachHandle(ClientHandleParent* aClientSource);
- 
-   void
-   DetachHandle(ClientHandleParent* aClientSource);
-+
-+  RefPtr<ClientOpPromise>
-+  StartOp(const ClientOpConstructorArgs& aArgs);
- };
- 
- } // namespace dom
- } // namespace mozilla
- 
- #endif // _mozilla_dom_ClientSourceParent_h
-

+ 0 - 38
frg/work-js/mozilla-release/patches/L-1460489-6-63a1.patch

@@ -1,38 +0,0 @@
-# HG changeset patch
-# User Tooru Fujisawa <arai_a@mac.com>
-# Date 1531363580 -32400
-#      Thu Jul 12 11:46:20 2018 +0900
-# Node ID 6a29c6057ad4c67c1f840cad5acbb66e7249a18e
-# Parent  5866137afd9a258675cdae78cc02b4a012f878e2
-Bug 1460489 - followup: Remove inline from BackgroundSweepTask::{isRunning,isRunningWithLockHeld} definitions which is called from other files. r=bustage CLOSED TREE
-
-diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
---- a/js/src/gc/GC.cpp
-+++ b/js/src/gc/GC.cpp
-@@ -3638,24 +3638,24 @@ GCRuntime::freeAllLifoBlocksAfterMinorGC
-     blocksToFreeAfterMinorGC.ref().transferFrom(lifo);
- }
- 
- BackgroundSweepTask::BackgroundSweepTask(JSRuntime* rt)
-   : GCParallelTaskHelper(rt),
-     done(false)
- {}
- 
--inline bool
-+bool
- BackgroundSweepTask::isRunning() const
- {
-     AutoLockHelperThreadState lock;
-     return isRunningWithLockHeld(lock);
- }
- 
--inline bool
-+bool
- BackgroundSweepTask::isRunningWithLockHeld(const AutoLockHelperThreadState& lock) const
- {
-     return Base::isRunningWithLockHeld(lock) && !done;
- }
- 
- void
- BackgroundSweepTask::startIfIdle(AutoLockHelperThreadState& lock)
- {

+ 0 - 94
frg/work-js/mozilla-release/patches/TOP-1472170-PARTIAL-NOTESTS-63a1.patch

@@ -1,94 +0,0 @@
-# HG changeset patch
-# User omersid <omersid@nomailaddy.com>
-# Date 1535426094 14400
-# Node ID 709590a1a24fc8d55f891204dd1e105eaf787177
-# Parent  f24d56bf25339e20635838a4d5d7ce3bcce2fad6
-Bug 1472170- Added description as a property for Symbol and updated tests262. r=anba
-
-diff --git a/js/src/builtin/Symbol.cpp b/js/src/builtin/Symbol.cpp
---- a/js/src/builtin/Symbol.cpp
-+++ b/js/src/builtin/Symbol.cpp
-@@ -26,16 +26,17 @@ SymbolObject::create(JSContext* cx, JS::
-     SymbolObject* obj = NewBuiltinClassInstance<SymbolObject>(cx);
-     if (!obj)
-         return nullptr;
-     obj->setPrimitiveValue(symbol);
-     return obj;
- }
- 
- const JSPropertySpec SymbolObject::properties[] = {
-+    JS_PSG("description", descriptionGetter, 0),
-     JS_PS_END
- };
- 
- const JSFunctionSpec SymbolObject::methods[] = {
-     JS_FN(js_toString_str, toString, 0, 0),
-     JS_FN(js_valueOf_str, valueOf, 0, 0),
-     JS_SYM_FN(toPrimitive, toPrimitive, 1, JSPROP_READONLY),
-     JS_FS_END
-@@ -226,16 +227,41 @@ SymbolObject::toPrimitive(JSContext* cx,
- {
-     CallArgs args = CallArgsFromVp(argc, vp);
- 
-     // The specification gives exactly the same algorithm for @@toPrimitive as
-     // for valueOf, so reuse the valueOf implementation.
-     return CallNonGenericMethod<IsSymbol, valueOf_impl>(cx, args);
- }
- 
-+bool
-+SymbolObject::descriptionGetter_impl(JSContext* cx, const CallArgs& args)
-+{
-+    // Get symbol object pointer.
-+    HandleValue thisv = args.thisv();
-+    MOZ_ASSERT(IsSymbol(thisv));
-+    Rooted<Symbol*> sym(cx, thisv.isSymbol()
-+                            ? thisv.toSymbol()
-+                            : thisv.toObject().as<SymbolObject>().unbox());
-+
-+    // Return the symbol's description if present, otherwise return undefined.
-+    if (JSString* str = sym->description())
-+        args.rval().setString(str);
-+    else
-+        args.rval().setUndefined();
-+    return true;
-+}
-+
-+bool
-+SymbolObject::descriptionGetter(JSContext* cx, unsigned argc, Value* vp)
-+{
-+    CallArgs args = CallArgsFromVp(argc, vp);
-+    return CallNonGenericMethod<IsSymbol, descriptionGetter_impl>(cx, args);
-+}
-+
- JSObject*
- js::InitSymbolClass(JSContext* cx, Handle<GlobalObject*> global)
- {
-     return SymbolObject::initClass(cx, global, true);
- }
- 
- JSObject*
- js::InitBareSymbolCtor(JSContext* cx, Handle<GlobalObject*> global)
-diff --git a/js/src/builtin/Symbol.h b/js/src/builtin/Symbol.h
---- a/js/src/builtin/Symbol.h
-+++ b/js/src/builtin/Symbol.h
-@@ -49,16 +49,20 @@ class SymbolObject : public NativeObject
- 
-     // Methods defined on Symbol.prototype.
-     static MOZ_MUST_USE bool toString_impl(JSContext* cx, const CallArgs& args);
-     static MOZ_MUST_USE bool toString(JSContext* cx, unsigned argc, Value* vp);
-     static MOZ_MUST_USE bool valueOf_impl(JSContext* cx, const CallArgs& args);
-     static MOZ_MUST_USE bool valueOf(JSContext* cx, unsigned argc, Value* vp);
-     static MOZ_MUST_USE bool toPrimitive(JSContext* cx, unsigned argc, Value* vp);
- 
-+    // Properties defined on Symbol.prototype.
-+    static MOZ_MUST_USE bool descriptionGetter_impl(JSContext* cx, const CallArgs& args);
-+    static MOZ_MUST_USE bool descriptionGetter(JSContext* cx, unsigned argc, Value *vp);
-+
-     static const JSPropertySpec properties[];
-     static const JSFunctionSpec methods[];
-     static const JSFunctionSpec staticMethods[];
- };
- 
- extern JSObject*
- InitSymbolClass(JSContext* cx, Handle<GlobalObject*> global);
- 

+ 77 - 0
frg/work-js/mozilla-release/patches/TOP-1541286-68a1.patch

@@ -0,0 +1,77 @@
+# HG changeset patch
+# User Jeff Walden <jwalden@mit.edu>
+# Date 1554254874 0
+# Node ID ef65dd8bc6d124409b017783e8e28a9cdade0136
+# Parent  fa00c80a5c818e1d63b821b0524193a24b2f6627
+Bug 1541286 - Remove "vm/RegExpConstants.h" and move the sole symbol in it into the sole header that #include'd it.  r=arai
+
+Differential Revision: https://phabricator.services.mozilla.com/D25892
+
+diff --git a/js/src/vm/RegExpConstants.h b/js/src/vm/RegExpConstants.h
+deleted file mode 100644
+--- a/js/src/vm/RegExpConstants.h
++++ /dev/null
+@@ -1,22 +0,0 @@
+-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+- * vim: set ts=8 sts=2 et sw=2 tw=80:
+- * This Source Code Form is subject to the terms of the Mozilla Public
+- * 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 vm_RegExpConstants_h
+-#define vm_RegExpConstants_h
+-
+-#include "builtin/SelfHostingDefines.h"
+-
+-namespace js {
+-
+-enum RegExpRunStatus {
+-  RegExpRunStatus_Error,
+-  RegExpRunStatus_Success,
+-  RegExpRunStatus_Success_NotFound
+-};
+-
+-} /* namespace js */
+-
+-#endif /* vm_RegExpConstants_h */
+diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
+--- a/js/src/vm/RegExpShared.h
++++ b/js/src/vm/RegExpShared.h
+@@ -21,30 +21,35 @@
+ #include "gc/Marking.h"
+ #include "gc/Zone.h"
+ #include "js/AllocPolicy.h"
+ #include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
+ #include "js/UbiNode.h"
+ #include "js/Vector.h"
+ #include "vm/ArrayObject.h"
+ #include "vm/JSAtom.h"
+-#include "vm/RegExpConstants.h"
+ 
+ namespace js {
+ 
+ class ArrayObject;
+ class RegExpRealm;
+ class RegExpShared;
+ class RegExpStatics;
+ class VectorMatchPairs;
+ 
+ using RootedRegExpShared = JS::Rooted<RegExpShared*>;
+ using HandleRegExpShared = JS::Handle<RegExpShared*>;
+ using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
+ 
++enum RegExpRunStatus {
++  RegExpRunStatus_Error,
++  RegExpRunStatus_Success,
++  RegExpRunStatus_Success_NotFound
++};
++
+ /*
+  * A RegExpShared is the compiled representation of a regexp. A RegExpShared is
+  * potentially pointed to by multiple RegExpObjects. Additionally, C++ code may
+  * have pointers to RegExpShareds on the stack. The RegExpShareds are kept in a
+  * table so that they can be reused when compiling the same regex string.
+  *
+  * To save memory, a RegExpShared is not created for a RegExpObject until it is
+  * needed for execution. When a RegExpShared needs to be created, it is looked
+

+ 0 - 74
frg/work-js/mozilla-release/patches/TOP-NOBUG-PLASTER-25319.patch

@@ -1,74 +0,0 @@
-# HG changeset patch
-# User Frank-Rainer Grahl <frgrahl@gmx.net>
-# Date 1702940964 -3600
-# Parent  6b84642351de0cf9e131c24a919a943fe00e57d6
-No bug - JS plaster for missing bugs. r=me a=me
-
-diff --git a/js/public/AutoByteString.h b/js/public/AutoByteString.h
---- a/js/public/AutoByteString.h
-+++ b/js/public/AutoByteString.h
-@@ -13,17 +13,19 @@
- 
- #include "mozilla/Assertions.h" // MOZ_ASSERT
- #include "mozilla/Attributes.h" // MOZ_RAII, MOZ_GUARD*
- 
- #include <string.h> // strlen
- 
- #include "jstypes.h" // JS_PUBLIC_API
- 
--#include "js/MemoryFunctions.h" // JS_free
-+// needs 1484386
-+#include "jsapi.h"
-+// #include "js/MemoryFunctions.h" // JS_free
- #include "js/RootingAPI.h" // JS::Handle
- #include "js/TypeDecls.h" // JSContext, JSString
- #include "js/Utility.h" // js_free, JS::UniqueChars
- 
- /**
-  * DEPRECATED
-  *
-  * Allocate memory sufficient to contain the characters of |str| truncated to
-diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h
---- a/js/src/frontend/TokenStream.h
-+++ b/js/src/frontend/TokenStream.h
-@@ -205,17 +205,19 @@
- #include "frontend/ErrorReporter.h"
- #include "frontend/TokenKind.h"
- #include "js/CompileOptions.h"
- #include "js/UniquePtr.h"
- #include "js/Vector.h"
- #include "util/Text.h"
- #include "util/Unicode.h"
- #include "vm/ErrorReporting.h"
-+#include "vm/JSAtom.h"
- #include "vm/RegExpShared.h"
-+#include "vm/StringType.h"
- 
- struct JSContext;
- struct KeywordInfo;
- 
- namespace js {
- 
- class AutoKeepAtoms;
- 
-diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp
---- a/js/src/jsexn.cpp
-+++ b/js/src/jsexn.cpp
-@@ -20,16 +20,17 @@
- #include "jsnum.h"
- #include "jstypes.h"
- #include "jsutil.h"
- 
- #include "gc/FreeOp.h"
- #include "gc/Marking.h"
- #include "js/AutoByteString.h"
- #include "js/CharacterEncoding.h"
-+#include "js/SavedFrameAPI.h"
- #include "js/UniquePtr.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "vm/ErrorObject.h"
- #include "vm/GlobalObject.h"
- #include "vm/JSContext.h"
- #include "vm/JSFunction.h"
- #include "vm/JSObject.h"

+ 51 - 48
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-02-1361856-1-dotall-76a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690629322 -7200
-# Parent  4f116dc38b1a753a345776923ded3f7e3ffdde67
+# Parent  091019166060db4b7a88c085d4df64ce387c336e
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 Implement /s (dotAll) for regular expressions.
@@ -10,7 +10,7 @@ Derived from https://github.com/WaterfoxCo/Waterfox-Classic/commit/e6562fcbac77a
 diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
 --- a/js/src/builtin/RegExp.cpp
 +++ b/js/src/builtin/RegExp.cpp
-@@ -172,17 +172,17 @@ js::ExecuteRegExpLegacy(JSContext* cx, R
+@@ -174,17 +174,17 @@ js::ExecuteRegExpLegacy(JSContext* cx, R
  }
  
  static bool
@@ -29,7 +29,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
      // If we already have a RegExpShared for this pattern/flags, we can
      // avoid the much slower CheckPatternSyntaxSlow call.
  
-@@ -693,16 +693,43 @@ regexp_source(JSContext* cx, unsigned ar
+@@ -695,16 +695,43 @@ regexp_source(JSContext* cx, unsigned ar
          args.rval().setString(cx->names().emptyRegExp);
          return true;
      }
@@ -73,7 +73,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
  
      // Steps 4-6.
      RegExpObject* reObj = &args.thisv().toObject().as<RegExpObject>();
-@@ -755,16 +782,17 @@ js::regexp_unicode(JSContext* cx, unsign
+@@ -757,16 +784,17 @@ js::regexp_unicode(JSContext* cx, unsign
  const JSPropertySpec js::regexp_properties[] = {
      JS_SELF_HOSTED_GET("flags", "RegExpFlagsGetter", 0),
      JS_PSG("global", regexp_global, 0),
@@ -91,7 +91,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
      JS_SELF_HOSTED_FN(js_toString_str, "RegExpToString", 0, 0),
      JS_FN("compile",        regexp_compile,     2,0),
      JS_SELF_HOSTED_FN("exec", "RegExp_prototype_Exec", 1,0),
-@@ -1614,16 +1642,23 @@ js::RegExpPrototypeOptimizableRaw(JSCont
+@@ -1616,16 +1644,23 @@ js::RegExpPrototypeOptimizableRaw(JSCont
  
      JSNative unicodeGetter;
      if (!GetOwnNativeGetterPure(cx, proto, NameToId(cx->names().unicode), &unicodeGetter))
@@ -214,7 +214,7 @@ diff --git a/js/src/builtin/SelfHostingDefines.h b/js/src/builtin/SelfHostingDef
 diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
 --- a/js/src/builtin/TestingFunctions.cpp
 +++ b/js/src/builtin/TestingFunctions.cpp
-@@ -4824,16 +4824,17 @@ ParseRegExp(JSContext* cx, unsigned argc
+@@ -4678,16 +4678,17 @@ ParseRegExp(JSContext* cx, unsigned argc
      CompileOptions options(cx);
      frontend::TokenStream dummyTokenStream(cx, options, nullptr, 0, nullptr);
  
@@ -235,7 +235,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
 diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 --- a/js/src/frontend/Parser.cpp
 +++ b/js/src/frontend/Parser.cpp
-@@ -9484,17 +9484,17 @@ Parser<SyntaxParseHandler, CharT>::newRe
+@@ -9485,17 +9485,17 @@ Parser<SyntaxParseHandler, CharT>::newRe
  {
      MOZ_ASSERT(!options().selfHostingMode);
  
@@ -257,7 +257,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
 --- a/js/src/frontend/TokenStream.cpp
 +++ b/js/src/frontend/TokenStream.cpp
-@@ -2238,16 +2238,18 @@ TokenStreamSpecific<CharT, AnyCharsAcces
+@@ -2240,16 +2240,18 @@ TokenStreamSpecific<CharT, AnyCharsAcces
          RegExpFlag flag;
          unit = getCodeUnit();
          if (unit == 'g')
@@ -580,7 +580,7 @@ diff --git a/js/src/irregexp/RegExpParser.h b/js/src/irregexp/RegExpParser.h
 diff --git a/js/src/jsapi.h b/js/src/jsapi.h
 --- a/js/src/jsapi.h
 +++ b/js/src/jsapi.h
-@@ -5334,16 +5334,17 @@ JS_ObjectIsDate(JSContext* cx, JS::Handl
+@@ -4181,16 +4181,17 @@ JS_ObjectIsDate(JSContext* cx, JS::Handl
  /*
   * Regular Expressions.
   */
@@ -619,10 +619,44 @@ diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
      macro(empty, empty, "") \
      macro(emptyRegExp, emptyRegExp, "(?:)") \
      macro(encodeURI, encodeURI, "encodeURI") \
+diff --git a/js/src/vm/RegExpConstants.h b/js/src/vm/RegExpConstants.h
+--- a/js/src/vm/RegExpConstants.h
++++ b/js/src/vm/RegExpConstants.h
+@@ -13,26 +13,28 @@ namespace js {
+ 
+ enum RegExpFlag : uint8_t
+ {
+     IgnoreCaseFlag  = 0x01,
+     GlobalFlag      = 0x02,
+     MultilineFlag   = 0x04,
+     StickyFlag      = 0x08,
+     UnicodeFlag     = 0x10,
++    DotAllFlag      = 0x20,
+ 
+     NoFlags         = 0x00,
+-    AllFlags        = 0x1f
++    AllFlags        = 0x3f
+ };
+ 
+ static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
+               GlobalFlag == REGEXP_GLOBAL_FLAG &&
+               MultilineFlag == REGEXP_MULTILINE_FLAG &&
+               StickyFlag == REGEXP_STICKY_FLAG &&
+-              UnicodeFlag == REGEXP_UNICODE_FLAG,
++              UnicodeFlag == REGEXP_UNICODE_FLAG &&
++              DotAllFlag == REGEXP_DOTALL_FLAG,
+               "Flag values should be in sync with self-hosted JS");
+ 
+ enum RegExpRunStatus
+ {
+     RegExpRunStatus_Error,
+     RegExpRunStatus_Success,
+     RegExpRunStatus_Success_NotFound
+ };
 diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 --- a/js/src/vm/RegExpObject.cpp
 +++ b/js/src/vm/RegExpObject.cpp
-@@ -47,16 +47,17 @@ using js::frontend::TokenStream;
+@@ -48,16 +48,17 @@ using JS::CompileOptions;
  
  using JS::AutoCheckCannotGC;
  
@@ -640,7 +674,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
      if (!regexp)
          return nullptr;
  
-@@ -126,16 +127,20 @@ RegExpObject::isOriginalFlagGetter(JSNat
+@@ -127,16 +128,20 @@ RegExpObject::isOriginalFlagGetter(JSNat
    if (native == regexp_sticky) {
        *mask = StickyFlag;
        return true;
@@ -661,7 +695,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
  RegExpObject::trace(JSTracer* trc, JSObject* obj)
  {
      obj->as<RegExpObject>().trace(trc);
-@@ -246,17 +251,17 @@ template RegExpObject*
+@@ -247,17 +252,17 @@ template RegExpObject*
  RegExpObject::create(JSContext* cx, const char16_t* chars, size_t length, RegExpFlag flags,
                       LifoAlloc& alloc, NewObjectKind newKind);
  
@@ -680,7 +714,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
  
      regexp->initAndZeroLastIndex(source, flags, cx);
  
-@@ -503,16 +508,18 @@ RegExpObject::toString(JSContext* cx) co
+@@ -504,16 +509,18 @@ RegExpObject::toString(JSContext* cx) co
      if (ignoreCase() && !sb.append('i'))
          return nullptr;
      if (multiline() && !sb.append('m'))
@@ -699,7 +733,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
  /* static */ bool
  RegExpShared::dumpBytecode(JSContext* cx, MutableHandleRegExpShared re, bool match_only,
                             HandleLinearString input)
-@@ -1008,17 +1015,17 @@ RegExpShared::compile(JSContext* cx, Mut
+@@ -1009,17 +1016,17 @@ RegExpShared::compile(JSContext* cx, Mut
      frontend::TokenStream dummyTokenStream(cx, options, nullptr, 0, nullptr);
  
      LifoAllocScope scope(&cx->tempLifoAlloc());
@@ -718,7 +752,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
  
      JitCodeTables tables;
      irregexp::RegExpCode code = irregexp::CompilePattern(cx, re, &data, input,
-@@ -1386,16 +1393,20 @@ ParseRegExpFlags(const CharT* chars, siz
+@@ -1378,16 +1385,20 @@ ParseRegExpFlags(const CharT* chars, siz
              flag = MultilineFlag;
              break;
            case 'y':
@@ -742,7 +776,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
 --- a/js/src/vm/RegExpObject.h
 +++ b/js/src/vm/RegExpObject.h
-@@ -141,16 +141,17 @@ class RegExpObject : public NativeObject
+@@ -139,16 +139,17 @@ class RegExpObject : public NativeObject
          setSlot(FLAGS_SLOT, Int32Value(flags));
      }
  
@@ -763,38 +797,7 @@ diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -39,26 +39,28 @@ using MutableHandleRegExpShared = JS::Mu
- 
- enum RegExpFlag : uint8_t
- {
-     IgnoreCaseFlag  = 0x01,
-     GlobalFlag      = 0x02,
-     MultilineFlag   = 0x04,
-     StickyFlag      = 0x08,
-     UnicodeFlag     = 0x10,
-+    DotAllFlag      = 0x20,
- 
-     NoFlags         = 0x00,
--    AllFlags        = 0x1f
-+    AllFlags        = 0x3f
- };
- 
- static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
-               GlobalFlag == REGEXP_GLOBAL_FLAG &&
-               MultilineFlag == REGEXP_MULTILINE_FLAG &&
-               StickyFlag == REGEXP_STICKY_FLAG &&
--              UnicodeFlag == REGEXP_UNICODE_FLAG,
-+              UnicodeFlag == REGEXP_UNICODE_FLAG &&
-+              DotAllFlag == REGEXP_DOTALL_FLAG,
-               "Flag values should be in sync with self-hosted JS");
- 
- enum RegExpRunStatus
- {
-     RegExpRunStatus_Error,
-     RegExpRunStatus_Success,
-     RegExpRunStatus_Success_NotFound
- };
-@@ -178,16 +180,17 @@ class RegExpShared : public gc::TenuredC
+@@ -153,16 +153,17 @@ class RegExpShared : public gc::TenuredC
  
      JSAtom* getSource() const           { return source; }
      RegExpFlag getFlags() const         { return flags; }

+ 77 - 61
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-04-1539690-68a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690629350 -7200
-# Parent  eb313cf07ce377512ba83c78c0fd20adbce4c235
+# Parent  42fb05fd6f08cadae20273042e7c78ed5be629ba
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
@@ -573,7 +573,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  
  // If disableOOMFunctions is set, disable functionality that causes artificial
  // OOM conditions.
-@@ -4776,17 +4779,17 @@ ParseRegExp(JSContext* cx, unsigned argc
+@@ -4646,17 +4649,17 @@ ParseRegExp(JSContext* cx, unsigned argc
          return false;
      }
  
@@ -592,7 +592,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
          RootedString flagStr(cx, args[1].toString());
          if (!ParseRegExpFlags(cx, flagStr, &flags))
              return false;
-@@ -4805,21 +4808,17 @@ ParseRegExp(JSContext* cx, unsigned argc
+@@ -4675,21 +4678,17 @@ ParseRegExp(JSContext* cx, unsigned argc
      if (!pattern)
          return false;
  
@@ -806,14 +806,14 @@ diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h
  #include "frontend/ErrorReporter.h"
  #include "frontend/TokenKind.h"
  #include "js/CompileOptions.h"
-+#include "js/RegExpFlags.h"
++#include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
  #include "js/UniquePtr.h"
  #include "js/Vector.h"
  #include "util/Text.h"
  #include "util/Unicode.h"
  #include "vm/ErrorReporting.h"
  #include "vm/JSAtom.h"
--#include "vm/RegExpShared.h"
+-#include "vm/RegExpConstants.h"
  #include "vm/StringType.h"
  
  struct JSContext;
@@ -1162,7 +1162,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
  #include "vm/RegExpStatics.h"
  #include "vm/StringType.h"
  #include "vm/TraceLogging.h"
-@@ -1525,17 +1526,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
+@@ -1526,17 +1527,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
      masm.branchPtr(Assembler::Equal, temp1, ImmWord(0), failure);
  
      // ES6 21.2.2.2 step 2.
@@ -1193,7 +1193,7 @@ diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp
  #include "jit/Lowering.h"
  #include "jit/MIR.h"
  #include "jit/MIRGraph.h"
-+#include "js/RegExpFlags.h"
++#include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
  #include "vm/ArgumentsObject.h"
  #include "vm/ArrayBufferObject.h"
  #include "vm/JSObject.h"
@@ -1201,14 +1201,14 @@ diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp
  #include "vm/SelfHosting.h"
  #include "vm/SharedArrayObject.h"
  #include "vm/TypedArrayObject.h"
- 
-@@ -37,16 +38,18 @@
- #include "vm/NativeObject-inl.h"
+ #include "wasm/WasmInstance.h"
+@@ -39,16 +40,18 @@
  #include "vm/StringObject-inl.h"
  #include "vm/UnboxedObject-inl.h"
  
  using mozilla::ArrayLength;
  using mozilla::AssertedCast;
+ using mozilla::Maybe;
  
  using JS::DoubleNaNValue;
 +using JS::RegExpFlag;
@@ -1221,7 +1221,7 @@ diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp
  IonBuilder::InliningResult
  IonBuilder::inlineNativeCall(CallInfo& callInfo, JSFunction* target)
  {
-@@ -412,26 +415,26 @@ IonBuilder::inlineNativeGetter(CallInfo&
+@@ -421,26 +424,26 @@ IonBuilder::inlineNativeGetter(CallInfo&
              return InliningStatus_NotInlined;
  
          MInstruction* length = addTypedArrayLength(thisArg);
@@ -1378,6 +1378,60 @@ diff --git a/js/src/moz.build b/js/src/moz.build
      '../public/SourceBufferHolder.h',
      '../public/StableStringChars.h',
      '../public/Stream.h',
+diff --git a/js/src/vm/RegExpConstants.h b/js/src/vm/RegExpConstants.h
+--- a/js/src/vm/RegExpConstants.h
++++ b/js/src/vm/RegExpConstants.h
+@@ -1,44 +1,22 @@
+-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+- * vim: set ts=8 sts=4 et sw=4 tw=99:
++/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
++ * vim: set ts=8 sts=2 et sw=2 tw=80:
+  * This Source Code Form is subject to the terms of the Mozilla Public
+  * 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 vm_RegExpConstants_h
+ #define vm_RegExpConstants_h
+ 
+ #include "builtin/SelfHostingDefines.h"
+ 
+ namespace js {
+ 
+-enum RegExpFlag : uint8_t
+-{
+-    IgnoreCaseFlag  = 0x01,
+-    GlobalFlag      = 0x02,
+-    MultilineFlag   = 0x04,
+-    StickyFlag      = 0x08,
+-    UnicodeFlag     = 0x10,
+-    DotAllFlag      = 0x20,
+-
+-    NoFlags         = 0x00,
+-    AllFlags        = 0x3f
+-};
+-
+-static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
+-              GlobalFlag == REGEXP_GLOBAL_FLAG &&
+-              MultilineFlag == REGEXP_MULTILINE_FLAG &&
+-              StickyFlag == REGEXP_STICKY_FLAG &&
+-              UnicodeFlag == REGEXP_UNICODE_FLAG &&
+-              DotAllFlag == REGEXP_DOTALL_FLAG,
+-              "Flag values should be in sync with self-hosted JS");
+-
+-enum RegExpRunStatus
+-{
+-    RegExpRunStatus_Error,
+-    RegExpRunStatus_Success,
+-    RegExpRunStatus_Success_NotFound
++enum RegExpRunStatus {
++  RegExpRunStatus_Error,
++  RegExpRunStatus_Success,
++  RegExpRunStatus_Success_NotFound
+ };
+ 
+ } /* namespace js */
+ 
+ #endif /* vm_RegExpConstants_h */
 diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 --- a/js/src/vm/RegExpObject.cpp
 +++ b/js/src/vm/RegExpObject.cpp
@@ -2032,63 +2086,25 @@ diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -16,16 +16,17 @@
+@@ -15,16 +15,17 @@
+ #include "mozilla/Assertions.h"
  #include "mozilla/MemoryReporting.h"
  
- #include "builtin/SelfHostingDefines.h"
  #include "gc/Barrier.h"
  #include "gc/Heap.h"
  #include "gc/Marking.h"
  #include "gc/Zone.h"
  #include "js/AllocPolicy.h"
-+#include "js/RegExpFlags.h"
++#include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
  #include "js/UbiNode.h"
  #include "js/Vector.h"
  #include "vm/ArrayObject.h"
  #include "vm/JSAtom.h"
+ #include "vm/RegExpConstants.h"
  
  namespace js {
  
- class ArrayObject;
-@@ -33,37 +34,16 @@ class RegExpRealm;
- class RegExpShared;
- class RegExpStatics;
- class VectorMatchPairs;
- 
- using RootedRegExpShared = JS::Rooted<RegExpShared*>;
- using HandleRegExpShared = JS::Handle<RegExpShared*>;
- using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
- 
--enum RegExpFlag : uint8_t
--{
--    IgnoreCaseFlag  = 0x01,
--    GlobalFlag      = 0x02,
--    MultilineFlag   = 0x04,
--    StickyFlag      = 0x08,
--    UnicodeFlag     = 0x10,
--    DotAllFlag      = 0x20,
--
--    NoFlags         = 0x00,
--    AllFlags        = 0x3f
--};
--
--static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
--              GlobalFlag == REGEXP_GLOBAL_FLAG &&
--              MultilineFlag == REGEXP_MULTILINE_FLAG &&
--              StickyFlag == REGEXP_STICKY_FLAG &&
--              UnicodeFlag == REGEXP_UNICODE_FLAG &&
--              DotAllFlag == REGEXP_DOTALL_FLAG,
--              "Flag values should be in sync with self-hosted JS");
--
- enum RegExpRunStatus
- {
-     RegExpRunStatus_Error,
-     RegExpRunStatus_Success,
-     RegExpRunStatus_Success_NotFound
- };
- 
- /*
-@@ -113,17 +93,17 @@ class RegExpShared : public gc::TenuredC
+@@ -85,17 +86,17 @@ class RegExpShared : public gc::TenuredC
          bool compiled(ForceByteCodeEnum force = DontForceByteCode) const {
              return byteCode || (force == DontForceByteCode && jitCode);
          }
@@ -2098,7 +2114,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      GCPtr<JSAtom*>     source;
  
 -    RegExpFlag         flags;
-+    JS::RegExpFlags    flags;
++    JS::RegExpFlags flags;
      bool               canStringMatch;
      size_t             parenCount;
  
@@ -2107,7 +2123,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      static int CompilationIndex(CompilationMode mode, bool latin1) {
          switch (mode) {
            case Normal:    return latin1 ? 0 : 1;
-@@ -131,17 +111,17 @@ class RegExpShared : public gc::TenuredC
+@@ -103,17 +104,17 @@ class RegExpShared : public gc::TenuredC
          }
          MOZ_CRASH();
      }
@@ -2126,7 +2142,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  
      static bool compileIfNecessary(JSContext* cx, MutableHandleRegExpShared res,
                                     HandleLinearString input, CompilationMode mode,
-@@ -175,23 +155,24 @@ class RegExpShared : public gc::TenuredC
+@@ -147,23 +148,24 @@ class RegExpShared : public gc::TenuredC
          MOZ_ASSERT(isCompiled());
          return parenCount;
      }
@@ -2158,7 +2174,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      bool isCompiled() const {
          return isCompiled(Normal, true) || isCompiled(Normal, false)
              || isCompiled(MatchOnly, true) || isCompiled(MatchOnly, false);
-@@ -229,38 +210,34 @@ class RegExpShared : public gc::TenuredC
+@@ -201,38 +203,34 @@ class RegExpShared : public gc::TenuredC
  #ifdef DEBUG
      static bool dumpBytecode(JSContext* cx, MutableHandleRegExpShared res, bool match_only,
                               HandleLinearString input);
@@ -2206,7 +2222,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
       * that was not marked is deleted and removed from the set.
       */
      using Set = JS::WeakCache<JS::GCHashSet<ReadBarriered<RegExpShared*>, Key, ZoneAllocPolicy>>;
-@@ -270,22 +247,22 @@ class RegExpZone
+@@ -242,22 +240,22 @@ class RegExpZone
      explicit RegExpZone(Zone* zone);
  
      ~RegExpZone() {
@@ -2336,7 +2352,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
  //
  // Note that SCTAG_END_OF_KEYS is written into the serialized form and should have
  // a stable ID, it need not be at the end of the list and should not be used for
-@@ -1680,17 +1684,17 @@ JSStructuredCloneWriter::startWrite(Hand
+@@ -1682,17 +1686,17 @@ JSStructuredCloneWriter::startWrite(Hand
              if (!Unbox(context(), obj, &unboxed))
                  return false;
              return out.writePair(SCTAG_BOOLEAN_OBJECT, unboxed.toBoolean());
@@ -2355,7 +2371,7 @@ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
              break;
            }
            case ESClass::SharedArrayBuffer:
-@@ -2409,17 +2413,17 @@ JSStructuredCloneReader::startRead(Mutab
+@@ -2410,17 +2414,17 @@ JSStructuredCloneReader::startRead(Mutab
          JSObject* obj = NewDateObjectMsec(context(), t);
          if (!obj)
              return false;

+ 29 - 29
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-09-1627356-77a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690629743 -7200
-# Parent  d4d4f6fe8996641c898d849541d9f247aebc6a72
+# Parent  90ef29d4fb35e6c6e338cb626ba7589731fe6fbf
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 hawkeye116477 <hawkeye116477@gmail.com>
@@ -12,7 +12,7 @@ MatchOnly mode is a hack. Instead of rewriting it for our new irregexp import, I
 diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
 --- a/js/src/builtin/RegExp.cpp
 +++ b/js/src/builtin/RegExp.cpp
-@@ -125,29 +125,29 @@ CreateRegExpSearchResult(const MatchPair
+@@ -126,29 +126,29 @@ CreateRegExpSearchResult(const MatchPair
      return position | (lastIndex << 15);
  }
  
@@ -51,7 +51,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
  /* Legacy ExecuteRegExp behavior is baked into the JSAPI. */
  bool
  js::ExecuteRegExpLegacy(JSContext* cx, RegExpStatics* res, Handle<RegExpObject*> reobj,
-@@ -156,17 +156,17 @@ js::ExecuteRegExpLegacy(JSContext* cx, R
+@@ -157,17 +157,17 @@ js::ExecuteRegExpLegacy(JSContext* cx, R
  {
      RootedRegExpShared shared(cx, RegExpObject::getShared(cx, reobj));
      if (!shared)
@@ -70,7 +70,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
          rval.setNull();
          return true;
      }
-@@ -941,17 +941,17 @@ IsTrailSurrogateWithLeadSurrogate(Handle
+@@ -942,17 +942,17 @@ IsTrailSurrogateWithLeadSurrogate(Handle
  }
  
  /*
@@ -89,7 +89,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
       */
  
      /* Steps 1-2 performed by the caller. */
-@@ -998,17 +998,17 @@ ExecuteRegExp(JSContext* cx, HandleObjec
+@@ -999,17 +999,17 @@ ExecuteRegExp(JSContext* cx, HandleObjec
           * However, the spec will change to match our implementation's
           * behavior. See https://github.com/tc39/ecma262/issues/128.
           */
@@ -108,7 +108,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
      return status;
  }
  
-@@ -1019,17 +1019,17 @@ ExecuteRegExp(JSContext* cx, HandleObjec
+@@ -1020,17 +1020,17 @@ ExecuteRegExp(JSContext* cx, HandleObjec
  static bool
  RegExpMatcherImpl(JSContext* cx, HandleObject regexp, HandleString string, int32_t lastIndex,
                    MutableHandleValue rval)
@@ -127,7 +127,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
          rval.setNull();
          return true;
      }
-@@ -1090,17 +1090,17 @@ js::RegExpMatcherRaw(JSContext* cx, Hand
+@@ -1091,17 +1091,17 @@ js::RegExpMatcherRaw(JSContext* cx, Hand
  static bool
  RegExpSearcherImpl(JSContext* cx, HandleObject regexp, HandleString string, int32_t lastIndex,
                     int32_t* result)
@@ -146,7 +146,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
          *result = -1;
          return true;
      }
-@@ -1172,47 +1172,46 @@ js::RegExpTester(JSContext* cx, unsigned
+@@ -1173,47 +1173,46 @@ js::RegExpTester(JSContext* cx, unsigned
  
      RootedObject regexp(cx, &args[0].toObject());
      RootedString string(cx, args[1].toString());
@@ -204,7 +204,7 @@ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
 diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
 --- a/js/src/builtin/TestingFunctions.cpp
 +++ b/js/src/builtin/TestingFunctions.cpp
-@@ -4849,38 +4849,29 @@ DisRegExp(JSContext* cx, unsigned argc, 
+@@ -4711,38 +4711,29 @@ DisRegExp(JSContext* cx, unsigned argc, 
  
      if (!args[0].isObject() || !args[0].toObject().is<RegExpObject>()) {
          ReportUsageErrorASCII(cx, callee, "First argument must be a RegExp");
@@ -248,7 +248,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  #endif  // DEBUG && !JS_NEW_REGEXP
  
  static bool
-@@ -5956,17 +5947,17 @@ gc::ZealModeHelpText),
+@@ -5936,17 +5927,17 @@ gc::ZealModeHelpText),
  
  static const JSFunctionSpecWithHelp FuzzingUnsafeTestingFunctions[] = {
  #if defined(DEBUG) && !defined(JS_NEW_REGEXP)
@@ -270,7 +270,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
 diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 --- a/js/src/jit/CodeGenerator.cpp
 +++ b/js/src/jit/CodeGenerator.cpp
-@@ -1389,47 +1389,39 @@ RegExpPairCountAddress(MacroAssembler& m
+@@ -1432,47 +1432,39 @@ RegExpPairCountAddress(MacroAssembler& m
  }
  
  #ifdef JS_NEW_REGEXP
@@ -332,7 +332,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
       *
       * inputOutputDataStartOffset +-----> +---------------+
       *                                    |InputOutputData|
-@@ -1477,42 +1469,38 @@ PrepareAndExecuteRegExp(JSContext* cx, M
+@@ -1520,42 +1512,38 @@ PrepareAndExecuteRegExp(JSContext* cx, M
      Address matchResultAddress(masm.getStackPointer(),
          inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, result));
  
@@ -396,7 +396,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
      masm.loadPtr(Address(regexp, NativeObject::getFixedSlotOffset(RegExpObject::PRIVATE_SLOT)), temp1);
      masm.branchPtr(Assembler::Equal, temp1, ImmWord(0), failure);
  
-@@ -1566,68 +1554,63 @@ PrepareAndExecuteRegExp(JSContext* cx, M
+@@ -1609,68 +1597,63 @@ PrepareAndExecuteRegExp(JSContext* cx, M
          masm.branch32(Assembler::NotEqual, temp3, Imm32(unicode::LeadSurrogateMin), &done);
  
          // Move lastIndex to lead surrogate.
@@ -481,7 +481,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
      if (lastIndex.volatile_())
          volatileRegs.add(lastIndex);
      if (input.volatile_())
-@@ -1702,21 +1685,16 @@ PrepareAndExecuteRegExp(JSContext* cx, M
+@@ -1745,21 +1728,16 @@ PrepareAndExecuteRegExp(JSContext* cx, M
      masm.store32(Imm32(1), Address(temp1, RegExpStatics::offsetOfPendingLazyEvaluation()));
  
      masm.loadPtr(Address(regexp, NativeObject::getFixedSlotOffset(RegExpObject::PRIVATE_SLOT)), temp2);
@@ -503,7 +503,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
  static void
  CopyStringChars(MacroAssembler& masm, Register to, Register from, Register len,
                  Register byteOpScratch, CharEncoding encoding);
-@@ -2023,23 +2001,27 @@ JitRealm::generateRegExpMatcherStub(JSCo
+@@ -2066,23 +2044,27 @@ JitRealm::generateRegExpMatcherStub(JSCo
  
      // The template object should have enough space for the maximum number of
      // pairs this stub can handle.
@@ -532,7 +532,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
      Register object = temp1;
      Label matchResultFallback, matchResultJoin;
      masm.createGCObject(object, temp2, templateObj, gc::DefaultHeap, &matchResultFallback);
-@@ -2334,24 +2316,27 @@ JitRealm::generateRegExpSearcherStub(JSC
+@@ -2377,24 +2359,27 @@ JitRealm::generateRegExpSearcherStub(JSC
      regs.take(lastIndex);
  
      Register temp1 = regs.takeAny();
@@ -562,7 +562,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
       * [SMDOC] Stack layout for the RegExpSearcher stub
       *
       *                                    +---------------+
-@@ -2520,42 +2505,50 @@ JitRealm::generateRegExpTesterStub(JSCon
+@@ -2563,42 +2548,50 @@ JitRealm::generateRegExpTesterStub(JSCon
      regs.take(input);
      regs.take(regexp);
      regs.take(lastIndex);
@@ -622,7 +622,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 --- a/js/src/vm/RegExpObject.cpp
 +++ b/js/src/vm/RegExpObject.cpp
-@@ -539,24 +539,22 @@ RegExpObject::toString(JSContext* cx) co
+@@ -543,24 +543,22 @@ RegExpObject::toString(JSContext* cx) co
      if (dotAll() && !sb.append('s'))
          return nullptr;
  
@@ -650,7 +650,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
      };
  
      auto Load16Aligned = [](const uint8_t* pc) -> int32_t {
-@@ -922,24 +920,23 @@ RegExpShared::dumpBytecode(JSContext* cx
+@@ -926,24 +924,23 @@ RegExpShared::dumpBytecode(JSContext* cx
  #undef STOP
  #undef JUMP
  #undef BRANCH
@@ -677,7 +677,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
  IsRegExpMetaChar(CharT ch)
  {
      switch (ch) {
-@@ -1013,105 +1010,100 @@ RegExpShared::finalize(FreeOp* fop)
+@@ -1017,105 +1014,100 @@ RegExpShared::finalize(FreeOp* fop)
  {
      for (auto& comp : compilationArray)
          js_free(comp.byteCode);
@@ -789,7 +789,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
          for (size_t i = 0; i < tables.length(); i++) {
              if (!re->addTable(std::move(tables[i]))) {
                  ReportOutOfMemory(cx);
-@@ -1126,47 +1118,42 @@ RegExpShared::compile(JSContext* cx,
+@@ -1130,47 +1122,42 @@ RegExpShared::compile(JSContext* cx,
  
      return true;
  }
@@ -843,7 +843,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
  
      // Reset the Irregexp backtrack stack if it grows during execution.
      irregexp::RegExpStackScope stackScope(cx);
-@@ -1176,57 +1163,51 @@ RegExpShared::execute(JSContext* cx,
+@@ -1180,57 +1167,51 @@ RegExpShared::execute(JSContext* cx,
          size_t sourceLength = re->source->length();
          if (re->sticky()) {
              // First part checks size_t overflow.
@@ -912,7 +912,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
              // interrupt guard failed. If CheckOverRecursed doesn't throw, break
              // out and retry the regexp in the bytecode interpreter, which can
              // execute while tolerating future interrupts. Otherwise, if we keep
-@@ -1236,42 +1217,41 @@ RegExpShared::execute(JSContext* cx,
+@@ -1240,42 +1221,41 @@ RegExpShared::execute(JSContext* cx,
              break;
          }
  
@@ -964,7 +964,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
 --- a/js/src/vm/RegExpObject.h
 +++ b/js/src/vm/RegExpObject.h
-@@ -172,18 +172,19 @@ class RegExpObject : public NativeObject
+@@ -170,18 +170,19 @@ class RegExpObject : public NativeObject
      void initIgnoringLastIndex(JSAtom* source, JS::RegExpFlags flags);
  
      // NOTE: This method is *only* safe to call on RegExps that haven't been
@@ -989,7 +989,7 @@ diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -60,21 +60,16 @@ enum RegExpRunStatus
+@@ -59,21 +59,16 @@ enum RegExpRunStatus {
   * than explicitly tracing them, so that the RegExpShared and any jitcode can
   * be reclaimed quicker. However, the RegExpShareds are traced through by
   * objects when we are preserving jitcode in their zone, to avoid the same
@@ -1011,12 +1011,12 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      using JitCodeTable = UniquePtr<uint8_t[], JS::FreePolicy>;
      using JitCodeTables = Vector<JitCodeTable, 0, SystemAllocPolicy>;
  
-@@ -96,57 +91,56 @@ class RegExpShared : public gc::TenuredC
+@@ -95,57 +90,56 @@ class RegExpShared : public gc::TenuredC
  
      /* Source to the RegExp, for lazy compilation. */
      GCPtr<JSAtom*>     source;
  
-     JS::RegExpFlags    flags;
+     JS::RegExpFlags flags;
      bool               canStringMatch;
      size_t             parenCount;
  
@@ -1089,7 +1089,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  
      /* Accessors */
  
-@@ -163,24 +157,21 @@ class RegExpShared : public gc::TenuredC
+@@ -162,24 +156,21 @@ class RegExpShared : public gc::TenuredC
  
      bool global() const                 { return flags.global(); }
      bool ignoreCase() const             { return flags.ignoreCase(); }
@@ -1117,7 +1117,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      static size_t offsetOfSource() {
          return offsetof(RegExpShared, source);
      }
-@@ -188,31 +179,28 @@ class RegExpShared : public gc::TenuredC
+@@ -187,31 +178,28 @@ class RegExpShared : public gc::TenuredC
      static size_t offsetOfFlags() {
          return offsetof(RegExpShared, flags);
      }

+ 9 - 9
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-10-1627838-77a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690629756 -7200
-# Parent  eb9fde5268b50729c94797c19ab5cda7e17757df
+# Parent  f3954186bfb5ca28e43c7235985e875d8aa3651b
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 hawkeye116477 <hawkeye116477@gmail.com>
@@ -179,7 +179,7 @@ diff --git a/js/src/new-regexp/RegExpAPI.h b/js/src/new-regexp/RegExpAPI.h
 diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 --- a/js/src/vm/RegExpObject.cpp
 +++ b/js/src/vm/RegExpObject.cpp
-@@ -975,29 +975,41 @@ js::StringHasRegExpMetaChars(JSLinearStr
+@@ -979,29 +979,41 @@ js::StringHasRegExpMetaChars(JSLinearStr
          return HasRegExpMetaChars(str->latin1Chars(nogc), str->length());
  
      return HasRegExpMetaChars(str->twoByteChars(nogc), str->length());
@@ -222,7 +222,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
      for (auto& comp : compilationArray)
          comp.jitCode = nullptr;
  
-@@ -1036,30 +1048,70 @@ RegExpShared::compile(JSContext* cx,
+@@ -1040,30 +1052,70 @@ RegExpShared::compile(JSContext* cx,
  }
  /* static */
  bool
@@ -295,7 +295,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
                        ForceByteCodeEnum force)
  {
      if (!re->ignoreCase() && !StringHasRegExpMetaChars(pattern))
-@@ -1154,43 +1206,17 @@ RegExpShared::execute(JSContext* cx,
+@@ -1158,43 +1210,17 @@ RegExpShared::execute(JSContext* cx,
      }
  
      size_t length = input->length();
@@ -340,7 +340,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
              break;
  
          RegExpRunStatus result;
-@@ -1245,17 +1271,58 @@ RegExpShared::execute(JSContext* cx,
+@@ -1249,17 +1275,58 @@ RegExpShared::execute(JSContext* cx,
          const char16_t* chars = inputChars.twoByteRange().begin().get();
          result = irregexp::InterpretCode(cx, byteCode, chars, start, length, matches, /*endIndex = */ nullptr);
      }
@@ -403,7 +403,7 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -65,16 +65,23 @@ enum RegExpRunStatus
+@@ -64,16 +64,23 @@ enum RegExpRunStatus {
  class RegExpShared : public gc::TenuredCell
  {
    public:
@@ -427,7 +427,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      friend class RegExpZone;
  
      struct RegExpCompilation
-@@ -88,17 +95,24 @@ class RegExpShared : public gc::TenuredC
+@@ -87,17 +94,24 @@ class RegExpShared : public gc::TenuredC
              return byteCode || (force == DontForceByteCode && jitCode);
          }
      };
@@ -435,7 +435,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      /* Source to the RegExp, for lazy compilation. */
      GCPtr<JSAtom*>     source;
  
-     JS::RegExpFlags    flags;
+     JS::RegExpFlags flags;
 -    bool               canStringMatch;
 +
 +#ifdef JS_NEW_REGEXP
@@ -453,7 +453,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  
      // Tables referenced by JIT code.
      JitCodeTables tables;
-@@ -127,37 +141,61 @@ class RegExpShared : public gc::TenuredC
+@@ -126,37 +140,61 @@ class RegExpShared : public gc::TenuredC
  
      RegExpCompilation& compilation(bool latin1) {
          return compilationArray[CompilationIndex(latin1)];

+ 16 - 18
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-12-1628835-77a1-25318.patch

@@ -1,13 +1,13 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690629791 -7200
-# Parent  fc8dac371e89ddc3af3fc0c1e08cf3810e8c7f25
+# Parent  0736545ea8f77dabe8a74239489d5937381b6f7c
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 --- a/js/src/jit/CodeGenerator.cpp
 +++ b/js/src/jit/CodeGenerator.cpp
-@@ -1597,21 +1597,20 @@ static bool PrepareAndExecuteRegExp(JSCo
+@@ -1598,21 +1598,20 @@ static bool PrepareAndExecuteRegExp(JSCo
  
          // Move lastIndex to lead surrogate.
          masm.sub32(Imm32(1), lastIndex);
@@ -498,13 +498,13 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -19,36 +19,39 @@
+@@ -18,35 +18,38 @@
  #include "gc/Barrier.h"
  #include "gc/Heap.h"
  #include "gc/Marking.h"
  #include "gc/Zone.h"
  #include "js/AllocPolicy.h"
- #include "js/RegExpFlags.h"
+ #include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
  #include "js/UbiNode.h"
  #include "js/Vector.h"
 +#ifdef JS_NEW_REGEXP
@@ -525,16 +525,14 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  using HandleRegExpShared = JS::Handle<RegExpShared*>;
  using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
  
--enum RegExpRunStatus
--{
--    RegExpRunStatus_Error,
--    RegExpRunStatus_Success,
--    RegExpRunStatus_Success_NotFound
-+enum RegExpRunStatus : int32_t
-+ {
-+    RegExpRunStatus_Error = -1,
-+    RegExpRunStatus_Success = 1,
-+    RegExpRunStatus_Success_NotFound = 0,
+-enum RegExpRunStatus {
+-  RegExpRunStatus_Error,
+-  RegExpRunStatus_Success,
+-  RegExpRunStatus_Success_NotFound
++enum RegExpRunStatus : int32_t {
++  RegExpRunStatus_Error = -1,
++  RegExpRunStatus_Success = 1,
++  RegExpRunStatus_Success_NotFound = 0,
  };
  
  /*
@@ -543,7 +541,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
   * have pointers to RegExpShareds on the stack. The RegExpShareds are kept in a
   * table so that they can be reused when compiling the same regex string.
   *
-@@ -73,48 +76,55 @@ class RegExpShared : public gc::TenuredC
+@@ -71,48 +74,55 @@ class RegExpShared : public gc::TenuredC
  
      enum class Kind
      {
@@ -581,7 +579,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      /* Source to the RegExp, for lazy compilation. */
      GCPtr<JSAtom*>     source;
  
-     JS::RegExpFlags    flags;
+     JS::RegExpFlags flags;
  
  #ifdef JS_NEW_REGEXP
      RegExpShared::Kind kind_ = Kind::Unparsed;
@@ -601,7 +599,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      // Tables referenced by JIT code.
      JitCodeTables tables;
  
-@@ -160,34 +170,46 @@ class RegExpShared : public gc::TenuredC
+@@ -158,34 +168,46 @@ class RegExpShared : public gc::TenuredC
  
      // Register a table with this RegExpShared, and take ownership.
      bool addTable(JitCodeTable table) {
@@ -653,7 +651,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  #else
      JSAtom* patternAtom() const { return getSource(); }
  #endif
-@@ -214,18 +236,18 @@ class RegExpShared : public gc::TenuredC
+@@ -212,18 +234,18 @@ class RegExpShared : public gc::TenuredC
      static size_t offsetOfSource() {
          return offsetof(RegExpShared, source);
      }

+ 16 - 16
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-14-1629670-77a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690629932 -7200
-# Parent  c3f133dc7e5a24322d684f903d4bd62953638183
+# Parent  d9dcba7bfe8df2d088f245e8debddda776aef6a9
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 Iain Ireland <iireland@mozilla.com>
@@ -508,31 +508,31 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -15,16 +15,17 @@
+@@ -14,16 +14,17 @@
+ 
  #include "mozilla/Assertions.h"
  #include "mozilla/MemoryReporting.h"
  
- #include "builtin/SelfHostingDefines.h"
  #include "gc/Barrier.h"
  #include "gc/Heap.h"
  #include "gc/Marking.h"
  #include "gc/Zone.h"
 +#include "jit/JitOptions.h"
  #include "js/AllocPolicy.h"
- #include "js/RegExpFlags.h"
+ #include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
  #include "js/UbiNode.h"
  #include "js/Vector.h"
  #ifdef JS_NEW_REGEXP
  #  include "new-regexp/RegExpTypes.h"
  #endif
  #include "vm/ArrayObject.h"
-@@ -44,16 +45,27 @@ using MutableHandleRegExpShared = JS::Mu
+@@ -42,16 +43,27 @@ using HandleRegExpShared = JS::Handle<Re
+ using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
  
- enum RegExpRunStatus : int32_t
-  {
-     RegExpRunStatus_Error = -1,
-     RegExpRunStatus_Success = 1,
-     RegExpRunStatus_Success_NotFound = 0,
+ enum RegExpRunStatus : int32_t {
+   RegExpRunStatus_Error = -1,
+   RegExpRunStatus_Success = 1,
+   RegExpRunStatus_Success_NotFound = 0,
  };
  
 +#ifdef JS_NEW_REGEXP
@@ -554,7 +554,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
   *
   * To save memory, a RegExpShared is not created for a RegExpObject until it is
   * needed for execution. When a RegExpShared needs to be created, it is looked
-@@ -64,28 +76,30 @@ enum RegExpRunStatus : int32_t
+@@ -62,28 +74,30 @@ enum RegExpRunStatus : int32_t {
   * than explicitly tracing them, so that the RegExpShared and any jitcode can
   * be reclaimed quicker. However, the RegExpShareds are traced through by
   * objects when we are preserving jitcode in their zone, to avoid the same
@@ -590,7 +590,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      using JitCodeTable = UniquePtr<uint8_t[], JS::FreePolicy>;
  #endif
      using JitCodeTables = Vector<JitCodeTable, 0, SystemAllocPolicy>;
-@@ -96,30 +110,40 @@ class RegExpShared : public gc::TenuredC
+@@ -94,30 +108,40 @@ class RegExpShared : public gc::TenuredC
  
      struct RegExpCompilation
      {
@@ -618,7 +618,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      /* Source to the RegExp, for lazy compilation. */
      GCPtr<JSAtom*>     source;
  
-     JS::RegExpFlags    flags;
+     JS::RegExpFlags flags;
  
  #ifdef JS_NEW_REGEXP
      RegExpShared::Kind kind_ = Kind::Unparsed;
@@ -633,7 +633,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  
      RegExpCompilation  compilationArray[2];
  
-@@ -129,27 +153,27 @@ class RegExpShared : public gc::TenuredC
+@@ -127,27 +151,27 @@ class RegExpShared : public gc::TenuredC
      JitCodeTables tables;
  
      /* Internal functions. */
@@ -664,7 +664,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      RegExpCompilation& compilation(bool latin1) {
          return compilationArray[CompilationIndex(latin1)];
      }
-@@ -188,22 +212,31 @@ class RegExpShared : public gc::TenuredC
+@@ -186,22 +210,31 @@ class RegExpShared : public gc::TenuredC
    RegExpShared::Kind kind() const { return kind_; }
  
    // Use simple string matching for this regexp.
@@ -696,7 +696,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  #endif
  
      JSAtom* getSource() const           { return source; }
-@@ -218,19 +251,19 @@ class RegExpShared : public gc::TenuredC
+@@ -216,19 +249,19 @@ class RegExpShared : public gc::TenuredC
  
      bool global() const                 { return flags.global(); }
      bool ignoreCase() const             { return flags.ignoreCase(); }

+ 38 - 35
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-37-1642493-79a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690631112 -7200
-# Parent  4bb09b13e74eea22ee97468c999c90385a51f5db
+# Parent  92e4360ccd7e57de95b6cc87c6ebe7d04fad771a
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 diff --git a/.clang-format-ignore b/.clang-format-ignore
@@ -230,7 +230,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  #include "js/AutoByteString.h"
  #include "js/CompilationAndEvaluation.h"
  #include "js/CompileOptions.h"
-@@ -4507,370 +4502,16 @@ GetModuleEnvironmentValue(JSContext* cx,
+@@ -4377,370 +4372,16 @@ GetModuleEnvironmentValue(JSContext* cx,
      if (args.rval().isMagic(JS_UNINITIALIZED_LEXICAL)) {
          ReportRuntimeLexicalError(cx, JSMSG_UNINITIALIZED_LEXICAL, id);
          return false;
@@ -601,7 +601,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  
      if (args.length() != 0) {
          ReportUsageErrorASCII(cx, callee, "Wrong number of arguments");
-@@ -6049,26 +5690,16 @@ gc::ZealModeHelpText),
+@@ -5921,26 +5562,16 @@ gc::ZealModeHelpText),
  "    baselineCompile();  for (var i=0; i<1; i++) {} ...\n"
  "  The interpreter will enter the new jitcode at the loop header unless\n"
  "  baselineCompile returned a string or threw an error.\n"),
@@ -23890,7 +23890,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
  #include "vm/RegExpStatics.h"
  #include "vm/StringType.h"
  #include "vm/TraceLogging.h"
-@@ -1543,18 +1538,16 @@ static void UpdateRegExpStatics(MacroAss
+@@ -1544,18 +1539,16 @@ static void UpdateRegExpStatics(MacroAss
                                     RegExpObject::PRIVATE_SLOT)),
                 temp1);
    masm.loadPtr(Address(temp1, RegExpShared::offsetOfSource()), temp2);
@@ -23909,7 +23909,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
                                      Register regexp, Register input,
                                      Register lastIndex, Register temp1,
                                      Register temp2, Register temp3,
-@@ -1754,216 +1747,16 @@ static bool PrepareAndExecuteRegExp(JSCo
+@@ -1755,216 +1748,16 @@ static bool PrepareAndExecuteRegExp(JSCo
    }
    masm.movePtr(ImmPtr(res), temp1);
    UpdateRegExpStatics(masm, regexp, input, lastIndex, temp1, temp2, temp3,
@@ -24126,7 +24126,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
  {
      CharEncoding encoding_;
      Register string_;
-@@ -2280,27 +2073,25 @@ JitRealm::generateRegExpMatcherStub(JSCo
+@@ -2281,27 +2074,25 @@ JitRealm::generateRegExpMatcherStub(JSCo
      Label notFound, oolEntry;
      if (!PrepareAndExecuteRegExp(cx, masm, regexp, input, lastIndex,
                                   temp1, temp2, temp3, inputOutputDataStartOffset,
@@ -24154,7 +24154,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
      masm.bind(&matchResultJoin);
  
      // Initialize slots of result object.
-@@ -2315,21 +2106,19 @@ JitRealm::generateRegExpMatcherStub(JSCo
+@@ -2316,21 +2107,19 @@ JitRealm::generateRegExpMatcherStub(JSCo
                  
      // Initialize the slots of the result object with the dummy values
      // defined in createMatchResultTemplateObject.
@@ -41925,7 +41925,7 @@ deleted file mode 100644
 diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
 --- a/js/src/shell/js.cpp
 +++ b/js/src/shell/js.cpp
-@@ -8890,22 +8890,20 @@ SetContextOptions(JSContext* cx, const O
+@@ -8892,22 +8892,20 @@ SetContextOptions(JSContext* cx, const O
      int32_t warmUpThreshold = op.getIntOption("ion-warmup-threshold");
      if (warmUpThreshold >= 0)
          jit::JitOptions.setCompilerWarmUpThreshold(warmUpThreshold);
@@ -41948,7 +41948,7 @@ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
          jit::JitOptions.forcedRegisterAllocator = jit::LookupRegisterAllocator(str);
          if (!jit::JitOptions.forcedRegisterAllocator.isSome())
              return OptionFailure("ion-regalloc", str);
-@@ -9265,23 +9263,21 @@ main(int argc, char** argv, char** envp)
+@@ -9267,23 +9265,21 @@ main(int argc, char** argv, char** envp)
          || !op.addBoolOption('\0', "test-wasm-await-tier2", "Forcibly activate tiering and block "
                                     "instantiation on completion of tier2")
  #ifdef ENABLE_WASM_GC
@@ -42960,11 +42960,11 @@ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
 diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
-@@ -15,24 +15,22 @@
+@@ -14,24 +14,22 @@
+ 
  #include "mozilla/Assertions.h"
  #include "mozilla/MemoryReporting.h"
  
- #include "builtin/SelfHostingDefines.h"
  #include "gc/Barrier.h"
  #include "gc/Heap.h"
  #include "gc/Marking.h"
@@ -42972,8 +42972,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 +#include "irregexp/RegExpTypes.h"
  #include "jit/JitOptions.h"
  #include "js/AllocPolicy.h"
--#include "js/RegExpFlags.h"
-+#include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
+ #include "js/RegExpFlags.h"  // JS::RegExpFlag, JS::RegExpFlags
  #include "js/UbiNode.h"
  #include "js/Vector.h"
 -#ifdef JS_NEW_REGEXP
@@ -42987,13 +42986,13 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  class ArrayObject;
  class RegExpRealm;
  class RegExpShared;
-@@ -45,26 +43,23 @@ using MutableHandleRegExpShared = JS::Mu
+@@ -43,26 +41,23 @@ using HandleRegExpShared = JS::Handle<Re
+ using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
  
- enum RegExpRunStatus : int32_t
-  {
-     RegExpRunStatus_Error = -1,
-     RegExpRunStatus_Success = 1,
-     RegExpRunStatus_Success_NotFound = 0,
+ enum RegExpRunStatus : int32_t {
+   RegExpRunStatus_Error = -1,
+   RegExpRunStatus_Success = 1,
+   RegExpRunStatus_Success_NotFound = 0,
  };
  
 -#ifdef JS_NEW_REGEXP
@@ -43017,7 +43016,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
   * table so that they can be reused when compiling the same regex string.
   *
   * To save memory, a RegExpShared is not created for a RegExpObject until it is
-@@ -90,23 +85,18 @@ class RegExpShared : public gc::TenuredC
+@@ -88,23 +83,18 @@ class RegExpShared : public gc::TenuredC
  
      enum class CodeKind
      {
@@ -43041,32 +43040,36 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
  
      struct RegExpCompilation
      {
-@@ -129,30 +119,24 @@ class RegExpShared : public gc::TenuredC
+@@ -125,32 +115,25 @@ class RegExpShared : public gc::TenuredC
+             }
+             MOZ_CRASH("Unreachable");
          }
      };
  
      /* Source to the RegExp, for lazy compilation. */
      GCPtr<JSAtom*>     source;
  
-     JS::RegExpFlags    flags;
+-    JS::RegExpFlags flags;
++  JS::RegExpFlags flags;
  
 -#ifdef JS_NEW_REGEXP
-     RegExpShared::Kind kind_ = Kind::Unparsed;
-     GCPtrAtom patternAtom_;
-     uint32_t maxRegisters_ = 0;
-     uint32_t ticks_ = 0;
+-    RegExpShared::Kind kind_ = Kind::Unparsed;
+-    GCPtrAtom patternAtom_;
+-    uint32_t maxRegisters_ = 0;
+-    uint32_t ticks_ = 0;
 -#else
 -    bool canStringMatch = false;
 -#endif
- 
+-
 -#ifdef JS_NEW_REGEXP
--  uint32_t numNamedCaptures_ = {};
--  uint32_t* namedCaptureIndices_ = {};
--  GCPtr<PlainObject*> groupsTemplate_ = {};
++  RegExpShared::Kind kind_ = Kind::Unparsed;
++  GCPtrAtom patternAtom_;
++  uint32_t maxRegisters_ = 0;
++  uint32_t ticks_ = 0;
+   uint32_t numNamedCaptures_ = {};
+   uint32_t* namedCaptureIndices_ = {};
+   GCPtr<PlainObject*> groupsTemplate_ = {};
 -#endif
-+    uint32_t numNamedCaptures_ = {};
-+    uint32_t* namedCaptureIndices_ = {};
-+    GCPtr<PlainObject*> groupsTemplate_ = {};
  
      size_t             pairCount_;
  
@@ -43075,7 +43078,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      static int CompilationIndex(bool latin1) { return latin1 ? 0 : 1; }
  
      // Tables referenced by JIT code.
-@@ -201,73 +185,62 @@ class RegExpShared : public gc::TenuredC
+@@ -199,73 +182,62 @@ class RegExpShared : public gc::TenuredC
      // Register a table with this RegExpShared, and take ownership.
      bool addTable(JitCodeTable table) {
          return tables.append(std::move(table));
@@ -43182,7 +43185,7 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
      bool multiline() const              { return flags.multiline(); }
      bool dotAll() const                 { return flags.dotAll(); }
      bool unicode() const                { return flags.unicode(); }
-@@ -296,21 +269,20 @@ class RegExpShared : public gc::TenuredC
+@@ -294,21 +266,20 @@ class RegExpShared : public gc::TenuredC
      }
  
      static size_t offsetOfJitCode(bool latin1)

+ 9 - 9
frg/work-js/mozilla-release/patches/TOP-NOBUG-REGEXP-46-fixes-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # Date 1690631530 -7200
-# Parent  1909f65e1651d5d02e7c0f5d283563b535ba11f8
+# Parent  47e6b371b658c6572f0b641fc14d52d972ab2ec6
 No Bug - Switch to new regexp V8 engine additional fixes. r=frg a=frg
 
 Fix x86 build and do not require turning on c++17 right now.
@@ -141,22 +141,22 @@ diff --git a/js/src/vm/RegExpShared.h b/js/src/vm/RegExpShared.h
 --- a/js/src/vm/RegExpShared.h
 +++ b/js/src/vm/RegExpShared.h
 @@ -130,16 +130,19 @@ class RegExpShared : public gc::TenuredC
-     uint32_t ticks_ = 0;
- 
-     uint32_t numNamedCaptures_ = {};
-     uint32_t* namedCaptureIndices_ = {};
-     GCPtr<PlainObject*> groupsTemplate_ = {};
+   uint32_t numNamedCaptures_ = {};
+   uint32_t* namedCaptureIndices_ = {};
+   GCPtr<PlainObject*> groupsTemplate_ = {};
  
      size_t             pairCount_;
  
-+    // Make x86 build happy.
-+    size_t             dummy_;
-+
      RegExpCompilation  compilationArray[2];
  
++  // Make x86 build happy.
++  size_t             dummy_;
++
      static int CompilationIndex(bool latin1) { return latin1 ? 0 : 1; }
  
      // Tables referenced by JIT code.
      JitCodeTables tables;
  
      /* Internal functions. */
+     RegExpShared(JSAtom* source, JS::RegExpFlags flags);
+ 

+ 0 - 83
frg/work-js/mozilla-release/patches/mozilla-central-push_433250.patch

@@ -1,83 +0,0 @@
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1535014829 -32400
-#      Thu Aug 23 18:00:29 2018 +0900
-# Node ID 7d4ae67397e207d28f6fa51cadef94a14d482d85
-# Parent  4fffa63b528ba3e7c57886e8670a816974941d13
-Bug 1485610 - Avoid copy relocations in binaries we build. r=froydnj
-
-See bug 1485562 for an example of bad things that can happen with such
-relocations, and see also
-https://github.com/llvm-mirror/lld/blob/c90379ddfe5eefdcb8edcaca5fa90a831505ae18/ELF/Relocations.cpp#L496-L537
-
-diff --git a/build/unix/mozconfig.lto b/build/unix/mozconfig.lto
---- a/build/unix/mozconfig.lto
-+++ b/build/unix/mozconfig.lto
-@@ -12,10 +12,13 @@ export CXX="$topsrcdir/clang/bin/clang++
- 
- # Use a newer binutils, from the tooltool gcc package, if it's there
- if [ -e "$topsrcdir/gcc/bin/ld" ]; then
-     export CC="$CC -B $topsrcdir/gcc/bin"
-     export CXX="$CXX -B $topsrcdir/gcc/bin"
- fi
- 
- ac_add_options --enable-lto
-+# Until it's either made the default or we figure a way to remove the
-+# copy locations that LTO induces in non-PIE executables.
-+ac_add_options --enable-pie
- 
- . "$topsrcdir/build/unix/mozconfig.stdcxx"
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -480,16 +480,23 @@ if test "$GNU_CC"; then
- 
-     AC_MSG_CHECKING([for -z relro option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,-z,relro"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
-+    AC_MSG_CHECKING([for -z nocopyreloc option to ld])
-+    _SAVE_LDFLAGS=$LDFLAGS
-+    LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
-+    AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-+                  AC_MSG_RESULT([no])
-+                  LDFLAGS=$_SAVE_LDFLAGS)
-+
-     AC_MSG_CHECKING([for --build-id option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,--build-id"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
-     _DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
-diff --git a/old-configure.in b/old-configure.in
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -540,16 +540,23 @@ if test "$GNU_CC"; then
- 
-     AC_MSG_CHECKING([for -z relro option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,-z,relro"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
-+    AC_MSG_CHECKING([for -z nocopyreloc option to ld])
-+    _SAVE_LDFLAGS=$LDFLAGS
-+    LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
-+    AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-+                  AC_MSG_RESULT([no])
-+                  LDFLAGS=$_SAVE_LDFLAGS)
-+
-     AC_MSG_CHECKING([for --build-id option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,--build-id"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
-     AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])

+ 0 - 842
frg/work-js/mozilla-release/patches/mozilla-central-push_433255.patch

@@ -1,842 +0,0 @@
-# HG changeset patch
-# User Tooru Fujisawa <arai_a@mac.com>
-# Date 1535084533 -32400
-#      Fri Aug 24 13:22:13 2018 +0900
-# Node ID f0c6e521429cfaff0585ec6eaf734e9fcf873f8a
-# Parent  5d6bf0312e088bb2424a8177589a9fd4aa44bfa8
-Bug 1259822 - Show property key in the error message when target object value is null or undefined. r=jorendorff
-
-diff --git a/dom/browser-element/mochitest/browserElement_ExecuteScript.js b/dom/browser-element/mochitest/browserElement_ExecuteScript.js
---- a/dom/browser-element/mochitest/browserElement_ExecuteScript.js
-+++ b/dom/browser-element/mochitest/browserElement_ExecuteScript.js
-@@ -86,17 +86,17 @@ function runTest() {
-       `, {url});
-     }).then(bail, (error) => {
-       is(error.message, 'Value returned (resolve) by promise is not a valid JSON object', `scriptId: ${scriptId++}`);
-       return iframe.executeScript('window.btoa("a")', {url})
-     }, bail).then(rv => {
-       ok(c(rv, 'YQ=='), `scriptId: ${scriptId++}`);
-       return iframe.executeScript('window.wrappedJSObject.btoa("a")', {url})
-     }, bail).then(bail, (error) => {
--      is(error.message, 'TypeError: window.wrappedJSObject is undefined', `scriptId: ${scriptId++}`);
-+      is(error.message, `TypeError: window.wrappedJSObject is undefined, can't access property "btoa" of it`, `scriptId: ${scriptId++}`);
-       return iframe.executeScript('42', {})
-     }).then(bail, error => {
-       is(error.name, 'InvalidAccessError', `scriptId: ${scriptId++}`);
-       return iframe.executeScript('42');
-     }).then(bail, error => {
-       is(error.name, 'InvalidAccessError', `scriptId: ${scriptId++}`);
-       return iframe.executeScript('43', { url: 'http://foo.com' });
-     }).then(bail, (error) => {
-diff --git a/dom/u2f/tests/frame_appid_facet_insecure.html b/dom/u2f/tests/frame_appid_facet_insecure.html
---- a/dom/u2f/tests/frame_appid_facet_insecure.html
-+++ b/dom/u2f/tests/frame_appid_facet_insecure.html
-@@ -28,17 +28,17 @@ async function doTests() {
-     local_ok(err == "ReferenceError: u2f is not defined", "calling u2f should have thrown from an insecure origin");
-   }
- 
-   try {
-     window.u2f.register(null, [], [], function(res) {
-       local_ok(false, "Callbacks should not be called.");
-     });
-   } catch (err) {
--    local_ok(err == "TypeError: window.u2f is undefined", "accessing window.u2f should have thrown from an insecure origin");
-+    local_ok(err.toString().includes("TypeError: window.u2f is undefined"), "accessing window.u2f should have thrown from an insecure origin");
-   }
- 
-   try {
-     await promiseU2FRegister(null, [{
-       version: version,
-       challenge: bytesToBase64UrlSafe(challenge),
-     }], [], function(res){
-       local_ok(false, "Shouldn't have gotten here on an insecure origin");
-diff --git a/js/src/jit-test/tests/basic/bug827104.js b/js/src/jit-test/tests/basic/bug827104.js
---- a/js/src/jit-test/tests/basic/bug827104.js
-+++ b/js/src/jit-test/tests/basic/bug827104.js
-@@ -5,9 +5,9 @@ function f() {
-     }
-     a[i][0] = 0;
- }
- 
- var e;
- try {
-     f();
- } catch (error) {e = error;}
--assertEq(e.toString(), 'TypeError: a[i] is undefined');
-\ No newline at end of file
-+assertEq(e.toString(), `TypeError: a[i] is undefined, can't access property 0 of it`);
-diff --git a/js/src/jit-test/tests/basic/expression-autopsy.js b/js/src/jit-test/tests/basic/expression-autopsy.js
---- a/js/src/jit-test/tests/basic/expression-autopsy.js
-+++ b/js/src/jit-test/tests/basic/expression-autopsy.js
-@@ -13,17 +13,17 @@ function check_one(expected, f, err) {
-         assertEq(s.slice(11, -err.length), expected);
-     }
-     if (!failed)
-         throw new Error("didn't fail");
- }
- ieval = eval;
- function check(expr, expected=expr, testStrict=true) {
-     var end, err;
--    for ([end, err] of [[".random_prop", " is undefined"], ["()", " is not a function"]]) {
-+    for ([end, err] of [[".random_prop", ` is undefined, can't access property \"random_prop" of it`], ["()", " is not a function"]]) {
-         var statement = "o = {};" + expr + end, f;
-         var cases = [
-             // Global scope
-             function () {
-                 ieval("var o, undef;\n" + statement);
-             },
-             // Function scope
-             Function("o", "undef", statement),
-@@ -97,17 +97,17 @@ check("o[(~(o + 1))]");
- check("o[(+ (o + 1))]");
- check("o[(- (o + 1))]");
- 
- // A few one off tests
- check_one("6", (function () { 6() }), " is not a function");
- check_one("4", (function() { (4||eval)(); }), " is not a function");
- check_one("0", (function () { Array.prototype.reverse.call('123'); }), " is read-only");
- check_one("[...][Symbol.iterator](...).next(...).value",
--          function () { ieval("{ let x; var [a, b, [c0, c1]] = [x, x, x]; }") }, " is undefined");
-+          function () { ieval("{ let x; var [a, b, [c0, c1]] = [x, x, x]; }") }, " is undefined, can't access property Symbol.iterator of it");
- check_one("(void 1)", function() { (void 1)(); }, " is not a function");
- check_one("(void o[1])", function() { var o = []; (void o[1])() }, " is not a function");
- 
- check_one("(typeof 1)", function() { (typeof 1)(); }, " is not a function");
- check_one("(typeof o[1])", function() { var o = []; (typeof o[1])() }, " is not a function");
- 
- check_one("(delete foo)",
-           function() { (delete foo)(); },
-diff --git a/js/src/jit-test/tests/basic/iterable-error-messages.js b/js/src/jit-test/tests/basic/iterable-error-messages.js
---- a/js/src/jit-test/tests/basic/iterable-error-messages.js
-+++ b/js/src/jit-test/tests/basic/iterable-error-messages.js
-@@ -10,30 +10,30 @@ function assertThrowsMsg(f, msg) {
- 
- // For-of
- function testForOf(val) {
-     for (var x of val) {}
- }
- for (v of [{}, Math, new Proxy({}, {})]) {
-     assertThrowsMsg(() => testForOf(v), "val is not iterable");
- }
--assertThrowsMsg(() => testForOf(null), "val is null");
-+assertThrowsMsg(() => testForOf(null), "val is null, can't access property Symbol.iterator of it");
- assertThrowsMsg(() => { for (var x of () => 1) {}}, "() => 1 is not iterable");
- 
- // Destructuring
- function testDestr(val) {
-     var [a, b] = val;
- }
- for (v of [{}, Math, new Proxy({}, {})]) {
-     assertThrowsMsg(() => testDestr(v), "val is not iterable");
- }
--assertThrowsMsg(() => testDestr(null), "val is null");
-+assertThrowsMsg(() => testDestr(null), "val is null, can't access property Symbol.iterator of it");
- assertThrowsMsg(() => { [a, b] = () => 1; }, "() => 1 is not iterable");
- 
- // Spread
- function testSpread(val) {
-     [...val];
- }
- for (v of [{}, Math, new Proxy({}, {})]) {
-     assertThrowsMsg(() => testSpread(v), "val is not iterable");
- }
--assertThrowsMsg(() => testSpread(null), "val is null");
-+assertThrowsMsg(() => testSpread(null), "val is null, can't access property Symbol.iterator of it");
- assertThrowsMsg(() => { [...() => 1]; }, "() => 1 is not iterable");
-diff --git a/js/src/jit-test/tests/basic/testBug604210.js b/js/src/jit-test/tests/basic/testBug604210.js
---- a/js/src/jit-test/tests/basic/testBug604210.js
-+++ b/js/src/jit-test/tests/basic/testBug604210.js
-@@ -1,11 +1,11 @@
- function f() {
-     var msg = '';
-     try {
-         var x = undefined;
-         print(x.foo);
-     } catch (e) {
-         msg = '' + e;
-     }
--    assertEq(msg, "TypeError: x is undefined");
-+    assertEq(msg, `TypeError: x is undefined, can't access property "foo" of it`);
- }
- f();
-diff --git a/js/src/jit-test/tests/debug/bug1275001.js b/js/src/jit-test/tests/debug/bug1275001.js
---- a/js/src/jit-test/tests/debug/bug1275001.js
-+++ b/js/src/jit-test/tests/debug/bug1275001.js
-@@ -12,17 +12,17 @@ function check_one(expected, f, err) {
-     } catch (ex) {
-         s = ex.toString()
-         assertEq(s.slice(11, -err.length), expected)
-     }
- }
- ieval = eval
- function check(expr, expected = expr) {
-     var end, err
--    for ([end, err] of[[".random_prop", " is undefined" ]]) 
-+    for ([end, err] of[[".random_prop", ` is undefined, can't access property \"random_prop" of it` ]]) 
-          statement = "o = {};" + expr + end;
-          cases = [
-             function() { return ieval("var undef;" + statement); },
-             Function(statement)
-         ]
-         for (f of cases) 
-             check_one(expected, f, err)
- }
-diff --git a/js/src/jit-test/tests/ion/bug913749.js b/js/src/jit-test/tests/ion/bug913749.js
---- a/js/src/jit-test/tests/ion/bug913749.js
-+++ b/js/src/jit-test/tests/ion/bug913749.js
-@@ -10,12 +10,12 @@ this.toSource();
- 
- y = undefined;
- 
- for (var i = 0; i < 3; i++) {
-     try {
- 	x.toString();
- 	assertEq(0, 1);
-     } catch (e) {
--	assertEq(e.message === "y is undefined" ||
-+	assertEq(e.message === `y is undefined, can't access property "length" of it` ||
- 		 e.message === "undefined has no properties", true);
-     }
- }
-diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp
---- a/js/src/jit/BaselineIC.cpp
-+++ b/js/src/jit/BaselineIC.cpp
-@@ -1875,17 +1875,17 @@ DoSetElemFallback(JSContext* cx, Baselin
- 
-     MOZ_ASSERT(op == JSOP_SETELEM ||
-                op == JSOP_STRICTSETELEM ||
-                op == JSOP_INITELEM ||
-                op == JSOP_INITHIDDENELEM ||
-                op == JSOP_INITELEM_ARRAY ||
-                op == JSOP_INITELEM_INC);
- 
--    RootedObject obj(cx, ToObjectFromStack(cx, objv));
-+    RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, objv, index));
-     if (!obj)
-         return false;
- 
-     RootedShape oldShape(cx, obj->maybeShape());
-     RootedObjectGroup oldGroup(cx, JSObject::getGroup(cx, obj));
-     if (!oldGroup)
-         return false;
- 
-@@ -2764,17 +2764,17 @@ DoSetPropFallback(JSContext* cx, Baselin
- 
-     RootedPropertyName name(cx);
-     if (op == JSOP_SETALIASEDVAR || op == JSOP_INITALIASEDLEXICAL)
-         name = EnvironmentCoordinateName(cx->caches().envCoordinateNameCache, script, pc);
-     else
-         name = script->getName(pc);
-     RootedId id(cx, NameToId(name));
- 
--    RootedObject obj(cx, ToObjectFromStack(cx, lhs));
-+    RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, lhs, id));
-     if (!obj)
-         return false;
-     RootedShape oldShape(cx, obj->maybeShape());
-     RootedObjectGroup oldGroup(cx, JSObject::getGroup(cx, obj));
-     if (!oldGroup)
-         return false;
- 
-     if (obj->is<UnboxedPlainObject>()) {
-diff --git a/js/src/js.msg b/js/src/js.msg
---- a/js/src/js.msg
-+++ b/js/src/js.msg
-@@ -49,16 +49,18 @@ MSG_DEF(JSMSG_READ_ONLY,               1
- MSG_DEF(JSMSG_CANT_DELETE,             1, JSEXN_TYPEERR, "property {0} is non-configurable and can't be deleted")
- MSG_DEF(JSMSG_CANT_TRUNCATE_ARRAY,     0, JSEXN_TYPEERR, "can't delete non-configurable array element")
- MSG_DEF(JSMSG_NOT_FUNCTION,            1, JSEXN_TYPEERR, "{0} is not a function")
- MSG_DEF(JSMSG_NOT_CONSTRUCTOR,         1, JSEXN_TYPEERR, "{0} is not a constructor")
- MSG_DEF(JSMSG_CANT_CONVERT_TO,         2, JSEXN_TYPEERR, "can't convert {0} to {1}")
- MSG_DEF(JSMSG_TOPRIMITIVE_NOT_CALLABLE, 2, JSEXN_TYPEERR, "can't convert {0} to {1}: its [Symbol.toPrimitive] property is not a function")
- MSG_DEF(JSMSG_TOPRIMITIVE_RETURNED_OBJECT, 2, JSEXN_TYPEERR, "can't convert {0} to {1}: its [Symbol.toPrimitive] method returned an object")
- MSG_DEF(JSMSG_NO_PROPERTIES,           1, JSEXN_TYPEERR, "{0} has no properties")
-+MSG_DEF(JSMSG_PROPERTY_FAIL,           2, JSEXN_TYPEERR, "can't access property {0} of {1}")
-+MSG_DEF(JSMSG_PROPERTY_FAIL_EXPR,      3, JSEXN_TYPEERR, "{0} is {1}, can't access property {2} of it")
- MSG_DEF(JSMSG_BAD_REGEXP_FLAG,         1, JSEXN_SYNTAXERR, "invalid regular expression flag {0}")
- MSG_DEF(JSMSG_INVALID_DATA_VIEW_LENGTH, 0, JSEXN_RANGEERR, "invalid data view length")
- MSG_DEF(JSMSG_OFFSET_LARGER_THAN_FILESIZE, 0, JSEXN_RANGEERR, "offset is larger than filesize")
- MSG_DEF(JSMSG_OFFSET_OUT_OF_BUFFER,    0, JSEXN_RANGEERR, "start offset is outside the bounds of the buffer")
- MSG_DEF(JSMSG_OFFSET_OUT_OF_DATAVIEW,  0, JSEXN_RANGEERR, "offset is outside the bounds of the DataView")
- MSG_DEF(JSMSG_SPREAD_TOO_LARGE,        0, JSEXN_RANGEERR, "array too large due to spread operand(s)")
- MSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         0, JSEXN_TYPEERR, "cannot use the given object as a weak map key")
- MSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,    1, JSEXN_TYPEERR, "invalid {0} usage")
-diff --git a/js/src/jsapi-tests/testErrorInterceptor.cpp b/js/src/jsapi-tests/testErrorInterceptor.cpp
---- a/js/src/jsapi-tests/testErrorInterceptor.cpp
-+++ b/js/src/jsapi-tests/testErrorInterceptor.cpp
-@@ -47,17 +47,17 @@ BEGIN_TEST(testErrorInterceptor)
-     };
-     // With the simpleInterceptor, we should end up with the following error:
-     const char* TO_STRING[] = {
-         "Error: I am an Error\0",
-         "TypeError: I am a TypeError\0",
-         "ReferenceError: I am a ReferenceError\0",
-         "SyntaxError: I am a SyntaxError\0",
-         "5\0",
--        "TypeError: undefined has no properties\0",
-+        "TypeError: can't access property 0 of undefined\0",
-         "ReferenceError: foo is not defined\0",
-         "SyntaxError: expected expression, got end of script\0",
-     };
-     MOZ_ASSERT(mozilla::ArrayLength(SAMPLES) == mozilla::ArrayLength(TO_STRING));
- 
- 
-     // Save original callback.
-     JSErrorInterceptor* original = JS_GetErrorInterceptorCallback(cx->runtime());
-diff --git a/js/src/tests/non262/extensions/regress-353116.js b/js/src/tests/non262/extensions/regress-353116.js
---- a/js/src/tests/non262/extensions/regress-353116.js
-+++ b/js/src/tests/non262/extensions/regress-353116.js
-@@ -14,57 +14,57 @@ var expect = '';
- test();
- //-----------------------------------------------------------------------------
- 
- function test()
- {
-   printBugNumber(BUGNUMBER);
-   printStatus (summary);
- 
--  expect = 'TypeError: undefined has no properties';
-+  expect = `TypeError: can't access property "y" of undefined`;
-   actual = 'No Error';
- 
-   try
-   {
-     undefined.y;
-   }
-   catch(ex)
-   {
-     actual = ex + '';
-   }
-   reportCompare(expect, actual, summary);
- 
--  expect = 'TypeError: null has no properties';
-+  expect = `TypeError: can't access property "y" of null`;
-   actual = 'No Error';
- 
-   try
-   {
-     null.y;
-   }
-   catch(ex)
-   {
-     actual = ex + '';
-   }
-   reportCompare(expect, actual, summary);
- 
--  expect = 'TypeError: x is undefined';
-+  expect = `TypeError: x is undefined, can't access property "y" of it`;
-   actual = 'No Error';
- 
-   try
-   {
-     x = undefined; 
-     x.y;
-   }
-   catch(ex)
-   {
-     actual = ex + '';
-   }
-   reportCompare(expect, actual, summary);
- 
--  expect = 'TypeError: x is null';
-+  expect = `TypeError: x is null, can't access property "y" of it`;
-   actual = 'No Error';
- 
-   try
-   {
-     x = null; 
-     x.y;
-   }
-   catch(ex)
-diff --git a/js/src/tests/non262/regress/regress-469625-03.js b/js/src/tests/non262/regress/regress-469625-03.js
---- a/js/src/tests/non262/regress/regress-469625-03.js
-+++ b/js/src/tests/non262/regress/regress-469625-03.js
-@@ -20,17 +20,17 @@ function test()
- {
-   printBugNumber(BUGNUMBER);
-   printStatus (summary);
-  
-   function f(x) {
-     var [a, b, [c0, c1]] = [x, x, x];
-   }
- 
--  expect = `TypeError: [...][Symbol.iterator](...).next(...).value is null`;
-+  expect = `TypeError: [...][Symbol.iterator](...).next(...).value is null, can't access property Symbol.iterator of it`;
-   actual = 'No Error';
-   try
-   {
-     f(null);
-   }
-   catch(ex)
-   {
-     actual = ex + '';
-diff --git a/js/src/tests/non262/regress/regress-469758.js b/js/src/tests/non262/regress/regress-469758.js
---- a/js/src/tests/non262/regress/regress-469758.js
-+++ b/js/src/tests/non262/regress/regress-469758.js
-@@ -4,11 +4,11 @@
- var err;
- try {
-     {let i=1}
-     {let j=1; [][j][2]}
- } catch (e) {
-     err = e;
- }
- assertEq(err instanceof TypeError, true);
--assertEq(err.message, "[][j] is undefined");
-+assertEq(err.message, "[][j] is undefined, can't access property 2 of it");
- 
- reportCompare(0, 0, 'ok');
-diff --git a/js/src/vm/Interpreter-inl.h b/js/src/vm/Interpreter-inl.h
---- a/js/src/vm/Interpreter-inl.h
-+++ b/js/src/vm/Interpreter-inl.h
-@@ -533,17 +533,17 @@ GetObjectElementOperation(JSContext* cx,
- 
- static MOZ_ALWAYS_INLINE bool
- GetPrimitiveElementOperation(JSContext* cx, JSOp op, JS::HandleValue receiver,
-                              HandleValue key, MutableHandleValue res)
- {
-     MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM);
- 
-     // FIXME: Bug 1234324 We shouldn't be boxing here.
--    RootedObject boxed(cx, ToObjectFromStack(cx, receiver));
-+    RootedObject boxed(cx, ToObjectFromStackForPropertyAccess(cx, receiver, key));
-     if (!boxed)
-         return false;
- 
-     do {
-         uint32_t index;
-         if (IsDefinitelyIndex(key, &index)) {
-             if (GetElementNoGC(cx, boxed, receiver, index, res.address()))
-                 break;
-diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
---- a/js/src/vm/Interpreter.cpp
-+++ b/js/src/vm/Interpreter.cpp
-@@ -258,17 +258,17 @@ GetImportOperation(JSContext* cx, Interp
-     return FetchName<GetNameMode::Normal>(cx, env, pobj, name, prop, vp);
- }
- 
- static bool
- SetPropertyOperation(JSContext* cx, JSOp op, HandleValue lval, HandleId id, HandleValue rval)
- {
-     MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP);
- 
--    RootedObject obj(cx, ToObjectFromStack(cx, lval));
-+    RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, lval, id));
-     if (!obj)
-         return false;
- 
-     ObjectOpResult result;
-     return SetProperty(cx, obj, id, rval, lval, result) &&
-            result.checkStrictErrorOrWarning(cx, obj, id, op == JSOP_STRICTSETPROP);
- }
- 
-@@ -1513,20 +1513,20 @@ HandleError(JSContext* cx, InterpreterRe
- #define PUSH_SYMBOL(s)           REGS.sp++->setSymbol(s)
- #define PUSH_STRING(s)           do { REGS.sp++->setString(s); cx->debugOnlyCheck(REGS.sp[-1]); } while (0)
- #define PUSH_OBJECT(obj)         do { REGS.sp++->setObject(obj); cx->debugOnlyCheck(REGS.sp[-1]); } while (0)
- #define PUSH_OBJECT_OR_NULL(obj) do { REGS.sp++->setObjectOrNull(obj); cx->debugOnlyCheck(REGS.sp[-1]); } while (0)
- #define PUSH_MAGIC(magic)        REGS.sp++->setMagic(magic)
- #define POP_COPY_TO(v)           (v) = *--REGS.sp
- #define POP_RETURN_VALUE()       REGS.fp()->setReturnValue(*--REGS.sp)
- 
--#define FETCH_OBJECT(cx, n, obj)                                              \
-+#define FETCH_OBJECT(cx, n, obj, key)                                         \
-     JS_BEGIN_MACRO                                                            \
-         HandleValue val = REGS.stackHandleAt(n);                              \
--        obj = ToObjectFromStack((cx), (val));                                 \
-+        obj = ToObjectFromStackForPropertyAccess((cx), (val), (key));         \
-         if (!obj)                                                             \
-             goto error;                                                       \
-     JS_END_MACRO
- 
- /*
-  * Same for JSOP_SETNAME and JSOP_SETPROP, which differ only slightly but
-  * remain distinct for the decompiler.
-  */
-@@ -2819,17 +2819,17 @@ END_CASE(JSOP_DELNAME)
- 
- CASE(JSOP_DELPROP)
- CASE(JSOP_STRICTDELPROP)
- {
-     static_assert(JSOP_DELPROP_LENGTH == JSOP_STRICTDELPROP_LENGTH,
-                   "delprop and strictdelprop must be the same size");
-     ReservedRooted<jsid> id(&rootId0, NameToId(script->getName(REGS.pc)));
-     ReservedRooted<JSObject*> obj(&rootObject0);
--    FETCH_OBJECT(cx, -1, obj);
-+    FETCH_OBJECT(cx, -1, obj, id);
- 
-     ObjectOpResult result;
-     if (!DeleteProperty(cx, obj, id, result))
-         goto error;
-     if (!result && JSOp(*REGS.pc) == JSOP_STRICTDELPROP) {
-         result.reportError(cx, obj, id);
-         goto error;
-     }
-@@ -2840,19 +2840,18 @@ END_CASE(JSOP_DELPROP)
- 
- CASE(JSOP_DELELEM)
- CASE(JSOP_STRICTDELELEM)
- {
-     static_assert(JSOP_DELELEM_LENGTH == JSOP_STRICTDELELEM_LENGTH,
-                   "delelem and strictdelelem must be the same size");
-     /* Fetch the left part and resolve it to a non-null object. */
-     ReservedRooted<JSObject*> obj(&rootObject0);
--    FETCH_OBJECT(cx, -2, obj);
--
-     ReservedRooted<Value> propval(&rootValue0, REGS.sp[-1]);
-+    FETCH_OBJECT(cx, -2, obj, propval);
- 
-     ObjectOpResult result;
-     ReservedRooted<jsid> id(&rootId0);
-     if (!ToPropertyKey(cx, propval, &id))
-         goto error;
-     if (!DeleteProperty(cx, obj, id, result))
-         goto error;
-     if (!result && JSOp(*REGS.pc) == JSOP_STRICTDELELEM) {
-@@ -3106,17 +3105,17 @@ END_CASE(JSOP_GETELEM_SUPER)
- 
- CASE(JSOP_SETELEM)
- CASE(JSOP_STRICTSETELEM)
- {
-     static_assert(JSOP_SETELEM_LENGTH == JSOP_STRICTSETELEM_LENGTH,
-                   "setelem and strictsetelem must be the same size");
-     HandleValue receiver = REGS.stackHandleAt(-3);
-     ReservedRooted<JSObject*> obj(&rootObject0);
--    obj = ToObjectFromStack(cx, receiver);
-+    obj = ToObjectFromStackForPropertyAccess(cx, receiver, REGS.stackHandleAt(-2));
-     if (!obj)
-         goto error;
-     ReservedRooted<jsid> id(&rootId0);
-     FETCH_ELEMENT_ID(-2, id);
-     HandleValue value = REGS.stackHandleAt(-1);
-     if (!SetObjectElementOperation(cx, obj, id, value, receiver, *REGS.pc == JSOP_STRICTSETELEM))
-         goto error;
-     REGS.sp[-3] = value;
-@@ -4609,17 +4608,17 @@ js::GetProperty(JSContext* cx, HandleVal
-         if (!proto)
-             return false;
- 
-         if (GetPropertyPure(cx, proto, NameToId(name), vp.address()))
-             return true;
-     }
- 
-     RootedValue receiver(cx, v);
--    RootedObject obj(cx, ToObjectFromStack(cx, v));
-+    RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, v, name));
-     if (!obj)
-         return false;
- 
-     return GetProperty(cx, obj, receiver, name, vp);
- }
- 
- JSObject*
- js::Lambda(JSContext* cx, HandleFunction fun, HandleObject parent)
-@@ -4754,17 +4753,17 @@ js::GetAndClearException(JSContext* cx, 
-     // Allow interrupting deeply nested exception handling.
-     return CheckForInterrupt(cx);
- }
- 
- template <bool strict>
- bool
- js::DeletePropertyJit(JSContext* cx, HandleValue v, HandlePropertyName name, bool* bp)
- {
--    RootedObject obj(cx, ToObjectFromStack(cx, v));
-+    RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, v, name));
-     if (!obj)
-         return false;
- 
-     RootedId id(cx, NameToId(name));
-     ObjectOpResult result;
-     if (!DeleteProperty(cx, obj, id, result))
-         return false;
- 
-@@ -4782,17 +4781,17 @@ template bool js::DeletePropertyJit<true
-                                            bool* bp);
- template bool js::DeletePropertyJit<false>(JSContext* cx, HandleValue val, HandlePropertyName name,
-                                            bool* bp);
- 
- template <bool strict>
- bool
- js::DeleteElementJit(JSContext* cx, HandleValue val, HandleValue index, bool* bp)
- {
--    RootedObject obj(cx, ToObjectFromStack(cx, val));
-+    RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, val, index));
-     if (!obj)
-         return false;
- 
-     RootedId id(cx);
-     if (!ToPropertyKey(cx, index, &id))
-         return false;
-     ObjectOpResult result;
-     if (!DeleteProperty(cx, obj, id, result))
-diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp
---- a/js/src/vm/JSContext.cpp
-+++ b/js/src/vm/JSContext.cpp
-@@ -905,37 +905,88 @@ js::ReportIsNotDefined(JSContext* cx, Ha
- void
- js::ReportIsNotDefined(JSContext* cx, HandlePropertyName name)
- {
-     RootedId id(cx, NameToId(name));
-     ReportIsNotDefined(cx, id);
- }
- 
- void
--js::ReportIsNullOrUndefined(JSContext* cx, int spindex, HandleValue v)
-+js::ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v, bool reportScanStack)
- {
-     MOZ_ASSERT(v.isNullOrUndefined());
- 
--    UniqueChars bytes = DecompileValueGenerator(cx, spindex, v, nullptr);
-+    if (!reportScanStack) {
-+        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_CONVERT_TO,
-+                                  v.isNull() ? "null" : "undefined", "object");
-+        return;
-+    }
-+
-+    UniqueChars bytes = DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, v, nullptr);
-     if (!bytes)
-         return;
- 
-     if (strcmp(bytes.get(), js_undefined_str) == 0 || strcmp(bytes.get(), js_null_str) == 0) {
-         JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_NO_PROPERTIES,
-                                    bytes.get());
-     } else if (v.isUndefined()) {
-         JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_UNEXPECTED_TYPE,
-                                    bytes.get(), js_undefined_str);
-     } else {
-         MOZ_ASSERT(v.isNull());
-         JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_UNEXPECTED_TYPE,
-                                    bytes.get(), js_null_str);
-     }
- }
- 
-+char*
-+EncodeIdAsLatin1(JSContext* cx, HandleId id, JSAutoByteString& bytes)
-+{
-+    RootedValue idVal(cx, IdToValue(id));
-+    RootedString idStr(cx, ValueToSource(cx, idVal));
-+    if (!idStr)
-+        return nullptr;
-+
-+    return bytes.encodeLatin1(cx, idStr);
-+}
-+
-+void
-+js::ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v, HandleId key,
-+                                             bool reportScanStack)
-+{
-+    MOZ_ASSERT(v.isNullOrUndefined());
-+
-+    JSAutoByteString keyBytes;
-+    if (!EncodeIdAsLatin1(cx, key, keyBytes))
-+        return;
-+
-+    if (!reportScanStack) {
-+        JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_PROPERTY_FAIL,
-+                                   keyBytes.ptr(),
-+                                   v.isUndefined() ? js_undefined_str : js_null_str);
-+        return;
-+    }
-+
-+    UniqueChars bytes = DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, v, nullptr);
-+    if (!bytes)
-+        return;
-+
-+    if (strcmp(bytes.get(), js_undefined_str) == 0 || strcmp(bytes.get(), js_null_str) == 0) {
-+        JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_PROPERTY_FAIL,
-+                                   keyBytes.ptr(), bytes.get());
-+    } else if (v.isUndefined()) {
-+        JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_PROPERTY_FAIL_EXPR,
-+                                   bytes.get(), js_undefined_str, keyBytes.ptr());
-+    } else {
-+        MOZ_ASSERT(v.isNull());
-+        JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_PROPERTY_FAIL_EXPR,
-+                                   bytes.get(), js_null_str, keyBytes.ptr());
-+    }
-+}
-+
- void
- js::ReportMissingArg(JSContext* cx, HandleValue v, unsigned arg)
- {
-     char argbuf[11];
-     UniqueChars bytes;
- 
-     SprintfLiteral(argbuf, "%u", arg);
-     if (IsFunctionObject(v)) {
-diff --git a/js/src/vm/JSContext.h b/js/src/vm/JSContext.h
---- a/js/src/vm/JSContext.h
-+++ b/js/src/vm/JSContext.h
-@@ -1102,17 +1102,20 @@ ReportIsNotDefined(JSContext* cx, Handle
- 
- extern void
- ReportIsNotDefined(JSContext* cx, HandleId id);
- 
- /*
-  * Report an attempt to access the property of a null or undefined value (v).
-  */
- extern void
--ReportIsNullOrUndefined(JSContext* cx, int spindex, HandleValue v);
-+ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v, bool reportScanStack);
-+extern void
-+ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v, HandleId key,
-+                                         bool reportScanStack);
- 
- extern void
- ReportMissingArg(JSContext* cx, js::HandleValue v, unsigned arg);
- 
- /*
-  * Report error using js_DecompileValueGenerator(cx, spindex, v, fallback) as
-  * the first argument for the error message. If the error message has less
-  * then 3 arguments, use null for arg1 or arg2.
-diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp
---- a/js/src/vm/JSObject.cpp
-+++ b/js/src/vm/JSObject.cpp
-@@ -3235,21 +3235,69 @@ js::PrimitiveToObject(JSContext* cx, con
-  */
- JSObject*
- js::ToObjectSlow(JSContext* cx, JS::HandleValue val, bool reportScanStack)
- {
-     MOZ_ASSERT(!val.isMagic());
-     MOZ_ASSERT(!val.isObject());
- 
-     if (val.isNullOrUndefined()) {
--        if (reportScanStack) {
--            ReportIsNullOrUndefined(cx, JSDVG_SEARCH_STACK, val);
-+        ReportIsNullOrUndefinedForPropertyAccess(cx, val, reportScanStack);
-+        return nullptr;
-+    }
-+
-+    return PrimitiveToObject(cx, val);
-+}
-+
-+JSObject*
-+js::ToObjectSlowForPropertyAccess(JSContext* cx, JS::HandleValue val, HandleId key,
-+                                  bool reportScanStack)
-+{
-+    MOZ_ASSERT(!val.isMagic());
-+    MOZ_ASSERT(!val.isObject());
-+
-+    if (val.isNullOrUndefined()) {
-+        ReportIsNullOrUndefinedForPropertyAccess(cx, val, key, reportScanStack);
-+        return nullptr;
-+    }
-+
-+    return PrimitiveToObject(cx, val);
-+}
-+
-+JSObject*
-+js::ToObjectSlowForPropertyAccess(JSContext* cx, JS::HandleValue val, HandlePropertyName key,
-+                                  bool reportScanStack)
-+{
-+    MOZ_ASSERT(!val.isMagic());
-+    MOZ_ASSERT(!val.isObject());
-+
-+    if (val.isNullOrUndefined()) {
-+        RootedId keyId(cx, NameToId(key));
-+        ReportIsNullOrUndefinedForPropertyAccess(cx, val, keyId, reportScanStack);
-+        return nullptr;
-+    }
-+
-+    return PrimitiveToObject(cx, val);
-+}
-+
-+JSObject*
-+js::ToObjectSlowForPropertyAccess(JSContext* cx, JS::HandleValue val, HandleValue keyValue,
-+                                  bool reportScanStack)
-+{
-+    MOZ_ASSERT(!val.isMagic());
-+    MOZ_ASSERT(!val.isObject());
-+
-+    if (val.isNullOrUndefined()) {
-+        RootedId key(cx);
-+        if (keyValue.isPrimitive()) {
-+            if (!ValueToId<CanGC>(cx, keyValue, &key))
-+                return nullptr;
-+            ReportIsNullOrUndefinedForPropertyAccess(cx, val, key, reportScanStack);
-         } else {
--            JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_CONVERT_TO,
--                                      val.isNull() ? "null" : "undefined", "object");
-+            ReportIsNullOrUndefinedForPropertyAccess(cx, val, reportScanStack);
-         }
-         return nullptr;
-     }
- 
-     return PrimitiveToObject(cx, val);
- }
- 
- Value
-diff --git a/js/src/vm/JSObject.h b/js/src/vm/JSObject.h
---- a/js/src/vm/JSObject.h
-+++ b/js/src/vm/JSObject.h
-@@ -1201,16 +1201,48 @@ namespace js {
- MOZ_ALWAYS_INLINE JSObject*
- ToObjectFromStack(JSContext* cx, HandleValue vp)
- {
-     if (vp.isObject())
-         return &vp.toObject();
-     return js::ToObjectSlow(cx, vp, true);
- }
- 
-+JSObject*
-+ToObjectSlowForPropertyAccess(JSContext* cx, JS::HandleValue val, HandleId key,
-+                              bool reportScanStack);
-+JSObject*
-+ToObjectSlowForPropertyAccess(JSContext* cx, JS::HandleValue val, HandlePropertyName key,
-+                              bool reportScanStack);
-+JSObject*
-+ToObjectSlowForPropertyAccess(JSContext* cx, JS::HandleValue val, HandleValue keyValue,
-+                              bool reportScanStack);
-+
-+MOZ_ALWAYS_INLINE JSObject*
-+ToObjectFromStackForPropertyAccess(JSContext* cx, HandleValue vp, HandleId key)
-+{
-+    if (vp.isObject())
-+        return &vp.toObject();
-+    return js::ToObjectSlowForPropertyAccess(cx, vp, key, true);
-+}
-+MOZ_ALWAYS_INLINE JSObject*
-+ToObjectFromStackForPropertyAccess(JSContext* cx, HandleValue vp, HandlePropertyName key)
-+{
-+    if (vp.isObject())
-+        return &vp.toObject();
-+    return js::ToObjectSlowForPropertyAccess(cx, vp, key, true);
-+}
-+MOZ_ALWAYS_INLINE JSObject*
-+ToObjectFromStackForPropertyAccess(JSContext* cx, HandleValue vp, HandleValue key)
-+{
-+    if (vp.isObject())
-+        return &vp.toObject();
-+    return js::ToObjectSlowForPropertyAccess(cx, vp, key, true);
-+}
-+
- template<XDRMode mode>
- XDRResult
- XDRObjectLiteral(XDRState<mode>* xdr, MutableHandleObject obj);
- 
- /*
-  * Report a TypeError: "so-and-so is not an object".
-  * Using NotNullObject is usually less code.
-  */
-diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js
---- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js
-+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js
-@@ -119,17 +119,18 @@ add_task(async function test_contentscri
-     try {
-       manifest = win.browser.runtime.getManifest();
-     } catch (e) {
-       manifestException = e;
-     }
- 
-     Assert.ok(!manifest, "manifest should be undefined");
- 
--    Assert.equal(String(manifestException), "TypeError: win.browser.runtime is undefined",
-+    Assert.equal(String(manifestException),
-+                 `TypeError: win.browser.runtime is undefined, can't access property "getManifest" of it`,
-                  "expected exception received");
- 
-     let getManifestException = win.testGetManifestException();
- 
-     Assert.equal(getManifestException, "TypeError: can't access dead object",
-                  "expected exception received");
-   });
- 

+ 0 - 1930
frg/work-js/mozilla-release/patches/mozilla-central-push_433279.patch

@@ -1,1930 +0,0 @@
-# HG changeset patch
-# User Thi Huynh <so61pi.re@gmail.com>
-# Date 1534842295 0
-#      Tue Aug 21 09:04:55 2018 +0000
-# Node ID 2102f887e46bf3cb2b6a7fb00ed33640c9cb330e
-# Parent  988b2e838fd1c3c335169808b563ee6c07feeac9
-Bug 1432135 - Rename TokenKind::{Lb,Rb,Lc,Rc,Lp,Rp} to their long names. r=jandem
-
-Differential Revision: https://phabricator.services.mozilla.com/D3803
-
-diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
---- a/js/src/frontend/Parser.cpp
-+++ b/js/src/frontend/Parser.cpp
-@@ -1794,18 +1794,18 @@ PerHandlerParser<ParseHandler>::propagat
- 
- template <typename CharT>
- bool
- Parser<FullParseHandler, CharT>::checkStatementsEOF()
- {
-     // This is designed to be paired with parsing a statement list at the top
-     // level.
-     //
--    // The statementList() call breaks on TokenKind::Rc, so make sure we've
--    // reached EOF here.
-+    // The statementList() call breaks on TokenKind::RightCurly, so make sure
-+    // we've reached EOF here.
-     TokenKind tt;
-     if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-         return false;
-     if (tt != TokenKind::Eof) {
-         error(JSMSG_UNEXPECTED_TOKEN, "expression", TokenKindToDesc(tt));
-         return false;
-     }
-     return true;
-@@ -2975,17 +2975,17 @@ bool
- GeneralParser<ParseHandler, CharT>::matchOrInsertSemicolon()
- {
-     TokenKind tt = TokenKind::Eof;
-     if (!tokenStream.peekTokenSameLine(&tt, TokenStream::Operand))
-         return false;
-     if (tt != TokenKind::Eof &&
-         tt != TokenKind::Eol &&
-         tt != TokenKind::Semi &&
--        tt != TokenKind::Rc)
-+        tt != TokenKind::RightCurly)
-     {
-         /*
-          * When current token is `await` and it's outside of async function,
-          * it's possibly intended to be an await expression.
-          *
-          *   await f();
-          *        ^
-          *        |
-@@ -3108,17 +3108,17 @@ GeneralParser<ParseHandler, CharT>::func
-         }
-     }
- 
-     TokenPos firstTokenPos;
-     if (!parenFreeArrow) {
-         TokenKind tt;
-         if (!tokenStream.getToken(&tt, firstTokenModifier))
-             return false;
--        if (tt != TokenKind::Lp) {
-+        if (tt != TokenKind::LeftParen) {
-             error(kind == FunctionSyntaxKind::Arrow
-                   ? JSMSG_BAD_ARROW_ARGS
-                   : JSMSG_PAREN_BEFORE_FORMAL);
-             return false;
-         }
- 
-         firstTokenPos = pos();
- 
-@@ -3137,17 +3137,17 @@ GeneralParser<ParseHandler, CharT>::func
-         return false;
-     handler.setFunctionFormalParametersAndBody(funcpn, argsbody);
- 
-     bool hasArguments = false;
-     if (parenFreeArrow) {
-         hasArguments = true;
-     } else {
-         bool matched;
--        if (!tokenStream.matchToken(&matched, TokenKind::Rp, TokenStream::Operand))
-+        if (!tokenStream.matchToken(&matched, TokenKind::RightParen, TokenStream::Operand))
-             return false;
-         if (!matched)
-             hasArguments = true;
-     }
-     if (hasArguments) {
-         bool hasRest = false;
-         bool hasDefault = false;
-         bool duplicatedParam = false;
-@@ -3188,27 +3188,27 @@ GeneralParser<ParseHandler, CharT>::func
- 
-                 hasRest = true;
-                 funbox->setHasRest();
- 
-                 if (!tokenStream.getToken(&tt))
-                     return false;
- 
-                 if (!TokenKindIsPossibleIdentifier(tt) &&
--                    tt != TokenKind::Lb &&
--                    tt != TokenKind::Lc)
-+                    tt != TokenKind::LeftBracket &&
-+                    tt != TokenKind::LeftCurly)
-                 {
-                     error(JSMSG_NO_REST_NAME);
-                     return false;
-                 }
-             }
- 
-             switch (tt) {
--              case TokenKind::Lb:
--              case TokenKind::Lc: {
-+              case TokenKind::LeftBracket:
-+              case TokenKind::LeftCurly: {
-                 disallowDuplicateParams = true;
-                 if (duplicatedParam) {
-                     // Has duplicated args before the destructuring parameter.
-                     error(JSMSG_BAD_DUP_ARGS);
-                     return false;
-                 }
- 
-                 funbox->hasDestructuringArgs = true;
-@@ -3307,26 +3307,26 @@ GeneralParser<ParseHandler, CharT>::func
-             if (!tokenStream.matchToken(&matched, TokenKind::Comma, TokenStream::Operand))
-                 return false;
-             if (!matched)
-                 break;
- 
-             if (!hasRest) {
-                 if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-                     return null();
--                if (tt == TokenKind::Rp)
-+                if (tt == TokenKind::RightParen)
-                     break;
-             }
-         }
- 
-         if (!parenFreeArrow) {
-             TokenKind tt;
-             if (!tokenStream.getToken(&tt, TokenStream::Operand))
-                 return false;
--            if (tt != TokenKind::Rp) {
-+            if (tt != TokenKind::RightParen) {
-                 if (kind == FunctionSyntaxKind::Setter) {
-                     error(JSMSG_ACCESSOR_WRONG_ARGS, "setter", "one", "");
-                     return false;
-                 }
- 
-                 error(JSMSG_PAREN_AFTER_FORMAL);
-                 return false;
-             }
-@@ -3407,17 +3407,17 @@ GeneralParser<ParseHandler, CharT>::addE
-     Node pn = expr(InAllowed, yieldHandling, TripledotProhibited);
-     if (!pn)
-         return false;
-     handler.addList(nodeList, pn);
- 
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt, TokenStream::Operand))
-         return false;
--    if (tt != TokenKind::Rc) {
-+    if (tt != TokenKind::RightCurly) {
-         error(JSMSG_TEMPLSTR_UNTERM_EXPR);
-         return false;
-     }
- 
-     return tokenStream.getToken(ttp, TokenStream::TemplateTail);
- }
- 
- template <class ParseHandler, typename CharT>
-@@ -3879,17 +3879,17 @@ GeneralParser<ParseHandler, CharT>::func
-     }
- 
-     // Parse the function body.
-     FunctionBodyType bodyType = StatementListBody;
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt, TokenStream::Operand))
-         return false;
-     uint32_t openedPos = 0;
--    if (tt != TokenKind::Lc) {
-+    if (tt != TokenKind::LeftCurly) {
-         if (kind != FunctionSyntaxKind::Arrow) {
-             error(JSMSG_CURLY_BEFORE_BODY);
-             return false;
-         }
- 
-         anyChars.ungetToken();
-         bodyType = ExpressionBody;
-         funbox->setHasExprBody();
-@@ -3940,17 +3940,17 @@ GeneralParser<ParseHandler, CharT>::func
-         // we don't need call AutoAwaitIsKeyword here.
- 
-         uint32_t nameOffset = handler.getFunctionNameOffset(*pn, anyChars);
-         if (!checkBindingIdentifier(propertyName, nameOffset, nameYieldHandling))
-             return false;
-     }
- 
-     if (bodyType == StatementListBody) {
--        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                          reportMissingClosing(JSMSG_CURLY_AFTER_BODY,
-                                                               JSMSG_CURLY_OPENED, openedPos));
-         funbox->setEnd(anyChars);
-     } else {
-         MOZ_ASSERT(kind == FunctionSyntaxKind::Arrow);
- 
-         if (anyChars.hadError())
-             return false;
-@@ -4300,17 +4300,17 @@ GeneralParser<ParseHandler, CharT>::stat
-     uint32_t statementBegin = 0;
-     for (;;) {
-         TokenKind tt = TokenKind::Eof;
-         if (!tokenStream.peekToken(&tt, TokenStream::Operand)) {
-             if (anyChars.isEOF())
-                 isUnexpectedEOF_ = true;
-             return null();
-         }
--        if (tt == TokenKind::Eof || tt == TokenKind::Rc) {
-+        if (tt == TokenKind::Eof || tt == TokenKind::RightCurly) {
-             TokenPos pos;
-             if (!tokenStream.peekTokenPos(&pos, TokenStream::Operand)) {
-                 return null();
-             }
-             handler.setListEndPosition(pn, pos);
-             break;
-         }
-         if (afterReturn) {
-@@ -4346,23 +4346,23 @@ GeneralParser<ParseHandler, CharT>::stat
- 
-     return pn;
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::condition(InHandling inHandling, YieldHandling yieldHandling)
- {
--    MUST_MATCH_TOKEN(TokenKind::Lp, JSMSG_PAREN_BEFORE_COND);
-+    MUST_MATCH_TOKEN(TokenKind::LeftParen, JSMSG_PAREN_BEFORE_COND);
- 
-     Node pn = exprInParens(inHandling, yieldHandling, TripledotProhibited);
-     if (!pn)
-         return null();
- 
--    MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_COND);
-+    MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_COND);
- 
-     /* Check for (a = b) and warn about possible (a == b) mistype. */
-     if (handler.isUnparenthesizedAssignment(pn)) {
-         if (!extraWarning(JSMSG_EQUAL_AS_ASSIGN))
-             return null();
-     }
-     return pn;
- }
-@@ -4584,52 +4584,52 @@ GeneralParser<ParseHandler, CharT>::bind
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::bindingIdentifierOrPattern(DeclarationKind kind,
-                                                                YieldHandling yieldHandling,
-                                                                TokenKind tt)
- {
--    if (tt == TokenKind::Lb)
-+    if (tt == TokenKind::LeftBracket)
-         return arrayBindingPattern(kind, yieldHandling);
- 
--    if (tt == TokenKind::Lc)
-+    if (tt == TokenKind::LeftCurly)
-         return objectBindingPattern(kind, yieldHandling);
- 
-     if (!TokenKindIsPossibleIdentifierName(tt)) {
-         error(JSMSG_NO_VARIABLE_NAME);
-         return null();
-     }
- 
-     return bindingIdentifier(kind, yieldHandling);
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::objectBindingPattern(DeclarationKind kind,
-                                                          YieldHandling yieldHandling)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lc));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftCurly));
- 
-     if (!CheckRecursionLimit(context))
-         return null();
- 
-     uint32_t begin = pos().begin;
-     Node literal = handler.newObjectLiteral(begin);
-     if (!literal)
-         return null();
- 
-     Maybe<DeclarationKind> declKind = Some(kind);
-     RootedAtom propAtom(context);
-     for (;;) {
-         TokenKind tt;
-         if (!tokenStream.peekToken(&tt))
-             return null();
--        if (tt == TokenKind::Rc) {
-+        if (tt == TokenKind::RightCurly) {
-             anyChars.addModifierException(TokenStream::OperandIsNone);
-             break;
-         }
- 
-         if (tt == TokenKind::TripleDot) {
-             tokenStream.consumeKnownToken(TokenKind::TripleDot);
-             uint32_t begin = pos().begin;
- 
-@@ -4718,30 +4718,30 @@ GeneralParser<ParseHandler, CharT>::obje
-         if (!matched)
-             break;
-         if (tt == TokenKind::TripleDot) {
-             error(JSMSG_REST_WITH_COMMA);
-             return null();
-         }
-     }
- 
--    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                      reportMissingClosing(JSMSG_CURLY_AFTER_LIST,
-                                                           JSMSG_CURLY_OPENED, begin));
- 
-     handler.setEndPosition(literal, pos().end);
-     return literal;
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::arrayBindingPattern(DeclarationKind kind,
-                                                         YieldHandling yieldHandling)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lb));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftBracket));
- 
-     if (!CheckRecursionLimit(context))
-         return null();
- 
-     uint32_t begin = pos().begin;
-     Node literal = handler.newArrayLiteral(begin);
-     if (!literal)
-         return null();
-@@ -4752,17 +4752,17 @@ GeneralParser<ParseHandler, CharT>::arra
-              error(JSMSG_ARRAY_INIT_TOO_BIG);
-              return null();
-          }
- 
-          TokenKind tt;
-          if (!tokenStream.getToken(&tt))
-              return null();
- 
--         if (tt == TokenKind::Rb) {
-+         if (tt == TokenKind::RightBracket) {
-              anyChars.ungetToken();
-              anyChars.addModifierException(TokenStream::OperandIsNone);
-              break;
-          }
- 
-          if (tt == TokenKind::Comma) {
-              if (!handler.addElision(literal, pos()))
-                  return null();
-@@ -4807,34 +4807,34 @@ GeneralParser<ParseHandler, CharT>::arra
- 
-              if (tt == TokenKind::TripleDot) {
-                  error(JSMSG_REST_WITH_COMMA);
-                  return null();
-              }
-          }
-      }
- 
--     MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rb, TokenStream::Operand,
-+     MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightBracket, TokenStream::Operand,
-                                       reportMissingClosing(JSMSG_BRACKET_AFTER_LIST,
-                                                            JSMSG_BRACKET_OPENED, begin));
- 
-     handler.setEndPosition(literal, pos().end);
-     return literal;
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::destructuringDeclaration(DeclarationKind kind,
-                                                              YieldHandling yieldHandling,
-                                                              TokenKind tt)
- {
-     MOZ_ASSERT(anyChars.isCurrentTokenType(tt));
--    MOZ_ASSERT(tt == TokenKind::Lb || tt == TokenKind::Lc);
--
--    return tt == TokenKind::Lb
-+    MOZ_ASSERT(tt == TokenKind::LeftBracket || tt == TokenKind::LeftCurly);
-+
-+    return tt == TokenKind::LeftBracket
-            ? arrayBindingPattern(kind, yieldHandling)
-            : objectBindingPattern(kind, yieldHandling);
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::destructuringDeclarationWithoutYieldOrAwait(DeclarationKind kind,
-                                                                                 YieldHandling yieldHandling,
-@@ -4856,29 +4856,29 @@ GeneralParser<ParseHandler, CharT>::dest
-     return res;
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::blockStatement(YieldHandling yieldHandling,
-                                                    unsigned errorNumber)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lc));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftCurly));
-     uint32_t openedPos = pos().begin;
- 
-     ParseContext::Statement stmt(pc, StatementKind::Block);
-     ParseContext::Scope scope(this);
-     if (!scope.init(pc))
-         return null();
- 
-     Node list = statementList(yieldHandling);
-     if (!list)
-         return null();
- 
--    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                      reportMissingClosing(errorNumber, JSMSG_CURLY_OPENED,
-                                                           openedPos));
- 
-     return finishLexicalScope(scope, list);
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
-@@ -4895,18 +4895,18 @@ GeneralParser<ParseHandler, CharT>::expr
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::declarationPattern(DeclarationKind declKind, TokenKind tt,
-                                                        bool initialDeclaration,
-                                                        YieldHandling yieldHandling,
-                                                        ParseNodeKind* forHeadKind,
-                                                        Node* forInOrOfExpression)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lb) ||
--               anyChars.isCurrentTokenType(TokenKind::Lc));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftBracket) ||
-+               anyChars.isCurrentTokenType(TokenKind::LeftCurly));
- 
-     Node pattern = destructuringDeclaration(declKind, yieldHandling, tt);
-     if (!pattern)
-         return null();
- 
-     if (initialDeclaration && forHeadKind) {
-         bool isForIn, isForOf;
-         if (!matchInOrOf(&isForIn, &isForOf))
-@@ -5119,17 +5119,17 @@ GeneralParser<ParseHandler, CharT>::decl
-     do {
-         MOZ_ASSERT_IF(!initialDeclaration && forHeadKind,
-                       *forHeadKind == ParseNodeKind::ForHead);
- 
-         TokenKind tt;
-         if (!tokenStream.getToken(&tt))
-             return null();
- 
--        Node binding = (tt == TokenKind::Lb || tt == TokenKind::Lc)
-+        Node binding = (tt == TokenKind::LeftBracket || tt == TokenKind::LeftCurly)
-                        ? declarationPattern(declKind, tt, initialDeclaration, yieldHandling,
-                                             forHeadKind, forInOrOfExpression)
-                        : declarationName(declKind, tt, initialDeclaration, yieldHandling,
-                                          forHeadKind, forInOrOfExpression);
-         if (!binding)
-             return null();
- 
-         handler.addList(decl, binding);
-@@ -5175,25 +5175,25 @@ GeneralParser<ParseHandler, CharT>::lexi
- 
-     return decl;
- }
- 
- template <typename CharT>
- bool
- Parser<FullParseHandler, CharT>::namedImportsOrNamespaceImport(TokenKind tt, Node importSpecSet)
- {
--    if (tt == TokenKind::Lc) {
-+    if (tt == TokenKind::LeftCurly) {
-         while (true) {
-             // Handle the forms |import {} from 'a'| and
-             // |import { ..., } from 'a'| (where ... is non empty), by
-             // escaping the loop early if the next token is }.
-             if (!tokenStream.getToken(&tt))
-                 return false;
- 
--            if (tt == TokenKind::Rc)
-+            if (tt == TokenKind::RightCurly)
-                 break;
- 
-             if (!TokenKindIsPossibleIdentifierName(tt)) {
-                 error(JSMSG_NO_IMPORT_NAME);
-                 return false;
-             }
- 
-             Rooted<PropertyName*> importName(context, anyChars.currentName());
-@@ -5242,17 +5242,17 @@ Parser<FullParseHandler, CharT>::namedIm
-                 return false;
- 
-             handler.addList(importSpecSet, importSpec);
- 
-             TokenKind next;
-             if (!tokenStream.getToken(&next))
-                 return false;
- 
--            if (next == TokenKind::Rc)
-+            if (next == TokenKind::RightCurly)
-                 break;
- 
-             if (next != TokenKind::Comma) {
-                 error(JSMSG_RC_AFTER_IMPORT_SPEC_LIST);
-                 return false;
-             }
-         }
-     } else {
-@@ -5313,17 +5313,17 @@ Parser<FullParseHandler, CharT>::importD
-     if (!importSpecSet)
-         return null();
- 
-     if (tt == TokenKind::String) {
-         // Handle the form |import 'a'| by leaving the list empty. This is
-         // equivalent to |import {} from 'a'|.
-         importSpecSet->pn_pos.end = importSpecSet->pn_pos.begin;
-     } else {
--        if (tt == TokenKind::Lc || tt == TokenKind::Mul) {
-+        if (tt == TokenKind::LeftCurly || tt == TokenKind::Mul) {
-             if (!namedImportsOrNamespaceImport(tt, importSpecSet))
-                 return null();
-         } else if (TokenKindIsPossibleIdentifierName(tt)) {
-             // Handle the form |import a from 'b'|, by adding a single import
-             // specifier to the list, with 'default' as the import name and
-             // 'a' as the binding name. This is equivalent to
-             // |import { default as a } from 'b'|.
-             Node importName = newName(context->names().default_);
-@@ -5350,17 +5350,17 @@ Parser<FullParseHandler, CharT>::importD
-             if (!tokenStream.peekToken(&tt))
-                 return null();
- 
-             if (tt == TokenKind::Comma) {
-                 tokenStream.consumeKnownToken(tt);
-                 if (!tokenStream.getToken(&tt))
-                     return null();
- 
--                if (tt != TokenKind::Lc && tt != TokenKind::Mul) {
-+                if (tt != TokenKind::LeftCurly && tt != TokenKind::Mul) {
-                     error(JSMSG_NAMED_IMPORTS_OR_NAMESPACE_IMPORT);
-                     return null();
-                 }
- 
-                 if (!namedImportsOrNamespaceImport(tt, importSpecSet))
-                     return null();
-             }
-         } else {
-@@ -5794,30 +5794,30 @@ GeneralParser<ParseHandler, CharT>::chec
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::exportClause(uint32_t begin)
- {
-     if (!abortIfSyntaxParser())
-         return null();
- 
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lc));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftCurly));
- 
-     Node kid = handler.newList(ParseNodeKind::ExportSpecList, pos());
-     if (!kid)
-         return null();
- 
-     TokenKind tt;
-     while (true) {
-         // Handle the forms |export {}| and |export { ..., }| (where ... is non
-         // empty), by escaping the loop early if the next token is }.
-         if (!tokenStream.getToken(&tt))
-             return null();
- 
--        if (tt == TokenKind::Rc)
-+        if (tt == TokenKind::RightCurly)
-             break;
- 
-         if (!TokenKindIsPossibleIdentifierName(tt)) {
-             error(JSMSG_NO_BINDING_NAME);
-             return null();
-         }
- 
-         Node bindingName = newName(anyChars.currentName());
-@@ -5842,17 +5842,17 @@ GeneralParser<ParseHandler, CharT>::expo
-             return null();
- 
-         handler.addList(kid, exportSpec);
- 
-         TokenKind next;
-         if (!tokenStream.getToken(&next))
-             return null();
- 
--        if (next == TokenKind::Rc)
-+        if (next == TokenKind::RightCurly)
-             break;
- 
-         if (next != TokenKind::Comma) {
-             error(JSMSG_RC_AFTER_EXPORT_SPEC_LIST);
-             return null();
-         }
-     }
- 
-@@ -6142,17 +6142,17 @@ GeneralParser<ParseHandler, CharT>::expo
- 
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt))
-         return null();
-     switch (tt) {
-       case TokenKind::Mul:
-         return exportBatch(begin);
- 
--      case TokenKind::Lc:
-+      case TokenKind::LeftCurly:
-         return exportClause(begin);
- 
-       case TokenKind::Var:
-         return exportVariableStatement(begin);
- 
-       case TokenKind::Function:
-         return exportFunctionDeclaration(begin, pos().begin);
- 
-@@ -6378,17 +6378,17 @@ GeneralParser<ParseHandler, CharT>::matc
- 
- template <class ParseHandler, typename CharT>
- bool
- GeneralParser<ParseHandler, CharT>::forHeadStart(YieldHandling yieldHandling,
-                                                  ParseNodeKind* forHeadKind, Node* forInitialPart,
-                                                  Maybe<ParseContext::Scope>& forLoopLexicalScope,
-                                                  Node* forInOrOfExpression)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lp));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftParen));
- 
-     TokenKind tt;
-     if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-         return null();
- 
-     // Super-duper easy case: |for (;| is a C-style for-loop with no init
-     // component.
-     if (tt == TokenKind::Semi) {
-@@ -6550,17 +6550,17 @@ GeneralParser<ParseHandler, CharT>::forS
-             return null();
- 
-         if (matched) {
-             iflags |= JSITER_FORAWAITOF;
-             iterKind = IteratorKind::Async;
-         }
-     }
- 
--    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Lp, TokenStream::None,
-+    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::LeftParen, TokenStream::None,
-                                      error((token == TokenKind::Await && !pc->isAsync())
-                                            ? JSMSG_FOR_AWAIT_OUTSIDE_ASYNC
-                                            : JSMSG_PAREN_AFTER_FOR));
- 
-     // ParseNodeKind::ForHead, ParseNodeKind::ForIn, or
-     // ParseNodeKind::ForOf depending on the loop type.
-     ParseNodeKind headKind;
- 
-@@ -6630,25 +6630,25 @@ GeneralParser<ParseHandler, CharT>::forS
-         }
- 
-         MUST_MATCH_TOKEN_MOD(TokenKind::Semi, TokenStream::Operand, JSMSG_SEMI_AFTER_FOR_COND);
- 
-         if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-             return null();
- 
-         Node update;
--        if (tt == TokenKind::Rp) {
-+        if (tt == TokenKind::RightParen) {
-             update = null();
-         } else {
-             update = expr(InAllowed, yieldHandling, TripledotProhibited);
-             if (!update)
-                 return null();
-         }
- 
--        MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_FOR_CTRL);
-+        MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_FOR_CTRL);
- 
-         TokenPos headPos(begin, pos().end);
-         forHead = handler.newForHead(init, test, update, headPos);
-         if (!forHead)
-             return null();
-     } else {
-         MOZ_ASSERT(headKind == ParseNodeKind::ForIn || headKind == ParseNodeKind::ForOf);
- 
-@@ -6661,17 +6661,17 @@ GeneralParser<ParseHandler, CharT>::forS
-         if (headKind == ParseNodeKind::ForIn)
-             stmt.refineForKind(StatementKind::ForInLoop);
-         else
-             stmt.refineForKind(StatementKind::ForOfLoop);
- 
-         // Parser::declaration consumed everything up to the closing ')'.  That
-         // token follows an {Assignment,}Expression and so must be interpreted
-         // as an operand to be consistent with normal expression tokenizing.
--        MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_FOR_CTRL);
-+        MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_FOR_CTRL);
- 
-         TokenPos headPos(begin, pos().end);
-         forHead = handler.newForInOrOfHead(headKind, target, iteratedExpr, headPos);
-         if (!forHead)
-             return null();
-     }
- 
-     Node body = statement(yieldHandling);
-@@ -6690,40 +6690,40 @@ GeneralParser<ParseHandler, CharT>::forS
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::switchStatement(YieldHandling yieldHandling)
- {
-     MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Switch));
-     uint32_t begin = pos().begin;
- 
--    MUST_MATCH_TOKEN(TokenKind::Lp, JSMSG_PAREN_BEFORE_SWITCH);
-+    MUST_MATCH_TOKEN(TokenKind::LeftParen, JSMSG_PAREN_BEFORE_SWITCH);
- 
-     Node discriminant = exprInParens(InAllowed, yieldHandling, TripledotProhibited);
-     if (!discriminant)
-         return null();
- 
--    MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_SWITCH);
--    MUST_MATCH_TOKEN(TokenKind::Lc, JSMSG_CURLY_BEFORE_SWITCH);
-+    MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_SWITCH);
-+    MUST_MATCH_TOKEN(TokenKind::LeftCurly, JSMSG_CURLY_BEFORE_SWITCH);
- 
-     ParseContext::Statement stmt(pc, StatementKind::Switch);
-     ParseContext::Scope scope(this);
-     if (!scope.init(pc))
-         return null();
- 
-     Node caseList = handler.newStatementList(pos());
-     if (!caseList)
-         return null();
- 
-     bool seenDefault = false;
-     TokenKind tt;
-     while (true) {
-         if (!tokenStream.getToken(&tt, TokenStream::Operand))
-             return null();
--        if (tt == TokenKind::Rc)
-+        if (tt == TokenKind::RightCurly)
-             break;
-         uint32_t caseBegin = pos().begin;
- 
-         Node caseExpr;
-         switch (tt) {
-           case TokenKind::Default:
-             if (seenDefault) {
-                 error(JSMSG_TOO_MANY_DEFAULTS);
-@@ -6751,17 +6751,17 @@ GeneralParser<ParseHandler, CharT>::swit
-             return null();
- 
-         bool afterReturn = false;
-         bool warnedAboutStatementsAfterReturn = false;
-         uint32_t statementBegin = 0;
-         while (true) {
-             if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-                 return null();
--            if (tt == TokenKind::Rc || tt == TokenKind::Case || tt == TokenKind::Default)
-+            if (tt == TokenKind::RightCurly || tt == TokenKind::Case || tt == TokenKind::Default)
-                 break;
-             if (afterReturn) {
-                 if (!tokenStream.peekOffset(&statementBegin, TokenStream::Operand))
-                     return null();
-             }
-             Node stmt = statementListItem(yieldHandling);
-             if (!stmt)
-                 return null();
-@@ -6881,17 +6881,17 @@ GeneralParser<ParseHandler, CharT>::retu
-     Node exprNode;
-     TokenKind tt = TokenKind::Eof;
-     if (!tokenStream.peekTokenSameLine(&tt, TokenStream::Operand))
-         return null();
-     switch (tt) {
-       case TokenKind::Eol:
-       case TokenKind::Eof:
-       case TokenKind::Semi:
--      case TokenKind::Rc:
-+      case TokenKind::RightCurly:
-         exprNode = null();
-         break;
-       default: {
-         exprNode = expr(InAllowed, yieldHandling, TripledotProhibited);
-         if (!exprNode)
-             return null();
-       }
-     }
-@@ -6924,19 +6924,19 @@ GeneralParser<ParseHandler, CharT>::yiel
-       // quirk in the grammar.
-       case TokenKind::Eol:
-       // The rest of these make up the complete set of tokens that can
-       // appear after any of the places where AssignmentExpression is used
-       // throughout the grammar.  Conveniently, none of them can also be the
-       // start an expression.
-       case TokenKind::Eof:
-       case TokenKind::Semi:
--      case TokenKind::Rc:
--      case TokenKind::Rb:
--      case TokenKind::Rp:
-+      case TokenKind::RightCurly:
-+      case TokenKind::RightBracket:
-+      case TokenKind::RightParen:
-       case TokenKind::Colon:
-       case TokenKind::Comma:
-       case TokenKind::In:
-         // No value.
-         exprNode = null();
-         anyChars.addModifierException(TokenStream::NoneIsOperand);
-         break;
-       case TokenKind::Mul:
-@@ -6965,23 +6965,23 @@ GeneralParser<ParseHandler, CharT>::with
-     // use strictModeError directly.  But while 'with' is forbidden in strict
-     // mode code, it doesn't even merit a warning in non-strict code.  See
-     // https://bugzilla.mozilla.org/show_bug.cgi?id=514576#c1.
-     if (pc->sc()->strict()) {
-         if (!strictModeError(JSMSG_STRICT_CODE_WITH))
-             return null();
-     }
- 
--    MUST_MATCH_TOKEN(TokenKind::Lp, JSMSG_PAREN_BEFORE_WITH);
-+    MUST_MATCH_TOKEN(TokenKind::LeftParen, JSMSG_PAREN_BEFORE_WITH);
- 
-     Node objectExpr = exprInParens(InAllowed, yieldHandling, TripledotProhibited);
-     if (!objectExpr)
-         return null();
- 
--    MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_WITH);
-+    MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_WITH);
- 
-     Node innerBlock;
-     {
-         ParseContext::Statement stmt(pc, StatementKind::With);
-         innerBlock = statement(yieldHandling);
-         if (!innerBlock)
-             return null();
-     }
-@@ -7062,17 +7062,17 @@ GeneralParser<ParseHandler, CharT>::thro
- {
-     MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Throw));
-     uint32_t begin = pos().begin;
- 
-     /* ECMA-262 Edition 3 says 'throw [no LineTerminator here] Expr'. */
-     TokenKind tt = TokenKind::Eof;
-     if (!tokenStream.peekTokenSameLine(&tt, TokenStream::Operand))
-         return null();
--    if (tt == TokenKind::Eof || tt == TokenKind::Semi || tt == TokenKind::Rc) {
-+    if (tt == TokenKind::Eof || tt == TokenKind::Semi || tt == TokenKind::RightCurly) {
-         error(JSMSG_MISSING_EXPR_AFTER_THROW);
-         return null();
-     }
-     if (tt == TokenKind::Eol) {
-         error(JSMSG_LINE_BREAK_AFTER_THROW);
-         return null();
-     }
- 
-@@ -7100,41 +7100,41 @@ GeneralParser<ParseHandler, CharT>::tryS
-      * kid3 is the finally statement
-      *
-      * catch nodes are binary.
-      * left is the catch-name/pattern or null
-      * right is the catch block
-      *
-      * catch lvalue nodes are either:
-      *   a single identifier
--     *   TokenKind::Rb or TokenKind::Rc for a destructuring left-hand side
-+     *   TokenKind::RightBracket or TokenKind::RightCurly for a destructuring left-hand side
-      *
--     * finally nodes are TokenKind::Lc statement lists.
-+     * finally nodes are TokenKind::LeftCurly statement lists.
-      */
- 
-     Node innerBlock;
-     {
--        MUST_MATCH_TOKEN(TokenKind::Lc, JSMSG_CURLY_BEFORE_TRY);
-+        MUST_MATCH_TOKEN(TokenKind::LeftCurly, JSMSG_CURLY_BEFORE_TRY);
- 
-         uint32_t openedPos = pos().begin;
- 
-         ParseContext::Statement stmt(pc, StatementKind::Try);
-         ParseContext::Scope scope(this);
-         if (!scope.init(pc))
-             return null();
- 
-         innerBlock = statementList(yieldHandling);
-         if (!innerBlock)
-             return null();
- 
-         innerBlock = finishLexicalScope(scope, innerBlock);
-         if (!innerBlock)
-             return null();
- 
--        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                          reportMissingClosing(JSMSG_CURLY_AFTER_TRY,
-                                                               JSMSG_CURLY_OPENED, openedPos));
-     }
- 
-     Node catchScope = null();
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt))
-         return null();
-@@ -7150,30 +7150,30 @@ GeneralParser<ParseHandler, CharT>::tryS
- 
-         /*
-          * Legal catch forms are:
-          *   catch (lhs) {
-          *   catch {
-          * where lhs is a name or a destructuring left-hand side.
-          */
-         bool omittedBinding;
--        if (!tokenStream.matchToken(&omittedBinding, TokenKind::Lc))
-+        if (!tokenStream.matchToken(&omittedBinding, TokenKind::LeftCurly))
-             return null();
- 
-         Node catchName;
-         if (omittedBinding) {
-             catchName = null();
-         } else {
--            MUST_MATCH_TOKEN(TokenKind::Lp, JSMSG_PAREN_BEFORE_CATCH);
-+            MUST_MATCH_TOKEN(TokenKind::LeftParen, JSMSG_PAREN_BEFORE_CATCH);
- 
-             if (!tokenStream.getToken(&tt))
-                 return null();
-             switch (tt) {
--              case TokenKind::Lb:
--              case TokenKind::Lc:
-+              case TokenKind::LeftBracket:
-+              case TokenKind::LeftCurly:
-                 catchName = destructuringDeclaration(DeclarationKind::CatchParameter,
-                                                      yieldHandling, tt);
-                 if (!catchName)
-                     return null();
-                 break;
- 
-               default: {
-                 if (!TokenKindIsPossibleIdentifierName(tt)) {
-@@ -7184,19 +7184,19 @@ GeneralParser<ParseHandler, CharT>::tryS
-                 catchName = bindingIdentifier(DeclarationKind::SimpleCatchParameter,
-                                               yieldHandling);
-                 if (!catchName)
-                     return null();
-                 break;
-               }
-             }
- 
--            MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_CATCH);
--
--            MUST_MATCH_TOKEN(TokenKind::Lc, JSMSG_CURLY_BEFORE_CATCH);
-+            MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_CATCH);
-+
-+            MUST_MATCH_TOKEN(TokenKind::LeftCurly, JSMSG_CURLY_BEFORE_CATCH);
-         }
- 
-         Node catchBody = catchBlockStatement(yieldHandling, scope);
-         if (!catchBody)
-             return null();
- 
-         catchScope = finishLexicalScope(scope, catchBody);
-         if (!catchScope)
-@@ -7208,34 +7208,34 @@ GeneralParser<ParseHandler, CharT>::tryS
- 
-         if (!tokenStream.getToken(&tt, TokenStream::Operand))
-             return null();
-     }
- 
-     Node finallyBlock = null();
- 
-     if (tt == TokenKind::Finally) {
--        MUST_MATCH_TOKEN(TokenKind::Lc, JSMSG_CURLY_BEFORE_FINALLY);
-+        MUST_MATCH_TOKEN(TokenKind::LeftCurly, JSMSG_CURLY_BEFORE_FINALLY);
- 
-         uint32_t openedPos = pos().begin;
- 
-         ParseContext::Statement stmt(pc, StatementKind::Finally);
-         ParseContext::Scope scope(this);
-         if (!scope.init(pc))
-             return null();
- 
-         finallyBlock = statementList(yieldHandling);
-         if (!finallyBlock)
-             return null();
- 
-         finallyBlock = finishLexicalScope(scope, finallyBlock);
-         if (!finallyBlock)
-             return null();
- 
--        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                          reportMissingClosing(JSMSG_CURLY_AFTER_FINALLY,
-                                                               JSMSG_CURLY_OPENED, openedPos));
-     } else {
-         anyChars.ungetToken();
-     }
-     if (!catchScope && !finallyBlock) {
-         error(JSMSG_CATCH_OR_FINALLY);
-         return null();
-@@ -7265,17 +7265,17 @@ GeneralParser<ParseHandler, CharT>::catc
-     // block, so declare the name in the inner scope.
-     if (!scope.addCatchParameters(pc, catchParamScope))
-         return null();
- 
-     Node list = statementList(yieldHandling);
-     if (!list)
-         return null();
- 
--    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                      reportMissingClosing(JSMSG_CURLY_AFTER_CATCH,
-                                                           JSMSG_CURLY_OPENED, openedPos));
- 
-     // The catch parameter names are not bound in the body scope, so remove
-     // them before generating bindings.
-     scope.removeCatchParameters(pc, catchParamScope);
-     return finishLexicalScope(scope, list);
- }
-@@ -7380,44 +7380,44 @@ GeneralParser<ParseHandler, CharT>::clas
-     if (hasHeritage) {
-         if (!tokenStream.getToken(&tt))
-             return null();
-         classHeritage = memberExpr(yieldHandling, TripledotProhibited, tt);
-         if (!classHeritage)
-             return null();
-     }
- 
--    MUST_MATCH_TOKEN(TokenKind::Lc, JSMSG_CURLY_BEFORE_CLASS);
-+    MUST_MATCH_TOKEN(TokenKind::LeftCurly, JSMSG_CURLY_BEFORE_CLASS);
- 
-     Node classMethods = handler.newClassMethodList(pos().begin);
-     if (!classMethods)
-         return null();
- 
-     Maybe<DeclarationKind> declKind = Nothing();
-     for (;;) {
-         TokenKind tt;
-         if (!tokenStream.getToken(&tt))
-             return null();
--        if (tt == TokenKind::Rc)
-+        if (tt == TokenKind::RightCurly)
-             break;
- 
-         if (tt == TokenKind::Semi)
-             continue;
- 
-         bool isStatic = false;
-         if (tt == TokenKind::Static) {
-             if (!tokenStream.peekToken(&tt))
-                 return null();
--            if (tt == TokenKind::Rc) {
-+            if (tt == TokenKind::RightCurly) {
-                 tokenStream.consumeKnownToken(tt);
-                 error(JSMSG_UNEXPECTED_TOKEN, "property name", TokenKindToDesc(tt));
-                 return null();
-             }
- 
--            if (tt != TokenKind::Lp)
-+            if (tt != TokenKind::LeftParen)
-                 isStatic = true;
-             else
-                 anyChars.ungetToken();
-         } else {
-             anyChars.ungetToken();
-         }
- 
-         uint32_t nameOffset;
-@@ -7453,28 +7453,28 @@ GeneralParser<ParseHandler, CharT>::clas
-             errorAt(nameOffset, JSMSG_BAD_METHOD_DEF);
-             return null();
-         }
- 
-         RootedAtom funName(context);
-         switch (propType) {
-           case PropertyType::Getter:
-           case PropertyType::Setter:
--            if (!anyChars.isCurrentTokenType(TokenKind::Rb)) {
-+            if (!anyChars.isCurrentTokenType(TokenKind::RightBracket)) {
-                 funName = prefixAccessorName(propType, propAtom);
-                 if (!funName)
-                     return null();
-             }
-             break;
-           case PropertyType::Constructor:
-           case PropertyType::DerivedConstructor:
-             funName = name;
-             break;
-           default:
--            if (!anyChars.isCurrentTokenType(TokenKind::Rb))
-+            if (!anyChars.isCurrentTokenType(TokenKind::RightBracket))
-                 funName = propAtom;
-         }
- 
-         // Calling toString on constructors need to return the source text for
-         // the entire class. The end offset is unknown at this point in
-         // parsing and will be amended when class parsing finishes below.
-         Node fn = methodDefinition(isConstructor ? classStartOffset : nameOffset,
-                                    propType, funName);
-@@ -7542,17 +7542,17 @@ bool
- ParserBase::nextTokenContinuesLetDeclaration(TokenKind next)
- {
-     MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Let));
-     MOZ_ASSERT(anyChars.nextToken().type == next);
- 
-     TokenStreamShared::verifyConsistentModifier(TokenStreamShared::None, anyChars.nextToken());
- 
-     // Destructuring continues a let declaration.
--    if (next == TokenKind::Lb || next == TokenKind::Lc)
-+    if (next == TokenKind::LeftBracket || next == TokenKind::LeftCurly)
-         return true;
- 
-     // A "let" edge case deserves special comment.  Consider this:
-     //
-     //   let     // not an ASI opportunity
-     //   let;
-     //
-     // Static semantics in §13.3.1.1 turn a LexicalDeclaration that binds
-@@ -7587,17 +7587,17 @@ GeneralParser<ParseHandler, CharT>::stat
-         return null();
- 
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt, TokenStream::Operand))
-         return null();
- 
-     switch (tt) {
-       // BlockStatement[?Yield, ?Return]
--      case TokenKind::Lc:
-+      case TokenKind::LeftCurly:
-         return blockStatement(yieldHandling);
- 
-       // VariableStatement[?Yield]
-       case TokenKind::Var:
-         return variableStatement(yieldHandling);
- 
-       // EmptyStatement
-       case TokenKind::Semi:
-@@ -7636,32 +7636,32 @@ GeneralParser<ParseHandler, CharT>::stat
-         if (!tokenStream.peekToken(&next))
-             return null();
- 
-         // |let| here can only be an Identifier, not a declaration.  Give nicer
-         // errors for declaration-looking typos.
-         if (tt == TokenKind::Let) {
-             bool forbiddenLetDeclaration = false;
- 
--            if (next == TokenKind::Lb) {
-+            if (next == TokenKind::LeftBracket) {
-                 // Enforce ExpressionStatement's 'let [' lookahead restriction.
-                 forbiddenLetDeclaration = true;
--            } else if (next == TokenKind::Lc || TokenKindIsPossibleIdentifier(next)) {
-+            } else if (next == TokenKind::LeftCurly || TokenKindIsPossibleIdentifier(next)) {
-                 // 'let {' and 'let foo' aren't completely forbidden, if ASI
-                 // causes 'let' to be the entire Statement.  But if they're
-                 // same-line, we can aggressively give a better error message.
-                 //
-                 // Note that this ignores 'yield' as TokenKind::Yield: we'll handle it
-                 // correctly but with a worse error message.
-                 TokenKind nextSameLine;
-                 if (!tokenStream.peekTokenSameLine(&nextSameLine))
-                     return null();
- 
-                 MOZ_ASSERT(TokenKindIsPossibleIdentifier(nextSameLine) ||
--                           nextSameLine == TokenKind::Lc ||
-+                           nextSameLine == TokenKind::LeftCurly ||
-                            nextSameLine == TokenKind::Eol);
- 
-                 forbiddenLetDeclaration = nextSameLine != TokenKind::Eol;
-             }
- 
-             if (forbiddenLetDeclaration) {
-                 error(JSMSG_FORBIDDEN_AS_STATEMENT, "lexical declarations");
-                 return null();
-@@ -7805,17 +7805,17 @@ GeneralParser<ParseHandler, CharT>::stat
-         return null();
- 
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt, TokenStream::Operand))
-         return null();
- 
-     switch (tt) {
-       // BlockStatement[?Yield, ?Return]
--      case TokenKind::Lc:
-+      case TokenKind::LeftCurly:
-         return blockStatement(yieldHandling);
- 
-       // VariableStatement[?Yield]
-       case TokenKind::Var:
-         return variableStatement(yieldHandling);
- 
-       // EmptyStatement
-       case TokenKind::Semi:
-@@ -8014,23 +8014,23 @@ GeneralParser<ParseHandler, CharT>::expr
-         // directly under CoverParenthesizedExpressionAndArrowParameterList,
-         // and the next two tokens are closing parenthesis and arrow. If all
-         // are present allow the trailing comma.
-         if (tripledotHandling == TripledotAllowed) {
-             TokenKind tt;
-             if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-                 return null();
- 
--            if (tt == TokenKind::Rp) {
--                tokenStream.consumeKnownToken(TokenKind::Rp, TokenStream::Operand);
-+            if (tt == TokenKind::RightParen) {
-+                tokenStream.consumeKnownToken(TokenKind::RightParen, TokenStream::Operand);
- 
-                 if (!tokenStream.peekToken(&tt))
-                     return null();
-                 if (tt != TokenKind::Arrow) {
--                    error(JSMSG_UNEXPECTED_TOKEN, "expression", TokenKindToDesc(TokenKind::Rp));
-+                    error(JSMSG_UNEXPECTED_TOKEN, "expression", TokenKindToDesc(TokenKind::RightParen));
-                     return null();
-                 }
- 
-                 anyChars.ungetToken();  // put back right paren
-                 break;
-             }
-         }
- 
-@@ -8357,17 +8357,17 @@ GeneralParser<ParseHandler, CharT>::assi
- 
-             TokenKind nextSameLine = TokenKind::Eof;
-             if (!tokenStream.peekTokenSameLine(&nextSameLine))
-                 return null();
- 
-             // The AsyncArrowFunction production are
-             //   async [no LineTerminator here] AsyncArrowBindingIdentifier ...
-             //   async [no LineTerminator here] ArrowFormalParameters ...
--            if (TokenKindIsPossibleIdentifier(nextSameLine) || nextSameLine == TokenKind::Lp)
-+            if (TokenKindIsPossibleIdentifier(nextSameLine) || nextSameLine == TokenKind::LeftParen)
-                 asyncKind = FunctionAsyncKind::AsyncFunction;
-             else
-                 anyChars.ungetToken();
-         }
- 
-         Node pn = handler.newArrowFunction(pos());
-         if (!pn)
-             return null();
-@@ -8678,17 +8678,17 @@ typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::argumentList(YieldHandling yieldHandling, bool* isSpread,
-                                                  PossibleError* possibleError /* = nullptr */)
- {
-     Node argsList = handler.newArguments(pos());
-     if (!argsList)
-         return null();
- 
-     bool matched;
--    if (!tokenStream.matchToken(&matched, TokenKind::Rp, TokenStream::Operand))
-+    if (!tokenStream.matchToken(&matched, TokenKind::RightParen, TokenStream::Operand))
-         return null();
-     if (matched) {
-         handler.setEndPosition(argsList, pos().end);
-         return argsList;
-     }
- 
-     while (true) {
-         bool spread = false;
-@@ -8716,21 +8716,21 @@ GeneralParser<ParseHandler, CharT>::argu
-         if (!tokenStream.matchToken(&matched, TokenKind::Comma, TokenStream::Operand))
-             return null();
-         if (!matched)
-             break;
- 
-         TokenKind tt;
-         if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-             return null();
--        if (tt == TokenKind::Rp)
-+        if (tt == TokenKind::RightParen)
-             break;
-     }
- 
--    MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_AFTER_ARGS);
-+    MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_ARGS);
- 
-     handler.setEndPosition(argsList, pos().end);
-     return argsList;
- }
- 
- bool
- ParserBase::checkAndMarkSuperScope()
- {
-@@ -8770,17 +8770,17 @@ GeneralParser<ParseHandler, CharT>::memb
-             tt = anyChars.currentToken().type;
-             Node ctorExpr = memberExpr(yieldHandling, TripledotProhibited, tt,
-                                        /* allowCallSyntax = */ false,
-                                        /* possibleError = */ nullptr, PredictInvoked);
-             if (!ctorExpr)
-                 return null();
- 
-             bool matched;
--            if (!tokenStream.matchToken(&matched, TokenKind::Lp))
-+            if (!tokenStream.matchToken(&matched, TokenKind::LeftParen))
-                 return null();
- 
-             bool isSpread = false;
-             Node args;
-             if (matched) {
-                 args = argumentList(yieldHandling, &isSpread);
-             } else {
-                 args = handler.newArguments(pos());
-@@ -8838,41 +8838,41 @@ GeneralParser<ParseHandler, CharT>::memb
- 
-                 nextMember = handler.newPropertyAccess(lhs, name);
-                 if (!nextMember)
-                     return null();
-             } else {
-                 error(JSMSG_NAME_AFTER_DOT);
-                 return null();
-             }
--        } else if (tt == TokenKind::Lb) {
-+        } else if (tt == TokenKind::LeftBracket) {
-             Node propExpr = expr(InAllowed, yieldHandling, TripledotProhibited);
-             if (!propExpr)
-                 return null();
- 
--            MUST_MATCH_TOKEN_MOD(TokenKind::Rb, TokenStream::Operand, JSMSG_BRACKET_IN_INDEX);
-+            MUST_MATCH_TOKEN_MOD(TokenKind::RightBracket, TokenStream::Operand, JSMSG_BRACKET_IN_INDEX);
- 
-             if (handler.isSuperBase(lhs) && !checkAndMarkSuperScope()) {
-                 error(JSMSG_BAD_SUPERPROP, "member");
-                 return null();
-             }
-             nextMember = handler.newPropertyByValue(lhs, propExpr, pos().end);
-             if (!nextMember)
-                 return null();
--        } else if ((allowCallSyntax && tt == TokenKind::Lp) ||
-+        } else if ((allowCallSyntax && tt == TokenKind::LeftParen) ||
-                    tt == TokenKind::TemplateHead ||
-                    tt == TokenKind::NoSubsTemplate)
-         {
-             if (handler.isSuperBase(lhs)) {
-                 if (!pc->sc()->allowSuperCall()) {
-                     error(JSMSG_BAD_SUPERCALL);
-                     return null();
-                 }
- 
--                if (tt != TokenKind::Lp) {
-+                if (tt != TokenKind::LeftParen) {
-                     error(JSMSG_BAD_SUPER);
-                     return null();
-                 }
- 
-                 // Despite the fact that it's impossible to have |super()| in a
-                 // generator, we still inherit the yieldHandling of the
-                 // memberExpression, per spec. Curious.
-                 bool isSpread = false;
-@@ -8907,17 +8907,17 @@ GeneralParser<ParseHandler, CharT>::memb
-                     // right syntax.
-                     if (prop == context->names().apply) {
-                         op = JSOP_FUNAPPLY;
-                         if (pc->isFunctionBox())
-                             pc->functionBox()->usesApply = true;
-                     } else if (prop == context->names().call) {
-                         op = JSOP_FUNCALL;
-                     }
--                } else if (tt == TokenKind::Lp) {
-+                } else if (tt == TokenKind::LeftParen) {
-                     if (handler.isAsyncKeyword(lhs, context)) {
-                         // |async (| can be the start of an async arrow
-                         // function, so we need to defer reporting possible
-                         // errors from destructuring syntax. To give better
-                         // error messages, we only allow the AsyncArrowHead
-                         // part of the CoverCallExpressionAndAsyncArrowHead
-                         // syntax when the initial name is "async".
-                         maybeAsyncArrow = true;
-@@ -8936,17 +8936,17 @@ GeneralParser<ParseHandler, CharT>::memb
-                         // If we're in a method, mark the method as requiring
-                         // support for 'super', since direct eval code can use
-                         // it. (If we're not in a method, that's fine, so
-                         // ignore the return value.)
-                         checkAndMarkSuperScope();
-                     }
-                 }
- 
--                if (tt == TokenKind::Lp) {
-+                if (tt == TokenKind::LeftParen) {
-                     bool isSpread = false;
-                     PossibleError* asyncPossibleError = maybeAsyncArrow ? possibleError : nullptr;
-                     Node args = argumentList(yieldHandling, &isSpread, asyncPossibleError);
-                     if (!args)
-                         return null();
-                     if (isSpread) {
-                         if (op == JSOP_EVAL)
-                             op = JSOP_SPREADEVAL;
-@@ -9337,28 +9337,28 @@ GeneralParser<ParseHandler, CharT>::chec
-     return checkDestructuringAssignmentTarget(expr, exprPos, exprPossibleError, possibleError);
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::arrayInitializer(YieldHandling yieldHandling,
-                                                      PossibleError* possibleError)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lb));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftBracket));
- 
-     uint32_t begin = pos().begin;
-     Node literal = handler.newArrayLiteral(begin);
-     if (!literal)
-         return null();
- 
-     TokenKind tt;
-     if (!tokenStream.getToken(&tt, TokenStream::Operand))
-         return null();
- 
--    if (tt == TokenKind::Rb) {
-+    if (tt == TokenKind::RightBracket) {
-         /*
-          * Mark empty arrays as non-constant, since we cannot easily
-          * determine their type.
-          */
-         handler.setListFlag(literal, PNX_NONCONST);
-     } else {
-         anyChars.ungetToken();
- 
-@@ -9366,17 +9366,17 @@ GeneralParser<ParseHandler, CharT>::arra
-             if (index >= NativeObject::MAX_DENSE_ELEMENTS_COUNT) {
-                 error(JSMSG_ARRAY_INIT_TOO_BIG);
-                 return null();
-             }
- 
-             TokenKind tt;
-             if (!tokenStream.peekToken(&tt, TokenStream::Operand))
-                 return null();
--            if (tt == TokenKind::Rb)
-+            if (tt == TokenKind::RightBracket)
-                 break;
- 
-             if (tt == TokenKind::Comma) {
-                 tokenStream.consumeKnownToken(TokenKind::Comma, TokenStream::Operand);
-                 if (!handler.addElision(literal, pos()))
-                     return null();
-                 continue;
-             }
-@@ -9427,17 +9427,17 @@ GeneralParser<ParseHandler, CharT>::arra
-                 return null();
-             if (!matched)
-                 break;
- 
-             if (tt == TokenKind::TripleDot && possibleError)
-                 possibleError->setPendingDestructuringErrorAt(pos(), JSMSG_REST_WITH_COMMA);
-         }
- 
--        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rb, TokenStream::Operand,
-+        MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightBracket, TokenStream::Operand,
-                                          reportMissingClosing(JSMSG_BRACKET_AFTER_LIST,
-                                                               JSMSG_BRACKET_OPENED, begin));
-     }
- 
-     handler.setEndPosition(literal, pos().end);
-     return literal;
- }
- 
-@@ -9448,17 +9448,17 @@ GeneralParser<ParseHandler, CharT>::prop
-                                                  Node propList,
-                                                  PropertyType* propType,
-                                                  MutableHandleAtom propAtom)
- {
-     TokenKind ltok;
-     if (!tokenStream.getToken(&ltok))
-         return null();
- 
--    MOZ_ASSERT(ltok != TokenKind::Rc, "caller should have handled TokenKind::Rc");
-+    MOZ_ASSERT(ltok != TokenKind::RightCurly, "caller should have handled TokenKind::RightCurly");
- 
-     bool isGenerator = false;
-     bool isAsync = false;
- 
-     if (ltok == TokenKind::Async) {
-         // AsyncMethod[Yield, Await]:
-         //   async [no LineTerminator here] PropertyName[?Yield, ?Await] ...
-         //
-@@ -9474,17 +9474,17 @@ GeneralParser<ParseHandler, CharT>::prop
-         //   StringLiteral
-         //   NumericLiteral
-         //
-         // ComputedPropertyName[Yield, Await]:
-         //   [ ...
-         TokenKind tt = TokenKind::Eof;
-         if (!tokenStream.peekTokenSameLine(&tt))
-             return null();
--        if (tt == TokenKind::String || tt == TokenKind::Number || tt == TokenKind::Lb ||
-+        if (tt == TokenKind::String || tt == TokenKind::Number || tt == TokenKind::LeftBracket ||
-             TokenKindIsPossibleIdentifierName(tt) || tt == TokenKind::Mul)
-         {
-             isAsync = true;
-             tokenStream.consumeKnownToken(tt);
-             ltok = tt;
-         }
-     }
- 
-@@ -9516,17 +9516,17 @@ GeneralParser<ParseHandler, CharT>::prop
-             break;
-         }
-         propName = stringLiteral();
-         if (!propName)
-             return null();
-         break;
-       }
- 
--      case TokenKind::Lb:
-+      case TokenKind::LeftBracket:
-         propName = computedPropertyName(yieldHandling, maybeDecl, propList);
-         if (!propName)
-             return null();
-         break;
- 
-       default: {
-         if (!TokenKindIsPossibleIdentifierName(ltok)) {
-             error(JSMSG_UNEXPECTED_TOKEN, "property name", TokenKindToDesc(ltok));
-@@ -9572,18 +9572,18 @@ GeneralParser<ParseHandler, CharT>::prop
-         if (tt == TokenKind::Number) {
-             tokenStream.consumeKnownToken(TokenKind::Number);
- 
-             propAtom.set(NumberToAtom(context, anyChars.currentToken().number()));
-             if (!propAtom.get())
-                 return null();
-             return newNumber(anyChars.currentToken());
-         }
--        if (tt == TokenKind::Lb) {
--            tokenStream.consumeKnownToken(TokenKind::Lb);
-+        if (tt == TokenKind::LeftBracket) {
-+            tokenStream.consumeKnownToken(TokenKind::LeftBracket);
- 
-             return computedPropertyName(yieldHandling, maybeDecl, propList);
-         }
- 
-         // Not an accessor property after all.
-         propName = handler.newObjectLiteralPropertyName(propAtom.get(), pos());
-         if (!propName)
-             return null();
-@@ -9600,32 +9600,32 @@ GeneralParser<ParseHandler, CharT>::prop
-             error(JSMSG_BAD_PROP_ID);
-             return null();
-         }
-         *propType = PropertyType::Normal;
-         return propName;
-     }
- 
-     if (TokenKindIsPossibleIdentifierName(ltok) &&
--        (tt == TokenKind::Comma || tt == TokenKind::Rc || tt == TokenKind::Assign))
-+        (tt == TokenKind::Comma || tt == TokenKind::RightCurly || tt == TokenKind::Assign))
-     {
-         if (isGenerator || isAsync) {
-             error(JSMSG_BAD_PROP_ID);
-             return null();
-         }
- 
-         anyChars.ungetToken();
-         anyChars.addModifierException(TokenStream::OperandIsNone);
-         *propType = tt == TokenKind::Assign
-                     ? PropertyType::CoverInitializedName
-                     : PropertyType::Shorthand;
-         return propName;
-     }
- 
--    if (tt == TokenKind::Lp) {
-+    if (tt == TokenKind::LeftParen) {
-         anyChars.ungetToken();
- 
-         if (isGenerator && isAsync)
-             *propType = PropertyType::AsyncGeneratorMethod;
-         else if (isGenerator)
-             *propType = PropertyType::GeneratorMethod;
-         else if (isAsync)
-             *propType = PropertyType::AsyncMethod;
-@@ -9639,57 +9639,57 @@ GeneralParser<ParseHandler, CharT>::prop
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::computedPropertyName(YieldHandling yieldHandling,
-                                                          const Maybe<DeclarationKind>& maybeDecl,
-                                                          Node literal)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lb));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftBracket));
- 
-     uint32_t begin = pos().begin;
- 
-     if (maybeDecl) {
-         if (*maybeDecl == DeclarationKind::FormalParameter)
-             pc->functionBox()->hasParameterExprs = true;
-     } else {
-         handler.setListFlag(literal, PNX_NONCONST);
-     }
- 
-     Node assignNode = assignExpr(InAllowed, yieldHandling, TripledotProhibited);
-     if (!assignNode)
-         return null();
- 
--    MUST_MATCH_TOKEN_MOD(TokenKind::Rb, TokenStream::Operand, JSMSG_COMP_PROP_UNTERM_EXPR);
-+    MUST_MATCH_TOKEN_MOD(TokenKind::RightBracket, TokenStream::Operand, JSMSG_COMP_PROP_UNTERM_EXPR);
-     return handler.newComputedName(assignNode, begin, pos().end);
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::objectLiteral(YieldHandling yieldHandling,
-                                                   PossibleError* possibleError)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lc));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftCurly));
- 
-     uint32_t openedPos = pos().begin;
- 
-     Node literal = handler.newObjectLiteral(pos().begin);
-     if (!literal)
-         return null();
- 
-     bool seenPrototypeMutation = false;
-     bool seenCoverInitializedName = false;
-     Maybe<DeclarationKind> declKind = Nothing();
-     RootedAtom propAtom(context);
-     for (;;) {
-         TokenKind tt;
-         if (!tokenStream.peekToken(&tt))
-             return null();
--        if (tt == TokenKind::Rc) {
-+        if (tt == TokenKind::RightCurly) {
-             anyChars.addModifierException(TokenStream::OperandIsNone);
-             break;
-         }
- 
-         if (tt == TokenKind::TripleDot) {
-             tokenStream.consumeKnownToken(TokenKind::TripleDot);
-             uint32_t begin = pos().begin;
- 
-@@ -9840,17 +9840,17 @@ GeneralParser<ParseHandler, CharT>::obje
-                 Node propExpr = handler.newAssignment(ParseNodeKind::Assign, lhs, rhs);
-                 if (!propExpr)
-                     return null();
- 
-                 if (!handler.addPropertyDefinition(literal, propName, propExpr))
-                     return null();
-             } else {
-                 RootedAtom funName(context);
--                if (!anyChars.isCurrentTokenType(TokenKind::Rb)) {
-+                if (!anyChars.isCurrentTokenType(TokenKind::RightBracket)) {
-                     funName = propAtom;
- 
-                     if (propType == PropertyType::Getter || propType == PropertyType::Setter) {
-                         funName = prefixAccessorName(propType, propAtom);
-                         if (!funName)
-                             return null();
-                     }
-                 }
-@@ -9874,17 +9874,17 @@ GeneralParser<ParseHandler, CharT>::obje
-         if (!tokenStream.matchToken(&matched, TokenKind::Comma, TokenStream::Operand))
-             return null();
-         if (!matched)
-             break;
-         if (tt == TokenKind::TripleDot && possibleError)
-             possibleError->setPendingDestructuringErrorAt(pos(), JSMSG_REST_WITH_COMMA);
-     }
- 
--    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::Rc, TokenStream::Operand,
-+    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TokenKind::RightCurly, TokenStream::Operand,
-                                      reportMissingClosing(JSMSG_CURLY_AFTER_LIST,
-                                                           JSMSG_CURLY_OPENED, openedPos));
- 
-     handler.setEndPosition(literal, pos().end);
-     return literal;
- }
- 
- template <class ParseHandler, typename CharT>
-@@ -10037,50 +10037,50 @@ GeneralParser<ParseHandler, CharT>::prim
- 
-     switch (tt) {
-       case TokenKind::Function:
-         return functionExpr(pos().begin, invoked, FunctionAsyncKind::SyncFunction);
- 
-       case TokenKind::Class:
-         return classDefinition(yieldHandling, ClassExpression, NameRequired);
- 
--      case TokenKind::Lb:
-+      case TokenKind::LeftBracket:
-         return arrayInitializer(yieldHandling, possibleError);
- 
--      case TokenKind::Lc:
-+      case TokenKind::LeftCurly:
-         return objectLiteral(yieldHandling, possibleError);
- 
--      case TokenKind::Lp: {
-+      case TokenKind::LeftParen: {
-         TokenKind next;
-         if (!tokenStream.peekToken(&next, TokenStream::Operand))
-             return null();
- 
--        if (next == TokenKind::Rp) {
-+        if (next == TokenKind::RightParen) {
-             // Not valid expression syntax, but this is valid in an arrow function
-             // with no params: `() => body`.
--            tokenStream.consumeKnownToken(TokenKind::Rp, TokenStream::Operand);
-+            tokenStream.consumeKnownToken(TokenKind::RightParen, TokenStream::Operand);
- 
-             if (!tokenStream.peekToken(&next))
-                 return null();
-             if (next != TokenKind::Arrow) {
--                error(JSMSG_UNEXPECTED_TOKEN, "expression", TokenKindToDesc(TokenKind::Rp));
-+                error(JSMSG_UNEXPECTED_TOKEN, "expression", TokenKindToDesc(TokenKind::RightParen));
-                 return null();
-             }
- 
-             // Now just return something that will allow parsing to continue.
-             // It doesn't matter what; when we reach the =>, we will rewind and
-             // reparse the whole arrow function. See Parser::assignExpr.
-             return handler.newNullLiteral(pos());
-         }
- 
-         // Pass |possibleError| to support destructuring in arrow parameters.
-         Node expr = exprInParens(InAllowed, yieldHandling, TripledotAllowed, possibleError);
-         if (!expr)
-             return null();
--        MUST_MATCH_TOKEN_MOD(TokenKind::Rp, TokenStream::Operand, JSMSG_PAREN_IN_PAREN);
-+        MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_IN_PAREN);
-         return handler.parenthesize(expr);
-       }
- 
-       case TokenKind::TemplateHead:
-         return templateLiteral(yieldHandling);
- 
-       case TokenKind::NoSubsTemplate:
-         return noSubstitutionUntaggedTemplate();
-@@ -10148,17 +10148,17 @@ GeneralParser<ParseHandler, CharT>::prim
-             error(JSMSG_UNEXPECTED_TOKEN, "expression", TokenKindToDesc(tt));
-             return null();
-         }
- 
-         TokenKind next;
-         if (!tokenStream.getToken(&next))
-             return null();
- 
--        if (next == TokenKind::Lb || next == TokenKind::Lc) {
-+        if (next == TokenKind::LeftBracket || next == TokenKind::LeftCurly) {
-             // Validate, but don't store the pattern right now. The whole arrow
-             // function is reparsed in functionFormalParametersAndBody().
-             if (!destructuringDeclaration(DeclarationKind::CoverArrowParameter, yieldHandling,
-                                           next))
-             {
-                 return null();
-             }
-         } else {
-@@ -10169,46 +10169,46 @@ GeneralParser<ParseHandler, CharT>::prim
-             if (!TokenKindIsPossibleIdentifier(next)) {
-                 error(JSMSG_UNEXPECTED_TOKEN, "rest argument name", TokenKindToDesc(next));
-                 return null();
-             }
-         }
- 
-         if (!tokenStream.getToken(&next))
-             return null();
--        if (next != TokenKind::Rp) {
-+        if (next != TokenKind::RightParen) {
-             error(JSMSG_UNEXPECTED_TOKEN, "closing parenthesis", TokenKindToDesc(next));
-             return null();
-         }
- 
-         if (!tokenStream.peekToken(&next))
-             return null();
-         if (next != TokenKind::Arrow) {
-             // Advance the scanner for proper error location reporting.
-             tokenStream.consumeKnownToken(next);
-             error(JSMSG_UNEXPECTED_TOKEN, "'=>' after argument list", TokenKindToDesc(next));
-             return null();
-         }
- 
-         anyChars.ungetToken();  // put back right paren
- 
--        // Return an arbitrary expression node. See case TokenKind::Rp above.
-+        // Return an arbitrary expression node. See case TokenKind::RightParen above.
-         return handler.newNullLiteral(pos());
-       }
-     }
- }
- 
- template <class ParseHandler, typename CharT>
- typename ParseHandler::Node
- GeneralParser<ParseHandler, CharT>::exprInParens(InHandling inHandling,
-                                                  YieldHandling yieldHandling,
-                                                  TripledotHandling tripledotHandling,
-                                                  PossibleError* possibleError /* = nullptr */)
- {
--    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Lp));
-+    MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftParen));
-     return expr(inHandling, yieldHandling, tripledotHandling, possibleError, PredictInvoked);
- }
- 
- template class PerHandlerParser<FullParseHandler>;
- template class PerHandlerParser<SyntaxParseHandler>;
- template class GeneralParser<FullParseHandler, Utf8Unit>;
- template class GeneralParser<SyntaxParseHandler, Utf8Unit>;
- template class GeneralParser<FullParseHandler, char16_t>;
-diff --git a/js/src/frontend/TokenKind.h b/js/src/frontend/TokenKind.h
---- a/js/src/frontend/TokenKind.h
-+++ b/js/src/frontend/TokenKind.h
-@@ -61,22 +61,22 @@
-     macro(Semi,         "';'") \
-     macro(Comma,        "','") \
-     macro(Hook,         "'?'")    /* conditional */ \
-     macro(Colon,        "':'")    /* conditional */ \
-     macro(Inc,          "'++'")   /* increment */ \
-     macro(Dec,          "'--'")   /* decrement */ \
-     macro(Dot,          "'.'")    /* member operator */ \
-     macro(TripleDot,    "'...'")  /* rest arguments and spread operator */ \
--    macro(Lb,           "'['") \
--    macro(Rb,           "']'") \
--    macro(Lc,           "'{'") \
--    macro(Rc,           "'}'") \
--    macro(Lp,           "'('") \
--    macro(Rp,           "')'") \
-+    macro(LeftBracket,  "'['") \
-+    macro(RightBracket, "']'") \
-+    macro(LeftCurly,    "'{'") \
-+    macro(RightCurly,   "'}'") \
-+    macro(LeftParen,    "'('") \
-+    macro(RightParen,   "')'") \
-     macro(Name,         "identifier") \
-     macro(Number,       "numeric literal") \
-     macro(String,       "string literal") \
-     \
-     /* start of template literal with substitutions */ \
-     macro(TemplateHead,    "'${'") \
-     /* template literal without substitutions */ \
-     macro(NoSubsTemplate, "template literal") \
-diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
---- a/js/src/frontend/TokenStream.cpp
-+++ b/js/src/frontend/TokenStream.cpp
-@@ -438,19 +438,19 @@ TokenStreamAnyChars::TokenStreamAnyChars
-     cx(cx),
-     mutedErrors(options.mutedErrors()),
-     strictModeGetter(smg)
- {
-     // |isExprEnding| was initially zeroed: overwrite the true entries here.
-     isExprEnding[size_t(TokenKind::Comma)] = true;
-     isExprEnding[size_t(TokenKind::Semi)] = true;
-     isExprEnding[size_t(TokenKind::Colon)] = true;
--    isExprEnding[size_t(TokenKind::Rp)] = true;
--    isExprEnding[size_t(TokenKind::Rb)] = true;
--    isExprEnding[size_t(TokenKind::Rc)] = true;
-+    isExprEnding[size_t(TokenKind::RightParen)] = true;
-+    isExprEnding[size_t(TokenKind::RightBracket)] = true;
-+    isExprEnding[size_t(TokenKind::RightCurly)] = true;
- }
- 
- template<typename CharT>
- TokenStreamCharsBase<CharT>::TokenStreamCharsBase(JSContext* cx, const CharT* chars, size_t length,
-                                                   size_t startOffset)
-   : TokenStreamCharsShared(cx),
-     sourceUnits(chars, length, startOffset)
- {}
-@@ -1969,24 +1969,24 @@ enum FirstCharKind {
- // Plus:    43: '+'
- // ZeroDigit:  48: '0'
- // Space:   9, 11, 12, 32: '\t', '\v', '\f', ' '
- // EOL:     10, 13: '\n', '\r'
- //
- #define T_COMMA     size_t(TokenKind::Comma)
- #define T_COLON     size_t(TokenKind::Colon)
- #define T_BITNOT    size_t(TokenKind::BitNot)
--#define T_LP        size_t(TokenKind::Lp)
--#define T_RP        size_t(TokenKind::Rp)
-+#define T_LP        size_t(TokenKind::LeftParen)
-+#define T_RP        size_t(TokenKind::RightParen)
- #define T_SEMI      size_t(TokenKind::Semi)
- #define T_HOOK      size_t(TokenKind::Hook)
--#define T_LB        size_t(TokenKind::Lb)
--#define T_RB        size_t(TokenKind::Rb)
--#define T_LC        size_t(TokenKind::Lc)
--#define T_RC        size_t(TokenKind::Rc)
-+#define T_LB        size_t(TokenKind::LeftBracket)
-+#define T_RB        size_t(TokenKind::RightBracket)
-+#define T_LC        size_t(TokenKind::LeftCurly)
-+#define T_RC        size_t(TokenKind::RightCurly)
- #define _______     Other
- static const uint8_t firstCharKinds[] = {
- /*         0        1        2        3        4        5        6        7        8        9    */
- /*   0+ */ _______, _______, _______, _______, _______, _______, _______, _______, _______,   Space,
- /*  10+ */     EOL,   Space,   Space,     EOL, _______, _______, _______, _______, _______, _______,
- /*  20+ */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- /*  30+ */ _______, _______,   Space, _______,  String, _______,   Ident, _______, _______,  String,
- /*  40+ */    T_LP,    T_RP, _______, _______, T_COMMA, _______, _______, _______,ZeroDigit,    Dec,
-diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
---- a/js/src/wasm/AsmJS.cpp
-+++ b/js/src/wasm/AsmJS.cpp
-@@ -5638,17 +5638,17 @@ CheckModuleExportObject(ModuleValidator&
- static bool
- CheckModuleReturn(ModuleValidator& m)
- {
-     TokenKind tk;
-     if (!GetToken(m.parser(), &tk))
-         return false;
-     auto& ts = m.parser().tokenStream;
-     if (tk != TokenKind::Return) {
--        return m.failCurrentOffset((tk == TokenKind::Rc || tk == TokenKind::Eof)
-+        return m.failCurrentOffset((tk == TokenKind::RightCurly || tk == TokenKind::Eof)
-                                    ? "expecting return statement"
-                                    : "invalid asm.js. statement");
-     }
-     ts.anyCharsAccess().ungetToken();
- 
-     ParseNode* returnStmt = m.parser().statementListItem(YieldIsName);
-     if (!returnStmt)
-         return false;
-@@ -5670,17 +5670,17 @@ CheckModuleReturn(ModuleValidator& m)
- 
- static bool
- CheckModuleEnd(ModuleValidator &m)
- {
-     TokenKind tk;
-     if (!GetToken(m.parser(), &tk))
-         return false;
- 
--    if (tk != TokenKind::Eof && tk != TokenKind::Rc)
-+    if (tk != TokenKind::Eof && tk != TokenKind::RightCurly)
-         return m.failCurrentOffset("top-level export (return) must be the last statement");
- 
-     m.parser().tokenStream.anyCharsAccess().ungetToken();
-     return true;
- }
- 
- static SharedModule
- CheckModule(JSContext* cx, AsmJSParser& parser, ParseNode* stmtList, unsigned* time)

+ 0 - 132
frg/work-js/mozilla-release/patches/mozilla-central-push_433567.patch

@@ -1,132 +0,0 @@
-# HG changeset patch
-# User Robin Templeton <robin@igalia.com>
-# Date 1535132580 -10800
-#      Fri Aug 24 20:43:00 2018 +0300
-# Node ID 417d94835a0334fb79cfa35b4216739d067783f2
-# Parent  c6552a729ea7cca69c4ec87740cfc7393e52a597
-bug 1486173 - Part 1: Move error reporting out of StringToBigInt. r=jandem
-
-diff --git a/js/src/vm/BigIntType.cpp b/js/src/vm/BigIntType.cpp
---- a/js/src/vm/BigIntType.cpp
-+++ b/js/src/vm/BigIntType.cpp
-@@ -404,26 +404,32 @@ js::ToBigInt(JSContext* cx, HandleValue 
- {
-     RootedValue v(cx, val);
- 
-     // Step 1.
-     if (!ToPrimitive(cx, JSTYPE_NUMBER, &v))
-         return nullptr;
- 
-     // Step 2.
--    // String conversions are not yet supported.
-     if (v.isBigInt())
-         return v.toBigInt();
- 
-     if (v.isBoolean())
-         return BigInt::createFromBoolean(cx, v.toBoolean());
- 
-     if (v.isString()) {
-         RootedString str(cx, v.toString());
--        return StringToBigInt(cx, str, 0);
-+        BigInt* bi;
-+        JS_TRY_VAR_OR_RETURN_NULL(cx, bi, StringToBigInt(cx, str, 0));
-+        if (!bi) {
-+            JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
-+                                      JSMSG_BIGINT_INVALID_SYNTAX);
-+            return nullptr;
-+        }
-+        return bi;
-     }
- 
-     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_BIGINT);
-     return nullptr;
- }
- 
- // ES 2019 draft 6.1.6
- double
-@@ -514,38 +520,38 @@ js::StringToBigIntImpl(const Range<const
-     }
- 
-     if (sign.valueOr(1) < 0)
-         mpz_neg(res->num_, res->num_);
- 
-     return true;
- }
- 
--BigInt*
-+JS::Result<BigInt*, JS::OOM&>
- js::StringToBigInt(JSContext* cx, HandleString str, uint8_t radix)
- {
-     RootedBigInt res(cx, BigInt::create(cx));
-+    if (!res)
-+        return cx->alreadyReportedOOM();
- 
-     JSLinearString* linear = str->ensureLinear(cx);
-     if (!linear)
--        return nullptr;
-+        return cx->alreadyReportedOOM();
- 
-     {
-         JS::AutoCheckCannotGC nogc;
-         if (linear->hasLatin1Chars()) {
-             if (StringToBigIntImpl(linear->latin1Range(nogc), radix, res))
--                return res;
-+                return res.get();
-         } else {
-             if (StringToBigIntImpl(linear->twoByteRange(nogc), radix, res))
--                return res;
-+                return res.get();
-         }
-     }
- 
--    JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
--                              JSMSG_BIGINT_INVALID_SYNTAX);
-     return nullptr;
- }
- 
- size_t
- BigInt::byteLength(BigInt* x)
- {
-     if (mpz_sgn(x->num_) == 0)
-         return 0;
-diff --git a/js/src/vm/BigIntType.h b/js/src/vm/BigIntType.h
---- a/js/src/vm/BigIntType.h
-+++ b/js/src/vm/BigIntType.h
-@@ -12,16 +12,17 @@
- 
- #include <gmp.h>
- 
- #include "gc/Barrier.h"
- #include "gc/GC.h"
- #include "gc/Heap.h"
- #include "js/AllocPolicy.h"
- #include "js/GCHashTable.h"
-+#include "js/Result.h"
- #include "js/RootingAPI.h"
- #include "js/TypeDecls.h"
- #include "vm/StringType.h"
- 
- namespace js {
- 
- template <typename CharT>
- static bool StringToBigIntImpl(const mozilla::Range<const CharT>& chars,
-@@ -116,17 +117,18 @@ static_assert(sizeof(BigInt) >= js::gc::
- namespace js {
- 
- extern JSAtom*
- BigIntToAtom(JSContext* cx, JS::BigInt* bi);
- 
- extern JS::BigInt*
- NumberToBigInt(JSContext* cx, double d);
- 
--extern JS::BigInt*
-+// Convert a string to a BigInt, returning nullptr if parsing fails.
-+extern JS::Result<JS::BigInt*, JS::OOM&>
- StringToBigInt(JSContext* cx, JS::Handle<JSString*> str, uint8_t radix);
- 
- extern JS::BigInt*
- ToBigInt(JSContext* cx, JS::Handle<JS::Value> v);
- 
- } // namespace js
- 
- #endif

+ 0 - 111
frg/work-js/mozilla-release/patches/mozilla-central-push_433568.patch

@@ -1,111 +0,0 @@
-# HG changeset patch
-# User Robin Templeton <robin@igalia.com>
-# Date 1535132580 -10800
-#      Fri Aug 24 20:43:00 2018 +0300
-# Node ID c62f40111003f108aa6bef93af6b289688ea1d97
-# Parent  417d94835a0334fb79cfa35b4216739d067783f2
-bug 1486173 - Part 2: Add BigInt methods for equality comparison. r=jandem
-
-diff --git a/js/src/vm/BigIntType.cpp b/js/src/vm/BigIntType.cpp
---- a/js/src/vm/BigIntType.cpp
-+++ b/js/src/vm/BigIntType.cpp
-@@ -438,16 +438,75 @@ BigInt::numberValue(BigInt* x)
-     // mpz_get_d may cause a hardware overflow trap, so use
-     // mpz_get_d_2exp to get the fractional part and exponent
-     // separately.
-     signed long int exp;
-     double d = mpz_get_d_2exp(&exp, x->num_);
-     return ldexp(d, exp);
- }
- 
-+bool
-+BigInt::equal(BigInt* lhs, BigInt* rhs)
-+{
-+    if (lhs == rhs)
-+        return true;
-+    if (mpz_cmp(lhs->num_, rhs->num_) == 0)
-+        return true;
-+    return false;
-+}
-+
-+bool
-+BigInt::equal(BigInt* lhs, double rhs)
-+{
-+    // The result of mpz_cmp_d is undefined for comparisons to NaN.
-+    if (mozilla::IsNaN(rhs))
-+        return false;
-+    if (mpz_cmp_d(lhs->num_, rhs) == 0)
-+        return true;
-+    return false;
-+}
-+
-+// BigInt proposal section 3.2.5
-+JS::Result<bool>
-+BigInt::looselyEqual(JSContext* cx, HandleBigInt lhs, HandleValue rhs)
-+{
-+    // Step 1.
-+    if (rhs.isBigInt())
-+        return equal(lhs, rhs.toBigInt());
-+
-+    // Steps 2-5 (not applicable).
-+
-+    // Steps 6-7.
-+    if (rhs.isString()) {
-+        RootedBigInt rhsBigInt(cx);
-+        RootedString rhsString(cx, rhs.toString());
-+        MOZ_TRY_VAR(rhsBigInt, StringToBigInt(cx, rhsString, 0));
-+        if (!rhsBigInt)
-+            return false;
-+        return equal(lhs, rhsBigInt);
-+    }
-+
-+    // Steps 8-9 (not applicable).
-+
-+    // Steps 10-11.
-+    if (rhs.isObject()) {
-+        RootedValue rhsPrimitive(cx, rhs);
-+        if (!ToPrimitive(cx, &rhsPrimitive))
-+            return cx->alreadyReportedError();
-+        return looselyEqual(cx, lhs, rhsPrimitive);
-+    }
-+
-+    // Step 12.
-+    if (rhs.isNumber())
-+        return equal(lhs, rhs.toNumber());
-+
-+    // Step 13.
-+    return false;
-+}
-+
- JSLinearString*
- BigInt::toString(JSContext* cx, BigInt* x, uint8_t radix)
- {
-     MOZ_ASSERT(2 <= radix && radix <= 36);
-     // We need two extra chars for '\0' and potentially '-'.
-     size_t strSize = mpz_sizeinbase(x->num_, 10) + 2;
-     UniqueChars str(js_pod_malloc<char>(strSize));
-     if (!str) {
-diff --git a/js/src/vm/BigIntType.h b/js/src/vm/BigIntType.h
---- a/js/src/vm/BigIntType.h
-+++ b/js/src/vm/BigIntType.h
-@@ -95,16 +95,20 @@ class BigInt final : public js::gc::Tenu
-     static bool div(JSContext* cx, Handle<Value> lhs, Handle<Value> rhs, MutableHandle<Value> res);
-     static bool mod(JSContext* cx, Handle<Value> lhs, Handle<Value> rhs, MutableHandle<Value> res);
-     static bool pow(JSContext* cx, Handle<Value> lhs, Handle<Value> rhs, MutableHandle<Value> res);
-     static bool neg(JSContext* cx, Handle<Value> operand, MutableHandle<Value> res);
- 
-     static double numberValue(BigInt* x);
-     static JSLinearString* toString(JSContext* cx, BigInt* x, uint8_t radix);
- 
-+    static bool equal(BigInt* lhs, BigInt* rhs);
-+    static bool equal(BigInt* lhs, double rhs);
-+    static JS::Result<bool> looselyEqual(JSContext* cx, HandleBigInt lhs, HandleValue rhs);
-+
-     // Return the length in bytes of the representation used by
-     // writeBytes.
-     static size_t byteLength(BigInt* x);
- 
-     // Write a little-endian representation of a BigInt's absolute value
-     // to a byte array.
-     static void writeBytes(BigInt* x, mozilla::RangedPtr<uint8_t> buffer);
- };

+ 0 - 69
frg/work-js/mozilla-release/patches/mozilla-central-push_433569.patch

@@ -1,69 +0,0 @@
-# HG changeset patch
-# User Robin Templeton <robin@igalia.com>
-# Date 1535132580 -10800
-#      Fri Aug 24 20:43:00 2018 +0300
-# Node ID be6163ba4a6a0b8491ccb1ba16aaabcffb448f37
-# Parent  c62f40111003f108aa6bef93af6b289688ea1d97
-bug 1486173 - Part 3: Implement BigInt support for equality operators. r=jandem
-
-diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
---- a/js/src/vm/Interpreter.cpp
-+++ b/js/src/vm/Interpreter.cpp
-@@ -862,16 +862,22 @@ EqualGivenSameType(JSContext* cx, Handle
-     MOZ_ASSERT(SameType(lval, rval));
- 
-     if (lval.isString())
-         return EqualStrings(cx, lval.toString(), rval.toString(), equal);
-     if (lval.isDouble()) {
-         *equal = (lval.toDouble() == rval.toDouble());
-         return true;
-     }
-+#ifdef ENABLE_BIGINT
-+    if (lval.isBigInt()) {
-+        *equal = BigInt::equal(lval.toBigInt(), rval.toBigInt());
-+        return true;
-+    }
-+#endif
-     if (lval.isGCThing()) {  // objects or symbols
-         *equal = (lval.toGCThing() == rval.toGCThing());
-         return true;
-     }
-     *equal = lval.get().payloadAsRawUint32() == rval.get().payloadAsRawUint32();
-     MOZ_ASSERT_IF(lval.isUndefined() || lval.isNull(), *equal);
-     return true;
- }
-@@ -965,16 +971,34 @@ js::LooselyEqual(JSContext* cx, HandleVa
-     // Step 11.
-     if (lval.isObject() && (rval.isString() || rval.isNumber() || rval.isSymbol())) {
-         RootedValue lvalue(cx, lval);
-         if (!ToPrimitive(cx, &lvalue))
-             return false;
-         return LooselyEqual(cx, lvalue, rval, result);
-     }
- 
-+#ifdef ENABLE_BIGINT
-+    if (lval.isBigInt()) {
-+        RootedBigInt lbi(cx, lval.toBigInt());
-+        bool tmpResult;
-+        JS_TRY_VAR_OR_RETURN_FALSE(cx, tmpResult, BigInt::looselyEqual(cx, lbi, rval));
-+        *result = tmpResult;
-+        return true;
-+    }
-+
-+    if (rval.isBigInt()) {
-+        RootedBigInt rbi(cx, rval.toBigInt());
-+        bool tmpResult;
-+        JS_TRY_VAR_OR_RETURN_FALSE(cx, tmpResult, BigInt::looselyEqual(cx, rbi, lval));
-+        *result = tmpResult;
-+        return true;
-+    }
-+#endif
-+
-     // Step 12.
-     *result = false;
-     return true;
- }
- 
- bool
- js::StrictlyEqual(JSContext* cx, HandleValue lval, HandleValue rval, bool* equal)
- {

+ 0 - 385
frg/work-js/mozilla-release/patches/mozilla-central-push_433577.patch

@@ -1,385 +0,0 @@
-# HG changeset patch
-# User Jan de Mooij <jdemooij@mozilla.com>
-# Date 1535383696 -7200
-#      Mon Aug 27 17:28:16 2018 +0200
-# Node ID c44d81b8909ab05e294a897ec76f02c04b729331
-# Parent  b8fdb9372c775f81cbe2f5da4e4c2257433980a2
-Bug 1486444 - Remove bogus/over-allocating no-arg versions of js_pod_malloc/js_pod_calloc. r=tcampbell
-
-These functions incorrectly passed sizeof(T) instead of 1, so we would allocate sizeof(T) * sizeof(T) bytes instead of sizeof(T) bytes. This was used for PcScriptCache where we would allocate a few extra megabytes due to this bug. The patch changes PcScriptCache to use UniquePtr + MakeUnique.
-
-Differential Revision: https://phabricator.services.mozilla.com/D4343
-
-diff --git a/js/public/Utility.h b/js/public/Utility.h
---- a/js/public/Utility.h
-+++ b/js/public/Utility.h
-@@ -588,23 +588,16 @@ template <class T>
- static MOZ_ALWAYS_INLINE T*
- js_pod_malloc(size_t numElems)
- {
-     return js_pod_arena_malloc<T>(js::MallocArena, numElems);
- }
- 
- template <class T>
- static MOZ_ALWAYS_INLINE T*
--js_pod_malloc()
--{
--    return js_pod_malloc<T>(sizeof(T));
--}
--
--template <class T>
--static MOZ_ALWAYS_INLINE T*
- js_pod_arena_calloc(arena_id_t arena, size_t numElems)
- {
-     size_t bytes;
-     if (MOZ_UNLIKELY(!js::CalculateAllocSize<T>(numElems, &bytes)))
-         return nullptr;
-     return static_cast<T*>(js_arena_calloc(arena, bytes, 1));
- }
- 
-@@ -612,23 +605,16 @@ template <class T>
- static MOZ_ALWAYS_INLINE T*
- js_pod_calloc(size_t numElems)
- {
-     return js_pod_arena_calloc<T>(js::MallocArena, numElems);
- }
- 
- template <class T>
- static MOZ_ALWAYS_INLINE T*
--js_pod_calloc()
--{
--    return js_pod_calloc<T>(sizeof(T));
--}
--
--template <class T>
--static MOZ_ALWAYS_INLINE T*
- js_pod_realloc(T* prior, size_t oldSize, size_t newSize)
- {
-     MOZ_ASSERT(!(oldSize & mozilla::tl::MulOverflowMask<sizeof(T)>::value));
-     size_t bytes;
-     if (MOZ_UNLIKELY(!js::CalculateAllocSize<T>(newSize, &bytes)))
-         return nullptr;
-     return static_cast<T*>(js_realloc(prior, bytes));
- }
-diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
---- a/js/src/jit/JitFrames.cpp
-+++ b/js/src/jit/JitFrames.cpp
-@@ -1405,24 +1405,24 @@ GetPcScript(JSContext* cx, JSScript** sc
-         retAddr = it.frame().returnAddress();
-     }
- 
-     uint32_t hash;
-     if (retAddr) {
-         hash = PcScriptCache::Hash(retAddr);
- 
-         // Lazily initialize the cache. The allocation may safely fail and will not GC.
--        if (MOZ_UNLIKELY(cx->ionPcScriptCache == nullptr)) {
--            cx->ionPcScriptCache = js_pod_malloc<PcScriptCache>();
--            if (cx->ionPcScriptCache)
--                cx->ionPcScriptCache->clear(cx->runtime()->gc.gcNumber());
-+        if (MOZ_UNLIKELY(cx->ionPcScriptCache == nullptr))
-+            cx->ionPcScriptCache = MakeUnique<PcScriptCache>(cx->runtime()->gc.gcNumber());
-+
-+        if (cx->ionPcScriptCache.ref() &&
-+            cx->ionPcScriptCache->get(cx->runtime(), hash, retAddr, scriptRes, pcRes))
-+        {
-+            return;
-         }
--
--        if (cx->ionPcScriptCache && cx->ionPcScriptCache->get(cx->runtime(), hash, retAddr, scriptRes, pcRes))
--            return;
-     }
- 
-     // Lookup failed: undertake expensive process to recover the innermost inlined frame.
-     jsbytecode* pc = nullptr;
-     if (it.frame().isIonJS() || it.frame().isBailoutJS()) {
-         InlineFrameIterator ifi(cx, &it.frame());
-         *scriptRes = ifi.script();
-         pc = ifi.pc();
-@@ -1430,17 +1430,17 @@ GetPcScript(JSContext* cx, JSScript** sc
-         MOZ_ASSERT(it.frame().isBaselineJS());
-         it.frame().baselineScriptAndPc(scriptRes, &pc);
-     }
- 
-     if (pcRes)
-         *pcRes = pc;
- 
-     // Add entry to cache.
--    if (retAddr && cx->ionPcScriptCache)
-+    if (retAddr && cx->ionPcScriptCache.ref())
-         cx->ionPcScriptCache->add(hash, retAddr, pc, *scriptRes);
- }
- 
- uint32_t
- OsiIndex::returnPointDisplacement() const
- {
-     // In general, pointer arithmetic on code is bad, but in this case,
-     // getting the return address from a call instruction, stepping over pools
-diff --git a/js/src/jit/PcScriptCache.h b/js/src/jit/PcScriptCache.h
---- a/js/src/jit/PcScriptCache.h
-+++ b/js/src/jit/PcScriptCache.h
-@@ -20,26 +20,32 @@ struct PcScriptCacheEntry
- {
-     uint8_t* returnAddress; // Key into the hash table.
-     jsbytecode* pc;         // Cached PC.
-     JSScript* script;       // Cached script.
- };
- 
- struct PcScriptCache
- {
-+  private:
-     static const uint32_t Length = 73;
- 
-     // GC number at the time the cache was filled or created.
-     // Storing and checking against this number allows us to not bother
-     // clearing this cache on every GC -- only when actually necessary.
-     uint64_t gcNumber;
- 
-     // List of cache entries.
-     mozilla::Array<PcScriptCacheEntry, Length> entries;
- 
-+  public:
-+    explicit PcScriptCache(uint64_t gcNumber) {
-+        clear(gcNumber);
-+    }
-+
-     void clear(uint64_t gcNumber) {
-         for (uint32_t i = 0; i < Length; i++)
-             entries[i].returnAddress = nullptr;
-         this->gcNumber = gcNumber;
-     }
- 
-     // Get a value from the cache. May perform lazy allocation.
-     MOZ_MUST_USE bool get(JSRuntime* rt, uint32_t hash, uint8_t* addr,
-diff --git a/js/src/jit/arm/Simulator-arm.cpp b/js/src/jit/arm/Simulator-arm.cpp
---- a/js/src/jit/arm/Simulator-arm.cpp
-+++ b/js/src/jit/arm/Simulator-arm.cpp
-@@ -1248,18 +1248,19 @@ class Redirection
-         Redirection* current = SimulatorProcess::redirection();
-         for (; current != nullptr; current = current->next_) {
-             if (current->nativeFunction_ == nativeFunction) {
-                 MOZ_ASSERT(current->type() == type);
-                 return current;
-             }
-         }
- 
-+        // Note: we can't use js_new here because the constructor is private.
-         AutoEnterOOMUnsafeRegion oomUnsafe;
--        Redirection* redir = js_pod_malloc<Redirection>();
-+        Redirection* redir = js_pod_malloc<Redirection>(1);
-         if (!redir)
-             oomUnsafe.crash("Simulator redirection");
-         new(redir) Redirection(nativeFunction, type);
-         return redir;
-     }
- 
-     static Redirection* FromSwiInstruction(SimInstruction* swiInstruction) {
-         uint8_t* addrOfSwi = reinterpret_cast<uint8_t*>(swiInstruction);
-diff --git a/js/src/jit/arm64/vixl/MozSimulator-vixl.cpp b/js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
---- a/js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
-+++ b/js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
-@@ -383,18 +383,19 @@ class Redirection
-     Redirection* current = SimulatorProcess::redirection();
-     for (; current != nullptr; current = current->next_) {
-       if (current->nativeFunction_ == nativeFunction) {
-         VIXL_ASSERT(current->type() == type);
-         return current;
-       }
-     }
- 
-+    // Note: we can't use js_new here because the constructor is private.
-     js::AutoEnterOOMUnsafeRegion oomUnsafe;
--    Redirection* redir = js_pod_malloc<Redirection>();
-+    Redirection* redir = js_pod_malloc<Redirection>(1);
-     if (!redir)
-         oomUnsafe.crash("Simulator redirection");
-     new(redir) Redirection(nativeFunction, type);
-     return redir;
-   }
- 
-   static const Redirection* FromSvcInstruction(const Instruction* svcInstruction) {
-     const uint8_t* addrOfSvc = reinterpret_cast<const uint8_t*>(svcInstruction);
-diff --git a/js/src/jit/mips32/Simulator-mips32.cpp b/js/src/jit/mips32/Simulator-mips32.cpp
---- a/js/src/jit/mips32/Simulator-mips32.cpp
-+++ b/js/src/jit/mips32/Simulator-mips32.cpp
-@@ -1338,18 +1338,19 @@ class Redirection
-         Redirection* current = SimulatorProcess::redirection();
-         for (; current != nullptr; current = current->next_) {
-             if (current->nativeFunction_ == nativeFunction) {
-                 MOZ_ASSERT(current->type() == type);
-                 return current;
-             }
-         }
- 
-+        // Note: we can't use js_new here because the constructor is private.
-         AutoEnterOOMUnsafeRegion oomUnsafe;
--        Redirection* redir = js_pod_malloc<Redirection>();
-+        Redirection* redir = js_pod_malloc<Redirection>(1);
-         if (!redir) {
-             oomUnsafe.crash("Simulator redirection");
-         }
-         new(redir) Redirection(nativeFunction, type);
-         return redir;
-     }
- 
-     static Redirection* FromSwiInstruction(SimInstruction* swiInstruction) {
-diff --git a/js/src/jit/mips64/Simulator-mips64.cpp b/js/src/jit/mips64/Simulator-mips64.cpp
---- a/js/src/jit/mips64/Simulator-mips64.cpp
-+++ b/js/src/jit/mips64/Simulator-mips64.cpp
-@@ -1346,18 +1346,19 @@ class Redirection
-         Redirection* current = SimulatorProcess::redirection();
-         for (; current != nullptr; current = current->next_) {
-             if (current->nativeFunction_ == nativeFunction) {
-                 MOZ_ASSERT(current->type() == type);
-                 return current;
-             }
-         }
- 
-+        // Note: we can't use js_new here because the constructor is private.
-         AutoEnterOOMUnsafeRegion oomUnsafe;
--        Redirection* redir = js_pod_malloc<Redirection>();
-+        Redirection* redir = js_pod_malloc<Redirection>(1);
-         if (!redir) {
-             oomUnsafe.crash("Simulator redirection");
-         }
-         new(redir) Redirection(nativeFunction, type);
-         return redir;
-     }
- 
-     static Redirection* FromSwiInstruction(SimInstruction* swiInstruction) {
-diff --git a/js/src/jit/shared/Disassembler-shared.cpp b/js/src/jit/shared/Disassembler-shared.cpp
---- a/js/src/jit/shared/Disassembler-shared.cpp
-+++ b/js/src/jit/shared/Disassembler-shared.cpp
-@@ -232,17 +232,17 @@ DisassemblerSpew::lookup(const Label* ke
-         ;
-     return p;
- }
- 
- DisassemblerSpew::Node*
- DisassemblerSpew::add(const Label* key, uint32_t value)
- {
-     MOZ_ASSERT(!lookup(key));
--    Node* node = js_pod_malloc<Node>();
-+    Node* node = js_new<Node>();
-     if (node) {
-         node->key = key;
-         node->value = value;
-         node->bound = false;
-         node->next = nodes_;
-         nodes_ = node;
-     }
-     return node;
-diff --git a/js/src/threading/ProtectedData.h b/js/src/threading/ProtectedData.h
---- a/js/src/threading/ProtectedData.h
-+++ b/js/src/threading/ProtectedData.h
-@@ -82,16 +82,19 @@ class ProtectedData
-     DECLARE_BOOL_OPERATORS(T)
- 
-     operator const T&() const { return ref(); }
-     const T& operator->() const { return ref(); }
- 
-     template <typename U>
-     ThisType& operator=(const U& p) { this->ref() = p; return *this; }
- 
-+    template <typename U>
-+    ThisType& operator=(U&& p) { this->ref() = std::move(p); return *this; }
-+
-     template <typename U> T& operator +=(const U& rhs) { return ref() += rhs; }
-     template <typename U> T& operator -=(const U& rhs) { return ref() -= rhs; }
-     template <typename U> T& operator *=(const U& rhs) { return ref() *= rhs; }
-     template <typename U> T& operator /=(const U& rhs) { return ref() /= rhs; }
-     template <typename U> T& operator &=(const U& rhs) { return ref() &= rhs; }
-     template <typename U> T& operator |=(const U& rhs) { return ref() |= rhs; }
-     T& operator ++() { return ++ref(); }
-     T& operator --() { return --ref(); }
-@@ -127,42 +130,40 @@ class ProtectedData
-     Check check;
- #endif
- };
- 
- // Intermediate class for protected data whose checks take no constructor arguments.
- template <typename Check, typename T>
- class ProtectedDataNoCheckArgs : public ProtectedData<Check, T>
- {
--    typedef ProtectedDataNoCheckArgs<Check, T> ThisType;
-+    using Base = ProtectedData<Check, T>;
- 
-   public:
-     template <typename... Args>
-     explicit ProtectedDataNoCheckArgs(Args&&... args)
-       : ProtectedData<Check, T>(Check(), std::forward<Args>(args)...)
-     {}
- 
--    template <typename U>
--    ThisType& operator=(const U& p) { this->ref() = p; return *this; }
-+    using Base::operator=;
- };
- 
- // Intermediate class for protected data whose checks take a Zone constructor argument.
- template <typename Check, typename T>
- class ProtectedDataZoneArg : public ProtectedData<Check, T>
- {
--    typedef ProtectedDataZoneArg<Check, T> ThisType;
-+    using Base = ProtectedData<Check, T>;
- 
-   public:
-     template <typename... Args>
-     explicit ProtectedDataZoneArg(JS::Zone* zone, Args&&... args)
-       : ProtectedData<Check, T>(Check(zone), std::forward<Args>(args)...)
-     {}
- 
--    template <typename U>
--    ThisType& operator=(const U& p) { this->ref() = p; return *this; }
-+    using Base::operator=;
- };
- 
- class CheckUnprotected
- {
- #ifdef JS_HAS_PROTECTED_DATA_CHECKS
-   public:
-     inline void check() const {}
- #endif
-diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp
---- a/js/src/vm/JSContext.cpp
-+++ b/js/src/vm/JSContext.cpp
-@@ -1354,18 +1354,16 @@ JSContext::~JSContext()
- {
-     // Clear the ContextKind first, so that ProtectedData checks will allow us to
-     // destroy this context even if the runtime is already gone.
-     kind_ = ContextKind::HelperThread;
- 
-     /* Free the stuff hanging off of cx. */
-     MOZ_ASSERT(!resolvingList);
- 
--    js_delete(ionPcScriptCache.ref());
--
-     if (dtoaState)
-         DestroyDtoaState(dtoaState);
- 
-     fx.destroyInstance();
-     freeOsrTempData();
- 
- #ifdef JS_SIMULATOR
-     js::jit::Simulator::Destroy(simulator_);
-diff --git a/js/src/vm/JSContext.h b/js/src/vm/JSContext.h
---- a/js/src/vm/JSContext.h
-+++ b/js/src/vm/JSContext.h
-@@ -651,17 +651,17 @@ struct JSContext : public JS::RootingCon
-     js::ThreadData<js::LifoAlloc> tempLifoAlloc_;
-   public:
-     js::LifoAlloc& tempLifoAlloc() { return tempLifoAlloc_.ref(); }
-     const js::LifoAlloc& tempLifoAlloc() const { return tempLifoAlloc_.ref(); }
- 
-     js::ThreadData<uint32_t> debuggerMutations;
- 
-     // Cache for jit::GetPcScript().
--    js::ThreadData<js::jit::PcScriptCache*> ionPcScriptCache;
-+    js::ThreadData<js::UniquePtr<js::jit::PcScriptCache>> ionPcScriptCache;
- 
-   private:
-     /* Exception state -- the exception member is a GC root by definition. */
-     js::ThreadData<bool> throwing;            /* is there a pending exception? */
-     js::ThreadData<JS::PersistentRooted<JS::Value>> unwrappedException_; /* most-recently-thrown exception */
- 
-     JS::Value& unwrappedException() {
-         if (!unwrappedException_.ref().initialized())

+ 0 - 153
frg/work-js/mozilla-release/patches/mozilla-central-push_433584.patch

@@ -1,153 +0,0 @@
-# HG changeset patch
-# User Ted Campbell <tcampbell@mozilla.com>
-# Date 1534962482 14400
-#      Wed Aug 22 14:28:02 2018 -0400
-# Node ID a6aa090e485ef4e81fc6e090e12ab6d2019f21aa
-# Parent  481d502afc69d7d120b2d80a2b881bcea25c2661
-Bug 1485347 - Part 1: Remove nTypeSets argument from JSScript::partiallyInit. r=jandem
-
-MozReview-Commit-ID: I6xBHG8FLlq
-
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -545,25 +545,28 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-     } else {
-         // When encoding, we do not mutate any of the JSScript or LazyScript, so
-         // we can safely unwrap it here.
-         sourceObject = &script->scriptSourceUnwrap();
-     }
- 
-     if (mode == XDR_DECODE) {
-         if (!JSScript::partiallyInit(cx, script, nscopes, nconsts, nobjects, ntrynotes,
--                                     nscopenotes, nyieldoffsets, nTypeSets))
-+                                     nscopenotes, nyieldoffsets))
-         {
-             return xdr->fail(JS::TranscodeResult_Throw);
-         }
- 
-         MOZ_ASSERT(!script->mainOffset());
-         script->mainOffset_ = prologueLength;
-         script->funLength_ = funLength;
- 
-+        MOZ_ASSERT(nTypeSets <= UINT16_MAX);
-+        script->nTypeSets_ = uint16_t(nTypeSets);
-+
-         scriptp.set(script);
- 
-         if (scriptBits & (1 << Strict))
-             script->bitFields_.strict_ = true;
-         if (scriptBits & (1 << ExplicitUseStrict))
-             script->bitFields_.explicitUseStrict_ = true;
-         if (scriptBits & (1 << ContainsDynamicNameAccess))
-             script->bitFields_.bindingsAccessedDynamically_ = true;
-@@ -2746,31 +2749,28 @@ AllocScriptData(JSContext* cx, size_t si
-         return nullptr;
-     MOZ_ASSERT(size_t(data) % sizeof(Value) == 0);
-     return data;
- }
- 
- /* static */ bool
- JSScript::partiallyInit(JSContext* cx, HandleScript script, uint32_t nscopes,
-                         uint32_t nconsts, uint32_t nobjects, uint32_t ntrynotes,
--                        uint32_t nscopenotes, uint32_t nyieldoffsets, uint32_t nTypeSets)
-+                        uint32_t nscopenotes, uint32_t nyieldoffsets)
- {
-     cx->check(script);
- 
-     size_t size = ScriptDataSize(nscopes, nconsts, nobjects, ntrynotes,
-                                  nscopenotes, nyieldoffsets);
-     script->data = AllocScriptData(cx, size);
-     if (size && !script->data)
-         return false;
- 
-     script->dataSize_ = size;
- 
--    MOZ_ASSERT(nTypeSets <= UINT16_MAX);
--    script->nTypeSets_ = uint16_t(nTypeSets);
--
-     uint8_t* cursor = script->data;
- 
-     // There must always be at least 1 scope, the body scope.
-     MOZ_ASSERT(nscopes != 0);
-     cursor += sizeof(ScopeArray);
- 
-     if (nconsts != 0) {
-         script->setHasArray(CONSTS);
-@@ -2851,23 +2851,24 @@ JSScript::initFunctionPrototype(JSContex
-                                 HandleFunction functionProto)
- {
-     uint32_t numScopes = 1;
-     uint32_t numConsts = 0;
-     uint32_t numObjects = 0;
-     uint32_t numTryNotes = 0;
-     uint32_t numScopeNotes = 0;
-     uint32_t numYieldAndAwaitOffsets = 0;
--    uint32_t numTypeSets = 0;
-     if (!partiallyInit(cx, script, numScopes, numConsts, numObjects, numTryNotes,
--                       numScopeNotes, numYieldAndAwaitOffsets, numTypeSets))
-+                       numScopeNotes, numYieldAndAwaitOffsets))
-     {
-         return false;
-     }
- 
-+    script->nTypeSets_ = 0;
-+
-     RootedScope enclosing(cx, &cx->global()->emptyGlobalScope());
-     Scope* functionProtoScope = FunctionScope::create(cx, nullptr, false, false, functionProto,
-                                                       enclosing);
-     if (!functionProtoScope)
-         return false;
-     script->scopes()->vector[0].init(functionProtoScope);
- 
-     uint32_t codeLength = 1;
-@@ -2966,24 +2967,24 @@ JSScript::fullyInitFromEmitter(JSContext
-     uint32_t prologueLength = bce->prologueOffset();
-     uint32_t nsrcnotes;
-     if (!bce->finishTakingSrcNotes(&nsrcnotes))
-         return false;
-     uint32_t natoms = bce->atomIndices->count();
-     if (!partiallyInit(cx, script,
-                        bce->scopeList.length(), bce->constList.length(), bce->objectList.length,
-                        bce->tryNoteList.length(), bce->scopeNoteList.length(),
--                       bce->yieldAndAwaitOffsetList.length(), bce->typesetCount))
-+                       bce->yieldAndAwaitOffsetList.length()))
-     {
-         return false;
-     }
- 
-     MOZ_ASSERT(script->mainOffset() == 0);
-     script->mainOffset_ = prologueLength;
--
-+    script->nTypeSets_ = bce->typesetCount;
-     script->lineno_ = bce->firstLine;
- 
-     if (!script->createScriptData(cx, prologueLength + mainLength, nsrcnotes, natoms))
-         return false;
- 
-     // Any fallible operation after JSScript::createScriptData should reset
-     // JSScript.scriptData_, in order to treat this script as uncompleted,
-     // in JSScript::isUncompleted.
-diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h
---- a/js/src/vm/JSScript.h
-+++ b/js/src/vm/JSScript.h
-@@ -1216,18 +1216,17 @@ class JSScript : public js::gc::TenuredC
-                             uint32_t toStringStart, uint32_t toStringEnd);
- 
-     // Three ways ways to initialize a JSScript. Callers of partiallyInit()
-     // are responsible for notifying the debugger after successfully creating
-     // any kind (function or other) of new JSScript.  However, callers of
-     // fullyInitFromEmitter() do not need to do this.
-     static bool partiallyInit(JSContext* cx, JS::Handle<JSScript*> script,
-                               uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
--                              uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets,
--                              uint32_t nTypeSets);
-+                              uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets);
- 
-   private:
-     static void initFromFunctionBox(js::HandleScript script, js::frontend::FunctionBox* funbox);
-     static void initFromModuleContext(js::HandleScript script);
- 
-   public:
-     static bool fullyInitFromEmitter(JSContext* cx, js::HandleScript script,
-                                      js::frontend::BytecodeEmitter* bce);

+ 0 - 105
frg/work-js/mozilla-release/patches/mozilla-central-push_433585.patch

@@ -1,105 +0,0 @@
-# HG changeset patch
-# User Ted Campbell <tcampbell@mozilla.com>
-# Date 1535057961 14400
-#      Thu Aug 23 16:59:21 2018 -0400
-# Node ID b09a2762f0e5533dab80401953121580134a2c6e
-# Parent  a6aa090e485ef4e81fc6e090e12ab6d2019f21aa
-Bug 1485347 - Part 2: Remove CheckScriptDataIntegrity. r=jandem
-
-This diagnostic did not provide value and should be removed to allow
-further cleanup.
-
-MozReview-Commit-ID: 49XJM0G7NAP
-
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -70,31 +70,16 @@
- using namespace js;
- using namespace js::gc;
- using namespace js::frontend;
- 
- using mozilla::Maybe;
- using mozilla::PodCopy;
- 
- 
--// Check that JSScript::data hasn't experienced obvious memory corruption.
--// This is a diagnositic for Bug 1367896.
--static void
--CheckScriptDataIntegrity(JSScript* script)
--{
--    ScopeArray* sa = script->scopes();
--    uint8_t* ptr = reinterpret_cast<uint8_t*>(sa->vector);
--
--    // Check that scope data - who's pointer is stored in data region - also
--    // points within the data region.
--    MOZ_RELEASE_ASSERT(ptr >= script->data &&
--                       ptr + sa->length <= script->data + script->dataSize(),
--                       "Corrupt JSScript::data");
--}
--
- template<XDRMode mode>
- XDRResult
- js::XDRScriptConst(XDRState<mode>* xdr, MutableHandleValue vp)
- {
-     JSContext* cx = xdr->cx();
- 
-     enum ConstTag {
-         SCRIPT_INT,
-@@ -365,18 +350,16 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-     RootedScript script(cx);
-     natoms = nsrcnotes = 0;
-     nconsts = nobjects = nscopes = nregexps = ntrynotes = nscopenotes = nyieldoffsets = 0;
- 
-     if (mode == XDR_ENCODE) {
-         script = scriptp.get();
-         MOZ_ASSERT(script->functionNonDelazifying() == fun);
- 
--        CheckScriptDataIntegrity(script);
--
-         if (!fun && script->treatAsRunOnce() && script->hasRunOnce()) {
-             // This is a toplevel or eval script that's runOnce.  We want to
-             // make sure that we're not XDR-saving an object we emitted for
-             // JSOP_OBJECT that then got modified.  So throw if we're not
-             // cloning in JSOP_OBJECT or if we ever didn't clone in it in the
-             // past.
-             Realm* realm = cx->realm();
-             if (!realm->creationOptions().cloneSingletons() ||
-@@ -885,18 +868,16 @@ js::XDRScript(XDRState<mode>* xdr, Handl
- 
-         MOZ_TRY(XDRRelazificationInfo(xdr, fun, script, scriptEnclosingScope, &lazy));
- 
-         if (mode == XDR_DECODE)
-             script->setLazyScript(lazy);
-     }
- 
-     if (mode == XDR_DECODE) {
--        CheckScriptDataIntegrity(script);
--
-         scriptp.set(script);
- 
-         /* see BytecodeEmitter::tellDebuggerAboutCompiledScript */
-         if (!fun && !cx->helperThread())
-             Debugger::onNewScript(cx, script);
-     }
- 
-     return Ok();
-@@ -3453,18 +3434,16 @@ js::detail::CopyScript(JSContext* cx, Ha
- {
-     if (src->treatAsRunOnce() && !src->functionNonDelazifying()) {
-         JS_ReportErrorASCII(cx, "No cloning toplevel run-once scripts");
-         return false;
-     }
- 
-     /* NB: Keep this in sync with XDRScript. */
- 
--    CheckScriptDataIntegrity(src);
--
-     /* Some embeddings are not careful to use ExposeObjectToActiveJS as needed. */
-     MOZ_ASSERT(!src->sourceObject()->isMarkedGray());
- 
-     uint32_t nconsts   = src->hasConsts()   ? src->consts()->length   : 0;
-     uint32_t nobjects  = src->hasObjects()  ? src->objects()->length  : 0;
-     uint32_t nscopes   = src->scopes()->length;
-     uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes()->length : 0;
-     uint32_t nscopenotes = src->hasScopeNotes() ? src->scopeNotes()->length : 0;

+ 0 - 52
frg/work-js/mozilla-release/patches/mozilla-central-push_433632.patch

@@ -1,52 +0,0 @@
-# HG changeset patch
-# User Jan Beich <jbeich@FreeBSD.org>
-# Date 1535260380 -10800
-#      Sun Aug 26 08:13:00 2018 +0300
-# Node ID 744b6786f4d2c5f65cac6475b18d6a113ab1ac72
-# Parent  f6d7cbceaa1ae13625587c887c6d5e720ccd3399
-Bug 1486281 - Implement js::ThisThread::GetName() on FreeBSD 11.3/12.0. r=sfink r=Build
-
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -1104,17 +1104,17 @@ then
-     LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
- fi
- 
- 
- dnl Checks for library functions.
- dnl ========================================================
- AC_PROG_GCC_TRADITIONAL
- AC_FUNC_MEMCMP
--AC_CHECK_FUNCS([getc_unlocked _getc_nolock gmtime_r localtime_r pthread_getname_np])
-+AC_CHECK_FUNCS([getc_unlocked _getc_nolock gmtime_r localtime_r pthread_getname_np pthread_get_name_np])
- 
- dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
- dnl avoid this on Darwin, since depending on your system config, we may think
- dnl it exists but it really doesn't
- case "$OS_TARGET" in
- Darwin)
-   ;;
- *)
-diff --git a/js/src/threading/posix/Thread.cpp b/js/src/threading/posix/Thread.cpp
---- a/js/src/threading/posix/Thread.cpp
-+++ b/js/src/threading/posix/Thread.cpp
-@@ -203,15 +203,18 @@ js::ThisThread::SetName(const char* name
- void
- js::ThisThread::GetName(char* nameBuffer, size_t len)
- {
-   MOZ_RELEASE_ASSERT(len >= 16);
- 
-   int rv = -1;
- #ifdef HAVE_PTHREAD_GETNAME_NP
-   rv = pthread_getname_np(pthread_self(), nameBuffer, len);
-+#elif defined(HAVE_PTHREAD_GET_NAME_NP)
-+  pthread_get_name_np(pthread_self(), nameBuffer, len);
-+  rv = 0;
- #elif defined(__linux__)
-   rv = prctl(PR_GET_NAME, reinterpret_cast<unsigned long>(nameBuffer));
- #endif
- 
-   if (rv)
-     nameBuffer[0] = '\0';
- }

+ 0 - 64
frg/work-js/mozilla-release/patches/mozilla-central-push_433701.patch

@@ -1,64 +0,0 @@
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1535461921 -32400
-#      Tue Aug 28 22:12:01 2018 +0900
-# Node ID 2b045052d4aad4e77f3b8fce35a40efeed4e19f1
-# Parent  692efe8acba9c8abda38ed8987b67f31d5a7bf4a
-Bug 1485759 - Pass --build-id=sha1 to the linker instead of --build-id. r=froydnj
-
-BFD ld's --build-id means --build-id=sha1, but with lld it means
---build-id=fast. Both support the explicit --build-id=sha1, so use that.
-Gold supports --build-id=sha1 too.
-ld64, used for mac builds doesn't support neither --build-id=sha1 nor
---build-id.
-
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -487,19 +487,19 @@ if test "$GNU_CC"; then
- 
-     AC_MSG_CHECKING([for -z nocopyreloc option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
--    AC_MSG_CHECKING([for --build-id option to ld])
-+    AC_MSG_CHECKING([for --build-id=sha1 option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
--    LDFLAGS="$LDFLAGS -Wl,--build-id"
-+    LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
-     _DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
-     _USE_CPP_INCLUDE_FLAG=1
- fi
- 
-diff --git a/old-configure.in b/old-configure.in
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -547,19 +547,19 @@ if test "$GNU_CC"; then
- 
-     AC_MSG_CHECKING([for -z nocopyreloc option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
--    AC_MSG_CHECKING([for --build-id option to ld])
-+    AC_MSG_CHECKING([for --build-id=sha1 option to ld])
-     _SAVE_LDFLAGS=$LDFLAGS
--    LDFLAGS="$LDFLAGS -Wl,--build-id"
-+    LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
-     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
-                   AC_MSG_RESULT([no])
-                   LDFLAGS=$_SAVE_LDFLAGS)
- 
-     AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
-     HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
-     _SAVE_LDFLAGS=$LDFLAGS
-     LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"

+ 0 - 1045
frg/work-js/mozilla-release/patches/mozilla-central-push_433712.patch

@@ -1,1045 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535132455 18000
-#      Fri Aug 24 12:40:55 2018 -0500
-# Node ID 31b77a399fcf7cd458ee255053dfc4e98392d1f0
-# Parent  08f104b6a248ae20202dbe1229413cb30ed6c7b9
-Bug 1486577 - Move all compile-options classes to a new public js/CompileOptions.h header.  r=jandem
-
-diff --git a/js/public/CompileOptions.h b/js/public/CompileOptions.h
-new file mode 100644
---- /dev/null
-+++ b/js/public/CompileOptions.h
-@@ -0,0 +1,540 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+/*
-+ * Options for JavaScript compilation.
-+ *
-+ * In the most common use case, a CompileOptions instance is allocated on the
-+ * stack, and holds non-owning references to non-POD option values: strings,
-+ * principals, objects, and so on.  The code declaring the instance guarantees
-+ * that such option values will outlive the CompileOptions itself: objects are
-+ * otherwise rooted, principals have had their reference counts bumped, and
-+ * strings won't be freed until the CompileOptions goes out of scope.  In this
-+ * situation, CompileOptions only refers to things others own, so it can be
-+ * lightweight.
-+ *
-+ * In some cases, however, we need to hold compilation options with a
-+ * non-stack-like lifetime.  For example, JS::CompileOffThread needs to save
-+ * compilation options where a worker thread can find them, then return
-+ * immediately.  The worker thread will come along at some later point, and use
-+ * the options.
-+ *
-+ * The compiler itself just needs to be able to access a collection of options;
-+ * it doesn't care who owns them, or what's keeping them alive.  It does its
-+ * own addrefs/copies/tracing/etc.
-+ *
-+ * Furthermore, in some cases compile options are propagated from one entity to
-+ * another (e.g. from a script to a function defined in that script).  This
-+ * involves copying over some, but not all, of the options.
-+ *
-+ * So we have a class hierarchy that reflects these four use cases:
-+ *
-+ * - TransitiveCompileOptions is the common base class, representing options
-+ *   that should get propagated from a script to functions defined in that
-+ *   script.  This class is abstract and is only ever used as a subclass.
-+ *
-+ * - ReadOnlyCompileOptions is the only subclass of TransitiveCompileOptions,
-+ *   representing a full set of compile options.  It can be used by code that
-+ *   simply needs to access options set elsewhere, like the compiler.  This
-+ *   class too is abstract and is only ever used as a subclass.
-+ *
-+ * - The usual CompileOptions class must be stack-allocated, and holds
-+ *   non-owning references to the filename, element, and so on. It's derived
-+ *   from ReadOnlyCompileOptions, so the compiler can use it.
-+ *
-+ * - OwningCompileOptions roots / copies / reference counts of all its values,
-+ *   and unroots / frees / releases them when it is destructed. It too is
-+ *   derived from ReadOnlyCompileOptions, so the compiler accepts it.
-+ */
-+
-+#ifndef js_CompileOptions_h
-+#define js_CompileOptions_h
-+
-+#include "mozilla/Attributes.h" // MOZ_MUST_USE
-+#include "mozilla/MemoryReporting.h" // mozilla::MallocSizeOf
-+
-+#include <stddef.h> // size_t
-+#include <stdint.h> // uint8_t
-+
-+#include "jstypes.h" // JS_PUBLIC_API
-+
-+#include "js/RootingAPI.h" // JS::PersistentRooted, JS::Rooted
-+
-+struct JSContext;
-+class JSObject;
-+class JSScript;
-+class JSString;
-+
-+namespace JS {
-+
-+enum class AsmJSOption : uint8_t
-+{
-+    Enabled,
-+    Disabled,
-+    DisabledByDebugger,
-+};
-+
-+/**
-+ * The common base class for the CompileOptions hierarchy.
-+ *
-+ * Use this in code that needs to propagate compile options from one
-+ * compilation unit to another.
-+ */
-+class JS_PUBLIC_API(TransitiveCompileOptions)
-+{
-+  protected:
-+    /**
-+     * The Web Platform allows scripts to be loaded from arbitrary cross-origin
-+     * sources. This allows an attack by which a malicious website loads a
-+     * sensitive file (say, a bank statement) cross-origin (using the user's
-+     * cookies), and sniffs the generated syntax errors (via a window.onerror
-+     * handler) for juicy morsels of its contents.
-+     *
-+     * To counter this attack, HTML5 specifies that script errors should be
-+     * sanitized ("muted") when the script is not same-origin with the global
-+     * for which it is loaded. Callers should set this flag for cross-origin
-+     * scripts, and it will be propagated appropriately to child scripts and
-+     * passed back in JSErrorReports.
-+     */
-+    bool mutedErrors_ = false;
-+
-+    const char* filename_ = nullptr;
-+    const char* introducerFilename_ = nullptr;
-+    const char16_t* sourceMapURL_ = nullptr;
-+
-+  public:
-+    // POD options.
-+    bool utf8 = false;
-+    bool selfHostingMode = false;
-+    bool canLazilyParse = true;
-+    bool strictOption = false;
-+    bool extraWarningsOption = false;
-+    bool werrorOption = false;
-+    AsmJSOption asmJSOption = AsmJSOption::Disabled;
-+    bool throwOnAsmJSValidationFailureOption = false;
-+    bool forceAsync = false;
-+    bool sourceIsLazy = false;
-+    bool allowHTMLComments = true;
-+    bool isProbablySystemCode = false;
-+    bool hideScriptFromDebugger = false;
-+
-+    /**
-+     * |introductionType| is a statically allocated C string: one of "eval",
-+     * "Function", or "GeneratorFunction".
-+     */
-+    const char* introductionType = nullptr;
-+
-+    unsigned introductionLineno = 0;
-+    uint32_t introductionOffset = 0;
-+    bool hasIntroductionInfo = false;
-+
-+  protected:
-+    TransitiveCompileOptions() = default;
-+
-+    // Set all POD options (those not requiring reference counts, copies,
-+    // rooting, or other hand-holding) to their values in |rhs|.
-+    void copyPODTransitiveOptions(const TransitiveCompileOptions& rhs);
-+
-+  public:
-+    // Read-only accessors for non-POD options. The proper way to set these
-+    // depends on the derived type.
-+    bool mutedErrors() const { return mutedErrors_; }
-+    const char* filename() const { return filename_; }
-+    const char* introducerFilename() const { return introducerFilename_; }
-+    const char16_t* sourceMapURL() const { return sourceMapURL_; }
-+    virtual JSObject* element() const = 0;
-+    virtual JSString* elementAttributeName() const = 0;
-+    virtual JSScript* introductionScript() const = 0;
-+
-+  private:
-+    void operator=(const TransitiveCompileOptions&) = delete;
-+};
-+
-+/**
-+ * The class representing a full set of compile options.
-+ *
-+ * Use this in code that only needs to access compilation options created
-+ * elsewhere, like the compiler.  Don't instantiate this class (the constructor
-+ * is protected anyway); instead, create instances only of the derived classes:
-+ * CompileOptions and OwningCompileOptions.
-+ */
-+class JS_PUBLIC_API(ReadOnlyCompileOptions)
-+  : public TransitiveCompileOptions
-+{
-+  public:
-+    // POD options.
-+    unsigned lineno  = 1;
-+    unsigned column = 0;
-+
-+    // The offset within the ScriptSource's full uncompressed text of the first
-+    // character we're presenting for compilation with this CompileOptions.
-+    //
-+    // When we compile a LazyScript, we pass the compiler only the substring of
-+    // the source the lazy function occupies. With chunked decompression, we
-+    // may not even have the complete uncompressed source present in memory. But
-+    // parse node positions are offsets within the ScriptSource's full text,
-+    // and LazyScripts indicate their substring of the full source by its
-+    // starting and ending offsets within the full text. This
-+    // scriptSourceOffset field lets the frontend convert between these
-+    // offsets and offsets within the substring presented for compilation.
-+    unsigned scriptSourceOffset = 0;
-+
-+    // isRunOnce only applies to non-function scripts.
-+    bool isRunOnce =  false;
-+
-+    bool nonSyntacticScope = false;
-+    bool noScriptRval = false;
-+    bool allowSyntaxParser = true;
-+
-+
-+  private:
-+    friend class CompileOptions;
-+
-+  protected:
-+    ReadOnlyCompileOptions() = default;
-+
-+    // Set all POD options (those not requiring reference counts, copies,
-+    // rooting, or other hand-holding) to their values in |rhs|.
-+    void copyPODOptions(const ReadOnlyCompileOptions& rhs);
-+
-+  public:
-+    // Read-only accessors for non-POD options. The proper way to set these
-+    // depends on the derived type.
-+    bool mutedErrors() const { return mutedErrors_; }
-+    const char* filename() const { return filename_; }
-+    const char* introducerFilename() const { return introducerFilename_; }
-+    const char16_t* sourceMapURL() const { return sourceMapURL_; }
-+    virtual JSObject* element() const override = 0;
-+    virtual JSString* elementAttributeName() const override = 0;
-+    virtual JSScript* introductionScript() const override = 0;
-+
-+  private:
-+    void operator=(const ReadOnlyCompileOptions&) = delete;
-+};
-+
-+/**
-+ * Compilation options, with dynamic lifetime. An instance of this type
-+ * makes a copy of / holds / roots all dynamically allocated resources
-+ * (principals; elements; strings) that it refers to. Its destructor frees
-+ * / drops / unroots them. This is heavier than CompileOptions, below, but
-+ * unlike CompileOptions, it can outlive any given stack frame.
-+ *
-+ * Note that this *roots* any JS values it refers to - they're live
-+ * unconditionally. Thus, instances of this type can't be owned, directly
-+ * or indirectly, by a JavaScript object: if any value that this roots ever
-+ * comes to refer to the object that owns this, then the whole cycle, and
-+ * anything else it entrains, will never be freed.
-+ */
-+class JS_PUBLIC_API(OwningCompileOptions) final
-+  : public ReadOnlyCompileOptions
-+{
-+    PersistentRooted<JSObject*> elementRoot;
-+    PersistentRooted<JSString*> elementAttributeNameRoot;
-+    PersistentRooted<JSScript*> introductionScriptRoot;
-+
-+  public:
-+    // A minimal constructor, for use with OwningCompileOptions::copy.
-+    explicit OwningCompileOptions(JSContext* cx);
-+    ~OwningCompileOptions();
-+
-+    JSObject* element() const override { return elementRoot; }
-+    JSString* elementAttributeName() const override { return elementAttributeNameRoot; }
-+    JSScript* introductionScript() const override { return introductionScriptRoot; }
-+
-+    /** Set this to a copy of |rhs|.  Return false on OOM. */
-+    bool copy(JSContext* cx, const ReadOnlyCompileOptions& rhs);
-+
-+    /* These setters make copies of their string arguments and are fallible. */
-+    bool setFile(JSContext* cx, const char* f);
-+    MOZ_MUST_USE bool setFileAndLine(JSContext* cx, const char* f, unsigned l);
-+    MOZ_MUST_USE bool setSourceMapURL(JSContext* cx, const char16_t* s);
-+    MOZ_MUST_USE bool setIntroducerFilename(JSContext* cx, const char* s);
-+
-+    /* These setters are infallible, and can be chained. */
-+
-+    OwningCompileOptions& setLine(unsigned l) {
-+        lineno = l;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setElement(JSObject* e) {
-+        elementRoot = e;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setElementAttributeName(JSString* p) {
-+        elementAttributeNameRoot = p;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setIntroductionScript(JSScript* s) {
-+        introductionScriptRoot = s;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setMutedErrors(bool mute) {
-+        mutedErrors_ = mute;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setUTF8(bool u) {
-+        utf8 = u;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setColumn(unsigned c) {
-+        column = c;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setScriptSourceOffset(unsigned o) {
-+        scriptSourceOffset = o;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setIsRunOnce(bool once) {
-+        isRunOnce = once;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setNoScriptRval(bool nsr) {
-+        noScriptRval = nsr;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setSelfHostingMode(bool shm) {
-+        selfHostingMode = shm;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setCanLazilyParse(bool clp) {
-+        canLazilyParse = clp;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setAllowSyntaxParser(bool clp) {
-+        allowSyntaxParser = clp;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setSourceIsLazy(bool l) {
-+        sourceIsLazy = l;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setNonSyntacticScope(bool n) {
-+        nonSyntacticScope = n;
-+        return *this;
-+    }
-+
-+    OwningCompileOptions& setIntroductionType(const char* t) {
-+        introductionType = t;
-+        return *this;
-+    }
-+
-+    bool setIntroductionInfo(JSContext* cx, const char* introducerFn,
-+                             const char* intro, unsigned line,
-+                             JSScript* script, uint32_t offset)
-+    {
-+        if (!setIntroducerFilename(cx, introducerFn))
-+            return false;
-+
-+        introductionType = intro;
-+        introductionLineno = line;
-+        introductionScriptRoot = script;
-+        introductionOffset = offset;
-+        hasIntroductionInfo = true;
-+        return true;
-+    }
-+
-+    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
-+
-+  private:
-+    void operator=(const CompileOptions& rhs) = delete;
-+};
-+
-+/**
-+ * Compilation options stored on the stack. An instance of this type
-+ * simply holds references to dynamically allocated resources (element;
-+ * filename; source map URL) that are owned by something else. If you
-+ * create an instance of this type, it's up to you to guarantee that
-+ * everything you store in it will outlive it.
-+ */
-+class MOZ_STACK_CLASS JS_PUBLIC_API(CompileOptions) final
-+  : public ReadOnlyCompileOptions
-+{
-+  private:
-+    Rooted<JSObject*> elementRoot;
-+    Rooted<JSString*> elementAttributeNameRoot;
-+    Rooted<JSScript*> introductionScriptRoot;
-+
-+  public:
-+    explicit CompileOptions(JSContext* cx);
-+
-+    CompileOptions(JSContext* cx, const ReadOnlyCompileOptions& rhs)
-+      : ReadOnlyCompileOptions(),
-+        elementRoot(cx),
-+        elementAttributeNameRoot(cx),
-+        introductionScriptRoot(cx)
-+    {
-+        copyPODOptions(rhs);
-+
-+        filename_ = rhs.filename();
-+        introducerFilename_ = rhs.introducerFilename();
-+        sourceMapURL_ = rhs.sourceMapURL();
-+        elementRoot = rhs.element();
-+        elementAttributeNameRoot = rhs.elementAttributeName();
-+        introductionScriptRoot = rhs.introductionScript();
-+    }
-+
-+    CompileOptions(JSContext* cx, const TransitiveCompileOptions& rhs)
-+      : ReadOnlyCompileOptions(),
-+        elementRoot(cx),
-+        elementAttributeNameRoot(cx),
-+        introductionScriptRoot(cx)
-+    {
-+        copyPODTransitiveOptions(rhs);
-+
-+        filename_ = rhs.filename();
-+        introducerFilename_ = rhs.introducerFilename();
-+        sourceMapURL_ = rhs.sourceMapURL();
-+        elementRoot = rhs.element();
-+        elementAttributeNameRoot = rhs.elementAttributeName();
-+        introductionScriptRoot = rhs.introductionScript();
-+    }
-+
-+    JSObject* element() const override {
-+        return elementRoot;
-+    }
-+
-+    JSString* elementAttributeName() const override {
-+        return elementAttributeNameRoot;
-+    }
-+
-+    JSScript* introductionScript() const override {
-+        return introductionScriptRoot;
-+    }
-+
-+    CompileOptions& setFile(const char* f) {
-+        filename_ = f;
-+        return *this;
-+    }
-+
-+    CompileOptions& setLine(unsigned l) {
-+        lineno = l;
-+        return *this;
-+    }
-+
-+    CompileOptions& setFileAndLine(const char* f, unsigned l) {
-+        filename_ = f;
-+        lineno = l;
-+        return *this;
-+    }
-+
-+    CompileOptions& setSourceMapURL(const char16_t* s) {
-+        sourceMapURL_ = s;
-+        return *this;
-+    }
-+
-+    CompileOptions& setElement(JSObject* e) {
-+        elementRoot = e;
-+        return *this;
-+    }
-+
-+    CompileOptions& setElementAttributeName(JSString* p) {
-+        elementAttributeNameRoot = p;
-+        return *this;
-+    }
-+
-+    CompileOptions& setIntroductionScript(JSScript* s) {
-+        introductionScriptRoot = s;
-+        return *this;
-+    }
-+
-+    CompileOptions& setMutedErrors(bool mute) {
-+        mutedErrors_ = mute;
-+        return *this;
-+    }
-+
-+    CompileOptions& setUTF8(bool u) {
-+        utf8 = u;
-+        return *this;
-+    }
-+
-+    CompileOptions& setColumn(unsigned c) {
-+        column = c;
-+        return *this;
-+    }
-+
-+    CompileOptions& setScriptSourceOffset(unsigned o) {
-+        scriptSourceOffset = o;
-+        return *this;
-+    }
-+
-+    CompileOptions& setIsRunOnce(bool once) {
-+        isRunOnce = once;
-+        return *this;
-+    }
-+
-+    CompileOptions& setNoScriptRval(bool nsr) {
-+        noScriptRval = nsr;
-+        return *this;
-+    }
-+
-+    CompileOptions& setSelfHostingMode(bool shm) {
-+        selfHostingMode = shm;
-+        return *this;
-+    }
-+
-+    CompileOptions& setCanLazilyParse(bool clp) {
-+        canLazilyParse = clp;
-+        return *this;
-+    }
-+
-+    CompileOptions& setAllowSyntaxParser(bool clp) {
-+        allowSyntaxParser = clp;
-+        return *this;
-+    }
-+
-+    CompileOptions& setSourceIsLazy(bool l) {
-+        sourceIsLazy = l;
-+        return *this;
-+    }
-+
-+    CompileOptions& setNonSyntacticScope(bool n) {
-+        nonSyntacticScope = n;
-+        return *this;
-+    }
-+
-+    CompileOptions& setIntroductionType(const char* t) {
-+        introductionType = t;
-+        return *this;
-+    }
-+
-+    CompileOptions& setIntroductionInfo(const char* introducerFn,
-+                                        const char* intro, unsigned line,
-+                                        JSScript* script, uint32_t offset)
-+    {
-+        introducerFilename_ = introducerFn;
-+        introductionType = intro;
-+        introductionLineno = line;
-+        introductionScriptRoot = script;
-+        introductionOffset = offset;
-+        hasIntroductionInfo = true;
-+        return *this;
-+    }
-+
-+    CompileOptions& maybeMakeStrictMode(bool strict) {
-+        strictOption = strictOption || strict;
-+        return *this;
-+    }
-+
-+  private:
-+    void operator=(const CompileOptions& rhs) = delete;
-+};
-+
-+} // namespace JS
-+
-+#endif /* js_CompileOptions_h */
-diff --git a/js/rust/etc/wrapper.hpp b/js/rust/etc/wrapper.hpp
---- a/js/rust/etc/wrapper.hpp
-+++ b/js/rust/etc/wrapper.hpp
-@@ -8,16 +8,17 @@
- #ifndef _MSC_VER
- #include <unistd.h>
- #endif
- 
- typedef uint32_t HashNumber;
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/CompileOptions.h"
- #include "js/Conversions.h"
- #include "js/Initialization.h"
- #include "js/MemoryMetrics.h"
- #include "js/StructuredClone.h"
- 
- // Replacements for types that are too difficult for rust-bindgen.
- 
- /// <div rustbindgen replaces="JS::detail::MaybeWrapped" />
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -23,16 +23,17 @@
- #include <stdio.h>
- 
- #include "jspubtd.h"
- 
- #include "js/AllocPolicy.h"
- #include "js/CallArgs.h"
- #include "js/CharacterEncoding.h"
- #include "js/Class.h"
-+#include "js/CompileOptions.h"
- #include "js/ErrorReport.h"
- #include "js/GCVector.h"
- #include "js/HashTable.h"
- #include "js/Id.h"
- #include "js/MemoryFunctions.h"
- #include "js/Principals.h"
- #include "js/Realm.h"
- #include "js/RefCounted.h"
-@@ -3161,400 +3162,16 @@ JS_GetScriptFilename(JSScript* script);
- extern JS_PUBLIC_API(unsigned)
- JS_GetScriptBaseLineNumber(JSContext* cx, JSScript* script);
- 
- extern JS_PUBLIC_API(JSScript*)
- JS_GetFunctionScript(JSContext* cx, JS::HandleFunction fun);
- 
- namespace JS {
- 
--/* Options for JavaScript compilation. */
--
--/*
-- * In the most common use case, a CompileOptions instance is allocated on the
-- * stack, and holds non-owning references to non-POD option values: strings;
-- * principals; objects; and so on. The code declaring the instance guarantees
-- * that such option values will outlive the CompileOptions itself: objects are
-- * otherwise rooted; principals have had their reference counts bumped; strings
-- * will not be freed until the CompileOptions goes out of scope. In this
-- * situation, CompileOptions only refers to things others own, so it can be
-- * lightweight.
-- *
-- * In some cases, however, we need to hold compilation options with a
-- * non-stack-like lifetime. For example, JS::CompileOffThread needs to save
-- * compilation options where a worker thread can find them, and then return
-- * immediately. The worker thread will come along at some later point, and use
-- * the options.
-- *
-- * The compiler itself just needs to be able to access a collection of options;
-- * it doesn't care who owns them, or what's keeping them alive. It does its own
-- * addrefs/copies/tracing/etc.
-- *
-- * Furthermore, in some cases compile options are propagated from one entity to
-- * another (e.g. from a script to a function defined in that script).  This
-- * involves copying over some, but not all, of the options.
-- *
-- * So, we have a class hierarchy that reflects these four use cases:
-- *
-- * - TransitiveCompileOptions is the common base class, representing options
-- *   that should get propagated from a script to functions defined in that
-- *   script.  This is never instantiated directly.
-- *
-- * - ReadOnlyCompileOptions is the only subclass of TransitiveCompileOptions,
-- *   representing a full set of compile options.  It can be used by code that
-- *   simply needs to access options set elsewhere, like the compiler.  This,
-- *   again, is never instantiated directly.
-- *
-- * - The usual CompileOptions class must be stack-allocated, and holds
-- *   non-owning references to the filename, element, and so on. It's derived
-- *   from ReadOnlyCompileOptions, so the compiler can use it.
-- *
-- * - OwningCompileOptions roots / copies / reference counts of all its values,
-- *   and unroots / frees / releases them when it is destructed. It too is
-- *   derived from ReadOnlyCompileOptions, so the compiler accepts it.
-- */
--
--enum class AsmJSOption : uint8_t { Enabled, Disabled, DisabledByDebugger };
--
--/**
-- * The common base class for the CompileOptions hierarchy.
-- *
-- * Use this in code that needs to propagate compile options from one compilation
-- * unit to another.
-- */
--class JS_FRIEND_API(TransitiveCompileOptions)
--{
--  protected:
--    // The Web Platform allows scripts to be loaded from arbitrary cross-origin
--    // sources. This allows an attack by which a malicious website loads a
--    // sensitive file (say, a bank statement) cross-origin (using the user's
--    // cookies), and sniffs the generated syntax errors (via a window.onerror
--    // handler) for juicy morsels of its contents.
--    //
--    // To counter this attack, HTML5 specifies that script errors should be
--    // sanitized ("muted") when the script is not same-origin with the global
--    // for which it is loaded. Callers should set this flag for cross-origin
--    // scripts, and it will be propagated appropriately to child scripts and
--    // passed back in JSErrorReports.
--    bool mutedErrors_;
--    const char* filename_;
--    const char* introducerFilename_;
--    const char16_t* sourceMapURL_;
--
--    TransitiveCompileOptions()
--      : mutedErrors_(false),
--        filename_(nullptr),
--        introducerFilename_(nullptr),
--        sourceMapURL_(nullptr),
--        utf8(false),
--        selfHostingMode(false),
--        canLazilyParse(true),
--        strictOption(false),
--        extraWarningsOption(false),
--        werrorOption(false),
--        asmJSOption(AsmJSOption::Disabled),
--        throwOnAsmJSValidationFailureOption(false),
--        forceAsync(false),
--        sourceIsLazy(false),
--        allowHTMLComments(true),
--        isProbablySystemCode(false),
--        hideScriptFromDebugger(false),
--        introductionType(nullptr),
--        introductionLineno(0),
--        introductionOffset(0),
--        hasIntroductionInfo(false)
--    { }
--
--    // Set all POD options (those not requiring reference counts, copies,
--    // rooting, or other hand-holding) to their values in |rhs|.
--    void copyPODTransitiveOptions(const TransitiveCompileOptions& rhs);
--
--  public:
--    // Read-only accessors for non-POD options. The proper way to set these
--    // depends on the derived type.
--    bool mutedErrors() const { return mutedErrors_; }
--    const char* filename() const { return filename_; }
--    const char* introducerFilename() const { return introducerFilename_; }
--    const char16_t* sourceMapURL() const { return sourceMapURL_; }
--    virtual JSObject* element() const = 0;
--    virtual JSString* elementAttributeName() const = 0;
--    virtual JSScript* introductionScript() const = 0;
--
--    // POD options.
--    bool utf8;
--    bool selfHostingMode;
--    bool canLazilyParse;
--    bool strictOption;
--    bool extraWarningsOption;
--    bool werrorOption;
--    AsmJSOption asmJSOption;
--    bool throwOnAsmJSValidationFailureOption;
--    bool forceAsync;
--    bool sourceIsLazy;
--    bool allowHTMLComments;
--    bool isProbablySystemCode;
--    bool hideScriptFromDebugger;
--
--    // |introductionType| is a statically allocated C string:
--    // one of "eval", "Function", or "GeneratorFunction".
--    const char* introductionType;
--    unsigned introductionLineno;
--    uint32_t introductionOffset;
--    bool hasIntroductionInfo;
--
--  private:
--    void operator=(const TransitiveCompileOptions&) = delete;
--};
--
--/**
-- * The class representing a full set of compile options.
-- *
-- * Use this in code that only needs to access compilation options created
-- * elsewhere, like the compiler. Don't instantiate this class (the constructor
-- * is protected anyway); instead, create instances only of the derived classes:
-- * CompileOptions and OwningCompileOptions.
-- */
--class JS_FRIEND_API(ReadOnlyCompileOptions) : public TransitiveCompileOptions
--{
--    friend class CompileOptions;
--
--  protected:
--    ReadOnlyCompileOptions()
--      : TransitiveCompileOptions(),
--        lineno(1),
--        column(0),
--        scriptSourceOffset(0),
--        isRunOnce(false),
--        nonSyntacticScope(false),
--        noScriptRval(false),
--        allowSyntaxParser(true)
--    { }
--
--    // Set all POD options (those not requiring reference counts, copies,
--    // rooting, or other hand-holding) to their values in |rhs|.
--    void copyPODOptions(const ReadOnlyCompileOptions& rhs);
--
--  public:
--    // Read-only accessors for non-POD options. The proper way to set these
--    // depends on the derived type.
--    bool mutedErrors() const { return mutedErrors_; }
--    const char* filename() const { return filename_; }
--    const char* introducerFilename() const { return introducerFilename_; }
--    const char16_t* sourceMapURL() const { return sourceMapURL_; }
--    virtual JSObject* element() const override = 0;
--    virtual JSString* elementAttributeName() const override = 0;
--    virtual JSScript* introductionScript() const override = 0;
--
--    // POD options.
--    unsigned lineno;
--    unsigned column;
--    // The offset within the ScriptSource's full uncompressed text of the first
--    // character we're presenting for compilation with this CompileOptions.
--    //
--    // When we compile a LazyScript, we pass the compiler only the substring of
--    // the source the lazy function occupies. With chunked decompression, we
--    // may not even have the complete uncompressed source present in memory. But
--    // parse node positions are offsets within the ScriptSource's full text,
--    // and LazyScripts indicate their substring of the full source by its
--    // starting and ending offsets within the full text. This
--    // scriptSourceOffset field lets the frontend convert between these
--    // offsets and offsets within the substring presented for compilation.
--    unsigned scriptSourceOffset;
--    // isRunOnce only applies to non-function scripts.
--    bool isRunOnce;
--    bool nonSyntacticScope;
--    bool noScriptRval;
--    bool allowSyntaxParser;
--
--  private:
--    void operator=(const ReadOnlyCompileOptions&) = delete;
--};
--
--/**
-- * Compilation options, with dynamic lifetime. An instance of this type
-- * makes a copy of / holds / roots all dynamically allocated resources
-- * (principals; elements; strings) that it refers to. Its destructor frees
-- * / drops / unroots them. This is heavier than CompileOptions, below, but
-- * unlike CompileOptions, it can outlive any given stack frame.
-- *
-- * Note that this *roots* any JS values it refers to - they're live
-- * unconditionally. Thus, instances of this type can't be owned, directly
-- * or indirectly, by a JavaScript object: if any value that this roots ever
-- * comes to refer to the object that owns this, then the whole cycle, and
-- * anything else it entrains, will never be freed.
-- */
--class JS_FRIEND_API(OwningCompileOptions) : public ReadOnlyCompileOptions
--{
--    PersistentRootedObject elementRoot;
--    PersistentRootedString elementAttributeNameRoot;
--    PersistentRootedScript introductionScriptRoot;
--
--  public:
--    // A minimal constructor, for use with OwningCompileOptions::copy.
--    explicit OwningCompileOptions(JSContext* cx);
--    ~OwningCompileOptions();
--
--    JSObject* element() const override { return elementRoot; }
--    JSString* elementAttributeName() const override { return elementAttributeNameRoot; }
--    JSScript* introductionScript() const override { return introductionScriptRoot; }
--
--    // Set this to a copy of |rhs|. Return false on OOM.
--    bool copy(JSContext* cx, const ReadOnlyCompileOptions& rhs);
--
--    /* These setters make copies of their string arguments, and are fallible. */
--    bool setFile(JSContext* cx, const char* f);
--    bool setFileAndLine(JSContext* cx, const char* f, unsigned l);
--    bool setSourceMapURL(JSContext* cx, const char16_t* s);
--    bool setIntroducerFilename(JSContext* cx, const char* s);
--
--    /* These setters are infallible, and can be chained. */
--    OwningCompileOptions& setLine(unsigned l)             { lineno = l; return *this; }
--    OwningCompileOptions& setElement(JSObject* e) {
--        elementRoot = e;
--        return *this;
--    }
--    OwningCompileOptions& setElementAttributeName(JSString* p) {
--        elementAttributeNameRoot = p;
--        return *this;
--    }
--    OwningCompileOptions& setIntroductionScript(JSScript* s) {
--        introductionScriptRoot = s;
--        return *this;
--    }
--    OwningCompileOptions& setMutedErrors(bool mute) {
--        mutedErrors_ = mute;
--        return *this;
--    }
--    OwningCompileOptions& setUTF8(bool u) { utf8 = u; return *this; }
--    OwningCompileOptions& setColumn(unsigned c) { column = c; return *this; }
--    OwningCompileOptions& setScriptSourceOffset(unsigned o) { scriptSourceOffset = o; return *this; }
--    OwningCompileOptions& setIsRunOnce(bool once) { isRunOnce = once; return *this; }
--    OwningCompileOptions& setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
--    OwningCompileOptions& setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
--    OwningCompileOptions& setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }
--    OwningCompileOptions& setAllowSyntaxParser(bool clp) { allowSyntaxParser = clp; return *this; }
--    OwningCompileOptions& setSourceIsLazy(bool l) { sourceIsLazy = l; return *this; }
--    OwningCompileOptions& setNonSyntacticScope(bool n) { nonSyntacticScope = n; return *this; }
--    OwningCompileOptions& setIntroductionType(const char* t) { introductionType = t; return *this; }
--    bool setIntroductionInfo(JSContext* cx, const char* introducerFn, const char* intro,
--                             unsigned line, JSScript* script, uint32_t offset)
--    {
--        if (!setIntroducerFilename(cx, introducerFn))
--            return false;
--        introductionType = intro;
--        introductionLineno = line;
--        introductionScriptRoot = script;
--        introductionOffset = offset;
--        hasIntroductionInfo = true;
--        return true;
--    }
--
--    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
--
--  private:
--    void operator=(const CompileOptions& rhs) = delete;
--};
--
--/**
-- * Compilation options stored on the stack. An instance of this type
-- * simply holds references to dynamically allocated resources (element;
-- * filename; source map URL) that are owned by something else. If you
-- * create an instance of this type, it's up to you to guarantee that
-- * everything you store in it will outlive it.
-- */
--class MOZ_STACK_CLASS JS_FRIEND_API(CompileOptions) final : public ReadOnlyCompileOptions
--{
--    RootedObject elementRoot;
--    RootedString elementAttributeNameRoot;
--    RootedScript introductionScriptRoot;
--
--  public:
--    explicit CompileOptions(JSContext* cx);
--    CompileOptions(JSContext* cx, const ReadOnlyCompileOptions& rhs)
--      : ReadOnlyCompileOptions(), elementRoot(cx), elementAttributeNameRoot(cx),
--        introductionScriptRoot(cx)
--    {
--        copyPODOptions(rhs);
--
--        filename_ = rhs.filename();
--        introducerFilename_ = rhs.introducerFilename();
--        sourceMapURL_ = rhs.sourceMapURL();
--        elementRoot = rhs.element();
--        elementAttributeNameRoot = rhs.elementAttributeName();
--        introductionScriptRoot = rhs.introductionScript();
--    }
--
--    CompileOptions(JSContext* cx, const TransitiveCompileOptions& rhs)
--      : ReadOnlyCompileOptions(), elementRoot(cx), elementAttributeNameRoot(cx),
--        introductionScriptRoot(cx)
--    {
--        copyPODTransitiveOptions(rhs);
--
--        filename_ = rhs.filename();
--        introducerFilename_ = rhs.introducerFilename();
--        sourceMapURL_ = rhs.sourceMapURL();
--        elementRoot = rhs.element();
--        elementAttributeNameRoot = rhs.elementAttributeName();
--        introductionScriptRoot = rhs.introductionScript();
--    }
--
--    JSObject* element() const override { return elementRoot; }
--    JSString* elementAttributeName() const override { return elementAttributeNameRoot; }
--    JSScript* introductionScript() const override { return introductionScriptRoot; }
--
--    CompileOptions& setFile(const char* f) { filename_ = f; return *this; }
--    CompileOptions& setLine(unsigned l) { lineno = l; return *this; }
--    CompileOptions& setFileAndLine(const char* f, unsigned l) {
--        filename_ = f; lineno = l; return *this;
--    }
--    CompileOptions& setSourceMapURL(const char16_t* s) { sourceMapURL_ = s; return *this; }
--    CompileOptions& setElement(JSObject* e)          { elementRoot = e; return *this; }
--    CompileOptions& setElementAttributeName(JSString* p) {
--        elementAttributeNameRoot = p;
--        return *this;
--    }
--    CompileOptions& setIntroductionScript(JSScript* s) {
--        introductionScriptRoot = s;
--        return *this;
--    }
--    CompileOptions& setMutedErrors(bool mute) {
--        mutedErrors_ = mute;
--        return *this;
--    }
--    CompileOptions& setUTF8(bool u) { utf8 = u; return *this; }
--    CompileOptions& setColumn(unsigned c) { column = c; return *this; }
--    CompileOptions& setScriptSourceOffset(unsigned o) { scriptSourceOffset = o; return *this; }
--    CompileOptions& setIsRunOnce(bool once) { isRunOnce = once; return *this; }
--    CompileOptions& setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
--    CompileOptions& setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
--    CompileOptions& setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }
--    CompileOptions& setAllowSyntaxParser(bool clp) { allowSyntaxParser = clp; return *this; }
--    CompileOptions& setSourceIsLazy(bool l) { sourceIsLazy = l; return *this; }
--    CompileOptions& setNonSyntacticScope(bool n) { nonSyntacticScope = n; return *this; }
--    CompileOptions& setIntroductionType(const char* t) { introductionType = t; return *this; }
--    CompileOptions& setIntroductionInfo(const char* introducerFn, const char* intro,
--                                        unsigned line, JSScript* script, uint32_t offset)
--    {
--        introducerFilename_ = introducerFn;
--        introductionType = intro;
--        introductionLineno = line;
--        introductionScriptRoot = script;
--        introductionOffset = offset;
--        hasIntroductionInfo = true;
--        return *this;
--    }
--    CompileOptions& maybeMakeStrictMode(bool strict) {
--        strictOption = strictOption || strict;
--        return *this;
--    }
--
--  private:
--    void operator=(const CompileOptions& rhs) = delete;
--};
--
- /**
-  * |script| will always be set. On failure, it will be set to nullptr.
-  */
- extern JS_PUBLIC_API(bool)
- Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
-         SourceBufferHolder& srcBuf, JS::MutableHandleScript script);
- 
- extern JS_PUBLIC_API(bool)
-diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h
---- a/js/src/jspubtd.h
-+++ b/js/src/jspubtd.h
-@@ -26,20 +26,20 @@ namespace JS {
- 
- template <typename T> class AutoVector;
- using AutoIdVector = AutoVector<jsid>;
- using AutoValueVector = AutoVector<Value>;
- using AutoObjectVector = AutoVector<JSObject*>;
- 
- class CallArgs;
- 
--class JS_FRIEND_API(CompileOptions);
--class JS_FRIEND_API(ReadOnlyCompileOptions);
--class JS_FRIEND_API(OwningCompileOptions);
--class JS_FRIEND_API(TransitiveCompileOptions);
-+class JS_PUBLIC_API(CompileOptions);
-+class JS_PUBLIC_API(ReadOnlyCompileOptions);
-+class JS_PUBLIC_API(OwningCompileOptions);
-+class JS_PUBLIC_API(TransitiveCompileOptions);
- class JS_PUBLIC_API(RealmOptions);
- 
- } // namespace JS
- 
- /* Result of typeof operator enumeration. */
- enum JSType {
-     JSTYPE_UNDEFINED,           /* undefined */
-     JSTYPE_OBJECT,              /* object */
-diff --git a/js/src/moz.build b/js/src/moz.build
---- a/js/src/moz.build
-+++ b/js/src/moz.build
-@@ -124,16 +124,17 @@ EXPORTS += [
- 
- EXPORTS.js += [
-     '../public/AllocPolicy.h',
-     '../public/AutoByteString.h',
-     '../public/CallArgs.h',
-     '../public/CallNonGenericMethod.h',
-     '../public/CharacterEncoding.h',
-     '../public/Class.h',
-+    '../public/CompileOptions.h',
-     '../public/Conversions.h',
-     '../public/Date.h',
-     '../public/Debug.h',
-     '../public/ErrorReport.h',
-     '../public/GCAnnotations.h',
-     '../public/GCAPI.h',
-     '../public/GCHashTable.h',
-     '../public/GCPolicyAPI.h',

+ 0 - 340
frg/work-js/mozilla-release/patches/mozilla-central-push_433713.patch

@@ -1,340 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535137235 18000
-#      Fri Aug 24 14:00:35 2018 -0500
-# Node ID ea8351c63f54a43a568804e81b8a5a237d1f8084
-# Parent  31b77a399fcf7cd458ee255053dfc4e98392d1f0
-Bug 1486577 - Move JS::SourceBufferHolder into a new public js/SourceBufferHolder.h header.  r=jandem
-
-diff --git a/js/public/SourceBufferHolder.h b/js/public/SourceBufferHolder.h
-new file mode 100644
---- /dev/null
-+++ b/js/public/SourceBufferHolder.h
-@@ -0,0 +1,140 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+/*
-+ * SourceBufferHolder groups buffer and length values and provides a way to
-+ * optionally pass ownership of the buffer to the JS engine without copying.
-+ *
-+ * Rules for use:
-+ *
-+ *  1) The data array must be allocated with js_malloc() or js_realloc() if
-+ *     ownership is being granted to the SourceBufferHolder.
-+ *  2) If ownership is not given to the SourceBufferHolder, then the memory
-+ *     must be kept alive until the JS compilation is complete.
-+ *  3) Any code calling SourceBufferHolder::take() must guarantee to keep the
-+ *     memory alive until JS compilation completes.  Normally only the JS
-+ *     engine should be calling take().
-+ *
-+ * Example use:
-+ *
-+ *    size_t length = 512;
-+ *    char16_t* chars = js_pod_malloc<char16_t>(length);
-+ *    JS::SourceBufferHolder srcBuf(chars, length, JS::SourceBufferHolder::GiveOwnership);
-+ *    JS::Compile(cx, options, srcBuf);
-+ */
-+
-+#ifndef js_SourceBufferHolder_h
-+#define js_SourceBufferHolder_h
-+
-+#include "mozilla/Assertions.h" // MOZ_ASSERT
-+
-+#include <stddef.h> // size_t
-+
-+#include "js/Utility.h" // JS::UniqueTwoByteChars
-+
-+namespace JS {
-+
-+class SourceBufferHolder final
-+{
-+  private:
-+    const char16_t* data_;
-+    size_t length_;
-+    bool ownsChars_;
-+
-+  private:
-+    void fixEmptyBuffer() {
-+        // Ensure that null buffers properly return an unowned, empty,
-+        // null-terminated string.
-+        static const char16_t NullChar_ = 0;
-+        if (!data_) {
-+            data_ = &NullChar_;
-+            length_ = 0;
-+            ownsChars_ = false;
-+        }
-+    }
-+
-+  public:
-+    enum Ownership {
-+      NoOwnership,
-+      GiveOwnership
-+    };
-+
-+    SourceBufferHolder(const char16_t* data, size_t dataLength, Ownership ownership)
-+      : data_(data),
-+        length_(dataLength),
-+        ownsChars_(ownership == GiveOwnership)
-+    {
-+        fixEmptyBuffer();
-+    }
-+
-+    SourceBufferHolder(UniqueTwoByteChars&& data, size_t dataLength)
-+      : data_(data.release()),
-+        length_(dataLength),
-+        ownsChars_(true)
-+    {
-+        fixEmptyBuffer();
-+    }
-+
-+    SourceBufferHolder(SourceBufferHolder&& other)
-+      : data_(other.data_),
-+        length_(other.length_),
-+        ownsChars_(other.ownsChars_)
-+    {
-+        other.data_ = nullptr;
-+        other.length_ = 0;
-+        other.ownsChars_ = false;
-+    }
-+
-+    ~SourceBufferHolder() {
-+        if (ownsChars_)
-+            js_free(const_cast<char16_t*>(data_));
-+    }
-+
-+    /** Access the underlying source buffer without affecting ownership. */
-+    const char16_t* get() const {
-+        return data_;
-+    }
-+
-+    /** Length of the source buffer in char16_t code units (not bytes). */
-+    size_t length() const {
-+        return length_;
-+    }
-+
-+    /**
-+     * Returns true if the SourceBufferHolder owns the buffer and will free it
-+     * upon destruction.  If true, it is legal to call take().
-+     */
-+    bool ownsChars() const {
-+        return ownsChars_;
-+    }
-+
-+    /**
-+     * Retrieve and take ownership of the underlying data buffer.  The caller
-+     * is now responsible for calling js_free() on the returned value, *but
-+     * only after JS script compilation has completed*.
-+     *
-+     * After the buffer has been taken the SourceBufferHolder functions as if
-+     * it had been constructed on an unowned buffer;  get() and length() still
-+     * work.  In order for this to be safe the taken buffer must be kept alive
-+     * until after JS script compilation completes as noted above.
-+     *
-+     * It's the caller's responsibility to check ownsChars() before taking the
-+     * buffer.  Taking and then free'ing an unowned buffer will have dire
-+     * consequences.
-+     */
-+    char16_t* take() {
-+        MOZ_ASSERT(ownsChars_);
-+        ownsChars_ = false;
-+        return const_cast<char16_t*>(data_);
-+    }
-+
-+  private:
-+    SourceBufferHolder(SourceBufferHolder&) = delete;
-+    SourceBufferHolder& operator=(SourceBufferHolder&) = delete;
-+};
-+
-+} // namespace JS
-+
-+#endif /* js_SourceBufferHolder_h */
-diff --git a/js/rust/etc/wrapper.hpp b/js/rust/etc/wrapper.hpp
---- a/js/rust/etc/wrapper.hpp
-+++ b/js/rust/etc/wrapper.hpp
-@@ -12,15 +12,16 @@
- typedef uint32_t HashNumber;
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
- #include "js/CompileOptions.h"
- #include "js/Conversions.h"
- #include "js/Initialization.h"
- #include "js/MemoryMetrics.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StructuredClone.h"
- 
- // Replacements for types that are too difficult for rust-bindgen.
- 
- /// <div rustbindgen replaces="JS::detail::MaybeWrapped" />
- template <typename T>
- using replaces_MaybeWrapped = T;
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -33,16 +33,17 @@
- #include "js/GCVector.h"
- #include "js/HashTable.h"
- #include "js/Id.h"
- #include "js/MemoryFunctions.h"
- #include "js/Principals.h"
- #include "js/Realm.h"
- #include "js/RefCounted.h"
- #include "js/RootingAPI.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/Stream.h"
- #include "js/TracingAPI.h"
- #include "js/UniquePtr.h"
- #include "js/Utility.h"
- #include "js/Value.h"
- #include "js/Vector.h"
- 
- /************************************************************************/
-@@ -296,124 +297,16 @@ JS_NumberValue(double d)
- 
- /************************************************************************/
- 
- JS_PUBLIC_API(bool)
- JS_StringHasBeenPinned(JSContext* cx, JSString* str);
- 
- namespace JS {
- 
--/**
-- * Container class for passing in script source buffers to the JS engine.  This
-- * not only groups the buffer and length values, it also provides a way to
-- * optionally pass ownership of the buffer to the JS engine without copying.
-- * Rules for use:
-- *
-- *  1) The data array must be allocated with js_malloc() or js_realloc() if
-- *     ownership is being granted to the SourceBufferHolder.
-- *  2) If ownership is not given to the SourceBufferHolder, then the memory
-- *     must be kept alive until the JS compilation is complete.
-- *  3) Any code calling SourceBufferHolder::take() must guarantee to keep the
-- *     memory alive until JS compilation completes.  Normally only the JS
-- *     engine should be calling take().
-- *
-- * Example use:
-- *
-- *    size_t length = 512;
-- *    char16_t* chars = js_pod_malloc<char16_t>(length);
-- *    JS::SourceBufferHolder srcBuf(chars, length, JS::SourceBufferHolder::GiveOwnership);
-- *    JS::Compile(cx, options, srcBuf);
-- */
--class SourceBufferHolder final
--{
--  public:
--    enum Ownership {
--      NoOwnership,
--      GiveOwnership
--    };
--
--    SourceBufferHolder(const char16_t* data, size_t dataLength, Ownership ownership)
--      : data_(data),
--        length_(dataLength),
--        ownsChars_(ownership == GiveOwnership)
--    {
--        fixEmptyBuffer();
--    }
--
--    SourceBufferHolder(UniqueTwoByteChars&& data, size_t dataLength)
--      : data_(data.release()),
--        length_(dataLength),
--        ownsChars_(true)
--    {
--        fixEmptyBuffer();
--    }
--
--    SourceBufferHolder(SourceBufferHolder&& other)
--      : data_(other.data_),
--        length_(other.length_),
--        ownsChars_(other.ownsChars_)
--    {
--        other.data_ = nullptr;
--        other.length_ = 0;
--        other.ownsChars_ = false;
--    }
--
--    ~SourceBufferHolder() {
--        if (ownsChars_)
--            js_free(const_cast<char16_t*>(data_));
--    }
--
--    // Access the underlying source buffer without affecting ownership.
--    const char16_t* get() const { return data_; }
--
--    // Length of the source buffer in char16_t code units (not bytes)
--    size_t length() const { return length_; }
--
--    // Returns true if the SourceBufferHolder owns the buffer and will free
--    // it upon destruction.  If true, it is legal to call take().
--    bool ownsChars() const { return ownsChars_; }
--
--    // Retrieve and take ownership of the underlying data buffer.  The caller
--    // is now responsible for calling js_free() on the returned value, *but only
--    // after JS script compilation has completed*.
--    //
--    // After the buffer has been taken the SourceBufferHolder functions as if
--    // it had been constructed on an unowned buffer;  get() and length() still
--    // work.  In order for this to be safe the taken buffer must be kept alive
--    // until after JS script compilation completes as noted above.
--    //
--    // Note, it's the caller's responsibility to check ownsChars() before taking
--    // the buffer.  Taking and then free'ing an unowned buffer will have dire
--    // consequences.
--    char16_t* take() {
--        MOZ_ASSERT(ownsChars_);
--        ownsChars_ = false;
--        return const_cast<char16_t*>(data_);
--    }
--
--  private:
--    SourceBufferHolder(SourceBufferHolder&) = delete;
--    SourceBufferHolder& operator=(SourceBufferHolder&) = delete;
--
--    void fixEmptyBuffer() {
--        // Ensure that null buffers properly return an unowned, empty,
--        // null-terminated string.
--        static const char16_t NullChar_ = 0;
--        if (!get()) {
--            data_ = &NullChar_;
--            length_ = 0;
--            ownsChars_ = false;
--        }
--    }
--
--    const char16_t* data_;
--    size_t length_;
--    bool ownsChars_;
--};
--
- struct TranscodeSource;
- 
- } /* namespace JS */
- 
- /************************************************************************/
- 
- /* Property attributes, set in JSPropertySpec and passed to API functions.
-  *
-diff --git a/js/src/moz.build b/js/src/moz.build
---- a/js/src/moz.build
-+++ b/js/src/moz.build
-@@ -156,16 +156,17 @@ EXPORTS.js += [
-     '../public/Proxy.h',
-     '../public/Realm.h',
-     '../public/RefCounted.h',
-     '../public/RequiredDefines.h',
-     '../public/Result.h',
-     '../public/RootingAPI.h',
-     '../public/SavedFrameAPI.h',
-     '../public/SliceBudget.h',
-+    '../public/SourceBufferHolder.h',
-     '../public/StableStringChars.h',
-     '../public/Stream.h',
-     '../public/StructuredClone.h',
-     '../public/SweepingAPI.h',
-     '../public/TraceKind.h',
-     '../public/TracingAPI.h',
-     '../public/TrackedOptimizationInfo.h',
-     '../public/TypeDecls.h',

+ 0 - 289
frg/work-js/mozilla-release/patches/mozilla-central-push_433714.patch

@@ -1,289 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535139844 18000
-#      Fri Aug 24 14:44:04 2018 -0500
-# Node ID daa263f9eda35ced064b6c12626249c12427311d
-# Parent  ea8351c63f54a43a568804e81b8a5a237d1f8084
-Bug 1486577 - Move script/function transcoding API into a new public js/Transcoding.h header.  r=jandem
-
-diff --git a/js/public/Transcoding.h b/js/public/Transcoding.h
-new file mode 100644
---- /dev/null
-+++ b/js/public/Transcoding.h
-@@ -0,0 +1,100 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+/*
-+ * Structures and functions for transcoding compiled scripts and functions to
-+ * and from memory.
-+ */
-+
-+#ifndef js_Transcoding_h
-+#define js_Transcoding_h
-+
-+#include "mozilla/Range.h" // mozilla::Range
-+#include "mozilla/Vector.h" // mozilla::Vector
-+
-+#include <stddef.h> // size_t
-+#include <stdint.h> // uint8_t, uint32_t
-+
-+#include "js/RootingAPI.h" // JS::Handle, JS::MutableHandle
-+
-+struct JSContext;
-+class JSFunction;
-+class JSObject;
-+class JSScript;
-+
-+namespace JS {
-+
-+using TranscodeBuffer = mozilla::Vector<uint8_t>;
-+using TranscodeRange = mozilla::Range<uint8_t>;
-+
-+struct TranscodeSource final
-+{
-+    TranscodeSource(const TranscodeRange& range_, const char* file, uint32_t line)
-+        : range(range_), filename(file), lineno(line)
-+    {}
-+
-+    const TranscodeRange range;
-+    const char* filename;
-+    const uint32_t lineno;
-+};
-+
-+using TranscodeSources = mozilla::Vector<TranscodeSource>;
-+
-+enum TranscodeResult : uint8_t
-+{
-+    // Successful encoding / decoding.
-+    TranscodeResult_Ok = 0,
-+
-+    // A warning message, is set to the message out-param.
-+    TranscodeResult_Failure = 0x10,
-+    TranscodeResult_Failure_BadBuildId =          TranscodeResult_Failure | 0x1,
-+    TranscodeResult_Failure_RunOnceNotSupported = TranscodeResult_Failure | 0x2,
-+    TranscodeResult_Failure_AsmJSNotSupported =   TranscodeResult_Failure | 0x3,
-+    TranscodeResult_Failure_BadDecode =           TranscodeResult_Failure | 0x4,
-+    TranscodeResult_Failure_WrongCompileOption =  TranscodeResult_Failure | 0x5,
-+    TranscodeResult_Failure_NotInterpretedFun =   TranscodeResult_Failure | 0x6,
-+
-+    // There is a pending exception on the context.
-+    TranscodeResult_Throw = 0x20
-+};
-+
-+extern JS_PUBLIC_API(TranscodeResult)
-+EncodeScript(JSContext* cx, TranscodeBuffer& buffer, Handle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(TranscodeResult)
-+EncodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, Handle<JSObject*> funobj);
-+
-+extern JS_PUBLIC_API(TranscodeResult)
-+DecodeScript(JSContext* cx, TranscodeBuffer& buffer, MutableHandle<JSScript*> scriptp,
-+             size_t cursorIndex = 0);
-+
-+extern JS_PUBLIC_API(TranscodeResult)
-+DecodeScript(JSContext* cx, const TranscodeRange& range, MutableHandle<JSScript*> scriptp);
-+
-+extern JS_PUBLIC_API(TranscodeResult)
-+DecodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, MutableHandle<JSFunction*> funp,
-+                          size_t cursorIndex = 0);
-+
-+// Register an encoder on the given script source, such that all functions can
-+// be encoded as they are parsed. This strategy is used to avoid blocking the
-+// main thread in a non-interruptible way.
-+//
-+// The |script| argument of |StartIncrementalEncoding| and
-+// |FinishIncrementalEncoding| should be the top-level script returned either as
-+// an out-param of any of the |Compile| functions, or the result of
-+// |FinishOffThreadScript|.
-+//
-+// The |buffer| argument of |FinishIncrementalEncoding| is used for appending
-+// the encoded bytecode into the buffer. If any of these functions failed, the
-+// content of |buffer| would be undefined.
-+extern JS_PUBLIC_API(bool)
-+StartIncrementalEncoding(JSContext* cx, Handle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+FinishIncrementalEncoding(JSContext* cx, Handle<JSScript*> script, TranscodeBuffer& buffer);
-+
-+} // namespace JS
-+
-+#endif /* js_Transcoding_h */
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -36,16 +36,17 @@
- #include "js/MemoryFunctions.h"
- #include "js/Principals.h"
- #include "js/Realm.h"
- #include "js/RefCounted.h"
- #include "js/RootingAPI.h"
- #include "js/SourceBufferHolder.h"
- #include "js/Stream.h"
- #include "js/TracingAPI.h"
-+#include "js/Transcoding.h"
- #include "js/UniquePtr.h"
- #include "js/Utility.h"
- #include "js/Value.h"
- #include "js/Vector.h"
- 
- /************************************************************************/
- 
- namespace JS {
-@@ -295,22 +296,16 @@ JS_NumberValue(double d)
-     return JS::DoubleValue(d);
- }
- 
- /************************************************************************/
- 
- JS_PUBLIC_API(bool)
- JS_StringHasBeenPinned(JSContext* cx, JSString* str);
- 
--namespace JS {
--
--struct TranscodeSource;
--
--} /* namespace JS */
--
- /************************************************************************/
- 
- /* Property attributes, set in JSPropertySpec and passed to API functions.
-  *
-  * NB: The data structure in which some of these values are stored only uses
-  *     a uint8_t to store the relevant information. Proceed with caution if
-  *     trying to reorder or change the the first byte worth of flags.
-  */
-@@ -4838,89 +4833,16 @@ class MOZ_RAII AutoHideScriptedCaller
-         UnhideScriptedCaller(mContext);
-     }
- 
-   protected:
-     JSContext* mContext;
-     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
- };
- 
--/*
-- * Encode/Decode interpreted scripts and functions to/from memory.
-- */
--
--typedef mozilla::Vector<uint8_t> TranscodeBuffer;
--typedef mozilla::Range<uint8_t> TranscodeRange;
--
--struct TranscodeSource
--{
--    TranscodeSource(const TranscodeRange& range_, const char* file, uint32_t line)
--        : range(range_), filename(file), lineno(line)
--    {}
--
--    const TranscodeRange range;
--    const char* filename;
--    const uint32_t lineno;
--};
--
--typedef mozilla::Vector<JS::TranscodeSource> TranscodeSources;
--
--enum TranscodeResult: uint8_t
--{
--    // Successful encoding / decoding.
--    TranscodeResult_Ok = 0,
--
--    // A warning message, is set to the message out-param.
--    TranscodeResult_Failure = 0x10,
--    TranscodeResult_Failure_BadBuildId =          TranscodeResult_Failure | 0x1,
--    TranscodeResult_Failure_RunOnceNotSupported = TranscodeResult_Failure | 0x2,
--    TranscodeResult_Failure_AsmJSNotSupported =   TranscodeResult_Failure | 0x3,
--    TranscodeResult_Failure_BadDecode =           TranscodeResult_Failure | 0x4,
--    TranscodeResult_Failure_WrongCompileOption =  TranscodeResult_Failure | 0x5,
--    TranscodeResult_Failure_NotInterpretedFun =   TranscodeResult_Failure | 0x6,
--
--    // There is a pending exception on the context.
--    TranscodeResult_Throw = 0x20
--};
--
--extern JS_PUBLIC_API(TranscodeResult)
--EncodeScript(JSContext* cx, TranscodeBuffer& buffer, JS::HandleScript script);
--
--extern JS_PUBLIC_API(TranscodeResult)
--EncodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, JS::HandleObject funobj);
--
--extern JS_PUBLIC_API(TranscodeResult)
--DecodeScript(JSContext* cx, TranscodeBuffer& buffer, JS::MutableHandleScript scriptp,
--             size_t cursorIndex = 0);
--
--extern JS_PUBLIC_API(TranscodeResult)
--DecodeScript(JSContext* cx, const TranscodeRange& range, JS::MutableHandleScript scriptp);
--
--extern JS_PUBLIC_API(TranscodeResult)
--DecodeInterpretedFunction(JSContext* cx, TranscodeBuffer& buffer, JS::MutableHandleFunction funp,
--                          size_t cursorIndex = 0);
--
--// Register an encoder on the given script source, such that all functions can
--// be encoded as they are parsed. This strategy is used to avoid blocking the
--// main thread in a non-interruptible way.
--//
--// The |script| argument of |StartIncrementalEncoding| and
--// |FinishIncrementalEncoding| should be the top-level script returned either as
--// an out-param of any of the |Compile| functions, or the result of
--// |FinishOffThreadScript|.
--//
--// The |buffer| argument of |FinishIncrementalEncoding| is used for appending
--// the encoded bytecode into the buffer. If any of these functions failed, the
--// content of |buffer| would be undefined.
--extern JS_PUBLIC_API(bool)
--StartIncrementalEncoding(JSContext* cx, JS::HandleScript script);
--
--extern JS_PUBLIC_API(bool)
--FinishIncrementalEncoding(JSContext* cx, JS::HandleScript script, TranscodeBuffer& buffer);
--
- } /* namespace JS */
- 
- namespace js {
- 
- enum class StackFormat { SpiderMonkey, V8, Default };
- 
- /*
-  * Sets the format used for stringifying Error stacks.
-diff --git a/js/src/moz.build b/js/src/moz.build
---- a/js/src/moz.build
-+++ b/js/src/moz.build
-@@ -164,16 +164,17 @@ EXPORTS.js += [
-     '../public/SourceBufferHolder.h',
-     '../public/StableStringChars.h',
-     '../public/Stream.h',
-     '../public/StructuredClone.h',
-     '../public/SweepingAPI.h',
-     '../public/TraceKind.h',
-     '../public/TracingAPI.h',
-     '../public/TrackedOptimizationInfo.h',
-+    '../public/Transcoding.h',
-     '../public/TypeDecls.h',
-     '../public/UbiNode.h',
-     '../public/UbiNodeBreadthFirst.h',
-     '../public/UbiNodeCensus.h',
-     '../public/UbiNodeDominatorTree.h',
-     '../public/UbiNodePostOrder.h',
-     '../public/UbiNodeShortestPaths.h',
-     '../public/UbiNodeUtils.h',
-diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h
---- a/js/src/vm/Xdr.h
-+++ b/js/src/vm/Xdr.h
-@@ -9,16 +9,17 @@
- 
- #include "mozilla/EndianUtils.h"
- #include "mozilla/TypeTraits.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
- #include "NamespaceImports.h"
- 
-+#include "js/Transcoding.h"
- #include "js/TypeDecls.h"
- #include "vm/JSAtom.h"
- 
- namespace js {
- 
- class LifoAlloc;
- 
- enum XDRMode {

+ 0 - 283
frg/work-js/mozilla-release/patches/mozilla-central-push_433715.patch

@@ -1,283 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535139850 18000
-#      Fri Aug 24 14:44:10 2018 -0500
-# Node ID 8896f3fdaf990d7d18ba07b08132fa12e18f8284
-# Parent  daa263f9eda35ced064b6c12626249c12427311d
-Bug 1486577 - Move of-thread compilation API into a new public js/OffThreadScriptCompilation.h header.  r=jandem
-
-diff --git a/js/public/OffThreadScriptCompilation.h b/js/public/OffThreadScriptCompilation.h
-new file mode 100644
---- /dev/null
-+++ b/js/public/OffThreadScriptCompilation.h
-@@ -0,0 +1,114 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+/*
-+ * Types and functions related to the compilation of JavaScript off the
-+ * direct JSAPI-using thread.
-+ */
-+
-+#ifndef js_OffThreadScriptCompilation_h
-+#define js_OffThreadScriptCompilation_h
-+
-+#include "mozilla/Range.h" // mozilla::Range
-+#include "mozilla/Vector.h" // mozilla::Vector
-+
-+#include <stddef.h> // size_t
-+
-+#include "jstypes.h" // JS_PUBLIC_API
-+
-+#include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions
-+#include "js/GCVector.h" // JS::GCVector
-+#include "js/Transcoding.h" // JS::TranscodeSource
-+
-+struct JSContext;
-+class JSScript;
-+
-+namespace JS {
-+
-+class SourceBufferHolder;
-+
-+} // namespace JS
-+
-+namespace JS {
-+
-+class OffThreadToken;
-+
-+using OffThreadCompileCallback = void (*)(OffThreadToken* token, void* callbackData);
-+
-+extern JS_PUBLIC_API(bool)
-+CanCompileOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
-+
-+extern JS_PUBLIC_API(bool)
-+CanDecodeOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
-+
-+/*
-+ * Off thread compilation control flow.
-+ *
-+ * After successfully triggering an off thread compile of a script, the
-+ * callback will eventually be invoked with the specified data and a token
-+ * for the compilation. The callback will be invoked while off thread,
-+ * so must ensure that its operations are thread safe. Afterwards, one of the
-+ * following functions must be invoked on the runtime's main thread:
-+ *
-+ * - FinishOffThreadScript, to get the result script (or nullptr on failure).
-+ * - CancelOffThreadScript, to free the resources without creating a script.
-+ *
-+ * The characters passed in to CompileOffThread must remain live until the
-+ * callback is invoked, and the resulting script will be rooted until the call
-+ * to FinishOffThreadScript.
-+ */
-+
-+extern JS_PUBLIC_API(bool)
-+CompileOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, SourceBufferHolder& srcBuf,
-+                 OffThreadCompileCallback callback, void* callbackData);
-+
-+extern JS_PUBLIC_API(JSScript*)
-+FinishOffThreadScript(JSContext* cx, OffThreadToken* token);
-+
-+extern JS_PUBLIC_API(void)
-+CancelOffThreadScript(JSContext* cx, OffThreadToken* token);
-+
-+extern JS_PUBLIC_API(bool)
-+CompileOffThreadModule(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                       SourceBufferHolder& srcBuf, OffThreadCompileCallback callback,
-+                       void* callbackData);
-+
-+extern JS_PUBLIC_API(JSScript*)
-+FinishOffThreadModule(JSContext* cx, OffThreadToken* token);
-+
-+extern JS_PUBLIC_API(void)
-+CancelOffThreadModule(JSContext* cx, OffThreadToken* token);
-+
-+extern JS_PUBLIC_API(bool)
-+DecodeOffThreadScript(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                      mozilla::Vector<uint8_t>& buffer /* TranscodeBuffer& */, size_t cursor,
-+                      OffThreadCompileCallback callback, void* callbackData);
-+
-+extern JS_PUBLIC_API(bool)
-+DecodeOffThreadScript(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                      const mozilla::Range<uint8_t>& range /* TranscodeRange& */,
-+                      OffThreadCompileCallback callback, void* callbackData);
-+
-+extern JS_PUBLIC_API(JSScript*)
-+FinishOffThreadScriptDecoder(JSContext* cx, OffThreadToken* token);
-+
-+extern JS_PUBLIC_API(void)
-+CancelOffThreadScriptDecoder(JSContext* cx, OffThreadToken* token);
-+
-+extern JS_PUBLIC_API(bool)
-+DecodeMultiOffThreadScripts(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                            mozilla::Vector<TranscodeSource>& sources,
-+                            OffThreadCompileCallback callback, void* callbackData);
-+
-+extern JS_PUBLIC_API(bool)
-+FinishMultiOffThreadScriptsDecoder(JSContext* cx, OffThreadToken* token,
-+                                   MutableHandle<GCVector<JSScript*>> scripts);
-+
-+extern JS_PUBLIC_API(void)
-+CancelMultiOffThreadScriptsDecoder(JSContext* cx, OffThreadToken* token);
-+
-+} // namespace JS
-+
-+#endif /* js_OffThreadScriptCompilation_h */
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -29,16 +29,17 @@
- #include "js/CharacterEncoding.h"
- #include "js/Class.h"
- #include "js/CompileOptions.h"
- #include "js/ErrorReport.h"
- #include "js/GCVector.h"
- #include "js/HashTable.h"
- #include "js/Id.h"
- #include "js/MemoryFunctions.h"
-+#include "js/OffThreadScriptCompilation.h"
- #include "js/Principals.h"
- #include "js/Realm.h"
- #include "js/RefCounted.h"
- #include "js/RootingAPI.h"
- #include "js/SourceBufferHolder.h"
- #include "js/Stream.h"
- #include "js/TracingAPI.h"
- #include "js/Transcoding.h"
-@@ -3085,89 +3086,16 @@ CompileForNonSyntacticScope(JSContext* c
- extern JS_PUBLIC_API(bool)
- CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
-                             FILE* file, JS::MutableHandleScript script);
- 
- extern JS_PUBLIC_API(bool)
- CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
-                             const char* filename, JS::MutableHandleScript script);
- 
--extern JS_PUBLIC_API(bool)
--CanCompileOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
--
--extern JS_PUBLIC_API(bool)
--CanDecodeOffThread(JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
--
--/*
-- * Off thread compilation control flow.
-- *
-- * After successfully triggering an off thread compile of a script, the
-- * callback will eventually be invoked with the specified data and a token
-- * for the compilation. The callback will be invoked while off thread,
-- * so must ensure that its operations are thread safe. Afterwards, one of the
-- * following functions must be invoked on the runtime's main thread:
-- *
-- * - FinishOffThreadScript, to get the result script (or nullptr on failure).
-- * - CancelOffThreadScript, to free the resources without creating a script.
-- *
-- * The characters passed in to CompileOffThread must remain live until the
-- * callback is invoked, and the resulting script will be rooted until the call
-- * to FinishOffThreadScript.
-- */
--
--extern JS_PUBLIC_API(bool)
--CompileOffThread(JSContext* cx, const ReadOnlyCompileOptions& options,
--                 JS::SourceBufferHolder& srcBuf,
--                 OffThreadCompileCallback callback, void* callbackData);
--
--extern JS_PUBLIC_API(JSScript*)
--FinishOffThreadScript(JSContext* cx, OffThreadToken* token);
--
--extern JS_PUBLIC_API(void)
--CancelOffThreadScript(JSContext* cx, OffThreadToken* token);
--
--extern JS_PUBLIC_API(bool)
--CompileOffThreadModule(JSContext* cx, const ReadOnlyCompileOptions& options,
--                       JS::SourceBufferHolder& srcBuf,
--                       OffThreadCompileCallback callback, void* callbackData);
--
--extern JS_PUBLIC_API(JSScript*)
--FinishOffThreadModule(JSContext* cx, OffThreadToken* token);
--
--extern JS_PUBLIC_API(void)
--CancelOffThreadModule(JSContext* cx, OffThreadToken* token);
--
--extern JS_PUBLIC_API(bool)
--DecodeOffThreadScript(JSContext* cx, const ReadOnlyCompileOptions& options,
--                      mozilla::Vector<uint8_t>& buffer /* TranscodeBuffer& */, size_t cursor,
--                      OffThreadCompileCallback callback, void* callbackData);
--
--extern JS_PUBLIC_API(bool)
--DecodeOffThreadScript(JSContext* cx, const ReadOnlyCompileOptions& options,
--                      const mozilla::Range<uint8_t>& range /* TranscodeRange& */,
--                      OffThreadCompileCallback callback, void* callbackData);
--
--extern JS_PUBLIC_API(JSScript*)
--FinishOffThreadScriptDecoder(JSContext* cx, OffThreadToken* token);
--
--extern JS_PUBLIC_API(void)
--CancelOffThreadScriptDecoder(JSContext* cx, OffThreadToken* token);
--
--extern JS_PUBLIC_API(bool)
--DecodeMultiOffThreadScripts(JSContext* cx, const ReadOnlyCompileOptions& options,
--                            mozilla::Vector<TranscodeSource>& sources,
--                            OffThreadCompileCallback callback, void* callbackData);
--
--extern JS_PUBLIC_API(bool)
--FinishMultiOffThreadScriptsDecoder(JSContext* cx, OffThreadToken* token,
--                                   JS::MutableHandle<JS::ScriptVector> scripts);
--
--extern JS_PUBLIC_API(void)
--CancelMultiOffThreadScriptsDecoder(JSContext* cx, OffThreadToken* token);
--
- /**
-  * Compile a function with envChain plus the global as its scope chain.
-  * envChain must contain objects in the current compartment of cx.  The actual
-  * scope chain used for the function will consist of With wrappers for those
-  * objects, followed by the current global of the compartment cx is in.  This
-  * global must not be explicitly included in the scope chain.
-  */
- extern JS_PUBLIC_API(bool)
-diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h
---- a/js/src/jspubtd.h
-+++ b/js/src/jspubtd.h
-@@ -99,20 +99,16 @@ CurrentThreadIsPerformingGC();
- #endif
- 
- } // namespace js
- 
- namespace JS {
- 
- struct JS_PUBLIC_API(PropertyDescriptor);
- 
--class OffThreadToken;
--
--typedef void (*OffThreadCompileCallback)(OffThreadToken* token, void* callbackData);
--
- enum class HeapState {
-     Idle,             // doing nothing with the GC heap
-     Tracing,          // tracing the GC heap without collecting, e.g. IterateCompartments()
-     MajorCollecting,  // doing a GC of the major heap
-     MinorCollecting,  // doing a GC of the minor heap (nursery)
-     CycleCollecting   // in the "Unlink" phase of cycle collection
- };
- 
-diff --git a/js/src/moz.build b/js/src/moz.build
---- a/js/src/moz.build
-+++ b/js/src/moz.build
-@@ -143,16 +143,17 @@ EXPORTS.js += [
-     '../public/HashTable.h',
-     '../public/HeapAPI.h',
-     '../public/Id.h',
-     '../public/Initialization.h',
-     '../public/JSON.h',
-     '../public/LocaleSensitive.h',
-     '../public/MemoryFunctions.h',
-     '../public/MemoryMetrics.h',
-+    '../public/OffThreadScriptCompilation.h',
-     '../public/Principals.h',
-     '../public/Printf.h',
-     '../public/ProfilingFrameIterator.h',
-     '../public/ProfilingStack.h',
-     '../public/ProtoKey.h',
-     '../public/Proxy.h',
-     '../public/Realm.h',
-     '../public/RefCounted.h',

+ 0 - 530
frg/work-js/mozilla-release/patches/mozilla-central-push_433716.patch

@@ -1,530 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535140528 18000
-#      Fri Aug 24 14:55:28 2018 -0500
-# Node ID 9fb317294f45476f0a2d2aa6dde4ec4848bac91d
-# Parent  8896f3fdaf990d7d18ba07b08132fa12e18f8284
-Bug 1486577 - Move compilation and evaluation APIs into a new public js/CompilationAndEvaluation.h header.  r=jandem
-
-diff --git a/js/public/CompilationAndEvaluation.h b/js/public/CompilationAndEvaluation.h
-new file mode 100644
---- /dev/null
-+++ b/js/public/CompilationAndEvaluation.h
-@@ -0,0 +1,223 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+/* Functions for compiling and evaluating scripts. */
-+
-+#ifndef js_CompilationAndEvaluation_h
-+#define js_CompilationAndEvaluation_h
-+
-+#include <stddef.h> // size_t
-+#include <stdio.h> // FILE
-+
-+#include "jstypes.h" // JS_PUBLIC_API
-+
-+#include "js/CompileOptions.h" // JS::CompileOptions, JS::ReadOnlyCompileOptions
-+#include "js/RootingAPI.h" // JS::Handle, JS::MutableHandle
-+
-+struct JSContext;
-+class JSFunction;
-+class JSObject;
-+class JSScript;
-+
-+namespace JS {
-+
-+template<typename T> class AutoVector;
-+
-+class SourceBufferHolder;
-+union Value;
-+
-+} // namespace JS
-+
-+/**
-+ * Given a buffer, return false if the buffer might become a valid JavaScript
-+ * script with the addition of more lines, or true if the validity of such a
-+ * script is conclusively known (because it's the prefix of a valid script --
-+ * and possibly the entirety of such a script).
-+ *
-+ * The intent of this function is to enable interactive compilation: accumulate
-+ * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to
-+ * the compiler.
-+ */
-+extern JS_PUBLIC_API(bool)
-+JS_BufferIsCompilableUnit(JSContext* cx, JS::Handle<JSObject*> obj, const char* utf8,
-+                          size_t length);
-+
-+/*
-+ * NB: JS_ExecuteScript and the JS::Evaluate APIs come in two flavors: either
-+ * they use the global as the scope, or they take an AutoObjectVector of objects
-+ * to use as the scope chain.  In the former case, the global is also used as
-+ * the "this" keyword value and the variables object (ECMA parlance for where
-+ * 'var' and 'function' bind names) of the execution context for script.  In the
-+ * latter case, the first object in the provided list is used, unless the list
-+ * is empty, in which case the global is used.
-+ *
-+ * Why a runtime option?  The alternative is to add APIs duplicating those
-+ * for the other value of flags, and that doesn't seem worth the code bloat
-+ * cost.  Such new entry points would probably have less obvious names, too, so
-+ * would not tend to be used.  The ContextOptionsRef adjustment, OTOH, can be
-+ * more easily hacked into existing code that does not depend on the bug; such
-+ * code can continue to use the familiar JS::Evaluate, etc., entry points.
-+ */
-+
-+/**
-+ * Evaluate a script in the scope of the current global of cx.
-+ */
-+extern JS_PUBLIC_API(bool)
-+JS_ExecuteScript(JSContext* cx, JS::Handle<JSScript*> script, JS::MutableHandle<JS::Value> rval);
-+
-+extern JS_PUBLIC_API(bool)
-+JS_ExecuteScript(JSContext* cx, JS::Handle<JSScript*> script);
-+
-+/**
-+ * As above, but providing an explicit scope chain.  envChain must not include
-+ * the global object on it; that's implicit.  It needs to contain the other
-+ * objects that should end up on the script's scope chain.
-+ */
-+extern JS_PUBLIC_API(bool)
-+JS_ExecuteScript(JSContext* cx, JS::AutoVector<JSObject*>& envChain,
-+                 JS::Handle<JSScript*> script, JS::MutableHandle<JS::Value> rval);
-+
-+extern JS_PUBLIC_API(bool)
-+JS_ExecuteScript(JSContext* cx, JS::AutoVector<JSObject*>& envChain, JS::Handle<JSScript*> script);
-+
-+/**
-+ * |script| will always be set. On failure, it will be set to nullptr.
-+ */
-+extern JS_PUBLIC_API(bool)
-+JS_CompileScript(JSContext* cx, const char* ascii, size_t length,
-+                 const JS::CompileOptions& options,
-+                 JS::MutableHandle<JSScript*> script);
-+
-+/**
-+ * |script| will always be set. On failure, it will be set to nullptr.
-+ */
-+extern JS_PUBLIC_API(bool)
-+JS_CompileUCScript(JSContext* cx, JS::SourceBufferHolder& srcBuf,
-+                   const JS::CompileOptions& options,
-+                   JS::MutableHandle<JSScript*> script);
-+
-+namespace JS {
-+
-+/**
-+ * Like the above, but handles a cross-compartment script. If the script is
-+ * cross-compartment, it is cloned into the current compartment before executing.
-+ */
-+extern JS_PUBLIC_API(bool)
-+CloneAndExecuteScript(JSContext* cx, Handle<JSScript*> script, MutableHandle<Value> rval);
-+
-+/**
-+ * Like CloneAndExecuteScript above, but allows executing under a non-syntactic
-+ * environment chain.
-+ */
-+extern JS_PUBLIC_API(bool)
-+CloneAndExecuteScript(JSContext* cx, AutoVector<JSObject*>& envChain, Handle<JSScript*> script,
-+                      MutableHandle<Value> rval);
-+
-+/**
-+ * Evaluate the given source buffer in the scope of the current global of cx.
-+ */
-+extern JS_PUBLIC_API(bool)
-+Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
-+         SourceBufferHolder& srcBuf, MutableHandle<Value> rval);
-+
-+/**
-+ * As above, but providing an explicit scope chain.  envChain must not include
-+ * the global object on it; that's implicit.  It needs to contain the other
-+ * objects that should end up on the script's scope chain.
-+ */
-+extern JS_PUBLIC_API(bool)
-+Evaluate(JSContext* cx, AutoVector<JSObject*>& envChain, const ReadOnlyCompileOptions& options,
-+         SourceBufferHolder& srcBuf, MutableHandle<Value> rval);
-+
-+/**
-+ * Evaluate the given byte buffer in the scope of the current global of cx.
-+ */
-+extern JS_PUBLIC_API(bool)
-+Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
-+         const char* bytes, size_t length, MutableHandle<Value> rval);
-+
-+/**
-+ * Evaluate the given file in the scope of the current global of cx.
-+ */
-+extern JS_PUBLIC_API(bool)
-+Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
-+         const char* filename, MutableHandle<Value> rval);
-+
-+/**
-+ * |script| will always be set. On failure, it will be set to nullptr.
-+ */
-+extern JS_PUBLIC_API(bool)
-+Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
-+        SourceBufferHolder& srcBuf, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
-+        const char* bytes, size_t length, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
-+        FILE* file, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
-+        const char* filename, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                            SourceBufferHolder& srcBuf, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                            const char* bytes, size_t length, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                            FILE* file, MutableHandle<JSScript*> script);
-+
-+extern JS_PUBLIC_API(bool)
-+CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
-+                            const char* filename, MutableHandle<JSScript*> script);
-+
-+/**
-+ * Compile a function with envChain plus the global as its scope chain.
-+ * envChain must contain objects in the current compartment of cx.  The actual
-+ * scope chain used for the function will consist of With wrappers for those
-+ * objects, followed by the current global of the compartment cx is in.  This
-+ * global must not be explicitly included in the scope chain.
-+ */
-+extern JS_PUBLIC_API(bool)
-+CompileFunction(JSContext* cx, AutoVector<JSObject*>& envChain,
-+                const ReadOnlyCompileOptions& options,
-+                const char* name, unsigned nargs, const char* const* argnames,
-+                SourceBufferHolder& srcBuf, MutableHandle<JSFunction*> fun);
-+
-+/**
-+ * Same as above, but taking a const char * for the function body.
-+ */
-+extern JS_PUBLIC_API(bool)
-+CompileFunction(JSContext* cx, AutoVector<JSObject*>& envChain,
-+                const ReadOnlyCompileOptions& options,
-+                const char* name, unsigned nargs, const char* const* argnames,
-+                const char* bytes, size_t length, MutableHandle<JSFunction*> fun);
-+
-+/*
-+ * Associate an element wrapper and attribute name with a previously compiled
-+ * script, for debugging purposes. Calling this function is optional, but should
-+ * be done before script execution if it is required.
-+ */
-+extern JS_PUBLIC_API(bool)
-+InitScriptSourceElement(JSContext* cx, Handle<JSScript*> script,
-+                        Handle<JSObject*> element, Handle<JSString*> elementAttrName = nullptr);
-+
-+/*
-+ * For a script compiled with the hideScriptFromDebugger option, expose the
-+ * script to the debugger by calling the debugger's onNewScript hook.
-+ */
-+extern JS_PUBLIC_API(void)
-+ExposeScriptToDebugger(JSContext* cx, Handle<JSScript*> script);
-+
-+} /* namespace JS */
-+
-+#endif /* js_CompilationAndEvaluation_h */
-diff --git a/js/rust/etc/wrapper.hpp b/js/rust/etc/wrapper.hpp
---- a/js/rust/etc/wrapper.hpp
-+++ b/js/rust/etc/wrapper.hpp
-@@ -8,16 +8,17 @@
- #ifndef _MSC_VER
- #include <unistd.h>
- #endif
- 
- typedef uint32_t HashNumber;
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/CompileOptions.h"
- #include "js/Conversions.h"
- #include "js/Initialization.h"
- #include "js/MemoryMetrics.h"
- #include "js/SourceBufferHolder.h"
- #include "js/StructuredClone.h"
- 
- // Replacements for types that are too difficult for rust-bindgen.
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -23,16 +23,17 @@
- #include <stdio.h>
- 
- #include "jspubtd.h"
- 
- #include "js/AllocPolicy.h"
- #include "js/CallArgs.h"
- #include "js/CharacterEncoding.h"
- #include "js/Class.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/CompileOptions.h"
- #include "js/ErrorReport.h"
- #include "js/GCVector.h"
- #include "js/HashTable.h"
- #include "js/Id.h"
- #include "js/MemoryFunctions.h"
- #include "js/OffThreadScriptCompilation.h"
- #include "js/Principals.h"
-@@ -3010,230 +3011,37 @@ CloneFunctionObject(JSContext* cx, Handl
-  * the global object on it; that's implicit.  It needs to contain the other
-  * objects that should end up on the clone's scope chain.
-  */
- extern JS_PUBLIC_API(JSObject*)
- CloneFunctionObject(JSContext* cx, HandleObject funobj, AutoObjectVector& scopeChain);
- 
- } // namespace JS
- 
--/**
-- * Given a buffer, return false if the buffer might become a valid
-- * javascript statement with the addition of more lines.  Otherwise return
-- * true.  The intent is to support interactive compilation - accumulate
-- * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to
-- * the compiler.
-- */
--extern JS_PUBLIC_API(bool)
--JS_BufferIsCompilableUnit(JSContext* cx, JS::Handle<JSObject*> obj, const char* utf8,
--                          size_t length);
--
--/**
-- * |script| will always be set. On failure, it will be set to nullptr.
-- */
--extern JS_PUBLIC_API(bool)
--JS_CompileScript(JSContext* cx, const char* ascii, size_t length,
--                 const JS::CompileOptions& options,
--                 JS::MutableHandleScript script);
--
--/**
-- * |script| will always be set. On failure, it will be set to nullptr.
-- */
--extern JS_PUBLIC_API(bool)
--JS_CompileUCScript(JSContext* cx, JS::SourceBufferHolder& srcBuf,
--                   const JS::CompileOptions& options,
--                   JS::MutableHandleScript script);
--
- extern JS_PUBLIC_API(JSObject*)
- JS_GetGlobalFromScript(JSScript* script);
- 
- extern JS_PUBLIC_API(const char*)
- JS_GetScriptFilename(JSScript* script);
- 
- extern JS_PUBLIC_API(unsigned)
- JS_GetScriptBaseLineNumber(JSContext* cx, JSScript* script);
- 
- extern JS_PUBLIC_API(JSScript*)
- JS_GetFunctionScript(JSContext* cx, JS::HandleFunction fun);
- 
--namespace JS {
--
--/**
-- * |script| will always be set. On failure, it will be set to nullptr.
-- */
--extern JS_PUBLIC_API(bool)
--Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
--        SourceBufferHolder& srcBuf, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
--        const char* bytes, size_t length, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
--        FILE* file, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--Compile(JSContext* cx, const ReadOnlyCompileOptions& options,
--        const char* filename, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
--                            SourceBufferHolder& srcBuf, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
--                            const char* bytes, size_t length, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
--                            FILE* file, JS::MutableHandleScript script);
--
--extern JS_PUBLIC_API(bool)
--CompileForNonSyntacticScope(JSContext* cx, const ReadOnlyCompileOptions& options,
--                            const char* filename, JS::MutableHandleScript script);
--
--/**
-- * Compile a function with envChain plus the global as its scope chain.
-- * envChain must contain objects in the current compartment of cx.  The actual
-- * scope chain used for the function will consist of With wrappers for those
-- * objects, followed by the current global of the compartment cx is in.  This
-- * global must not be explicitly included in the scope chain.
-- */
--extern JS_PUBLIC_API(bool)
--CompileFunction(JSContext* cx, AutoObjectVector& envChain,
--                const ReadOnlyCompileOptions& options,
--                const char* name, unsigned nargs, const char* const* argnames,
--                SourceBufferHolder& srcBuf, JS::MutableHandleFunction fun);
--
--/**
-- * Same as above, but taking a const char * for the function body.
-- */
--extern JS_PUBLIC_API(bool)
--CompileFunction(JSContext* cx, AutoObjectVector& envChain,
--                const ReadOnlyCompileOptions& options,
--                const char* name, unsigned nargs, const char* const* argnames,
--                const char* bytes, size_t length, JS::MutableHandleFunction fun);
--
--/*
-- * Associate an element wrapper and attribute name with a previously compiled
-- * script, for debugging purposes. Calling this function is optional, but should
-- * be done before script execution if it is required.
-- */
--extern JS_PUBLIC_API(bool)
--InitScriptSourceElement(JSContext* cx, HandleScript script,
--                        HandleObject element, HandleString elementAttrName = nullptr);
--
--/*
-- * For a script compiled with the hideScriptFromDebugger option, expose the
-- * script to the debugger by calling the debugger's onNewScript hook.
-- */
--extern JS_PUBLIC_API(void)
--ExposeScriptToDebugger(JSContext* cx, HandleScript script);
--
--} /* namespace JS */
--
- extern JS_PUBLIC_API(JSString*)
- JS_DecompileScript(JSContext* cx, JS::Handle<JSScript*> script);
- 
- extern JS_PUBLIC_API(JSString*)
- JS_DecompileFunction(JSContext* cx, JS::Handle<JSFunction*> fun);
- 
- 
--/*
-- * NB: JS_ExecuteScript and the JS::Evaluate APIs come in two flavors: either
-- * they use the global as the scope, or they take an AutoObjectVector of objects
-- * to use as the scope chain.  In the former case, the global is also used as
-- * the "this" keyword value and the variables object (ECMA parlance for where
-- * 'var' and 'function' bind names) of the execution context for script.  In the
-- * latter case, the first object in the provided list is used, unless the list
-- * is empty, in which case the global is used.
-- *
-- * Why a runtime option?  The alternative is to add APIs duplicating those
-- * for the other value of flags, and that doesn't seem worth the code bloat
-- * cost.  Such new entry points would probably have less obvious names, too, so
-- * would not tend to be used.  The ContextOptionsRef adjustment, OTOH, can be
-- * more easily hacked into existing code that does not depend on the bug; such
-- * code can continue to use the familiar JS::Evaluate, etc., entry points.
-- */
--
--/**
-- * Evaluate a script in the scope of the current global of cx.
-- */
--extern JS_PUBLIC_API(bool)
--JS_ExecuteScript(JSContext* cx, JS::HandleScript script, JS::MutableHandleValue rval);
--
--extern JS_PUBLIC_API(bool)
--JS_ExecuteScript(JSContext* cx, JS::HandleScript script);
--
--/**
-- * As above, but providing an explicit scope chain.  envChain must not include
-- * the global object on it; that's implicit.  It needs to contain the other
-- * objects that should end up on the script's scope chain.
-- */
--extern JS_PUBLIC_API(bool)
--JS_ExecuteScript(JSContext* cx, JS::AutoObjectVector& envChain,
--                 JS::HandleScript script, JS::MutableHandleValue rval);
--
--extern JS_PUBLIC_API(bool)
--JS_ExecuteScript(JSContext* cx, JS::AutoObjectVector& envChain, JS::HandleScript script);
--
- namespace JS {
- 
--/**
-- * Like the above, but handles a cross-compartment script. If the script is
-- * cross-compartment, it is cloned into the current compartment before executing.
-- */
--extern JS_PUBLIC_API(bool)
--CloneAndExecuteScript(JSContext* cx, JS::Handle<JSScript*> script,
--                      JS::MutableHandleValue rval);
--
--/**
-- * Like CloneAndExecuteScript above, but allows executing under a non-syntactic
-- * environment chain.
-- */
--extern JS_PUBLIC_API(bool)
--CloneAndExecuteScript(JSContext* cx, JS::AutoObjectVector& envChain,
--                      JS::Handle<JSScript*> script,
--                      JS::MutableHandleValue rval);
--
--} /* namespace JS */
--
--namespace JS {
--
--/**
-- * Evaluate the given source buffer in the scope of the current global of cx.
-- */
--extern JS_PUBLIC_API(bool)
--Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
--         SourceBufferHolder& srcBuf, JS::MutableHandleValue rval);
--
--/**
-- * As above, but providing an explicit scope chain.  envChain must not include
-- * the global object on it; that's implicit.  It needs to contain the other
-- * objects that should end up on the script's scope chain.
-- */
--extern JS_PUBLIC_API(bool)
--Evaluate(JSContext* cx, AutoObjectVector& envChain, const ReadOnlyCompileOptions& options,
--         SourceBufferHolder& srcBuf, JS::MutableHandleValue rval);
--
--/**
-- * Evaluate the given byte buffer in the scope of the current global of cx.
-- */
--extern JS_PUBLIC_API(bool)
--Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
--         const char* bytes, size_t length, JS::MutableHandleValue rval);
--
--/**
-- * Evaluate the given file in the scope of the current global of cx.
-- */
--extern JS_PUBLIC_API(bool)
--Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
--         const char* filename, JS::MutableHandleValue rval);
--
- using ModuleResolveHook = JSScript* (*)(JSContext*, HandleScript, HandleString);
- 
- /**
-  * Get the HostResolveImportedModule hook for the runtime.
-  */
- extern JS_PUBLIC_API(ModuleResolveHook)
- GetModuleResolveHook(JSRuntime* rt);
- 
-diff --git a/js/src/moz.build b/js/src/moz.build
---- a/js/src/moz.build
-+++ b/js/src/moz.build
-@@ -124,16 +124,17 @@ EXPORTS += [
- 
- EXPORTS.js += [
-     '../public/AllocPolicy.h',
-     '../public/AutoByteString.h',
-     '../public/CallArgs.h',
-     '../public/CallNonGenericMethod.h',
-     '../public/CharacterEncoding.h',
-     '../public/Class.h',
-+    '../public/CompilationAndEvaluation.h',
-     '../public/CompileOptions.h',
-     '../public/Conversions.h',
-     '../public/Date.h',
-     '../public/Debug.h',
-     '../public/ErrorReport.h',
-     '../public/GCAnnotations.h',
-     '../public/GCAPI.h',
-     '../public/GCHashTable.h',

+ 0 - 880
frg/work-js/mozilla-release/patches/mozilla-central-push_433717.patch

@@ -1,880 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535162518 18000
-#      Fri Aug 24 21:01:58 2018 -0500
-# Node ID 2dc7007e3924444f55345606b6785f2d2ba89ce1
-# Parent  9fb317294f45476f0a2d2aa6dde4ec4848bac91d
-Bug 1486577 - Don't #include js/SourceBufferHolder.h in jsapi.h, and instead require users to do so -- a minor translation-unit size improvement for anyone who never has to use SourceBufferHolder other than by reference.  r=jandem
-
-diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp
---- a/dom/base/nsFrameMessageManager.cpp
-+++ b/dom/base/nsFrameMessageManager.cpp
-@@ -25,16 +25,17 @@
- #include "nsIXULRuntime.h"
- #include "nsIScriptError.h"
- #include "nsIConsoleService.h"
- #include "nsIMemoryReporter.h"
- #include "nsIProtocolHandler.h"
- #include "nsIScriptSecurityManager.h"
- #include "xpcpublic.h"
- #include "js/JSON.h"
-+#include "js/SourceBufferHolder.h"
- #include "mozilla/ClearOnShutdown.h"
- #include "mozilla/CycleCollectedJSContext.h"
- #include "mozilla/Preferences.h"
- #include "mozilla/ScriptPreloader.h"
- #include "mozilla/Telemetry.h"
- #include "mozilla/dom/ChildProcessMessageManager.h"
- #include "mozilla/dom/ChromeMessageBroadcaster.h"
- #include "mozilla/dom/File.h"
-diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp
---- a/dom/base/nsJSUtils.cpp
-+++ b/dom/base/nsJSUtils.cpp
-@@ -9,16 +9,17 @@
-  * invoked from the JavaScript code generated from IDL interfaces.
-  * The goal of the utility functions is to cut down on the size of
-  * the generated code itself.
-  */
- 
- #include "nsJSUtils.h"
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/SourceBufferHolder.h"
- #include "nsIScriptContext.h"
- #include "nsIScriptElement.h"
- #include "nsIScriptGlobalObject.h"
- #include "nsIXPConnect.h"
- #include "nsCOMPtr.h"
- #include "nsIScriptSecurityManager.h"
- #include "nsPIDOMWindow.h"
- #include "GeckoProfiler.h"
-diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
---- a/dom/script/ScriptLoader.cpp
-+++ b/dom/script/ScriptLoader.cpp
-@@ -9,16 +9,17 @@
- #include "ScriptLoadRequest.h"
- #include "ScriptTrace.h"
- #include "ModuleLoadRequest.h"
- #include "ModuleScript.h"
- 
- #include "prsystem.h"
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/Utility.h"
- #include "xpcpublic.h"
- #include "nsCycleCollectionParticipant.h"
- #include "nsIContent.h"
- #include "nsJSUtils.h"
- #include "mozilla/dom/DocGroup.h"
- #include "mozilla/dom/Element.h"
- #include "mozilla/dom/ScriptSettings.h"
-diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp
---- a/dom/workers/ScriptLoader.cpp
-+++ b/dom/workers/ScriptLoader.cpp
-@@ -20,16 +20,17 @@
- #include "nsIScriptSecurityManager.h"
- #include "nsIStreamLoader.h"
- #include "nsIStreamListenerTee.h"
- #include "nsIThreadRetargetableRequest.h"
- #include "nsIURI.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/SourceBufferHolder.h"
- #include "nsError.h"
- #include "nsContentPolicyUtils.h"
- #include "nsContentUtils.h"
- #include "nsDocShellCID.h"
- #include "nsISupportsPrimitives.h"
- #include "nsNetUtil.h"
- #include "nsIPipe.h"
- #include "nsIOutputStream.h"
-diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
---- a/dom/workers/WorkerPrivate.cpp
-+++ b/dom/workers/WorkerPrivate.cpp
-@@ -3,16 +3,17 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "WorkerPrivate.h"
- 
- #include "js/LocaleSensitive.h"
- #include "js/MemoryMetrics.h"
-+#include "js/SourceBufferHolder.h"
- #include "MessageEventRunnable.h"
- #include "mozilla/ScopeExit.h"
- #include "mozilla/StaticPrefs.h"
- #include "mozilla/dom/BlobURLProtocolHandler.h"
- #include "mozilla/dom/ClientManager.h"
- #include "mozilla/dom/ClientSource.h"
- #include "mozilla/dom/ClientState.h"
- #include "mozilla/dom/Console.h"
-diff --git a/dom/worklet/Worklet.cpp b/dom/worklet/Worklet.cpp
---- a/dom/worklet/Worklet.cpp
-+++ b/dom/worklet/Worklet.cpp
-@@ -14,16 +14,17 @@
- #include "mozilla/dom/BlobBinding.h"
- #include "mozilla/dom/DOMPrefs.h"
- #include "mozilla/dom/Fetch.h"
- #include "mozilla/dom/PromiseNativeHandler.h"
- #include "mozilla/dom/RegisterWorkletBindings.h"
- #include "mozilla/dom/Response.h"
- #include "mozilla/dom/ScriptSettings.h"
- #include "mozilla/dom/ScriptLoader.h"
-+#include "js/SourceBufferHolder.h"
- #include "nsIInputStreamPump.h"
- #include "nsIThreadRetargetableRequest.h"
- #include "nsNetUtil.h"
- #include "xpcprivate.h"
- 
- namespace mozilla {
- namespace dom {
- 
-diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp
---- a/dom/xul/XULDocument.cpp
-+++ b/dom/xul/XULDocument.cpp
-@@ -81,16 +81,17 @@
- #include "mozilla/dom/ProcessingInstruction.h"
- #include "mozilla/dom/ScriptSettings.h"
- #include "mozilla/dom/XULDocumentBinding.h"
- #include "mozilla/EventDispatcher.h"
- #include "mozilla/LoadInfo.h"
- #include "mozilla/Preferences.h"
- #include "nsTextNode.h"
- #include "nsJSUtils.h"
-+#include "js/SourceBufferHolder.h"
- #include "mozilla/dom/URL.h"
- #include "nsIContentPolicy.h"
- #include "mozAutoDocUpdate.h"
- #include "xpcpublic.h"
- #include "mozilla/StyleSheet.h"
- #include "mozilla/StyleSheetInlines.h"
- #include "nsIConsoleService.h"
- 
-diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp
---- a/dom/xul/nsXULElement.cpp
-+++ b/dom/xul/nsXULElement.cpp
-@@ -13,16 +13,17 @@
- #include "nsIDOMXULCommandDispatcher.h"
- #include "nsIDOMXULSelectCntrlItemEl.h"
- #include "nsIDocument.h"
- #include "mozilla/ClearOnShutdown.h"
- #include "mozilla/EventListenerManager.h"
- #include "mozilla/EventStateManager.h"
- #include "mozilla/EventStates.h"
- #include "mozilla/DeclarationBlock.h"
-+#include "js/SourceBufferHolder.h"
- #include "nsFocusManager.h"
- #include "nsHTMLStyleSheet.h"
- #include "nsNameSpaceManager.h"
- #include "nsIObjectInputStream.h"
- #include "nsIObjectOutputStream.h"
- #include "nsIPresShell.h"
- #include "nsIPrincipal.h"
- #include "nsIScriptContext.h"
-diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp
---- a/ipc/testshell/XPCShellEnvironment.cpp
-+++ b/ipc/testshell/XPCShellEnvironment.cpp
-@@ -12,16 +12,17 @@
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>     /* for isatty() */
- #endif
- 
- #include "base/basictypes.h"
- 
- #include "jsapi.h"
- #include "js/AutoByteString.h"
-+#include "js/SourceBufferHolder.h"
- 
- #include "xpcpublic.h"
- 
- #include "XPCShellEnvironment.h"
- 
- #include "mozilla/XPCOM.h"
- 
- #include "nsIChannel.h"
-diff --git a/js/src/NamespaceImports.h b/js/src/NamespaceImports.h
---- a/js/src/NamespaceImports.h
-+++ b/js/src/NamespaceImports.h
-@@ -100,17 +100,16 @@ using JS::GCHashSet;
- 
- using JS::CallArgs;
- using JS::CallNonGenericMethod;
- using JS::CompileOptions;
- using JS::IsAcceptableThis;
- using JS::NativeImpl;
- using JS::OwningCompileOptions;
- using JS::ReadOnlyCompileOptions;
--using JS::SourceBufferHolder;
- using JS::TransitiveCompileOptions;
- 
- using JS::Rooted;
- using JS::RootedFunction;
- using JS::RootedId;
- using JS::RootedObject;
- using JS::RootedScript;
- using JS::RootedString;
-diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp
---- a/js/src/builtin/Eval.cpp
-+++ b/js/src/builtin/Eval.cpp
-@@ -6,32 +6,34 @@
- 
- #include "builtin/Eval.h"
- 
- #include "mozilla/HashFunctions.h"
- #include "mozilla/Range.h"
- 
- #include "frontend/BytecodeCompiler.h"
- #include "gc/HashUtil.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "vm/Debugger.h"
- #include "vm/GlobalObject.h"
- #include "vm/JSContext.h"
- #include "vm/JSONParser.h"
- 
- #include "vm/Interpreter-inl.h"
- 
- using namespace js;
- 
- using mozilla::AddToHash;
- using mozilla::HashString;
- using mozilla::RangedPtr;
- 
- using JS::AutoCheckCannotGC;
- using JS::AutoStableStringChars;
-+using JS::SourceBufferHolder;
- 
- // We should be able to assert this for *any* fp->environmentChain().
- static void
- AssertInnerizedEnvironmentChain(JSContext* cx, JSObject& env)
- {
- #ifdef DEBUG
-     RootedObject obj(cx);
-     for (obj = &env; obj; obj = obj->enclosingEnvironment())
-diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
---- a/js/src/builtin/TestingFunctions.cpp
-+++ b/js/src/builtin/TestingFunctions.cpp
-@@ -40,16 +40,17 @@
- #include "gc/Heap.h"
- #include "jit/BaselineJIT.h"
- #include "jit/InlinableNatives.h"
- #include "jit/JitRealm.h"
- #include "js/AutoByteString.h"
- #include "js/Debug.h"
- #include "js/HashTable.h"
- #include "js/LocaleSensitive.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/StructuredClone.h"
- #include "js/UbiNode.h"
- #include "js/UbiNodeBreadthFirst.h"
- #include "js/UbiNodeShortestPaths.h"
- #include "js/UniquePtr.h"
- #include "js/Vector.h"
- #include "js/Wrapper.h"
-@@ -84,16 +85,17 @@
- #include "vm/StringType-inl.h"
- 
- using namespace js;
- 
- using mozilla::ArrayLength;
- using mozilla::Maybe;
- 
- using JS::AutoStableStringChars;
-+using JS::SourceBufferHolder;
- 
- // If fuzzingSafe is set, remove functionality that could cause problems with
- // fuzzers. Set this via the environment variable MOZ_FUZZING_SAFE.
- mozilla::Atomic<bool> fuzzingSafe(false);
- 
- // If disableOOMFunctions is set, disable functionality that causes artificial
- // OOM conditions.
- static mozilla::Atomic<bool> disableOOMFunctions(false);
-diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp
---- a/js/src/frontend/BytecodeCompiler.cpp
-+++ b/js/src/frontend/BytecodeCompiler.cpp
-@@ -12,32 +12,36 @@
- #include "builtin/ModuleObject.h"
- #if defined(JS_BUILD_BINAST)
- # include "frontend/BinSource.h"
- #endif // JS_BUILD_BINAST
- #include "frontend/BytecodeEmitter.h"
- #include "frontend/ErrorReporter.h"
- #include "frontend/FoldConstants.h"
- #include "frontend/Parser.h"
-+#include "js/SourceBufferHolder.h"
- #include "vm/GlobalObject.h"
- #include "vm/JSContext.h"
- #include "vm/JSScript.h"
- #include "vm/TraceLogging.h"
- #include "wasm/AsmJS.h"
- 
- #include "vm/EnvironmentObject-inl.h"
- #include "vm/GeckoProfiler-inl.h"
- #include "vm/JSObject-inl.h"
- #include "vm/JSScript-inl.h"
- 
- using namespace js;
- using namespace js::frontend;
-+
- using mozilla::Maybe;
- using mozilla::Nothing;
- 
-+using JS::SourceBufferHolder;
-+
- // The BytecodeCompiler class contains resources common to compiling scripts and
- // function bodies.
- class MOZ_STACK_CLASS BytecodeCompiler
- {
-   public:
-     // Construct an object passing mandatory arguments.
-     BytecodeCompiler(JSContext* cx,
-                      LifoAlloc& alloc,
-diff --git a/js/src/frontend/BytecodeCompiler.h b/js/src/frontend/BytecodeCompiler.h
---- a/js/src/frontend/BytecodeCompiler.h
-+++ b/js/src/frontend/BytecodeCompiler.h
-@@ -27,43 +27,43 @@ namespace frontend {
- 
- class ErrorReporter;
- class FunctionBox;
- class ParseNode;
- 
- JSScript*
- CompileGlobalScript(JSContext* cx, LifoAlloc& alloc, ScopeKind scopeKind,
-                     const ReadOnlyCompileOptions& options,
--                    SourceBufferHolder& srcBuf,
-+                    JS::SourceBufferHolder& srcBuf,
-                     ScriptSourceObject** sourceObjectOut = nullptr);
- 
- #if defined(JS_BUILD_BINAST)
- 
- JSScript*
- CompileGlobalBinASTScript(JSContext *cx, LifoAlloc& alloc,
-                           const ReadOnlyCompileOptions& options,
-                           const uint8_t* src, size_t len,
-                           ScriptSourceObject** sourceObjectOut = nullptr);
- 
- #endif // JS_BUILD_BINAST
- 
- JSScript*
- CompileEvalScript(JSContext* cx, LifoAlloc& alloc,
-                   HandleObject scopeChain, HandleScope enclosingScope,
-                   const ReadOnlyCompileOptions& options,
--                  SourceBufferHolder& srcBuf,
-+                  JS::SourceBufferHolder& srcBuf,
-                   ScriptSourceObject** sourceObjectOut = nullptr);
- 
- JSScript*
- CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options,
--              SourceBufferHolder& srcBuf);
-+              JS::SourceBufferHolder& srcBuf);
- 
- JSScript*
- CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options,
--              SourceBufferHolder& srcBuf, LifoAlloc& alloc,
-+              JS::SourceBufferHolder& srcBuf, LifoAlloc& alloc,
-               ScriptSourceObject** sourceObjectOut = nullptr);
- 
- MOZ_MUST_USE bool
- CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const char16_t* chars, size_t length);
- 
- //
- // Compile a single function. The source in srcBuf must match the ECMA-262
- // FunctionExpression production.
-diff --git a/js/src/jsapi-tests/testCompileNonSyntactic.cpp b/js/src/jsapi-tests/testCompileNonSyntactic.cpp
---- a/js/src/jsapi-tests/testCompileNonSyntactic.cpp
-+++ b/js/src/jsapi-tests/testCompileNonSyntactic.cpp
-@@ -1,21 +1,23 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "gc/GCInternals.h"
-+#include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- #include "vm/Monitor.h"
- #include "vm/MutexIDs.h"
- 
- using namespace JS;
- using js::AutoLockMonitor;
- 
--struct OffThreadTask {
-+struct OffThreadTask
-+{
-     OffThreadTask()
-       : monitor(js::mutexid::ShellOffThreadState),
-         token(nullptr)
-     {}
- 
-     OffThreadToken* waitUntilDone(JSContext* cx)
-     {
-         if (OffThreadParsingMustWaitForGC(cx->runtime()))
-@@ -63,17 +65,17 @@ testCompile(bool nonSyntactic)
-     static const char src[] = "42\n";
-     static const char16_t src_16[] = u"42\n";
- 
-     constexpr size_t length = sizeof(src) - 1;
-     static_assert(sizeof(src_16) / sizeof(*src_16) - 1 == length,
-                   "Source buffers must be same length");
- 
- 
--    SourceBufferHolder buf(src_16, length, SourceBufferHolder::NoOwnership);
-+    JS::SourceBufferHolder buf(src_16, length, JS::SourceBufferHolder::NoOwnership);
- 
-     JS::CompileOptions options(cx);
-     options.setNonSyntacticScope(nonSyntactic);
- 
-     JS::RootedScript script(cx);
- 
- 
-     // Check explicit non-syntactic compilation first to make sure it doesn't
-@@ -103,17 +105,17 @@ testCompile(bool nonSyntactic)
-         CHECK_EQUAL(script->hasNonSyntacticScope(), nonSyntactic);
-     }
- 
- 
-     options.forceAsync = true;
-     OffThreadTask task;
-     OffThreadToken* token;
- 
--    SourceBufferHolder srcBuf(src_16, length, SourceBufferHolder::NoOwnership);
-+    JS::SourceBufferHolder srcBuf(src_16, length, JS::SourceBufferHolder::NoOwnership);
-     CHECK(CompileOffThread(cx, options, srcBuf, task.OffThreadCallback, &task));
-     CHECK(token = task.waitUntilDone(cx));
-     CHECK(script = FinishOffThreadScript(cx, token));
-     CHECK_EQUAL(script->hasNonSyntacticScope(), nonSyntactic);
- 
-     return true;
- }
- END_TEST(testCompileScript);
-diff --git a/js/src/jsapi-tests/testErrorLineOfContext.cpp b/js/src/jsapi-tests/testErrorLineOfContext.cpp
---- a/js/src/jsapi-tests/testErrorLineOfContext.cpp
-+++ b/js/src/jsapi-tests/testErrorLineOfContext.cpp
-@@ -1,13 +1,14 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsfriendapi.h"
-+#include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- #include "vm/ErrorReporting.h"
- 
- BEGIN_TEST(testErrorLineOfContext)
- {
-     static const char16_t fullLineR[] = u"\n  var x = @;  \r  ";
-     CHECK(testLineOfContextHasNoLineTerminator(fullLineR, ' '));
- 
-diff --git a/js/src/jsapi-tests/testJSEvaluateScript.cpp b/js/src/jsapi-tests/testJSEvaluateScript.cpp
---- a/js/src/jsapi-tests/testJSEvaluateScript.cpp
-+++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp
-@@ -1,12 +1,13 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  */
- 
-+#include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- 
- using mozilla::ArrayLength;
- 
- BEGIN_TEST(testJSEvaluateScript)
- {
-     JS::RootedObject obj(cx, JS_NewPlainObject(cx));
-     CHECK(obj);
-diff --git a/js/src/jsapi-tests/testMutedErrors.cpp b/js/src/jsapi-tests/testMutedErrors.cpp
---- a/js/src/jsapi-tests/testMutedErrors.cpp
-+++ b/js/src/jsapi-tests/testMutedErrors.cpp
-@@ -1,13 +1,14 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsfriendapi.h"
-+#include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- 
- BEGIN_TEST(testMutedErrors)
- {
-     CHECK(testOuter("function f() {return 1}; f;"));
-     CHECK(testOuter("function outer() { return (function () {return 2}); }; outer();"));
-     CHECK(testOuter("eval('(function() {return 3})');"));
-     CHECK(testOuter("(function (){ return eval('(function() {return 4})'); })()"));
-diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp
---- a/js/src/jsapi-tests/testScriptObject.cpp
-+++ b/js/src/jsapi-tests/testScriptObject.cpp
-@@ -1,15 +1,16 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- 
- struct ScriptObjectFixture : public JSAPITest {
-     static const int code_size;
-     static const char code[];
-     static char16_t uc_code[];
- 
-     ScriptObjectFixture()
-diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
---- a/js/src/jsapi.cpp
-+++ b/js/src/jsapi.cpp
-@@ -59,16 +59,17 @@
- #include "js/CharacterEncoding.h"
- #include "js/Conversions.h"
- #include "js/Date.h"
- #include "js/Initialization.h"
- #include "js/JSON.h"
- #include "js/LocaleSensitive.h"
- #include "js/Proxy.h"
- #include "js/SliceBudget.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/StructuredClone.h"
- #include "js/Utility.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "util/Text.h"
- #include "vm/AsyncFunction.h"
- #include "vm/AsyncIteration.h"
-@@ -108,16 +109,17 @@
- using namespace js;
- using namespace js::gc;
- 
- using mozilla::Maybe;
- using mozilla::PodCopy;
- using mozilla::Some;
- 
- using JS::AutoStableStringChars;
-+using JS::SourceBufferHolder;
- 
- #ifdef HAVE_VA_LIST_AS_ARRAY
- #define JS_ADDRESSOF_VA_LIST(ap) ((va_list*)(ap))
- #else
- #define JS_ADDRESSOF_VA_LIST(ap) (&(ap))
- #endif
- 
- JS_PUBLIC_API(bool)
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -35,29 +35,29 @@
- #include "js/HashTable.h"
- #include "js/Id.h"
- #include "js/MemoryFunctions.h"
- #include "js/OffThreadScriptCompilation.h"
- #include "js/Principals.h"
- #include "js/Realm.h"
- #include "js/RefCounted.h"
- #include "js/RootingAPI.h"
--#include "js/SourceBufferHolder.h"
- #include "js/Stream.h"
- #include "js/TracingAPI.h"
- #include "js/Transcoding.h"
- #include "js/UniquePtr.h"
- #include "js/Utility.h"
- #include "js/Value.h"
- #include "js/Vector.h"
- 
- /************************************************************************/
- 
- namespace JS {
- 
-+class SourceBufferHolder;
- class TwoByteChars;
- 
- #ifdef JS_DEBUG
- 
- class JS_PUBLIC_API(AutoCheckRequestDepth)
- {
-     JSContext* cx;
-   public:
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -79,16 +79,17 @@
- #include "jit/JitRealm.h"
- #include "jit/shared/CodeGenerator-shared.h"
- #include "js/AutoByteString.h"
- #include "js/Debug.h"
- #include "js/GCVector.h"
- #include "js/Initialization.h"
- #include "js/JSON.h"
- #include "js/Printf.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/StructuredClone.h"
- #include "js/SweepingAPI.h"
- #include "js/Wrapper.h"
- #include "perf/jsperf.h"
- #include "shell/jsoptparse.h"
- #include "shell/jsshell.h"
- #include "shell/OSObject.h"
-@@ -4406,18 +4407,18 @@ ParseModule(JSContext* cx, unsigned argc
-         options.setFileAndLine("<string>", 1);
-     }
- 
-     AutoStableStringChars stableChars(cx);
-     if (!stableChars.initTwoByte(cx, scriptContents))
-         return false;
- 
-     const char16_t* chars = stableChars.twoByteRange().begin().get();
--    SourceBufferHolder srcBuf(chars, scriptContents->length(),
--                              SourceBufferHolder::NoOwnership);
-+    JS::SourceBufferHolder srcBuf(chars, scriptContents->length(),
-+                                  JS::SourceBufferHolder::NoOwnership);
- 
-     RootedScript script(cx, frontend::CompileModule(cx, options, srcBuf));
-     if (!script)
-         return false;
- 
-     JSObject* obj = ShellScriptObject::get(cx, script);
-     if (!obj)
-         return false;
-diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
---- a/js/src/vm/Debugger.cpp
-+++ b/js/src/vm/Debugger.cpp
-@@ -22,16 +22,17 @@
- #include "gc/HashUtil.h"
- #include "gc/Marking.h"
- #include "gc/Policy.h"
- #include "gc/PublicIterators.h"
- #include "jit/BaselineDebugModeOSR.h"
- #include "jit/BaselineJIT.h"
- #include "js/AutoByteString.h"
- #include "js/Date.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/UbiNodeBreadthFirst.h"
- #include "js/Vector.h"
- #include "js/Wrapper.h"
- #include "proxy/ScriptedProxyHandler.h"
- #include "util/Text.h"
- #include "vm/ArgumentsObject.h"
- #include "vm/AsyncFunction.h"
-@@ -56,16 +57,17 @@
- #include "vm/Stack-inl.h"
- 
- using namespace js;
- 
- using JS::AutoStableStringChars;
- using JS::dbg::AutoEntryMonitor;
- using JS::dbg::Builder;
- using js::frontend::IsIdentifier;
-+using JS::SourceBufferHolder;
- using mozilla::DebugOnly;
- using mozilla::MakeScopeExit;
- using mozilla::Maybe;
- using mozilla::Some;
- using mozilla::Nothing;
- using mozilla::AsVariant;
- using mozilla::TimeDuration;
- using mozilla::TimeStamp;
-diff --git a/js/src/vm/HelperThreads.h b/js/src/vm/HelperThreads.h
---- a/js/src/vm/HelperThreads.h
-+++ b/js/src/vm/HelperThreads.h
-@@ -19,16 +19,17 @@
- #include "mozilla/TimeStamp.h"
- #include "mozilla/TypeTraits.h"
- #include "mozilla/Variant.h"
- 
- #include "jsapi.h"
- 
- #include "ds/Fifo.h"
- #include "jit/Ion.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/TypeDecls.h"
- #include "threading/ConditionVariable.h"
- #include "vm/JSContext.h"
- #include "vm/MutexIDs.h"
- 
- namespace JS {
- class OffThreadToken {};
- } // namespace JS
-diff --git a/js/src/vm/JSFunction.cpp b/js/src/vm/JSFunction.cpp
---- a/js/src/vm/JSFunction.cpp
-+++ b/js/src/vm/JSFunction.cpp
-@@ -29,16 +29,17 @@
- #include "frontend/TokenStream.h"
- #include "gc/Marking.h"
- #include "gc/Policy.h"
- #include "jit/InlinableNatives.h"
- #include "jit/Ion.h"
- #include "js/AutoByteString.h"
- #include "js/CallNonGenericMethod.h"
- #include "js/Proxy.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "vm/AsyncFunction.h"
- #include "vm/AsyncIteration.h"
- #include "vm/Debugger.h"
- #include "vm/GlobalObject.h"
- #include "vm/Interpreter.h"
-@@ -62,16 +63,17 @@ using namespace js::gc;
- using namespace js::frontend;
- 
- using mozilla::ArrayLength;
- using mozilla::CheckedInt;
- using mozilla::Maybe;
- using mozilla::Some;
- 
- using JS::AutoStableStringChars;
-+using JS::SourceBufferHolder;
- 
- static bool
- fun_enumerate(JSContext* cx, HandleObject obj)
- {
-     MOZ_ASSERT(obj->is<JSFunction>());
- 
-     RootedId id(cx);
-     bool found;
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -33,16 +33,17 @@
- #include "frontend/SharedContext.h"
- #include "gc/FreeOp.h"
- #include "jit/BaselineJIT.h"
- #include "jit/Ion.h"
- #include "jit/IonCode.h"
- #include "jit/JitRealm.h"
- #include "js/MemoryMetrics.h"
- #include "js/Printf.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/UniquePtr.h"
- #include "js/Utility.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "util/Text.h"
- #include "vm/ArgumentsObject.h"
- #include "vm/BytecodeUtil.h"
- #include "vm/Compression.h"
-@@ -69,16 +70,17 @@
- 
- using namespace js;
- using namespace js::gc;
- using namespace js::frontend;
- 
- using mozilla::Maybe;
- using mozilla::PodCopy;
- 
-+using JS::SourceBufferHolder;
- 
- template<XDRMode mode>
- XDRResult
- js::XDRScriptConst(XDRState<mode>* xdr, MutableHandleValue vp)
- {
-     JSContext* cx = xdr->cx();
- 
-     enum ConstTag {
-diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
---- a/js/src/wasm/AsmJS.cpp
-+++ b/js/src/wasm/AsmJS.cpp
-@@ -30,16 +30,17 @@
- #include "jsutil.h"
- 
- #include "builtin/String.h"
- #include "frontend/Parser.h"
- #include "gc/Policy.h"
- #include "js/AutoByteString.h"
- #include "js/MemoryMetrics.h"
- #include "js/Printf.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "util/Text.h"
- #include "vm/ErrorReporting.h"
- #include "vm/SelfHosting.h"
- #include "vm/Time.h"
- #include "vm/TypedArrayObject.h"
-@@ -69,16 +70,17 @@ using mozilla::IsNegativeZero;
- using mozilla::IsPositiveZero;
- using mozilla::IsPowerOfTwo;
- using mozilla::PodZero;
- using mozilla::PositiveInfinity;
- using mozilla::Unused;
- using JS::AsmJSOption;
- using JS::AutoStableStringChars;
- using JS::GenericNaN;
-+using JS::SourceBufferHolder;
- 
- /*****************************************************************************/
- 
- // The asm.js valid heap lengths are precisely the WASM valid heap lengths for ARM
- // greater or equal to MinHeapLength
- static const size_t MinHeapLength = PageSize;
- 
- static uint32_t
-diff --git a/js/xpconnect/loader/ChromeScriptLoader.cpp b/js/xpconnect/loader/ChromeScriptLoader.cpp
---- a/js/xpconnect/loader/ChromeScriptLoader.cpp
-+++ b/js/xpconnect/loader/ChromeScriptLoader.cpp
-@@ -8,16 +8,17 @@
- 
- #include "nsIURI.h"
- #include "nsIChannel.h"
- #include "nsNetUtil.h"
- #include "nsThreadUtils.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/Utility.h"
- 
- #include "mozilla/dom/ChromeUtils.h"
- #include "mozilla/dom/Promise.h"
- #include "mozilla/dom/ScriptLoader.h"
- #include "mozilla/HoldDropJSObjects.h"
- #include "mozilla/SystemGroup.h"
- #include "nsCCUncollectableMarker.h"
-diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
---- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
-+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
-@@ -14,16 +14,17 @@
- #include "nsIInputStream.h"
- #include "nsNetCID.h"
- #include "nsNetUtil.h"
- #include "nsIFileURL.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
- #include "xpcprivate.h" // For xpc::OptionsBase
-+#include "js/SourceBufferHolder.h"
- #include "js/Wrapper.h"
- 
- #include "mozilla/ContentPrincipal.h"
- #include "mozilla/dom/Promise.h"
- #include "mozilla/dom/ToJSValue.h"
- #include "mozilla/dom/ScriptLoader.h"
- #include "mozilla/HoldDropJSObjects.h"
- #include "mozilla/ScriptPreloader.h"
-diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp
---- a/js/xpconnect/src/Sandbox.cpp
-+++ b/js/xpconnect/src/Sandbox.cpp
-@@ -7,16 +7,17 @@
- /*
-  * The Components.Sandbox object.
-  */
- 
- #include "AccessCheck.h"
- #include "jsfriendapi.h"
- #include "js/AutoByteString.h"
- #include "js/Proxy.h"
-+#include "js/SourceBufferHolder.h"
- #include "js/StructuredClone.h"
- #include "nsContentUtils.h"
- #include "nsGlobalWindow.h"
- #include "nsIException.h" // for nsIStackFrame
- #include "nsIScriptContext.h"
- #include "nsIScriptObjectPrincipal.h"
- #include "nsIURI.h"
- #include "nsJSUtils.h"

+ 0 - 1364
frg/work-js/mozilla-release/patches/mozilla-central-push_433718.patch

@@ -1,1364 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535163915 18000
-#      Fri Aug 24 21:25:15 2018 -0500
-# Node ID 1fb7ddfad86d5e085c4f2af23a2519d37e45a3e4
-# Parent  2dc7007e3924444f55345606b6785f2d2ba89ce1
-Bug 1486577 - Make all users of the various *CompileOptions classes #include "js/CompileOptions.h" so that nothing but that file has to know about these classes having a JS_PUBLIC_API on them, that would have to be present in forward-declarations.  r=jandem
-
-diff --git a/js/public/CompileOptions.h b/js/public/CompileOptions.h
---- a/js/public/CompileOptions.h
-+++ b/js/public/CompileOptions.h
-@@ -147,16 +147,18 @@ class JS_PUBLIC_API(TransitiveCompileOpt
-     virtual JSObject* element() const = 0;
-     virtual JSString* elementAttributeName() const = 0;
-     virtual JSScript* introductionScript() const = 0;
- 
-   private:
-     void operator=(const TransitiveCompileOptions&) = delete;
- };
- 
-+class JS_PUBLIC_API(CompileOptions);
-+
- /**
-  * The class representing a full set of compile options.
-  *
-  * Use this in code that only needs to access compilation options created
-  * elsewhere, like the compiler.  Don't instantiate this class (the constructor
-  * is protected anyway); instead, create instances only of the derived classes:
-  * CompileOptions and OwningCompileOptions.
-  */
-diff --git a/js/src/NamespaceImports.h b/js/src/NamespaceImports.h
---- a/js/src/NamespaceImports.h
-+++ b/js/src/NamespaceImports.h
-@@ -95,22 +95,18 @@ using JS::IdVector;
- using JS::ScriptVector;
- 
- using JS::GCVector;
- using JS::GCHashMap;
- using JS::GCHashSet;
- 
- using JS::CallArgs;
- using JS::CallNonGenericMethod;
--using JS::CompileOptions;
- using JS::IsAcceptableThis;
- using JS::NativeImpl;
--using JS::OwningCompileOptions;
--using JS::ReadOnlyCompileOptions;
--using JS::TransitiveCompileOptions;
- 
- using JS::Rooted;
- using JS::RootedFunction;
- using JS::RootedId;
- using JS::RootedObject;
- using JS::RootedScript;
- using JS::RootedString;
- using JS::RootedSymbol;
-diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp
---- a/js/src/builtin/Eval.cpp
-+++ b/js/src/builtin/Eval.cpp
-@@ -23,16 +23,17 @@
- using namespace js;
- 
- using mozilla::AddToHash;
- using mozilla::HashString;
- using mozilla::RangedPtr;
- 
- using JS::AutoCheckCannotGC;
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
- using JS::SourceBufferHolder;
- 
- // We should be able to assert this for *any* fp->environmentChain().
- static void
- AssertInnerizedEnvironmentChain(JSContext* cx, JSObject& env)
- {
- #ifdef DEBUG
-     RootedObject obj(cx);
-diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp
---- a/js/src/builtin/ReflectParse.cpp
-+++ b/js/src/builtin/ReflectParse.cpp
-@@ -27,16 +27,17 @@
- #include "frontend/ParseNode-inl.h"
- #include "vm/JSObject-inl.h"
- 
- using namespace js;
- using namespace js::frontend;
- 
- using JS::AutoStableStringChars;
- using JS::AutoValueArray;
-+using JS::CompileOptions;
- using mozilla::DebugOnly;
- 
- enum ASTType {
-     AST_ERROR = -1,
- #define ASTDEF(ast, str, method) ast,
- #include "jsast.tbl"
- #undef ASTDEF
-     AST_LIMIT
-diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp
---- a/js/src/builtin/RegExp.cpp
-+++ b/js/src/builtin/RegExp.cpp
-@@ -22,16 +22,18 @@
- #include "vm/NativeObject-inl.h"
- #include "vm/UnboxedObject-inl.h"
- 
- using namespace js;
- 
- using mozilla::CheckedInt;
- using mozilla::IsAsciiDigit;
- 
-+using JS::CompileOptions;
-+
- /*
-  * ES 2017 draft rev 6a13789aa9e7c6de4e96b7d3e24d9e6eba6584ad 21.2.5.2.2
-  * steps 3, 16-25.
-  */
- bool
- js::CreateRegExpMatchResult(JSContext* cx, HandleString input, const MatchPairs& matches,
-                             MutableHandleValue rval)
- {
-diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
---- a/js/src/builtin/TestingFunctions.cpp
-+++ b/js/src/builtin/TestingFunctions.cpp
-@@ -37,16 +37,17 @@
- #include "irregexp/RegExpEngine.h"
- #include "irregexp/RegExpParser.h"
- #endif
- #include "gc/Heap.h"
- #include "jit/BaselineJIT.h"
- #include "jit/InlinableNatives.h"
- #include "jit/JitRealm.h"
- #include "js/AutoByteString.h"
-+#include "js/CompileOptions.h"
- #include "js/Debug.h"
- #include "js/HashTable.h"
- #include "js/LocaleSensitive.h"
- #include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/StructuredClone.h"
- #include "js/UbiNode.h"
- #include "js/UbiNodeBreadthFirst.h"
-@@ -85,16 +86,17 @@
- #include "vm/StringType-inl.h"
- 
- using namespace js;
- 
- using mozilla::ArrayLength;
- using mozilla::Maybe;
- 
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
- using JS::SourceBufferHolder;
- 
- // If fuzzingSafe is set, remove functionality that could cause problems with
- // fuzzers. Set this via the environment variable MOZ_FUZZING_SAFE.
- mozilla::Atomic<bool> fuzzingSafe(false);
- 
- // If disableOOMFunctions is set, disable functionality that causes artificial
- // OOM conditions.
-diff --git a/js/src/frontend/BinSource.h b/js/src/frontend/BinSource.h
---- a/js/src/frontend/BinSource.h
-+++ b/js/src/frontend/BinSource.h
-@@ -20,16 +20,17 @@
- #include "frontend/BinToken.h"
- #include "frontend/BinTokenReaderMultipart.h"
- #include "frontend/BinTokenReaderTester.h"
- #include "frontend/FullParseHandler.h"
- #include "frontend/ParseContext.h"
- #include "frontend/ParseNode.h"
- #include "frontend/SharedContext.h"
- 
-+#include "js/CompileOptions.h"
- #include "js/GCHashTable.h"
- #include "js/GCVector.h"
- #include "js/Result.h"
- 
- namespace js {
- namespace frontend {
- 
- class BinASTParserBase: private JS::AutoGCRooter
-@@ -182,19 +183,19 @@ class BinASTParser : public BinASTParser
-     MOZ_MUST_USE JS::Result<Ok> checkFunctionClosedVars();
- 
-     // --- Utilities.
- 
-     MOZ_MUST_USE JS::Result<ParseNode*> appendDirectivesToBody(ParseNode* body,
-         ParseNode* directives);
- 
-   private: // Implement ErrorReporter
--    const ReadOnlyCompileOptions& options_;
-+    const JS::ReadOnlyCompileOptions& options_;
- 
--    const ReadOnlyCompileOptions& options() const override {
-+    const JS::ReadOnlyCompileOptions& options() const override {
-         return this->options_;
-     }
- 
-   public:
-     virtual ObjectBox* newObjectBox(JSObject* obj) override {
-         MOZ_ASSERT(obj);
- 
-         /*
-diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp
---- a/js/src/frontend/BytecodeCompiler.cpp
-+++ b/js/src/frontend/BytecodeCompiler.cpp
-@@ -30,16 +30,18 @@
- #include "vm/JSScript-inl.h"
- 
- using namespace js;
- using namespace js::frontend;
- 
- using mozilla::Maybe;
- using mozilla::Nothing;
- 
-+using JS::CompileOptions;
-+using JS::ReadOnlyCompileOptions;
- using JS::SourceBufferHolder;
- 
- // The BytecodeCompiler class contains resources common to compiling scripts and
- // function bodies.
- class MOZ_STACK_CLASS BytecodeCompiler
- {
-   public:
-     // Construct an object passing mandatory arguments.
-@@ -707,17 +709,17 @@ frontend::CompileModule(JSContext* cx, c
-     if (!script)
-         return nullptr;
- 
-     assertException.reset();
-     return script;
- }
- 
- JSScript*
--frontend::CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options,
-+frontend::CompileModule(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                         SourceBufferHolder& srcBuf)
- {
-     AutoAssertReportedException assertException(cx);
- 
-     if (!GlobalObject::ensureModulePrototypesCreated(cx, cx->global()))
-         return nullptr;
- 
-     LifoAlloc& alloc = cx->tempLifoAlloc();
-@@ -785,17 +787,17 @@ frontend::CompileLazyFunction(JSContext*
-     // compiled, because compilation requires full information about the
-     // function's immediately enclosing scope.
-     MOZ_ASSERT(lazy->enclosingScriptHasEverBeenCompiled());
- 
-     AutoAssertReportedException assertException(cx);
-     Rooted<JSFunction*> fun(cx, lazy->functionNonDelazifying());
-     AutoAssertFunctionDelazificationCompletion delazificationCompletion(cx, fun);
- 
--    CompileOptions options(cx);
-+    JS::CompileOptions options(cx);
-     options.setMutedErrors(lazy->mutedErrors())
-            .setFileAndLine(lazy->filename(), lazy->lineno())
-            .setColumn(lazy->column())
-            .setScriptSourceOffset(lazy->sourceStart())
-            .setNoScriptRval(false)
-            .setSelfHostingMode(false);
- 
-     // Update statistics to find out if we are delazifying just after having
-@@ -852,17 +854,17 @@ frontend::CompileLazyFunction(JSContext*
- 
-     delazificationCompletion.complete();
-     assertException.reset();
-     return true;
- }
- 
- bool
- frontend::CompileStandaloneFunction(JSContext* cx, MutableHandleFunction fun,
--                                    const ReadOnlyCompileOptions& options,
-+                                    const JS::ReadOnlyCompileOptions& options,
-                                     JS::SourceBufferHolder& srcBuf,
-                                     const Maybe<uint32_t>& parameterListEnd,
-                                     HandleScope enclosingScope /* = nullptr */)
- {
-     AutoAssertReportedException assertException(cx);
- 
-     RootedScope scope(cx, enclosingScope);
-     if (!scope)
-@@ -877,17 +879,17 @@ frontend::CompileStandaloneFunction(JSCo
-     }
- 
-     assertException.reset();
-     return true;
- }
- 
- bool
- frontend::CompileStandaloneGenerator(JSContext* cx, MutableHandleFunction fun,
--                                     const ReadOnlyCompileOptions& options,
-+                                     const JS::ReadOnlyCompileOptions& options,
-                                      JS::SourceBufferHolder& srcBuf,
-                                      const Maybe<uint32_t>& parameterListEnd)
- {
-     AutoAssertReportedException assertException(cx);
- 
-     RootedScope emptyGlobalScope(cx, &cx->global()->emptyGlobalScope());
- 
-     BytecodeCompiler compiler(cx, cx->tempLifoAlloc(), options, srcBuf, emptyGlobalScope);
-diff --git a/js/src/frontend/BytecodeCompiler.h b/js/src/frontend/BytecodeCompiler.h
---- a/js/src/frontend/BytecodeCompiler.h
-+++ b/js/src/frontend/BytecodeCompiler.h
-@@ -6,16 +6,17 @@
- 
- #ifndef frontend_BytecodeCompiler_h
- #define frontend_BytecodeCompiler_h
- 
- #include "mozilla/Maybe.h"
- 
- #include "NamespaceImports.h"
- 
-+#include "js/CompileOptions.h"
- #include "vm/Scope.h"
- #include "vm/StringType.h"
- #include "vm/TraceLogging.h"
- 
- class JSLinearString;
- 
- namespace js {
- 
-@@ -26,43 +27,43 @@ class ScriptSourceObject;
- namespace frontend {
- 
- class ErrorReporter;
- class FunctionBox;
- class ParseNode;
- 
- JSScript*
- CompileGlobalScript(JSContext* cx, LifoAlloc& alloc, ScopeKind scopeKind,
--                    const ReadOnlyCompileOptions& options,
-+                    const JS::ReadOnlyCompileOptions& options,
-                     JS::SourceBufferHolder& srcBuf,
-                     ScriptSourceObject** sourceObjectOut = nullptr);
- 
- #if defined(JS_BUILD_BINAST)
- 
- JSScript*
- CompileGlobalBinASTScript(JSContext *cx, LifoAlloc& alloc,
--                          const ReadOnlyCompileOptions& options,
-+                          const JS::ReadOnlyCompileOptions& options,
-                           const uint8_t* src, size_t len,
-                           ScriptSourceObject** sourceObjectOut = nullptr);
- 
- #endif // JS_BUILD_BINAST
- 
- JSScript*
- CompileEvalScript(JSContext* cx, LifoAlloc& alloc,
-                   HandleObject scopeChain, HandleScope enclosingScope,
--                  const ReadOnlyCompileOptions& options,
-+                  const JS::ReadOnlyCompileOptions& options,
-                   JS::SourceBufferHolder& srcBuf,
-                   ScriptSourceObject** sourceObjectOut = nullptr);
- 
- JSScript*
--CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options,
-+CompileModule(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-               JS::SourceBufferHolder& srcBuf);
- 
- JSScript*
--CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options,
-+CompileModule(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-               JS::SourceBufferHolder& srcBuf, LifoAlloc& alloc,
-               ScriptSourceObject** sourceObjectOut = nullptr);
- 
- MOZ_MUST_USE bool
- CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const char16_t* chars, size_t length);
- 
- //
- // Compile a single function. The source in srcBuf must match the ECMA-262
-@@ -73,41 +74,41 @@ CompileLazyFunction(JSContext* cx, Handl
- // else, it's a SyntaxError. This is used to implement the Function constructor;
- // it's how we detect that these weird cases are SyntaxErrors:
- //
- //     Function("/*", "*/x) {")
- //     Function("x){ if (3", "return x;}")
- //
- MOZ_MUST_USE bool
- CompileStandaloneFunction(JSContext* cx, MutableHandleFunction fun,
--                          const ReadOnlyCompileOptions& options,
-+                          const JS::ReadOnlyCompileOptions& options,
-                           JS::SourceBufferHolder& srcBuf,
-                           const mozilla::Maybe<uint32_t>& parameterListEnd,
-                           HandleScope enclosingScope = nullptr);
- 
- MOZ_MUST_USE bool
- CompileStandaloneGenerator(JSContext* cx, MutableHandleFunction fun,
--                           const ReadOnlyCompileOptions& options,
-+                           const JS::ReadOnlyCompileOptions& options,
-                            JS::SourceBufferHolder& srcBuf,
-                            const mozilla::Maybe<uint32_t>& parameterListEnd);
- 
- MOZ_MUST_USE bool
- CompileStandaloneAsyncFunction(JSContext* cx, MutableHandleFunction fun,
--                               const ReadOnlyCompileOptions& options,
-+                               const JS::ReadOnlyCompileOptions& options,
-                                JS::SourceBufferHolder& srcBuf,
-                                const mozilla::Maybe<uint32_t>& parameterListEnd);
- 
- MOZ_MUST_USE bool
- CompileStandaloneAsyncGenerator(JSContext* cx, MutableHandleFunction fun,
--                                const ReadOnlyCompileOptions& options,
-+                                const JS::ReadOnlyCompileOptions& options,
-                                 JS::SourceBufferHolder& srcBuf,
-                                 const mozilla::Maybe<uint32_t>& parameterListEnd);
- 
- ScriptSourceObject*
--CreateScriptSourceObject(JSContext* cx, const ReadOnlyCompileOptions& options,
-+CreateScriptSourceObject(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                          const mozilla::Maybe<uint32_t>& parameterListEnd = mozilla::Nothing());
- 
- /*
-  * True if str consists of an IdentifierStart character, followed by one or
-  * more IdentifierPart characters, i.e. it matches the IdentifierName production
-  * in the language spec.
-  *
-  * This returns true even if str is a keyword like "if".
-diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
---- a/js/src/frontend/BytecodeEmitter.cpp
-+++ b/js/src/frontend/BytecodeEmitter.cpp
-@@ -32,16 +32,17 @@
- #include "frontend/ForOfEmitter.h"
- #include "frontend/ForOfLoopControl.h"
- #include "frontend/IfEmitter.h"
- #include "frontend/Parser.h"
- #include "frontend/SwitchEmitter.h"
- #include "frontend/TDZCheckCache.h"
- #include "frontend/TryEmitter.h"
- #include "frontend/WhileEmitter.h"
-+#include "js/CompileOptions.h"
- #include "vm/BytecodeUtil.h"
- #include "vm/Debugger.h"
- #include "vm/GeneratorObject.h"
- #include "vm/JSAtom.h"
- #include "vm/JSContext.h"
- #include "vm/JSFunction.h"
- #include "vm/JSScript.h"
- #include "vm/Stack.h"
-@@ -5108,18 +5109,18 @@ BytecodeEmitter::emitFunction(ParseNode*
-                 fun->lazyScript()->setTreatAsRunOnce();
-         } else {
-             MOZ_ASSERT_IF(outersc->strict(), funbox->strictScript);
- 
-             // Inherit most things (principals, version, etc) from the
-             // parent.  Use default values for the rest.
-             Rooted<JSScript*> parent(cx, script);
-             MOZ_ASSERT(parent->mutedErrors() == parser->options().mutedErrors());
--            const TransitiveCompileOptions& transitiveOptions = parser->options();
--            CompileOptions options(cx, transitiveOptions);
-+            const JS::TransitiveCompileOptions& transitiveOptions = parser->options();
-+            JS::CompileOptions options(cx, transitiveOptions);
- 
-             Rooted<JSObject*> sourceObject(cx, script->sourceObject());
-             Rooted<JSScript*> script(cx, JSScript::Create(cx, options, sourceObject,
-                                                           funbox->bufStart, funbox->bufEnd,
-                                                           funbox->toStringStart,
-                                                           funbox->toStringEnd));
-             if (!script)
-                 return false;
-diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
---- a/js/src/frontend/Parser.cpp
-+++ b/js/src/frontend/Parser.cpp
-@@ -60,16 +60,17 @@ using mozilla::Maybe;
- using mozilla::Nothing;
- using mozilla::PodCopy;
- using mozilla::PodZero;
- using mozilla::Some;
- using mozilla::Unused;
- using mozilla::Utf8Unit;
- 
- using JS::AutoGCRooter;
-+using JS::ReadOnlyCompileOptions;
- 
- namespace js {
- namespace frontend {
- 
- using DeclaredNamePtr = ParseContext::Scope::DeclaredNamePtr;
- using AddDeclaredNamePtr = ParseContext::Scope::AddDeclaredNamePtr;
- using BindingIter = ParseContext::Scope::BindingIter;
- using UsedNamePtr = UsedNameTracker::UsedNameMap::Ptr;
-diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
---- a/js/src/frontend/Parser.h
-+++ b/js/src/frontend/Parser.h
-@@ -176,16 +176,17 @@
- #include "frontend/BytecodeCompiler.h"
- #include "frontend/FullParseHandler.h"
- #include "frontend/NameAnalysisTypes.h"
- #include "frontend/NameCollections.h"
- #include "frontend/ParseContext.h"
- #include "frontend/SharedContext.h"
- #include "frontend/SyntaxParseHandler.h"
- #include "frontend/TokenStream.h"
-+#include "js/CompileOptions.h"
- #include "vm/Iteration.h"
- 
- namespace js {
- 
- class ModuleObject;
- 
- namespace frontend {
- 
-@@ -315,17 +316,17 @@ class MOZ_STACK_CLASS ParserBase
- 
-     ParseGoal parseGoal() const {
-         return ParseGoal(parseGoal_);
-     }
- 
-     template<class, typename> friend class AutoAwaitIsKeyword;
-     template<class, typename> friend class AutoInParametersOfAsyncFunction;
- 
--    ParserBase(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
-+    ParserBase(JSContext* cx, LifoAlloc& alloc, const JS::ReadOnlyCompileOptions& options,
-                bool foldConstants, UsedNameTracker& usedNames,
-                ScriptSourceObject* sourceObject, ParseGoal parseGoal);
-     ~ParserBase();
- 
-     bool checkOptions();
- 
-     void trace(JSTracer* trc);
- 
-@@ -338,17 +339,17 @@ class MOZ_STACK_CLASS ParserBase
-     }
- 
-     virtual bool strictMode() override { return pc->sc()->strict(); }
-     bool setLocalStrictMode(bool strict) {
-         MOZ_ASSERT(anyChars.debugHasNoLookahead());
-         return pc->sc()->setLocalStrictMode(strict);
-     }
- 
--    const ReadOnlyCompileOptions& options() const {
-+    const JS::ReadOnlyCompileOptions& options() const {
-         return anyChars.options();
-     }
- 
-     bool isUnexpectedEOF() const { return isUnexpectedEOF_; }
- 
-     MOZ_MUST_USE bool warningNoOffset(unsigned errorNumber, ...);
-     void errorNoOffset(unsigned errorNumber, ...);
- 
-@@ -480,24 +481,24 @@ class MOZ_STACK_CLASS PerHandlerParser
-     // template class doesn't know |CharT|, so we store a |void*| here and make
-     // |GeneralParser<ParseHandler, CharT>::getSyntaxParser| impose the real type.
-     void* internalSyntaxParser_;
- 
-   private:
-     // NOTE: The argument ordering here is deliberately different from the
-     //       public constructor so that typos calling the public constructor
-     //       are less likely to select this overload.
--    PerHandlerParser(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
-+    PerHandlerParser(JSContext* cx, LifoAlloc& alloc, const JS::ReadOnlyCompileOptions& options,
-                      bool foldConstants, UsedNameTracker& usedNames, LazyScript* lazyOuterFunction,
-                      ScriptSourceObject* sourceObject, ParseGoal parseGoal,
-                      void* internalSyntaxParser);
- 
-   protected:
-     template<typename CharT>
--    PerHandlerParser(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
-+    PerHandlerParser(JSContext* cx, LifoAlloc& alloc, const JS::ReadOnlyCompileOptions& options,
-                      bool foldConstants, UsedNameTracker& usedNames,
-                      GeneralParser<SyntaxParseHandler, CharT>* syntaxParser,
-                      LazyScript* lazyOuterFunction, ScriptSourceObject* sourceObject,
-                      ParseGoal parseGoal)
-       : PerHandlerParser(cx, alloc, options, foldConstants, usedNames, lazyOuterFunction,
-                          sourceObject, parseGoal,
-                          // JSOPTION_EXTRA_WARNINGS adds extra warnings not
-                          // generated when functions are parsed lazily.
-@@ -894,17 +895,17 @@ class MOZ_STACK_CLASS GeneralParser
-     SyntaxParser* getSyntaxParser() const {
-         return reinterpret_cast<SyntaxParser*>(Base::internalSyntaxParser_);
-     }
- 
-   public:
-     TokenStream tokenStream;
- 
-   public:
--    GeneralParser(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
-+    GeneralParser(JSContext* cx, LifoAlloc& alloc, const JS::ReadOnlyCompileOptions& options,
-                   const CharT* chars, size_t length, bool foldConstants,
-                   UsedNameTracker& usedNames, SyntaxParser* syntaxParser,
-                   LazyScript* lazyOuterFunction,
-                   ScriptSourceObject* sourceObject,
-                   ParseGoal parseGoal);
- 
-     inline void setAwaitHandling(AwaitHandling awaitHandling);
-     inline void setInParametersOfAsyncFunction(bool inParameters);
-diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
---- a/js/src/frontend/TokenStream.cpp
-+++ b/js/src/frontend/TokenStream.cpp
-@@ -50,16 +50,18 @@ using mozilla::IsAsciiAlpha;
- using mozilla::IsAsciiDigit;
- using mozilla::IsTrailingUnit;
- using mozilla::MakeScopeExit;
- using mozilla::MakeSpan;
- using mozilla::Maybe;
- using mozilla::PointerRangeSize;
- using mozilla::Utf8Unit;
- 
-+using JS::ReadOnlyCompileOptions;
-+
- struct ReservedWordInfo
- {
-     const char* chars;         // C string with reserved word text
-     js::frontend::TokenKind tokentype;
- };
- 
- static const ReservedWordInfo reservedWords[] = {
- #define RESERVED_WORD_INFO(word, name, type) \
-diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h
---- a/js/src/frontend/TokenStream.h
-+++ b/js/src/frontend/TokenStream.h
-@@ -199,16 +199,17 @@
- #include <stddef.h>
- #include <stdint.h>
- #include <stdio.h>
- 
- #include "jspubtd.h"
- 
- #include "frontend/ErrorReporter.h"
- #include "frontend/TokenKind.h"
-+#include "js/CompileOptions.h"
- #include "js/UniquePtr.h"
- #include "js/Vector.h"
- #include "util/Text.h"
- #include "util/Unicode.h"
- #include "vm/ErrorReporting.h"
- #include "vm/JSContext.h"
- #include "vm/RegExpShared.h"
- #include "vm/StringType.h"
-@@ -588,17 +589,17 @@ class MOZ_STACK_CLASS TokenStreamPositio
-     unsigned lookahead;
-     Token lookaheadTokens[TokenStreamShared::maxLookahead];
- } JS_HAZ_ROOTED;
- 
- class TokenStreamAnyChars
-   : public TokenStreamShared
- {
-   public:
--    TokenStreamAnyChars(JSContext* cx, const ReadOnlyCompileOptions& options,
-+    TokenStreamAnyChars(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                         StrictModeGetter* smg);
- 
-     template<typename CharT, class AnyCharsAccess> friend class GeneralTokenStreamChars;
-     template<typename CharT, class AnyCharsAccess> friend class TokenStreamChars;
-     template<typename CharT, class AnyCharsAccess> friend class TokenStreamSpecific;
- 
-     template<typename CharT> friend class TokenStreamPosition;
- 
-@@ -889,17 +890,17 @@ class TokenStreamAnyChars
-     }
- 
-     const char* getFilename() const {
-         return filename_;
-     }
- 
-   protected:
-     // Options used for parsing/tokenizing.
--    const ReadOnlyCompileOptions& options_;
-+    const JS::ReadOnlyCompileOptions& options_;
- 
-     Token               tokens[ntokens];    // circular token buffer
-   private:
-     unsigned            cursor_;            // index of last parsed token
-   protected:
-     unsigned            lookahead;          // count of lookahead tokens
-     unsigned            lineno;             // current line number
-     TokenStreamFlags    flags;              // flags -- see above
-@@ -2317,17 +2318,17 @@ class MOZ_STACK_CLASS TokenStreamSpecifi
-     // Deliberately don't |using| |sourceUnits| because of bug 1472569.  :-(
-     using CharsBase::toCharT;
-     using GeneralCharsBase::ungetCodeUnit;
-     using GeneralCharsBase::updateLineInfoForEOL;
- 
-     template<typename CharU> friend class TokenStreamPosition;
- 
-   public:
--    TokenStreamSpecific(JSContext* cx, const ReadOnlyCompileOptions& options,
-+    TokenStreamSpecific(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                         const CharT* base, size_t length);
- 
-     /**
-      * Get the next code point, converting LineTerminatorSequences to '\n' and
-      * updating internal line-counter state if needed.  Return true on success
-      * and store the code point in |*cp|.  Return false and leave |*cp|
-      * undefined on failure.
-      */
-@@ -2690,17 +2691,17 @@ class TokenStreamAnyCharsAccess
- 
- class MOZ_STACK_CLASS TokenStream final
-   : public TokenStreamAnyChars,
-     public TokenStreamSpecific<char16_t, TokenStreamAnyCharsAccess>
- {
-     using CharT = char16_t;
- 
-   public:
--    TokenStream(JSContext* cx, const ReadOnlyCompileOptions& options,
-+    TokenStream(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                 const CharT* base, size_t length, StrictModeGetter* smg)
-     : TokenStreamAnyChars(cx, options, smg),
-       TokenStreamSpecific<CharT, TokenStreamAnyCharsAccess>(cx, options, base, length)
-     {}
- };
- 
- template<class TokenStreamSpecific>
- /* static */ inline TokenStreamAnyChars&
-diff --git a/js/src/fuzz-tests/testBinASTReader.cpp b/js/src/fuzz-tests/testBinASTReader.cpp
---- a/js/src/fuzz-tests/testBinASTReader.cpp
-+++ b/js/src/fuzz-tests/testBinASTReader.cpp
-@@ -10,23 +10,26 @@
- 
- #include "jsapi.h"
- 
- #include "frontend/BinSource.h"
- #include "frontend/FullParseHandler.h"
- #include "frontend/ParseContext.h"
- #include "frontend/Parser.h"
- #include "fuzz-tests/tests.h"
-+#include "js/CompileOptions.h"
- #include "vm/Interpreter.h"
- 
- #include "vm/JSContext-inl.h"
- 
- using UsedNameTracker = js::frontend::UsedNameTracker;
- using namespace js;
- 
-+using JS::CompileOptions;
-+
- // These are defined and pre-initialized by the harness (in tests.cpp).
- extern JS::PersistentRootedObject gGlobal;
- extern JSContext* gCx;
- 
- static int
- testBinASTReaderInit(int *argc, char ***argv) {
-   return 0;
- }
-diff --git a/js/src/gdb/tests/test-unwind.cpp b/js/src/gdb/tests/test-unwind.cpp
---- a/js/src/gdb/tests/test-unwind.cpp
-+++ b/js/src/gdb/tests/test-unwind.cpp
-@@ -1,18 +1,24 @@
- #include "gdb-tests.h"
--#include "jsapi.h"
--#include "jit/JitOptions.h"
-+#include "jsapi.h" // sundry symbols not moved to more-specific headers yet
- 
--#include <string.h>
-+#include "jit/JitOptions.h" // js::jit::JitOptions
-+#include "js/CallArgs.h" // JS::CallArgs, JS::CallArgsFromVp
-+#include "js/CompileOptions.h" // JS::CompileOptions
-+#include "js/RootingAPI.h" // JS::Rooted
-+#include "js/Value.h" // JS::Value
-+
-+#include <stdint.h> // uint32_t
-+#include <string.h> // strlen
- 
- static bool
- Something(JSContext* cx, unsigned argc, JS::Value* vp)
- {
--    JS::CallArgs args = CallArgsFromVp(argc, vp);
-+    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-     args.rval().setInt32(23);
-     breakpoint();
-     return true;
- }
- 
- static const JSFunctionSpecWithHelp unwind_functions[] = {
-     JS_FN_HELP("something", Something, 0, 0,
- "something()",
-@@ -38,15 +44,15 @@ FRAGMENT(unwind, simple) {
-         "}\n"
-         "\n"
-         "function unwindFunctionOuter() {\n"
-         "    return unwindFunctionInner();\n"
-         "}\n"
-         "\n"
-         "unwindFunctionOuter();\n";
- 
--    CompileOptions opts(cx);
-+    JS::CompileOptions opts(cx);
-     opts.setFileAndLine(__FILE__, line0 + 1);
--    RootedValue rval(cx);
--    Evaluate(cx, opts, bytes, strlen(bytes), &rval);
-+    JS::Rooted<JS::Value> rval(cx);
-+    JS::Evaluate(cx, opts, bytes, strlen(bytes), &rval);
- 
-     js::jit::JitOptions.baselineWarmUpThreshold = saveThreshold;
- }
-diff --git a/js/src/jsapi-tests/testCloneScript.cpp b/js/src/jsapi-tests/testCloneScript.cpp
---- a/js/src/jsapi-tests/testCloneScript.cpp
-+++ b/js/src/jsapi-tests/testCloneScript.cpp
-@@ -2,17 +2,25 @@
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  *
-  * Test script cloning.
-  */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include <string.h> // strlen
-+
-+#include "jsapi.h" // sundry symbols not moved to more-specific headers yet
- #include "jsfriendapi.h"
-+#include "jspubtd.h" // JS::AutoObjectVector
-+
-+#include "js/CompileOptions.h" // JS::CompileOptions
-+#include "js/RootingAPI.h" // JS::Rooted
-+#include "js/TypeDecls.h" // JSFunction, JSObject
- #include "jsapi-tests/tests.h"
- 
- BEGIN_TEST(test_cloneScript)
- {
-     JS::RootedObject A(cx, createGlobal());
-     JS::RootedObject B(cx, createGlobal());
- 
-     CHECK(A);
-diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
---- a/js/src/jsapi.cpp
-+++ b/js/src/jsapi.cpp
-@@ -52,16 +52,17 @@
- #include "gc/Marking.h"
- #include "gc/Policy.h"
- #include "gc/PublicIterators.h"
- #include "gc/WeakMap.h"
- #include "jit/JitCommon.h"
- #include "jit/JitSpewer.h"
- #include "js/AutoByteString.h"
- #include "js/CharacterEncoding.h"
-+#include "js/CompileOptions.h"
- #include "js/Conversions.h"
- #include "js/Date.h"
- #include "js/Initialization.h"
- #include "js/JSON.h"
- #include "js/LocaleSensitive.h"
- #include "js/Proxy.h"
- #include "js/SliceBudget.h"
- #include "js/SourceBufferHolder.h"
-@@ -109,16 +110,18 @@
- using namespace js;
- using namespace js::gc;
- 
- using mozilla::Maybe;
- using mozilla::PodCopy;
- using mozilla::Some;
- 
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
-+using JS::ReadOnlyCompileOptions;
- using JS::SourceBufferHolder;
- 
- #ifdef HAVE_VA_LIST_AS_ARRAY
- #define JS_ADDRESSOF_VA_LIST(ap) ((va_list*)(ap))
- #else
- #define JS_ADDRESSOF_VA_LIST(ap) (&(ap))
- #endif
- 
-diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h
---- a/js/src/jspubtd.h
-+++ b/js/src/jspubtd.h
-@@ -26,20 +26,16 @@ namespace JS {
- 
- template <typename T> class AutoVector;
- using AutoIdVector = AutoVector<jsid>;
- using AutoValueVector = AutoVector<Value>;
- using AutoObjectVector = AutoVector<JSObject*>;
- 
- class CallArgs;
- 
--class JS_PUBLIC_API(CompileOptions);
--class JS_PUBLIC_API(ReadOnlyCompileOptions);
--class JS_PUBLIC_API(OwningCompileOptions);
--class JS_PUBLIC_API(TransitiveCompileOptions);
- class JS_PUBLIC_API(RealmOptions);
- 
- } // namespace JS
- 
- /* Result of typeof operator enumeration. */
- enum JSType {
-     JSTYPE_UNDEFINED,           /* undefined */
-     JSTYPE_OBJECT,              /* object */
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -74,16 +74,17 @@
- #include "gc/Zone.h"
- #include "jit/arm/Simulator-arm.h"
- #include "jit/InlinableNatives.h"
- #include "jit/Ion.h"
- #include "jit/JitcodeMap.h"
- #include "jit/JitRealm.h"
- #include "jit/shared/CodeGenerator-shared.h"
- #include "js/AutoByteString.h"
-+#include "js/CompileOptions.h"
- #include "js/Debug.h"
- #include "js/GCVector.h"
- #include "js/Initialization.h"
- #include "js/JSON.h"
- #include "js/Printf.h"
- #include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/StructuredClone.h"
-@@ -127,16 +128,17 @@
- #include "vm/Realm-inl.h"
- #include "vm/Stack-inl.h"
- 
- using namespace js;
- using namespace js::cli;
- using namespace js::shell;
- 
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
- 
- using js::shell::RCFile;
- 
- using mozilla::ArrayEqual;
- using mozilla::ArrayLength;
- using mozilla::Atomic;
- using mozilla::MakeScopeExit;
- using mozilla::Maybe;
-diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
---- a/js/src/vm/Debugger.cpp
-+++ b/js/src/vm/Debugger.cpp
-@@ -54,16 +54,17 @@
- #include "vm/JSObject-inl.h"
- #include "vm/JSScript-inl.h"
- #include "vm/NativeObject-inl.h"
- #include "vm/Stack-inl.h"
- 
- using namespace js;
- 
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
- using JS::dbg::AutoEntryMonitor;
- using JS::dbg::Builder;
- using js::frontend::IsIdentifier;
- using JS::SourceBufferHolder;
- using mozilla::DebugOnly;
- using mozilla::MakeScopeExit;
- using mozilla::Maybe;
- using mozilla::Some;
-diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp
---- a/js/src/vm/HelperThreads.cpp
-+++ b/js/src/vm/HelperThreads.cpp
-@@ -35,16 +35,19 @@
- 
- using namespace js;
- 
- using mozilla::Maybe;
- using mozilla::Unused;
- using mozilla::TimeDuration;
- using mozilla::TimeStamp;
- 
-+using JS::CompileOptions;
-+using JS::ReadOnlyCompileOptions;
-+
- namespace js {
- 
- GlobalHelperThreadState* gHelperThreadState = nullptr;
- 
- } // namespace js
- 
- // These macros are identical in function to the same-named ones in
- // GeckoProfiler.h, but they are defined separately because SpiderMonkey can't
-diff --git a/js/src/vm/HelperThreads.h b/js/src/vm/HelperThreads.h
---- a/js/src/vm/HelperThreads.h
-+++ b/js/src/vm/HelperThreads.h
-@@ -19,16 +19,17 @@
- #include "mozilla/TimeStamp.h"
- #include "mozilla/TypeTraits.h"
- #include "mozilla/Variant.h"
- 
- #include "jsapi.h"
- 
- #include "ds/Fifo.h"
- #include "jit/Ion.h"
-+#include "js/CompileOptions.h"
- #include "js/SourceBufferHolder.h"
- #include "js/TypeDecls.h"
- #include "threading/ConditionVariable.h"
- #include "vm/JSContext.h"
- #include "vm/MutexIDs.h"
- 
- namespace JS {
- class OffThreadToken {};
-@@ -599,41 +600,41 @@ HasOffThreadIonCompile(JS::Realm* realm)
- void
- CancelOffThreadParses(JSRuntime* runtime);
- 
- /*
-  * Start a parse/emit cycle for a stream of source. The characters must stay
-  * alive until the compilation finishes.
-  */
- bool
--StartOffThreadParseScript(JSContext* cx, const ReadOnlyCompileOptions& options,
-+StartOffThreadParseScript(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                           JS::SourceBufferHolder& srcBuf,
-                           JS::OffThreadCompileCallback callback, void* callbackData);
- 
- bool
--StartOffThreadParseModule(JSContext* cx, const ReadOnlyCompileOptions& options,
-+StartOffThreadParseModule(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                           JS::SourceBufferHolder& srcBuf,
-                           JS::OffThreadCompileCallback callback, void* callbackData);
- 
- bool
--StartOffThreadDecodeScript(JSContext* cx, const ReadOnlyCompileOptions& options,
-+StartOffThreadDecodeScript(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                            const JS::TranscodeRange& range,
-                            JS::OffThreadCompileCallback callback, void* callbackData);
- 
- #if defined(JS_BUILD_BINAST)
- 
- bool
--StartOffThreadDecodeBinAST(JSContext* cx, const ReadOnlyCompileOptions& options,
-+StartOffThreadDecodeBinAST(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                            const uint8_t* buf, size_t length,
-                            JS::OffThreadCompileCallback callback, void* callbackData);
- 
- #endif /* JS_BUILD_BINAST */
- 
- bool
--StartOffThreadDecodeMultiScripts(JSContext* cx, const ReadOnlyCompileOptions& options,
-+StartOffThreadDecodeMultiScripts(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
-                                  JS::TranscodeSources& sources,
-                                  JS::OffThreadCompileCallback callback, void* callbackData);
- 
- /*
-  * Called at the end of GC to enqueue any Parse tasks that were waiting on an
-  * atoms-zone GC to finish.
-  */
- void
-@@ -682,17 +683,17 @@ class MOZ_RAII AutoUnlockHelperThreadSta
-     {
-         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-     }
- };
- 
- struct ParseTask : public mozilla::LinkedListElement<ParseTask>, public JS::OffThreadToken
- {
-     ParseTaskKind kind;
--    OwningCompileOptions options;
-+    JS::OwningCompileOptions options;
- 
-     LifoAlloc alloc;
- 
-     // The global object to use while parsing.
-     JSObject* parseGlobal;
- 
-     // Callback invoked off thread when the parse finishes.
-     JS::OffThreadCompileCallback callback;
-@@ -711,17 +712,17 @@ struct ParseTask : public mozilla::Linke
-     Vector<UniquePtr<CompileError>, 0, SystemAllocPolicy> errors;
-     bool overRecursed;
-     bool outOfMemory;
- 
-     ParseTask(ParseTaskKind kind, JSContext* cx,
-               JS::OffThreadCompileCallback callback, void* callbackData);
-     virtual ~ParseTask();
- 
--    bool init(JSContext* cx, const ReadOnlyCompileOptions& options, JSObject* global);
-+    bool init(JSContext* cx, const JS::ReadOnlyCompileOptions& options, JSObject* global);
- 
-     void activate(JSRuntime* rt);
-     virtual void parse(JSContext* cx) = 0;
-     bool finish(JSContext* cx);
- 
-     bool runtimeMatches(JSRuntime* rt) {
-         return parseGlobal->runtimeFromAnyThread() == rt;
-     }
-diff --git a/js/src/vm/JSFunction.cpp b/js/src/vm/JSFunction.cpp
---- a/js/src/vm/JSFunction.cpp
-+++ b/js/src/vm/JSFunction.cpp
-@@ -28,17 +28,19 @@
- #include "frontend/BytecodeCompiler.h"
- #include "frontend/TokenStream.h"
- #include "gc/Marking.h"
- #include "gc/Policy.h"
- #include "jit/InlinableNatives.h"
- #include "jit/Ion.h"
- #include "js/AutoByteString.h"
- #include "js/CallNonGenericMethod.h"
-+#include "js/CompileOptions.h"
- #include "js/Proxy.h"
-+
- #include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "vm/AsyncFunction.h"
- #include "vm/AsyncIteration.h"
- #include "vm/Debugger.h"
- #include "vm/GlobalObject.h"
-@@ -63,16 +65,17 @@ using namespace js::gc;
- using namespace js::frontend;
- 
- using mozilla::ArrayLength;
- using mozilla::CheckedInt;
- using mozilla::Maybe;
- using mozilla::Some;
- 
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
- using JS::SourceBufferHolder;
- 
- static bool
- fun_enumerate(JSContext* cx, HandleObject obj)
- {
-     MOZ_ASSERT(obj->is<JSFunction>());
- 
-     RootedId id(cx);
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -31,16 +31,17 @@
- #include "frontend/BytecodeCompiler.h"
- #include "frontend/BytecodeEmitter.h"
- #include "frontend/SharedContext.h"
- #include "gc/FreeOp.h"
- #include "jit/BaselineJIT.h"
- #include "jit/Ion.h"
- #include "jit/IonCode.h"
- #include "jit/JitRealm.h"
-+#include "js/CompileOptions.h"
- #include "js/MemoryMetrics.h"
- #include "js/Printf.h"
- #include "js/SourceBufferHolder.h"
- #include "js/UniquePtr.h"
- #include "js/Utility.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "util/Text.h"
-@@ -70,16 +71,18 @@
- 
- using namespace js;
- using namespace js::gc;
- using namespace js::frontend;
- 
- using mozilla::Maybe;
- using mozilla::PodCopy;
- 
-+using JS::CompileOptions;
-+using JS::ReadOnlyCompileOptions;
- using JS::SourceBufferHolder;
- 
- template<XDRMode mode>
- XDRResult
- js::XDRScriptConst(XDRState<mode>* xdr, MutableHandleValue vp)
- {
-     JSContext* cx = xdr->cx();
- 
-diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h
---- a/js/src/vm/JSScript.h
-+++ b/js/src/vm/JSScript.h
-@@ -16,16 +16,17 @@
- #include "mozilla/Variant.h"
- 
- #include "jstypes.h"
- 
- #include "frontend/NameAnalysisTypes.h"
- #include "gc/Barrier.h"
- #include "gc/Rooting.h"
- #include "jit/IonCode.h"
-+#include "js/CompileOptions.h"
- #include "js/UbiNode.h"
- #include "js/UniquePtr.h"
- #include "vm/BytecodeUtil.h"
- #include "vm/JSAtom.h"
- #include "vm/NativeObject.h"
- #include "vm/Scope.h"
- #include "vm/Shape.h"
- #include "vm/SharedImmutableStringsCache.h"
-@@ -539,17 +540,17 @@ class ScriptSource
- 
-     void incref() { refs++; }
-     void decref() {
-         MOZ_ASSERT(refs != 0);
-         if (--refs == 0)
-             js_delete(this);
-     }
-     MOZ_MUST_USE bool initFromOptions(JSContext* cx,
--                                      const ReadOnlyCompileOptions& options,
-+                                      const JS::ReadOnlyCompileOptions& options,
-                                       const mozilla::Maybe<uint32_t>& parameterListEnd = mozilla::Nothing());
-     MOZ_MUST_USE bool setSourceCopy(JSContext* cx, JS::SourceBufferHolder& srcBuf);
-     void setSourceRetrievable() { sourceRetrievable_ = true; }
-     bool sourceRetrievable() const { return sourceRetrievable_; }
-     bool hasSourceData() const { return !data.is<Missing>(); }
-     bool hasUncompressedSource() const { return data.is<Uncompressed>(); }
-     bool hasCompressedSource() const { return data.is<Compressed>(); }
- 
-@@ -726,17 +727,17 @@ class ScriptSourceObject : public Native
- 
-     static void trace(JSTracer* trc, JSObject* obj);
-     static void finalize(FreeOp* fop, JSObject* obj);
-     static ScriptSourceObject* create(JSContext* cx, ScriptSource* source);
- 
-     // Initialize those properties of this ScriptSourceObject whose values
-     // are provided by |options|, re-wrapping as necessary.
-     static bool initFromOptions(JSContext* cx, HandleScriptSourceObject source,
--                                const ReadOnlyCompileOptions& options);
-+                                const JS::ReadOnlyCompileOptions& options);
- 
-     static bool initElementProperties(JSContext* cx, HandleScriptSourceObject source,
-                                       HandleObject element, HandleString elementAttrName);
- 
-     ScriptSource* source() const {
-         return static_cast<ScriptSource*>(getReservedSlot(SOURCE_SLOT).toPrivate());
-     }
-     JSObject* element() const {
-diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
---- a/js/src/vm/RegExpObject.cpp
-+++ b/js/src/vm/RegExpObject.cpp
-@@ -39,16 +39,17 @@
- 
- using namespace js;
- 
- using mozilla::ArrayLength;
- using mozilla::DebugOnly;
- using mozilla::PodCopy;
- using JS::AutoStableStringChars;
- using js::frontend::TokenStream;
-+using JS::CompileOptions;
- 
- using JS::AutoCheckCannotGC;
- 
- JS_STATIC_ASSERT(IgnoreCaseFlag == JSREG_FOLD);
- JS_STATIC_ASSERT(GlobalFlag == JSREG_GLOB);
- JS_STATIC_ASSERT(MultilineFlag == JSREG_MULTILINE);
- JS_STATIC_ASSERT(StickyFlag == JSREG_STICKY);
- JS_STATIC_ASSERT(UnicodeFlag == JSREG_UNICODE);
-diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp
---- a/js/src/vm/SelfHosting.cpp
-+++ b/js/src/vm/SelfHosting.cpp
-@@ -68,16 +68,17 @@
- #include "vm/NumberObject-inl.h"
- #include "vm/StringObject-inl.h"
- 
- using namespace js;
- using namespace js::selfhosted;
- 
- using JS::AutoCheckCannotGC;
- using JS::AutoStableStringChars;
-+using JS::CompileOptions;
- using mozilla::IsInRange;
- using mozilla::Maybe;
- 
- static void
- selfHosting_WarningReporter(JSContext* cx, JSErrorReport* report)
- {
-     MOZ_ASSERT(report);
-     MOZ_ASSERT(JSREPORT_IS_WARNING(report->flags));
-diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h
---- a/js/src/vm/Xdr.h
-+++ b/js/src/vm/Xdr.h
-@@ -9,16 +9,17 @@
- 
- #include "mozilla/EndianUtils.h"
- #include "mozilla/TypeTraits.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
- #include "NamespaceImports.h"
- 
-+#include "js/CompileOptions.h"
- #include "js/Transcoding.h"
- #include "js/TypeDecls.h"
- #include "vm/JSAtom.h"
- 
- namespace js {
- 
- class LifoAlloc;
- 
-@@ -249,17 +250,17 @@ class XDRState : public XDRCoderBase
-     virtual ~XDRState() {};
- 
-     JSContext* cx() const {
-         return buf.cx();
-     }
-     virtual LifoAlloc& lifoAlloc() const;
- 
-     virtual bool hasOptions() const { return false; }
--    virtual const ReadOnlyCompileOptions& options() {
-+    virtual const JS::ReadOnlyCompileOptions& options() {
-         MOZ_CRASH("does not have options");
-     }
-     virtual bool hasScriptSourceObjectOut() const { return false; }
-     virtual ScriptSourceObject** scriptSourceObjectOut() {
-         MOZ_CRASH("does not have scriptSourceObjectOut.");
-     }
- 
-     XDRResult fail(JS::TranscodeResult code) {
-@@ -472,31 +473,31 @@ class XDRState : public XDRCoderBase
-     XDRResult codeScript(MutableHandleScript scriptp);
- };
- 
- using XDREncoder = XDRState<XDR_ENCODE>;
- using XDRDecoder = XDRState<XDR_DECODE>;
- 
- class XDROffThreadDecoder : public XDRDecoder
- {
--    const ReadOnlyCompileOptions* options_;
-+    const JS::ReadOnlyCompileOptions* options_;
-     ScriptSourceObject** sourceObjectOut_;
-     LifoAlloc& alloc_;
- 
-   public:
-     // Note, when providing an JSContext, where isJSContext is false,
-     // then the initialization of the ScriptSourceObject would remain
-     // incomplete. Thus, the sourceObjectOut must be used to finish the
-     // initialization with ScriptSourceObject::initFromOptions after the
-     // decoding.
-     //
-     // When providing a sourceObjectOut pointer, you have to ensure that it is
-     // marked by the GC to avoid dangling pointers.
-     XDROffThreadDecoder(JSContext* cx, LifoAlloc& alloc,
--                        const ReadOnlyCompileOptions* options,
-+                        const JS::ReadOnlyCompileOptions* options,
-                         ScriptSourceObject** sourceObjectOut,
-                         const JS::TranscodeRange& range)
-       : XDRDecoder(cx, range),
-         options_(options),
-         sourceObjectOut_(sourceObjectOut),
-         alloc_(alloc)
-     {
-         MOZ_ASSERT(options);
-@@ -504,17 +505,17 @@ class XDROffThreadDecoder : public XDRDe
-         MOZ_ASSERT(*sourceObjectOut == nullptr);
-     }
- 
-     LifoAlloc& lifoAlloc() const override {
-         return alloc_;
-     }
- 
-     bool hasOptions() const override { return true; }
--    const ReadOnlyCompileOptions& options() override {
-+    const JS::ReadOnlyCompileOptions& options() override {
-         return *options_;
-     }
-     bool hasScriptSourceObjectOut() const override { return true; }
-     ScriptSourceObject** scriptSourceObjectOut() override {
-         return sourceObjectOut_;
-     }
- };
- 
-diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
---- a/js/src/wasm/AsmJS.cpp
-+++ b/js/src/wasm/AsmJS.cpp
-@@ -6150,17 +6150,17 @@ HandleInstantiationFailure(JSContext* cx
-         return false;
- 
-     RootedFunction fun(cx, NewScriptedFunction(cx, 0, JSFunction::INTERPRETED_NORMAL,
-                                                name, /* proto = */ nullptr, gc::AllocKind::FUNCTION,
-                                                TenuredObject));
-     if (!fun)
-         return false;
- 
--    CompileOptions options(cx);
-+    JS::CompileOptions options(cx);
-     options.setMutedErrors(source->mutedErrors())
-            .setFile(source->filename())
-            .setNoScriptRval(false);
-     options.asmJSOption = AsmJSOption::Disabled;
- 
-     // The exported function inherits an implicit strict context if the module
-     // also inherited it somehow.
-     if (metadata.strict)

+ 0 - 875
frg/work-js/mozilla-release/patches/mozilla-central-push_433719.patch

@@ -1,875 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535169109 18000
-#      Fri Aug 24 22:51:49 2018 -0500
-# Node ID 48921866b394212e0dddd0ba72c183081bc6805f
-# Parent  1fb7ddfad86d5e085c4f2af23a2519d37e45a3e4
-Bug 1486577 - Don't #include "js/CompilationAndEvaluation.h" in jsapi.h, minimizing the scope of that header and reducing translation-unit size of anything that needs JSAPI but doesn't need to compile/evaluate JavaScript.  r=jandem
-
-diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp
---- a/dom/base/nsFrameMessageManager.cpp
-+++ b/dom/base/nsFrameMessageManager.cpp
-@@ -24,16 +24,17 @@
- #include "nsIInputStream.h"
- #include "nsIXULRuntime.h"
- #include "nsIScriptError.h"
- #include "nsIConsoleService.h"
- #include "nsIMemoryReporter.h"
- #include "nsIProtocolHandler.h"
- #include "nsIScriptSecurityManager.h"
- #include "xpcpublic.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/JSON.h"
- #include "js/SourceBufferHolder.h"
- #include "mozilla/ClearOnShutdown.h"
- #include "mozilla/CycleCollectedJSContext.h"
- #include "mozilla/Preferences.h"
- #include "mozilla/ScriptPreloader.h"
- #include "mozilla/Telemetry.h"
- #include "mozilla/dom/ChildProcessMessageManager.h"
-diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp
---- a/dom/base/nsJSUtils.cpp
-+++ b/dom/base/nsJSUtils.cpp
-@@ -9,16 +9,18 @@
-  * invoked from the JavaScript code generated from IDL interfaces.
-  * The goal of the utility functions is to cut down on the size of
-  * the generated code itself.
-  */
- 
- #include "nsJSUtils.h"
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
-+#include "js/OffThreadScriptCompilation.h"
- #include "js/SourceBufferHolder.h"
- #include "nsIScriptContext.h"
- #include "nsIScriptElement.h"
- #include "nsIScriptGlobalObject.h"
- #include "nsIXPConnect.h"
- #include "nsCOMPtr.h"
- #include "nsIScriptSecurityManager.h"
- #include "nsPIDOMWindow.h"
-diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
---- a/dom/script/ScriptLoader.cpp
-+++ b/dom/script/ScriptLoader.cpp
-@@ -9,16 +9,18 @@
- #include "ScriptLoadRequest.h"
- #include "ScriptTrace.h"
- #include "ModuleLoadRequest.h"
- #include "ModuleScript.h"
- 
- #include "prsystem.h"
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
-+#include "js/OffThreadScriptCompilation.h"
- #include "js/SourceBufferHolder.h"
- #include "js/Utility.h"
- #include "xpcpublic.h"
- #include "nsCycleCollectionParticipant.h"
- #include "nsIContent.h"
- #include "nsJSUtils.h"
- #include "mozilla/dom/DocGroup.h"
- #include "mozilla/dom/Element.h"
-diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp
---- a/dom/workers/ScriptLoader.cpp
-+++ b/dom/workers/ScriptLoader.cpp
-@@ -20,16 +20,17 @@
- #include "nsIScriptSecurityManager.h"
- #include "nsIStreamLoader.h"
- #include "nsIStreamListenerTee.h"
- #include "nsIThreadRetargetableRequest.h"
- #include "nsIURI.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "nsError.h"
- #include "nsContentPolicyUtils.h"
- #include "nsContentUtils.h"
- #include "nsDocShellCID.h"
- #include "nsISupportsPrimitives.h"
- #include "nsNetUtil.h"
- #include "nsIPipe.h"
-diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
---- a/dom/workers/WorkerPrivate.cpp
-+++ b/dom/workers/WorkerPrivate.cpp
-@@ -1,16 +1,17 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "WorkerPrivate.h"
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "js/LocaleSensitive.h"
- #include "js/MemoryMetrics.h"
- #include "js/SourceBufferHolder.h"
- #include "MessageEventRunnable.h"
- #include "mozilla/ScopeExit.h"
- #include "mozilla/StaticPrefs.h"
- #include "mozilla/dom/BlobURLProtocolHandler.h"
- #include "mozilla/dom/ClientManager.h"
-diff --git a/dom/worklet/Worklet.cpp b/dom/worklet/Worklet.cpp
---- a/dom/worklet/Worklet.cpp
-+++ b/dom/worklet/Worklet.cpp
-@@ -14,16 +14,17 @@
- #include "mozilla/dom/BlobBinding.h"
- #include "mozilla/dom/DOMPrefs.h"
- #include "mozilla/dom/Fetch.h"
- #include "mozilla/dom/PromiseNativeHandler.h"
- #include "mozilla/dom/RegisterWorkletBindings.h"
- #include "mozilla/dom/Response.h"
- #include "mozilla/dom/ScriptSettings.h"
- #include "mozilla/dom/ScriptLoader.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "nsIInputStreamPump.h"
- #include "nsIThreadRetargetableRequest.h"
- #include "nsNetUtil.h"
- #include "xpcprivate.h"
- 
- namespace mozilla {
- namespace dom {
-diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp
---- a/dom/xul/XULDocument.cpp
-+++ b/dom/xul/XULDocument.cpp
-@@ -81,16 +81,17 @@
- #include "mozilla/dom/ProcessingInstruction.h"
- #include "mozilla/dom/ScriptSettings.h"
- #include "mozilla/dom/XULDocumentBinding.h"
- #include "mozilla/EventDispatcher.h"
- #include "mozilla/LoadInfo.h"
- #include "mozilla/Preferences.h"
- #include "nsTextNode.h"
- #include "nsJSUtils.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "mozilla/dom/URL.h"
- #include "nsIContentPolicy.h"
- #include "mozAutoDocUpdate.h"
- #include "xpcpublic.h"
- #include "mozilla/StyleSheet.h"
- #include "mozilla/StyleSheetInlines.h"
- #include "nsIConsoleService.h"
-diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp
---- a/dom/xul/nsXULElement.cpp
-+++ b/dom/xul/nsXULElement.cpp
-@@ -13,16 +13,17 @@
- #include "nsIDOMXULCommandDispatcher.h"
- #include "nsIDOMXULSelectCntrlItemEl.h"
- #include "nsIDocument.h"
- #include "mozilla/ClearOnShutdown.h"
- #include "mozilla/EventListenerManager.h"
- #include "mozilla/EventStateManager.h"
- #include "mozilla/EventStates.h"
- #include "mozilla/DeclarationBlock.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "nsFocusManager.h"
- #include "nsHTMLStyleSheet.h"
- #include "nsNameSpaceManager.h"
- #include "nsIObjectInputStream.h"
- #include "nsIObjectOutputStream.h"
- #include "nsIPresShell.h"
- #include "nsIPrincipal.h"
-diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp
---- a/ipc/testshell/XPCShellEnvironment.cpp
-+++ b/ipc/testshell/XPCShellEnvironment.cpp
-@@ -12,16 +12,17 @@
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>     /* for isatty() */
- #endif
- 
- #include "base/basictypes.h"
- 
- #include "jsapi.h"
- #include "js/AutoByteString.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- 
- #include "xpcpublic.h"
- 
- #include "XPCShellEnvironment.h"
- 
- #include "mozilla/XPCOM.h"
- 
-diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
---- a/js/src/builtin/TestingFunctions.cpp
-+++ b/js/src/builtin/TestingFunctions.cpp
-@@ -37,16 +37,17 @@
- #include "irregexp/RegExpEngine.h"
- #include "irregexp/RegExpParser.h"
- #endif
- #include "gc/Heap.h"
- #include "jit/BaselineJIT.h"
- #include "jit/InlinableNatives.h"
- #include "jit/JitRealm.h"
- #include "js/AutoByteString.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/CompileOptions.h"
- #include "js/Debug.h"
- #include "js/HashTable.h"
- #include "js/LocaleSensitive.h"
- #include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
- #include "js/StructuredClone.h"
- #include "js/UbiNode.h"
-diff --git a/js/src/gdb/tests/test-asmjs.cpp b/js/src/gdb/tests/test-asmjs.cpp
---- a/js/src/gdb/tests/test-asmjs.cpp
-+++ b/js/src/gdb/tests/test-asmjs.cpp
-@@ -1,10 +1,14 @@
- #include "gdb-tests.h"
- #include "jsapi.h"
-+#include "js/CompilationAndEvaluation.h"
-+#include "js/CompileOptions.h"
-+#include "js/RootingAPI.h"
-+#include "js/Value.h"
- 
- #include <string.h>
- 
- FRAGMENT(asmjs, segfault) {
-     using namespace JS;
- 
-     int line0 = __LINE__;
-     const char* bytes = "\n"
-@@ -20,17 +24,17 @@ FRAGMENT(asmjs, segfault) {
-         "\n"
-         "var func = f(this, null, new ArrayBuffer(0x10000));\n"
-         "func(0x10000 << 2);\n"
-         "'ok'\n";
- 
-     CompileOptions opts(cx);
-     opts.setFileAndLine(__FILE__, line0 + 1);
-     opts.asmJSOption = JS::AsmJSOption::Enabled;
--    RootedValue rval(cx);
-+    Rooted<Value> rval(cx);
-     bool ok;
-     ok = false;
- 
-     ok = Evaluate(cx, opts, bytes, strlen(bytes), &rval);
- 
-     breakpoint();
- 
-     use(ok);
-diff --git a/js/src/gdb/tests/test-unwind.cpp b/js/src/gdb/tests/test-unwind.cpp
---- a/js/src/gdb/tests/test-unwind.cpp
-+++ b/js/src/gdb/tests/test-unwind.cpp
-@@ -1,13 +1,14 @@
- #include "gdb-tests.h"
- #include "jsapi.h" // sundry symbols not moved to more-specific headers yet
- 
- #include "jit/JitOptions.h" // js::jit::JitOptions
- #include "js/CallArgs.h" // JS::CallArgs, JS::CallArgsFromVp
-+#include "js/CompilationAndEvaluation.h" // JS::Evaluate
- #include "js/CompileOptions.h" // JS::CompileOptions
- #include "js/RootingAPI.h" // JS::Rooted
- #include "js/Value.h" // JS::Value
- 
- #include <stdint.h> // uint32_t
- #include <string.h> // strlen
- 
- static bool
-diff --git a/js/src/jsapi-tests/testCallArgs.cpp b/js/src/jsapi-tests/testCallArgs.cpp
---- a/js/src/jsapi-tests/testCallArgs.cpp
-+++ b/js/src/jsapi-tests/testCallArgs.cpp
-@@ -1,12 +1,13 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- static bool
- CustomNative(JSContext* cx, unsigned argc, JS::Value* vp)
- {
-     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
- 
-     MOZ_RELEASE_ASSERT(!JS_IsExceptionPending(cx));
-diff --git a/js/src/jsapi-tests/testChromeBuffer.cpp b/js/src/jsapi-tests/testChromeBuffer.cpp
---- a/js/src/jsapi-tests/testChromeBuffer.cpp
-+++ b/js/src/jsapi-tests/testChromeBuffer.cpp
-@@ -1,14 +1,15 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- static TestJSPrincipals system_principals(1);
- 
- static const JSClassOps global_classOps = {
-     nullptr,
-     nullptr,
-     nullptr,
-diff --git a/js/src/jsapi-tests/testCloneScript.cpp b/js/src/jsapi-tests/testCloneScript.cpp
---- a/js/src/jsapi-tests/testCloneScript.cpp
-+++ b/js/src/jsapi-tests/testCloneScript.cpp
-@@ -8,16 +8,17 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- #include <string.h> // strlen
- 
- #include "jsapi.h" // sundry symbols not moved to more-specific headers yet
- #include "jsfriendapi.h"
- #include "jspubtd.h" // JS::AutoObjectVector
- 
-+#include "js/CompilationAndEvaluation.h" // JS::CompileFunction
- #include "js/CompileOptions.h" // JS::CompileOptions
- #include "js/RootingAPI.h" // JS::Rooted
- #include "js/TypeDecls.h" // JSFunction, JSObject
- #include "jsapi-tests/tests.h"
- 
- BEGIN_TEST(test_cloneScript)
- {
-     JS::RootedObject A(cx, createGlobal());
-diff --git a/js/src/jsapi-tests/testCompileNonSyntactic.cpp b/js/src/jsapi-tests/testCompileNonSyntactic.cpp
---- a/js/src/jsapi-tests/testCompileNonSyntactic.cpp
-+++ b/js/src/jsapi-tests/testCompileNonSyntactic.cpp
-@@ -1,13 +1,14 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "gc/GCInternals.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- #include "vm/Monitor.h"
- #include "vm/MutexIDs.h"
- 
- using namespace JS;
- using js::AutoLockMonitor;
- 
-diff --git a/js/src/jsapi-tests/testErrorLineOfContext.cpp b/js/src/jsapi-tests/testErrorLineOfContext.cpp
---- a/js/src/jsapi-tests/testErrorLineOfContext.cpp
-+++ b/js/src/jsapi-tests/testErrorLineOfContext.cpp
-@@ -1,13 +1,15 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsfriendapi.h"
-+
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- #include "vm/ErrorReporting.h"
- 
- BEGIN_TEST(testErrorLineOfContext)
- {
-     static const char16_t fullLineR[] = u"\n  var x = @;  \r  ";
-     CHECK(testLineOfContextHasNoLineTerminator(fullLineR, ' '));
-diff --git a/js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp b/js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp
---- a/js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp
-+++ b/js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp
-@@ -1,12 +1,13 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- #include "vm/EnvironmentObject.h"
- #include "vm/EnvironmentObject-inl.h"
- 
- 
- BEGIN_TEST(testExecuteInJSMEnvironment_Basic)
- {
-     static const char src[] =
-diff --git a/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp b/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp
---- a/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp
-+++ b/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp
-@@ -1,15 +1,16 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- static bool
- GlobalResolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* resolvedp)
- {
-     return JS_ResolveStandardClass(cx, obj, id, resolvedp);
- }
- 
-diff --git a/js/src/jsapi-tests/testFunctionBinding.cpp b/js/src/jsapi-tests/testFunctionBinding.cpp
---- a/js/src/jsapi-tests/testFunctionBinding.cpp
-+++ b/js/src/jsapi-tests/testFunctionBinding.cpp
-@@ -4,16 +4,17 @@
-  * Test function name binding.
-  */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsfriendapi.h"
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- using namespace js;
- 
- BEGIN_TEST(test_functionBinding)
- {
-     RootedFunction fun(cx);
- 
-diff --git a/js/src/jsapi-tests/testGCCellPtr.cpp b/js/src/jsapi-tests/testGCCellPtr.cpp
---- a/js/src/jsapi-tests/testGCCellPtr.cpp
-+++ b/js/src/jsapi-tests/testGCCellPtr.cpp
-@@ -4,17 +4,17 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsapi.h"
- #include "jspubtd.h"
- 
- #include "gc/Heap.h"
--
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- JS::GCCellPtr
- GivesAndTakesCells(JS::GCCellPtr cell)
- {
-     return cell;
- }
- 
-diff --git a/js/src/jsapi-tests/testGCOutOfMemory.cpp b/js/src/jsapi-tests/testGCOutOfMemory.cpp
---- a/js/src/jsapi-tests/testGCOutOfMemory.cpp
-+++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp
-@@ -1,16 +1,17 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  *
-  * Any copyright is dedicated to the Public Domain.
-  * http://creativecommons.org/licenses/publicdomain/
-  * Contributor: Igor Bukanov
-  */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- BEGIN_TEST(testGCOutOfMemory)
- {
-     JS::RootedValue root(cx);
- 
-     // Count the number of allocations until we hit OOM, and store it in 'max'.
-     static const char source[] =
-diff --git a/js/src/jsapi-tests/testJSEvaluateScript.cpp b/js/src/jsapi-tests/testJSEvaluateScript.cpp
---- a/js/src/jsapi-tests/testJSEvaluateScript.cpp
-+++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp
-@@ -1,12 +1,13 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- 
- using mozilla::ArrayLength;
- 
- BEGIN_TEST(testJSEvaluateScript)
- {
-     JS::RootedObject obj(cx, JS_NewPlainObject(cx));
-diff --git a/js/src/jsapi-tests/testMutedErrors.cpp b/js/src/jsapi-tests/testMutedErrors.cpp
---- a/js/src/jsapi-tests/testMutedErrors.cpp
-+++ b/js/src/jsapi-tests/testMutedErrors.cpp
-@@ -1,13 +1,14 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- 
- BEGIN_TEST(testMutedErrors)
- {
-     CHECK(testOuter("function f() {return 1}; f;"));
-     CHECK(testOuter("function outer() { return (function () {return 2}); }; outer();"));
-     CHECK(testOuter("eval('(function() {return 3})');"));
-diff --git a/js/src/jsapi-tests/testPreserveJitCode.cpp b/js/src/jsapi-tests/testPreserveJitCode.cpp
---- a/js/src/jsapi-tests/testPreserveJitCode.cpp
-+++ b/js/src/jsapi-tests/testPreserveJitCode.cpp
-@@ -1,15 +1,16 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- // For js::jit::IsIonEnabled().
- #include "jit/Ion.h"
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- #include "vm/JSObject-inl.h"
- 
- using namespace JS;
- 
- static void
- ScriptCallback(JSRuntime* rt, void* data, JSScript* script, const JS::AutoRequireNoGC& nogc)
-diff --git a/js/src/jsapi-tests/testPrivateGCThingValue.cpp b/js/src/jsapi-tests/testPrivateGCThingValue.cpp
---- a/js/src/jsapi-tests/testPrivateGCThingValue.cpp
-+++ b/js/src/jsapi-tests/testPrivateGCThingValue.cpp
-@@ -2,16 +2,17 @@
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsapi.h"
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "js/HeapAPI.h"
- #include "jsapi-tests/tests.h"
- 
- class TestTracer : public JS::CallbackTracer
- {
-     void onChild(const JS::GCCellPtr& thing) override {
-         if (thing.asCell() == expectedCell && thing.kind() == expectedKind)
-             found = true;
-diff --git a/js/src/jsapi-tests/testScriptInfo.cpp b/js/src/jsapi-tests/testScriptInfo.cpp
---- a/js/src/jsapi-tests/testScriptInfo.cpp
-+++ b/js/src/jsapi-tests/testScriptInfo.cpp
-@@ -2,16 +2,17 @@
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsapi.h"
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- 
- const char code[] =
-     "xx = 1;       \n\
-                    \n\
- try {              \n\
- 	 debugger; \n\
-                    \n\
-diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp
---- a/js/src/jsapi-tests/testScriptObject.cpp
-+++ b/js/src/jsapi-tests/testScriptObject.cpp
-@@ -1,15 +1,16 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "jsapi-tests/tests.h"
- 
- struct ScriptObjectFixture : public JSAPITest {
-     static const int code_size;
-     static const char code[];
-     static char16_t uc_code[];
- 
-diff --git a/js/src/jsapi-tests/testSourcePolicy.cpp b/js/src/jsapi-tests/testSourcePolicy.cpp
---- a/js/src/jsapi-tests/testSourcePolicy.cpp
-+++ b/js/src/jsapi-tests/testSourcePolicy.cpp
-@@ -1,12 +1,13 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "jsapi-tests/tests.h"
- #include "vm/JSScript.h"
- 
- BEGIN_TEST(testBug795104)
- {
-     JS::CompileOptions opts(cx);
-     JS::RealmBehaviorsRef(cx->realm()).setDiscardSource(true);
- 
-diff --git a/js/src/jsapi-tests/testUbiNode.cpp b/js/src/jsapi-tests/testUbiNode.cpp
---- a/js/src/jsapi-tests/testUbiNode.cpp
-+++ b/js/src/jsapi-tests/testUbiNode.cpp
-@@ -1,13 +1,14 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "builtin/TestingFunctions.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/UbiNode.h"
- #include "js/UbiNodeDominatorTree.h"
- #include "js/UbiNodePostOrder.h"
- #include "js/UbiNodeShortestPaths.h"
- #include "jsapi-tests/tests.h"
- #include "util/Text.h"
- #include "vm/Realm.h"
- #include "vm/SavedFrame.h"
-diff --git a/js/src/jsapi-tests/testXDR.cpp b/js/src/jsapi-tests/testXDR.cpp
---- a/js/src/jsapi-tests/testXDR.cpp
-+++ b/js/src/jsapi-tests/testXDR.cpp
-@@ -2,16 +2,18 @@
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsfriendapi.h"
- #include "builtin/String.h"
- 
-+#include "js/CompilationAndEvaluation.h"
-+#include "js/Transcoding.h"
- #include "jsapi-tests/tests.h"
- #include "vm/JSScript.h"
- 
- #include "vm/JSScript-inl.h"
- 
- static bool
- GetBuildId(JS::BuildIdCharVector* buildId)
- {
-diff --git a/js/src/jsapi-tests/tests.cpp b/js/src/jsapi-tests/tests.cpp
---- a/js/src/jsapi-tests/tests.cpp
-+++ b/js/src/jsapi-tests/tests.cpp
-@@ -3,16 +3,17 @@
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "jsapi-tests/tests.h"
- 
- #include <stdio.h>
- 
-+#include "js/CompilationAndEvaluation.h"
- #include "js/Initialization.h"
- #include "js/RootingAPI.h"
- 
- JSAPITest* JSAPITest::list;
- 
- bool JSAPITest::init()
- {
-     cx = createContext();
-diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
---- a/js/src/jsapi.cpp
-+++ b/js/src/jsapi.cpp
-@@ -52,16 +52,17 @@
- #include "gc/Marking.h"
- #include "gc/Policy.h"
- #include "gc/PublicIterators.h"
- #include "gc/WeakMap.h"
- #include "jit/JitCommon.h"
- #include "jit/JitSpewer.h"
- #include "js/AutoByteString.h"
- #include "js/CharacterEncoding.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/CompileOptions.h"
- #include "js/Conversions.h"
- #include "js/Date.h"
- #include "js/Initialization.h"
- #include "js/JSON.h"
- #include "js/LocaleSensitive.h"
- #include "js/Proxy.h"
- #include "js/SliceBudget.h"
-diff --git a/js/src/jsapi.h b/js/src/jsapi.h
---- a/js/src/jsapi.h
-+++ b/js/src/jsapi.h
-@@ -23,17 +23,16 @@
- #include <stdio.h>
- 
- #include "jspubtd.h"
- 
- #include "js/AllocPolicy.h"
- #include "js/CallArgs.h"
- #include "js/CharacterEncoding.h"
- #include "js/Class.h"
--#include "js/CompilationAndEvaluation.h"
- #include "js/CompileOptions.h"
- #include "js/ErrorReport.h"
- #include "js/GCVector.h"
- #include "js/HashTable.h"
- #include "js/Id.h"
- #include "js/MemoryFunctions.h"
- #include "js/OffThreadScriptCompilation.h"
- #include "js/Principals.h"
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -74,16 +74,17 @@
- #include "gc/Zone.h"
- #include "jit/arm/Simulator-arm.h"
- #include "jit/InlinableNatives.h"
- #include "jit/Ion.h"
- #include "jit/JitcodeMap.h"
- #include "jit/JitRealm.h"
- #include "jit/shared/CodeGenerator-shared.h"
- #include "js/AutoByteString.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/CompileOptions.h"
- #include "js/Debug.h"
- #include "js/GCVector.h"
- #include "js/Initialization.h"
- #include "js/JSON.h"
- #include "js/Printf.h"
- #include "js/SourceBufferHolder.h"
- #include "js/StableStringChars.h"
-diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp
---- a/js/src/vm/SelfHosting.cpp
-+++ b/js/src/vm/SelfHosting.cpp
-@@ -35,16 +35,17 @@
- #include "builtin/WeakMapObject.h"
- #include "gc/HashUtil.h"
- #include "gc/Marking.h"
- #include "gc/Policy.h"
- #include "jit/AtomicOperations.h"
- #include "jit/InlinableNatives.h"
- #include "js/AutoByteString.h"
- #include "js/CharacterEncoding.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/Date.h"
- #include "js/StableStringChars.h"
- #include "js/Wrapper.h"
- #include "util/StringBuffer.h"
- #include "vm/ArgumentsObject.h"
- #include "vm/Compression.h"
- #include "vm/GeneratorObject.h"
- #include "vm/Interpreter.h"
-diff --git a/js/xpconnect/loader/ChromeScriptLoader.cpp b/js/xpconnect/loader/ChromeScriptLoader.cpp
---- a/js/xpconnect/loader/ChromeScriptLoader.cpp
-+++ b/js/xpconnect/loader/ChromeScriptLoader.cpp
-@@ -8,16 +8,17 @@
- 
- #include "nsIURI.h"
- #include "nsIChannel.h"
- #include "nsNetUtil.h"
- #include "nsThreadUtils.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "js/Utility.h"
- 
- #include "mozilla/dom/ChromeUtils.h"
- #include "mozilla/dom/Promise.h"
- #include "mozilla/dom/ScriptLoader.h"
- #include "mozilla/HoldDropJSObjects.h"
- #include "mozilla/SystemGroup.h"
-diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp
---- a/js/xpconnect/loader/mozJSComponentLoader.cpp
-+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
-@@ -13,16 +13,17 @@
- #include <android/log.h>
- #endif
- #ifdef XP_WIN
- #include <windows.h>
- #endif
- 
- #include "jsapi.h"
- #include "js/AutoByteString.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/Printf.h"
- #include "nsCOMPtr.h"
- #include "nsAutoPtr.h"
- #include "nsExceptionHandler.h"
- #include "nsIComponentManager.h"
- #include "mozilla/Module.h"
- #include "nsIFile.h"
- #include "mozJSComponentLoader.h"
-diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
---- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
-+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
-@@ -14,16 +14,17 @@
- #include "nsIInputStream.h"
- #include "nsNetCID.h"
- #include "nsNetUtil.h"
- #include "nsIFileURL.h"
- 
- #include "jsapi.h"
- #include "jsfriendapi.h"
- #include "xpcprivate.h" // For xpc::OptionsBase
-+#include "js/CompilationAndEvaluation.h"
- #include "js/SourceBufferHolder.h"
- #include "js/Wrapper.h"
- 
- #include "mozilla/ContentPrincipal.h"
- #include "mozilla/dom/Promise.h"
- #include "mozilla/dom/ToJSValue.h"
- #include "mozilla/dom/ScriptLoader.h"
- #include "mozilla/HoldDropJSObjects.h"
-diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp
---- a/js/xpconnect/src/Sandbox.cpp
-+++ b/js/xpconnect/src/Sandbox.cpp
-@@ -6,16 +6,17 @@
- 
- /*
-  * The Components.Sandbox object.
-  */
- 
- #include "AccessCheck.h"
- #include "jsfriendapi.h"
- #include "js/AutoByteString.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/Proxy.h"
- #include "js/SourceBufferHolder.h"
- #include "js/StructuredClone.h"
- #include "nsContentUtils.h"
- #include "nsGlobalWindow.h"
- #include "nsIException.h" // for nsIStackFrame
- #include "nsIScriptContext.h"
- #include "nsIScriptObjectPrincipal.h"
-diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp
---- a/js/xpconnect/src/XPCShellImpl.cpp
-+++ b/js/xpconnect/src/XPCShellImpl.cpp
-@@ -3,16 +3,17 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "nsXULAppAPI.h"
- #include "jsapi.h"
- #include "jsfriendapi.h"
- #include "js/AutoByteString.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "js/Printf.h"
- #include "mozilla/ChaosMode.h"
- #include "mozilla/dom/ScriptSettings.h"
- #include "mozilla/Preferences.h"
- #include "nsServiceManagerUtils.h"
- #include "nsComponentManagerUtils.h"
- #include "nsExceptionHandler.h"
- #include "nsIServiceManager.h"
-diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp
---- a/netwerk/base/ProxyAutoConfig.cpp
-+++ b/netwerk/base/ProxyAutoConfig.cpp
-@@ -10,16 +10,17 @@
- #include "nsIDNSRecord.h"
- #include "nsIDNSService.h"
- #include "nsINamed.h"
- #include "nsThreadUtils.h"
- #include "nsIConsoleService.h"
- #include "nsIURLParser.h"
- #include "nsJSUtils.h"
- #include "jsfriendapi.h"
-+#include "js/CompilationAndEvaluation.h"
- #include "prnetdb.h"
- #include "nsITimer.h"
- #include "mozilla/net/DNS.h"
- #include "nsServiceManagerUtils.h"
- #include "nsNetCID.h"
- 
- namespace mozilla {
- namespace net {

+ 0 - 29
frg/work-js/mozilla-release/patches/mozilla-central-push_433996.patch

@@ -1,29 +0,0 @@
-# HG changeset patch
-# User Jeff Walden <jwalden@mit.edu>
-# Date 1535568074 18000
-#      Wed Aug 29 13:41:14 2018 -0500
-# Node ID 23b954ab9d4323c67d28e548940de8121986cce5
-# Parent  e8a440cca97f287d762b84f8c7b1fea7a770a108
-Bug 1486577 - Remove a spurious inclusion of js/CompileOptions.h from vm/TraceLogging.h, because the header doesn't need any *CompileOptions declaration or definition.  r=me as trivial, following up on a bustage fix that got merged into the landing for bug 1486731
-
-diff --git a/js/src/vm/TraceLogging.h b/js/src/vm/TraceLogging.h
---- a/js/src/vm/TraceLogging.h
-+++ b/js/src/vm/TraceLogging.h
-@@ -9,17 +9,16 @@
- 
- #include "mozilla/GuardObjects.h"
- #include "mozilla/LinkedList.h"
- #include "mozilla/MemoryReporting.h"
- 
- #include <utility>
- 
- #include "js/AllocPolicy.h"
--#include "js/CompileOptions.h"
- #include "js/HashTable.h"
- #include "js/TypeDecls.h"
- #include "js/Vector.h"
- #include "vm/MutexIDs.h"
- #include "vm/TraceLoggingGraph.h"
- #include "vm/TraceLoggingTypes.h"
- 
- namespace js {

+ 0 - 97
frg/work-js/mozilla-release/patches/mozilla-central-push_433997.patch

@@ -1,97 +0,0 @@
-# HG changeset patch
-# User Ashley Hauck <khyperia@mozilla.com>
-# Date 1535454420 -10800
-#      Tue Aug 28 14:07:00 2018 +0300
-# Node ID 432ffee537201b7225944a73ab538e2a228976f5
-# Parent  23b954ab9d4323c67d28e548940de8121986cce5
-Bug 1476921 - Don't throw an error in GetModuleNamespace for errored modules. r=jonco
-
-diff --git a/js/src/builtin/Module.js b/js/src/builtin/Module.js
---- a/js/src/builtin/Module.js
-+++ b/js/src/builtin/Module.js
-@@ -183,42 +183,37 @@ function IsResolvedBinding(resolution)
- }
- 
- // 15.2.1.18 GetModuleNamespace(module)
- function GetModuleNamespace(module)
- {
-     // Step 1
-     assert(IsObject(module) && IsModule(module), "GetModuleNamespace called with non-module");
- 
--    // Until issue https://github.com/tc39/ecma262/issues/1155 is resolved,
--    // violate the spec here and throw if called on an errored module.
--    if (module.status === MODULE_STATUS_EVALUATED_ERROR)
--        throw GetModuleEvaluationError(module);
--
--    // Steps 2-3
-+    // Step 2
-     assert(module.status !== MODULE_STATUS_UNINSTANTIATED,
-            "Bad module state in GetModuleNamespace");
- 
--    // Step 4
-+    // Step 3
-     let namespace = module.namespace;
- 
--    // Step 3
-+    // Step 4
-     if (typeof namespace === "undefined") {
-         let exportedNames = callFunction(module.getExportedNames, module);
-         let unambiguousNames = [];
-         for (let i = 0; i < exportedNames.length; i++) {
-             let name = exportedNames[i];
-             let resolution = callFunction(module.resolveExport, module, name);
-             if (IsResolvedBinding(resolution))
-                 _DefineDataProperty(unambiguousNames, unambiguousNames.length, name);
-         }
-         namespace = ModuleNamespaceCreate(module, unambiguousNames);
-     }
- 
--    // Step 4
-+    // Step 5
-     return namespace;
- }
- 
- // 9.4.6.13 ModuleNamespaceCreate(module, exports)
- function ModuleNamespaceCreate(module, exports)
- {
-     callFunction(ArraySort, exports);
- 
-diff --git a/js/src/jit-test/tests/modules/bug-1476921.js b/js/src/jit-test/tests/modules/bug-1476921.js
-new file mode 100644
---- /dev/null
-+++ b/js/src/jit-test/tests/modules/bug-1476921.js
-@@ -0,0 +1,19 @@
-+"use strict";
-+
-+load(libdir + "asserts.js");
-+load(libdir + "dummyModuleResolveHook.js");
-+
-+class UniqueError extends Error {}
-+
-+let a = moduleRepo['a'] = parseModule(`
-+    throw new UniqueError();
-+`);
-+
-+let b = moduleRepo['b'] = parseModule(`
-+    import * as ns0 from "a";
-+`);
-+
-+instantiateModule(a);
-+assertThrowsInstanceOf(() => evaluateModule(a), UniqueError);
-+instantiateModule(b);
-+assertThrowsInstanceOf(() => evaluateModule(b), UniqueError);
-diff --git a/js/src/jit-test/tests/modules/bug1449153.js b/js/src/jit-test/tests/modules/bug1449153.js
---- a/js/src/jit-test/tests/modules/bug1449153.js
-+++ b/js/src/jit-test/tests/modules/bug1449153.js
-@@ -27,9 +27,10 @@ let c = moduleRepo["c"] = parseModule(`
-     import "a";
- `);
- instantiateModule(c);
- assertThrowsMyError(() => evaluateModule(c));
- 
- let b = moduleRepo['b'] = parseModule(`
-     import * as ns0 from 'a'
- `);
--assertThrowsMyError(() => instantiateModule(b));
-+instantiateModule(b);
-+assertThrowsMyError(() => evaluateModule(b));

+ 0 - 323
frg/work-js/mozilla-release/patches/mozilla-central-push_434095.patch

@@ -1,323 +0,0 @@
-# HG changeset patch
-# User Myk Melez <myk@mykzilla.org>
-# Date 1535650194 0
-#      Thu Aug 30 17:29:54 2018 +0000
-# Node ID b9197ece79556d5e565bb5350383b75f1448f06c
-# Parent  7e58b028df95389c1994c268161a0c7ba6e7f957
-Bug 1482810 - set COMPILE_FLAGS var to hide warnings for Rust crates r=chmanchester
-
-In conjunction with the cc crate changes in https://github.com/alexcrichton/cc-rs/pull/342 (which I'll land in https://phabricator.services.mozilla.com/D4699), this hides warnings generated by C code in Rust crates (by removing warnings flags from CFLAGS when compiling Rust libraries).
-
-MozReview-Commit-ID: 9CZgLGbWjbA
-
-Differential Revision: https://phabricator.services.mozilla.com/D3939
-
-diff --git a/build/clang-plugin/tests/moz.build b/build/clang-plugin/tests/moz.build
---- a/build/clang-plugin/tests/moz.build
-+++ b/build/clang-plugin/tests/moz.build
-@@ -62,10 +62,14 @@ COMPILE_FLAGS['OS_CXXFLAGS'] = (
-     ['-fsyntax-only', '-Xclang', '-verify', '-ferror-limit=0', '-Wno-invalid-noreturn']
- )
- COMPILE_FLAGS['OS_CFLAGS'] = (
-     [f for f in COMPILE_FLAGS.get('OS_CFLAGS', []) if not f.startswith('-W')] +
-     ['-fsyntax-only', '-Xclang', '-verify', '-ferror-limit=0', '-std=c11',
-      '-Wno-invalid-noreturn']
- )
- 
-+# Don't reflect WARNINGS_CFLAGS into CFLAGS, as the warnings flags should be
-+# as specified in OS_CFLAGS above.
-+DisableCompilerWarnings()
-+
- if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
-     AllowCompilerWarnings()  # workaround for bug 1090497
-diff --git a/build/templates.mozbuild b/build/templates.mozbuild
---- a/build/templates.mozbuild
-+++ b/build/templates.mozbuild
-@@ -53,24 +53,33 @@ def Library(name):
-     '''Template for libraries.'''
-     LIBRARY_NAME = name
- 
- @template
- def AllowCompilerWarnings():
-     COMPILE_FLAGS['WARNINGS_AS_ERRORS'] = []
- 
- @template
-+def DisableCompilerWarnings():
-+    COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
-+
-+@template
- def RustLibrary(name, features=None, target_dir=None, output_category=None):
-     '''Template for Rust libraries.'''
-     Library(name)
- 
-     IS_RUST_LIBRARY = True
-     # Some Rust build scripts compile C/C++ sources, don't error on warnings for them.
-     AllowCompilerWarnings()
- 
-+    # And furthermore, don't even show warnings for them, so they don't regress
-+    # the Compiler Warnings build metric
-+    # <https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Automated_Performance_Testing_and_Sheriffing/Build_Metrics#compiler_warnings>.
-+    DisableCompilerWarnings()
-+
-     if features:
-         RUST_LIBRARY_FEATURES = features
- 
-     if target_dir:
-         RUST_LIBRARY_TARGET_DIR = target_dir
- 
-     if output_category:
-         RUST_LIBRARY_OUTPUT_CATEGORY = output_category
-diff --git a/config/rules.mk b/config/rules.mk
---- a/config/rules.mk
-+++ b/config/rules.mk
-@@ -900,48 +900,53 @@ rust_unlock_unstable =
- ifdef MOZ_RUST_SIMD
- rust_unlock_unstable += RUSTC_BOOTSTRAP=1
- endif
- 
- ifdef MOZ_USING_SCCACHE
- sccache_wrap := RUSTC_WRAPPER='$(CCACHE)'
- endif
- 
--ifneq (WINNT,$(HOST_OS_ARCH))
- ifndef MOZ_ASAN
- ifndef MOZ_TSAN
- ifndef MOZ_CODE_COVERAGE
- # Pass the compilers and flags in use to cargo for use in build scripts.
--# * Don't do this on Windows because msys path translation makes a mess of the paths, and
--#   we put MSVC in PATH there anyway.
- # * Don't do this for ASAN/TSAN builds because we don't pass our custom linker (see below)
- #   which will muck things up.
- # * Don't do this for code coverage builds because the way rustc invokes the linker doesn't
- #   work with GCC 6: https://bugzilla.mozilla.org/show_bug.cgi?id=1477305
- #
- # We don't pass HOST_{CC,CXX} down in any form because our host value might not match
- # what cargo chooses and there's no way to control cargo's selection, so we just have to
- # hope that if something needs to build a host C source file it can find a usable compiler!
- #
- # We're passing these for consumption by the `cc` crate, which doesn't use the same
- # convention as cargo itself:
- # https://github.com/alexcrichton/cc-rs/blob/baa71c0e298d9ad7ac30f0ad78f20b4b3b3a8fb2/src/lib.rs#L1715
- rust_cc_env_name := $(subst -,_,$(RUST_TARGET))
- 
-+ifeq (WINNT,$(HOST_OS_ARCH))
-+# Don't do most of this on Windows because msys path translation makes a mess of the paths, and
-+# we put MSVC in PATH there anyway.  But we do suppress warnings, since all such warnings
-+# are in third-party code.
-+cargo_c_compiler_envs := \
-+ CFLAGS_$(rust_cc_env_name)="-w" \
-+ $(NULL)
-+else
- cargo_c_compiler_envs := \
-  CC_$(rust_cc_env_name)="$(CC)" \
-  CXX_$(rust_cc_env_name)="$(CXX)" \
-  CFLAGS_$(rust_cc_env_name)="$(COMPUTED_CFLAGS)" \
-  CXXFLAGS_$(rust_cc_env_name)="$(COMPUTED_CXXFLAGS)" \
-  AR_$(rust_cc_env_name)="$(AR)" \
-  $(NULL)
-+endif # WINNT
- endif # MOZ_CODE_COVERAGE
- endif # MOZ_TSAN
- endif # MOZ_ASAN
--endif # WINNT
- 
- # We use the + prefix to pass down the jobserver fds to cargo, but we
- # don't use the prefix when make -n is used, so that cargo doesn't run
- # in that case)
- define RUN_CARGO
- $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleaner) $(rust_unlock_unstable) $(sccache_wrap) \
- 	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
- 	RUSTFLAGS='$(2)' \
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -418,18 +418,19 @@ dnl computed above.
- dnl ========================================================
- 
- MOZ_ANDROID_CPU_ARCH
- MOZ_ANDROID_STLPORT
- 
- dnl ========================================================
- dnl Suppress Clang Argument Warnings
- dnl ========================================================
-+WARNINGS_CFLAGS="$_WARNINGS_CFLAGS"
- if test -n "${CLANG_CC}${CLANG_CL}"; then
--    _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
-+    WARNINGS_CFLAGS="-Qunused-arguments $WARNINGS_CFLAGS"
-     CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
- fi
- if test -n "${CLANG_CXX}${CLANG_CL}"; then
-     _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
- fi
- 
- MOZ_CONFIG_SANITIZE
- 
-@@ -1751,16 +1752,17 @@ AC_SUBST_LIST(ASFLAGS)
- AC_SUBST(AS_DASH_C_FLAG)
- AC_SUBST(RC)
- AC_SUBST(RCFLAGS)
- AC_SUBST(WINDRES)
- AC_SUBST(IMPLIB)
- AC_SUBST(FILTER)
- AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
- AC_SUBST(WARNINGS_AS_ERRORS)
-+AC_SUBST_LIST(WARNINGS_CFLAGS)
- AC_SUBST(LIBICONV)
- 
- AC_SUBST(ENABLE_STRIP)
- AC_SUBST(PKG_SKIP_STRIP)
- AC_SUBST(INCREMENTAL_LINKER)
- 
- AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
- 
-@@ -1778,17 +1780,16 @@ dnl ====================================
- 
- dnl top-level configure may override this with --without-intl-api
- _INTL_API=yes
- 
- MOZ_CONFIG_ICU()
- 
- dnl Echo the CFLAGS to remove extra whitespace.
- CFLAGS=`echo \
--	$_WARNINGS_CFLAGS \
- 	$_COMPILATION_CFLAGS \
- 	$CFLAGS`
- 
- CXXFLAGS=`echo \
- 	$_WARNINGS_CXXFLAGS \
- 	$_COMPILATION_CXXFLAGS \
- 	$CXXFLAGS`
- 
-diff --git a/old-configure.in b/old-configure.in
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -472,18 +472,19 @@ dnl ====================================
- MOZ_ANDROID_CPU_ARCH
- if test "$COMPILE_ENVIRONMENT"; then
-     MOZ_ANDROID_STLPORT
- fi # COMPILE_ENVIRONMENT
- 
- dnl ========================================================
- dnl Suppress Clang Argument Warnings
- dnl ========================================================
-+WARNINGS_CFLAGS="$_WARNINGS_CFLAGS"
- if test -n "${CLANG_CC}${CLANG_CL}"; then
--    _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
-+    WARNINGS_CFLAGS="-Qunused-arguments $WARNINGS_CFLAGS"
-     CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
- fi
- if test -n "${CLANG_CXX}${CLANG_CL}"; then
-     _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
- fi
- 
- if test -n "$COMPILE_ENVIRONMENT"; then
-    MOZ_CONFIG_SANITIZE
-@@ -4102,16 +4103,17 @@ AC_SUBST(RC)
- AC_SUBST(RCFLAGS)
- AC_SUBST(WINDRES)
- AC_SUBST(IMPLIB)
- AC_SUBST(FILTER)
- AC_SUBST(MOZ_AUTH_EXTENSION)
- AC_SUBST(MOZ_PREF_EXTENSIONS)
- AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
- AC_SUBST(WARNINGS_AS_ERRORS)
-+AC_SUBST_LIST(WARNINGS_CFLAGS)
- AC_SUBST_SET(MOZ_EXTENSIONS)
- AC_SUBST(MOZ_TOOLKIT_SEARCH)
- AC_SUBST(MOZ_FEEDS)
- 
- AC_SUBST(MOZ_UNIVERSALCHARDET)
- AC_SUBST(ACCESSIBILITY)
- AC_SUBST(MOZ_SPELLCHECK)
- AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
-@@ -4370,17 +4372,16 @@ dnl ====================================
- if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
-     USE_ICU=1
- fi
- 
- MOZ_CONFIG_ICU()
- 
- dnl Echo the CFLAGS to remove extra whitespace.
- CFLAGS=`echo \
--    $_WARNINGS_CFLAGS \
-     $_COMPILATION_CFLAGS \
-     $CFLAGS`
- 
- CXXFLAGS=`echo \
-     $_WARNINGS_CXXFLAGS \
-     $_COMPILATION_CXXFLAGS \
-     $CXXFLAGS`
- 
-diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
---- a/python/mozbuild/mozbuild/frontend/context.py
-+++ b/python/mozbuild/mozbuild/frontend/context.py
-@@ -458,16 +458,18 @@ class CompileFlags(BaseCompileFlags):
-             ('CLANG_PLUGIN', context.config.substs.get('CLANG_PLUGIN_FLAGS'),
-              ('CFLAGS', 'CXXFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-             ('OPTIMIZE', self._optimize_flags(),
-              ('CFLAGS', 'CXXFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-             ('FRAMEPTR', context.config.substs.get('MOZ_FRAMEPTR_FLAGS'),
-              ('CFLAGS', 'CXXFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-             ('WARNINGS_AS_ERRORS', self._warnings_as_errors(),
-              ('CXXFLAGS', 'CFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-+            ('WARNINGS_CFLAGS', context.config.substs.get('WARNINGS_CFLAGS'),
-+             ('CFLAGS', 'C_LDFLAGS')),
-             ('MOZBUILD_CFLAGS', None, ('CFLAGS',)),
-             ('MOZBUILD_CXXFLAGS', None, ('CXXFLAGS',)),
-         )
- 
-         BaseCompileFlags.__init__(self, context)
- 
-     def _debug_flags(self):
-         if (self._context.config.substs.get('MOZ_DEBUG') or
-diff --git a/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/moz.build b/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/moz.build
-new file mode 100644
---- /dev/null
-+++ b/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/moz.build
-@@ -0,0 +1,17 @@
-+# Any copyright is dedicated to the Public Domain.
-+# http://creativecommons.org/publicdomain/zero/1.0/
-+
-+@template
-+def DisableCompilerWarnings():
-+    COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
-+
-+@template
-+def Library(name):
-+    '''Template for libraries.'''
-+    LIBRARY_NAME = name
-+
-+Library('dummy')
-+
-+UNIFIED_SOURCES += ['test1.c']
-+
-+DisableCompilerWarnings()
-diff --git a/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/test1.c b/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/test1.c
-new file mode 100644
-diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
---- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
-+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
-@@ -418,16 +418,23 @@ class TestEmitterBasic(unittest.TestCase
- 
-     def test_allow_compiler_warnings(self):
-         reader = self.reader('allow-compiler-warnings', extra_substs={
-             'WARNINGS_AS_ERRORS': '-Werror',
-         })
-         sources, ldflags, lib, flags = self.read_topsrcdir(reader)
-         self.assertEqual(flags.flags['WARNINGS_AS_ERRORS'], [])
- 
-+    def test_disable_compiler_warnings(self):
-+        reader = self.reader('disable-compiler-warnings', extra_substs={
-+            'WARNINGS_CFLAGS': '-Wall',
-+        })
-+        sources, ldflags, lib, flags = self.read_topsrcdir(reader)
-+        self.assertEqual(flags.flags['WARNINGS_CFLAGS'], [])
-+
-     def test_use_yasm(self):
-         # When yasm is not available, this should raise.
-         reader = self.reader('use-yasm')
-         with self.assertRaisesRegexp(SandboxValidationError,
-             'yasm is not available'):
-             self.read_topsrcdir(reader)
- 
-         # When yasm is available, this should work.

+ 0 - 57
frg/work-js/mozilla-release/patches/mozilla-central-push_434123.patch

@@ -1,57 +0,0 @@
-# HG changeset patch
-# User Jon Coppeard <jcoppeard@mozilla.com>
-# Date 1535654307 -3600
-#      Thu Aug 30 19:38:27 2018 +0100
-# Node ID d86165aa128f6a5093f6b3c5e2883e56c1a85367
-# Parent  d4c75554b3749be3c32971ab9a67873008c75bfd
-Bug 1485698 - Check for no module meta object during JIT analysis r=jandem
-
-diff --git a/js/src/jit-test/tests/modules/bug1485698.js b/js/src/jit-test/tests/modules/bug1485698.js
-new file mode 100644
---- /dev/null
-+++ b/js/src/jit-test/tests/modules/bug1485698.js
-@@ -0,0 +1,9 @@
-+let m = parseModule(`
-+  function f(x,y,z) {
-+    delete arguments[2];
-+    import.meta[2]
-+  }
-+  f(1,2,3)
-+`);
-+instantiateModule(m);
-+evaluateModule(m);
-diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
---- a/js/src/jit/IonBuilder.cpp
-+++ b/js/src/jit/IonBuilder.cpp
-@@ -13164,20 +13164,30 @@ IonBuilder::jsop_implicitthis(PropertyNa
-     current->push(implicitThis);
- 
-     return resumeAfter(implicitThis);
- }
- 
- AbortReasonOr<Ok>
- IonBuilder::jsop_importmeta()
- {
-+    if (info().analysisMode() == Analysis_ArgumentsUsage) {
-+        // The meta object may not have been created yet. Just push a dummy
-+        // value, it does not affect the arguments analysis.
-+        MUnknownValue* unknown = MUnknownValue::New(alloc());
-+        current->add(unknown);
-+        current->push(unknown);
-+        return Ok();
-+    }
-+
-     ModuleObject* module = GetModuleObjectForScript(script());
-     MOZ_ASSERT(module);
- 
--    // The object must have been created already when we compiled for baseline.
-+    // If we get there then the meta object must already have been created, at
-+    // the latest when we compiled for baseline.
-     JSObject* metaObject = module->metaObject();
-     MOZ_ASSERT(metaObject);
- 
-     pushConstant(ObjectValue(*metaObject));
- 
-     return Ok();
- }
- 

+ 0 - 1080
frg/work-js/mozilla-release/patches/mozilla-central-push_434126.patch

@@ -1,1080 +0,0 @@
-# HG changeset patch
-# User Jon Coppeard <jcoppeard@mozilla.com>
-# Date 1535656220 -3600
-#      Thu Aug 30 20:10:20 2018 +0100
-# Node ID 7d07908ee08acfa5333806b907bce7fb20c59dc1
-# Parent  21fc9db289024eaf15d00df5e4125fded2e15d04
-Bug 1486730 - Remove some unnecessary includes from js/src/frontend r=Waldo
-
-diff --git a/js/src/frontend/BinSource-macros.h b/js/src/frontend/BinSource-macros.h
---- a/js/src/frontend/BinSource-macros.h
-+++ b/js/src/frontend/BinSource-macros.h
-@@ -2,27 +2,27 @@
-  * vim: set ts=8 sts=4 et sw=4 tw=99:
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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 frontend_BinSource_macros_h
- #define frontend_BinSource_macros_h
- 
-+#include "vm/JSContext.h"
- 
- // Evaluate an expression EXPR, checking that the result is not falsy.
- //
- // Throw `cx->alreadyReportedError()` if it returns 0/nullptr.
- #define BINJS_TRY(EXPR) \
-     do { \
-         if (!EXPR) \
-             return cx_->alreadyReportedError(); \
-     } while(false)
- 
--
- // Evaluate an expression EXPR, checking that the result is not falsy.
- // In case of success, assign the result to VAR.
- //
- // Throw `cx->alreadyReportedError()` if it returns 0/nullptr.
- #define BINJS_TRY_VAR(VAR, EXPR) \
-     do { \
-         VAR = EXPR; \
-         if (!VAR) \
-diff --git a/js/src/frontend/BinSource.h b/js/src/frontend/BinSource.h
---- a/js/src/frontend/BinSource.h
-+++ b/js/src/frontend/BinSource.h
-@@ -70,26 +70,25 @@ class BinASTParserBase: private JS::Auto
-   protected:
-     LifoAlloc& alloc_;
-     ObjectBox* traceListHead_;
-     UsedNameTracker& usedNames_;
-   private:
-     LifoAlloc::Mark tempPoolMark_;
-     ParseNodeAllocator nodeAlloc_;
- 
-+    // ---- Parsing-related stuff
-+  protected:
-     // Root atoms and objects allocated for the parse tree.
-     AutoKeepAtoms keepAtoms_;
- 
--    // ---- Parsing-related stuff
--  protected:
-     ParseContext* parseContext_;
-     FullParseHandler factory_;
- 
-     friend class BinParseContext;
--
- };
- 
- /**
-  * The parser for a Binary AST.
-  *
-  * By design, this parser never needs to backtrack or look ahead. Errors are not
-  * recoverable.
-  */
-diff --git a/js/src/frontend/BinSourceRuntimeSupport.h b/js/src/frontend/BinSourceRuntimeSupport.h
---- a/js/src/frontend/BinSourceRuntimeSupport.h
-+++ b/js/src/frontend/BinSourceRuntimeSupport.h
-@@ -3,32 +3,30 @@
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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 frontend_BinSourceSupport_h
- #define frontend_BinSourceSupport_h
- 
- #include "mozilla/HashFunctions.h"
--#include "mozilla/Maybe.h"
--
--#include "jsapi.h"
- 
- #include "frontend/BinToken.h"
- 
-+#include "js/AllocPolicy.h"
- #include "js/HashTable.h"
- #include "js/Result.h"
- 
- namespace js {
- 
- // Support for parsing JS Binary ASTs.
- struct BinaryASTSupport {
--    using BinVariant  = js::frontend::BinVariant;
-+    using BinVariant = js::frontend::BinVariant;
-     using BinField = js::frontend::BinField;
--    using BinKind  = js::frontend::BinKind;
-+    using BinKind = js::frontend::BinKind;
- 
-     // A structure designed to perform fast char* + length lookup
-     // without copies.
-     struct CharSlice {
-         const char* start_;
-         uint32_t byteLen_;
-         CharSlice(const CharSlice& other)
-             : start_(other.start_)
-diff --git a/js/src/frontend/BinToken.cpp b/js/src/frontend/BinToken.cpp
---- a/js/src/frontend/BinToken.cpp
-+++ b/js/src/frontend/BinToken.cpp
-@@ -5,18 +5,16 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- #include "frontend/BinToken.h"
- 
- #include "mozilla/Maybe.h"
- 
- #include <sys/types.h>
- 
--#include "jsapi.h"
--
- #include "frontend/BinSourceRuntimeSupport.h"
- #include "frontend/TokenStream.h"
- #include "gc/Zone.h"
- #include "js/Result.h"
- 
- namespace js {
- namespace frontend {
- 
-diff --git a/js/src/frontend/BinTokenReaderBase.cpp b/js/src/frontend/BinTokenReaderBase.cpp
---- a/js/src/frontend/BinTokenReaderBase.cpp
-+++ b/js/src/frontend/BinTokenReaderBase.cpp
-@@ -59,16 +59,23 @@ ErrorResult<JS::Error&>
- BinTokenReaderBase::raiseInvalidField(const char* kind, const BinField field)
- {
-     Sprinter out(cx_);
-     BINJS_TRY(out.init());
-     BINJS_TRY(out.printf("In %s, invalid field '%s'", kind, describeBinField(field)));
-     return raiseError(out.string());
- }
- 
-+#ifdef DEBUG
-+bool
-+BinTokenReaderBase::hasRaisedError() const
-+{
-+    return cx_->isExceptionPending();
-+}
-+#endif
- 
- size_t
- BinTokenReaderBase::offset() const
- {
-     return current_ - start_;
- }
- 
- TokenPos
-diff --git a/js/src/frontend/BinTokenReaderBase.h b/js/src/frontend/BinTokenReaderBase.h
---- a/js/src/frontend/BinTokenReaderBase.h
-+++ b/js/src/frontend/BinTokenReaderBase.h
-@@ -119,33 +119,37 @@ class MOZ_STACK_CLASS BinTokenReaderBase
-      * @return true if `value` represents the next few chars in the
-      * internal buffer, false otherwise. If `true`, the chars are consumed,
-      * otherwise there is no side-effect.
-      */
-     template <size_t N>
-     MOZ_MUST_USE bool matchConst(const char (&value)[N], bool expectNul) {
-         MOZ_ASSERT(N > 0);
-         MOZ_ASSERT(value[N - 1] == 0);
--        MOZ_ASSERT(!cx_->isExceptionPending());
-+        MOZ_ASSERT(!hasRaisedError());
- 
-         if (current_ + N - 1 > stop_)
-             return false;
- 
-         // Perform lookup, without side-effects.
-         if (!std::equal(current_, current_ + N + (expectNul ? 0 : -1)/*implicit NUL*/, value))
-             return false;
- 
-         // Looks like we have a match. Now perform side-effects
-         current_ += N + (expectNul ? 0 : -1);
-         updateLatestKnownGood();
-         return true;
-     }
- 
-     void updateLatestKnownGood();
- 
-+#ifdef DEBUG
-+    bool hasRaisedError() const;
-+#endif
-+
-     JSContext* cx_;
- 
-     // `true` if we have encountered an error. Errors are non recoverable.
-     // Attempting to read from a poisoned tokenizer will cause assertion errors.
-     bool poisoned_;
- 
-     // The first byte of the buffer. Not owned.
-     const uint8_t* start_;
-diff --git a/js/src/frontend/BinTokenReaderMultipart.h b/js/src/frontend/BinTokenReaderMultipart.h
---- a/js/src/frontend/BinTokenReaderMultipart.h
-+++ b/js/src/frontend/BinTokenReaderMultipart.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 frontend_BinTokenReaderMultipart_h
- #define frontend_BinTokenReaderMultipart_h
- 
- #include "mozilla/Maybe.h"
- 
-+#include "frontend/BinSourceRuntimeSupport.h"
- #include "frontend/BinToken.h"
- #include "frontend/BinTokenReaderBase.h"
- 
- #include "js/Result.h"
- 
- namespace js {
- namespace frontend {
- 
-diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp
---- a/js/src/frontend/BytecodeCompiler.cpp
-+++ b/js/src/frontend/BytecodeCompiler.cpp
-@@ -21,18 +21,17 @@
- #include "vm/GlobalObject.h"
- #include "vm/JSContext.h"
- #include "vm/JSScript.h"
- #include "vm/TraceLogging.h"
- #include "wasm/AsmJS.h"
- 
- #include "vm/EnvironmentObject-inl.h"
- #include "vm/GeckoProfiler-inl.h"
--#include "vm/JSObject-inl.h"
--#include "vm/JSScript-inl.h"
-+#include "vm/JSContext-inl.h"
- 
- using namespace js;
- using namespace js::frontend;
- 
- using mozilla::Maybe;
- using mozilla::Nothing;
- 
- using JS::CompileOptions;
-diff --git a/js/src/frontend/BytecodeCompiler.h b/js/src/frontend/BytecodeCompiler.h
---- a/js/src/frontend/BytecodeCompiler.h
-+++ b/js/src/frontend/BytecodeCompiler.h
-@@ -8,17 +8,16 @@
- #define frontend_BytecodeCompiler_h
- 
- #include "mozilla/Maybe.h"
- 
- #include "NamespaceImports.h"
- 
- #include "js/CompileOptions.h"
- #include "vm/Scope.h"
--#include "vm/StringType.h"
- #include "vm/TraceLogging.h"
- 
- class JSLinearString;
- 
- namespace js {
- 
- class LazyScript;
- class LifoAlloc;
-diff --git a/js/src/frontend/BytecodeControlStructures.h b/js/src/frontend/BytecodeControlStructures.h
---- a/js/src/frontend/BytecodeControlStructures.h
-+++ b/js/src/frontend/BytecodeControlStructures.h
-@@ -14,17 +14,16 @@
- #include <stdint.h>
- 
- #include "ds/Nestable.h"
- #include "frontend/JumpList.h"
- #include "frontend/SharedContext.h"
- #include "frontend/TDZCheckCache.h"
- #include "gc/Rooting.h"
- #include "vm/BytecodeUtil.h"
--#include "vm/StringType.h"
- 
- namespace js {
- namespace frontend {
- 
- struct BytecodeEmitter;
- class EmitterScope;
- 
- class NestableControl : public Nestable<NestableControl>
-diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
---- a/js/src/frontend/BytecodeEmitter.cpp
-+++ b/js/src/frontend/BytecodeEmitter.cpp
-@@ -13,17 +13,16 @@
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/DebugOnly.h"
- #include "mozilla/FloatingPoint.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/PodOperations.h"
- 
- #include <string.h>
- 
--#include "jsapi.h"
- #include "jsnum.h"
- #include "jstypes.h"
- #include "jsutil.h"
- 
- #include "ds/Nestable.h"
- #include "frontend/BytecodeControlStructures.h"
- #include "frontend/CForEmitter.h"
- #include "frontend/DoWhileEmitter.h"
-@@ -44,20 +43,17 @@
- #include "vm/JSAtom.h"
- #include "vm/JSContext.h"
- #include "vm/JSFunction.h"
- #include "vm/JSScript.h"
- #include "vm/Stack.h"
- #include "wasm/AsmJS.h"
- 
- #include "frontend/ParseNode-inl.h"
--#include "vm/EnvironmentObject-inl.h"
--#include "vm/JSAtom-inl.h"
--#include "vm/JSScript-inl.h"
--#include "vm/NativeObject-inl.h"
-+#include "vm/JSObject-inl.h"
- 
- using namespace js;
- using namespace js::gc;
- using namespace js::frontend;
- 
- using mozilla::AssertedCast;
- using mozilla::DebugOnly;
- using mozilla::Maybe;
-diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h
---- a/js/src/frontend/BytecodeEmitter.h
-+++ b/js/src/frontend/BytecodeEmitter.h
-@@ -16,18 +16,16 @@
- #include "frontend/EitherParser.h"
- #include "frontend/JumpList.h"
- #include "frontend/NameFunctions.h"
- #include "frontend/SharedContext.h"
- #include "frontend/SourceNotes.h"
- #include "vm/BytecodeUtil.h"
- #include "vm/Interpreter.h"
- #include "vm/Iteration.h"
--#include "vm/JSContext.h"
--#include "vm/JSScript.h"
- 
- namespace js {
- namespace frontend {
- 
- class CGConstList {
-     Vector<Value> list;
-   public:
-     explicit CGConstList(JSContext* cx) : list(cx) {}
-diff --git a/js/src/frontend/EmitterScope.cpp b/js/src/frontend/EmitterScope.cpp
---- a/js/src/frontend/EmitterScope.cpp
-+++ b/js/src/frontend/EmitterScope.cpp
-@@ -5,16 +5,18 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- #include "frontend/EmitterScope.h"
- 
- #include "frontend/BytecodeEmitter.h"
- #include "frontend/TDZCheckCache.h"
- #include "js/AutoByteString.h"
- 
-+#include "vm/GlobalObject.h"
-+
- using namespace js;
- using namespace js::frontend;
- 
- using mozilla::DebugOnly;
- using mozilla::Maybe;
- using mozilla::Nothing;
- using mozilla::Some;
- 
-diff --git a/js/src/frontend/EmitterScope.h b/js/src/frontend/EmitterScope.h
---- a/js/src/frontend/EmitterScope.h
-+++ b/js/src/frontend/EmitterScope.h
-@@ -13,19 +13,21 @@
- #include <stdint.h>
- 
- #include "ds/Nestable.h"
- #include "frontend/NameAnalysisTypes.h"
- #include "frontend/NameCollections.h"
- #include "frontend/ParseContext.h"
- #include "frontend/SharedContext.h"
- #include "js/TypeDecls.h"
--#include "vm/Scope.h"
- 
- namespace js {
-+
-+class Scope;
-+
- namespace frontend {
- 
- // A scope that introduces bindings.
- class EmitterScope : public Nestable<EmitterScope>
- {
-     // The cache of bound names that may be looked up in the
-     // scope. Initially populated as the set of names this scope binds. As
-     // names are looked up in enclosing scopes, they are cached on the
-diff --git a/js/src/frontend/ErrorReporter.h b/js/src/frontend/ErrorReporter.h
---- a/js/src/frontend/ErrorReporter.h
-+++ b/js/src/frontend/ErrorReporter.h
-@@ -6,17 +6,20 @@
- 
- #ifndef frontend_ErrorReporter_h
- #define frontend_ErrorReporter_h
- 
- #include <stdarg.h> // for va_list
- #include <stddef.h> // for size_t
- #include <stdint.h> // for uint32_t
- 
--#include "jsapi.h" // for JS::ReadOnlyCompileOptions
-+#include "js/CompileOptions.h"
-+#include "js/UniquePtr.h"
-+
-+class JSErrorNotes;
- 
- namespace js {
- namespace frontend {
- 
- class ErrorReporter
- {
-   public:
-     virtual const JS::ReadOnlyCompileOptions& options() const = 0;
-diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp
---- a/js/src/frontend/FoldConstants.cpp
-+++ b/js/src/frontend/FoldConstants.cpp
-@@ -4,25 +4,23 @@
-  * 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/. */
- 
- #include "frontend/FoldConstants.h"
- 
- #include "mozilla/FloatingPoint.h"
- 
- #include "jslibmath.h"
-+#include "jsnum.h"
- 
- #include "frontend/ParseNode.h"
- #include "frontend/Parser.h"
- #include "js/Conversions.h"
- #include "vm/StringType.h"
- 
--#include "vm/JSContext-inl.h"
--#include "vm/JSObject-inl.h"
--
- using namespace js;
- using namespace js::frontend;
- 
- using mozilla::IsNaN;
- using mozilla::IsNegative;
- using mozilla::NegativeInfinity;
- using mozilla::PositiveInfinity;
- using JS::GenericNaN;
-diff --git a/js/src/frontend/ForOfLoopControl.h b/js/src/frontend/ForOfLoopControl.h
---- a/js/src/frontend/ForOfLoopControl.h
-+++ b/js/src/frontend/ForOfLoopControl.h
-@@ -7,18 +7,16 @@
- #ifndef frontend_ForOfLoopControl_h
- #define frontend_ForOfLoopControl_h
- 
- #include "mozilla/Attributes.h"
- #include "mozilla/Maybe.h"
- 
- #include <stdint.h>
- 
--#include "jsapi.h"
--
- #include "frontend/BytecodeControlStructures.h"
- #include "frontend/TryEmitter.h"
- #include "vm/Iteration.h"
- 
- namespace js {
- namespace frontend {
- 
- struct BytecodeEmitter;
-diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h
---- a/js/src/frontend/FullParseHandler.h
-+++ b/js/src/frontend/FullParseHandler.h
-@@ -9,16 +9,17 @@
- 
- #include "mozilla/Attributes.h"
- #include "mozilla/PodOperations.h"
- 
- #include <string.h>
- 
- #include "frontend/ParseNode.h"
- #include "frontend/SharedContext.h"
-+#include "vm/JSContext.h"
- 
- namespace js {
- 
- class RegExpObject;
- 
- namespace frontend {
- 
- enum class SourceKind {
-diff --git a/js/src/frontend/NameCollections.h b/js/src/frontend/NameCollections.h
---- a/js/src/frontend/NameCollections.h
-+++ b/js/src/frontend/NameCollections.h
-@@ -5,21 +5,22 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- #ifndef frontend_NameCollections_h
- #define frontend_NameCollections_h
- 
- #include "ds/InlineTable.h"
- #include "frontend/NameAnalysisTypes.h"
- #include "js/Vector.h"
--#include "vm/Stack.h"
- 
- namespace js {
- namespace frontend {
- 
-+class FunctionBox;
-+
- // A pool of recyclable containers for use in the frontend. The Parser and
- // BytecodeEmitter create many maps for name analysis that are short-lived
- // (i.e., for the duration of parsing or emitting a lexical scope). Making
- // them recyclable cuts down significantly on allocator churn.
- template <typename RepresentativeCollection, typename ConcreteCollectionPool>
- class CollectionPool
- {
-     using RecyclableCollections = Vector<void*, 32, SystemAllocPolicy>;
-@@ -157,17 +158,16 @@ struct NameMapHasher : public DefaultHas
- template <typename MapValue>
- using RecyclableNameMap = InlineMap<JSAtom*,
-                                     RecyclableAtomMapValueWrapper<MapValue>,
-                                     24,
-                                     NameMapHasher,
-                                     SystemAllocPolicy>;
- 
- using DeclaredNameMap = RecyclableNameMap<DeclaredNameInfo>;
--using CheckTDZMap = RecyclableNameMap<MaybeCheckTDZ>;
- using NameLocationMap = RecyclableNameMap<NameLocation>;
- using AtomIndexMap = RecyclableNameMap<uint32_t>;
- 
- template <typename RepresentativeTable>
- class InlineTablePool
-   : public CollectionPool<RepresentativeTable, InlineTablePool<RepresentativeTable>>
- {
-   public:
-@@ -330,17 +330,14 @@ class PooledVectorPtr
- 
- #undef POOLED_COLLECTION_PTR_METHODS
- 
- } // namespace frontend
- } // namespace js
- 
- namespace mozilla {
- 
--template <>
--struct IsPod<js::MaybeCheckTDZ> : TrueType {};
--
- template <typename T>
- struct IsPod<js::frontend::RecyclableAtomMapValueWrapper<T>> : IsPod<T> {};
- 
- } // namespace mozilla
- 
- #endif // frontend_NameCollections_h
-diff --git a/js/src/frontend/ParseContext-inl.h b/js/src/frontend/ParseContext-inl.h
---- a/js/src/frontend/ParseContext-inl.h
-+++ b/js/src/frontend/ParseContext-inl.h
-@@ -1,8 +1,14 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-+ * vim: set ts=8 sts=4 et sw=4 tw=99:
-+ * This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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 frontend_ParseContext_inl_h
- #define frontend_ParseContext_inl_h
- 
- #include "frontend/ParseContext.h"
- 
- namespace js {
- namespace frontend {
- 
-@@ -15,17 +21,16 @@ ParseContext::Statement::is<ParseContext
- 
- template <>
- inline bool
- ParseContext::Statement::is<ParseContext::ClassStatement>() const
- {
-     return kind_ == StatementKind::Class;
- }
- 
--
- inline JS::Result<Ok, ParseContext::BreakStatementError>
- ParseContext::checkBreakStatement(PropertyName* label)
- {
-     // Labeled 'break' statements target the nearest labeled statements (could
-     // be any kind) with the same label. Unlabeled 'break' statements target
-     // the innermost loop or switch statement.
-     if (label) {
-         auto hasSameLabel = [&label](ParseContext::LabelStatement* stmt) {
-diff --git a/js/src/frontend/ParseContext.h b/js/src/frontend/ParseContext.h
---- a/js/src/frontend/ParseContext.h
-+++ b/js/src/frontend/ParseContext.h
-@@ -481,45 +481,19 @@ class ParseContext : public Nestable<Par
-     // the Function or Generator constructor.
-     bool isStandaloneFunctionBody_;
- 
-     // Set when encountering a super.property inside a method. We need to mark
-     // the nearest super scope as needing a home object.
-     bool superScopeNeedsHomeObject_;
- 
-   public:
--    inline ParseContext(JSContext* cx, ParseContext*& parent, SharedContext* sc, ErrorReporter& errorReporter,
--        class UsedNameTracker& usedNames, Directives* newDirectives, bool isFull)
--      : Nestable<ParseContext>(&parent),
--        traceLog_(sc->context,
--                  isFull
--                  ? TraceLogger_ParsingFull
--                  : TraceLogger_ParsingSyntax,
--                  errorReporter),
--        sc_(sc),
--        errorReporter_(errorReporter),
--        innermostStatement_(nullptr),
--        innermostScope_(nullptr),
--        varScope_(nullptr),
--        positionalFormalParameterNames_(cx->frontendCollectionPool()),
--        closedOverBindingsForLazy_(cx->frontendCollectionPool()),
--        innerFunctionsForLazy(cx, GCVector<JSFunction*, 8>(cx)),
--        newDirectives(newDirectives),
--        lastYieldOffset(NoYieldOffset),
--        lastAwaitOffset(NoAwaitOffset),
--        scriptId_(usedNames.nextScriptId()),
--        isStandaloneFunctionBody_(false),
--        superScopeNeedsHomeObject_(false)
--    {
--        if (isFunctionBox()) {
--            if (functionBox()->function()->isNamedLambda())
--                namedLambdaScope_.emplace(cx, parent, usedNames);
--            functionScope_.emplace(cx, parent, usedNames);
--        }
--    }
-+    ParseContext(JSContext* cx, ParseContext*& parent, SharedContext* sc,
-+                 ErrorReporter& errorReporter, UsedNameTracker& usedNames,
-+                 Directives* newDirectives, bool isFull);
- 
-     MOZ_MUST_USE bool init();
- 
-     SharedContext* sc() {
-         return sc_;
-     }
- 
-     // `true` if we are in the body of a function definition.
-diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp
---- a/js/src/frontend/ParseNode.cpp
-+++ b/js/src/frontend/ParseNode.cpp
-@@ -3,16 +3,18 @@
-  * This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
- #include "frontend/ParseNode-inl.h"
- 
- #include "mozilla/FloatingPoint.h"
- 
-+#include "jsnum.h"
-+
- #include "frontend/Parser.h"
- 
- #include "vm/JSContext-inl.h"
- 
- using namespace js;
- using namespace js::frontend;
- 
- using mozilla::IsFinite;
-diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
---- a/js/src/frontend/ParseNode.h
-+++ b/js/src/frontend/ParseNode.h
-@@ -4,19 +4,20 @@
-  * 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 frontend_ParseNode_h
- #define frontend_ParseNode_h
- 
- #include "mozilla/Attributes.h"
- 
--#include "builtin/ModuleObject.h"
- #include "frontend/TokenStream.h"
-+#include "vm/BytecodeUtil.h"
- #include "vm/Printer.h"
-+#include "vm/Scope.h"
- 
- // A few notes on lifetime of ParseNode trees:
- //
- // - All the `ParseNode` instances MUST BE explicitly allocated in the context's `LifoAlloc`.
- //   This is typically implemented by the `FullParseHandler` or it can be reimplemented with
- //   a custom `new_`.
- //
- // - The tree is bulk-deallocated when the parser is deallocated. Consequently, references
-diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
---- a/js/src/frontend/Parser.cpp
-+++ b/js/src/frontend/Parser.cpp
-@@ -23,17 +23,17 @@
- #include "mozilla/Sprintf.h"
- #include "mozilla/TypeTraits.h"
- #include "mozilla/Unused.h"
- #include "mozilla/Utf8.h"
- 
- #include <memory>
- #include <new>
- 
--#include "jsapi.h"
-+#include "jsnum.h"
- #include "jstypes.h"
- 
- #include "builtin/ModuleObject.h"
- #include "builtin/SelfHostingDefines.h"
- #include "frontend/BytecodeCompiler.h"
- #include "frontend/FoldConstants.h"
- #include "frontend/TokenStream.h"
- #include "irregexp/RegExpParser.h"
-@@ -45,18 +45,16 @@
- #include "vm/JSScript.h"
- #include "vm/RegExpObject.h"
- #include "vm/StringType.h"
- #include "wasm/AsmJS.h"
- 
- #include "frontend/ParseContext-inl.h"
- #include "frontend/ParseNode-inl.h"
- #include "vm/EnvironmentObject-inl.h"
--#include "vm/JSAtom-inl.h"
--#include "vm/JSScript-inl.h"
- 
- using namespace js;
- using namespace js::gc;
- 
- using mozilla::Maybe;
- using mozilla::Nothing;
- using mozilla::PodCopy;
- using mozilla::PodZero;
-@@ -375,16 +373,47 @@ EvalSharedContext::EvalSharedContext(JSC
-                 break;
-             }
- 
-             env = env->enclosingEnvironment();
-         }
-     }
- }
- 
-+ParseContext::ParseContext(JSContext* cx, ParseContext*& parent, SharedContext* sc,
-+                           ErrorReporter& errorReporter, class UsedNameTracker& usedNames,
-+                           Directives* newDirectives, bool isFull)
-+  : Nestable<ParseContext>(&parent),
-+    traceLog_(sc->context,
-+              isFull
-+              ? TraceLogger_ParsingFull
-+              : TraceLogger_ParsingSyntax,
-+              errorReporter),
-+    sc_(sc),
-+    errorReporter_(errorReporter),
-+    innermostStatement_(nullptr),
-+    innermostScope_(nullptr),
-+    varScope_(nullptr),
-+    positionalFormalParameterNames_(cx->frontendCollectionPool()),
-+    closedOverBindingsForLazy_(cx->frontendCollectionPool()),
-+    innerFunctionsForLazy(cx, GCVector<JSFunction*, 8>(cx)),
-+    newDirectives(newDirectives),
-+    lastYieldOffset(NoYieldOffset),
-+    lastAwaitOffset(NoAwaitOffset),
-+    scriptId_(usedNames.nextScriptId()),
-+    isStandaloneFunctionBody_(false),
-+    superScopeNeedsHomeObject_(false)
-+{
-+    if (isFunctionBox()) {
-+        if (functionBox()->function()->isNamedLambda())
-+            namedLambdaScope_.emplace(cx, parent, usedNames);
-+        functionScope_.emplace(cx, parent, usedNames);
-+    }
-+}
-+
- bool
- ParseContext::init()
- {
-     if (scriptId_ == UINT32_MAX) {
-         errorReporter_.reportErrorNoOffset(JSMSG_NEED_DIET, js_script_str);
-         return false;
-     }
- 
-@@ -457,16 +486,24 @@ UsedNameTracker::rewind(RewindToken toke
- {
-     scriptCounter_ = token.scriptId;
-     scopeCounter_ = token.scopeId;
- 
-     for (UsedNameMap::Range r = map_.all(); !r.empty(); r.popFront())
-         r.front().value().resetToScope(token.scriptId, token.scopeId);
- }
- 
-+#ifdef DEBUG
-+bool
-+FunctionBox::atomsAreKept()
-+{
-+    return context->zone()->hasKeptAtoms();
-+}
-+#endif
-+
- FunctionBox::FunctionBox(JSContext* cx, ObjectBox* traceListHead,
-                          JSFunction* fun, uint32_t toStringStart,
-                          Directives directives, bool extraWarnings,
-                          GeneratorKind generatorKind, FunctionAsyncKind asyncKind)
-   : ObjectBox(fun, traceListHead),
-     SharedContext(cx, Kind::FunctionBox, directives, extraWarnings),
-     enclosingScope_(nullptr),
-     namedLambdaBindings_(nullptr),
-diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
---- a/js/src/frontend/Parser.h
-+++ b/js/src/frontend/Parser.h
-@@ -176,18 +176,16 @@
- #include "frontend/BytecodeCompiler.h"
- #include "frontend/FullParseHandler.h"
- #include "frontend/NameAnalysisTypes.h"
- #include "frontend/NameCollections.h"
- #include "frontend/ParseContext.h"
- #include "frontend/SharedContext.h"
- #include "frontend/SyntaxParseHandler.h"
- #include "frontend/TokenStream.h"
--#include "js/CompileOptions.h"
--#include "vm/Iteration.h"
- 
- namespace js {
- 
- class ModuleObject;
- 
- namespace frontend {
- 
- class ParserBase;
-diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h
---- a/js/src/frontend/SharedContext.h
-+++ b/js/src/frontend/SharedContext.h
-@@ -9,20 +9,18 @@
- 
- #include "jspubtd.h"
- #include "jstypes.h"
- 
- #include "builtin/ModuleObject.h"
- #include "ds/InlineTable.h"
- #include "frontend/ParseNode.h"
- #include "frontend/TokenStream.h"
--#include "gc/Zone.h"
- #include "vm/BytecodeUtil.h"
--#include "vm/EnvironmentObject.h"
--#include "vm/JSAtom.h"
-+#include "vm/JSFunction.h"
- #include "vm/JSScript.h"
- 
- namespace js {
- namespace frontend {
- 
- class ParseContext;
- class ParseNode;
- 
-@@ -405,28 +403,32 @@ class FunctionBox : public ObjectBox, pu
- 
-     // Whether this function has nested functions.
-     bool hasInnerFunctions_:1;
- 
-     FunctionBox(JSContext* cx, ObjectBox* traceListHead, JSFunction* fun,
-                 uint32_t toStringStart, Directives directives, bool extraWarnings,
-                 GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
- 
-+#ifdef DEBUG
-+    bool atomsAreKept();
-+#endif
-+
-     MutableHandle<LexicalScope::Data*> namedLambdaBindings() {
--        MOZ_ASSERT(context->zone()->hasKeptAtoms());
-+        MOZ_ASSERT(atomsAreKept());
-         return MutableHandle<LexicalScope::Data*>::fromMarkedLocation(&namedLambdaBindings_);
-     }
- 
-     MutableHandle<FunctionScope::Data*> functionScopeBindings() {
--        MOZ_ASSERT(context->zone()->hasKeptAtoms());
-+        MOZ_ASSERT(atomsAreKept());
-         return MutableHandle<FunctionScope::Data*>::fromMarkedLocation(&functionScopeBindings_);
-     }
- 
-     MutableHandle<VarScope::Data*> extraVarScopeBindings() {
--        MOZ_ASSERT(context->zone()->hasKeptAtoms());
-+        MOZ_ASSERT(atomsAreKept());
-         return MutableHandle<VarScope::Data*>::fromMarkedLocation(&extraVarScopeBindings_);
-     }
- 
-     void initFromLazyFunction();
-     void initStandaloneFunction(Scope* enclosingScope);
-     void initWithEnclosingParseContext(ParseContext* enclosing, FunctionSyntaxKind kind);
- 
-     inline bool isLazyFunctionWithoutEnclosingScope() const {
-diff --git a/js/src/frontend/TDZCheckCache.h b/js/src/frontend/TDZCheckCache.h
---- a/js/src/frontend/TDZCheckCache.h
-+++ b/js/src/frontend/TDZCheckCache.h
-@@ -15,16 +15,18 @@
- #include "js/TypeDecls.h"
- #include "vm/Stack.h"
- 
- namespace js {
- namespace frontend {
- 
- struct BytecodeEmitter;
- 
-+using CheckTDZMap = RecyclableNameMap<MaybeCheckTDZ>;
-+
- // A cache that tracks Temporal Dead Zone (TDZ) checks, so that any use of a
- // lexical variable that's dominated by an earlier use, or by evaluation of its
- // declaration (which will initialize it, perhaps to |undefined|), doesn't have
- // to redundantly check that the lexical variable has been initialized
- //
- // Each basic block should have a TDZCheckCache in scope. Some NestableControl
- // subclasses contain a TDZCheckCache.
- //
-diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h
---- a/js/src/frontend/TokenStream.h
-+++ b/js/src/frontend/TokenStream.h
-@@ -205,23 +205,25 @@
- #include "frontend/ErrorReporter.h"
- #include "frontend/TokenKind.h"
- #include "js/CompileOptions.h"
- #include "js/UniquePtr.h"
- #include "js/Vector.h"
- #include "util/Text.h"
- #include "util/Unicode.h"
- #include "vm/ErrorReporting.h"
--#include "vm/JSContext.h"
- #include "vm/RegExpShared.h"
--#include "vm/StringType.h"
--
-+
-+struct JSContext;
- struct KeywordInfo;
- 
- namespace js {
-+
-+class AutoKeepAtoms;
-+
- namespace frontend {
- 
- struct TokenPos {
-     uint32_t    begin;  // Offset of the token's first code unit.
-     uint32_t    end;    // Offset of 1 past the token's last code unit.
- 
-     TokenPos()
-       : begin(0),
-diff --git a/js/src/gc/Rooting.h b/js/src/gc/Rooting.h
---- a/js/src/gc/Rooting.h
-+++ b/js/src/gc/Rooting.h
-@@ -25,16 +25,17 @@ class ScriptSourceObject;
- class SavedFrame;
- class Shape;
- class ObjectGroup;
- class DebuggerArguments;
- class DebuggerEnvironment;
- class DebuggerFrame;
- class DebuggerObject;
- class Scope;
-+class ModuleObject;
- 
- // These are internal counterparts to the public types such as HandleObject.
- 
- typedef JS::Handle<NativeObject*>           HandleNativeObject;
- typedef JS::Handle<Shape*>                  HandleShape;
- typedef JS::Handle<ObjectGroup*>            HandleObjectGroup;
- typedef JS::Handle<JSAtom*>                 HandleAtom;
- typedef JS::Handle<JSLinearString*>         HandleLinearString;
-@@ -43,27 +44,29 @@ typedef JS::Handle<ArrayObject*>        
- typedef JS::Handle<PlainObject*>            HandlePlainObject;
- typedef JS::Handle<SavedFrame*>             HandleSavedFrame;
- typedef JS::Handle<ScriptSourceObject*>     HandleScriptSourceObject;
- typedef JS::Handle<DebuggerArguments*>      HandleDebuggerArguments;
- typedef JS::Handle<DebuggerEnvironment*>    HandleDebuggerEnvironment;
- typedef JS::Handle<DebuggerFrame*>          HandleDebuggerFrame;
- typedef JS::Handle<DebuggerObject*>         HandleDebuggerObject;
- typedef JS::Handle<Scope*>                  HandleScope;
-+typedef JS::Handle<ModuleObject*>           HandleModuleObject;
- 
- typedef JS::MutableHandle<Shape*>               MutableHandleShape;
- typedef JS::MutableHandle<JSAtom*>              MutableHandleAtom;
- typedef JS::MutableHandle<NativeObject*>        MutableHandleNativeObject;
- typedef JS::MutableHandle<PlainObject*>         MutableHandlePlainObject;
- typedef JS::MutableHandle<SavedFrame*>          MutableHandleSavedFrame;
- typedef JS::MutableHandle<DebuggerArguments*>   MutableHandleDebuggerArguments;
- typedef JS::MutableHandle<DebuggerEnvironment*> MutableHandleDebuggerEnvironment;
- typedef JS::MutableHandle<DebuggerFrame*>       MutableHandleDebuggerFrame;
- typedef JS::MutableHandle<DebuggerObject*>      MutableHandleDebuggerObject;
- typedef JS::MutableHandle<Scope*>               MutableHandleScope;
-+typedef JS::MutableHandle<ModuleObject*>        MutableHandleModuleObject;
- 
- typedef JS::Rooted<NativeObject*>           RootedNativeObject;
- typedef JS::Rooted<Shape*>                  RootedShape;
- typedef JS::Rooted<ObjectGroup*>            RootedObjectGroup;
- typedef JS::Rooted<JSAtom*>                 RootedAtom;
- typedef JS::Rooted<JSLinearString*>         RootedLinearString;
- typedef JS::Rooted<PropertyName*>           RootedPropertyName;
- typedef JS::Rooted<ArrayObject*>            RootedArrayObject;
-@@ -71,16 +74,17 @@ typedef JS::Rooted<GlobalObject*>       
- typedef JS::Rooted<PlainObject*>            RootedPlainObject;
- typedef JS::Rooted<SavedFrame*>             RootedSavedFrame;
- typedef JS::Rooted<ScriptSourceObject*>     RootedScriptSourceObject;
- typedef JS::Rooted<DebuggerArguments*>      RootedDebuggerArguments;
- typedef JS::Rooted<DebuggerEnvironment*>    RootedDebuggerEnvironment;
- typedef JS::Rooted<DebuggerFrame*>          RootedDebuggerFrame;
- typedef JS::Rooted<DebuggerObject*>         RootedDebuggerObject;
- typedef JS::Rooted<Scope*>                  RootedScope;
-+typedef JS::Rooted<ModuleObject*>           RootedModuleObject;
- 
- typedef JS::GCVector<JSFunction*>   FunctionVector;
- typedef JS::GCVector<PropertyName*> PropertyNameVector;
- typedef JS::GCVector<Shape*>        ShapeVector;
- typedef JS::GCVector<JSString*>     StringVector;
- 
- /** Interface substitute for Rooted<T> which does not root the variable's memory. */
- template <typename T>
-diff --git a/js/src/vm/Iteration.h b/js/src/vm/Iteration.h
---- a/js/src/vm/Iteration.h
-+++ b/js/src/vm/Iteration.h
-@@ -10,17 +10,16 @@
- /*
-  * JavaScript iterators.
-  */
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/MemoryReporting.h"
- 
- #include "gc/Barrier.h"
--#include "vm/JSContext.h"
- #include "vm/ReceiverGuard.h"
- #include "vm/Stack.h"
- 
- namespace js {
- 
- class PropertyIteratorObject;
- 
- struct NativeIterator
-diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h
---- a/js/src/vm/Stack.h
-+++ b/js/src/vm/Stack.h
-@@ -98,18 +98,27 @@ class Instance;
- // the activation's "current regs", which contains the stack pointer 'sp'. In
- // the interpreter, sp is adjusted as individual values are pushed and popped
- // from the stack and the InterpreterRegs struct (pointed to by the
- // InterpreterActivation) is a local var of js::Interpret.
- 
- enum MaybeCheckAliasing { CHECK_ALIASING = true, DONT_CHECK_ALIASING = false };
- enum MaybeCheckTDZ { CheckTDZ = true, DontCheckTDZ = false };
- 
-+} // namespace js
-+
-+namespace mozilla {
-+template <>
-+struct IsPod<js::MaybeCheckTDZ> : TrueType {};
-+} // namespace mozilla
-+
- /*****************************************************************************/
- 
-+namespace js {
-+
- namespace jit {
-     class BaselineFrame;
-     class RematerializedFrame;
- } // namespace jit
- 
- /**
-  * Pointer to a live JS or WASM stack frame.
-  */
-@@ -2424,9 +2433,10 @@ FrameIter::isPhysicalJitFrame() const
- inline jit::CommonFrameLayout*
- FrameIter::physicalJitFrame() const
- {
-     MOZ_ASSERT(isPhysicalJitFrame());
-     return jsJitFrame().current();
- }
- 
- }  /* namespace js */
-+
- #endif /* vm_Stack_h */

+ 0 - 151
frg/work-js/mozilla-release/patches/mozilla-central-push_434179.patch

@@ -1,151 +0,0 @@
-# HG changeset patch
-# User Jesse Schwartzentruber <truber@mozilla.com>
-# Date 1535686520 0
-#      Fri Aug 31 03:35:20 2018 +0000
-# Node ID b073a55c2be73fc6e5ba1a0f2bcef7c61d4d68ef
-# Parent  06af1619a7998038ce334196cf6e8790d26007c2
-Bug 1475573 - Create --enable-fuzzing debug build job for Android x86 firefox. r=nalexander,froydnj
-
-Differential Revision: https://phabricator.services.mozilla.com/D2428
-
-diff --git a/js/moz.configure b/js/moz.configure
---- a/js/moz.configure
-+++ b/js/moz.configure
-@@ -426,19 +426,20 @@ with only_when('--enable-compile-environ
-                          check_msg='for AFL compiler',
-                          when='--enable-fuzzing'))
-     def enable_aflfuzzer(afl):
-         if afl:
-             return True
- 
-     @depends(enable_fuzzing,
-              enable_aflfuzzer,
--             c_compiler)
--    def enable_libfuzzer(fuzzing, afl, c_compiler):
--        if fuzzing and not afl and c_compiler.type == 'clang':
-+             c_compiler,
-+             target)
-+    def enable_libfuzzer(fuzzing, afl, c_compiler, target):
-+        if fuzzing and not afl and c_compiler.type == 'clang' and target.os != 'Android':
-             return True
- 
-     @depends(enable_fuzzing,
-              enable_aflfuzzer,
-              enable_libfuzzer)
-     def enable_fuzzing_interfaces(fuzzing, afl, libfuzzer):
-         if fuzzing and (afl or libfuzzer):
-             return True
-diff --git a/taskcluster/ci/build/android.yml b/taskcluster/ci/build/android.yml
---- a/taskcluster/ci/build/android.yml
-+++ b/taskcluster/ci/build/android.yml
-@@ -165,16 +165,67 @@ android-x86/opt:
-         - android-sdk-linux
-         - linux64-clang
-         - linux64-rust-android
-         - linux64-rust-size
-         - linux64-cbindgen
-         - linux64-sccache
-         - linux64-node
- 
-+android-x86-fuzzing/debug:
-+    description: "Android x86 Fuzzing Debug"
-+    index:
-+        product: mobile
-+        job-name: android-x86-fuzzing-debug
-+    treeherder:
-+        platform: android-4-2-x86/debug
-+        symbol: Bf
-+    worker-type: aws-provisioner-v1/gecko-{level}-b-android
-+    worker:
-+        docker-image: {in-tree: android-build}
-+        max-run-time: 7200
-+        env:
-+            GRADLE_USER_HOME: "/builds/worker/workspace/build/src/mobile/android/gradle/dotgradle-offline"
-+            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
-+        artifacts:
-+            - name: public/android/R
-+              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/R
-+              type: directory
-+            - name: public/android/maven
-+              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview/maven/
-+              type: directory
-+            - name: public/build/geckoview-androidTest.apk
-+              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview/outputs/apk/androidTest/officialWithGeckoBinariesNoMinApi/debug/geckoview-official-withGeckoBinaries-noMinApi-debug-androidTest.apk
-+              type: file
-+            - name: public/build/geckoview_example.apk
-+              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview_example/outputs/apk/officialWithGeckoBinariesNoMinApi/debug/geckoview_example-official-withGeckoBinaries-noMinApi-debug.apk
-+              type: file
-+            - name: public/build
-+              path: /builds/worker/artifacts/
-+              type: directory
-+    run:
-+        using: mozharness
-+        actions: [get-secrets build multi-l10n update]
-+        config:
-+            - builds/releng_base_android_64_builds.py
-+        script: "mozharness/scripts/fx_desktop_build.py"
-+        secrets: true
-+        custom-build-variant-cfg: x86-fuzzing-debug
-+        tooltool-downloads: internal
-+    toolchains:
-+        - android-gradle-dependencies
-+        - android-ndk-linux
-+        - android-sdk-linux
-+        - linux64-clang
-+        - linux64-rust-android
-+        - linux64-rust-size
-+        - linux64-cbindgen
-+        - linux64-sccache
-+        - linux64-node
-+
- android-x86-nightly/opt:
-     description: "Android 4.2 x86 Nightly"
-     attributes:
-         nightly: true
-         enable-full-crashsymbols: true
-     shipping-phase: promote
-     shipping-product: fennec
-     index:
-diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py
---- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
-+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
-@@ -431,16 +431,17 @@ class BuildOptionParser(object):
-         'api-16-debug-artifact': 'builds/releng_sub_%s_configs/%s_api_16_debug_artifact.py',
-         'api-16-gradle': 'builds/releng_sub_%s_configs/%s_api_16_gradle.py',
-         'api-16-gradle-artifact': 'builds/releng_sub_%s_configs/%s_api_16_gradle_artifact.py',
-         'api-16-without-google-play-services': 'builds/releng_sub_%s_configs/%s_api_16_without_google_play_services.py',
-         'rusttests': 'builds/releng_sub_%s_configs/%s_rusttests.py',
-         'rusttests-debug': 'builds/releng_sub_%s_configs/%s_rusttests_debug.py',
-         'x86': 'builds/releng_sub_%s_configs/%s_x86.py',
-         'x86-artifact': 'builds/releng_sub_%s_configs/%s_x86_artifact.py',
-+        'x86-fuzzing-debug': 'builds/releng_sub_%s_configs/%s_x86_fuzzing_debug.py',
-         'api-16-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_16_partner_sample1.py',
-         'aarch64': 'builds/releng_sub_%s_configs/%s_aarch64.py',
-         'android-test': 'builds/releng_sub_%s_configs/%s_test.py',
-         'android-test-ccov': 'builds/releng_sub_%s_configs/%s_test_ccov.py',
-         'android-checkstyle': 'builds/releng_sub_%s_configs/%s_checkstyle.py',
-         'android-lint': 'builds/releng_sub_%s_configs/%s_lint.py',
-         'android-findbugs': 'builds/releng_sub_%s_configs/%s_findbugs.py',
-         'android-geckoview-docs': 'builds/releng_sub_%s_configs/%s_geckoview_docs.py',
-diff --git a/tools/fuzzing/faulty/Faulty.cpp b/tools/fuzzing/faulty/Faulty.cpp
---- a/tools/fuzzing/faulty/Faulty.cpp
-+++ b/tools/fuzzing/faulty/Faulty.cpp
-@@ -358,17 +358,17 @@ Faulty::MutationFactor()
- void
- Faulty::MaybeCollectAndClosePipe(int aPipe, unsigned int aProbability)
- {
-   if (!mFuzzPipes) {
-     return;
-   }
- 
-   if (aPipe > -1) {
--    FAULTY_LOG("Collecting pipe %d to bucket of pipes (count: %ld)",
-+    FAULTY_LOG("Collecting pipe %d to bucket of pipes (count: %zu)",
-                aPipe, mFds.size());
-     mFds.insert(aPipe);
-   }
- 
-   if (mFds.size() > 0 && FuzzingTraits::Sometimes(aProbability)) {
-     std::set<int>::iterator it(mFds.begin());
-     std::advance(it, FuzzingTraits::Random(mFds.size()));
-     FAULTY_LOG("Trying to close collected pipe: %d", *it);

+ 0 - 218
frg/work-js/mozilla-release/patches/mozilla-central-push_434306.patch

@@ -1,218 +0,0 @@
-# HG changeset patch
-# User Jon Coppeard <jcoppeard@mozilla.com>
-# Date 1535716505 -3600
-#      Fri Aug 31 12:55:05 2018 +0100
-# Node ID afbecefb2defdc42bbd6a20563fb4cef800500a3
-# Parent  3b26f3da46d88490bc6c956c418974c572aaa727
-Bug 1487346 - Replace shell module loader property with a hook function r=anba
-
-diff --git a/js/src/shell/ModuleLoader.js b/js/src/shell/ModuleLoader.js
---- a/js/src/shell/ModuleLoader.js
-+++ b/js/src/shell/ModuleLoader.js
-@@ -170,15 +170,16 @@ const ReflectLoader = new class {
-     }
- 
-     ["import"](name, referrer) {
-         let path = this.resolve(name, null);
-         return this.loadAndExecute(path);
-     }
- };
- 
-+setModuleLoadHook((path) => ReflectLoader.importRoot(path));
-+
- setModuleResolveHook((module, requestName) => {
-     let path = ReflectLoader.resolve(requestName, module);
-     return ReflectLoader.loadAndParse(path);
- });
- 
--Reflect.Loader = ReflectLoader;
- }
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -182,17 +182,18 @@ enum JSShellExitCode {
-     EXITCODE_FILE_NOT_FOUND     = 4,
-     EXITCODE_OUT_OF_MEMORY      = 5,
-     EXITCODE_TIMEOUT            = 6
- };
- 
- // Define use of application-specific slots on the shell's global object.
- enum GlobalAppSlot
- {
--    GlobalAppSlotModuleResolveHook,
-+    GlobalAppSlotModuleLoadHook,           // Shell-specific; load a module graph
-+    GlobalAppSlotModuleResolveHook,        // HostResolveImportedModule
-     GlobalAppSlotCount
- };
- static_assert(GlobalAppSlotCount <= JSCLASS_GLOBAL_APPLICATION_SLOTS,
-               "Too many applications slots defined for shell global");
- 
- /*
-  * Note: This limit should match the stack limit set by the browser in
-  *       js/xpconnect/src/XPCJSContext.cpp
-@@ -916,82 +917,57 @@ InitModuleLoader(JSContext* cx)
-     options.werrorOption = true;
-     options.strictOption = true;
- 
-     RootedValue rv(cx);
-     return Evaluate(cx, options, src.get(), srcLen, &rv);
- }
- 
- static bool
--GetLoaderObject(JSContext* cx, MutableHandleObject resultOut)
--{
--    // Look up the |Reflect.Loader| object that has been defined by the module
--    // loader.
--
--    RootedObject object(cx, cx->global());
--    RootedValue value(cx);
--    if (!JS_GetProperty(cx, object, "Reflect", &value) || !value.isObject())
--        return false;
--
--    object = &value.toObject();
--    if (!JS_GetProperty(cx, object, "Loader", &value) || !value.isObject())
--        return false;
--
--    resultOut.set(&value.toObject());
--    return true;
--}
--
--static bool
--GetImportRootMethod(JSContext* cx, HandleObject loader, MutableHandleFunction resultOut)
--{
--    // Look up the module loader's |importRoot| method.
--
--    RootedValue value(cx);
--    if (!JS_GetProperty(cx, loader, "importRoot", &value) || !value.isObject())
--        return false;
--
--    RootedObject object(cx, &value.toObject());
--    if (!object->is<JSFunction>())
--        return false;
--
--    resultOut.set(&object->as<JSFunction>());
-+GetModuleImportHook(JSContext* cx, MutableHandleFunction resultOut)
-+{
-+    Handle<GlobalObject*> global = cx->global();
-+    RootedValue hookValue(cx, global->getReservedSlot(GlobalAppSlotModuleLoadHook));
-+    if (hookValue.isUndefined()) {
-+        JS_ReportErrorASCII(cx, "Module load hook not set");
-+        return false;
-+    }
-+
-+    if (!hookValue.isObject() || !hookValue.toObject().is<JSFunction>()) {
-+        JS_ReportErrorASCII(cx, "Module load hook is not a function");
-+        return false;
-+    }
-+
-+    resultOut.set(&hookValue.toObject().as<JSFunction>());
-     return true;
- }
- 
- static MOZ_MUST_USE bool
- RunModule(JSContext* cx, const char* filename, FILE* file, bool compileOnly)
- {
--    // Execute a module by calling Reflect.Loader.importRoot on the resolved
--    // filename.
--
--    RootedObject loaderObj(cx);
--    if (!GetLoaderObject(cx, &loaderObj)) {
--        JS_ReportErrorASCII(cx, "Failed to get Reflect.Loader");
--        return false;
--    }
-+    // Execute a module by calling the module loader's import hook on the
-+    // resolved filename.
- 
-     RootedFunction importFun(cx);
--    if (!GetImportRootMethod(cx, loaderObj, &importFun)) {
--        JS_ReportErrorASCII(cx, "Failed to get Reflect.Loader.importRoot method");
--        return false;
--    }
-+    if (!GetModuleImportHook(cx, &importFun))
-+        return false;
- 
-     RootedString path(cx, JS_NewStringCopyZ(cx, filename));
-     if (!path)
-         return false;
- 
-     path = ResolvePath(cx, path, RootRelative);
-     if (!path)
-         return false;
- 
-     JS::AutoValueArray<1> args(cx);
-     args[0].setString(path);
- 
-     RootedValue value(cx);
--    return JS_CallFunction(cx, loaderObj, importFun, args, &value);
-+    return JS_CallFunction(cx, nullptr, importFun, args, &value);
- }
- 
- static bool
- EnqueueJob(JSContext* cx, unsigned argc, Value* vp)
- {
-     CallArgs args = CallArgsFromVp(argc, vp);
- 
-     if (!IsFunctionObject(args.get(0))) {
-@@ -4481,16 +4457,39 @@ EvaluateModule(JSContext* cx, unsigned a
-         return false;
-     }
- 
-     args.rval().setUndefined();
-     return ModuleObject::Evaluate(cx, module);
- }
- 
- static bool
-+SetModuleLoadHook(JSContext* cx, unsigned argc, Value* vp)
-+{
-+    CallArgs args = CallArgsFromVp(argc, vp);
-+    if (args.length() != 1) {
-+        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
-+                                  "setModuleLoadHook", "0", "s");
-+        return false;
-+    }
-+
-+    if (!args[0].isObject() || !args[0].toObject().is<JSFunction>()) {
-+        const char* typeName = InformalValueTypeName(args[0]);
-+        JS_ReportErrorASCII(cx, "expected hook function, got %s", typeName);
-+        return false;
-+    }
-+
-+    Handle<GlobalObject*> global = cx->global();
-+    global->setReservedSlot(GlobalAppSlotModuleLoadHook, args[0]);
-+
-+    args.rval().setUndefined();
-+    return true;
-+}
-+
-+static bool
- SetModuleResolveHook(JSContext* cx, unsigned argc, Value* vp)
- {
-     CallArgs args = CallArgsFromVp(argc, vp);
-     if (args.length() != 1) {
-         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
-                                   "setModuleResolveHook", "0", "s");
-         return false;
-     }
-@@ -7447,16 +7446,22 @@ static const JSFunctionSpecWithHelp shel
-     JS_FN_HELP("instantiateModule", InstantiateModule, 1, 0,
- "instantiateModule(moduleScript)",
- "  Instantiate a module script graph."),
- 
-     JS_FN_HELP("evaluateModule", EvaluateModule, 1, 0,
- "evaluateModule(moduleScript)",
- "  Evaluate a previously instantiated module script graph."),
- 
-+    JS_FN_HELP("setModuleLoadHook", SetModuleLoadHook, 1, 0,
-+"setModuleLoadHook(function(path))",
-+"  Set the shell specific module load hook to |function|.\n"
-+"  This hook is used to load a module graph.  It should be implemented by the\n"
-+"  module loader."),
-+
-     JS_FN_HELP("setModuleResolveHook", SetModuleResolveHook, 1, 0,
- "setModuleResolveHook(function(module, specifier) {})",
- "  Set the HostResolveImportedModule hook to |function|.\n"
- "  This hook is used to look up a previously loaded module object.  It should\n"
- "  be implemented by the module loader."),
- 
-     JS_FN_HELP("getModuleLoadPath", GetModuleLoadPath, 0, 0,
- "getModuleLoadPath()",

+ 0 - 27
frg/work-js/mozilla-release/patches/mozilla-central-push_434309.patch

@@ -1,27 +0,0 @@
-# HG changeset patch
-# User Jon Coppeard <jcoppeard@mozilla.com>
-# Date 1535718091 -3600
-#      Fri Aug 31 13:21:31 2018 +0100
-# Node ID 19ae3c2784141d821c15da480bcd9e77a6e2f9c2
-# Parent  f34f8a70ede7ddfc1f855208096939f2fa40b9ba
-Bug 1487346 - Fix JS lint error on a CLOSED TREE r=me
-
-diff --git a/js/src/shell/ModuleLoader.js b/js/src/shell/ModuleLoader.js
---- a/js/src/shell/ModuleLoader.js
-+++ b/js/src/shell/ModuleLoader.js
-@@ -1,14 +1,14 @@
- /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
--/* global getModuleLoadPath setModuleResolveHook parseModule instantiateModule evaluateModule os */
-+/* global getModuleLoadPath setModuleLoadHook setModuleResolveHook parseModule instantiateModule evaluateModule os */
- 
- // A basic synchronous module loader for testing the shell.
- {
- // Save standard built-ins before scripts can modify them.
- const ArrayPrototypeJoin = Array.prototype.join;
- const MapPrototypeGet = Map.prototype.get;
- const MapPrototypeHas = Map.prototype.has;
- const MapPrototypeSet = Map.prototype.set;

+ 0 - 4560
frg/work-js/mozilla-release/patches/mozilla-central-push_434356.patch

@@ -1,4560 +0,0 @@
-# HG changeset patch
-# User Sebastian Hengst <archaeopteryx@coole-files.de>
-# Date 1535756483 -10800
-#      Sat Sep 01 02:01:23 2018 +0300
-# Node ID 6c83f735355d19458caa7ff34069b5676c062228
-# Parent  0aa31e702587617919d21d135d757b1004dd6aca
-Backed out 18 changesets (bug 1487647, bug 1487271, bug 1487001, bug 1487105, bug 1486845, bug 1485738, bug 1487595, bug 1347060, bug 1480900, bug 1487889) for accidential push of inbound to central. a=backout
-
-Backed out changeset 331706d8558f (bug 1487595)
-Backed out changeset d78b833293db (bug 1487595)
-Backed out changeset f292ef31ef0b (bug 1487595)
-Backed out changeset ef8c5c529210 (bug 1486845)
-Backed out changeset 9cbc8592d649 (bug 1487889)
-Backed out changeset 05a0118455e4 (bug 1487105)
-Backed out changeset 78b8ff889992 (bug 1487105)
-Backed out changeset 5a55e5b74107 (bug 1480900)
-Backed out changeset ea2402bdef40 (bug 1347060)
-Backed out changeset 3f831b709e37 (bug 1485738)
-Backed out changeset d1c29bfb5ea9 (bug 1480900)
-Backed out changeset 8e60483ec824 (bug 1480900)
-Backed out changeset 328589a86dd1 (bug 1487647)
-Backed out changeset d974ef1647f3 (bug 1480900)
-Backed out changeset 0509636cc5d5 (bug 1487001)
-Backed out changeset c57165730494 (bug 1487271)
-Backed out changeset a55d81761fc4 (bug 1480900)
-Backed out changeset eaa2d0e9b62d (bug 1480900)
-
-diff --git a/browser/actors/NetErrorChild.jsm b/browser/actors/NetErrorChild.jsm
---- a/browser/actors/NetErrorChild.jsm
-+++ b/browser/actors/NetErrorChild.jsm
-@@ -163,17 +163,17 @@ class NetErrorChild extends ActorChild {
-       let subjectAltNames = input.data.certSubjectAltNames.split(",");
-       let numSubjectAltNames = subjectAltNames.length;
-       let msgPrefix = "";
-       if (numSubjectAltNames != 0) {
-         if (numSubjectAltNames == 1) {
-           if (newErrorPagesEnabled) {
-             technicalInfo.textContent = "";
-             let brandName = gBrandBundle.GetStringFromName("brandShortName");
--            msgPrefix = gPipNSSBundle.formatStringFromName("certErrorMismatchSinglePrefix1", [brandName, hostString], 2) + " ";
-+            msgPrefix = gPipNSSBundle.formatStringFromName("certErrorMismatchSinglePrefix1", [brandName, hostString], 2);
-             msgPrefix += gPipNSSBundle.GetStringFromName("certErrorMismatchSinglePrefix");
-           } else {
-             msgPrefix = gPipNSSBundle.GetStringFromName("certErrorMismatchSinglePrefix");
-           }
-           // Let's check if we want to make this a link.
-           let okHost = input.data.certSubjectAltNames;
-           let href = "";
-           let thisHost = doc.location.hostname;
-diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul
---- a/browser/base/content/browser.xul
-+++ b/browser/base/content/browser.xul
-@@ -1265,17 +1265,17 @@ xmlns="http://www.w3.org/1999/xhtml"
-         <browser id="sidebar" flex="1" autoscroll="false" disablehistory="true" disablefullscreen="true"
-                   style="min-width: 14em; width: 18em; max-width: 36em;" tooltip="aHTMLTooltip"/>
-       </vbox>
- 
-       <splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" hidden="true"/>
-       <vbox id="appcontent" flex="1">
-         <notificationbox id="high-priority-global-notificationbox" notificationside="top"/>
-         <tabbox id="tabbrowser-tabbox"
--                flex="1" tabcontainer="tabbrowser-tabs">
-+                flex="1" eventnode="document" tabcontainer="tabbrowser-tabs">
-           <tabpanels id="tabbrowser-tabpanels"
-                      flex="1" class="plain" selectedIndex="0"/>
-         </tabbox>
-       </vbox>
-       <vbox id="browser-border-end" hidden="true" layer="true"/>
-     </hbox>
- #include ../../components/customizableui/content/customizeMode.inc.xul
-   </deck>
-diff --git a/browser/components/preferences/in-content/extensionControlled.js b/browser/components/preferences/in-content/extensionControlled.js
---- a/browser/components/preferences/in-content/extensionControlled.js
-+++ b/browser/components/preferences/in-content/extensionControlled.js
-@@ -58,19 +58,17 @@ let extensionControlledContentIds = {
-   },
- };
- 
- const extensionControlledL10nKeys = {
-   "homepage_override": "homepage-override",
-   "newTabURL": "new-tab-url",
-   "defaultSearch": "default-search",
-   "privacy.containers": "privacy-containers",
--  "websites.trackingProtectionMode": contentBlockingUiEnabled ?
--                                       "websites-content-blocking-all-trackers" :
--                                       "websites-tracking-protection-mode",
-+  "websites.trackingProtectionMode": "websites-tracking-protection-mode",
-   "proxy.settings": "proxy-config",
- };
- 
- let extensionControlledIds = {};
- 
- /**
-   * Check if a pref is being managed by an extension.
-   */
-diff --git a/browser/components/preferences/in-content/privacy.js b/browser/components/preferences/in-content/privacy.js
---- a/browser/components/preferences/in-content/privacy.js
-+++ b/browser/components/preferences/in-content/privacy.js
-@@ -517,27 +517,16 @@ var gPrivacyPane = {
-       }
-     }
- 
-     // Allow turning off the "(recommended)" label using a pref
-     let blockCookiesFromTrackers = document.getElementById("blockCookiesFromTrackersCB");
-     if (contentBlockingRejectTrackersRecommended) {
-       document.l10n.setAttributes(blockCookiesFromTrackers, "content-blocking-reject-trackers-block-trackers-option-recommended");
-     }
--
--    // Reorder the privacy pane to put the Content Blocking section first and the
--    // Cookies & Site Data section right after it.
--    let trackingGroup = document.getElementById("trackingGroup");
--    let siteDataGroup = document.getElementById("siteDataGroup");
--    let browserPrivacyCategory = document.getElementById("browserPrivacyCategory");
--
--    browserPrivacyCategory.parentNode.insertBefore(siteDataGroup,
--                                                   browserPrivacyCategory.nextSibling);
--    browserPrivacyCategory.parentNode.insertBefore(trackingGroup,
--                                                   browserPrivacyCategory.nextSibling);
-   },
- 
-   /**
-    * Resets all user-exposed content blocking preferences to their default values.
-    */
-   async restoreContentBlockingPrefs() {
-     function clearIfNotLocked(pref) {
-       if (!Services.prefs.prefIsLocked(pref)) {
-diff --git a/browser/components/preferences/in-content/privacy.xul b/browser/components/preferences/in-content/privacy.xul
---- a/browser/components/preferences/in-content/privacy.xul
-+++ b/browser/components/preferences/in-content/privacy.xul
-@@ -339,17 +339,17 @@
-         </vbox>
-         <vbox class="content-blocking-category-icon">
-           <image class="fastblock-icon content-blocking-icon"/>
-         </vbox>
-         <vbox class="content-blocking-category-labels" flex="1">
-           <label data-l10n-id="content-blocking-fastblock-slow-loading-label"
-                  class="content-blocking-category-name"
-                  control="contentBlockingFastBlockCheckbox"/>
--          <description data-l10n-id="content-blocking-fastblock-new-description" class="content-blocking-category-description"/>
-+          <description data-l10n-id="content-blocking-fastblock-description" class="content-blocking-category-description"/>
-         </vbox>
-       </hbox>
-       <vbox>
-         <hbox id="contentBlockingTrackingProtectionExtensionContentLabel" align="center" hidden="true">
-           <description control="contentBlockingDisableTrackingProtectionExtension" flex="1"/>
-         </hbox>
-         <hbox id="contentBlockingTrackingProtectionExtensionContentButton" hidden="true">
-           <button id="contentBlockingDisableTrackingProtectionExtension"
-@@ -362,29 +362,29 @@
-           </vbox>
-           <vbox class="content-blocking-category-icon">
-             <image class="tracking-protection-icon content-blocking-icon" />
-           </vbox>
-           <vbox class="content-blocking-category-labels" flex="1">
-             <label data-l10n-id="content-blocking-tracking-protection-all-label"
-                    class="content-blocking-category-name"
-                    control="contentBlockingTrackingProtectionCheckbox"/>
--            <description data-l10n-id="content-blocking-tracking-protection-new-description"
-+            <description data-l10n-id="content-blocking-tracking-protection-description"
-                          class="content-blocking-category-description"
-                          id="trackingProtectionMenuDesc"/>
-             <radiogroup id="trackingProtectionMenu"
-                         aria-labelledby="trackingProtectionMenuDesc">
-               <radio value="private"
-                      data-l10n-id="content-blocking-tracking-protection-option-private"
-                      flex="1" />
-               <radio value="always"
-                      data-l10n-id="content-blocking-tracking-protection-option-always"
-                      flex="1" />
-             </radiogroup>
--            <label id="changeBlockListLink" data-l10n-id="content-blocking-tracking-protection-change-block-list" class="text-link"/>
-+            <label id="changeBlockListLink" data-l10n-id="content-blocking-tracking-protection-change-blocklist" class="text-link"/>
-           </vbox>
-         </hbox>
-       </vbox>
-       <hbox class="content-blocking-category reject-trackers-ui">
-         <hbox flex="1">
-           <vbox class="content-blocking-category-checkbox">
-             <checkbox id="contentBlockingBlockCookiesCheckbox" class="content-blocking-checkbox" />
-           </vbox>
-@@ -398,23 +398,23 @@
-                        class="content-blocking-category-name"
-                        control="contentBlockingBlockCookiesCheckbox"/>
-                 <deck id="blockCookiesCBDeck">
-                   <description id="blockCookiesCBDesc"
-                                data-l10n-id="content-blocking-reject-trackers-description"
-                                class="content-blocking-category-description"/>
-                   <hbox id="warningAllCookiesBlocked">
-                     <image class="reject-trackers-warning-icon"/>
--                    <description data-l10n-id="content-blocking-reject-trackers-warning-your-settings-prevent-changes"
--                                 class="content-blocking-category-description description-with-side-element"/>
-+                    <description data-l10n-id="content-blocking-reject-trackers-warning-all-cookies-blocked"
-+                                 class="content-blocking-category-description"/>
-                   </hbox>
-                   <hbox id="warningFromVisitedCookiesBlocked">
-                     <image class="reject-trackers-warning-icon"/>
--                    <description data-l10n-id="content-blocking-reject-trackers-warning-your-settings-prevent-changes"
--                                 class="content-blocking-category-description description-with-side-element"/>
-+                    <description data-l10n-id="content-blocking-reject-trackers-warning-from-unvisited-cookies-blocked"
-+                                 class="content-blocking-category-description"/>
-                   </hbox>
-                 </deck>
-               </vbox>
-               <hbox align="center">
-                 <vbox align="center">
-                   <button id="contentBlockingChangeCookieSettings"
-                           class="accessory-button"
-                           flex="1"
-diff --git a/browser/components/preferences/in-content/tests/browser_extension_controlled.js b/browser/components/preferences/in-content/tests/browser_extension_controlled.js
---- a/browser/components/preferences/in-content/tests/browser_extension_controlled.js
-+++ b/browser/components/preferences/in-content/tests/browser_extension_controlled.js
-@@ -529,17 +529,16 @@ add_task(async function testExtensionCon
-     new: "contentBlockingTrackingProtectionExtensionContentButton",
-   };
-   const DISABLE_BUTTON_ID = {
-     old: "disableTrackingProtectionExtension",
-     new: "contentBlockingDisableTrackingProtectionExtension",
-   };
- 
-   let tpEnabledPref = () => Services.prefs.getBoolPref(TP_PREF);
--  let cbUIEnabledPref = () => Services.prefs.getBoolPref(CB_UI_PREF);
- 
-   await SpecialPowers.pushPrefEnv(
-     {"set": [[TP_PREF, TP_DEFAULT], [CB_UI_PREF, true]]});
- 
-   function background() {
-     browser.privacy.websites.trackingProtectionMode.set({value: "always"});
-   }
- 
-@@ -549,18 +548,17 @@ add_task(async function testExtensionCon
-     let controlledLabel = doc.getElementById(CONTROLLED_LABEL_ID[uiType]);
-     let controlledButton = doc.getElementById(CONTROLLED_BUTTON_ID[uiType]);
- 
-     is(controlledLabel.hidden, !isControlled, "The extension controlled row's visibility is as expected.");
-     is(controlledButton.hidden, !isControlled, "The disable extension button's visibility is as expected.");
-     if (isControlled) {
-       let controlledDesc = controlledLabel.querySelector("description");
-       Assert.deepEqual(doc.l10n.getAttributes(controlledDesc), {
--        id: cbUIEnabledPref() ? "extension-controlled-websites-content-blocking-all-trackers" :
--                                "extension-controlled-websites-tracking-protection-mode",
-+        id: "extension-controlled-websites-tracking-protection-mode",
-         args: {
-           name: "set_tp",
-         },
-       }, "The user is notified that an extension is controlling TP.");
-     }
- 
-     if (uiType === "old") {
-       for (let element of doc.querySelectorAll("#trackingProtectionRadioGroup > radio")) {
-diff --git a/browser/extensions/formautofill/test/browser/browser_privacyPreferences.js b/browser/extensions/formautofill/test/browser/browser_privacyPreferences.js
---- a/browser/extensions/formautofill/test/browser/browser_privacyPreferences.js
-+++ b/browser/extensions/formautofill/test/browser/browser_privacyPreferences.js
-@@ -76,29 +76,23 @@ add_task(async function test_autofillChe
-     await finalPrefPaneLoaded;
-     await ContentTask.spawn(browser, SELECTORS, (selectors) => {
-       is(content.document.querySelector(selectors.group).hidden, false,
-         "Form Autofill group should be visible");
-       is(content.document.querySelector(selectors.addressAutofillCheckbox).checked, false,
-         "Checkbox should be unchecked when Autofill Addresses is disabled");
-       is(content.document.querySelector(selectors.creditCardAutofillCheckbox).checked, false,
-         "Checkbox should be unchecked when Autofill Credit Cards is disabled");
--      content.document.querySelector(selectors.addressAutofillCheckbox)
--        .scrollIntoView({block: "center", behavior: "instant"});
-     });
- 
-     info("test toggling the checkboxes");
-     await BrowserTestUtils.synthesizeMouseAtCenter(SELECTORS.addressAutofillCheckbox, {}, browser);
-     is(Services.prefs.getBoolPref(ENABLED_AUTOFILL_ADDRESSES_PREF), true,
-        "Check address autofill is now enabled");
- 
--    await ContentTask.spawn(browser, SELECTORS, (selectors) => {
--      content.document.querySelector(selectors.creditCardAutofillCheckbox)
--        .scrollIntoView({block: "center", behavior: "instant"});
--    });
-     await BrowserTestUtils.synthesizeMouseAtCenter(SELECTORS.creditCardAutofillCheckbox, {}, browser);
-     is(Services.prefs.getBoolPref(ENABLED_AUTOFILL_CREDITCARDS_PREF), true,
-        "Check credit card autofill is now enabled");
-   });
- });
- 
- add_task(async function test_creditCardNotAvailable() {
-   await SpecialPowers.pushPrefEnv({set: [[AUTOFILL_CREDITCARDS_AVAILABLE_PREF, false]]});
-diff --git a/browser/locales/en-US/browser/preferences/preferences.ftl b/browser/locales/en-US/browser/preferences/preferences.ftl
---- a/browser/locales/en-US/browser/preferences/preferences.ftl
-+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
-@@ -103,20 +103,16 @@ extension-controlled-default-search = An
- # This string is shown to notify the user that Container Tabs
- # are being enabled by an extension.
- extension-controlled-privacy-containers = An extension, <img data-l10n-name="icon"/> { $name }, requires Container Tabs.
- 
- # This string is shown to notify the user that their tracking protection preferences
- # are being controlled by an extension.
- extension-controlled-websites-tracking-protection-mode = An extension, <img data-l10n-name="icon"/> { $name }, is controlling tracking protection.
- 
--# This string is shown to notify the user that their content blocking "All Detected Trackers"
--# preferences are being controlled by an extension.
--extension-controlled-websites-content-blocking-all-trackers = An extension, <img data-l10n-name="icon"/> { $name }, is controlling this setting.
--
- # This string is shown to notify the user that their proxy configuration preferences
- # are being controlled by an extension.
- extension-controlled-proxy-config = An extension, <img data-l10n-name="icon"/> { $name }, is controlling how { -brand-short-name } connects to the internet.
- 
- # This string is shown after the user disables an extension to notify the user
- # how to enable an extension that they disabled.
- #
- # <img data-l10n-name="addons-icon"/> will be replaced with Add-ons icon
-@@ -810,17 +806,17 @@ addressbar-locbar-openpage-option =
- addressbar-suggestions-settings = Change preferences for search engine suggestions
- 
- ## Privacy Section - Content Blocking
- 
- content-blocking-header = Content Blocking
- 
- content-blocking-desc = Block third-party content, like ads or code, that can slow your browsing and track you around the web. Customize your settings for the best balance of protection and performance.
- 
--content-blocking-learn-more = Learn more
-+content-blocking-learn-more = Learn More
- content-blocking-restore-defaults =
-   .label = Restore Defaults
-   .accesskey = R
- 
- content-blocking-toggle-on =
-   .tooltiptext = Turn Off Content Blocking
- content-blocking-toggle-off =
-   .tooltiptext = Turn On Content Blocking
-@@ -832,36 +828,39 @@ content-blocking-toggle-label-off = OFF
- 
- content-blocking-category-label = Choose what to block
- 
- # "Slow" in this instance means "slow to load on the network".
- # FastBlock is a feature that blocks requests to tracking sites if they
- # have not finished loading after a certain threshold of seconds.
- content-blocking-fastblock-slow-loading-label = Slow-Loading Trackers
-   .accesskey = S
--content-blocking-fastblock-new-description = Block just the trackers that keep pages from loading quickly.
-+content-blocking-fastblock-description = Blocks third-party content that takes longer than 5 seconds to load.
- content-blocking-tracking-protection-all-label = All Detected Trackers
-   .accesskey = T
--content-blocking-tracking-protection-new-description = Block all known trackers. (May prevent some pages from loading.)
-+content-blocking-tracking-protection-description = Blocks all known trackers (Note: may also prevent some pages from loading).
- content-blocking-tracking-protection-option-always =
-   .label = Always
-   .accesskey = A
- content-blocking-tracking-protection-option-private =
-   .label = Only in private windows
-   .accesskey = p
--content-blocking-tracking-protection-change-block-list = Change block list
-+content-blocking-tracking-protection-change-blocklist = Change Block List…
- 
- content-blocking-reject-trackers-label = Third-Party Cookies
-   .accesskey = C
- content-blocking-reject-trackers-description = Block all third-party cookies or just those set by trackers.
- # This is a warning message shown next to a yellow warning icon when the Third-Party Cookies subsection
--# of the Content Blocking UI in Preferences has been disabled due to the either the "All cookies" option
--# or the "Cookies from unvisited websites" option being selected in the Cookies and Site Data section of
--# the UI.
--content-blocking-reject-trackers-warning-your-settings-prevent-changes = Your settings in Cookies and Site Data are preventing changes to Third-Party Cookies settings.
-+# of the Content Blocking UI in Preferences has been disabled due to the "All cookies" option
-+# being selected in the Cookies and Site Data section of the UI.
-+content-blocking-reject-trackers-warning-all-cookies-blocked = All cookies are currently blocked.
-+# This is a warning message shown next to a yellow warning icon when the Third-Party Cookies subsection
-+# of the Content Blocking UI in Preferences has been disabled due to the "Cookies from unvisited websites"
-+# option being selected in the Cookies and Site Data section of the UI.
-+content-blocking-reject-trackers-warning-from-unvisited-cookies-blocked = Cookies from unvisited websites are currently blocked.
- content-blocking-change-cookie-settings =
-   .label = Change Cookie Settings
-   .accesskey = S
- content-blocking-reject-trackers-block-trackers-option-recommended =
-   .label = Trackers (recommended)
-   .accesskey = k
- content-blocking-reject-trackers-block-trackers-option =
-   .label = Trackers
-diff --git a/build/autoconf/expandlibs.m4 b/build/autoconf/expandlibs.m4
---- a/build/autoconf/expandlibs.m4
-+++ b/build/autoconf/expandlibs.m4
-@@ -9,39 +9,58 @@ dnl =
- dnl = Check what kind of list files are supported by the
- dnl = linker
- dnl =
- dnl ========================================================
- 
- AC_CACHE_CHECK(what kind of list files are supported by the linker,
-     EXPAND_LIBS_LIST_STYLE,
-     [echo "int main() {return 0;}" > conftest.${ac_ext}
--     dnl Because BFD ld doesn't work with LTO + linker scripts, we
--     dnl must pass the LTO CFLAGS to the compile command, and the LTO
--     dnl LDFLAGS to all subsequent link commands.
--     dnl https://sourceware.org/bugzilla/show_bug.cgi?id=23600
--     if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $MOZ_LTO_CFLAGS $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
-+     if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
-          echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
--         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $MOZ_LTO_LDFLAGS $LDFLAGS conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
-+         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
-              EXPAND_LIBS_LIST_STYLE=linkerscript
-          else
-              echo "conftest.${OBJ_SUFFIX}" > conftest.list
-              dnl -filelist is for the OS X linker.  We need to try -filelist
-              dnl first because clang understands @file, but may pass an
-              dnl oversized argument list to the linker depending on the
-              dnl contents of @file.
--             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $MOZ_LTO_LDFLAGS $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
-+             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
-                  EXPAND_LIBS_LIST_STYLE=filelist
--             elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $MOZ_LTO_LDFLAGS $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
-+             elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
-                  EXPAND_LIBS_LIST_STYLE=list
-              else
--                 AC_ERROR([Couldn't find one that works])
-+                 EXPAND_LIBS_LIST_STYLE=none
-              fi
-          fi
-      else
-          dnl We really don't expect to get here, but just in case
-          AC_ERROR([couldn't compile a simple C file])
-      fi
-      rm -rf conftest*])
- 
-+LIBS_DESC_SUFFIX=desc
-+AC_SUBST(LIBS_DESC_SUFFIX)
- AC_SUBST(EXPAND_LIBS_LIST_STYLE)
- 
-+if test "$GCC_USE_GNU_LD"; then
-+    AC_CACHE_CHECK(what kind of ordering can be done with the linker,
-+        EXPAND_LIBS_ORDER_STYLE,
-+        [> conftest.order
-+         _SAVE_LDFLAGS="$LDFLAGS"
-+         LDFLAGS="${LDFLAGS} -Wl,--section-ordering-file,conftest.order"
-+         AC_TRY_LINK([], [],
-+             EXPAND_LIBS_ORDER_STYLE=section-ordering-file,
-+             EXPAND_LIBS_ORDER_STYLE=)
-+         LDFLAGS="$_SAVE_LDFLAGS"
-+         if test -z "$EXPAND_LIBS_ORDER_STYLE"; then
-+             if AC_TRY_COMMAND(${CC-cc} ${DSO_LDOPTS} ${LDFLAGS} -o conftest -Wl,--verbose 2> /dev/null | sed -n '/^===/,/^===/p' | grep '\.text'); then
-+                 EXPAND_LIBS_ORDER_STYLE=linkerscript
-+             else
-+                 EXPAND_LIBS_ORDER_STYLE=none
-+             fi
-+             rm -f ${DLL_PREFIX}conftest${DLL_SUFFIX}
-+         fi])
-+fi
-+AC_SUBST(EXPAND_LIBS_ORDER_STYLE)
-+
- ])
-diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
---- a/build/moz.configure/toolchain.configure
-+++ b/build/moz.configure/toolchain.configure
-@@ -1402,18 +1402,16 @@ def lto(value, pgo, c_compiler):
-     )
- 
- 
- add_old_configure_assignment('MOZ_LTO', lto.enabled)
- set_config('MOZ_LTO', lto.enabled)
- set_define('MOZ_LTO', lto.enabled)
- set_config('MOZ_LTO_CFLAGS', lto.cflags)
- set_config('MOZ_LTO_LDFLAGS', lto.ldflags)
--add_old_configure_assignment('MOZ_LTO_CFLAGS', lto.cflags)
--add_old_configure_assignment('MOZ_LTO_LDFLAGS', lto.ldflags)
- 
- # ASAN
- # ==============================================================
- 
- js_option('--enable-address-sanitizer', help='Enable Address Sanitizer')
- 
- 
- @depends_if('--enable-address-sanitizer')
-diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
---- a/dom/base/nsJSEnvironment.cpp
-+++ b/dom/base/nsJSEnvironment.cpp
-@@ -1263,44 +1263,16 @@ FinishAnyIncrementalGC()
- static void
- FireForgetSkippable(uint32_t aSuspected, bool aRemoveChildless,
-                     TimeStamp aDeadline)
- {
-   AUTO_PROFILER_TRACING("CC", aDeadline.IsNull() ? "ForgetSkippable"
-                                                  : "IdleForgetSkippable");
-   PRTime startTime = PR_Now();
-   TimeStamp startTimeStamp = TimeStamp::Now();
--
--  static uint32_t sForgetSkippableCounter = 0;
--  static TimeStamp sForgetSkippableFrequencyStartTime;
--  static TimeStamp sLastForgetSkippableEndTime;
--  static const TimeDuration minute = TimeDuration::FromSeconds(60.0f);
--
--  if (sForgetSkippableFrequencyStartTime.IsNull()) {
--    sForgetSkippableFrequencyStartTime = startTimeStamp;
--  } else if (startTimeStamp - sForgetSkippableFrequencyStartTime > minute) {
--    TimeStamp startPlusMinute = sForgetSkippableFrequencyStartTime + minute;
--
--    // If we had forget skippables only at the beginning of the interval, we
--    // still want to use the whole time, minute or more, for frequency
--    // calculation. sLastForgetSkippableEndTime is needed if forget skippable
--    // takes enough time to push the interval to be over a minute.
--    TimeStamp endPoint = startPlusMinute > sLastForgetSkippableEndTime ?
--      startPlusMinute : sLastForgetSkippableEndTime;
--
--    // Duration in minutes.
--    double duration =
--      (endPoint - sForgetSkippableFrequencyStartTime).ToSeconds() / 60;
--    uint32_t frequencyPerMinute = uint32_t(sForgetSkippableCounter / duration);
--    Telemetry::Accumulate(Telemetry::FORGET_SKIPPABLE_FREQUENCY, frequencyPerMinute);
--    sForgetSkippableCounter = 0;
--    sForgetSkippableFrequencyStartTime = startTimeStamp;
--  }
--  ++sForgetSkippableCounter;
--
-   FinishAnyIncrementalGC();
-   bool earlyForgetSkippable =
-     sCleanupsSinceLastGC < NS_MAJOR_FORGET_SKIPPABLE_CALLS;
- 
-   int64_t budgetMs = aDeadline.IsNull() ?
-     kForgetSkippableSliceDuration :
-     int64_t((aDeadline - TimeStamp::Now()).ToMilliseconds());
-   js::SliceBudget budget = js::SliceBudget(js::TimeBudget(budgetMs));
-@@ -1315,18 +1287,16 @@ FireForgetSkippable(uint32_t aSuspected,
-   if (sMaxForgetSkippableTime < delta) {
-     sMaxForgetSkippableTime = delta;
-   }
-   sTotalForgetSkippableTime += delta;
-   sRemovedPurples += (aSuspected - sPreviousSuspectedCount);
-   ++sForgetSkippableBeforeCC;
- 
-   TimeStamp now = TimeStamp::Now();
--  sLastForgetSkippableEndTime = now;
--
-   TimeDuration duration = now - startTimeStamp;
-   if (duration.ToSeconds()) {
-     TimeDuration idleDuration;
-     if (!aDeadline.IsNull()) {
-       if (aDeadline < now) {
-         // This slice overflowed the idle period.
-         if (aDeadline > startTimeStamp) {
-           idleDuration = aDeadline - startTimeStamp;
-diff --git a/gfx/doc/AdvancedLayers.md b/gfx/doc/AdvancedLayers.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/AdvancedLayers.md
-@@ -0,0 +1,308 @@
-+Advanced Layers
-+==============
-+
-+Advanced Layers is a new method of compositing layers in Gecko. This document serves as a technical
-+overview and provides a short walk-through of its source code.
-+
-+Overview
-+-------------
-+
-+Advanced Layers attempts to group as many GPU operations as it can into a single draw call. This is
-+a common technique in GPU-based rendering called "batching". It is not always trivial, as a
-+batching algorithm can easily waste precious CPU resources trying to build optimal draw calls.
-+
-+Advanced Layers reuses the existing Gecko layers system as much as possible. Huge layer trees do
-+not currently scale well (see the future work section), so opportunities for batching are currently
-+limited without expending unnecessary resources elsewhere. However, Advanced Layers has a few
-+benefits:
-+
-+ * It submits smaller GPU workloads and buffer uploads than the existing compositor.
-+ * It needs only a single pass over the layer tree.
-+ * It uses occlusion information more intelligently.
-+ * It is easier to add new specialized rendering paths and new layer types.
-+ * It separates compositing logic from device logic, unlike the existing compositor.
-+ * It is much faster at rendering 3d scenes or complex layer trees.
-+ * It has experimental code to use the z-buffer for occlusion culling.
-+
-+Because of these benefits we hope that it provides a significant improvement over the existing
-+compositor.
-+
-+Advanced Layers uses the acronym "MLG" and "MLGPU" in many places. This stands for "Mid-Level
-+Graphics", the idea being that it is optimized for Direct3D 11-style rendering systems as opposed
-+to Direct3D 12 or Vulkan.
-+
-+LayerManagerMLGPU
-+------------------------------
-+
-+Advanced layers does not change client-side rendering at all. Content still uses Direct2D (when
-+possible), and creates identical layer trees as it would with a normal Direct3D 11 compositor. In
-+fact, Advanced Layers re-uses all of the existing texture handling and video infrastructure as
-+well, replacing only the composite-side layer types.
-+
-+Advanced Layers does not create a `LayerManagerComposite` - instead, it creates a
-+`LayerManagerMLGPU`. This layer manager does not have a `Compositor` - instead, it has an
-+`MLGDevice`, which roughly abstracts the Direct3D 11 API. (The hope is that this API is easily
-+interchangeable for something else when cross-platform or software support is needed.)
-+
-+`LayerManagerMLGPU` also dispenses with the old "composite" layers for new layer types. For
-+example, `ColorLayerComposite` becomes `ColorLayerMLGPU`. Since these layer types implement
-+`HostLayer`, they integrate with `LayerTransactionParent` as normal composite layers would.
-+
-+Rendering Overview
-+----------------------------
-+
-+The steps for rendering are described in more detail below, but roughly the process is:
-+
-+1. Sort layers front-to-back.
-+2. Create a dependency tree of render targets (called "views").
-+3. Accumulate draw calls for all layers in each view.
-+4. Upload draw call buffers to the GPU.
-+5. Execute draw commands for each view.
-+
-+Advanced Layers divides the layer tree into "views" (`RenderViewMLGPU`), which correspond to a
-+render target. The root layer is represented by a view corresponding to the screen. Layers that
-+require intermediate surfaces have temporary views. Layers are analyzed front-to-back, and rendered
-+back-to-front within a view. Views themselves are rendered front-to-back, to minimize render target
-+switching.
-+
-+Each view contains one or more rendering passes (`RenderPassMLGPU`). A pass represents a single
-+draw command with one or more rendering items attached to it. For example, a `SolidColorPass` item
-+contains a rectangle and an RGBA value, and many of these can be drawn with a single GPU call.
-+
-+When considering a layer, views will first try to find an existing rendering batch that can support
-+it. If so, that pass will accumulate another draw item for the layer. Otherwise, a new pass will be
-+added.
-+
-+When trying to find a matching pass for a layer, there is a tradeoff in CPU time versus the GPU
-+time saved by not issuing another draw commands. We generally care more about CPU time, so we do
-+not try too hard in matching items to an existing batch.
-+
-+After all layers have been processed, there is a "prepare" step. This copies all accumulated draw
-+data and uploads it into vertex and constant buffers in the GPU.
-+
-+Finally, we execute rendering commands. At the end of the frame, all batches and (most) constant
-+buffers are thrown away.
-+
-+Shaders Overview
-+-------------------------------------
-+
-+Advanced Layers currently has five layer-related shader pipelines:
-+
-+ - Textured (PaintedLayer, ImageLayer, CanvasLayer)
-+ - ComponentAlpha (PaintedLayer with component-alpha)
-+ - YCbCr (ImageLayer with YCbCr video)
-+ - Color (ColorLayers)
-+ - Blend (ContainerLayers with mix-blend modes)
-+
-+There are also three special shader pipelines:
-+
-+ - MaskCombiner, which is used to combine mask layers into a single texture.
-+ - Clear, which is used for fast region-based clears when not directly supported by the GPU.
-+ - Diagnostic, which is used to display the diagnostic overlay texture.
-+
-+The layer shaders follow a unified structure. Each pipeline has a vertex and pixel shader.
-+The vertex shader takes a layers ID, a z-buffer depth, a unit position in either a unit
-+square or unit triangle, and either rectangular or triangular geometry. Shaders can also
-+have ancillary data needed like texture coordinates or colors.
-+
-+Most of the time, layers have simple rectangular clips with simple rectilinear transforms, and
-+pixel shaders do not need to perform masking or clipping. For these layers we use a fast-path
-+pipeline, using unit-quad shaders that are able to clip geometry so the pixel shader does not
-+have to. This type of pipeline does not support complex masks.
-+
-+If a layer has a complex mask, a rotation or 3d transform, or a complex operation like blending,
-+then we use shaders capable of handling arbitrary geometry. Their input is a unit triangle,
-+and these shaders are generally more expensive.
-+
-+All of the shader-specific data is modelled in ShaderDefinitionsMLGPU.h.
-+
-+CPU Occlusion Culling
-+-------------------------------------
-+
-+By default, Advanced Layers performs occlusion culling on the CPU. Since layers are visited
-+front-to-back, this is simply a matter of accumulating the visible region of opaque layers, and
-+subtracting it from the visible region of subsequent layers. There is a major difference
-+between this occlusion culling and PostProcessLayers of the old compositor: AL performs culling
-+after invalidation, not before. Completely valid layers will have an empty visible region.
-+
-+Most layer types (with the exception of images) will intelligently split their draw calls into a
-+batch of individual rectangles, based on their visible region.
-+
-+Z-Buffering and Occlusion
-+-------------------------------------
-+
-+Advanced Layers also supports occlusion culling on the GPU, using a z-buffer. This is disabled by
-+default currently since it is significantly costly on integrated GPUs. When using the z-buffer, we
-+separate opaque layers into a separate list of passes. The render process then uses the following
-+steps:
-+
-+ 1. The depth buffer is set to read-write.
-+ 2. Opaque batches are executed.,
-+ 3. The depth buffer is set to read-only.
-+ 4. Transparent batches are executed.
-+
-+The problem we have observed is that the depth buffer increases writes to the GPU, and on
-+integrated GPUs this is expensive - we have seen draw call times increase by 20-30%, which is the
-+wrong direction we want to take on battery life. In particular on a full screen video, the call to
-+ClearDepthStencilView plus the actual depth buffer write of the video can double GPU time.
-+
-+For now the depth-buffer is disabled until we can find a compelling case for it on non-integrated
-+hardware.
-+
-+Clipping
-+-------------------------------------
-+
-+Clipping is a bit tricky in Advanced Layers. We cannot use the hardware "scissor" feature, since the
-+clip can change from instance to instance within a batch. And if using the depth buffer, we
-+cannot write transparent pixels for the clipped area. As a result we always clip opaque draw rects
-+in the vertex shader (and sometimes even on the CPU, as is needed for sane texture coordiantes).
-+Only transparent items are clipped in the pixel shader. As a result, masked layers and layers with
-+non-rectangular transforms are always considered transparent, and use a more flexible clipping
-+pipeline.
-+
-+Plane Splitting
-+---------------------
-+
-+Plane splitting is when a 3D transform causes a layer to be split - for example, one transparent
-+layer may intersect another on a separate plane. When this happens, Gecko sorts layers using a BSP
-+tree and produces a list of triangles instead of draw rects.
-+
-+These layers cannot use the "unit quad" shaders that support the fast clipping pipeline. Instead
-+they always use the full triangle-list shaders that support extended vertices and clipping.
-+
-+This is the slowest path we can take when building a draw call, since we must interact with the
-+polygon clipping and texturing code.
-+
-+Masks
-+---------
-+
-+For each layer with a mask attached, Advanced Layers builds a `MaskOperation`. These operations
-+must resolve to a single mask texture, as well as a rectangular area to which the mask applies. All
-+batched pixel shaders will automatically clip pixels to the mask if a mask texture is bound. (Note
-+that we must use separate batches if the mask texture changes.)
-+
-+Some layers have multiple mask textures. In this case, the MaskOperation will store the list of
-+masks, and right before rendering, it will invoke a shader to combine these masks into a single texture.
-+
-+MaskOperations are shared across layers when possible, but are not cached across frames.
-+
-+BigImage Support
-+--------------------------
-+
-+ImageLayers and CanvasLayers can be tiled with many individual textures. This happens in rare cases
-+where the underlying buffer is too big for the GPU. Early on this caused problems for Advanced
-+Layers, since AL required one texture per layer. We implemented BigImage support by creating
-+temporary ImageLayers for each visible tile, and throwing those layers away at the end of the
-+frame.
-+
-+Advanced Layers no longer has a 1:1 layer:texture restriction, but we retain the temporary layer
-+solution anyway. It is not much code and it means we do not have to split `TexturedLayerMLGPU`
-+methods into iterated and non-iterated versions.
-+
-+Texture Locking
-+----------------------
-+
-+Advanced Layers has a different texture locking scheme than the existing compositor. If a texture
-+needs to be locked, then it is locked by the MLGDevice automatically when bound to the current
-+pipeline. The MLGDevice keeps a set of the locked textures to avoid double-locking. At the end of
-+the frame, any textures in the locked set are unlocked.
-+
-+We cannot easily replicate the locking scheme in the old compositor, since the duration of using
-+the texture is not scoped to when we visit the layer.
-+
-+Buffer Measurements
-+-------------------------------
-+
-+Advanced Layers uses constant buffers to send layer information and extended instance data to the
-+GPU. We do this by pre-allocating large constant buffers and mapping them with `MAP_DISCARD` at the
-+beginning of the frame. Batches may allocate into this up to the maximum bindable constant buffer
-+size of the device (currently, 64KB).
-+
-+There are some downsides to this approach. Constant buffers are difficult to work with - they have
-+specific alignment requirements, and care must be taken not too run over the maximum number of
-+constants in a buffer. Another approach would be to store constants in a 2D texture and use vertex
-+shader texture fetches. Advanced Layers implemented this and benchmarked it to decide which
-+approach to use. Textures seemed to skew better on GPU performance, but worse on CPU, but this
-+varied depending on the GPU. Overall constant buffers performed best and most consistently, so we
-+have kept them.
-+
-+Additionally, we tested different ways of performing buffer uploads. Buffer creation itself is
-+costly, especially on integrated GPUs, and especially so for immutable, immediate-upload buffers.
-+As a result we aggressively cache buffer objects and always allocate them as MAP_DISCARD unless
-+they are write-once and long-lived.
-+
-+Buffer Types
-+------------
-+
-+Advanced Layers has a few different classes to help build and upload buffers to the GPU. They are:
-+
-+ - `MLGBuffer`. This is the low-level shader resource that `MLGDevice` exposes. It is the building
-+   block for buffer helper classes, but it can also be used to make one-off, immutable,
-+   immediate-upload buffers. MLGBuffers, being a GPU resource, are reference counted.
-+ - `SharedBufferMLGPU`. These are large, pre-allocated buffers that are read-only on the GPU and
-+   write-only on the CPU. They usually exceed the maximum bindable buffer size. There are three
-+   shared buffers created by default and they are automatically unmapped as needed: one for vertices,
-+   one for vertex shader constants, and one for pixel shader constants. When callers allocate into a
-+   shared buffer they get back a mapped pointer, a GPU resource, and an offset. When the underlying
-+   device supports offsetable buffers (like `ID3D11DeviceContext1` does), this results in better GPU
-+   utilization, as there are less resources and fewer upload commands.
-+ - `ConstantBufferSection` and `VertexBufferSection`. These are "views" into a `SharedBufferMLGPU`.
-+   They contain the underlying `MLGBuffer`, and when offsetting is supported, the offset
-+   information necessary for resource binding. Sections are not reference counted.
-+ - `StagingBuffer`. A dynamically sized CPU buffer where items can be appended in a free-form
-+   manner. The stride of a single "item" is computed by the first item written, and successive
-+   items must have the same stride. The buffer must be uploaded to the GPU manually. Staging buffers
-+   are appropriate for creating general constant or vertex buffer data. They can also write items in
-+   reverse, which is how we render back-to-front when layers are visited front-to-back. They can be
-+   uploaded to a `SharedBufferMLGPU` or an immutabler `MLGBuffer` very easily. Staging buffers are not
-+   reference counted.
-+
-+Unsupported Features
-+--------------------------------
-+
-+Currently, these features of the old compositor are not yet implemented.
-+
-+ - OpenGL and software support (currently AL only works on D3D11).
-+ - APZ displayport overlay.
-+ - Diagnostic/developer overlays other than the FPS/timing overlay.
-+ - DEAA. It was never ported to the D3D11 compositor, but we would like it.
-+ - Component alpha when used inside an opaque intermediate surface.
-+ - Effects prefs. Possibly not needed post-B2G removal.
-+ - Widget overlays and underlays used by macOS and Android.
-+ - DefaultClearColor. This is Android specific, but is easy to added when needed.
-+ - Frame uniformity info in the profiler. Possibly not needed post-B2G removal.
-+ - LayerScope. There are no plans to make this work.
-+
-+Future Work
-+--------------------------------
-+
-+ - Refactor for D3D12/Vulkan support (namely, split MLGDevice into something less stateful and something else more low-level).
-+ - Remove "MLG" moniker and namespace everything.
-+ - Other backends (D3D12/Vulkan, OpenGL, Software)
-+ - Delete CompositorD3D11
-+ - Add DEAA support
-+ - Re-enable the depth buffer by default for fast GPUs
-+ - Re-enable right-sizing of inaccurately sized containers
-+ - Drop constant buffers for ancillary vertex data
-+ - Fast shader paths for simple video/painted layer cases
-+
-+History
-+----------
-+
-+Advanced Layers has gone through four major design iterations. The initial version used tiling -
-+each render view divided the screen into 128x128 tiles, and layers were assigned to tiles based on
-+their screen-space draw area. This approach proved not to scale well to 3d transforms, and so
-+tiling was eliminated.
-+
-+We replaced it with a simple system of accumulating draw regions to each batch, thus ensuring that
-+items could be assigned to batches while maintaining correct z-ordering. This second iteration also
-+coincided with plane-splitting support.
-+
-+On large layer trees, accumulating the affected regions of batches proved to be quite expensive.
-+This led to a third iteration, using depth buffers and separate opaque and transparent batch lists
-+to achieve z-ordering and occlusion culling.
-+
-+Finally, depth buffers proved to be too expensive, and we introduced a simple CPU-based occlusion
-+culling pass. This iteration coincided with using more precise draw rects and splitting pipelines
-+into unit-quad, cpu-clipped and triangle-list, gpu-clipped variants.
-+
-diff --git a/gfx/docs/AsyncPanZoomArchitecture.png b/gfx/doc/AsyncPanZoom-HighLevel.png
-rename from gfx/docs/AsyncPanZoomArchitecture.png
-rename to gfx/doc/AsyncPanZoom-HighLevel.png
-diff --git a/gfx/doc/AsyncPanZoom.md b/gfx/doc/AsyncPanZoom.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/AsyncPanZoom.md
-@@ -0,0 +1,299 @@
-+Asynchronous Panning and Zooming {#apz}
-+================================
-+
-+**This document is a work in progress.  Some information may be missing or incomplete.**
-+
-+## Goals
-+
-+We need to be able to provide a visual response to user input with minimal latency.
-+In particular, on devices with touch input, content must track the finger exactly while panning, or the user experience is very poor.
-+According to the UX team, 120ms is an acceptable latency between user input and response.
-+
-+## Context and surrounding architecture
-+
-+The fundamental problem we are trying to solve with the Asynchronous Panning and Zooming (APZ) code is that of responsiveness.
-+By default, web browsers operate in a "game loop" that looks like this:
-+
-+    while true:
-+        process input
-+        do computations
-+        repaint content
-+        display repainted content
-+
-+In browsers the "do computation" step can be arbitrarily expensive because it can involve running event handlers in web content.
-+Therefore, there can be an arbitrary delay between the input being received and the on-screen display getting updated.
-+
-+Responsiveness is always good, and with touch-based interaction it is even more important than with mouse or keyboard input.
-+In order to ensure responsiveness, we split the "game loop" model of the browser into a multithreaded variant which looks something like this:
-+
-+    Thread 1 (compositor thread)
-+    while true:
-+        receive input
-+        send a copy of input to thread 2
-+        adjust painted content based on input
-+        display adjusted painted content
-+    
-+    Thread 2 (main thread)
-+    while true:
-+        receive input from thread 1
-+        do computations
-+        repaint content
-+        update the copy of painted content in thread 1
-+
-+This multithreaded model is called off-main-thread compositing (OMTC), because the compositing (where the content is displayed on-screen) happens on a separate thread from the main thread.
-+Note that this is a very very simplified model, but in this model the "adjust painted content based on input" is the primary function of the APZ code.
-+
-+The "painted content" is stored on a set of "layers", that are conceptually double-buffered.
-+That is, when the main thread does its repaint, it paints into one set of layers (the "client" layers).
-+The update that is sent to the compositor thread copies all the changes from the client layers into another set of layers that the compositor holds.
-+These layers are called the "shadow" layers or the "compositor" layers.
-+The compositor in theory can continuously composite these shadow layers to the screen while the main thread is busy doing other things and painting a new set of client layers.
-+
-+The APZ code takes the input events that are coming in from the hardware and uses them to figure out what the user is trying to do (e.g. pan the page, zoom in).
-+It then expresses this user intention in the form of translation and/or scale transformation matrices.
-+These transformation matrices are applied to the shadow layers at composite time, so that what the user sees on-screen reflects what they are trying to do as closely as possible.
-+
-+## Technical overview
-+
-+As per the heavily simplified model described above, the fundamental purpose of the APZ code is to take input events and produce transformation matrices.
-+This section attempts to break that down and identify the different problems that make this task non-trivial.
-+
-+### Checkerboarding
-+
-+The content area that is painted and stored in a shadow layer is called the "displayport".
-+The APZ code is responsible for determining how large the displayport should be.
-+On the one hand, we want the displayport to be as large as possible.
-+At the very least it needs to be larger than what is visible on-screen, because otherwise, as soon as the user pans, there will be some unpainted area of the page exposed.
-+However, we cannot always set the displayport to be the entire page, because the page can be arbitrarily long and this would require an unbounded amount of memory to store.
-+Therefore, a good displayport size is one that is larger than the visible area but not so large that it is a huge drain on memory.
-+Because the displayport is usually smaller than the whole page, it is always possible for the user to scroll so fast that they end up in an area of the page outside the displayport.
-+When this happens, they see unpainted content; this is referred to as "checkerboarding", and we try to avoid it where possible.
-+
-+There are many possible ways to determine what the displayport should be in order to balance the tradeoffs involved (i.e. having one that is too big is bad for memory usage, and having one that is too small results in excessive checkerboarding).
-+Ideally, the displayport should cover exactly the area that we know the user will make visible.
-+Although we cannot know this for sure, we can use heuristics based on current panning velocity and direction to ensure a reasonably-chosen displayport area.
-+This calculation is done in the APZ code, and a new desired displayport is frequently sent to the main thread as the user is panning around.
-+
-+### Multiple layers
-+
-+Consider, for example, a scrollable page that contains an iframe which itself is scrollable.
-+The iframe can be scrolled independently of the top-level page, and we would like both the page and the iframe to scroll responsively.
-+This means that we want independent asynchronous panning for both the top-level page and the iframe.
-+In addition to iframes, elements that have the overflow:scroll CSS property set are also scrollable, and also end up on separate scrollable layers.
-+In the general case, the layers are arranged in a tree structure, and so within the APZ code we have a matching tree of AsyncPanZoomController (APZC) objects, one for each scrollable layer.
-+To manage this tree of APZC instances, we have a single APZCTreeManager object.
-+Each APZC is relatively independent and handles the scrolling for its associated layer, but there are some cases in which they need to interact; these cases are described in the sections below.
-+
-+### Hit detection
-+
-+Consider again the case where we have a scrollable page that contains an iframe which itself is scrollable.
-+As described above, we will have two APZC instances - one for the page and one for the iframe.
-+When the user puts their finger down on the screen and moves it, we need to do some sort of hit detection in order to determine whether their finger is on the iframe or on the top-level page.
-+Based on where their finger lands, the appropriate APZC instance needs to handle the input.
-+This hit detection is also done in the APZCTreeManager, as it has the necessary information about the sizes and positions of the layers.
-+Currently this hit detection is not perfect, as it uses rects and does not account for things like rounded corners and opacity.
-+
-+Also note that for some types of input (e.g. when the user puts two fingers down to do a pinch) we do not want the input to be "split" across two different APZC instances.
-+In the case of a pinch, for example, we find a "common ancestor" APZC instance - one that is zoomable and contains all of the touch input points, and direct the input to that APZC instance.
-+
-+### Scroll Handoff
-+
-+Consider yet again the case where we have a scrollable page that contains an iframe which itself is scrollable.
-+Say the user scrolls the iframe so that it reaches the bottom.
-+If the user continues panning on the iframe, the expectation is that the top-level page will start scrolling.
-+However, as discussed in the section on hit detection, the APZC instance for the iframe is separate from the APZC instance for the top-level page.
-+Thus, we need the two APZC instances to communicate in some way such that input events on the iframe result in scrolling on the top-level page.
-+This behaviour is referred to as "scroll handoff" (or "fling handoff" in the case where analogous behaviour results from the scrolling momentum of the page after the user has lifted their finger).
-+
-+### Input event untransformation
-+
-+The APZC architecture by definition results in two copies of a "scroll position" for each scrollable layer.
-+There is the original copy on the main thread that is accessible to web content and the layout and painting code.
-+And there is a second copy on the compositor side, which is updated asynchronously based on user input, and corresponds to what the user visually sees on the screen.
-+Although these two copies may diverge temporarily, they are reconciled periodically.
-+In particular, they diverge while the APZ code is performing an async pan or zoom action on behalf of the user, and are reconciled when the APZ code requests a repaint from the main thread.
-+
-+Because of the way input events are stored, this has some unfortunate consequences.
-+Input events are stored relative to the device screen - so if the user touches at the same physical spot on the device, the same input events will be delivered regardless of the content scroll position.
-+When the main thread receives a touch event, it combines that with the content scroll position in order to figure out what DOM element the user touched.
-+However, because we now have two different scroll positions, this process may not work perfectly.
-+A concrete example follows:
-+
-+Consider a device with screen size 600 pixels tall.
-+On this device, a user is viewing a document that is 1000 pixels tall, and that is scrolled down by 200 pixels.
-+That is, the vertical section of the document from 200px to 800px is visible.
-+Now, if the user touches a point 100px from the top of the physical display, the hardware will generate a touch event with y=100.
-+This will get sent to the main thread, which will add the scroll position (200) and get a document-relative touch event with y=300.
-+This new y-value will be used in hit detection to figure out what the user touched.
-+If the document had a absolute-positioned div at y=300, then that would receive the touch event.
-+
-+Now let us add some async scrolling to this example.
-+Say that the user additionally scrolls the document by another 10 pixels asynchronously (i.e. only on the compositor thread), and then does the same touch event.
-+The same input event is generated by the hardware, and as before, the document will deliver the touch event to the div at y=300.
-+However, visually, the document is scrolled by an additional 10 pixels so this outcome is wrong.
-+What needs to happen is that the APZ code needs to intercept the touch event and account for the 10 pixels of asynchronous scroll.
-+Therefore, the input event with y=100 gets converted to y=110 in the APZ code before being passed on to the main thread.
-+The main thread then adds the scroll position it knows about and determines that the user touched at a document-relative position of y=310.
-+
-+Analogous input event transformations need to be done for horizontal scrolling and zooming.
-+
-+### Content independently adjusting scrolling
-+
-+As described above, there are two copies of the scroll position in the APZ architecture - one on the main thread and one on the compositor thread.
-+Usually for architectures like this, there is a single "source of truth" value and the other value is simply a copy.
-+However, in this case that is not easily possible to do.
-+The reason is that both of these values can be legitimately modified.
-+On the compositor side, the input events the user is triggering modify the scroll position, which is then propagated to the main thread.
-+However, on the main thread, web content might be running Javascript code that programatically sets the scroll position (via window.scrollTo, for example).
-+Scroll changes driven from the main thread are just as legitimate and need to be propagated to the compositor thread, so that the visual display updates in response.
-+
-+Because the cross-thread messaging is asynchronous, reconciling the two types of scroll changes is a tricky problem.
-+Our design solves this using various flags and generation counters.
-+The general heuristic we have is that content-driven scroll position changes (e.g. scrollTo from JS) are never lost.
-+For instance, if the user is doing an async scroll with their finger and content does a scrollTo in the middle, then some of the async scroll would occur before the "jump" and the rest after the "jump".
-+
-+### Content preventing default behaviour of input events
-+
-+Another problem that we need to deal with is that web content is allowed to intercept touch events and prevent the "default behaviour" of scrolling.
-+This ability is defined in web standards and is non-negotiable.
-+Touch event listeners in web content are allowed call preventDefault() on the touchstart or first touchmove event for a touch point; doing this is supposed to "consume" the event and prevent touch-based panning.
-+As we saw in a previous section, the input event needs to be untransformed by the APZ code before it can be delivered to content.
-+But, because of the preventDefault problem, we cannot fully process the touch event in the APZ code until content has had a chance to handle it.
-+Web browsers in general solve this problem by inserting a delay of up to 300ms before processing the input - that is, web content is allowed up to 300ms to process the event and call preventDefault on it.
-+If web content takes longer than 300ms, or if it completes handling of the event without calling preventDefault, then the browser immediately starts processing the events.
-+
-+The way the APZ implementation deals with this is that upon receiving a touch event, it immediately returns an untransformed version that can be dispatched to content.
-+It also schedules a 400ms timeout (600ms on Android) during which content is allowed to prevent scrolling.
-+There is an API that allows the main-thread event dispatching code to notify the APZ as to whether or not the default action should be prevented.
-+If the APZ content response timeout expires, or if the main-thread event dispatching code notifies the APZ of the preventDefault status, then the APZ continues with the processing of the events (which may involve discarding the events).
-+
-+The touch-action CSS property from the pointer-events spec is intended to allow eliminating this 400ms delay in many cases (although for backwards compatibility it will still be needed for a while).
-+Note that even with touch-action implemented, there may be cases where the APZ code does not know the touch-action behaviour of the point the user touched.
-+In such cases, the APZ code will still wait up to 400ms for the main thread to provide it with the touch-action behaviour information.
-+
-+## Technical details
-+
-+This section describes various pieces of the APZ code, and goes into more specific detail on APIs and code than the previous sections.
-+The primary purpose of this section is to help people who plan on making changes to the code, while also not going into so much detail that it needs to be updated with every patch.
-+
-+### Overall flow of input events
-+
-+This section describes how input events flow through the APZ code.
-+<ol>
-+<li value="1">
-+Input events arrive from the hardware/widget code into the APZ via APZCTreeManager::ReceiveInputEvent.
-+The thread that invokes this is called the input thread, and may or may not be the same as the Gecko main thread.
-+</li>
-+<li value="2">
-+Conceptually the first thing that the APZCTreeManager does is to associate these events with "input blocks".
-+An input block is a set of events that share certain properties, and generally are intended to represent a single gesture.
-+For example with touch events, all events following a touchstart up to but not including the next touchstart are in the same block.
-+All of the events in a given block will go to the same APZC instance and will either all be processed or all be dropped.
-+</li>
-+<li value="3">
-+Using the first event in the input block, the APZCTreeManager does a hit-test to see which APZC it hits.
-+This hit-test uses the event regions populated on the layers, which may be larger than the true hit area of the layer.
-+If no APZC is hit, the events are discarded and we jump to step 6.
-+Otherwise, the input block is tagged with the hit APZC as a tentative target and put into a global APZ input queue.
-+</li>
-+<li value="4">
-+ <ol>
-+  <li value="i">
-+   If the input events landed outside the dispatch-to-content event region for the layer, any available events in the input block are processed.
-+   These may trigger behaviours like scrolling or tap gestures.
-+  </li>
-+  <li value="ii">
-+   If the input events landed inside the dispatch-to-content event region for the layer, the events are left in the queue and a 400ms timeout is initiated.
-+   If the timeout expires before step 9 is completed, the APZ assumes the input block was not cancelled and the tentative target is correct, and processes them as part of step 10.
-+  </li>
-+ </ol>
-+</li>
-+<li value="5">
-+The call stack unwinds back to APZCTreeManager::ReceiveInputEvent, which does an in-place modification of the input event so that any async transforms are removed.
-+</li>
-+<li value="6">
-+The call stack unwinds back to the widget code that called ReceiveInputEvent.
-+This code now has the event in the coordinate space Gecko is expecting, and so can dispatch it to the Gecko main thread.
-+</li>
-+<li value="7">
-+Gecko performs its own usual hit-testing and event dispatching for the event.
-+As part of this, it records whether any touch listeners cancelled the input block by calling preventDefault().
-+It also activates inactive scrollframes that were hit by the input events.
-+</li>
-+<li value="8">
-+The call stack unwinds back to the widget code, which sends two notifications to the APZ code on the input thread.
-+The first notification is via APZCTreeManager::ContentReceivedInputBlock, and informs the APZ whether the input block was cancelled.
-+The second notification is via APZCTreeManager::SetTargetAPZC, and informs the APZ of the results of the Gecko hit-test during event dispatch.
-+Note that Gecko may report that the input event did not hit any scrollable frame at all.
-+The SetTargetAPZC notification happens only once per input block, while the ContentReceivedInputBlock notification may happen once per block, or multiple times per block, depending on the input type.
-+</li>
-+<li value="9">
-+ <ol>
-+  <li value="i">
-+   If the events were processed as part of step 4(i), the notifications from step 8 are ignored and step 10 is skipped.
-+  </li>
-+  <li value="ii">
-+   If events were queued as part of step 4(ii), and steps 5-8 take less than 400ms, the arrival of both notifications from step 8 will mark the input block ready for processing.
-+  </li>
-+  <li value="iii">
-+   If events were queued as part of step 4(ii), but steps 5-8 take longer than 400ms, the notifications from step 8 will be ignored and step 10 will already have happened.
-+  </li>
-+ </ol>
-+</li>
-+<li value="10">
-+If events were queued as part of step 4(ii) they are now either processed (if the input block was not cancelled and Gecko detected a scrollframe under the input event, or if the timeout expired) or dropped (all other cases).
-+Note that the APZC that processes the events may be different at this step than the tentative target from step 3, depending on the SetTargetAPZC notification.
-+Processing the events may trigger behaviours like scrolling or tap gestures.
-+</li>
-+</ol>
-+
-+If the CSS touch-action property is enabled, the above steps are modified as follows:
-+<ul>
-+<li>
-+ In step 4, the APZC also requires the allowed touch-action behaviours for the input event.
-+ This might have been determined as part of the hit-test in APZCTreeManager; if not, the events are queued.
-+</li>
-+<li>
-+ In step 6, the widget code determines the content element at the point under the input element, and notifies the APZ code of the allowed touch-action behaviours.
-+ This notification is sent via a call to APZCTreeManager::SetAllowedTouchBehavior on the input thread.
-+</li>
-+<li>
-+ In step 9(ii), the input block will only be marked ready for processing once all three notifications arrive.
-+</li>
-+</ul>
-+
-+#### Threading considerations
-+
-+The bulk of the input processing in the APZ code happens on what we call "the input thread".
-+In practice the input thread could be the Gecko main thread, the compositor thread, or some other thread.
-+There are obvious downsides to using the Gecko main thread - that is, "asynchronous" panning and zooming is not really asynchronous as input events can only be processed while Gecko is idle.
-+In an e10s environment, using the Gecko main thread of the chrome process is acceptable, because the code running in that process is more controllable and well-behaved than arbitrary web content.
-+Using the compositor thread as the input thread could work on some platforms, but may be inefficient on others.
-+For example, on Android (Fennec) we receive input events from the system on a dedicated UI thread.
-+We would have to redispatch the input events to the compositor thread if we wanted to the input thread to be the same as the compositor thread.
-+This introduces a potential for higher latency, particularly if the compositor does any blocking operations - blocking SwapBuffers operations, for example.
-+As a result, the APZ code itself does not assume that the input thread will be the same as the Gecko main thread or the compositor thread.
-+
-+#### Active vs. inactive scrollframes
-+
-+The number of scrollframes on a page is potentially unbounded.
-+However, we do not want to create a separate layer for each scrollframe right away, as this would require large amounts of memory.
-+Therefore, scrollframes as designated as either "active" or "inactive".
-+Active scrollframes are the ones that do have their contents put on a separate layer (or set of layers), and inactive ones do not.
-+
-+Consider a page with a scrollframe that is initially inactive.
-+When layout generates the layers for this page, the content of the scrollframe will be flattened into some other PaintedLayer (call it P).
-+The layout code also adds the area (or bounding region in case of weird shapes) of the scrollframe to the dispatch-to-content region of P.
-+
-+When the user starts interacting with that content, the hit-test in the APZ code finds the dispatch-to-content region of P.
-+The input block therefore has a tentative target of P when it goes into step 4(ii) in the flow above.
-+When gecko processes the input event, it must detect the inactive scrollframe and activate it, as part of step 7.
-+Finally, the widget code sends the SetTargetAPZC notification in step 8 to notify the APZ that the input block should really apply to this new layer.
-+The issue here is that the layer transaction containing the new layer must reach the compositor and APZ before the SetTargetAPZC notification.
-+If this does not occur within the 400ms timeout, the APZ code will be unable to update the tentative target, and will continue to use P for that input block.
-+Input blocks that start after the layer transaction will get correctly routed to the new layer as there will now be a layer and APZC instance for the active scrollframe.
-+
-+This model implies that when the user initially attempts to scroll an inactive scrollframe, it may end up scrolling an ancestor scrollframe.
-+(This is because in the absence of the SetTargetAPZC notification, the input events will get applied to the closest ancestor scrollframe's APZC.)
-+Only after the round-trip to the gecko thread is complete is there a layer for async scrolling to actually occur on the scrollframe itself.
-+At that point the scrollframe will start receiving new input blocks and will scroll normally.
-diff --git a/gfx/doc/GraphicsOverview.md b/gfx/doc/GraphicsOverview.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/GraphicsOverview.md
-@@ -0,0 +1,83 @@
-+Mozilla Graphics Overview {#graphicsoverview}
-+=================
-+## Work in progress.  Possibly incorrect or incomplete.
-+
-+Overview
-+--------
-+The graphics systems is responsible for rendering (painting, drawing) the frame tree (rendering tree) elements as created by the layout system.  Each leaf in the tree has content, either bounded by a rectangle (or perhaps another shape, in the case of SVG.)
-+
-+The simple approach for producing the result would thus involve traversing the frame tree, in a correct order, drawing each frame into the resulting buffer and displaying (printing non-withstanding) that buffer when the traversal is done. It is worth spending some time on the "correct order" note above.  If there are no overlapping frames, this is fairly simple - any order will do, as long as there is no background.  If there is background, we just have to worry about drawing that first. Since we do not control the content, chances are the page is more complicated.  There are overlapping frames, likely with transparency, so we need to make sure the elements are draw "back to front", in layers, so to speak.  Layers are an important concept, and we will revisit them shortly, as they are central to fixing a major issue with the above simple approach.
-+
-+While the above simple approach will work, the performance will suffer.  Each time anything changes in any of the frames, the complete process needs to be repeated, everything needs to be redrawn.  Further, there is very little space to take advantage of the modern graphics (GPU) hardware, or multi-core computers.  If you recall from the previous sections, the frame tree is only accessible from the UI thread, so while we're doing all this work, the UI is basically blocked.
-+
-+### (Retained) Layers
-+
-+Layers framework was introduced to address the above performance issues, by having a part of the design address each item. At the high level:
-+
-+1. We create a layer tree. The leaf elements of the tree contain all frames (possibly multiple frames per leaf).
-+2. We render each layer tree element and cache (retain) the result.
-+3. We composite (combine) all the leaf elements into the final result.
-+
-+Let's examine each of these steps, in reverse order.
-+
-+### Compositing
-+We use the term composite as it implies that the order is important.  If the elements being composited overlap, whether there is transparency involved or not, the order in which they are combined will effect the result.
-+Compositing is where we can use some of the power of the modern graphics hardware.  It is optimal for doing this job. In the scenarios where only the position of individual frames changes, without the content inside them changing, we see why caching each layer would be advantageous - we only need to repeat the final compositing step, completely skipping the layer tree creation and the rendering of each leaf, thus speeding up the process considerably.
-+
-+Another benefit is equally apparent in the context of the stated deficiencies of the simple approach. We can use the available graphics hardware accelerated APIs to do the compositing step.  Direct3D, OpenGL can be used on different platforms and are well suited to accelerate this step.
-+
-+Finally, we can now envision performing the compositing step on a separate thread, unblocking the UI thread for other work, and doing more work in parallel.  More on this below.
-+
-+It is important to note that the number of operations in this step is proportional to the number of layer tree (leaf) elements, so there is additional work and complexity involved, when the layer tree is large.
-+
-+#### Render and retain layer elements
-+As we saw, the compositing step benefits from caching the intermediate result.  This does result in the extra memory usage, so needs to be considered during the layer tree creation. Beyond the caching, we can accelerate the rendering of each element by (indirectly) using the available platform APIs (e.g., Direct2D, CoreGraphics, even some of the 3D APIs like OpenGL or Direct3D) as available.  This is actually done through a platform independent API (see Moz2D) below, but is important to realize it does get accelerated appropriately.
-+
-+#### Creating the layer tree
-+We need to create a layer tree (from the frames tree), which will give us the correct result while striking the right balance between a layer per frame element and a single layer for the complete frames tree.  As was mentioned above, there is an overhead in traversing the whole tree and caching each of the elements, balanced by the performance improvements.  Some of the performance improvements are only noticed when something changes (e.g., one element is moving, we only need to redo the compositing step).
-+
-+### Refresh Driver
-+
-+### Layers
-+
-+#### Rendering each layer
-+
-+### Tiling vs. Buffer Rotation vs. Full paint
-+
-+#### Compositing for the final result
-+
-+### Graphics API
-+
-+#### Moz2D
-+* The Moz2D graphics API, part of the Azure project, is a cross-platform interface onto the various graphics backends that Gecko uses for rendering such as Direct2D (1.0 and 1.1), Skia, Cairo, Quartz, and NV Path. Adding a new graphics platform to Gecko is accomplished by adding a backend to Moz2D.
-+\see [Moz2D documentation on wiki](https://wiki.mozilla.org/Platform/GFX/Moz2D)
-+
-+#### Compositing
-+
-+#### Image Decoding
-+
-+#### Image Animation
-+
-+### Funny words
-+There are a lot of code words that we use to refer to projects, libraries, areas of the code.  Here's an attempt to cover some of those:
-+* Azure - See Moz2D in the Graphics API section above.
-+* Backend - See Moz2D in the Graphics API section above.
-+* Cairo - http://www.cairographics.org/.  Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. 
-+* Moz2D - See Moz2D in the Graphics API section above.
-+* Thebes - Graphics API that preceded Moz2D.
-+* Reflow
-+* Display list
-+
-+### [Historical Documents](http://www.youtube.com/watch?v=lLZQz26-kms)
-+A number of posts and blogs that will give you more details or more background, or reasoning that led to different solutions and approaches.
-+
-+* 2010-01 [Layers: Cross Platform Acceleration] (http://www.basschouten.com/blog1.php/layers-cross-platform-acceleration) 
-+* 2010-04 [Layers] (http://robert.ocallahan.org/2010/04/layers_01.html)
-+* 2010-07 [Retained Layers](http://robert.ocallahan.org/2010/07/retained-layers_16.html)
-+* 2011-04 [Introduction](https://blog.mozilla.org/joe/2011/04/26/introducing-the-azure-project/ Moz2D)
-+* 2011-07 [Layers](http://chrislord.net/index.php/2011/07/25/shadow-layers-and-learning-by-failing/ Shadow)
-+* 2011-09 [Graphics API Design](http://robert.ocallahan.org/2011/09/graphics-api-design.html)
-+* 2012-04 [Moz2D Canvas on OSX](http://muizelaar.blogspot.ca/2012/04/azure-canvas-on-os-x.html)
-+* 2012-05 [Mask Layers](http://featherweightmusings.blogspot.co.uk/2012/05/mask-layers_26.html)
-+* 2013-07 [Graphics related](http://www.basschouten.com/blog1.php)
-+
-diff --git a/gfx/doc/LayersHistory.md b/gfx/doc/LayersHistory.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/LayersHistory.md
-@@ -0,0 +1,60 @@
-+This is an overview of the major events in the history of our Layers infrastructure.
-+
-+- iPhone released in July 2007 (Built on a toolkit called LayerKit)
-+
-+- Core Animation (October 2007) LayerKit was publicly renamed to OS X 10.5
-+
-+- Webkit CSS 3d transforms (July 2009)
-+
-+- Original layers API (March 2010) Introduced the idea of a layer manager that
-+  would composite. One of the first use cases for this was hardware accelerated
-+  YUV conversion for video.
-+
-+- Retained layers (July 7 2010 - Bug 564991)
-+This was an important concept that introduced the idea of persisting the layer
-+content across paints in gecko controlled buffers instead of just by the OS. This introduced
-+the concept of buffer rotation to deal with scrolling instead of using the
-+native scrolling APIs like ScrollWindowEx
-+
-+- Layers IPC (July 2010 - Bug 570294)
-+This introduced shadow layers and edit lists and was originally done for e10s v1
-+
-+- 3d transforms (September 2011 - Bug 505115)
-+
-+- OMTC (December 2011 - Bug 711168)
-+This was prototyped on OS X but shipped first for Fennec
-+
-+- Tiling v1 (April 2012 - Bug 739679)
-+Originally done for Fennec.
-+This was done to avoid situations where we had to do a bunch of work for
-+scrolling a small amount. i.e. buffer rotation.  It allowed us to have a
-+variety of interesting features like progressive painting and lower resolution
-+painting.
-+
-+- C++ Async pan zoom controller (July 2012 - Bug 750974)
-+The existing APZ code was in Java for Fennec so this was reimplemented.
-+
-+- Streaming WebGL Buffers (February 2013 - Bug 716859)
-+Infrastructure to allow OMTC WebGL and avoid the need to glFinish() every
-+frame.
-+
-+- Compositor API (April 2013 - Bug 825928)
-+The planning for this started around November 2012.
-+Layers refactoring created a compositor API that abstracted away the differences between the
-+D3D vs OpenGL. The main piece of API is DrawQuad.
-+
-+- Tiling v2 (Mar 7 2014 - Bug 963073)
-+Tiling for B2G. This work is mainly porting tiled layers to new textures,
-+implementing double-buffered tiles and implementing a texture client pool, to
-+be used by tiled content clients.
-+
-+ A large motivation for the pool was the very slow performance of allocating tiles because
-+of the sync messages to the compositor.
-+
-+ The slow performance of allocating was directly addressed by bug 959089 which allowed us
-+to allocate gralloc buffers without sync messages to the compositor thread.
-+
-+- B2G WebGL performance (May 2014 - Bug 1006957, 1001417, 1024144)
-+This work improved the synchronization mechanism between the compositor
-+and the producer.
-+
-diff --git a/gfx/doc/MainPage.md b/gfx/doc/MainPage.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/MainPage.md
-@@ -0,0 +1,21 @@
-+Mozilla Graphics {#mainpage}
-+======================
-+
-+## Work in progress.  Possibly incorrect or incomplete.
-+
-+
-+Introduction
-+-------
-+This collection of linked pages contains a combination of Doxygen
-+extracted source code documentation and design documents for the
-+Mozilla graphics architecture.  The design documents live in gfx/docs directory.
-+
-+This [wiki page](https://wiki.mozilla.org/Platform/GFX) contains
-+information about graphics and the graphics team at MoCo.
-+
-+Continue here for a [very high level introductory overview](@ref graphicsoverview)
-+if you don't know where to start.
-+
-+Useful pointers for creating documentation
-+------
-+[The mechanics of creating these files](https://wiki.mozilla.org/Platform/GFX/DesignDocumentationGuidelines)
-diff --git a/gfx/doc/MozSurface.md b/gfx/doc/MozSurface.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/MozSurface.md
-@@ -0,0 +1,124 @@
-+MozSurface {#mozsurface}
-+==========
-+
-+**This document is work in progress.  Some information may be missing or incomplete.**
-+
-+## Goals
-+
-+We need to be able to safely and efficiently render web content into surfaces that may be shared accross processes.
-+MozSurface is a cross-process and backend-independent Surface API and not a stream API.
-+
-+## Owner
-+
-+Nicolas Silva
-+
-+## Definitions
-+
-+## Use cases
-+
-+Drawing web content into a surface and share it with the compositor process to display it on the screen without copies.
-+
-+## Requirement
-+
-+* It must be possible to efficiently share a MozSurface with a separate thread or process through IPDL
-+* It must be possible to obtain read access a MozSurface on both the client and the host side at the same time.
-+* The creation, update and destrution of surfaces must be safe and race-free. In particular, the ownership of the shared data must be clearly defined.
-+* MozSurface must be a cross-backend/cross-platform abstraction that we will use on all of the supported platforms.
-+* It must be possible to efficiently draw into a MozSurface using Moz2D.
-+* While it should be possible to share MozSurfaces accross processes, it should not be limited to that. MozSurface should also be the preferred abstraction for use with surfaces that are not shared with the compositor process.
-+
-+## TextureClient and TextureHost
-+
-+TextureClient and TextureHost are the closest abstractions we currently have to MozSurface. The current plan is to evolve TextureClient into MozSurface. In its current state, TextureClient doesn't meet all the requirements and desisgn decisions of MozSurface yet.
-+
-+In particular, TextureClient/TextureHost are designed around cross-process sharing specifically. See the SharedMozSurface design document for more information about TextureClient and TextureHost.
-+
-+## Locking semantics
-+
-+In order to access the shared surface data users of MozSurface must acquire and release a lock on the surface, specifying the open mode (read/write/read+write).
-+
-+    bool Lock(OpenMode aMode);
-+    void Unlock();
-+
-+This locking API has two purposes:
-+
-+* Ensure that access to the shared data is race-free.
-+* Let the implemetation do whatever is necessary for the user to have access to the data. For example it can be mapping and unmapping the surface data in memory if the underlying backend requires it.
-+
-+The lock is expected to behave as a cross-process blocking read/write lock that is not reentrant.
-+
-+## Immutable surfaces
-+
-+In some cases we know in advance that a surface will not be modified after it has been shared. This is for example true for video frames. In this case the surface can be marked as immutable and the underlying implementation doesn't need to hold an actual blocking lock on the shared data.
-+Trying to acquire a write lock on a MozSurface that is marked as immutable and already shared must fail (return false).
-+Note that it is still required to use the Lock/Unlock API to read the data, in order for the implementation to be able to properly map and unmap the memory. This is just an optimization and a safety check.
-+
-+## Drawing into a surface
-+
-+In most cases we want to be able to paint directly into a surface through the Moz2D API.
-+
-+A surface lets you *borrow* a DrawTarget that is only valid between Lock and Unlock.
-+
-+    DrawTarget* GetAsDrawTarget();
-+
-+It is invalid to hold a reference to the DrawTarget after Unlock, and a different DrawTarget may be obtained during the next Lock/Unlock interval.
-+
-+In some cases we want to use MozSurface without drawing into it. For instance to share video frames accross processes. Some surface types may also not be accessible through a DrawTarget (for example YCbCr surfaces).
-+
-+    bool CanExposeDrawTarget();
-+
-+helps with making sure that a Surface supports exposing a Moz2D DrawTarget.
-+
-+## Using a MozSurface as a source for Compositing
-+
-+To interface with the Compositor API, MozSurface gives access to TextureSource objects. TextureSource is the cross-backend representation of a texture that Compositor understands.
-+While MozSurface handles memory management of (potentially shared) texture data, TextureSource is only an abstraction for Compositing.
-+
-+## Fence synchronization
-+
-+TODO: We need to figure this out. Right now we have a Gonk specific implementation, but no cross-platform abstraction/design.
-+
-+## Ownership of the shared data
-+
-+MozSurface (TextureClient/TextureHost in its current form) defines ownership rules that depend on the configuration of the surface, in order to satisy efficiency and safety requirements.
-+
-+These rules rely on the fact that the underlying shared data is strictly owned by the MozSurface. This means that keeping direct references to the shared data is illegal and unsafe.
-+
-+## Internal buffers / direct texturing
-+
-+Some MozSurface implementations use CPU-side shared memory to share the texture data accross processes, and require a GPU texture upload when interfacing with a TextureSource. In this case we say that the surface has an internal buffer (because it is implicitly equivalent to double buffering where the shared data is the back buffer and the GPU side texture is the front buffer). We also say that it doesn't do "direct texturing" meaning that we don't draw directly into the GPU-side texture.
-+
-+Examples:
-+
-+ * Shmem MozSurface + OpenGL TextureSource: Has an internal buffer (no direct texturing)
-+ * Gralloc MozSurface + Gralloc TextureSource: No internal buffer (direct texturing)
-+
-+While direct texturing is usually the most efficient way, it is not always available depending on the platform and the required allocation size or format. Textures with internal buffers have less restrictions around locking since the host side will only need to read from the MozSurface once per update, meaning that we can often get away with single buffering where we would need double buffering with direct texturing.
-+
-+## Alternative solutions
-+
-+## Backends
-+
-+We have MozSurface implementaions (classes inheriting from TextureClient/TextureHost) for OpenGL, Software, D3D9, and D3D11 backends.
-+Some implemtations can be used with any backend (ex. ShmemTextureClient/Host).
-+
-+## Users of MozSurface
-+
-+MozSurface is the mechanism used by layers to share surfaces with the compositor, but it is not limited to layers. It should be used by anything that draws into a surface that may be shared with the compositor thread.
-+
-+## Testing
-+
-+TODO - How can we make MozSurface more testable and what should we test?
-+
-+## Future work
-+
-+### Using a MozSurface as a source for Drawing
-+
-+MozSurface should be able to expose a borrowed Moz2D SourceSurface that is valid between Lock and Unlock similarly to how it exposes a DrawTarget.
-+
-+## Comparison with other APIs
-+
-+MozSurface is somewhat equivalent to Gralloc on Android/Gonk: it is a reference counted cross-process surface with locking semantics. While Gralloc can interface itself with OpenGL textures for compositing, MozSurface can interface itself to TextureSource objects.
-+
-+MozSurface should not be confused with higher level APIs such as EGLStream. A swap-chain API like EGLStream can be implemented on top of MozSurface, but MozSurface's purpose is to define and manage the memory and resources of shared texture data.
-+
-diff --git a/gfx/webrender_bindings/README.webrender b/gfx/doc/README.webrender
-rename from gfx/webrender_bindings/README.webrender
-rename to gfx/doc/README.webrender
-diff --git a/gfx/doc/SharedMozSurface.md b/gfx/doc/SharedMozSurface.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/SharedMozSurface.md
-@@ -0,0 +1,147 @@
-+Shared MozSurface {#mozsurface}
-+==========
-+
-+**This document is work in progress.  Some information may be missing or incomplete.**
-+
-+Shared MozSurfaces represent an important use case of MozSurface, anything that is in the MozSurface design document also applies to shared MozSurfaces.
-+
-+## Goals
-+
-+We need to be able to safely and efficiently render web content into surfaces that may be shared accross processes.
-+MozSurface is a cross-process and backend-independent Surface API and not a stream API.
-+
-+## Owner
-+
-+Nicolas Silva
-+
-+## Definitions
-+
-+* Client and Host: In Gecko's compositing architecture, the client process is the producer, while the host process is the consumer side, where compositing takes place.
-+
-+## Use cases
-+
-+Drawing web content into a surface and share it with the compositor process to display it on the screen without copies.
-+
-+## Requirement
-+
-+Shared MozSurfaces represent an important use case of MozSurface, it has the same requirements as MozSurface.
-+
-+## TextureClient and TextureHost
-+
-+TextureClient and TextureHost are the closest abstractions we currently have to MozSurface.
-+Inline documentation about TextureClient and TextureHost can be found in:
-+
-+* [gfx/layers/client/TextureClient.h](http://dxr.mozilla.org/mozilla-central/source/gfx/layers/client/TextureClient.h)
-+* [gfx/layers/composite/TextureHost.h](http://dxr.mozilla.org/mozilla-central/source/gfx/layers/composite/TextureHost.h)
-+
-+TextureClient is the client-side handle on a MozSurface, while TextureHost is the equivalent host-side representation. There can only be one TextureClient for a given TextureHost, and one TextureHost for a given TextureClient. Likewise, there can only be one shared object for a given TextureClient/TextureHost pair.
-+
-+A MozSurface containing data that is shared between a client process and a host process exists in the following form:
-+
-+```
-+                                 .
-+            Client process       .      Host process
-+                                 .
-+     ________________      ______________      ______________
-+    |                |    |              |    |              |
-+    | TextureClient  +----+ <SharedData> +----+ TextureHost  |
-+    |________________|    |______________|    |______________|
-+                                 .
-+                                 .
-+                                 .
-+    Figure 1) A Surface as seen by the client and the host processes
-+```
-+
-+The above figure is a logical representation, not a class diagram.
-+`<SharedData>` is a placeholder for whichever platform specific surface type we are sharing, for example a Gralloc buffer on Gonk or a D3D11 texture on Windows.
-+
-+## Deallocation protocol
-+
-+The shared data is accessible by both the client-side and the host-side of the MozSurface. A deallocation protocol must be defined to handle which side deallocates the data, and to ensure that it doesn't cause any race condition.
-+The client side, which contains the web content's logic, always "decides" when a surface is needed or not. So the life time of a MozSurface is driven by the reference count of it's client-side handle (TextureClient).
-+When a TextureClient's reference count reaches zero, a "Remove" message is sent in order to let the host side that the shared data is not accessible on the client side and that it si safe for it to be deleted. The host side responds with a "Delete" message.
-+
-+
-+```
-+           client side                .         host side
-+                                      .
-+    (A) Client: Send Remove     -.    .
-+                                  \   .
-+                                   \  .   ... can receive and send ...
-+                                    \
-+        Can receive                  `--> (B) Host: Receive Remove
-+        Can't send                         |
-+                                      .-- (C) Host: Send Delete
-+                                     /
-+                                    / .   ... can't receive nor send ...
-+                                   /  .
-+    (D) Client: Receive Delete <--'   .
-+                                      .
-+    Figure 2) MozSurface deallocation handshake
-+```
-+
-+This handshake protocol is twofold:
-+
-+* It defines where and when it is possible to deallocate the shared data without races
-+* It makes it impossible for asynchronous messages to race with the destruction of the MozSurface.
-+
-+### Deallocating on the host side
-+
-+In the common case, the shared data is deallocated asynchronously on the host side. In this case the deallocation takes place at the point (C) of figure 2.
-+
-+### Deallocating on the client side
-+
-+In some rare cases, for instance if the underlying implementation requires it, the shared data must be deallocated on the client side. In such cases, deallocation happens at the point (D) of figure 2.
-+
-+In some exceptional cases, this needs to happen synchronously, meaning that the client-side thread will block until the Delete message is received. This is supported but it is terrible for performance, so it should be avoided as much as possible.
-+Currently this is needed when shutting down a hardware-decoded video stream with libstagefright on Gonk, because the libstagefright unfortunately assumes it has full ownership over the shared data (gralloc buffers) and crashes if there are still users of the buffers.
-+
-+### Sharing state
-+
-+The above deallocation protocol of a MozSurface applies to the common case that is when the surface is shared between two processes. A Surface can also be deallocated while it is not shared.
-+
-+The sharing state of a MozSurface can be one of the following:
-+
-+* (1) Uninitialized (it doesn't have any shared data)
-+* (2) Local (it isn't shared with the another thread/process)
-+* (3) Shared (the state you would expect it to be most of the time)
-+* (4) Invalid (when for some rare cases we needed to force the deallocation of the shared data before the destruction of the TextureClient object).
-+
-+Surfaces can move from state N to state N+1 and be deallocated in any of these states. It could be possible to move from Shared to Local, but we currently don't have a use case for it.
-+
-+The deallocation protocol above, applies to the Shared state (3).
-+In the other cases:
-+
-+* (1) Unitilialized: There is nothing to do.
-+* (2) Local: The shared data is deallocated by the client side without need for a handshake, since it is not shared with other threads.
-+* (4) Invalid: There is nothing to do (deallocation has already happenned).
-+
-+## Alternative solutions
-+
-+### Sending ownership back and forth between the client and host sides through message passing, intead of sharing.
-+
-+The current design of MozSurface makes the surface accessible from both sides at the same time, forcing us to do Locking and have a hand shake around deallocating the shared data, while using pure message passing and making the surface accessible only from one side at a time would avoid these complications.
-+
-+Using pure message passing was actually the first approach we tried when we created the first version of TextureClient and TextureHost. This strategy failed in several places, partly because of some legacy in Gecko's architecture, and partly because of some of optimizations we do to avoid copying surfaces.
-+
-+We need a given surface to be accessible on both the client and host for the following reasons:
-+
-+* Gecko can at any time require read access on the client side to a surface that is shared with the host process, for example to build a temporary layer manager and generate a screenshot. This is mostly a legacy problem.
-+* We do some copy-on-write optimizations on surfaces that are shared with the compositor in order to keep invalid regions as small as possible. Out tiling implementation is an example of that.
-+* Our buffer rotation code on scrollable non-tiled layers also requires a synchronization on the client side between the front and back buffers, while the front buffer is used on the host side.
-+
-+## Testing
-+
-+TODO - How can we make shared MozSurfaces more testable and what should we test?
-+
-+## Future work
-+
-+### Rename TextureClient/TextureHost
-+
-+The current terminology is very confusing.
-+
-+### Unify TextureClient and TextureHost
-+
-+TextureClient and TextureHost should live under a common interface to better hide the IPC details. The base classe should only expose the non-ipc related methods such as Locking, access through a DrawTarget, access to a TextureSource.
-+
-+## Comparison with other APIs
-diff --git a/gfx/doc/Silk.md b/gfx/doc/Silk.md
-new file mode 100644
---- /dev/null
-+++ b/gfx/doc/Silk.md
-@@ -0,0 +1,246 @@
-+Silk Architecture Overview
-+=================
-+
-+#Architecture
-+Our current architecture is to align three components to hardware vsync timers:
-+
-+1. Compositor
-+2. RefreshDriver / Painting
-+3. Input Events
-+
-+The flow of our rendering engine is as follows:
-+
-+1. Hardware Vsync event occurs on an OS specific *Hardware Vsync Thread* on a per monitor basis.
-+2. The *Hardware Vsync Thread* attached to the monitor notifies the **CompositorVsyncDispatchers** and **RefreshTimerVsyncDispatcher**.
-+3. For every Firefox window on the specific monitor, notify a **CompositorVsyncDispatcher**. The **CompositorVsyncDispatcher** is specific to one window.
-+4. The **CompositorVsyncDispatcher** notifies a **CompositorWidgetVsyncObserver** when remote compositing, or a **CompositorVsyncScheduler::Observer** when compositing in-process.
-+5. If remote compositing, a vsync notification is sent from the **CompositorWidgetVsyncObserver** to the **VsyncBridgeChild** on the UI process, which sends an IPDL message to the **VsyncBridgeParent** on the compositor thread of the GPU process, which then dispatches to **CompositorVsyncScheduler::Observer**.
-+6. The **RefreshTimerVsyncDispatcher** notifies the Chrome **RefreshTimer** that a vsync has occured.
-+7. The **RefreshTimerVsyncDispatcher** sends IPC messages to all content processes to tick their respective active **RefreshTimer**.
-+8. The **Compositor** dispatches input events on the *Compositor Thread*, then composites. Input events are only dispatched on the *Compositor Thread* on b2g.
-+9. The **RefreshDriver** paints on the *Main Thread*.
-+
-+The implementation is broken into the following sections and will reference this figure. Note that **Objects** are bold fonts while *Threads* are italicized.
-+
-+<img src="silkArchitecture.png" width="900px" height="630px" />
-+
-+#Hardware Vsync
-+Hardware vsync events from (1), occur on a specific **Display** Object.
-+The **Display** object is responsible for enabling / disabling vsync on a per connected display basis.
-+For example, if two monitors are connected, two **Display** objects will be created, each listening to vsync events for their respective displays.
-+We require one **Display** object per monitor as each monitor may have different vsync rates.
-+As a fallback solution, we have one global **Display** object that can synchronize across all connected displays.
-+The global **Display** is useful if a window is positioned halfway between the two monitors.
-+Each platform will have to implement a specific **Display** object to hook and listen to vsync events.
-+As of this writing, both Firefox OS and OS X create their own hardware specific *Hardware Vsync Thread* that executes after a vsync has occured.
-+OS X creates one *Hardware Vsync Thread* per **CVDisplayLinkRef**.
-+We do not currently support multiple displays, so we use one global **CVDisplayLinkRef** that works across all active displays.
-+On Windows, we have to create a new platform *thread* that waits for DwmFlush(), which works across all active displays.
-+Once the thread wakes up from DwmFlush(), the actual vsync timestamp is retrieved from DwmGetCompositionTimingInfo(), which is the timestamp that is actually passed into the compositor and refresh driver.
-+
-+When a vsync occurs on a **Display**, the *Hardware Vsync Thread* callback fetches all **CompositorVsyncDispatchers** associated with the **Display**.
-+Each **CompositorVsyncDispatcher** is notified that a vsync has occured with the vsync's timestamp.
-+It is the responsibility of the **CompositorVsyncDispatcher** to notify the **Compositor** that is awaiting vsync notifications.
-+The **Display** will then notify the associated **RefreshTimerVsyncDispatcher**, which should notify all active **RefreshDrivers** to tick.
-+
-+All **Display** objects are encapsulated in a **VsyncSource** object.
-+The **VsyncSource** object lives in **gfxPlatform** and is instantiated only on the parent process when **gfxPlatform** is created.
-+The **VsyncSource** is destroyed when **gfxPlatform** is destroyed.
-+There is only one **VsyncSource** object throughout the entire lifetime of Firefox.
-+Each platform is expected to implement their own **VsyncSource** to manage vsync events.
-+On Firefox OS, this is through the **HwcComposer2D**.
-+On OS X, this is through **CVDisplayLinkRef**.
-+On Windows, it should be through **DwmGetCompositionTimingInfo**.
-+
-+#Compositor
-+When the **CompositorVsyncDispatcher** is notified of the vsync event, the **CompositorVsyncScheduler::Observer** associated with the **CompositorVsyncDispatcher** begins execution.
-+Since the **CompositorVsyncDispatcher** executes on the *Hardware Vsync Thread* and the **Compositor** composites on the *CompositorThread*, the **CompositorVsyncScheduler::Observer** posts a task to the *CompositorThread*.
-+The **CompositorBridgeParent** then composites.
-+The model where the **CompositorVsyncDispatcher** notifies components on the *Hardware Vsync Thread*, and the component schedules the task on the appropriate thread is used everywhere.
-+
-+The **CompositorVsyncScheduler::Observer** listens to vsync events as needed and stops listening to vsync when composites are no longer scheduled or required.
-+Every **CompositorBridgeParent** is associated and tied to one **CompositorVsyncScheduler::Observer**, which is associated with the **CompositorVsyncDispatcher**.
-+Each **CompositorBridgeParent** is associated with one widget and is created when a new platform window or **nsBaseWidget** is created.
-+The **CompositorBridgeParent**, **CompositorVsyncDispatcher**, **CompositorVsyncScheduler::Observer**, and **nsBaseWidget** all have the same lifetimes, which are created and destroyed together.
-+
-+##Out-of-process Compositors
-+When compositing out-of-process, this model changes slightly.
-+In this case there are effectively two observers: a UI process observer (**CompositorWidgetVsyncObserver**), and the **CompositorVsyncScheduler::Observer** in the GPU process.
-+There are also two dispatchers: the widget dispatcher in the UI process (**CompositorVsyncDispatcher**), and the IPDL-based dispatcher in the GPU process (**CompositorBridgeParent::NotifyVsync**).
-+The UI process observer and the GPU process dispatcher are linked via an IPDL protocol called PVsyncBridge.
-+**PVsyncBridge** is a top-level protocol for sending vsync notifications to the compositor thread in the GPU process.
-+The compositor controls vsync observation through a separate actor, **PCompositorWidget**, which (as a subactor for **CompositorBridgeChild**) links the compositor thread in the GPU process to the main thread in the UI process.
-+
-+Out-of-process compositors do not go through **CompositorVsyncDispatcher** directly.
-+Instead, the **CompositorWidgetDelegate** in the UI process creates one, and gives it a **CompositorWidgetVsyncObserver**.
-+This observer forwards notifications to a Vsync I/O thread, where **VsyncBridgeChild** then forwards the notification again to the compositor thread in the GPU process.
-+The notification is received by a **VsyncBridgeParent**.
-+The GPU process uses the layers ID in the notification to find the correct compositor to dispatch the notification to.
-+
-+###CompositorVsyncDispatcher
-+The **CompositorVsyncDispatcher** executes on the *Hardware Vsync Thread*.
-+It contains references to the **nsBaseWidget** it is associated with and has a lifetime equal to the **nsBaseWidget**.
-+The **CompositorVsyncDispatcher** is responsible for notifying the **CompositorBridgeParent** that a vsync event has occured.
-+There can be multiple **CompositorVsyncDispatchers** per **Display**, one **CompositorVsyncDispatcher** per window.
-+The only responsibility of the **CompositorVsyncDispatcher** is to notify components when a vsync event has occured, and to stop listening to vsync when no components require vsync events.
-+We require one **CompositorVsyncDispatcher** per window so that we can handle multiple **Displays**.
-+When compositing in-process, the **CompositorVsyncDispatcher** is attached to the CompositorWidget for the
-+window. When out-of-process, it is attached to the CompositorWidgetDelegate, which forwards
-+observer notifications over IPDL. In the latter case, its lifetime is tied to a CompositorSession
-+rather than the nsIWidget.
-+
-+###Multiple Displays
-+The **VsyncSource** has an API to switch a **CompositorVsyncDispatcher** from one **Display** to another **Display**.
-+For example, when one window either goes into full screen mode or moves from one connected monitor to another.
-+When one window moves to another monitor, we expect a platform specific notification to occur.
-+The detection of when a window enters full screen mode or moves is not covered by Silk itself, but the framework is built to support this use case.
-+The expected flow is that the OS notification occurs on **nsIWidget**, which retrieves the associated **CompositorVsyncDispatcher**.
-+The **CompositorVsyncDispatcher** then notifies the **VsyncSource** to switch to the correct **Display** the **CompositorVsyncDispatcher** is connected to.
-+Because the notification works through the **nsIWidget**, the actual switching of the **CompositorVsyncDispatcher** to the correct **Display** should occur on the *Main Thread*.
-+The current implementation of Silk does not handle this case and needs to be built out.
-+
-+###CompositorVsyncScheduler::Observer
-+The **CompositorVsyncScheduler::Observer** handles the vsync notifications and interactions with the **CompositorVsyncDispatcher**.
-+When the **Compositor** requires a scheduled composite, it notifies the **CompositorVsyncScheduler::Observer** that it needs to listen to vsync.
-+The **CompositorVsyncScheduler::Observer** then observes / unobserves vsync as needed from the **CompositorVsyncDispatcher** to enable composites.
-+
-+###GeckoTouchDispatcher
-+The **GeckoTouchDispatcher** is a singleton that resamples touch events to smooth out jank while tracking a user's finger.
-+Because input and composite are linked together, the **CompositorVsyncScheduler::Observer** has a reference to the **GeckoTouchDispatcher** and vice versa.
-+
-+###Input Events
-+One large goal of Silk is to align touch events with vsync events.
-+On Firefox OS, touchscreens often have different touch scan rates than the display refreshes.
-+A Flame device has a touch refresh rate of 75 HZ, while a Nexus 4 has a touch refresh rate of 100 HZ, while the device's display refresh rate is 60HZ.
-+When a vsync event occurs, we resample touch events, and then dispatch the resampled touch event to APZ.
-+Touch events on Firefox OS occur on a *Touch Input Thread* whereas they are processed by APZ on the *APZ Controller Thread*.
-+We use [Google Android's touch resampling](http://www.masonchang.com/blog/2014/8/25/androids-touch-resampling-algorithm) algorithm to resample touch events.
-+
-+Currently, we have a strict ordering between Composites and touch events.
-+When a touch event occurs on the *Touch Input Thread*, we store the touch event in a queue.
-+When a vsync event occurs, the **CompositorVsyncDispatcher** notifies the **Compositor** of a vsync event, which notifies the **GeckoTouchDispatcher**.
-+The **GeckoTouchDispatcher** processes the touch event first on the *APZ Controller Thread*, which is the same as the *Compositor Thread* on b2g, then the **Compositor** finishes compositing.
-+We require this strict ordering because if a vsync notification is dispatched to both the **Compositor** and **GeckoTouchDispatcher** at the same time, a race condition occurs between processing the touch event and therefore position versus compositing.
-+In practice, this creates very janky scrolling.
-+As of this writing, we have not analyzed input events on desktop platforms.
-+
-+One slight quirk is that input events can start a composite, for example during a scroll and after the **Compositor** is no longer listening to vsync events.
-+In these cases, we notify the **Compositor** to observe vsync so that it dispatches touch events.
-+If touch events were not dispatched, and since the **Compositor** is not listening to vsync events, the touch events would never be dispatched.
-+The **GeckoTouchDispatcher** handles this case by always forcing the **Compositor** to listen to vsync events while touch events are occurring.
-+
-+###Widget, Compositor, CompositorVsyncDispatcher, GeckoTouchDispatcher Shutdown Procedure
-+When the [nsBaseWidget shuts down](https://hg.mozilla.org/mozilla-central/file/0df249a0e4d3/widget/nsBaseWidget.cpp#l182) - It calls nsBaseWidget::DestroyCompositor on the *Gecko Main Thread*.
-+During nsBaseWidget::DestroyCompositor, it first destroys the CompositorBridgeChild.
-+CompositorBridgeChild sends a sync IPC call to CompositorBridgeParent::RecvStop, which calls [CompositorBridgeParent::Destroy](https://hg.mozilla.org/mozilla-central/file/ab0490972e1e/gfx/layers/ipc/CompositorBridgeParent.cpp#l509).
-+During this time, the *main thread* is blocked on the parent process.
-+CompositorBridgeParent::RecvStop runs on the *Compositor thread* and cleans up some resources, including setting the **CompositorVsyncScheduler::Observer** to nullptr.
-+CompositorBridgeParent::RecvStop also explicitly keeps the CompositorBridgeParent alive and posts another task to run CompositorBridgeParent::DeferredDestroy on the Compositor loop so that all ipdl code can finish executing.
-+The **CompositorVsyncScheduler::Observer** also unobserves from vsync and cancels any pending composite tasks.
-+Once CompositorBridgeParent::RecvStop finishes, the *main thread* in the parent process continues shutting down the nsBaseWidget.
-+
-+At the same time, the *Compositor thread* is executing tasks until CompositorBridgeParent::DeferredDestroy runs, which flushes the compositor message loop.
-+Now we have two tasks as both the nsBaseWidget releases a reference to the Compositor on the *main thread* during destruction and the CompositorBridgeParent::DeferredDestroy releases a reference to the CompositorBridgeParent on the *Compositor Thread*.
-+Finally, the CompositorBridgeParent itself is destroyed on the *main thread* once both references are gone due to explicit [main thread destruction](https://hg.mozilla.org/mozilla-central/file/50b95032152c/gfx/layers/ipc/CompositorBridgeParent.h#l148).
-+
-+With the **CompositorVsyncScheduler::Observer**, any accesses to the widget after nsBaseWidget::DestroyCompositor executes are invalid.
-+Any accesses to the compositor between the time the nsBaseWidget::DestroyCompositor runs and the CompositorVsyncScheduler::Observer's destructor runs aren't safe yet a hardware vsync event could occur between these times.
-+Since any tasks posted on the Compositor loop after CompositorBridgeParent::DeferredDestroy is posted are invalid, we make sure that no vsync tasks can be posted once CompositorBridgeParent::RecvStop executes and DeferredDestroy is posted on the Compositor thread.
-+When the sync call to CompositorBridgeParent::RecvStop executes, we explicitly set the CompositorVsyncScheduler::Observer to null to prevent vsync notifications from occurring.
-+If vsync notifications were allowed to occur, since the **CompositorVsyncScheduler::Observer**'s vsync notification executes on the *hardware vsync thread*, it would post a task to the Compositor loop and may execute after CompositorBridgeParent::DeferredDestroy.
-+Thus, we explicitly shut down vsync events in the **CompositorVsyncDispatcher** and **CompositorVsyncScheduler::Observer** during nsBaseWidget::Shutdown to prevent any vsync tasks from executing after CompositorBridgeParent::DeferredDestroy.
-+
-+The **CompositorVsyncDispatcher** may be destroyed on either the *main thread* or *Compositor Thread*, since both the nsBaseWidget and **CompositorVsyncScheduler::Observer** race to destroy on different threads.
-+nsBaseWidget is destroyed on the *main thread* and releases a reference to the **CompositorVsyncDispatcher** during destruction.
-+The **CompositorVsyncScheduler::Observer** has a race to be destroyed either during CompositorBridgeParent shutdown or from the **GeckoTouchDispatcher** which is destroyed on the main thread with [ClearOnShutdown](https://hg.mozilla.org/mozilla-central/file/21567e9a6e40/xpcom/base/ClearOnShutdown.h#l15).
-+Whichever object, the CompositorBridgeParent or the **GeckoTouchDispatcher** is destroyed last will hold the last reference to the **CompositorVsyncDispatcher**, which destroys the object.
-+
-+#Refresh Driver
-+The Refresh Driver is ticked from a [single active timer](https://hg.mozilla.org/mozilla-central/file/ab0490972e1e/layout/base/nsRefreshDriver.cpp#l11).
-+The assumption is that there are multiple **RefreshDrivers** connected to a single **RefreshTimer**.
-+There are two **RefreshTimers**: an active and an inactive **RefreshTimer**.
-+Each Tab has its own **RefreshDriver**, which connects to one of the global **RefreshTimers**.
-+The **RefreshTimers** execute on the *Main Thread* and tick their connected **RefreshDrivers**.
-+We do not want to break this model of multiple **RefreshDrivers** per a set of two global **RefreshTimers**.
-+Each **RefreshDriver** switches between the active and inactive **RefreshTimer**.
-+
-+Instead, we create a new **RefreshTimer**, the **VsyncRefreshTimer** which ticks based on vsync messages.
-+We replace the current active timer with a **VsyncRefreshTimer**.
-+All tabs will then tick based on this new active timer.
-+Since the **RefreshTimer** has a lifetime of the process, we only need to create a single **RefreshTimerVsyncDispatcher** per **Display** when Firefox starts.
-+Even if we do not have any content processes, the Chrome process will still need a **VsyncRefreshTimer**, thus we can associate the **RefreshTimerVsyncDispatcher** with each **Display**.
-+
-+When Firefox starts, we initially create a new **VsyncRefreshTimer** in the Chrome process.
-+The **VsyncRefreshTimer** will listen to vsync notifications from **RefreshTimerVsyncDispatcher** on the global **Display**.
-+When nsRefreshDriver::Shutdown executes, it will delete the **VsyncRefreshTimer**.
-+This creates a problem as all the **RefreshTimers** are currently manually memory managed whereas **VsyncObservers** are ref counted.
-+To work around this problem, we create a new **RefreshDriverVsyncObserver** as an inner class to **VsyncRefreshTimer**, which actually receives vsync notifications. It then ticks the **RefreshDrivers** inside **VsyncRefreshTimer**.
-+
-+With Content processes, the start up process is more complicated.
-+We send vsync IPC messages via the use of the PBackground thread on the parent process, which allows us to send messages from the Parent process' without waiting on the *main thread*.
-+This sends messages from the Parent::*PBackground Thread* to the Child::*Main Thread*.
-+The *main thread* receiving IPC messages on the content process is acceptable because **RefreshDrivers** must execute on the *main thread*.
-+However, there is some amount of time required to setup the IPC connection upon process creation and during this time, the **RefreshDrivers** must tick to set up the process.
-+To get around this, we initially use software **RefreshTimers** that already exist during content process startup and swap in the **VsyncRefreshTimer** once the IPC connection is created.
-+
-+During nsRefreshDriver::ChooseTimer, we create an async PBackground IPC open request to create a **VsyncParent** and **VsyncChild**.
-+At the same time, we create a software **RefreshTimer** and tick the **RefreshDrivers** as normal.
-+Once the PBackground callback is executed and an IPC connection exists, we swap all **RefreshDrivers** currently associated with the active **RefreshTimer** and swap the **RefreshDrivers** to use the **VsyncRefreshTimer**.
-+Since all interactions on the content process occur on the main thread, there are no need for locks.
-+The **VsyncParent** listens to vsync events through the **VsyncRefreshTimerDispatcher** on the parent side and sends vsync IPC messages to the **VsyncChild**.
-+The **VsyncChild** notifies the **VsyncRefreshTimer** on the content process.
-+
-+During the shutdown process of the content process, ActorDestroy is called on the **VsyncChild** and **VsyncParent** due to the normal PBackground shutdown process.
-+Once ActorDestroy is called, no IPC messages should be sent across the channel.
-+After ActorDestroy is called, the IPDL machinery will delete the **VsyncParent/Child** pair.
-+The **VsyncParent**, due to being a **VsyncObserver**, is ref counted.
-+After **VsyncParent::ActorDestroy** is called, it unregisters itself from the **RefreshTimerVsyncDispatcher**, which holds the last reference to the **VsyncParent**, and the object will be deleted.
-+
-+Thus the overall flow during normal execution is:
-+
-+1. VsyncSource::Display::RefreshTimerVsyncDispatcher receives a Vsync notification from the OS in the parent process.
-+2. RefreshTimerVsyncDispatcher notifies VsyncRefreshTimer::RefreshDriverVsyncObserver that a vsync occured on the parent process on the hardware vsync thread.
-+3. RefreshTimerVsyncDispatcher notifies the VsyncParent on the hardware vsync thread that a vsync occured.
-+4. The VsyncRefreshTimer::RefreshDriverVsyncObserver in the parent process posts a task to the main thread that ticks the refresh drivers.
-+5. VsyncParent posts a task to the PBackground thread to send a vsync IPC message to VsyncChild.
-+6. VsyncChild receive a vsync notification on the content process on the main thread and ticks their respective RefreshDrivers.
-+
-+###Compressing Vsync Messages
-+Vsync messages occur quite often and the *main thread* can be busy for long periods of time due to JavaScript.
-+Consistently sending vsync messages to the refresh driver timer can flood the *main thread* with refresh driver ticks, causing even more delays.
-+To avoid this problem, we compress vsync messages on both the parent and child processes.
-+
-+On the parent process, newer vsync messages update a vsync timestamp but do not actually queue any tasks on the *main thread*.
-+Once the parent process' *main thread* executes the refresh driver tick, it uses the most updated vsync timestamp to tick the refresh driver.
-+After the refresh driver has ticked, one single vsync message is queued for another refresh driver tick task.
-+On the content process, the IPDL **compress** keyword automatically compresses IPC messages.
-+
-+### Multiple Monitors
-+In order to have multiple monitor support for the **RefreshDrivers**, we have multiple active **RefreshTimers**.
-+Each **RefreshTimer** is associated with a specific **Display** via an id and tick when it's respective **Display** vsync occurs.
-+We have **N RefreshTimers**, where N is the number of connected displays.
-+Each **RefreshTimer** still has multiple **RefreshDrivers**.
-+
-+When a tab or window changes monitors, the **nsIWidget** receives a display changed notification.
-+Based on which display the window is on, the window switches to the correct **RefreshTimerVsyncDispatcher** and **CompositorVsyncDispatcher** on the parent process based on the display id.
-+Each **TabParent** should also send a notification to their child.
-+Each **TabChild**, given the display ID, switches to the correct **RefreshTimer** associated with the display ID.
-+When each display vsync occurs, it sends one IPC message to notify vsync.
-+The vsync message contains a display ID, to tick the appropriate **RefreshTimer** on the content process.
-+There is still only one **VsyncParent/VsyncChild** pair, just each vsync notification will include a display ID, which maps to the correct **RefreshTimer**.
-+
-+#Object Lifetime
-+1. CompositorVsyncDispatcher - Lives as long as the nsBaseWidget associated with the VsyncDispatcher
-+2. CompositorVsyncScheduler::Observer - Lives and dies the same time as the CompositorBridgeParent.
-+3. RefreshTimerVsyncDispatcher - As long as the associated display object, which is the lifetime of Firefox.
-+4. VsyncSource - Lives as long as the gfxPlatform on the chrome process, which is the lifetime of Firefox.
-+5. VsyncParent/VsyncChild - Lives as long as the content process
-+6. RefreshTimer - Lives as long as the process
-+
-+#Threads
-+All **VsyncObservers** are notified on the *Hardware Vsync Thread*. It is the responsibility of the **VsyncObservers** to post tasks to their respective correct thread. For example, the **CompositorVsyncScheduler::Observer** will be notified on the *Hardware Vsync Thread*, and post a task to the *Compositor Thread* to do the actual composition.
-+
-+1. Compositor Thread - Nothing changes
-+2. Main Thread - PVsyncChild receives IPC messages on the main thread. We also enable/disable vsync on the main thread.
-+3. PBackground Thread - Creates a connection from the PBackground thread on the parent process to the main thread in the content process.
-+4. Hardware Vsync Thread - Every platform is different, but we always have the concept of a hardware vsync thread. Sometimes this is actually created by the host OS. On Windows, we have to create a separate platform thread that blocks on DwmFlush().
-diff --git a/gfx/docs/SilkArchitecture.png b/gfx/doc/silkArchitecture.png
-rename from gfx/docs/SilkArchitecture.png
-rename to gfx/doc/silkArchitecture.png
-diff --git a/gfx/docs/AdvancedLayers.rst b/gfx/docs/AdvancedLayers.rst
-deleted file mode 100644
---- a/gfx/docs/AdvancedLayers.rst
-+++ /dev/null
-@@ -1,370 +0,0 @@
--Advanced Layers
--===============
--
--Advanced Layers is a new method of compositing layers in Gecko. This
--document serves as a technical overview and provides a short
--walk-through of its source code.
--
--Overview
----------
--
--Advanced Layers attempts to group as many GPU operations as it can into
--a single draw call. This is a common technique in GPU-based rendering
--called “batching”. It is not always trivial, as a batching algorithm can
--easily waste precious CPU resources trying to build optimal draw calls.
--
--Advanced Layers reuses the existing Gecko layers system as much as
--possible. Huge layer trees do not currently scale well (see the future
--work section), so opportunities for batching are currently limited
--without expending unnecessary resources elsewhere. However, Advanced
--Layers has a few benefits:
--
---  It submits smaller GPU workloads and buffer uploads than the existing
--   compositor.
---  It needs only a single pass over the layer tree.
---  It uses occlusion information more intelligently.
---  It is easier to add new specialized rendering paths and new layer
--   types.
---  It separates compositing logic from device logic, unlike the existing
--   compositor.
---  It is much faster at rendering 3d scenes or complex layer trees.
---  It has experimental code to use the z-buffer for occlusion culling.
--
--Because of these benefits we hope that it provides a significant
--improvement over the existing compositor.
--
--Advanced Layers uses the acronym “MLG” and “MLGPU” in many places. This
--stands for “Mid-Level Graphics”, the idea being that it is optimized for
--Direct3D 11-style rendering systems as opposed to Direct3D 12 or Vulkan.
--
--LayerManagerMLGPU
-------------------
--
--Advanced layers does not change client-side rendering at all. Content
--still uses Direct2D (when possible), and creates identical layer trees
--as it would with a normal Direct3D 11 compositor. In fact, Advanced
--Layers re-uses all of the existing texture handling and video
--infrastructure as well, replacing only the composite-side layer types.
--
--Advanced Layers does not create a ``LayerManagerComposite`` - instead,
--it creates a ``LayerManagerMLGPU``. This layer manager does not have a
--``Compositor`` - instead, it has an ``MLGDevice``, which roughly
--abstracts the Direct3D 11 API. (The hope is that this API is easily
--interchangeable for something else when cross-platform or software
--support is needed.)
--
--``LayerManagerMLGPU`` also dispenses with the old “composite” layers for
--new layer types. For example, ``ColorLayerComposite`` becomes
--``ColorLayerMLGPU``. Since these layer types implement ``HostLayer``,
--they integrate with ``LayerTransactionParent`` as normal composite
--layers would.
--
--Rendering Overview
--------------------
--
--The steps for rendering are described in more detail below, but roughly
--the process is:
--
--1. Sort layers front-to-back.
--2. Create a dependency tree of render targets (called “views”).
--3. Accumulate draw calls for all layers in each view.
--4. Upload draw call buffers to the GPU.
--5. Execute draw commands for each view.
--
--Advanced Layers divides the layer tree into “views”
--(``RenderViewMLGPU``), which correspond to a render target. The root
--layer is represented by a view corresponding to the screen. Layers that
--require intermediate surfaces have temporary views. Layers are analyzed
--front-to-back, and rendered back-to-front within a view. Views
--themselves are rendered front-to-back, to minimize render target
--switching.
--
--Each view contains one or more rendering passes (``RenderPassMLGPU``). A
--pass represents a single draw command with one or more rendering items
--attached to it. For example, a ``SolidColorPass`` item contains a
--rectangle and an RGBA value, and many of these can be drawn with a
--single GPU call.
--
--When considering a layer, views will first try to find an existing
--rendering batch that can support it. If so, that pass will accumulate
--another draw item for the layer. Otherwise, a new pass will be added.
--
--When trying to find a matching pass for a layer, there is a tradeoff in
--CPU time versus the GPU time saved by not issuing another draw commands.
--We generally care more about CPU time, so we do not try too hard in
--matching items to an existing batch.
--
--After all layers have been processed, there is a “prepare” step. This
--copies all accumulated draw data and uploads it into vertex and constant
--buffers in the GPU.
--
--Finally, we execute rendering commands. At the end of the frame, all
--batches and (most) constant buffers are thrown away.
--
--Shaders Overview
------------------
--
--Advanced Layers currently has five layer-related shader pipelines:
--
---  Textured (PaintedLayer, ImageLayer, CanvasLayer)
---  ComponentAlpha (PaintedLayer with component-alpha)
---  YCbCr (ImageLayer with YCbCr video)
---  Color (ColorLayers)
---  Blend (ContainerLayers with mix-blend modes)
--
--There are also three special shader pipelines:
--
---  MaskCombiner, which is used to combine mask layers into a single
--   texture.
---  Clear, which is used for fast region-based clears when not directly
--   supported by the GPU.
---  Diagnostic, which is used to display the diagnostic overlay texture.
--
--The layer shaders follow a unified structure. Each pipeline has a vertex
--and pixel shader. The vertex shader takes a layers ID, a z-buffer depth,
--a unit position in either a unit square or unit triangle, and either
--rectangular or triangular geometry. Shaders can also have ancillary data
--needed like texture coordinates or colors.
--
--Most of the time, layers have simple rectangular clips with simple
--rectilinear transforms, and pixel shaders do not need to perform masking
--or clipping. For these layers we use a fast-path pipeline, using
--unit-quad shaders that are able to clip geometry so the pixel shader
--does not have to. This type of pipeline does not support complex masks.
--
--If a layer has a complex mask, a rotation or 3d transform, or a complex
--operation like blending, then we use shaders capable of handling
--arbitrary geometry. Their input is a unit triangle, and these shaders
--are generally more expensive.
--
--All of the shader-specific data is modelled in ShaderDefinitionsMLGPU.h.
--
--CPU Occlusion Culling
-----------------------
--
--By default, Advanced Layers performs occlusion culling on the CPU. Since
--layers are visited front-to-back, this is simply a matter of
--accumulating the visible region of opaque layers, and subtracting it
--from the visible region of subsequent layers. There is a major
--difference between this occlusion culling and PostProcessLayers of the
--old compositor: AL performs culling after invalidation, not before.
--Completely valid layers will have an empty visible region.
--
--Most layer types (with the exception of images) will intelligently split
--their draw calls into a batch of individual rectangles, based on their
--visible region.
--
--Z-Buffering and Occlusion
---------------------------
--
--Advanced Layers also supports occlusion culling on the GPU, using a
--z-buffer. This is disabled by default currently since it is
--significantly costly on integrated GPUs. When using the z-buffer, we
--separate opaque layers into a separate list of passes. The render
--process then uses the following steps:
--
--1. The depth buffer is set to read-write.
--2. Opaque batches are executed.,
--3. The depth buffer is set to read-only.
--4. Transparent batches are executed.
--
--The problem we have observed is that the depth buffer increases writes
--to the GPU, and on integrated GPUs this is expensive - we have seen draw
--call times increase by 20-30%, which is the wrong direction we want to
--take on battery life. In particular on a full screen video, the call to
--ClearDepthStencilView plus the actual depth buffer write of the video
--can double GPU time.
--
--For now the depth-buffer is disabled until we can find a compelling case
--for it on non-integrated hardware.
--
--Clipping
----------
--
--Clipping is a bit tricky in Advanced Layers. We cannot use the hardware
--“scissor” feature, since the clip can change from instance to instance
--within a batch. And if using the depth buffer, we cannot write
--transparent pixels for the clipped area. As a result we always clip
--opaque draw rects in the vertex shader (and sometimes even on the CPU,
--as is needed for sane texture coordiantes). Only transparent items are
--clipped in the pixel shader. As a result, masked layers and layers with
--non-rectangular transforms are always considered transparent, and use a
--more flexible clipping pipeline.
--
--Plane Splitting
-----------------
--
--Plane splitting is when a 3D transform causes a layer to be split - for
--example, one transparent layer may intersect another on a separate
--plane. When this happens, Gecko sorts layers using a BSP tree and
--produces a list of triangles instead of draw rects.
--
--These layers cannot use the “unit quad” shaders that support the fast
--clipping pipeline. Instead they always use the full triangle-list
--shaders that support extended vertices and clipping.
--
--This is the slowest path we can take when building a draw call, since we
--must interact with the polygon clipping and texturing code.
--
--Masks
-------
--
--For each layer with a mask attached, Advanced Layers builds a
--``MaskOperation``. These operations must resolve to a single mask
--texture, as well as a rectangular area to which the mask applies. All
--batched pixel shaders will automatically clip pixels to the mask if a
--mask texture is bound. (Note that we must use separate batches if the
--mask texture changes.)
--
--Some layers have multiple mask textures. In this case, the MaskOperation
--will store the list of masks, and right before rendering, it will invoke
--a shader to combine these masks into a single texture.
--
--MaskOperations are shared across layers when possible, but are not
--cached across frames.
--
--BigImage Support
------------------
--
--ImageLayers and CanvasLayers can be tiled with many individual textures.
--This happens in rare cases where the underlying buffer is too big for
--the GPU. Early on this caused problems for Advanced Layers, since AL
--required one texture per layer. We implemented BigImage support by
--creating temporary ImageLayers for each visible tile, and throwing those
--layers away at the end of the frame.
--
--Advanced Layers no longer has a 1:1 layer:texture restriction, but we
--retain the temporary layer solution anyway. It is not much code and it
--means we do not have to split ``TexturedLayerMLGPU`` methods into
--iterated and non-iterated versions.
--
--Texture Locking
-----------------
--
--Advanced Layers has a different texture locking scheme than the existing
--compositor. If a texture needs to be locked, then it is locked by the
--MLGDevice automatically when bound to the current pipeline. The
--MLGDevice keeps a set of the locked textures to avoid double-locking. At
--the end of the frame, any textures in the locked set are unlocked.
--
--We cannot easily replicate the locking scheme in the old compositor,
--since the duration of using the texture is not scoped to when we visit
--the layer.
--
--Buffer Measurements
---------------------
--
--Advanced Layers uses constant buffers to send layer information and
--extended instance data to the GPU. We do this by pre-allocating large
--constant buffers and mapping them with ``MAP_DISCARD`` at the beginning
--of the frame. Batches may allocate into this up to the maximum bindable
--constant buffer size of the device (currently, 64KB).
--
--There are some downsides to this approach. Constant buffers are
--difficult to work with - they have specific alignment requirements, and
--care must be taken not too run over the maximum number of constants in a
--buffer. Another approach would be to store constants in a 2D texture and
--use vertex shader texture fetches. Advanced Layers implemented this and
--benchmarked it to decide which approach to use. Textures seemed to skew
--better on GPU performance, but worse on CPU, but this varied depending
--on the GPU. Overall constant buffers performed best and most
--consistently, so we have kept them.
--
--Additionally, we tested different ways of performing buffer uploads.
--Buffer creation itself is costly, especially on integrated GPUs, and
--especially so for immutable, immediate-upload buffers. As a result we
--aggressively cache buffer objects and always allocate them as
--MAP_DISCARD unless they are write-once and long-lived.
--
--Buffer Types
--------------
--
--Advanced Layers has a few different classes to help build and upload
--buffers to the GPU. They are:
--
---  ``MLGBuffer``. This is the low-level shader resource that
--   ``MLGDevice`` exposes. It is the building block for buffer helper
--   classes, but it can also be used to make one-off, immutable,
--   immediate-upload buffers. MLGBuffers, being a GPU resource, are
--   reference counted.
---  ``SharedBufferMLGPU``. These are large, pre-allocated buffers that
--   are read-only on the GPU and write-only on the CPU. They usually
--   exceed the maximum bindable buffer size. There are three shared
--   buffers created by default and they are automatically unmapped as
--   needed: one for vertices, one for vertex shader constants, and one
--   for pixel shader constants. When callers allocate into a shared
--   buffer they get back a mapped pointer, a GPU resource, and an offset.
--   When the underlying device supports offsetable buffers (like
--   ``ID3D11DeviceContext1`` does), this results in better GPU
--   utilization, as there are less resources and fewer upload commands.
---  ``ConstantBufferSection`` and ``VertexBufferSection``. These are
--   “views” into a ``SharedBufferMLGPU``. They contain the underlying
--   ``MLGBuffer``, and when offsetting is supported, the offset
--   information necessary for resource binding. Sections are not
--   reference counted.
---  ``StagingBuffer``. A dynamically sized CPU buffer where items can be
--   appended in a free-form manner. The stride of a single “item” is
--   computed by the first item written, and successive items must have
--   the same stride. The buffer must be uploaded to the GPU manually.
--   Staging buffers are appropriate for creating general constant or
--   vertex buffer data. They can also write items in reverse, which is
--   how we render back-to-front when layers are visited front-to-back.
--   They can be uploaded to a ``SharedBufferMLGPU`` or an immutabler
--   ``MLGBuffer`` very easily. Staging buffers are not reference counted.
--
--Unsupported Features
----------------------
--
--Currently, these features of the old compositor are not yet implemented.
--
---  OpenGL and software support (currently AL only works on D3D11).
---  APZ displayport overlay.
---  Diagnostic/developer overlays other than the FPS/timing overlay.
---  DEAA. It was never ported to the D3D11 compositor, but we would like
--   it.
---  Component alpha when used inside an opaque intermediate surface.
---  Effects prefs. Possibly not needed post-B2G removal.
---  Widget overlays and underlays used by macOS and Android.
---  DefaultClearColor. This is Android specific, but is easy to added
--   when needed.
---  Frame uniformity info in the profiler. Possibly not needed post-B2G
--   removal.
---  LayerScope. There are no plans to make this work.
--
--Future Work
-------------
--
---  Refactor for D3D12/Vulkan support (namely, split MLGDevice into
--   something less stateful and something else more low-level).
---  Remove “MLG” moniker and namespace everything.
---  Other backends (D3D12/Vulkan, OpenGL, Software)
---  Delete CompositorD3D11
---  Add DEAA support
---  Re-enable the depth buffer by default for fast GPUs
---  Re-enable right-sizing of inaccurately sized containers
---  Drop constant buffers for ancillary vertex data
---  Fast shader paths for simple video/painted layer cases
--
--History
---------
--
--Advanced Layers has gone through four major design iterations. The
--initial version used tiling - each render view divided the screen into
--128x128 tiles, and layers were assigned to tiles based on their
--screen-space draw area. This approach proved not to scale well to 3d
--transforms, and so tiling was eliminated.
--
--We replaced it with a simple system of accumulating draw regions to each
--batch, thus ensuring that items could be assigned to batches while
--maintaining correct z-ordering. This second iteration also coincided
--with plane-splitting support.
--
--On large layer trees, accumulating the affected regions of batches
--proved to be quite expensive. This led to a third iteration, using depth
--buffers and separate opaque and transparent batch lists to achieve
--z-ordering and occlusion culling.
--
--Finally, depth buffers proved to be too expensive, and we introduced a
--simple CPU-based occlusion culling pass. This iteration coincided with
--using more precise draw rects and splitting pipelines into unit-quad,
--cpu-clipped and triangle-list, gpu-clipped variants.
-diff --git a/gfx/docs/AsyncPanZoom.rst b/gfx/docs/AsyncPanZoom.rst
-deleted file mode 100644
---- a/gfx/docs/AsyncPanZoom.rst
-+++ /dev/null
-@@ -1,452 +0,0 @@
--.. _apz:
--
--Asynchronous Panning and Zooming
--================================
--
--**This document is a work in progress. Some information may be missing
--or incomplete.**
--
--.. image:: AsyncPanZoomArchitecture.png
--
--Goals
-------
--
--We need to be able to provide a visual response to user input with
--minimal latency. In particular, on devices with touch input, content
--must track the finger exactly while panning, or the user experience is
--very poor. According to the UX team, 120ms is an acceptable latency
--between user input and response.
--
--Context and surrounding architecture
--------------------------------------
--
--The fundamental problem we are trying to solve with the Asynchronous
--Panning and Zooming (APZ) code is that of responsiveness. By default,
--web browsers operate in a “game loop” that looks like this:
--
--::
--
--       while true:
--           process input
--           do computations
--           repaint content
--           display repainted content
--
--In browsers the “do computation” step can be arbitrarily expensive
--because it can involve running event handlers in web content. Therefore,
--there can be an arbitrary delay between the input being received and the
--on-screen display getting updated.
--
--Responsiveness is always good, and with touch-based interaction it is
--even more important than with mouse or keyboard input. In order to
--ensure responsiveness, we split the “game loop” model of the browser
--into a multithreaded variant which looks something like this:
--
--::
--
--       Thread 1 (compositor thread)
--       while true:
--           receive input
--           send a copy of input to thread 2
--           adjust painted content based on input
--           display adjusted painted content
--       
--       Thread 2 (main thread)
--       while true:
--           receive input from thread 1
--           do computations
--           repaint content
--           update the copy of painted content in thread 1
--
--This multithreaded model is called off-main-thread compositing (OMTC),
--because the compositing (where the content is displayed on-screen)
--happens on a separate thread from the main thread. Note that this is a
--very very simplified model, but in this model the “adjust painted
--content based on input” is the primary function of the APZ code.
--
--The “painted content” is stored on a set of “layers”, that are
--conceptually double-buffered. That is, when the main thread does its
--repaint, it paints into one set of layers (the “client” layers). The
--update that is sent to the compositor thread copies all the changes from
--the client layers into another set of layers that the compositor holds.
--These layers are called the “shadow” layers or the “compositor” layers.
--The compositor in theory can continuously composite these shadow layers
--to the screen while the main thread is busy doing other things and
--painting a new set of client layers.
--
--The APZ code takes the input events that are coming in from the hardware
--and uses them to figure out what the user is trying to do (e.g. pan the
--page, zoom in). It then expresses this user intention in the form of
--translation and/or scale transformation matrices. These transformation
--matrices are applied to the shadow layers at composite time, so that
--what the user sees on-screen reflects what they are trying to do as
--closely as possible.
--
--Technical overview
--------------------
--
--As per the heavily simplified model described above, the fundamental
--purpose of the APZ code is to take input events and produce
--transformation matrices. This section attempts to break that down and
--identify the different problems that make this task non-trivial.
--
--Checkerboarding
--~~~~~~~~~~~~~~~
--
--The content area that is painted and stored in a shadow layer is called
--the “displayport”. The APZ code is responsible for determining how large
--the displayport should be. On the one hand, we want the displayport to
--be as large as possible. At the very least it needs to be larger than
--what is visible on-screen, because otherwise, as soon as the user pans,
--there will be some unpainted area of the page exposed. However, we
--cannot always set the displayport to be the entire page, because the
--page can be arbitrarily long and this would require an unbounded amount
--of memory to store. Therefore, a good displayport size is one that is
--larger than the visible area but not so large that it is a huge drain on
--memory. Because the displayport is usually smaller than the whole page,
--it is always possible for the user to scroll so fast that they end up in
--an area of the page outside the displayport. When this happens, they see
--unpainted content; this is referred to as “checkerboarding”, and we try
--to avoid it where possible.
--
--There are many possible ways to determine what the displayport should be
--in order to balance the tradeoffs involved (i.e. having one that is too
--big is bad for memory usage, and having one that is too small results in
--excessive checkerboarding). Ideally, the displayport should cover
--exactly the area that we know the user will make visible. Although we
--cannot know this for sure, we can use heuristics based on current
--panning velocity and direction to ensure a reasonably-chosen displayport
--area. This calculation is done in the APZ code, and a new desired
--displayport is frequently sent to the main thread as the user is panning
--around.
--
--Multiple layers
--~~~~~~~~~~~~~~~
--
--Consider, for example, a scrollable page that contains an iframe which
--itself is scrollable. The iframe can be scrolled independently of the
--top-level page, and we would like both the page and the iframe to scroll
--responsively. This means that we want independent asynchronous panning
--for both the top-level page and the iframe. In addition to iframes,
--elements that have the overflow:scroll CSS property set are also
--scrollable, and also end up on separate scrollable layers. In the
--general case, the layers are arranged in a tree structure, and so within
--the APZ code we have a matching tree of AsyncPanZoomController (APZC)
--objects, one for each scrollable layer. To manage this tree of APZC
--instances, we have a single APZCTreeManager object. Each APZC is
--relatively independent and handles the scrolling for its associated
--layer, but there are some cases in which they need to interact; these
--cases are described in the sections below.
--
--Hit detection
--~~~~~~~~~~~~~
--
--Consider again the case where we have a scrollable page that contains an
--iframe which itself is scrollable. As described above, we will have two
--APZC instances - one for the page and one for the iframe. When the user
--puts their finger down on the screen and moves it, we need to do some
--sort of hit detection in order to determine whether their finger is on
--the iframe or on the top-level page. Based on where their finger lands,
--the appropriate APZC instance needs to handle the input. This hit
--detection is also done in the APZCTreeManager, as it has the necessary
--information about the sizes and positions of the layers. Currently this
--hit detection is not perfect, as it uses rects and does not account for
--things like rounded corners and opacity.
--
--Also note that for some types of input (e.g. when the user puts two
--fingers down to do a pinch) we do not want the input to be “split”
--across two different APZC instances. In the case of a pinch, for
--example, we find a “common ancestor” APZC instance - one that is
--zoomable and contains all of the touch input points, and direct the
--input to that APZC instance.
--
--Scroll Handoff
--~~~~~~~~~~~~~~
--
--Consider yet again the case where we have a scrollable page that
--contains an iframe which itself is scrollable. Say the user scrolls the
--iframe so that it reaches the bottom. If the user continues panning on
--the iframe, the expectation is that the top-level page will start
--scrolling. However, as discussed in the section on hit detection, the
--APZC instance for the iframe is separate from the APZC instance for the
--top-level page. Thus, we need the two APZC instances to communicate in
--some way such that input events on the iframe result in scrolling on the
--top-level page. This behaviour is referred to as “scroll handoff” (or
--“fling handoff” in the case where analogous behaviour results from the
--scrolling momentum of the page after the user has lifted their finger).
--
--Input event untransformation
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--The APZC architecture by definition results in two copies of a “scroll
--position” for each scrollable layer. There is the original copy on the
--main thread that is accessible to web content and the layout and
--painting code. And there is a second copy on the compositor side, which
--is updated asynchronously based on user input, and corresponds to what
--the user visually sees on the screen. Although these two copies may
--diverge temporarily, they are reconciled periodically. In particular,
--they diverge while the APZ code is performing an async pan or zoom
--action on behalf of the user, and are reconciled when the APZ code
--requests a repaint from the main thread.
--
--Because of the way input events are stored, this has some unfortunate
--consequences. Input events are stored relative to the device screen - so
--if the user touches at the same physical spot on the device, the same
--input events will be delivered regardless of the content scroll
--position. When the main thread receives a touch event, it combines that
--with the content scroll position in order to figure out what DOM element
--the user touched. However, because we now have two different scroll
--positions, this process may not work perfectly. A concrete example
--follows:
--
--Consider a device with screen size 600 pixels tall. On this device, a
--user is viewing a document that is 1000 pixels tall, and that is
--scrolled down by 200 pixels. That is, the vertical section of the
--document from 200px to 800px is visible. Now, if the user touches a
--point 100px from the top of the physical display, the hardware will
--generate a touch event with y=100. This will get sent to the main
--thread, which will add the scroll position (200) and get a
--document-relative touch event with y=300. This new y-value will be used
--in hit detection to figure out what the user touched. If the document
--had a absolute-positioned div at y=300, then that would receive the
--touch event.
--
--Now let us add some async scrolling to this example. Say that the user
--additionally scrolls the document by another 10 pixels asynchronously
--(i.e. only on the compositor thread), and then does the same touch
--event. The same input event is generated by the hardware, and as before,
--the document will deliver the touch event to the div at y=300. However,
--visually, the document is scrolled by an additional 10 pixels so this
--outcome is wrong. What needs to happen is that the APZ code needs to
--intercept the touch event and account for the 10 pixels of asynchronous
--scroll. Therefore, the input event with y=100 gets converted to y=110 in
--the APZ code before being passed on to the main thread. The main thread
--then adds the scroll position it knows about and determines that the
--user touched at a document-relative position of y=310.
--
--Analogous input event transformations need to be done for horizontal
--scrolling and zooming.
--
--Content independently adjusting scrolling
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--As described above, there are two copies of the scroll position in the
--APZ architecture - one on the main thread and one on the compositor
--thread. Usually for architectures like this, there is a single “source
--of truth” value and the other value is simply a copy. However, in this
--case that is not easily possible to do. The reason is that both of these
--values can be legitimately modified. On the compositor side, the input
--events the user is triggering modify the scroll position, which is then
--propagated to the main thread. However, on the main thread, web content
--might be running Javascript code that programatically sets the scroll
--position (via window.scrollTo, for example). Scroll changes driven from
--the main thread are just as legitimate and need to be propagated to the
--compositor thread, so that the visual display updates in response.
--
--Because the cross-thread messaging is asynchronous, reconciling the two
--types of scroll changes is a tricky problem. Our design solves this
--using various flags and generation counters. The general heuristic we
--have is that content-driven scroll position changes (e.g. scrollTo from
--JS) are never lost. For instance, if the user is doing an async scroll
--with their finger and content does a scrollTo in the middle, then some
--of the async scroll would occur before the “jump” and the rest after the
--“jump”.
--
--Content preventing default behaviour of input events
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--Another problem that we need to deal with is that web content is allowed
--to intercept touch events and prevent the “default behaviour” of
--scrolling. This ability is defined in web standards and is
--non-negotiable. Touch event listeners in web content are allowed call
--preventDefault() on the touchstart or first touchmove event for a touch
--point; doing this is supposed to “consume” the event and prevent
--touch-based panning. As we saw in a previous section, the input event
--needs to be untransformed by the APZ code before it can be delivered to
--content. But, because of the preventDefault problem, we cannot fully
--process the touch event in the APZ code until content has had a chance
--to handle it. Web browsers in general solve this problem by inserting a
--delay of up to 300ms before processing the input - that is, web content
--is allowed up to 300ms to process the event and call preventDefault on
--it. If web content takes longer than 300ms, or if it completes handling
--of the event without calling preventDefault, then the browser
--immediately starts processing the events.
--
--The way the APZ implementation deals with this is that upon receiving a
--touch event, it immediately returns an untransformed version that can be
--dispatched to content. It also schedules a 400ms timeout (600ms on
--Android) during which content is allowed to prevent scrolling. There is
--an API that allows the main-thread event dispatching code to notify the
--APZ as to whether or not the default action should be prevented. If the
--APZ content response timeout expires, or if the main-thread event
--dispatching code notifies the APZ of the preventDefault status, then the
--APZ continues with the processing of the events (which may involve
--discarding the events).
--
--The touch-action CSS property from the pointer-events spec is intended
--to allow eliminating this 400ms delay in many cases (although for
--backwards compatibility it will still be needed for a while). Note that
--even with touch-action implemented, there may be cases where the APZ
--code does not know the touch-action behaviour of the point the user
--touched. In such cases, the APZ code will still wait up to 400ms for the
--main thread to provide it with the touch-action behaviour information.
--
--Technical details
-------------------
--
--This section describes various pieces of the APZ code, and goes into
--more specific detail on APIs and code than the previous sections. The
--primary purpose of this section is to help people who plan on making
--changes to the code, while also not going into so much detail that it
--needs to be updated with every patch.
--
--Overall flow of input events
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--This section describes how input events flow through the APZ code.
--
--1.  Input events arrive from the hardware/widget code into the APZ via
--    APZCTreeManager::ReceiveInputEvent. The thread that invokes this is
--    called the input thread, and may or may not be the same as the Gecko
--    main thread.
--2.  Conceptually the first thing that the APZCTreeManager does is to
--    associate these events with “input blocks”. An input block is a set
--    of events that share certain properties, and generally are intended
--    to represent a single gesture. For example with touch events, all
--    events following a touchstart up to but not including the next
--    touchstart are in the same block. All of the events in a given block
--    will go to the same APZC instance and will either all be processed
--    or all be dropped.
--3.  Using the first event in the input block, the APZCTreeManager does a
--    hit-test to see which APZC it hits. This hit-test uses the event
--    regions populated on the layers, which may be larger than the true
--    hit area of the layer. If no APZC is hit, the events are discarded
--    and we jump to step 6. Otherwise, the input block is tagged with the
--    hit APZC as a tentative target and put into a global APZ input
--    queue.
--4.
--
--    i.  If the input events landed outside the dispatch-to-content event
--        region for the layer, any available events in the input block
--        are processed. These may trigger behaviours like scrolling or
--        tap gestures.
--    ii. If the input events landed inside the dispatch-to-content event
--        region for the layer, the events are left in the queue and a
--        400ms timeout is initiated. If the timeout expires before step 9
--        is completed, the APZ assumes the input block was not cancelled
--        and the tentative target is correct, and processes them as part
--        of step 10.
--
--5.  The call stack unwinds back to APZCTreeManager::ReceiveInputEvent,
--    which does an in-place modification of the input event so that any
--    async transforms are removed.
--6.  The call stack unwinds back to the widget code that called
--    ReceiveInputEvent. This code now has the event in the coordinate
--    space Gecko is expecting, and so can dispatch it to the Gecko main
--    thread.
--7.  Gecko performs its own usual hit-testing and event dispatching for
--    the event. As part of this, it records whether any touch listeners
--    cancelled the input block by calling preventDefault(). It also
--    activates inactive scrollframes that were hit by the input events.
--8.  The call stack unwinds back to the widget code, which sends two
--    notifications to the APZ code on the input thread. The first
--    notification is via APZCTreeManager::ContentReceivedInputBlock, and
--    informs the APZ whether the input block was cancelled. The second
--    notification is via APZCTreeManager::SetTargetAPZC, and informs the
--    APZ of the results of the Gecko hit-test during event dispatch. Note
--    that Gecko may report that the input event did not hit any
--    scrollable frame at all. The SetTargetAPZC notification happens only
--    once per input block, while the ContentReceivedInputBlock
--    notification may happen once per block, or multiple times per block,
--    depending on the input type.
--9.
--
--    i.   If the events were processed as part of step 4(i), the
--         notifications from step 8 are ignored and step 10 is skipped.
--    ii.  If events were queued as part of step 4(ii), and steps 5-8 take
--         less than 400ms, the arrival of both notifications from step 8
--         will mark the input block ready for processing.
--    iii. If events were queued as part of step 4(ii), but steps 5-8 take
--         longer than 400ms, the notifications from step 8 will be
--         ignored and step 10 will already have happened.
--
--10. If events were queued as part of step 4(ii) they are now either
--    processed (if the input block was not cancelled and Gecko detected a
--    scrollframe under the input event, or if the timeout expired) or
--    dropped (all other cases). Note that the APZC that processes the
--    events may be different at this step than the tentative target from
--    step 3, depending on the SetTargetAPZC notification. Processing the
--    events may trigger behaviours like scrolling or tap gestures.
--
--If the CSS touch-action property is enabled, the above steps are
--modified as follows: \* In step 4, the APZC also requires the allowed
--touch-action behaviours for the input event. This might have been
--determined as part of the hit-test in APZCTreeManager; if not, the
--events are queued. \* In step 6, the widget code determines the content
--element at the point under the input element, and notifies the APZ code
--of the allowed touch-action behaviours. This notification is sent via a
--call to APZCTreeManager::SetAllowedTouchBehavior on the input thread. \*
--In step 9(ii), the input block will only be marked ready for processing
--once all three notifications arrive.
--
--Threading considerations
--^^^^^^^^^^^^^^^^^^^^^^^^
--
--The bulk of the input processing in the APZ code happens on what we call
--“the input thread”. In practice the input thread could be the Gecko main
--thread, the compositor thread, or some other thread. There are obvious
--downsides to using the Gecko main thread - that is, “asynchronous”
--panning and zooming is not really asynchronous as input events can only
--be processed while Gecko is idle. In an e10s environment, using the
--Gecko main thread of the chrome process is acceptable, because the code
--running in that process is more controllable and well-behaved than
--arbitrary web content. Using the compositor thread as the input thread
--could work on some platforms, but may be inefficient on others. For
--example, on Android (Fennec) we receive input events from the system on
--a dedicated UI thread. We would have to redispatch the input events to
--the compositor thread if we wanted to the input thread to be the same as
--the compositor thread. This introduces a potential for higher latency,
--particularly if the compositor does any blocking operations - blocking
--SwapBuffers operations, for example. As a result, the APZ code itself
--does not assume that the input thread will be the same as the Gecko main
--thread or the compositor thread.
--
--Active vs. inactive scrollframes
--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
--The number of scrollframes on a page is potentially unbounded. However,
--we do not want to create a separate layer for each scrollframe right
--away, as this would require large amounts of memory. Therefore,
--scrollframes as designated as either “active” or “inactive”. Active
--scrollframes are the ones that do have their contents put on a separate
--layer (or set of layers), and inactive ones do not.
--
--Consider a page with a scrollframe that is initially inactive. When
--layout generates the layers for this page, the content of the
--scrollframe will be flattened into some other PaintedLayer (call it P).
--The layout code also adds the area (or bounding region in case of weird
--shapes) of the scrollframe to the dispatch-to-content region of P.
--
--When the user starts interacting with that content, the hit-test in the
--APZ code finds the dispatch-to-content region of P. The input block
--therefore has a tentative target of P when it goes into step 4(ii) in
--the flow above. When gecko processes the input event, it must detect the
--inactive scrollframe and activate it, as part of step 7. Finally, the
--widget code sends the SetTargetAPZC notification in step 8 to notify the
--APZ that the input block should really apply to this new layer. The
--issue here is that the layer transaction containing the new layer must
--reach the compositor and APZ before the SetTargetAPZC notification. If
--this does not occur within the 400ms timeout, the APZ code will be
--unable to update the tentative target, and will continue to use P for
--that input block. Input blocks that start after the layer transaction
--will get correctly routed to the new layer as there will now be a layer
--and APZC instance for the active scrollframe.
--
--This model implies that when the user initially attempts to scroll an
--inactive scrollframe, it may end up scrolling an ancestor scrollframe.
--(This is because in the absence of the SetTargetAPZC notification, the
--input events will get applied to the closest ancestor scrollframe’s
--APZC.) Only after the round-trip to the gecko thread is complete is
--there a layer for async scrolling to actually occur on the scrollframe
--itself. At that point the scrollframe will start receiving new input
--blocks and will scroll normally.
-diff --git a/gfx/docs/GraphicsOverview.rst b/gfx/docs/GraphicsOverview.rst
-deleted file mode 100644
---- a/gfx/docs/GraphicsOverview.rst
-+++ /dev/null
-@@ -1,159 +0,0 @@
--Graphics Overview
--=========================
--
--Work in progress. Possibly incorrect or incomplete.
-----------------------------------------------------
--
--Jargon
--------
--
--There's a lot of jargon in the graphics stack. We try to maintain a list
--of common words and acronyms `here <https://wiki.mozilla.org/Platform/GFX/Jargon>`__.
--
--Overview
----------
--
--The graphics systems is responsible for rendering (painting, drawing)
--the frame tree (rendering tree) elements as created by the layout
--system. Each leaf in the tree has content, either bounded by a rectangle
--(or perhaps another shape, in the case of SVG.)
--
--The simple approach for producing the result would thus involve
--traversing the frame tree, in a correct order, drawing each frame into
--the resulting buffer and displaying (printing non-withstanding) that
--buffer when the traversal is done. It is worth spending some time on the
--“correct order” note above. If there are no overlapping frames, this is
--fairly simple - any order will do, as long as there is no background. If
--there is background, we just have to worry about drawing that first.
--Since we do not control the content, chances are the page is more
--complicated. There are overlapping frames, likely with transparency, so
--we need to make sure the elements are draw “back to front”, in layers,
--so to speak. Layers are an important concept, and we will revisit them
--shortly, as they are central to fixing a major issue with the above
--simple approach.
--
--While the above simple approach will work, the performance will suffer.
--Each time anything changes in any of the frames, the complete process
--needs to be repeated, everything needs to be redrawn. Further, there is
--very little space to take advantage of the modern graphics (GPU)
--hardware, or multi-core computers. If you recall from the previous
--sections, the frame tree is only accessible from the UI thread, so while
--we’re doing all this work, the UI is basically blocked.
--
--(Retained) Layers
--~~~~~~~~~~~~~~~~~
--
--Layers framework was introduced to address the above performance issues,
--by having a part of the design address each item. At the high level:
--
--1. We create a layer tree. The leaf elements of the tree contain all
--   frames (possibly multiple frames per leaf).
--2. We render each layer tree element and cache (retain) the result.
--3. We composite (combine) all the leaf elements into the final result.
--
--Let’s examine each of these steps, in reverse order.
--
--Compositing
--~~~~~~~~~~~
--
--We use the term composite as it implies that the order is important. If
--the elements being composited overlap, whether there is transparency
--involved or not, the order in which they are combined will effect the
--result. Compositing is where we can use some of the power of the modern
--graphics hardware. It is optimal for doing this job. In the scenarios
--where only the position of individual frames changes, without the
--content inside them changing, we see why caching each layer would be
--advantageous - we only need to repeat the final compositing step,
--completely skipping the layer tree creation and the rendering of each
--leaf, thus speeding up the process considerably.
--
--Another benefit is equally apparent in the context of the stated
--deficiencies of the simple approach. We can use the available graphics
--hardware accelerated APIs to do the compositing step. Direct3D, OpenGL
--can be used on different platforms and are well suited to accelerate
--this step.
--
--Finally, we can now envision performing the compositing step on a
--separate thread, unblocking the UI thread for other work, and doing more
--work in parallel. More on this below.
--
--It is important to note that the number of operations in this step is
--proportional to the number of layer tree (leaf) elements, so there is
--additional work and complexity involved, when the layer tree is large.
--
--Render and retain layer elements
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--As we saw, the compositing step benefits from caching the intermediate
--result. This does result in the extra memory usage, so needs to be
--considered during the layer tree creation. Beyond the caching, we can
--accelerate the rendering of each element by (indirectly) using the
--available platform APIs (e.g., Direct2D, CoreGraphics, even some of the
--3D APIs like OpenGL or Direct3D) as available. This is actually done
--through a platform independent API (see Moz2D) below, but is important
--to realize it does get accelerated appropriately.
--
--Creating the layer tree
--~~~~~~~~~~~~~~~~~~~~~~~
--
--We need to create a layer tree (from the frames tree), which will give
--us the correct result while striking the right balance between a layer
--per frame element and a single layer for the complete frames tree. As
--was mentioned above, there is an overhead in traversing the whole tree
--and caching each of the elements, balanced by the performance
--improvements. Some of the performance improvements are only noticed when
--something changes (e.g., one element is moving, we only need to redo the
--compositing step).
--
--Refresh Driver
--~~~~~~~~~~~~~~
--
--Layers
--~~~~~~
--
--Rendering each layer
--~~~~~~~~~~~~~~~~~~~~
--
--Tiling vs. Buffer Rotation vs. Full paint
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--Compositing for the final result
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
--Graphics API
--~~~~~~~~~~~~
--
--Moz2D
--~~~~~
--
---  The Moz2D graphics API, part of the Azure project, is a
--   cross-platform interface onto the various graphics backends that
--   Gecko uses for rendering such as Direct2D (1.0 and 1.1), Skia, Cairo,
--   Quartz, and NV Path. Adding a new graphics platform to Gecko is
--   accomplished by adding a backend to Moz2D.
--   See `Moz2D documentation on wiki <https://wiki.mozilla.org/Platform/GFX/Moz2D>`__.
--
--Compositing
--~~~~~~~~~~~
--
--Image Decoding
--~~~~~~~~~~~~~~
--
--Image Animation
--~~~~~~~~~~~~~~~
--
--`Historical Documents <http://www.youtube.com/watch?v=lLZQz26-kms>`__
-----------------------------------------------------------------------
--
--A number of posts and blogs that will give you more details or more
--background, or reasoning that led to different solutions and approaches.
--
---  2010-01 `Layers: Cross Platform Acceleration <http://www.basschouten.com/blog1.php/layers-cross-platform-acceleration>`__
---  2010-04 `Layers <http://robert.ocallahan.org/2010/04/layers_01.html>`__
---  2010-07 `Retained Layers <http://robert.ocallahan.org/2010/07/retained-layers_16.html>`__
---  2011-04 `Introduction <https://blog.mozilla.org/joe/2011/04/26/introducing-the-azure-project/%20Moz2D>`__
---  2011-07 `Layers <http://chrislord.net/index.php/2011/07/25/shadow-layers-and-learning-by-failing/%20Shadow>`__
---  2011-09 `Graphics API Design <http://robert.ocallahan.org/2011/09/graphics-api-design.html>`__
---  2012-04 `Moz2D Canvas on OSX <http://muizelaar.blogspot.ca/2012/04/azure-canvas-on-os-x.html>`__
---  2012-05 `Mask Layers <http://featherweightmusings.blogspot.co.uk/2012/05/mask-layers_26.html>`__
---  2013-07 `Graphics related <http://www.basschouten.com/blog1.php>`__
-diff --git a/gfx/docs/LayersHistory.rst b/gfx/docs/LayersHistory.rst
-deleted file mode 100644
---- a/gfx/docs/LayersHistory.rst
-+++ /dev/null
-@@ -1,63 +0,0 @@
--Layers History
--==============
--
--This is an overview of the major events in the history of our Layers
--infrastructure.
--
---  iPhone released in July 2007 (Built on a toolkit called LayerKit)
--
---  Core Animation (October 2007) LayerKit was publicly renamed to OS X
--   10.5
--
---  Webkit CSS 3d transforms (July 2009)
--
---  Original layers API (March 2010) Introduced the idea of a layer
--   manager that would composite. One of the first use cases for this was
--   hardware accelerated YUV conversion for video.
--
---  Retained layers (July 7 2010 - Bug 564991) This was an important
--   concept that introduced the idea of persisting the layer content
--   across paints in gecko controlled buffers instead of just by the OS.
--   This introduced the concept of buffer rotation to deal with scrolling
--   instead of using the native scrolling APIs like ScrollWindowEx
--
---  Layers IPC (July 2010 - Bug 570294) This introduced shadow layers and
--   edit lists and was originally done for e10s v1
--
---  3D transforms (September 2011 - Bug 505115)
--
---  OMTC (December 2011 - Bug 711168) This was prototyped on OS X but
--   shipped first for Fennec
--
---  Tiling v1 (April 2012 - Bug 739679) Originally done for Fennec. This
--   was done to avoid situations where we had to do a bunch of work for
--   scrolling a small amount. i.e. buffer rotation. It allowed us to have
--   a variety of interesting features like progressive painting and lower
--   resolution painting.
--
---  C++ Async pan zoom controller (July 2012 - Bug 750974) The existing
--   APZ code was in Java for Fennec so this was reimplemented.
--
---  Streaming WebGL Buffers (February 2013 - Bug 716859) Infrastructure
--   to allow OMTC WebGL and avoid the need to glFinish() every frame.
--
---  Compositor API (April 2013 - Bug 825928) The planning for this
--   started around November 2012. Layers refactoring created a compositor
--   API that abstracted away the differences between the D3D vs OpenGL.
--   The main piece of API is DrawQuad.
--
---  Tiling v2 (Mar 7 2014 - Bug 963073) Tiling for B2G. This work is
--   mainly porting tiled layers to new textures, implementing
--   double-buffered tiles and implementing a texture client pool, to be
--   used by tiled content clients.
--
--   A large motivation for the pool was the very slow performance of
--   allocating tiles because of the sync messages to the compositor.
--
--   The slow performance of allocating was directly addressed by bug 959089
--   which allowed us to allocate gralloc buffers without sync messages to
--   the compositor thread.
--
---  B2G WebGL performance (May 2014 - Bug 1006957, 1001417, 1024144) This
--   work improved the synchronization mechanism between the compositor
--   and the producer.
-diff --git a/gfx/docs/Silk.rst b/gfx/docs/Silk.rst
-deleted file mode 100644
---- a/gfx/docs/Silk.rst
-+++ /dev/null
-@@ -1,469 +0,0 @@
--Silk Overview
--==========================
--
--.. image:: SilkArchitecture.png
--
--Architecture
--------------
--
--Our current architecture is to align three components to hardware vsync
--timers:
--
--1. Compositor
--2. RefreshDriver / Painting
--3. Input Events
--
--The flow of our rendering engine is as follows:
--
--1. Hardware Vsync event occurs on an OS specific *Hardware Vsync Thread*
--   on a per monitor basis.
--2. The *Hardware Vsync Thread* attached to the monitor notifies the
--   ``CompositorVsyncDispatchers`` and ``RefreshTimerVsyncDispatcher``.
--3. For every Firefox window on the specific monitor, notify a
--   ``CompositorVsyncDispatcher``. The ``CompositorVsyncDispatcher`` is
--   specific to one window.
--4. The ``CompositorVsyncDispatcher`` notifies a
--   ``CompositorWidgetVsyncObserver`` when remote compositing, or a
--   ``CompositorVsyncScheduler::Observer`` when compositing in-process.
--5. If remote compositing, a vsync notification is sent from the
--   ``CompositorWidgetVsyncObserver`` to the ``VsyncBridgeChild`` on the
--   UI process, which sends an IPDL message to the ``VsyncBridgeParent``
--   on the compositor thread of the GPU process, which then dispatches to
--   ``CompositorVsyncScheduler::Observer``.
--6. The ``RefreshTimerVsyncDispatcher`` notifies the Chrome
--   ``RefreshTimer`` that a vsync has occured.
--7. The ``RefreshTimerVsyncDispatcher`` sends IPC messages to all content
--   processes to tick their respective active ``RefreshTimer``.
--8. The ``Compositor`` dispatches input events on the *Compositor
--   Thread*, then composites. Input events are only dispatched on the
--   *Compositor Thread* on b2g.
--9. The ``RefreshDriver`` paints on the *Main Thread*.
--
--Hardware Vsync
----------------
--
--Hardware vsync events from (1), occur on a specific ``Display`` Object.
--The ``Display`` object is responsible for enabling / disabling vsync on
--a per connected display basis. For example, if two monitors are
--connected, two ``Display`` objects will be created, each listening to
--vsync events for their respective displays. We require one ``Display``
--object per monitor as each monitor may have different vsync rates. As a
--fallback solution, we have one global ``Display`` object that can
--synchronize across all connected displays. The global ``Display`` is
--useful if a window is positioned halfway between the two monitors. Each
--platform will have to implement a specific ``Display`` object to hook
--and listen to vsync events. As of this writing, both Firefox OS and OS X
--create their own hardware specific *Hardware Vsync Thread* that executes
--after a vsync has occured. OS X creates one *Hardware Vsync Thread* per
--``CVDisplayLinkRef``. We do not currently support multiple displays, so
--we use one global ``CVDisplayLinkRef`` that works across all active
--displays. On Windows, we have to create a new platform ``thread`` that
--waits for DwmFlush(), which works across all active displays. Once the
--thread wakes up from DwmFlush(), the actual vsync timestamp is retrieved
--from DwmGetCompositionTimingInfo(), which is the timestamp that is
--actually passed into the compositor and refresh driver.
--
--When a vsync occurs on a ``Display``, the *Hardware Vsync Thread*
--callback fetches all ``CompositorVsyncDispatchers`` associated with the
--``Display``. Each ``CompositorVsyncDispatcher`` is notified that a vsync
--has occured with the vsync’s timestamp. It is the responsibility of the
--``CompositorVsyncDispatcher`` to notify the ``Compositor`` that is
--awaiting vsync notifications. The ``Display`` will then notify the
--associated ``RefreshTimerVsyncDispatcher``, which should notify all
--active ``RefreshDrivers`` to tick.
--
--All ``Display`` objects are encapsulated in a ``VsyncSource`` object.
--The ``VsyncSource`` object lives in ``gfxPlatform`` and is instantiated
--only on the parent process when ``gfxPlatform`` is created. The
--``VsyncSource`` is destroyed when ``gfxPlatform`` is destroyed. There is
--only one ``VsyncSource`` object throughout the entire lifetime of
--Firefox. Each platform is expected to implement their own
--``VsyncSource`` to manage vsync events. On Firefox OS, this is through
--the ``HwcComposer2D``. On OS X, this is through ``CVDisplayLinkRef``. On
--Windows, it should be through ``DwmGetCompositionTimingInfo``.
--
--Compositor
------------
--
--When the ``CompositorVsyncDispatcher`` is notified of the vsync event,
--the ``CompositorVsyncScheduler::Observer`` associated with the
--``CompositorVsyncDispatcher`` begins execution. Since the
--``CompositorVsyncDispatcher`` executes on the *Hardware Vsync Thread*
--and the ``Compositor`` composites on the ``CompositorThread``, the
--``CompositorVsyncScheduler::Observer`` posts a task to the
--``CompositorThread``. The ``CompositorBridgeParent`` then composites.
--The model where the ``CompositorVsyncDispatcher`` notifies components on
--the *Hardware Vsync Thread*, and the component schedules the task on the
--appropriate thread is used everywhere.
--
--The ``CompositorVsyncScheduler::Observer`` listens to vsync events as
--needed and stops listening to vsync when composites are no longer
--scheduled or required. Every ``CompositorBridgeParent`` is associated
--and tied to one ``CompositorVsyncScheduler::Observer``, which is
--associated with the ``CompositorVsyncDispatcher``. Each
--``CompositorBridgeParent`` is associated with one widget and is created
--when a new platform window or ``nsBaseWidget`` is created. The
--``CompositorBridgeParent``, ``CompositorVsyncDispatcher``,
--``CompositorVsyncScheduler::Observer``, and ``nsBaseWidget`` all have
--the same lifetimes, which are created and destroyed together.
--
--Out-of-process Compositors
----------------------------
--
--When compositing out-of-process, this model changes slightly. In this
--case there are effectively two observers: a UI process observer
--(``CompositorWidgetVsyncObserver``), and the
--``CompositorVsyncScheduler::Observer`` in the GPU process. There are
--also two dispatchers: the widget dispatcher in the UI process
--(``CompositorVsyncDispatcher``), and the IPDL-based dispatcher in the
--GPU process (``CompositorBridgeParent::NotifyVsync``). The UI process
--observer and the GPU process dispatcher are linked via an IPDL protocol
--called PVsyncBridge. ``PVsyncBridge`` is a top-level protocol for
--sending vsync notifications to the compositor thread in the GPU process.
--The compositor controls vsync observation through a separate actor,
--``PCompositorWidget``, which (as a subactor for
--``CompositorBridgeChild``) links the compositor thread in the GPU
--process to the main thread in the UI process.
--
--Out-of-process compositors do not go through
--``CompositorVsyncDispatcher`` directly. Instead, the
--``CompositorWidgetDelegate`` in the UI process creates one, and gives it
--a ``CompositorWidgetVsyncObserver``. This observer forwards
--notifications to a Vsync I/O thread, where ``VsyncBridgeChild`` then
--forwards the notification again to the compositor thread in the GPU
--process. The notification is received by a ``VsyncBridgeParent``. The
--GPU process uses the layers ID in the notification to find the correct
--compositor to dispatch the notification to.
--
--CompositorVsyncDispatcher
---------------------------
--
--The ``CompositorVsyncDispatcher`` executes on the *Hardware Vsync
--Thread*. It contains references to the ``nsBaseWidget`` it is associated
--with and has a lifetime equal to the ``nsBaseWidget``. The
--``CompositorVsyncDispatcher`` is responsible for notifying the
--``CompositorBridgeParent`` that a vsync event has occured. There can be
--multiple ``CompositorVsyncDispatchers`` per ``Display``, one
--``CompositorVsyncDispatcher`` per window. The only responsibility of the
--``CompositorVsyncDispatcher`` is to notify components when a vsync event
--has occured, and to stop listening to vsync when no components require
--vsync events. We require one ``CompositorVsyncDispatcher`` per window so
--that we can handle multiple ``Displays``. When compositing in-process,
--the ``CompositorVsyncDispatcher`` is attached to the CompositorWidget
--for the window. When out-of-process, it is attached to the
--CompositorWidgetDelegate, which forwards observer notifications over
--IPDL. In the latter case, its lifetime is tied to a CompositorSession
--rather than the nsIWidget.
--
--Multiple Displays
-------------------
--
--The ``VsyncSource`` has an API to switch a ``CompositorVsyncDispatcher``
--from one ``Display`` to another ``Display``. For example, when one
--window either goes into full screen mode or moves from one connected
--monitor to another. When one window moves to another monitor, we expect
--a platform specific notification to occur. The detection of when a
--window enters full screen mode or moves is not covered by Silk itself,
--but the framework is built to support this use case. The expected flow
--is that the OS notification occurs on ``nsIWidget``, which retrieves the
--associated ``CompositorVsyncDispatcher``. The
--``CompositorVsyncDispatcher`` then notifies the ``VsyncSource`` to
--switch to the correct ``Display`` the ``CompositorVsyncDispatcher`` is
--connected to. Because the notification works through the ``nsIWidget``,
--the actual switching of the ``CompositorVsyncDispatcher`` to the correct
--``Display`` should occur on the *Main Thread*. The current
--implementation of Silk does not handle this case and needs to be built
--out.
--
--CompositorVsyncScheduler::Observer
------------------------------------
--
--The ``CompositorVsyncScheduler::Observer`` handles the vsync
--notifications and interactions with the ``CompositorVsyncDispatcher``.
--When the ``Compositor`` requires a scheduled composite, it notifies the
--``CompositorVsyncScheduler::Observer`` that it needs to listen to vsync.
--The ``CompositorVsyncScheduler::Observer`` then observes / unobserves
--vsync as needed from the ``CompositorVsyncDispatcher`` to enable
--composites.
--
--GeckoTouchDispatcher
----------------------
--
--The ``GeckoTouchDispatcher`` is a singleton that resamples touch events
--to smooth out jank while tracking a user’s finger. Because input and
--composite are linked together, the
--``CompositorVsyncScheduler::Observer`` has a reference to the
--``GeckoTouchDispatcher`` and vice versa.
--
--Input Events
--------------
--
--One large goal of Silk is to align touch events with vsync events. On
--Firefox OS, touchscreens often have different touch scan rates than the
--display refreshes. A Flame device has a touch refresh rate of 75 HZ,
--while a Nexus 4 has a touch refresh rate of 100 HZ, while the device’s
--display refresh rate is 60HZ. When a vsync event occurs, we resample
--touch events, and then dispatch the resampled touch event to APZ. Touch
--events on Firefox OS occur on a *Touch Input Thread* whereas they are
--processed by APZ on the *APZ Controller Thread*. We use `Google
--Android’s touch
--resampling <http://www.masonchang.com/blog/2014/8/25/androids-touch-resampling-algorithm>`__
--algorithm to resample touch events.
--
--Currently, we have a strict ordering between Composites and touch
--events. When a touch event occurs on the *Touch Input Thread*, we store
--the touch event in a queue. When a vsync event occurs, the
--``CompositorVsyncDispatcher`` notifies the ``Compositor`` of a vsync
--event, which notifies the ``GeckoTouchDispatcher``. The
--``GeckoTouchDispatcher`` processes the touch event first on the *APZ
--Controller Thread*, which is the same as the *Compositor Thread* on b2g,
--then the ``Compositor`` finishes compositing. We require this strict
--ordering because if a vsync notification is dispatched to both the
--``Compositor`` and ``GeckoTouchDispatcher`` at the same time, a race
--condition occurs between processing the touch event and therefore
--position versus compositing. In practice, this creates very janky
--scrolling. As of this writing, we have not analyzed input events on
--desktop platforms.
--
--One slight quirk is that input events can start a composite, for example
--during a scroll and after the ``Compositor`` is no longer listening to
--vsync events. In these cases, we notify the ``Compositor`` to observe
--vsync so that it dispatches touch events. If touch events were not
--dispatched, and since the ``Compositor`` is not listening to vsync
--events, the touch events would never be dispatched. The
--``GeckoTouchDispatcher`` handles this case by always forcing the
--``Compositor`` to listen to vsync events while touch events are
--occurring.
--
--Widget, Compositor, CompositorVsyncDispatcher, GeckoTouchDispatcher Shutdown Procedure
----------------------------------------------------------------------------------------
--
--When the `nsBaseWidget shuts
--down <https://hg.mozilla.org/mozilla-central/file/0df249a0e4d3/widget/nsBaseWidget.cpp#l182>`__
--- It calls nsBaseWidget::DestroyCompositor on the *Gecko Main Thread*.
--During nsBaseWidget::DestroyCompositor, it first destroys the
--CompositorBridgeChild. CompositorBridgeChild sends a sync IPC call to
--CompositorBridgeParent::RecvStop, which calls
--`CompositorBridgeParent::Destroy <https://hg.mozilla.org/mozilla-central/file/ab0490972e1e/gfx/layers/ipc/CompositorBridgeParent.cpp#l509>`__.
--During this time, the *main thread* is blocked on the parent process.
--CompositorBridgeParent::RecvStop runs on the *Compositor thread* and
--cleans up some resources, including setting the
--``CompositorVsyncScheduler::Observer`` to nullptr.
--CompositorBridgeParent::RecvStop also explicitly keeps the
--CompositorBridgeParent alive and posts another task to run
--CompositorBridgeParent::DeferredDestroy on the Compositor loop so that
--all ipdl code can finish executing. The
--``CompositorVsyncScheduler::Observer`` also unobserves from vsync and
--cancels any pending composite tasks. Once
--CompositorBridgeParent::RecvStop finishes, the *main thread* in the
--parent process continues shutting down the nsBaseWidget.
--
--At the same time, the *Compositor thread* is executing tasks until
--CompositorBridgeParent::DeferredDestroy runs, which flushes the
--compositor message loop. Now we have two tasks as both the nsBaseWidget
--releases a reference to the Compositor on the *main thread* during
--destruction and the CompositorBridgeParent::DeferredDestroy releases a
--reference to the CompositorBridgeParent on the *Compositor Thread*.
--Finally, the CompositorBridgeParent itself is destroyed on the *main
--thread* once both references are gone due to explicit `main thread
--destruction <https://hg.mozilla.org/mozilla-central/file/50b95032152c/gfx/layers/ipc/CompositorBridgeParent.h#l148>`__.
--
--With the ``CompositorVsyncScheduler::Observer``, any accesses to the
--widget after nsBaseWidget::DestroyCompositor executes are invalid. Any
--accesses to the compositor between the time the
--nsBaseWidget::DestroyCompositor runs and the
--CompositorVsyncScheduler::Observer’s destructor runs aren’t safe yet a
--hardware vsync event could occur between these times. Since any tasks
--posted on the Compositor loop after
--CompositorBridgeParent::DeferredDestroy is posted are invalid, we make
--sure that no vsync tasks can be posted once
--CompositorBridgeParent::RecvStop executes and DeferredDestroy is posted
--on the Compositor thread. When the sync call to
--CompositorBridgeParent::RecvStop executes, we explicitly set the
--CompositorVsyncScheduler::Observer to null to prevent vsync
--notifications from occurring. If vsync notifications were allowed to
--occur, since the ``CompositorVsyncScheduler::Observer``\ ’s vsync
--notification executes on the *hardware vsync thread*, it would post a
--task to the Compositor loop and may execute after
--CompositorBridgeParent::DeferredDestroy. Thus, we explicitly shut down
--vsync events in the ``CompositorVsyncDispatcher`` and
--``CompositorVsyncScheduler::Observer`` during nsBaseWidget::Shutdown to
--prevent any vsync tasks from executing after
--CompositorBridgeParent::DeferredDestroy.
--
--The ``CompositorVsyncDispatcher`` may be destroyed on either the *main
--thread* or *Compositor Thread*, since both the nsBaseWidget and
--``CompositorVsyncScheduler::Observer`` race to destroy on different
--threads. nsBaseWidget is destroyed on the *main thread* and releases a
--reference to the ``CompositorVsyncDispatcher`` during destruction. The
--``CompositorVsyncScheduler::Observer`` has a race to be destroyed either
--during CompositorBridgeParent shutdown or from the
--``GeckoTouchDispatcher`` which is destroyed on the main thread with
--`ClearOnShutdown <https://hg.mozilla.org/mozilla-central/file/21567e9a6e40/xpcom/base/ClearOnShutdown.h#l15>`__.
--Whichever object, the CompositorBridgeParent or the
--``GeckoTouchDispatcher`` is destroyed last will hold the last reference
--to the ``CompositorVsyncDispatcher``, which destroys the object.
--
--Refresh Driver
----------------
--
--The Refresh Driver is ticked from a `single active
--timer <https://hg.mozilla.org/mozilla-central/file/ab0490972e1e/layout/base/nsRefreshDriver.cpp#l11>`__.
--The assumption is that there are multiple ``RefreshDrivers`` connected
--to a single ``RefreshTimer``. There are two ``RefreshTimers``: an active
--and an inactive ``RefreshTimer``. Each Tab has its own
--``RefreshDriver``, which connects to one of the global
--``RefreshTimers``. The ``RefreshTimers`` execute on the *Main Thread*
--and tick their connected ``RefreshDrivers``. We do not want to break
--this model of multiple ``RefreshDrivers`` per a set of two global
--``RefreshTimers``. Each ``RefreshDriver`` switches between the active
--and inactive ``RefreshTimer``.
--
--Instead, we create a new ``RefreshTimer``, the ``VsyncRefreshTimer``
--which ticks based on vsync messages. We replace the current active timer
--with a ``VsyncRefreshTimer``. All tabs will then tick based on this new
--active timer. Since the ``RefreshTimer`` has a lifetime of the process,
--we only need to create a single ``RefreshTimerVsyncDispatcher`` per
--``Display`` when Firefox starts. Even if we do not have any content
--processes, the Chrome process will still need a ``VsyncRefreshTimer``,
--thus we can associate the ``RefreshTimerVsyncDispatcher`` with each
--``Display``.
--
--When Firefox starts, we initially create a new ``VsyncRefreshTimer`` in
--the Chrome process. The ``VsyncRefreshTimer`` will listen to vsync
--notifications from ``RefreshTimerVsyncDispatcher`` on the global
--``Display``. When nsRefreshDriver::Shutdown executes, it will delete the
--``VsyncRefreshTimer``. This creates a problem as all the
--``RefreshTimers`` are currently manually memory managed whereas
--``VsyncObservers`` are ref counted. To work around this problem, we
--create a new ``RefreshDriverVsyncObserver`` as an inner class to
--``VsyncRefreshTimer``, which actually receives vsync notifications. It
--then ticks the ``RefreshDrivers`` inside ``VsyncRefreshTimer``.
--
--With Content processes, the start up process is more complicated. We
--send vsync IPC messages via the use of the PBackground thread on the
--parent process, which allows us to send messages from the Parent
--process’ without waiting on the *main thread*. This sends messages from
--the Parent::\ *PBackground Thread* to the Child::\ *Main Thread*. The
--*main thread* receiving IPC messages on the content process is
--acceptable because ``RefreshDrivers`` must execute on the *main thread*.
--However, there is some amount of time required to setup the IPC
--connection upon process creation and during this time, the
--``RefreshDrivers`` must tick to set up the process. To get around this,
--we initially use software ``RefreshTimers`` that already exist during
--content process startup and swap in the ``VsyncRefreshTimer`` once the
--IPC connection is created.
--
--During nsRefreshDriver::ChooseTimer, we create an async PBackground IPC
--open request to create a ``VsyncParent`` and ``VsyncChild``. At the same
--time, we create a software ``RefreshTimer`` and tick the
--``RefreshDrivers`` as normal. Once the PBackground callback is executed
--and an IPC connection exists, we swap all ``RefreshDrivers`` currently
--associated with the active ``RefreshTimer`` and swap the
--``RefreshDrivers`` to use the ``VsyncRefreshTimer``. Since all
--interactions on the content process occur on the main thread, there are
--no need for locks. The ``VsyncParent`` listens to vsync events through
--the ``VsyncRefreshTimerDispatcher`` on the parent side and sends vsync
--IPC messages to the ``VsyncChild``. The ``VsyncChild`` notifies the
--``VsyncRefreshTimer`` on the content process.
--
--During the shutdown process of the content process, ActorDestroy is
--called on the ``VsyncChild`` and ``VsyncParent`` due to the normal
--PBackground shutdown process. Once ActorDestroy is called, no IPC
--messages should be sent across the channel. After ActorDestroy is
--called, the IPDL machinery will delete the **VsyncParent/Child** pair.
--The ``VsyncParent``, due to being a ``VsyncObserver``, is ref counted.
--After ``VsyncParent::ActorDestroy`` is called, it unregisters itself
--from the ``RefreshTimerVsyncDispatcher``, which holds the last reference
--to the ``VsyncParent``, and the object will be deleted.
--
--Thus the overall flow during normal execution is:
--
--1. VsyncSource::Display::RefreshTimerVsyncDispatcher receives a Vsync
--   notification from the OS in the parent process.
--2. RefreshTimerVsyncDispatcher notifies
--   VsyncRefreshTimer::RefreshDriverVsyncObserver that a vsync occured on
--   the parent process on the hardware vsync thread.
--3. RefreshTimerVsyncDispatcher notifies the VsyncParent on the hardware
--   vsync thread that a vsync occured.
--4. The VsyncRefreshTimer::RefreshDriverVsyncObserver in the parent
--   process posts a task to the main thread that ticks the refresh
--   drivers.
--5. VsyncParent posts a task to the PBackground thread to send a vsync
--   IPC message to VsyncChild.
--6. VsyncChild receive a vsync notification on the content process on the
--   main thread and ticks their respective RefreshDrivers.
--
--Compressing Vsync Messages
----------------------------
--
--Vsync messages occur quite often and the *main thread* can be busy for
--long periods of time due to JavaScript. Consistently sending vsync
--messages to the refresh driver timer can flood the *main thread* with
--refresh driver ticks, causing even more delays. To avoid this problem,
--we compress vsync messages on both the parent and child processes.
--
--On the parent process, newer vsync messages update a vsync timestamp but
--do not actually queue any tasks on the *main thread*. Once the parent
--process’ *main thread* executes the refresh driver tick, it uses the
--most updated vsync timestamp to tick the refresh driver. After the
--refresh driver has ticked, one single vsync message is queued for
--another refresh driver tick task. On the content process, the IPDL
--``compress`` keyword automatically compresses IPC messages.
--
--Multiple Monitors
-------------------
--
--In order to have multiple monitor support for the ``RefreshDrivers``, we
--have multiple active ``RefreshTimers``. Each ``RefreshTimer`` is
--associated with a specific ``Display`` via an id and tick when it’s
--respective ``Display`` vsync occurs. We have **N RefreshTimers**, where
--N is the number of connected displays. Each ``RefreshTimer`` still has
--multiple ``RefreshDrivers``.
--
--When a tab or window changes monitors, the ``nsIWidget`` receives a
--display changed notification. Based on which display the window is on,
--the window switches to the correct ``RefreshTimerVsyncDispatcher`` and
--``CompositorVsyncDispatcher`` on the parent process based on the display
--id. Each ``TabParent`` should also send a notification to their child.
--Each ``TabChild``, given the display ID, switches to the correct
--``RefreshTimer`` associated with the display ID. When each display vsync
--occurs, it sends one IPC message to notify vsync. The vsync message
--contains a display ID, to tick the appropriate ``RefreshTimer`` on the
--content process. There is still only one **VsyncParent/VsyncChild**
--pair, just each vsync notification will include a display ID, which maps
--to the correct ``RefreshTimer``.
--
--Object Lifetime
-----------------
--
--1. CompositorVsyncDispatcher - Lives as long as the nsBaseWidget
--   associated with the VsyncDispatcher
--2. CompositorVsyncScheduler::Observer - Lives and dies the same time as
--   the CompositorBridgeParent.
--3. RefreshTimerVsyncDispatcher - As long as the associated display
--   object, which is the lifetime of Firefox.
--4. VsyncSource - Lives as long as the gfxPlatform on the chrome process,
--   which is the lifetime of Firefox.
--5. VsyncParent/VsyncChild - Lives as long as the content process
--6. RefreshTimer - Lives as long as the process
--
--Threads
---------
--
--All ``VsyncObservers`` are notified on the *Hardware Vsync Thread*. It
--is the responsibility of the ``VsyncObservers`` to post tasks to their
--respective correct thread. For example, the
--``CompositorVsyncScheduler::Observer`` will be notified on the *Hardware
--Vsync Thread*, and post a task to the *Compositor Thread* to do the
--actual composition.
--
--1. Compositor Thread - Nothing changes
--2. Main Thread - PVsyncChild receives IPC messages on the main thread.
--   We also enable/disable vsync on the main thread.
--3. PBackground Thread - Creates a connection from the PBackground thread
--   on the parent process to the main thread in the content process.
--4. Hardware Vsync Thread - Every platform is different, but we always
--   have the concept of a hardware vsync thread. Sometimes this is
--   actually created by the host OS. On Windows, we have to create a
--   separate platform thread that blocks on DwmFlush().
-diff --git a/gfx/docs/index.rst b/gfx/docs/index.rst
---- a/gfx/docs/index.rst
-+++ b/gfx/docs/index.rst
-@@ -1,17 +1,9 @@
-+========
- Graphics
- ========
- 
--This collection of linked pages contains design documents for the
--Mozilla graphics architecture. The design documents live in gfx/docs directory.
--
--This `wiki page <https://wiki.mozilla.org/Platform/GFX>`__ contains
--information about graphics and the graphics team at Mozilla.
-+The graphics team's documentation is currently using doxygen. We're tracking the work to integrate it better at https://bugzilla.mozilla.org/show_bug.cgi?id=1150232.
- 
--.. toctree::
--   :maxdepth: 1
-+For now you can read the graphics source code documentation here:
- 
--   GraphicsOverview
--   LayersHistory
--   AsyncPanZoom
--   AdvancedLayers
--   Silk
-+http://people.mozilla.org/~bgirard/doxygen/gfx/
-diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp
---- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
-+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
-@@ -3748,30 +3748,27 @@ bool AsyncPanZoomController::AdvanceAnim
-   // responsibility to schedule a composite.
-   mAsyncTransformAppliedToContent = false;
-   bool requestAnimationFrame = false;
-   nsTArray<RefPtr<Runnable>> deferredTasks;
- 
-   {
-     RecursiveMutexAutoLock lock(mRecursiveMutex);
- 
-+    requestAnimationFrame = UpdateAnimation(aSampleTime, &deferredTasks);
-+
-     { // scope lock
-       MutexAutoLock lock(mCheckerboardEventLock);
--      // Update RendertraceProperty before UpdateAnimation() call, since
--      // the UpdateAnimation() updates effective ScrollOffset for next frame
--      // if APZFrameDelay is enabled.
-       if (mCheckerboardEvent) {
-         mCheckerboardEvent->UpdateRendertraceProperty(
-             CheckerboardEvent::UserVisible,
--            CSSRect(GetEffectiveScrollOffset(AsyncPanZoomController::eForCompositing),
-+            CSSRect(Metrics().GetScrollOffset(),
-                     Metrics().CalculateCompositedSizeInCssPixels()));
-       }
-     }
--
--    requestAnimationFrame = UpdateAnimation(aSampleTime, &deferredTasks);
-   }
- 
-   // Execute any deferred tasks queued up by mAnimation's Sample() (called by
-   // UpdateAnimation()). This needs to be done after the monitor is released
-   // since the tasks are allowed to call APZCTreeManager methods which can grab
-   // the tree lock.
-   for (uint32_t i = 0; i < deferredTasks.Length(); ++i) {
-     APZThreadUtils::RunOnControllerThread(deferredTasks[i].forget());
-@@ -4026,17 +4023,17 @@ Matrix4x4 AsyncPanZoomController::GetTra
-            PostScale(zoomChange.width, zoomChange.height, 1);
- }
- 
- uint32_t
- AsyncPanZoomController::GetCheckerboardMagnitude() const
- {
-   RecursiveMutexAutoLock lock(mRecursiveMutex);
- 
--  CSSPoint currentScrollOffset = GetEffectiveScrollOffset(AsyncPanZoomController::eForCompositing) + mTestAsyncScrollOffset;
-+  CSSPoint currentScrollOffset = Metrics().GetScrollOffset() + mTestAsyncScrollOffset;
-   CSSRect painted = mLastContentPaintMetrics.GetDisplayPort() + mLastContentPaintMetrics.GetScrollOffset();
-   CSSRect visible = CSSRect(currentScrollOffset, Metrics().CalculateCompositedSizeInCssPixels());
- 
-   CSSIntRegion checkerboard;
-   // Round so as to minimize checkerboarding; if we're only showing fractional
-   // pixels of checkerboarding it's not really worth counting
-   checkerboard.Sub(RoundedIn(visible), RoundedOut(painted));
-   return checkerboard.Area();
-diff --git a/gfx/webrender/src/display_list_flattener.rs b/gfx/webrender/src/display_list_flattener.rs
---- a/gfx/webrender/src/display_list_flattener.rs
-+++ b/gfx/webrender/src/display_list_flattener.rs
-@@ -1041,16 +1041,46 @@ impl<'a> DisplayListFlattener<'a> {
-                 .rev()
-                 .find(|sc| sc.rendering_context_3d_prim_index.is_some())
-                 .map(|sc| sc.rendering_context_3d_prim_index.unwrap())
-                 .unwrap()
-         } else {
-             *self.picture_stack.last().unwrap()
-         };
- 
-+        // For each filter, create a new image with that composite mode.
-+        for filter in composite_ops.filters.iter().rev() {
-+            let picture = PicturePrimitive::new_image(
-+                self.get_next_picture_id(),
-+                Some(PictureCompositeMode::Filter(*filter)),
-+                false,
-+                pipeline_id,
-+                None,
-+                true,
-+            );
-+
-+            let src_prim = BrushPrimitive::new_picture(picture);
-+            let src_prim_index = self.prim_store.add_primitive(
-+                &LayoutRect::zero(),
-+                &max_clip,
-+                true,
-+                clip_chain_id,
-+                spatial_node_index,
-+                None,
-+                PrimitiveContainer::Brush(src_prim),
-+            );
-+
-+            let parent_pic = self.prim_store.get_pic_mut(parent_prim_index);
-+            parent_prim_index = src_prim_index;
-+
-+            parent_pic.add_primitive(src_prim_index);
-+
-+            self.picture_stack.push(src_prim_index);
-+        }
-+
-         // Same for mix-blend-mode.
-         if let Some(mix_blend_mode) = composite_ops.mix_blend_mode {
-             let picture = PicturePrimitive::new_image(
-                 self.get_next_picture_id(),
-                 Some(PictureCompositeMode::MixBlend(mix_blend_mode)),
-                 false,
-                 pipeline_id,
-                 None,
-@@ -1071,46 +1101,16 @@ impl<'a> DisplayListFlattener<'a> {
- 
-             let parent_pic = self.prim_store.get_pic_mut(parent_prim_index);
-             parent_prim_index = src_prim_index;
-             parent_pic.add_primitive(src_prim_index);
- 
-             self.picture_stack.push(src_prim_index);
-         }
- 
--        // For each filter, create a new image with that composite mode.
--        for filter in composite_ops.filters.iter().rev() {
--            let picture = PicturePrimitive::new_image(
--                self.get_next_picture_id(),
--                Some(PictureCompositeMode::Filter(*filter)),
--                false,
--                pipeline_id,
--                None,
--                true,
--            );
--
--            let src_prim = BrushPrimitive::new_picture(picture);
--            let src_prim_index = self.prim_store.add_primitive(
--                &LayoutRect::zero(),
--                &max_clip,
--                true,
--                clip_chain_id,
--                spatial_node_index,
--                None,
--                PrimitiveContainer::Brush(src_prim),
--            );
--
--            let parent_pic = self.prim_store.get_pic_mut(parent_prim_index);
--            parent_prim_index = src_prim_index;
--
--            parent_pic.add_primitive(src_prim_index);
--
--            self.picture_stack.push(src_prim_index);
--        }
--
-         // By default, this picture will be collapsed into
-         // the owning target.
-         let mut composite_mode = None;
-         let mut frame_output_pipeline_id = None;
- 
-         // If this stacking context if the root of a pipeline, and the caller
-         // has requested it as an output frame, create a render task to isolate it.
-         if is_pipeline_root && self.output_pipelines.contains(&pipeline_id) {
-diff --git a/gfx/webrender_bindings/revision.txt b/gfx/webrender_bindings/revision.txt
---- a/gfx/webrender_bindings/revision.txt
-+++ b/gfx/webrender_bindings/revision.txt
-@@ -1,1 +1,1 @@
--3fa5eb8aaa0172306bfdc5e87d1d0c9af39d103a
-+6415faa7f6acd412d4cc6b745cf802204690611c
-diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
---- a/js/src/jit/BaselineBailouts.cpp
-+++ b/js/src/jit/BaselineBailouts.cpp
-@@ -642,19 +642,17 @@ InitFromBailout(JSContext* cx, size_t fr
-     // +---------------+
-     // |    StackS     |
-     // +---------------+  --- IF NOT LAST INLINE FRAME,
-     // |  Descr(BLJS)  |  --- CALLING INFO STARTS HERE
-     // +---------------+
-     // |  ReturnAddr   | <-- return into main jitcode after IC
-     // +===============+
- 
--    JitSpew(JitSpew_BaselineBailouts, "      Unpacking %s:%u:%u", script->filename(),
--                                                                  script->lineno(), 
--                                                                  script->column());
-+    JitSpew(JitSpew_BaselineBailouts, "      Unpacking %s:%u", script->filename(), script->lineno());
-     JitSpew(JitSpew_BaselineBailouts, "      [BASELINE-JS FRAME]");
- 
-     // Calculate and write the previous frame pointer value.
-     // Record the virtual stack offset at this location.  Later on, if we end up
-     // writing out a BaselineStub frame for the next callee, we'll need to save the
-     // address.
-     void* prevFramePtr = builder.calculatePrevFramePtr();
-     if (!builder.writePtr(prevFramePtr, "PrevFramePtr"))
-@@ -1042,19 +1040,19 @@ InitFromBailout(JSContext* cx, size_t fr
-                 // arguments in the slots and not be 4.
-                 MOZ_ASSERT(exprStackSlots == expectedDepth);
-             }
-         }
-     }
- #endif
- 
- #ifdef JS_JITSPEW
--    JitSpew(JitSpew_BaselineBailouts, "      Resuming %s pc offset %d (op %s) (line %d) of %s:%u:%u",
-+    JitSpew(JitSpew_BaselineBailouts, "      Resuming %s pc offset %d (op %s) (line %d) of %s:%u",
-                 resumeAfter ? "after" : "at", (int) pcOff, CodeName[op],
--                PCToLineNumber(script, pc), script->filename(), script->lineno(), script->column());
-+                PCToLineNumber(script, pc), script->filename(), script->lineno());
-     JitSpew(JitSpew_BaselineBailouts, "      Bailout kind: %s",
-             BailoutKindString(bailoutKind));
- #endif
- 
-     bool pushedNewTarget = IsConstructorCallPC(pc);
- 
-     // If this was the last inline frame, or we are bailing out to a catch or
-     // finally block in this frame, then unpacking is almost done.
-@@ -1552,18 +1550,18 @@ jit::BailoutIonToBaseline(JSContext* cx,
-     //      +---------------+
-     //      |  ReturnAddr   |
-     //      +---------------+
-     //      |    |||||      | <---- Overwrite starting here.
-     //      |    |||||      |
-     //      |    |||||      |
-     //      +---------------+
- 
--    JitSpew(JitSpew_BaselineBailouts, "Bailing to baseline %s:%u:%u (IonScript=%p) (FrameType=%d)",
--            iter.script()->filename(), iter.script()->lineno(), iter.script()->column(), (void*) iter.ionScript(),
-+    JitSpew(JitSpew_BaselineBailouts, "Bailing to baseline %s:%u (IonScript=%p) (FrameType=%d)",
-+            iter.script()->filename(), iter.script()->lineno(), (void*) iter.ionScript(),
-             (int) prevFrameType);
- 
-     bool catchingException;
-     bool propagatingExceptionForDebugMode;
-     if (excInfo) {
-         catchingException = excInfo->catchingException();
-         propagatingExceptionForDebugMode = excInfo->propagatingIonExceptionForDebugMode();
- 
-@@ -1608,18 +1606,18 @@ jit::BailoutIonToBaseline(JSContext* cx,
- 
- #ifdef TRACK_SNAPSHOTS
-     snapIter.spewBailingFrom();
- #endif
- 
-     RootedFunction callee(cx, iter.maybeCallee());
-     RootedScript scr(cx, iter.script());
-     if (callee) {
--        JitSpew(JitSpew_BaselineBailouts, "  Callee function (%s:%u:%u)",
--                scr->filename(), scr->lineno(), scr->column());
-+        JitSpew(JitSpew_BaselineBailouts, "  Callee function (%s:%u)",
-+                scr->filename(), scr->lineno());
-     } else {
-         JitSpew(JitSpew_BaselineBailouts, "  No callee!");
-     }
- 
-     if (iter.isConstructing())
-         JitSpew(JitSpew_BaselineBailouts, "  Constructing!");
-     else
-         JitSpew(JitSpew_BaselineBailouts, "  Not constructing!");
-@@ -1734,59 +1732,59 @@ InvalidateAfterBailout(JSContext* cx, Ha
- 
-     JitSpew(JitSpew_BaselineBailouts, "Invalidating due to %s", reason);
-     Invalidate(cx, outerScript);
- }
- 
- static void
- HandleBoundsCheckFailure(JSContext* cx, HandleScript outerScript, HandleScript innerScript)
- {
--    JitSpew(JitSpew_IonBailouts, "Bounds check failure %s:%u:%u, inlined into %s:%u:%u",
--            innerScript->filename(), innerScript->lineno(), innerScript->column(),
--            outerScript->filename(), outerScript->lineno(), outerScript->column());
-+    JitSpew(JitSpew_IonBailouts, "Bounds check failure %s:%u, inlined into %s:%u",
-+            innerScript->filename(), innerScript->lineno(),
-+            outerScript->filename(), outerScript->lineno());
- 
-     if (!innerScript->failedBoundsCheck())
-         innerScript->setFailedBoundsCheck();
- 
-     InvalidateAfterBailout(cx, outerScript, "bounds check failure");
-     if (innerScript->hasIonScript())
-         Invalidate(cx, innerScript);
- }
- 
- static void
- HandleShapeGuardFailure(JSContext* cx, HandleScript outerScript, HandleScript innerScript)
- {
--    JitSpew(JitSpew_IonBailouts, "Shape guard failure %s:%u:%u, inlined into %s:%u:%u",
--            innerScript->filename(), innerScript->lineno(), innerScript->column(),
--            outerScript->filename(), outerScript->lineno(), outerScript->column());
-+    JitSpew(JitSpew_IonBailouts, "Shape guard failure %s:%u, inlined into %s:%u",
-+            innerScript->filename(), innerScript->lineno(),
-+            outerScript->filename(), outerScript->lineno());
- 
-     // TODO: Currently this mimic's Ion's handling of this case.  Investigate setting
-     // the flag on innerScript as opposed to outerScript, and maybe invalidating both
-     // inner and outer scripts, instead of just the outer one.
-     outerScript->setFailedShapeGuard();
- 
-     InvalidateAfterBailout(cx, outerScript, "shape guard failure");
- }
- 
- static void
- HandleBaselineInfoBailout(JSContext* cx, HandleScript outerScript, HandleScript innerScript)
- {
--    JitSpew(JitSpew_IonBailouts, "Baseline info failure %s:%u:%u, inlined into %s:%u:%u",
--            innerScript->filename(), innerScript->lineno(), innerScript->column(),
--            outerScript->filename(), outerScript->lineno(), outerScript->column());
-+    JitSpew(JitSpew_IonBailouts, "Baseline info failure %s:%u, inlined into %s:%u",
-+            innerScript->filename(), innerScript->lineno(),
-+            outerScript->filename(), outerScript->lineno());
- 
-     InvalidateAfterBailout(cx, outerScript, "invalid baseline info");
- }
- 
- static void
- HandleLexicalCheckFailure(JSContext* cx, HandleScript outerScript, HandleScript innerScript)
- {
--    JitSpew(JitSpew_IonBailouts, "Lexical check failure %s:%u:%u, inlined into %s:%u:%u",
--            innerScript->filename(), innerScript->lineno(), innerScript->column(),
--            outerScript->filename(), outerScript->lineno(), outerScript->column());
-+    JitSpew(JitSpew_IonBailouts, "Lexical check failure %s:%u, inlined into %s:%u",
-+            innerScript->filename(), innerScript->lineno(),
-+            outerScript->filename(), outerScript->lineno());
- 
-     if (!innerScript->failedLexicalCheck())
-         innerScript->setFailedLexicalCheck();
- 
-     InvalidateAfterBailout(cx, outerScript, "lexical check failure");
-     if (innerScript->hasIonScript())
-         Invalidate(cx, innerScript);
- }
-@@ -1990,19 +1988,19 @@ jit::FinishBailoutToBaseline(BaselineBai
-     // If we are catching an exception, we need to unwind scopes.
-     // See |SettleOnTryNote|
-     if (cx->isExceptionPending() && faultPC) {
-         EnvironmentIter ei(cx, topFrame, faultPC);
-         UnwindEnvironment(cx, ei, tryPC);
-     }
- 
-     JitSpew(JitSpew_BaselineBailouts,
--            "  Restored outerScript=(%s:%u:%u,%u) innerScript=(%s:%u:%u,%u) (bailoutKind=%u)",
--            outerScript->filename(), outerScript->lineno(), outerScript->column(), outerScript->getWarmUpCount(),
--            innerScript->filename(), innerScript->lineno(), innerScript->column(), innerScript->getWarmUpCount(),
-+            "  Restored outerScript=(%s:%u,%u) innerScript=(%s:%u,%u) (bailoutKind=%u)",
-+            outerScript->filename(), outerScript->lineno(), outerScript->getWarmUpCount(),
-+            innerScript->filename(), innerScript->lineno(), innerScript->getWarmUpCount(),
-             (unsigned) bailoutKind);
- 
-     switch (bailoutKind) {
-       // Normal bailouts.
-       case Bailout_Inevitable:
-       case Bailout_DuringVMCall:
-       case Bailout_NonJSFunctionCallee:
-       case Bailout_DynamicNameNotFound:
-diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp
---- a/js/src/jit/BaselineCompiler.cpp
-+++ b/js/src/jit/BaselineCompiler.cpp
-@@ -81,21 +81,21 @@ BaselineCompiler::addPCMappingEntry(bool
-     entry.addIndexEntry = addIndexEntry;
- 
-     return pcMappingEntries_.append(entry);
- }
- 
- MethodStatus
- BaselineCompiler::compile()
- {
--    JitSpew(JitSpew_BaselineScripts, "Baseline compiling script %s:%u:%u (%p)",
--            script->filename(), script->lineno(), script->column(), script);
--
--    JitSpew(JitSpew_Codegen, "# Emitting baseline code for script %s:%u:%u",
--            script->filename(), script->lineno(), script->column());
-+    JitSpew(JitSpew_BaselineScripts, "Baseline compiling script %s:%u (%p)",
-+            script->filename(), script->lineno(), script);
-+
-+    JitSpew(JitSpew_Codegen, "# Emitting baseline code for script %s:%u",
-+            script->filename(), script->lineno());
- 
-     TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);
-     TraceLoggerEvent scriptEvent(TraceLogger_AnnotateScripts, script);
-     AutoTraceLog logScript(logger, scriptEvent);
-     AutoTraceLog logCompile(logger, TraceLogger_BaselineCompilation);
- 
-     AutoKeepTypeScripts keepTypes(cx);
-     if (!script->ensureHasTypes(cx, keepTypes) || !script->ensureHasAnalyzedArgsUsage(cx))
-@@ -217,19 +217,19 @@ BaselineCompiler::compile()
-     if (!baselineScript) {
-         ReportOutOfMemory(cx);
-         return Method_Error;
-     }
- 
-     baselineScript->setMethod(code);
-     baselineScript->setTemplateEnvironment(templateEnv);
- 
--    JitSpew(JitSpew_BaselineScripts, "Created BaselineScript %p (raw %p) for %s:%u:%u",
-+    JitSpew(JitSpew_BaselineScripts, "Created BaselineScript %p (raw %p) for %s:%u",
-             (void*) baselineScript.get(), (void*) code->raw(),
--            script->filename(), script->lineno(), script->column());
-+            script->filename(), script->lineno());
- 
-     MOZ_ASSERT(pcMappingIndexEntries.length() > 0);
-     baselineScript->copyPCMappingIndexEntries(&pcMappingIndexEntries[0]);
- 
-     MOZ_ASSERT(pcEntries.length() > 0);
-     baselineScript->copyPCMappingEntries(pcEntries);
- 
-     // Copy IC entries
-@@ -273,18 +273,18 @@ BaselineCompiler::compile()
-     baselineScript->copyYieldAndAwaitEntries(script, yieldAndAwaitOffsets_);
- 
-     if (compileDebugInstrumentation_)
-         baselineScript->setHasDebugInstrumentation();
- 
-     // Always register a native => bytecode mapping entry, since profiler can be
-     // turned on with baseline jitcode on stack, and baseline jitcode cannot be invalidated.
-     {
--        JitSpew(JitSpew_Profiling, "Added JitcodeGlobalEntry for baseline script %s:%u:%u (%p)",
--                    script->filename(), script->lineno(), script->column(), baselineScript.get());
-+        JitSpew(JitSpew_Profiling, "Added JitcodeGlobalEntry for baseline script %s:%u (%p)",
-+                    script->filename(), script->lineno(), baselineScript.get());
- 
-         // Generate profiling string.
-         char* str = JitcodeGlobalEntry::createScriptString(cx, script);
-         if (!str)
-             return Method_Error;
- 
-         JitcodeGlobalEntry::BaselineEntry entry;
-         entry.init(code, code->raw(), code->rawEnd(), script, str);
-diff --git a/js/src/jit/BaselineDebugModeOSR.cpp b/js/src/jit/BaselineDebugModeOSR.cpp
---- a/js/src/jit/BaselineDebugModeOSR.cpp
-+++ b/js/src/jit/BaselineDebugModeOSR.cpp
-@@ -318,29 +318,29 @@ ICEntryKindToString(ICEntry::Kind kind)
- }
- #endif // JS_JITSPEW
- 
- static void
- SpewPatchBaselineFrame(uint8_t* oldReturnAddress, uint8_t* newReturnAddress,
-                        JSScript* script, ICEntry::Kind frameKind, jsbytecode* pc)
- {
-     JitSpew(JitSpew_BaselineDebugModeOSR,
--            "Patch return %p -> %p on BaselineJS frame (%s:%u:%u) from %s at %s",
-+            "Patch return %p -> %p on BaselineJS frame (%s:%u) from %s at %s",
-             oldReturnAddress, newReturnAddress, script->filename(), script->lineno(),
--            script->column(), ICEntryKindToString(frameKind), CodeName[(JSOp)*pc]);
-+            ICEntryKindToString(frameKind), CodeName[(JSOp)*pc]);
- }
- 
- static void
- SpewPatchBaselineFrameFromExceptionHandler(uint8_t* oldReturnAddress, uint8_t* newReturnAddress,
-                                            JSScript* script, jsbytecode* pc)
- {
-     JitSpew(JitSpew_BaselineDebugModeOSR,
--            "Patch return %p -> %p on BaselineJS frame (%s:%u:%u) from exception handler at %s",
-+            "Patch return %p -> %p on BaselineJS frame (%s:%u) from exception handler at %s",
-             oldReturnAddress, newReturnAddress, script->filename(), script->lineno(),
--            script->column(), CodeName[(JSOp)*pc]);
-+            CodeName[(JSOp)*pc]);
- }
- 
- static void
- SpewPatchStubFrame(ICStub* oldStub, ICStub* newStub)
- {
-     JitSpew(JitSpew_BaselineDebugModeOSR,
-             "Patch   stub %p -> %p on BaselineStub frame (%s)",
-             oldStub, newStub, newStub ? ICStub::KindString(newStub->kind()) : "exception handler");
-@@ -678,19 +678,18 @@ RecompileBaselineScriptForDebugMode(JSCo
- {
-     BaselineScript* oldBaselineScript = script->baselineScript();
- 
-     // If a script is on the stack multiple times, it may have already
-     // been recompiled.
-     if (oldBaselineScript->hasDebugInstrumentation() == observing)
-         return true;
- 
--    JitSpew(JitSpew_BaselineDebugModeOSR, "Recompiling (%s:%u:%u) for %s",
--            script->filename(), script->lineno(), script->column(), 
--            observing ? "DEBUGGING" : "NORMAL EXECUTION");
-+    JitSpew(JitSpew_BaselineDebugModeOSR, "Recompiling (%s:%u) for %s",
-+            script->filename(), script->lineno(), observing ? "DEBUGGING" : "NORMAL EXECUTION");
- 
-     AutoKeepTypeScripts keepTypes(cx);
-     script->setBaselineScript(cx->runtime(), nullptr);
- 
-     MethodStatus status = BaselineCompile(cx, script, /* forceDebugMode = */ observing);
-     if (status != Method_Compiled) {
-         // We will only fail to recompile for debug mode due to OOM. Restore
-         // the old baseline script in case something doesn't properly
-diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp
---- a/js/src/jit/BaselineIC.cpp
-+++ b/js/src/jit/BaselineIC.cpp
-@@ -65,20 +65,19 @@ FallbackICSpew(JSContext* cx, ICFallback
- 
-         char fmtbuf[100];
-         va_list args;
-         va_start(args, fmt);
-         (void) VsprintfLiteral(fmtbuf, fmt, args);
-         va_end(args);
- 
-         JitSpew(JitSpew_BaselineICFallback,
--                "Fallback hit for (%s:%u:%u) (pc=%zu,line=%d,uses=%d,stubs=%zu): %s",
-+                "Fallback hit for (%s:%u) (pc=%zu,line=%d,uses=%d,stubs=%zu): %s",
-                 script->filename(),
-                 script->lineno(),
--                script->column(),
-                 script->pcToOffset(pc),
-                 PCToLineNumber(script, pc),
-                 script->getWarmUpCount(),
-                 stub->numOptimizedStubs(),
-                 fmtbuf);
-     }
- }
- 
-@@ -91,20 +90,19 @@ TypeFallbackICSpew(JSContext* cx, ICType
- 
-         char fmtbuf[100];
-         va_list args;
-         va_start(args, fmt);
-         (void) VsprintfLiteral(fmtbuf, fmt, args);
-         va_end(args);
- 
-         JitSpew(JitSpew_BaselineICFallback,
--                "Type monitor fallback hit for (%s:%u:%u) (pc=%zu,line=%d,uses=%d,stubs=%d): %s",
-+                "Type monitor fallback hit for (%s:%u) (pc=%zu,line=%d,uses=%d,stubs=%d): %s",
-                 script->filename(),
-                 script->lineno(),
--                script->column(),
-                 script->pcToOffset(pc),
-                 PCToLineNumber(script, pc),
-                 script->getWarmUpCount(),
-                 (int) stub->numOptimizedMonitorStubs(),
-                 fmtbuf);
-     }
- }
- #endif // JS_JITSPEW
-@@ -3335,19 +3333,19 @@ TryAttachCallStub(JSContext* cx, ICCall_
-         }
- 
-         if (nativeWithJitEntry) {
-             JitSpew(JitSpew_BaselineIC,
-                     "  Generating Call_Scripted stub (native=%p with jit entry, cons=%s, spread=%s)",
-                     fun->native(), constructing ? "yes" : "no", isSpread ? "yes" : "no");
-         } else {
-             JitSpew(JitSpew_BaselineIC,
--                    "  Generating Call_Scripted stub (fun=%p, %s:%u:%u, cons=%s, spread=%s)",
-+                    "  Generating Call_Scripted stub (fun=%p, %s:%u, cons=%s, spread=%s)",
-                     fun.get(), fun->nonLazyScript()->filename(), fun->nonLazyScript()->lineno(),
--                    fun->nonLazyScript()->column(), constructing ? "yes" : "no", isSpread ? "yes" : "no");
-+                    constructing ? "yes" : "no", isSpread ? "yes" : "no");
-         }
- 
-         bool isCrossRealm = cx->realm() != fun->realm();
-         ICCallScriptedCompiler compiler(cx, typeMonitorFallback->firstMonitorStub(),
-                                         fun, templateObject,
-                                         constructing, isSpread, isCrossRealm,
-                                         script->pcToOffset(pc));
-         ICStub* newStub = compiler.getStub(compiler.getStubSpace(script));
-diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
---- a/js/src/jit/CodeGenerator.cpp
-+++ b/js/src/jit/CodeGenerator.cpp
-@@ -10207,20 +10207,19 @@ CodeGenerator::generateWasm(wasm::FuncTy
-     MOZ_ASSERT(safepoints_.size() == 0);
-     MOZ_ASSERT(!scriptCounts_);
-     return true;
- }
- 
- bool
- CodeGenerator::generate()
- {
--    JitSpew(JitSpew_Codegen, "# Emitting code for script %s:%u:%u",
-+    JitSpew(JitSpew_Codegen, "# Emitting code for script %s:%u",
-             gen->info().script()->filename(),
--            gen->info().script()->lineno(),
--            gen->info().script()->column());
-+            gen->info().script()->lineno());
- 
-     // Initialize native code table with an entry to the start of
-     // top-level script.
-     InlineScriptTree* tree = gen->info().inlineScriptTree();
-     jsbytecode* startPC = tree->script()->code();
-     BytecodeSite* startSite = new(gen->alloc()) BytecodeSite(tree, startPC);
-     if (!addNativeToBytecodeEntry(startSite))
-         return false;
-diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
---- a/js/src/jit/Ion.cpp
-+++ b/js/src/jit/Ion.cpp
-@@ -2027,19 +2027,19 @@ IonCompile(JSContext* cx, JSScript* scri
- 
-         return reason;
-     }
- 
-     AssertBasicGraphCoherency(builder->graph());
- 
-     // If possible, compile the script off thread.
-     if (options.offThreadCompilationAvailable()) {
--        JitSpew(JitSpew_IonSyncLogs, "Can't log script %s:%u:%u"
-+        JitSpew(JitSpew_IonSyncLogs, "Can't log script %s:%u"
-                 ". (Compiled on background thread.)",
--                builderScript->filename(), builderScript->lineno(), builderScript->column());
-+                builderScript->filename(), builderScript->lineno());
- 
-         if (!CreateMIRRootList(*builder))
-             return AbortReason::Alloc;
- 
-         AutoLockHelperThreadState lock;
-         if (!StartOffThreadIonCompile(builder, lock)) {
-             JitSpew(JitSpew_IonAbort, "Unable to start off-thread ion compilation.");
-             builder->graphSpewer().endFunction();
-@@ -2222,18 +2222,17 @@ Compile(JSContext* cx, HandleScript scri
-         return Method_Skipped;
- 
-     if (script->isDebuggee() || (osrFrame && osrFrame->isDebuggee())) {
-         TrackAndSpewIonAbort(cx, script, "debugging");
-         return Method_Skipped;
-     }
- 
-     if (!CanIonCompileScript(cx, script)) {
--        JitSpew(JitSpew_IonAbort, "Aborted compilation of %s:%u:%u", script->filename(),
--                script->lineno(), script->column());
-+        JitSpew(JitSpew_IonAbort, "Aborted compilation of %s:%u", script->filename(), script->lineno());
-         return Method_CantCompile;
-     }
- 
-     bool recompile = false;
-     OptimizationLevel optimizationLevel = GetOptimizationLevel(script, osrPc);
-     if (optimizationLevel == OptimizationLevel::DontCompile)
-         return Method_Skipped;
- 
-@@ -2493,19 +2492,18 @@ jit::IonCompileScriptForBaseline(JSConte
-         // TODO: ASSERT that a ion-script-already-exists checker stub doesn't exist.
-         // TODO: Clear all optimized stubs.
-         // TODO: Add a ion-script-already-exists checker stub.
-         return true;
-     }
- 
-     // Ensure that Ion-compiled code is available.
-     JitSpew(JitSpew_BaselineOSR,
--            "WarmUpCounter for %s:%u:%u reached %d at pc %p, trying to switch to Ion!",
--            script->filename(), script->lineno(), script->column(), 
--            (int) script->getWarmUpCount(), (void*) pc);
-+            "WarmUpCounter for %s:%u reached %d at pc %p, trying to switch to Ion!",
-+            script->filename(), script->lineno(), (int) script->getWarmUpCount(), (void*) pc);
- 
-     MethodStatus stat;
-     if (isLoopEntry) {
-         MOZ_ASSERT(LoopEntryCanIonOsr(pc));
-         JitSpew(JitSpew_BaselineOSR, "  Compile at loop entry!");
-         stat = BaselineCanEnterAtBranch(cx, script, frame, pc);
-     } else if (frame->isFunctionFrame()) {
-         JitSpew(JitSpew_BaselineOSR, "  Compile function from top for later entry!");
-@@ -2598,20 +2596,20 @@ InvalidateActivation(FreeOp* fop, const 
-             const char* type = "Unknown";
-             if (frame.isIonJS())
-                 type = "Optimized";
-             else if (frame.isBaselineJS())
-                 type = "Baseline";
-             else if (frame.isBailoutJS())
-                 type = "Bailing";
-             JitSpew(JitSpew_IonInvalidate,
--                    "#%zu %s JS frame @ %p, %s:%u:%u (fun: %p, script: %p, pc %p)",
-+                    "#%zu %s JS frame @ %p, %s:%u (fun: %p, script: %p, pc %p)",
-                     frameno, type, frame.fp(), frame.script()->maybeForwardedFilename(),
--                    frame.script()->lineno(), frame.script()->column(), frame.maybeCallee(), 
--                    (JSScript*)frame.script(), frame.returnAddressToFp());
-+                    frame.script()->lineno(), frame.maybeCallee(), (JSScript*)frame.script(),
-+                    frame.returnAddressToFp());
-             break;
-           }
-           case FrameType::BaselineStub:
-             JitSpew(JitSpew_IonInvalidate, "#%zu baseline stub frame @ %p", frameno, frame.fp());
-             break;
-           case FrameType::Rectifier:
-             JitSpew(JitSpew_IonInvalidate, "#%zu rectifier frame @ %p", frameno, frame.fp());
-             break;
-@@ -2755,19 +2753,18 @@ jit::Invalidate(TypeZone& types, FreeOp*
-     for (const RecompileInfo& info : invalid) {
-         if (cancelOffThread)
-             CancelOffThreadIonCompile(info.script());
- 
-         IonScript* ionScript = info.maybeIonScriptToInvalidate(types);
-         if (!ionScript)
-             continue;
- 
--        JitSpew(JitSpew_IonInvalidate, " Invalidate %s:%u:%u, IonScript %p",
--                info.script()->filename(), info.script()->lineno(), 
--                info.script()->column(), ionScript);
-+        JitSpew(JitSpew_IonInvalidate, " Invalidate %s:%u, IonScript %p",
-+                info.script()->filename(), info.script()->lineno(), ionScript);
- 
-         // Keep the ion script alive during the invalidation and flag this
-         // ionScript as being invalidated.  This increment is removed by the
-         // loop after the calls to InvalidateActivation.
-         ionScript->incrementInvalidationCount();
-         numInvalidations++;
-     }
- 
-@@ -2848,18 +2845,17 @@ jit::Invalidate(JSContext* cx, JSScript*
-         //      "<filename>:<lineno>"
- 
-         // Get the script filename, if any, and its length.
-         const char* filename = script->filename();
-         if (filename == nullptr)
-             filename = "<unknown>";
- 
-         // Construct the descriptive string.
--        UniqueChars buf = JS_smprintf("Invalidate %s:%u:%u", filename, 
--                script->lineno(), script->column());
-+        UniqueChars buf = JS_smprintf("Invalidate %s:%u", filename, script->lineno());
- 
-         // Ignore the event on allocation failure.
-         if (buf) {
-             cx->runtime()->geckoProfiler().markEvent(buf.get());
-         }
-     }
- 
-     // RecompileInfoVector has inline space for at least one element.
-@@ -2885,18 +2881,18 @@ jit::FinishInvalidation(FreeOp* fop, JSS
-     // true. In this case we have to wait until destroying it.
-     if (!ion->invalidated())
-         jit::IonScript::Destroy(fop, ion);
- }
- 
- void
- jit::ForbidCompilation(JSContext* cx, JSScript* script)
- {
--    JitSpew(JitSpew_IonAbort, "Disabling Ion compilation of script %s:%u:%u",
--            script->filename(), script->lineno(), script->column());
-+    JitSpew(JitSpew_IonAbort, "Disabling Ion compilation of script %s:%u",
-+            script->filename(), script->lineno());
- 
-     CancelOffThreadIonCompile(script);
- 
-     if (script->hasIonScript())
-         Invalidate(cx, script, false);
- 
-     script->setIonScript(cx->runtime(), ION_DISABLED_SCRIPT);
- }
-diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
---- a/js/src/jit/IonBuilder.cpp
-+++ b/js/src/jit/IonBuilder.cpp
-@@ -321,19 +321,18 @@ IonBuilder::getPolyCallTargets(Temporary
- 
-     return Ok();
- }
- 
- IonBuilder::InliningDecision
- IonBuilder::DontInline(JSScript* targetScript, const char* reason)
- {
-     if (targetScript) {
--        JitSpew(JitSpew_Inlining, "Cannot inline %s:%u:%u %s",
--                targetScript->filename(), targetScript->lineno(), 
--                targetScript->column(), reason);
-+        JitSpew(JitSpew_Inlining, "Cannot inline %s:%u: %s",
-+                targetScript->filename(), targetScript->lineno(), reason);
-     } else {
-         JitSpew(JitSpew_Inlining, "Cannot inline: %s", reason);
-     }
- 
-     return InliningDecision_DontInline;
- }
- 
- /*
-@@ -748,24 +747,24 @@ IonBuilder::build()
-         script()->baselineScript()->resetMaxInliningDepth();
- 
-     MBasicBlock* entry;
-     MOZ_TRY_VAR(entry, newBlock(info().firstStackSlot(), pc));
-     MOZ_TRY(setCurrentAndSpecializePhis(entry));
- 
- #ifdef JS_JITSPEW
-     if (info().isAnalysis()) {
--        JitSpew(JitSpew_IonScripts, "Analyzing script %s:%u:%u (%p) %s",
--                script()->filename(), script()->lineno(), script()->column(),
--                (void*)script(), AnalysisModeString(info().analysisMode()));
-+        JitSpew(JitSpew_IonScripts, "Analyzing script %s:%u (%p) %s",
-+                script()->filename(), script()->lineno(), (void*)script(),
-+                AnalysisModeString(info().analysisMode()));
-     } else {
--        JitSpew(JitSpew_IonScripts, "%sompiling script %s:%u:%u (%p) (warmup-counter=%" PRIu32 ", level=%s)",
-+        JitSpew(JitSpew_IonScripts, "%sompiling script %s:%u (%p) (warmup-counter=%" PRIu32 ", level=%s)",
-                 (script()->hasIonScript() ? "Rec" : "C"),
--                script()->filename(), script()->lineno(), script()->column(), 
--                (void*)script(), script()->getWarmUpCount(), OptimizationLevelString(optimizationInfo().level()));
-+                script()->filename(), script()->lineno(), (void*)script(),
-+                script()->getWarmUpCount(), OptimizationLevelString(optimizationInfo().level()));
-     }
- #endif
- 
-     MOZ_TRY(initParameters());
-     initLocals();
- 
-     // Initialize something for the env chain. We can bail out before the
-     // start instruction, but the snapshot is encoded *at* the start
-@@ -922,18 +921,18 @@ IonBuilder::processIterators()
- AbortReasonOr<Ok>
- IonBuilder::buildInline(IonBuilder* callerBuilder, MResumePoint* callerResumePoint,
-                         CallInfo& callInfo)
- {
-     inlineCallInfo_ = &callInfo;
- 
-     MOZ_TRY(init());
- 
--    JitSpew(JitSpew_IonScripts, "Inlining script %s:%u:%u (%p)",
--            script()->filename(), script()->lineno(), script()->column(), (void*)script());
-+    JitSpew(JitSpew_IonScripts, "Inlining script %s:%u (%p)",
-+            script()->filename(), script()->lineno(), (void*)script());
- 
-     callerBuilder_ = callerBuilder;
-     callerResumePoint_ = callerResumePoint;
- 
-     if (callerBuilder->failedBoundsCheck_)
-         failedBoundsCheck_ = true;
- 
-     if (callerBuilder->failedShapeGuard_)
-@@ -1219,18 +1218,18 @@ IonBuilder::initEnvironmentChain(MDefini
-     // See: |InitFromBailout|
-     current->setEnvironmentChain(env);
-     return Ok();
- }
- 
- void
- IonBuilder::initArgumentsObject()
- {
--    JitSpew(JitSpew_IonMIR, "%s:%u:%u - Emitting code to initialize arguments object! block=%p",
--            script()->filename(), script()->lineno(), script()->column(), current);
-+    JitSpew(JitSpew_IonMIR, "%s:%u - Emitting code to initialize arguments object! block=%p",
-+            script()->filename(), script()->lineno(), current);
-     MOZ_ASSERT(info().needsArgsObj());
- 
-     bool mapped = script()->hasMappedArgsObj();
-     ArgumentsObject* templateObj = script()->realm()->maybeArgumentsTemplateObject(mapped);
- 
-     MCreateArgumentsObject* argsObj =
-         MCreateArgumentsObject::New(alloc(), current->environmentChain(), templateObj);
-     current->add(argsObj);
-@@ -1431,18 +1430,18 @@ GetOrCreateControlFlowGraph(TempAllocato
-         return CFGState::Alloc;
- 
-     if (script->hasBaselineScript()) {
-         MOZ_ASSERT(!script->baselineScript()->controlFlowGraph());
-         script->baselineScript()->setControlFlowGraph(cfg);
-     }
- 
-     if (JitSpewEnabled(JitSpew_CFG)) {
--        JitSpew(JitSpew_CFG, "Generating graph for %s:%u:%u",
--                             script->filename(), script->lineno(), script->column());
-+        JitSpew(JitSpew_CFG, "Generating graph for %s:%u",
-+                             script->filename(), script->lineno());
-         Fprinter& print = JitSpewPrinter();
-         cfg->dump(print, script);
-     }
- 
-     *cfgOut = cfg;
-     return CFGState::Success;
- }
- 
-@@ -4030,18 +4029,18 @@ IonBuilder::makeInliningDecision(JSObjec
-     // Callee must have been called a few times to have somewhat stable
-     // type information, except for definite properties analysis,
-     // as the caller has not run yet.
-     if (targetScript->getWarmUpCount() < optimizationInfo().inliningWarmUpThreshold() &&
-         !targetScript->baselineScript()->ionCompiledOrInlined() &&
-         info().analysisMode() != Analysis_DefiniteProperties)
-     {
-         trackOptimizationOutcome(TrackedOutcome::CantInlineNotHot);
--        JitSpew(JitSpew_Inlining, "Cannot inline %s:%u:%u: callee is insufficiently hot.",
--                targetScript->filename(), targetScript->lineno(), targetScript->column());
-+        JitSpew(JitSpew_Inlining, "Cannot inline %s:%u: callee is insufficiently hot.",
-+                targetScript->filename(), targetScript->lineno());
-         return InliningDecision_WarmUpCountTooLow;
-     }
- 
-     // Don't inline if the callee is known to inline a lot of code, to avoid
-     // huge MIR graphs.
-     uint32_t inlinedBytecodeLength = targetScript->baselineScript()->inlinedBytecodeLength();
-     if (inlinedBytecodeLength > optimizationInfo().inlineMaxCalleeInlinedBytecodeLength()) {
-         trackOptimizationOutcome(TrackedOutcome::CantInlineBigCalleeInlinedBytecodeLength);
-diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp
---- a/js/src/jit/IonIC.cpp
-+++ b/js/src/jit/IonIC.cpp
-@@ -157,18 +157,18 @@ IonGetPropertyIC::update(JSContext* cx, 
- 
-     if (!attached && ic->idempotent()) {
-         // Invalidate the cache if the property was not found, or was found on
-         // a non-native object. This ensures:
-         // 1) The property read has no observable side-effects.
-         // 2) There's no need to dynamically monitor the return type. This would
-         //    be complicated since (due to GVN) there can be multiple pc's
-         //    associated with a single idempotent cache.
--        JitSpew(JitSpew_IonIC, "Invalidating from idempotent cache %s:%u:%u",
--                outerScript->filename(), outerScript->lineno(), outerScript->column());
-+        JitSpew(JitSpew_IonIC, "Invalidating from idempotent cache %s:%u",
-+                outerScript->filename(), outerScript->lineno());
- 
-         outerScript->setInvalidatedIdempotentCache();
- 
-         // Do not re-invalidate if the lookup already caused invalidation.
-         if (outerScript->hasIonScript())
-             Invalidate(cx, outerScript);
- 
-         // We will redo the potentially effectful lookup in Baseline.
-diff --git a/js/src/jit/JitcodeMap.cpp b/js/src/jit/JitcodeMap.cpp
---- a/js/src/jit/JitcodeMap.cpp
-+++ b/js/src/jit/JitcodeMap.cpp
-@@ -1531,25 +1531,24 @@ JitcodeIonTable::WriteIonTable(CompactBu
-                                const NativeToBytecode* end,
-                                uint32_t* tableOffsetOut, uint32_t* numRegionsOut)
- {
-     MOZ_ASSERT(tableOffsetOut != nullptr);
-     MOZ_ASSERT(numRegionsOut != nullptr);
-     MOZ_ASSERT(writer.length() == 0);
-     MOZ_ASSERT(scriptListSize > 0);
- 
--    JitSpew(JitSpew_Profiling, "Writing native to bytecode map for %s:%u:%u (%zu entries)",
--            scriptList[0]->filename(), scriptList[0]->lineno(), scriptList[0]->column(),
-+    JitSpew(JitSpew_Profiling, "Writing native to bytecode map for %s:%u (%zu entries)",
-+            scriptList[0]->filename(), scriptList[0]->lineno(),
-             mozilla::PointerRangeSize(start, end));
- 
-     JitSpew(JitSpew_Profiling, "  ScriptList of size %d", int(scriptListSize));
-     for (uint32_t i = 0; i < scriptListSize; i++) {
--        JitSpew(JitSpew_Profiling, "  Script %d - %s:%u:%u",
--                int(i), scriptList[i]->filename(), 
--                scriptList[i]->lineno(), scriptList[i]->column());
-+        JitSpew(JitSpew_Profiling, "  Script %d - %s:%u",
-+                int(i), scriptList[i]->filename(), scriptList[i]->lineno());
-     }
- 
-     // Write out runs first.  Keep a vector tracking the positive offsets from payload
-     // start to the run.
-     const NativeToBytecode* curEntry = start;
-     js::Vector<uint32_t, 32, SystemAllocPolicy> runOffsets;
- 
-     while (curEntry != end) {
-diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp
---- a/js/src/jit/shared/CodeGenerator-shared.cpp
-+++ b/js/src/jit/shared/CodeGenerator-shared.cpp
-@@ -277,19 +277,18 @@ CodeGeneratorShared::addNativeToBytecode
-     return true;
- }
- 
- void
- CodeGeneratorShared::dumpNativeToBytecodeEntries()
- {
- #ifdef JS_JITSPEW
-     InlineScriptTree* topTree = gen->info().inlineScriptTree();
--    JitSpewStart(JitSpew_Profiling, "Native To Bytecode Entries for %s:%u:%u\n",
--                 topTree->script()->filename(), topTree->script()->lineno(),
--                 topTree->script()->column());
-+    JitSpewStart(JitSpew_Profiling, "Native To Bytecode Entries for %s:%u\n",
-+                 topTree->script()->filename(), topTree->script()->lineno());
-     for (unsigned i = 0; i < nativeToBytecodeList_.length(); i++)
-         dumpNativeToBytecodeEntry(i);
- #endif
- }
- 
- void
- CodeGeneratorShared::dumpNativeToBytecodeEntry(uint32_t idx)
- {
-@@ -301,28 +300,27 @@ CodeGeneratorShared::dumpNativeToBytecod
-     unsigned nativeDelta = 0;
-     unsigned pcDelta = 0;
-     if (idx + 1 < nativeToBytecodeList_.length()) {
-         NativeToBytecode* nextRef = &ref + 1;
-         nativeDelta = nextRef->nativeOffset.offset() - nativeOffset;
-         if (nextRef->tree == ref.tree)
-             pcDelta = nextRef->pc - ref.pc;
-     }
--    JitSpewStart(JitSpew_Profiling, "    %08zx [+%-6d] => %-6ld [%-4d] {%-10s} (%s:%u:%u",
-+    JitSpewStart(JitSpew_Profiling, "    %08zx [+%-6d] => %-6ld [%-4d] {%-10s} (%s:%u",
-                  ref.nativeOffset.offset(),
-                  nativeDelta,
-                  (long) (ref.pc - script->code()),
-                  pcDelta,
-                  CodeName[JSOp(*ref.pc)],
--                 script->filename(), script->lineno(), script->column());
-+                 script->filename(), script->lineno());
- 
-     for (tree = tree->caller(); tree; tree = tree->caller()) {
--        JitSpewCont(JitSpew_Profiling, " <= %s:%u:%u", tree->script()->filename(),
--                                                       tree->script()->lineno(),
--                                                       tree->script()->column());
-+        JitSpewCont(JitSpew_Profiling, " <= %s:%u", tree->script()->filename(),
-+                                                    tree->script()->lineno());
-     }
-     JitSpewCont(JitSpew_Profiling, ")");
-     JitSpewFin(JitSpew_Profiling);
- #endif
- }
- 
- bool
- CodeGeneratorShared::addTrackedOptimizationsEntry(const TrackedOptimizations* optimizations)
-diff --git a/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py b/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
---- a/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
-+++ b/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
-@@ -490,16 +490,43 @@ class AccessibleCaretSelectionModeTestCa
-         (caret1_x, caret1_y), (caret2_x, caret2_y) = sel.carets_location()
-         self.actions.flick(body, caret2_x, caret2_y, start_caret_x, start_caret_y).perform()
- 
-         # Drag end caret back to the target word
-         self.actions.flick(body, start_caret_x, start_caret_y, caret2_x, caret2_y).perform()
- 
-         self.assertEqual(self.to_unix_line_ending(sel.selected_content), 'select')
- 
-+    @skip_if_not_rotatable
-+    def test_caret_position_after_changing_orientation_of_device(self):
-+        '''Bug 1094072
-+        If positions of carets are updated correctly, they should be draggable.
-+        '''
-+        self.open_test_html(self._longtext_html)
-+        body = self.marionette.find_element(By.ID, 'bd')
-+        longtext = self.marionette.find_element(By.ID, 'longtext')
-+
-+        # Select word in portrait mode, then change to landscape mode
-+        self.marionette.set_orientation('portrait')
-+        self.long_press_on_word(longtext, 12)
-+        sel = SelectionManager(body)
-+        (p_start_caret_x, p_start_caret_y), (p_end_caret_x, p_end_caret_y) = sel.carets_location()
-+        self.marionette.set_orientation('landscape')
-+        (l_start_caret_x, l_start_caret_y), (l_end_caret_x, l_end_caret_y) = sel.carets_location()
-+
-+        # Drag end caret to the start caret to change the selected content
-+        self.actions.flick(body, l_end_caret_x, l_end_caret_y,
-+                           l_start_caret_x, l_start_caret_y).perform()
-+
-+        # Change orientation back to portrait mode to prevent affecting
-+        # other tests
-+        self.marionette.set_orientation('portrait')
-+
-+        self.assertEqual(self.to_unix_line_ending(sel.selected_content), 'o')
-+
-     def test_select_word_inside_an_iframe(self):
-         '''Bug 1088552
-         The scroll offset in iframe should be taken into consideration properly.
-         In this test, we scroll content in the iframe to the bottom to cause a
-         huge offset. If we use the right coordinate system, selection should
-         work. Otherwise, it would be hard to trigger select word.
-         '''
-         self.open_test_html(self._iframe_html)
-diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json
---- a/toolkit/components/telemetry/Histograms.json
-+++ b/toolkit/components/telemetry/Histograms.json
-@@ -533,26 +533,16 @@
-     "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
-     "expires_in_version": "never",
-     "kind": "linear",
-     "high": 100,
-     "n_buckets": 50,
-     "bug_numbers": [1372042],
-     "description": "Percent of the cycle collector's forget skippable done during idle time"
-   },
--  "FORGET_SKIPPABLE_FREQUENCY": {
--    "record_in_processes": ["main", "content"],
--    "alert_emails": ["smaug@mozilla.com", "dev-telemetry-gc-alerts@mozilla.org"],
--    "expires_in_version": "never",
--    "kind": "linear",
--    "high": 500,
--    "n_buckets": 100,
--    "bug_numbers": [1487271],
--    "description": "Number of forget skippables occurred during a minute"
--  },
-   "FULLSCREEN_TRANSITION_BLACK_MS": {
-     "record_in_processes": ["main", "content"],
-     "alert_emails": ["xquan@mozilla.com"],
-     "expires_in_version": "never",
-     "kind": "exponential",
-     "low": 100,
-     "high": 5000,
-     "n_buckets": 50,
-diff --git a/toolkit/content/widgets/tabbox.js b/toolkit/content/widgets/tabbox.js
---- a/toolkit/content/widgets/tabbox.js
-+++ b/toolkit/content/widgets/tabbox.js
-@@ -9,23 +9,37 @@
- class MozTabbox extends MozXULElement {
-   constructor() {
-     super();
-     this._handleMetaAltArrows = /Mac/.test(navigator.platform);
-     this.disconnectedCallback = this.disconnectedCallback.bind(this);
-   }
- 
-   connectedCallback() {
--    Services.els.addSystemEventListener(document, "keydown", this, false);
-+    switch (this.getAttribute("eventnode")) {
-+      case "parent":
-+        this._eventNode = this.parentNode;
-+        break;
-+      case "window":
-+        this._eventNode = window;
-+        break;
-+      case "document":
-+        this._eventNode = document;
-+        break;
-+      default:
-+        this._eventNode = this;
-+    }
-+
-+    Services.els.addSystemEventListener(this._eventNode, "keydown", this, false);
-     window.addEventListener("unload", this.disconnectedCallback, { once: true });
-   }
- 
-   disconnectedCallback() {
-     window.removeEventListener("unload", this.disconnectedCallback);
--    Services.els.removeSystemEventListener(document, "keydown", this, false);
-+    Services.els.removeSystemEventListener(this._eventNode, "keydown", this, false);
-   }
- 
-   set handleCtrlTab(val) {
-     this.setAttribute("handleCtrlTab", val);
-     return val;
-   }
- 
-   get handleCtrlTab() {
-@@ -94,16 +108,29 @@ class MozTabbox extends MozXULElement {
-     return val;
-   }
- 
-   get selectedPanel() {
-     var tabpanels = this.tabpanels;
-     return tabpanels && tabpanels.selectedPanel;
-   }
- 
-+  set eventNode(val) {
-+    if (val != this._eventNode) {
-+      Services.els.addSystemEventListener(val, "keydown", this, false);
-+      Services.els.removeSystemEventListener(this._eventNode, "keydown", this, false);
-+      this._eventNode = val;
-+    }
-+    return val;
-+  }
-+
-+  get eventNode() {
-+    return this._eventNode;
-+  }
-+
-   handleEvent(event) {
-     if (!event.isTrusted) {
-       // Don't let untrusted events mess with tabs.
-       return;
-     }
- 
-     // Don't check if the event was already consumed because tab
-     // navigation should always work for better user experience.

+ 0 - 35
frg/work-js/mozilla-release/patches/mozilla-central-push_434421.patch

@@ -1,35 +0,0 @@
-# HG changeset patch
-# User Brian Hackett <bhackett1024@gmail.com>
-# Date 1535666396 36000
-#      Thu Aug 30 11:59:56 2018 -1000
-# Node ID 354e37362d068f8f120d759c6ed61507f46c2918
-# Parent  45649765f2a9efbdde2931a9f2387484a65fb6fc
-Bug 1479909 Part 3 - Disable DOM Ion optimizations when recording or replaying, r=bz.
-
-diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
---- a/js/src/jit/IonBuilder.cpp
-+++ b/js/src/jit/IonBuilder.cpp
-@@ -5460,16 +5460,23 @@ IonBuilder::jsop_call(uint32_t argc, boo
- }
- 
- AbortReasonOr<bool>
- IonBuilder::testShouldDOMCall(TypeSet* inTypes, JSFunction* func, JSJitInfo::OpType opType)
- {
-     if (!func->isNative() || !func->hasJitInfo())
-         return false;
- 
-+    // Some DOM optimizations cause execution to skip over recorded events such
-+    // as wrapper cache accesses, e.g. through GVN or loop hoisting of the
-+    // expression which performs the event. Disable DOM optimizations when
-+    // recording or replaying to avoid this problem.
-+    if (mozilla::recordreplay::IsRecordingOrReplaying())
-+        return false;
-+
-     // If all the DOM objects flowing through are legal with this
-     // property, we can bake in a call to the bottom half of the DOM
-     // accessor
-     DOMInstanceClassHasProtoAtDepth instanceChecker =
-         realm->runtime()->DOMcallbacks()->instanceClassMatchesProto;
- 
-     const JSJitInfo* jinfo = func->jitInfo();
-     if (jinfo->type() != opType)

+ 0 - 67
frg/work-js/mozilla-release/patches/mozilla-central-push_434424.patch

@@ -1,67 +0,0 @@
-# HG changeset patch
-# User Brian Hackett <bhackett1024@gmail.com>
-# Date 1535728904 36000
-#      Fri Aug 31 05:21:44 2018 -1000
-# Node ID dcecbdfea1143b1ff7e2fdd8466fbc7c5ec393e2
-# Parent  354e37362d068f8f120d759c6ed61507f46c2918
-Bug 1486556 - Avoid unlocking the helper thread state lock after looking for tasks to perform, r=jandem.
-
-diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp
---- a/js/src/vm/HelperThreads.cpp
-+++ b/js/src/vm/HelperThreads.cpp
-@@ -2418,38 +2418,42 @@ HelperThread::threadLoop()
-             oomUnsafe.crash("HelperThread cx.init()");
-     }
-     cx.setHelperThread(this);
-     JS_SetNativeStackQuota(&cx, HELPER_STACK_QUOTA);
- 
-     while (!terminate) {
-         MOZ_ASSERT(idle());
- 
-+        if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-+            // Unlock the helper thread state lock before potentially
-+            // blocking while the main thread waits for all threads to
-+            // become idle. Otherwise we would need to see if we need to
-+            // block at every point where a helper thread acquires the
-+            // helper thread state lock.
-+            {
-+                AutoUnlockHelperThreadState unlock(lock);
-+                mozilla::recordreplay::MaybeWaitForCheckpointSave();
-+            }
-+            // Now that we are holding the helper thread state lock again,
-+            // notify the record/replay system that we might block soon.
-+            // The helper thread state lock may not be released until the
-+            // block occurs.
-+            mozilla::recordreplay::NotifyUnrecordedWait(WakeupAll);
-+        }
-+
-         // The selectors may depend on the HelperThreadState not changing
-         // between task selection and task execution, in particular, on new
-         // tasks not being added (because of the lifo structure of the work
-         // lists). Unlocking the HelperThreadState between task selection and
-         // execution is not well-defined.
- 
-         const TaskSpec* task = findHighestPriorityTask(lock);
-         if (!task) {
-             AUTO_PROFILER_LABEL("HelperThread::threadLoop::wait", IDLE);
--            if (mozilla::recordreplay::IsRecordingOrReplaying()) {
--                // Unlock the helper thread state lock before potentially
--                // blocking while the main thread waits for all threads to
--                // become idle. Otherwise we would need to see if we need to
--                // block at every point where a helper thread acquires the
--                // helper thread state lock.
--                {
--                    AutoUnlockHelperThreadState unlock(lock);
--                    mozilla::recordreplay::MaybeWaitForCheckpointSave();
--                }
--                mozilla::recordreplay::NotifyUnrecordedWait(WakeupAll);
--            }
--
-             HelperThreadState().wait(lock, GlobalHelperThreadState::PRODUCER);
-             continue;
-         }
- 
-         js::oom::SetThreadType(task->type);
-         (this->*(task->handleWorkload))(lock);
-         js::oom::SetThreadType(js::THREAD_TYPE_NONE);
-     }

+ 0 - 494
frg/work-js/mozilla-release/patches/mozilla-central-push_434600.patch

@@ -1,494 +0,0 @@
-# HG changeset patch
-# User Jan de Mooij <jdemooij@mozilla.com>
-# Date 1536080396 0
-#      Tue Sep 04 16:59:56 2018 +0000
-# Node ID 04eb549952d0f5eae672a84407e111cdf2a8423e
-# Parent  6029e0377ddac33b1528e59d760a0931851e7909
-Bug 1267297 - Use AutoEntryScript for script activity bookkeeping instead of the request machinery. r=bholley
-
-Differential Revision: https://phabricator.services.mozilla.com/D4085
-
-diff --git a/dom/script/ScriptSettings.cpp b/dom/script/ScriptSettings.cpp
---- a/dom/script/ScriptSettings.cpp
-+++ b/dom/script/ScriptSettings.cpp
-@@ -657,18 +657,21 @@ AutoEntryScript::AutoEntryScript(nsIGlob
-   , mCallerOverride(cx())
- #ifdef MOZ_GECKO_PROFILER
-   , mAutoProfilerLabel("AutoEntryScript", aReason, __LINE__,
-                        js::ProfilingStackFrame::Category::JS)
- #endif
- {
-   MOZ_ASSERT(aGlobalObject);
- 
--  if (aIsMainThread && gRunToCompletionListeners > 0) {
--    mDocShellEntryMonitor.emplace(cx(), aReason);
-+  if (aIsMainThread) {
-+    if (gRunToCompletionListeners > 0) {
-+      mDocShellEntryMonitor.emplace(cx(), aReason);
-+    }
-+    mScriptActivity.emplace(true);
-   }
- }
- 
- AutoEntryScript::AutoEntryScript(JSObject* aObject,
-                                  const char* aReason,
-                                  bool aIsMainThread)
-   : AutoEntryScript(xpc::NativeGlobal(aObject), aReason, aIsMainThread)
- {
-@@ -810,27 +813,30 @@ AutoSafeJSContext::AutoSafeJSContext(MOZ
-   DebugOnly<bool> ok = Init(xpc::UnprivilegedJunkScope());
-   MOZ_ASSERT(ok,
-              "This is quite odd.  We should have crashed in the "
-              "xpc::NativeGlobal() call if xpc::UnprivilegedJunkScope() "
-              "returned null, and inited correctly otherwise!");
- }
- 
- AutoSlowOperation::AutoSlowOperation(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
--  : AutoJSAPI()
-+  : mIsMainThread(NS_IsMainThread())
- {
-   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
--
--  Init();
-+  if (mIsMainThread) {
-+    mScriptActivity.emplace(true);
-+  }
- }
- 
- void
- AutoSlowOperation::CheckForInterrupt()
- {
-   // For now we support only main thread!
-   if (mIsMainThread) {
-     // JS_CheckForInterrupt expects us to be in a realm.
--    JSAutoRealm ar(cx(), xpc::UnprivilegedJunkScope());
--    JS_CheckForInterrupt(cx());
-+    AutoJSAPI jsapi;
-+    if (jsapi.Init(xpc::UnprivilegedJunkScope())) {
-+      JS_CheckForInterrupt(jsapi.cx());
-+    }
-   }
- }
- 
- } // namespace mozilla
-diff --git a/dom/script/ScriptSettings.h b/dom/script/ScriptSettings.h
---- a/dom/script/ScriptSettings.h
-+++ b/dom/script/ScriptSettings.h
-@@ -7,16 +7,17 @@
- /* Utilities for managing the script settings object stack defined in webapps */
- 
- #ifndef mozilla_dom_ScriptSettings_h
- #define mozilla_dom_ScriptSettings_h
- 
- #include "MainThreadUtils.h"
- #include "nsIGlobalObject.h"
- #include "nsIPrincipal.h"
-+#include "xpcpublic.h"
- 
- #include "mozilla/Maybe.h"
- 
- #include "jsapi.h"
- #include "js/Debug.h"
- 
- class nsPIDOMWindowInner;
- class nsGlobalWindowInner;
-@@ -378,16 +379,17 @@ private:
-   // the aIsJSImplementedWebIDL case.  And in that case, the subject principal
-   // is the principal of the callee function that is part of the CallArgs just a
-   // bit up the stack, and which will outlive us.  So we know the principal
-   // can't go away until then either.
-   nsIPrincipal* MOZ_NON_OWNING_REF mWebIDLCallerPrincipal;
-   friend nsIPrincipal* GetWebIDLCallerPrincipal();
- 
-   Maybe<DocshellEntryMonitor> mDocShellEntryMonitor;
-+  Maybe<xpc::AutoScriptActivity> mScriptActivity;
-   JS::AutoHideScriptedCaller mCallerOverride;
- #ifdef MOZ_GECKO_PROFILER
-   AutoProfilerLabel mAutoProfilerLabel;
- #endif
- };
- 
- /*
-  * A class that can be used to force a particular incumbent script on the stack.
-@@ -450,27 +452,31 @@ public:
- private:
-   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
- };
- 
- /**
-  * Use AutoSlowOperation when native side calls many JS callbacks in a row
-  * and slow script dialog should be activated if too much time is spent going
-  * through those callbacks.
-- * AutoSlowOperation puts a JSAutoRequest on the stack so that we don't continue
-- * to reset the watchdog and CheckForInterrupt can be then used to check whether
-- * JS execution should be interrupted.
-+ * AutoSlowOperation puts an AutoScriptActivity on the stack so that we don't
-+ * continue to reset the watchdog. CheckForInterrupt can then be used to check
-+ * whether JS execution should be interrupted.
-+ * This class (including CheckForInterrupt) is a no-op when used off the main
-+ * thread.
-  */
--class MOZ_RAII AutoSlowOperation : public dom::AutoJSAPI
-+class MOZ_RAII AutoSlowOperation
- {
- public:
-   explicit AutoSlowOperation(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
-   void CheckForInterrupt();
- private:
-   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
-+  bool mIsMainThread;
-+  Maybe<xpc::AutoScriptActivity> mScriptActivity;
- };
- 
- /**
-  * A class to disable interrupt callback temporary.
-  */
- class MOZ_RAII AutoDisableJSInterruptCallback
- {
- public:
-diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
---- a/js/xpconnect/src/XPCJSContext.cpp
-+++ b/js/xpconnect/src/XPCJSContext.cpp
-@@ -546,38 +546,59 @@ PRTime
- XPCJSContext::GetWatchdogTimestamp(WatchdogTimestampCategory aCategory)
- {
-     AutoLockWatchdog lock(mWatchdogManager->GetWatchdog());
-     return aCategory == TimestampContextStateChange ?
-         mWatchdogManager->GetContextTimestamp(this, lock) :
-         mWatchdogManager->GetTimestamp(aCategory, lock);
- }
- 
--void
--xpc::SimulateActivityCallback(bool aActive)
-+// static
-+bool
-+XPCJSContext::RecordScriptActivity(bool aActive)
- {
--    XPCJSContext::ActivityCallback(XPCJSContext::Get(), aActive);
--}
-+    MOZ_ASSERT(NS_IsMainThread());
- 
--// static
--void
--XPCJSContext::ActivityCallback(void* arg, bool active)
--{
-+    XPCJSContext* xpccx = XPCJSContext::Get();
-+    if (!xpccx) {
-+        // mozilla::SpinEventLoopUntil may use AutoScriptActivity(false) after
-+        // we destroyed the XPCJSContext.
-+        MOZ_ASSERT(!aActive);
-+        return false;
-+    }
-+
-+    bool oldValue = xpccx->SetHasScriptActivity(aActive);
-+    if (aActive == oldValue) {
-+        // Nothing to do.
-+        return oldValue;
-+    }
-+
-     // Since the slow script dialog never activates if we are recording or
-     // replaying, don't record/replay JS activity notifications.
-     if (recordreplay::IsRecordingOrReplaying()) {
--        return;
-+        return oldValue;
-     }
- 
--    if (!active) {
-+    if (!aActive) {
-         ProcessHangMonitor::ClearHang();
-     }
-+    xpccx->mWatchdogManager->RecordContextActivity(xpccx, aActive);
- 
--    XPCJSContext* self = static_cast<XPCJSContext*>(arg);
--    self->mWatchdogManager->RecordContextActivity(self, active);
-+    return oldValue;
-+}
-+
-+AutoScriptActivity::AutoScriptActivity(bool aActive)
-+  : mActive(aActive)
-+  , mOldValue(XPCJSContext::RecordScriptActivity(aActive))
-+{
-+}
-+
-+AutoScriptActivity::~AutoScriptActivity()
-+{
-+    MOZ_ALWAYS_TRUE(mActive == XPCJSContext::RecordScriptActivity(mOldValue));
- }
- 
- // static
- bool
- XPCJSContext::InterruptCallback(JSContext* cx)
- {
-     // The slow script dialog never activates if we are recording or replaying,
-     // since the precise timing of the dialog cannot be replayed.
-@@ -885,18 +906,16 @@ XPCJSContext::~XPCJSContext()
-     Preferences::UnregisterPrefixCallback(ReloadPrefsCallback,
-                                           JS_OPTIONS_DOT_STR,
-                                           this);
- 
- #ifdef FUZZING
-     Preferences::UnregisterCallback(ReloadPrefsCallback, "fuzzing.enabled", this);
- #endif
- 
--    js::SetActivityCallback(Context(), nullptr, nullptr);
--
-     // Clear any pending exception.  It might be an XPCWrappedJS, and if we try
-     // to destroy it later we will crash.
-     SetPendingException(nullptr);
- 
-     // If we're the last XPCJSContext around, clean up the watchdog manager.
-     if (--sInstanceCount == 0) {
-         if (mWatchdogManager->GetWatchdog()) {
-             mWatchdogManager->StopWatchdog();
-@@ -921,16 +940,17 @@ XPCJSContext::~XPCJSContext()
- XPCJSContext::XPCJSContext()
-  : mCallContext(nullptr),
-    mAutoRoots(nullptr),
-    mResolveName(JSID_VOID),
-    mResolvingWrapper(nullptr),
-    mWatchdogManager(GetWatchdogManager()),
-    mSlowScriptSecondHalf(false),
-    mTimeoutAccumulated(false),
-+   mHasScriptActivity(false),
-    mPendingResult(NS_OK),
-    mActive(CONTEXT_INACTIVE),
-    mLastStateChange(PR_Now())
- {
-     MOZ_COUNT_CTOR_INHERITED(XPCJSContext, CycleCollectedJSContext);
-     MOZ_RELEASE_ASSERT(!gTlsContext.get());
-     MOZ_ASSERT(mWatchdogManager);
-     ++sInstanceCount;
-@@ -1135,17 +1155,16 @@ XPCJSContext::Initialize(XPCJSContext* a
- 
-     JS_SetNativeStackQuota(cx,
-                            kStackQuota,
-                            kStackQuota - kSystemCodeBuffer,
-                            kStackQuota - kSystemCodeBuffer - kTrustedScriptBuffer);
- 
-     PROFILER_SET_JS_CONTEXT(cx);
- 
--    js::SetActivityCallback(cx, ActivityCallback, this);
-     JS_AddInterruptCallback(cx, InterruptCallback);
- 
-     if (!aPrimaryContext) {
-         Runtime()->Initialize(cx);
-     }
- 
-     // Watch for the JS boolean options.
-     ReloadPrefsCallback(nullptr, this);
-diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp
---- a/js/xpconnect/src/XPCShellImpl.cpp
-+++ b/js/xpconnect/src/XPCShellImpl.cpp
-@@ -585,25 +585,31 @@ SetInterruptCallback(JSContext* cx, unsi
-     }
- 
-     *sScriptedInterruptCallback = args[0];
- 
-     return true;
- }
- 
- static bool
--SimulateActivityCallback(JSContext* cx, unsigned argc, Value* vp)
-+SimulateNoScriptActivity(JSContext* cx, unsigned argc, Value* vp)
- {
-     // Sanity-check args.
-     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
--    if (args.length() != 1 || !args[0].isBoolean()) {
--        JS_ReportErrorASCII(cx, "Wrong number of arguments");
-+    if (args.length() != 1 || !args[0].isInt32() || args[0].toInt32() < 0) {
-+        JS_ReportErrorASCII(cx, "Expected a positive integer argument");
-         return false;
-     }
--    xpc::SimulateActivityCallback(args[0].toBoolean());
-+
-+    // This mimics mozilla::SpinEventLoopUntil but instead of spinning the
-+    // event loop we sleep, to make sure we don't run script.
-+    xpc::AutoScriptActivity asa(false);
-+    PR_Sleep(PR_SecondsToInterval(args[0].toInt32()));
-+
-+    args.rval().setUndefined();
-     return true;
- }
- 
- static bool
- RegisterAppManifest(JSContext* cx, unsigned argc, Value* vp)
- {
-     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-     if (args.length() != 1) {
-@@ -660,17 +666,17 @@ static const JSFunctionSpec glob_functio
- #ifdef JS_GC_ZEAL
-     JS_FN("gczeal",          GCZeal,         1,0),
- #endif
-     JS_FN("options",         Options,        0,0),
-     JS_FN("sendCommand",     SendCommand,    1,0),
-     JS_FN("atob",            xpc::Atob,      1,0),
-     JS_FN("btoa",            xpc::Btoa,      1,0),
-     JS_FN("setInterruptCallback", SetInterruptCallback, 1,0),
--    JS_FN("simulateActivityCallback", SimulateActivityCallback, 1,0),
-+    JS_FN("simulateNoScriptActivity", SimulateNoScriptActivity, 1,0),
-     JS_FN("registerAppManifest", RegisterAppManifest, 1, 0),
- #ifdef ENABLE_TESTS
-     JS_FN("registerXPCTestComponents", RegisterXPCTestComponents, 0, 0),
- #endif
-     JS_FS_END
- };
- 
- /***************************************************************************/
-diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
---- a/js/xpconnect/src/xpcprivate.h
-+++ b/js/xpconnect/src/xpcprivate.h
-@@ -368,17 +368,24 @@ public:
- 
-     AutoMarkingPtr** GetAutoRootsAdr() {return &mAutoRoots;}
- 
-     nsresult GetPendingResult() { return mPendingResult; }
-     void SetPendingResult(nsresult rv) { mPendingResult = rv; }
- 
-     PRTime GetWatchdogTimestamp(WatchdogTimestampCategory aCategory);
- 
--    static void ActivityCallback(void* arg, bool active);
-+    static bool RecordScriptActivity(bool aActive);
-+
-+    bool SetHasScriptActivity(bool aActive) {
-+        bool oldValue = mHasScriptActivity;
-+        mHasScriptActivity = aActive;
-+        return oldValue;
-+    }
-+
-     static bool InterruptCallback(JSContext* cx);
- 
-     // Mapping of often used strings to jsid atoms that live 'forever'.
-     //
-     // To add a new string: add to this list and to XPCJSRuntime::mStrings
-     // at the top of XPCJSRuntime.cpp
-     enum {
-         IDX_CONSTRUCTOR             = 0 ,
-@@ -456,16 +463,18 @@ private:
-     // 2. mSlowScriptSecondHalf was set to true
-     // (whichever comes later). We use it to determine whether the interrupt
-     // callback needs to do anything.
-     mozilla::TimeStamp mSlowScriptCheckpoint;
-     // Accumulates total time we actually waited for telemetry
-     mozilla::TimeDuration mSlowScriptActualWait;
-     bool mTimeoutAccumulated;
- 
-+    bool mHasScriptActivity;
-+
-     // mPendingResult is used to implement Components.returnCode.  Only really
-     // meaningful while calling through XPCWrappedJS.
-     nsresult mPendingResult;
- 
-     // These members must be accessed via WatchdogManager.
-     enum { CONTEXT_ACTIVE, CONTEXT_INACTIVE } mActive;
-     PRTime mLastStateChange;
- 
-diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h
---- a/js/xpconnect/src/xpcpublic.h
-+++ b/js/xpconnect/src/xpcpublic.h
-@@ -545,18 +545,24 @@ WindowGlobalOrNull(JSObject* aObj);
- 
- /**
-  * If |cx| is in a realm whose global is a window, returns the associated
-  * nsGlobalWindow. Otherwise, returns null.
-  */
- nsGlobalWindowInner*
- CurrentWindowOrNull(JSContext* cx);
- 
--void
--SimulateActivityCallback(bool aActive);
-+class MOZ_RAII AutoScriptActivity
-+{
-+    bool mActive;
-+    bool mOldValue;
-+  public:
-+    explicit AutoScriptActivity(bool aActive);
-+    ~AutoScriptActivity();
-+};
- 
- // This function may be used off-main-thread, in which case it is benignly
- // racey.
- bool
- ShouldDiscardSystemSource();
- 
- bool
- SharedMemoryEnabled();
-diff --git a/js/xpconnect/tests/unit/test_watchdog_hibernate.js b/js/xpconnect/tests/unit/test_watchdog_hibernate.js
---- a/js/xpconnect/tests/unit/test_watchdog_hibernate.js
-+++ b/js/xpconnect/tests/unit/test_watchdog_hibernate.js
-@@ -18,23 +18,21 @@ async function testBody() {
-   Assert.ok(startHibernation < now, "startHibernation ok");
-   Assert.ok(stopHibernation < now, "stopHibernation ok");
- 
-   // When the watchdog runs, it hibernates if there's been no activity for the
-   // last 2 seconds, otherwise it sleeps for 1 second. As such, given perfect
-   // scheduling, we should never have more than 3 seconds of inactivity without
-   // hibernating. To add some padding for automation, we mandate that hibernation
-   // must begin between 2 and 5 seconds from now.
--  await new Promise(resolve => {
--    var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
--    timer.initWithCallback(resolve, 10000, Ci.nsITimer.TYPE_ONE_SHOT);
--    simulateActivityCallback(false);
--  });
- 
--  simulateActivityCallback(true);
-+  // Sleep for 10 seconds. Note: we don't use nsITimer here because then we may run
-+  // arbitrary (idle) events involving script before it fires.
-+  simulateNoScriptActivity(10);
-+
-   busyWait(1000); // Give the watchdog time to wake up on the condvar.
-   var stateChange = Cu.getWatchdogTimestamp("ContextStateChange");
-   startHibernation = Cu.getWatchdogTimestamp("WatchdogHibernateStart");
-   stopHibernation = Cu.getWatchdogTimestamp("WatchdogHibernateStop");
-   do_log_info("Post-hibernation statistics:");
-   do_log_info("stateChange: " + stateChange / 1000000);
-   do_log_info("startHibernation: " + startHibernation / 1000000);
-   do_log_info("stopHibernation: " + stopHibernation / 1000000);
-diff --git a/xpcom/threads/nsThreadUtils.h b/xpcom/threads/nsThreadUtils.h
---- a/xpcom/threads/nsThreadUtils.h
-+++ b/xpcom/threads/nsThreadUtils.h
-@@ -16,18 +16,20 @@
- #include "nsINamed.h"
- #include "nsIRunnable.h"
- #include "nsIThreadManager.h"
- #include "nsITimer.h"
- #include "nsIThread.h"
- #include "nsString.h"
- #include "nsCOMPtr.h"
- #include "nsAutoPtr.h"
-+#include "xpcpublic.h"
- #include "mozilla/Atomics.h"
- #include "mozilla/Likely.h"
-+#include "mozilla/Maybe.h"
- #include "mozilla/Move.h"
- #include "mozilla/TimeStamp.h"
- #include "mozilla/Tuple.h"
- #include "mozilla/TypeTraits.h"
- 
- #include <utility>
- 
- //-----------------------------------------------------------------------------
-@@ -315,16 +317,24 @@ enum class ProcessFailureBehavior {
- 
- template<ProcessFailureBehavior Behavior = ProcessFailureBehavior::ReportToCaller,
-          typename Pred>
- bool
- SpinEventLoopUntil(Pred&& aPredicate, nsIThread* aThread = nullptr)
- {
-   nsIThread* thread = aThread ? aThread : NS_GetCurrentThread();
- 
-+  // From a latency perspective, spinning the event loop is like leaving script
-+  // and returning to the event loop. Tell the watchdog we stopped running
-+  // script (until we return).
-+  mozilla::Maybe<xpc::AutoScriptActivity> asa;
-+  if (NS_IsMainThread()) {
-+    asa.emplace(false);
-+  }
-+
-   while (!aPredicate()) {
-     bool didSomething = NS_ProcessNextEvent(thread, true);
- 
-     if (Behavior == ProcessFailureBehavior::IgnoreAndContinue) {
-       // Don't care what happened, continue on.
-       continue;
-     } else if (!didSomething) {
-       return false;

+ 0 - 2030
frg/work-js/mozilla-release/patches/mozilla-central-push_438583.patch

@@ -1,2030 +0,0 @@
-# HG changeset patch
-# User Ted Campbell <tcampbell@mozilla.com>
-# Date 1534993363 14400
-#      Wed Aug 22 23:02:43 2018 -0400
-# Node ID 78d60776b5be58408a15de4346b302d1df1f8c14
-# Parent  dc4ca2dbed1fbabaa968cc1b802ba31406e45941
-Bug 1485347 - Part 3: Use mozilla::Span for JSScript::data arrays. r=jandem
-
-Replace various custom data-types in JSScript interfaces with
-mozilla::Span. This abstracts implementation details and supports
-range-based for-loops. Underlying storage is unchanged, but this sets us
-up to be able to more easily change it.
-
-MozReview-Commit-ID: FDfIYsAxTA8
-
-diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
---- a/js/src/frontend/BytecodeEmitter.cpp
-+++ b/js/src/frontend/BytecodeEmitter.cpp
-@@ -10,16 +10,17 @@
- 
- #include "frontend/BytecodeEmitter.h"
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/DebugOnly.h"
- #include "mozilla/FloatingPoint.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/PodOperations.h"
-+#include "mozilla/ReverseIterator.h"
- 
- #include <string.h>
- 
- #include "jsnum.h"
- #include "jstypes.h"
- #include "jsutil.h"
- 
- #include "ds/Nestable.h"
-@@ -9625,22 +9626,22 @@ BytecodeEmitter::copySrcNotes(jssrcnote*
-     unsigned mainCount = main.notes.length();
-     // nsrcnotes includes SN_MAKE_TERMINATOR in addition to main.notes.
-     MOZ_ASSERT(mainCount == nsrcnotes - 1);
-     PodCopy(destination, main.notes.begin(), mainCount);
-     SN_MAKE_TERMINATOR(&destination[mainCount]);
- }
- 
- void
--CGNumberList::finish(ConstArray* array)
--{
--    MOZ_ASSERT(length() == array->length);
-+CGNumberList::finish(mozilla::Span<GCPtrValue> array)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
--        array->vector[i] = DoubleValue(list[i]);
-+        array[i].init(DoubleValue(list[i]));
-     }
- }
- 
- /*
-  * Find the index of the given object for code generator.
-  *
-  * Since the emitter refers to each parsed object only once, for the index we
-  * use the number of already indexed objects. We also add the object to a list
-@@ -9652,42 +9653,41 @@ CGObjectList::add(ObjectBox* objbox)
- {
-     MOZ_ASSERT(!objbox->emitLink);
-     objbox->emitLink = lastbox;
-     lastbox = objbox;
-     return length++;
- }
- 
- void
--CGObjectList::finish(ObjectArray* array)
-+CGObjectList::finish(mozilla::Span<GCPtrObject> array)
- {
-     MOZ_ASSERT(length <= INDEX_LIMIT);
--    MOZ_ASSERT(length == array->length);
--
--    js::GCPtrObject* cursor = array->vector + array->length;
-+    MOZ_ASSERT(length == array.size());
-+
-     ObjectBox* objbox = lastbox;
--    do {
--        --cursor;
--        MOZ_ASSERT(!*cursor);
-+    for (GCPtrObject& obj : mozilla::Reversed(array)) {
-+        MOZ_ASSERT(obj == nullptr);
-         MOZ_ASSERT(objbox->object->isTenured());
-         if (objbox->isFunctionBox()) {
-             objbox->asFunctionBox()->finish();
-         }
--        *cursor = objbox->object;
--    } while ((objbox = objbox->emitLink) != nullptr);
--    MOZ_ASSERT(cursor == array->vector);
-+        obj.init(objbox->object);
-+        objbox = objbox->emitLink;
-+    }
- }
- 
- void
--CGScopeList::finish(ScopeArray* array)
-+CGScopeList::finish(mozilla::Span<GCPtrScope> array)
- {
-     MOZ_ASSERT(length() <= INDEX_LIMIT);
--    MOZ_ASSERT(length() == array->length);
-+    MOZ_ASSERT(length() == array.size());
-+
-     for (uint32_t i = 0; i < length(); i++) {
--        array->vector[i].init(vector[i]);
-+        array[i].init(vector[i]);
-     }
- }
- 
- bool
- CGTryNoteList::append(JSTryNoteKind kind, uint32_t stackDepth, size_t start, size_t end)
- {
-     MOZ_ASSERT(start <= end);
-     MOZ_ASSERT(size_t(uint32_t(start)) == start);
-@@ -9698,22 +9698,22 @@ CGTryNoteList::append(JSTryNoteKind kind
-     note.stackDepth = stackDepth;
-     note.start = uint32_t(start);
-     note.length = uint32_t(end - start);
- 
-     return list.append(note);
- }
- 
- void
--CGTryNoteList::finish(TryNoteArray* array)
--{
--    MOZ_ASSERT(length() == array->length);
-+CGTryNoteList::finish(mozilla::Span<JSTryNote> array)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
--        array->vector[i] = list[i];
-+        array[i] = list[i];
-     }
- }
- 
- bool
- CGScopeNoteList::append(uint32_t scopeIndex, uint32_t offset, bool inPrologue,
-                         uint32_t parent)
- {
-     CGScopeNote note;
-@@ -9732,37 +9732,37 @@ CGScopeNoteList::recordEnd(uint32_t inde
- {
-     MOZ_ASSERT(index < length());
-     MOZ_ASSERT(list[index].length == 0);
-     list[index].end = offset;
-     list[index].endInPrologue = inPrologue;
- }
- 
- void
--CGScopeNoteList::finish(ScopeNoteArray* array, uint32_t prologueLength)
--{
--    MOZ_ASSERT(length() == array->length);
-+CGScopeNoteList::finish(mozilla::Span<ScopeNote> array, uint32_t prologueLength)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
-         if (!list[i].startInPrologue) {
-             list[i].start += prologueLength;
-         }
-         if (!list[i].endInPrologue && list[i].end != UINT32_MAX) {
-             list[i].end += prologueLength;
-         }
-         MOZ_ASSERT(list[i].end >= list[i].start);
-         list[i].length = list[i].end - list[i].start;
--        array->vector[i] = list[i];
-+        array[i] = list[i];
-     }
- }
- 
- void
--CGYieldAndAwaitOffsetList::finish(YieldAndAwaitOffsetArray& array, uint32_t prologueLength)
--{
--    MOZ_ASSERT(length() == array.length());
-+CGYieldAndAwaitOffsetList::finish(mozilla::Span<uint32_t> array, uint32_t prologueLength)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
-         array[i] = prologueLength + list[i];
-     }
- }
- 
- const JSSrcNoteSpec js_SrcNoteSpec[] = {
- #define DEFINE_SRC_NOTE_SPEC(sym, name, arity) { name, arity },
-diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h
---- a/js/src/frontend/BytecodeEmitter.h
-+++ b/js/src/frontend/BytecodeEmitter.h
-@@ -5,16 +5,17 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- /* JS bytecode generation. */
- 
- #ifndef frontend_BytecodeEmitter_h
- #define frontend_BytecodeEmitter_h
- 
- #include "mozilla/Attributes.h"
-+#include "mozilla/Span.h"
- 
- #include "ds/InlineTable.h"
- #include "frontend/BCEParserHandle.h"
- #include "frontend/EitherParser.h"
- #include "frontend/JumpList.h"
- #include "frontend/NameFunctions.h"
- #include "frontend/SharedContext.h"
- #include "frontend/SourceNotes.h"
-@@ -29,48 +30,48 @@ class CGNumberList {
-     Vector<double> list;
- 
-   public:
-     explicit CGNumberList(JSContext* cx) : list(cx) {}
-     MOZ_MUST_USE bool append(double v) {
-         return list.append(v);
-     }
-     size_t length() const { return list.length(); }
--    void finish(ConstArray* array);
-+    void finish(mozilla::Span<GCPtrValue> array);
- };
- 
- struct CGObjectList {
-     uint32_t            length;     /* number of emitted so far objects */
-     ObjectBox*          lastbox;   /* last emitted object */
- 
-     CGObjectList() : length(0), lastbox(nullptr) {}
- 
-     unsigned add(ObjectBox* objbox);
--    void finish(ObjectArray* array);
-+    void finish(mozilla::Span<GCPtrObject> array);
- };
- 
- struct MOZ_STACK_CLASS CGScopeList {
-     Rooted<GCVector<Scope*>> vector;
- 
-     explicit CGScopeList(JSContext* cx)
-       : vector(cx, GCVector<Scope*>(cx))
-     { }
- 
-     bool append(Scope* scope) { return vector.append(scope); }
-     uint32_t length() const { return vector.length(); }
--    void finish(ScopeArray* array);
-+    void finish(mozilla::Span<GCPtrScope> array);
- };
- 
- struct CGTryNoteList {
-     Vector<JSTryNote> list;
-     explicit CGTryNoteList(JSContext* cx) : list(cx) {}
- 
-     MOZ_MUST_USE bool append(JSTryNoteKind kind, uint32_t stackDepth, size_t start, size_t end);
-     size_t length() const { return list.length(); }
--    void finish(TryNoteArray* array);
-+    void finish(mozilla::Span<JSTryNote> array);
- };
- 
- struct CGScopeNote : public ScopeNote
- {
-     // The end offset. Used to compute the length; may need adjusting first if
-     // in the prologue.
-     uint32_t end;
- 
-@@ -84,28 +85,28 @@ struct CGScopeNote : public ScopeNote
- struct CGScopeNoteList {
-     Vector<CGScopeNote> list;
-     explicit CGScopeNoteList(JSContext* cx) : list(cx) {}
- 
-     MOZ_MUST_USE bool append(uint32_t scopeIndex, uint32_t offset, bool inPrologue,
-                              uint32_t parent);
-     void recordEnd(uint32_t index, uint32_t offset, bool inPrologue);
-     size_t length() const { return list.length(); }
--    void finish(ScopeNoteArray* array, uint32_t prologueLength);
-+    void finish(mozilla::Span<ScopeNote> array, uint32_t prologueLength);
- };
- 
- struct CGYieldAndAwaitOffsetList {
-     Vector<uint32_t> list;
-     uint32_t numYields;
-     uint32_t numAwaits;
-     explicit CGYieldAndAwaitOffsetList(JSContext* cx) : list(cx), numYields(0), numAwaits(0) {}
- 
-     MOZ_MUST_USE bool append(uint32_t offset) { return list.append(offset); }
-     size_t length() const { return list.length(); }
--    void finish(YieldAndAwaitOffsetArray& array, uint32_t prologueLength);
-+    void finish(mozilla::Span<uint32_t> array, uint32_t prologueLength);
- };
- 
- // Have a few inline elements, so as to avoid heap allocation for tiny
- // sequences.  See bug 1390526.
- typedef Vector<jsbytecode, 64> BytecodeVector;
- typedef Vector<jssrcnote, 64> SrcNotesVector;
- 
- // Used to control whether JSOP_CALL_IGNORES_RV is emitted for function calls.
-diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
---- a/js/src/jit/BaselineBailouts.cpp
-+++ b/js/src/jit/BaselineBailouts.cpp
-@@ -484,49 +484,48 @@ GetNextNonLoopEntryPc(jsbytecode* pc, js
- 
- static bool
- HasLiveStackValueAtDepth(JSScript* script, jsbytecode* pc, uint32_t stackDepth)
- {
-     if (!script->hasTrynotes()) {
-         return false;
-     }
- 
--    JSTryNote* tn = script->trynotes()->vector;
--    JSTryNote* tnEnd = tn + script->trynotes()->length;
-     uint32_t pcOffset = uint32_t(pc - script->main());
--    for (; tn != tnEnd; ++tn) {
--        if (pcOffset < tn->start) {
-+
-+    for (const JSTryNote& tn : script->trynotes()) {
-+        if (pcOffset < tn.start) {
-             continue;
-         }
--        if (pcOffset >= tn->start + tn->length) {
-+        if (pcOffset >= tn.start + tn.length) {
-             continue;
-         }
- 
--        switch (tn->kind) {
-+        switch (tn.kind) {
-           case JSTRY_FOR_IN:
-             // For-in loops have only the iterator on stack.
--            if (stackDepth == tn->stackDepth) {
-+            if (stackDepth == tn.stackDepth) {
-                 return true;
-             }
-             break;
- 
-           case JSTRY_FOR_OF:
-             // For-of loops have the iterator, its next method and the
-             // result.value on stack.
-             // The iterator is below the result.value, the next method below
-             // the iterator.
--            if (stackDepth == tn->stackDepth - 1 || stackDepth == tn->stackDepth - 2) {
-+            if (stackDepth == tn.stackDepth - 1 || stackDepth == tn.stackDepth - 2) {
-                 return true;
-             }
-             break;
- 
-           case JSTRY_DESTRUCTURING_ITERCLOSE:
-             // Destructuring code that need to call IteratorClose have both
-             // the iterator and the "done" value on the stack.
--            if (stackDepth == tn->stackDepth || stackDepth == tn->stackDepth - 1) {
-+            if (stackDepth == tn.stackDepth || stackDepth == tn.stackDepth - 1) {
-                 return true;
-             }
-             break;
- 
-           default:
-             break;
-         }
-     }
-diff --git a/js/src/jit/BytecodeAnalysis.cpp b/js/src/jit/BytecodeAnalysis.cpp
---- a/js/src/jit/BytecodeAnalysis.cpp
-+++ b/js/src/jit/BytecodeAnalysis.cpp
-@@ -112,24 +112,22 @@ BytecodeAnalysis::init(TempAllocator& al
-                     infos_[targetOffset].jumpTarget = true;
-                 }
-                 pc2 += JUMP_OFFSET_LEN;
-             }
-             break;
-           }
- 
-           case JSOP_TRY: {
--            JSTryNote* tn = script_->trynotes()->vector;
--            JSTryNote* tnlimit = tn + script_->trynotes()->length;
--            for (; tn < tnlimit; tn++) {
--                unsigned startOffset = script_->mainOffset() + tn->start;
-+            for (const JSTryNote& tn : script_->trynotes()) {
-+                unsigned startOffset = script_->mainOffset() + tn.start;
-                 if (startOffset == offset + 1) {
--                    unsigned catchOffset = startOffset + tn->length;
-+                    unsigned catchOffset = startOffset + tn.length;
- 
--                    if (tn->kind != JSTRY_FOR_IN) {
-+                    if (tn.kind != JSTRY_FOR_IN) {
-                         infos_[catchOffset].init(stackDepth);
-                         infos_[catchOffset].jumpTarget = true;
-                     }
-                 }
-             }
- 
-             // Get the pc of the last instruction in the try block. It's a JSOP_GOTO to
-             // jump over the catch/finally blocks.
-diff --git a/js/src/jit/IonControlFlow.cpp b/js/src/jit/IonControlFlow.cpp
---- a/js/src/jit/IonControlFlow.cpp
-+++ b/js/src/jit/IonControlFlow.cpp
-@@ -559,20 +559,18 @@ ControlFlowGenerator::processLabelEnd(CF
- 
- ControlFlowGenerator::ControlStatus
- ControlFlowGenerator::processTry()
- {
-     MOZ_ASSERT(JSOp(*pc) == JSOP_TRY);
- 
-     // Try-finally is not yet supported.
-     if (!checkedTryFinally_) {
--        JSTryNote* tn = script->trynotes()->vector;
--        JSTryNote* tnlimit = tn + script->trynotes()->length;
--        for (; tn < tnlimit; tn++) {
--            if (tn->kind == JSTRY_FINALLY) {
-+        for (const JSTryNote& tn : script->trynotes()) {
-+            if (tn.kind == JSTRY_FINALLY) {
-                 return ControlStatus::Abort;
-             }
-         }
-         checkedTryFinally_ = true;
-     }
- 
-     jssrcnote* sn = GetSrcNote(gsn, script, pc);
-     MOZ_ASSERT(SN_TYPE(sn) == SRC_TRY);
-diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
---- a/js/src/jit/JitFrames.cpp
-+++ b/js/src/jit/JitFrames.cpp
-@@ -100,17 +100,17 @@ ReadFrameBooleanSlot(JitFrameLayout* fp,
- static uint32_t
- NumArgAndLocalSlots(const InlineFrameIterator& frame)
- {
-     JSScript* script = frame.script();
-     return CountArgSlots(script, frame.maybeCalleeTemplate()) + script->nfixed();
- }
- 
- static void
--CloseLiveIteratorIon(JSContext* cx, const InlineFrameIterator& frame, JSTryNote* tn)
-+CloseLiveIteratorIon(JSContext* cx, const InlineFrameIterator& frame, const JSTryNote* tn)
- {
-     MOZ_ASSERT(tn->kind == JSTRY_FOR_IN ||
-                tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE);
- 
-     bool isDestructuring = tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE;
-     MOZ_ASSERT_IF(!isDestructuring, tn->stackDepth > 0);
-     MOZ_ASSERT_IF(isDestructuring, tn->stackDepth > 1);
- 
-@@ -218,17 +218,17 @@ HandleExceptionIon(JSContext* cx, const 
-     RootedScript script(cx, frame.script());
-     if (!script->hasTrynotes()) {
-         return;
-     }
- 
-     bool inForOfIterClose = false;
- 
-     for (TryNoteIterIon tni(cx, frame); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
- 
-         switch (tn->kind) {
-           case JSTRY_FOR_IN:
-           case JSTRY_DESTRUCTURING_ITERCLOSE:
-             // See corresponding comment in ProcessTryNotes.
-             if (inForOfIterClose) {
-                 break;
-             }
-@@ -300,27 +300,27 @@ OnLeaveBaselineFrame(JSContext* cx, cons
- static inline void
- ForcedReturn(JSContext* cx, const JSJitFrameIter& frame, jsbytecode* pc,
-              ResumeFromException* rfe)
- {
-     OnLeaveBaselineFrame(cx, frame, pc, rfe, true);
- }
- 
- static inline void
--BaselineFrameAndStackPointersFromTryNote(JSTryNote* tn, const JSJitFrameIter& frame,
-+BaselineFrameAndStackPointersFromTryNote(const JSTryNote* tn, const JSJitFrameIter& frame,
-                                          uint8_t** framePointer, uint8_t** stackPointer)
- {
-     JSScript* script = frame.baselineFrame()->script();
-     *framePointer = frame.fp() - BaselineFrame::FramePointerOffset;
-     *stackPointer = *framePointer - BaselineFrame::Size() -
-                     (script->nfixed() + tn->stackDepth) * sizeof(Value);
- }
- 
- static void
--SettleOnTryNote(JSContext* cx, JSTryNote* tn, const JSJitFrameIter& frame,
-+SettleOnTryNote(JSContext* cx, const JSTryNote* tn, const JSJitFrameIter& frame,
-                 EnvironmentIter& ei, ResumeFromException* rfe, jsbytecode** pc)
- {
-     RootedScript script(cx, frame.baselineFrame()->script());
- 
-     // Unwind environment chain (pop block objects).
-     if (cx->isExceptionPending()) {
-         UnwindEnvironment(cx, ei, UnwindEnvironmentToTryPc(script, tn));
-     }
-@@ -371,17 +371,17 @@ class TryNoteIterBaseline : public TryNo
- // Close all live iterators on a BaselineFrame due to exception unwinding. The
- // pc parameter is updated to where the envs have been unwound to.
- static void
- CloseLiveIteratorsBaselineForUncatchableException(JSContext* cx, const JSJitFrameIter& frame,
-                                                   jsbytecode* pc)
- {
-     bool inForOfIterClose = false;
-     for (TryNoteIterBaseline tni(cx, frame.baselineFrame(), pc); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
-         switch (tn->kind) {
-           case JSTRY_FOR_IN: {
-             // See corresponding comment in ProcessTryNotes.
-             if (inForOfIterClose) {
-                 break;
-             }
- 
-             uint8_t* framePointer;
-@@ -410,17 +410,17 @@ CloseLiveIteratorsBaselineForUncatchable
- static bool
- ProcessTryNotesBaseline(JSContext* cx, const JSJitFrameIter& frame, EnvironmentIter& ei,
-                         ResumeFromException* rfe, jsbytecode** pc)
- {
-     RootedScript script(cx, frame.baselineFrame()->script());
-     bool inForOfIterClose = false;
- 
-     for (TryNoteIterBaseline tni(cx, frame.baselineFrame(), *pc); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
- 
-         MOZ_ASSERT(cx->isExceptionPending());
-         switch (tn->kind) {
-           case JSTRY_CATCH: {
-             // If we're closing a legacy generator, we have to skip catch
-             // blocks.
-             if (cx->isClosingGenerator()) {
-                 break;
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -3067,63 +3067,59 @@ TryNotes(JSContext* cx, HandleScript scr
-     if (!script->hasTrynotes()) {
-         return true;
-     }
- 
-     if (!sp->put("\nException table:\nkind               stack    start      end\n")) {
-         return false;
-     }
- 
--    JSTryNote* tn = script->trynotes()->vector;
--    JSTryNote* tnlimit = tn + script->trynotes()->length;
--    do {
--        uint32_t startOff = script->pcToOffset(script->main()) + tn->start;
-+    for (const JSTryNote& tn : script->trynotes()) {
-+        uint32_t startOff = script->pcToOffset(script->main()) + tn.start;
-         if (!sp->jsprintf(" %-16s %6u %8u %8u\n",
--                          TryNoteName(static_cast<JSTryNoteKind>(tn->kind)),
--                          tn->stackDepth, startOff, startOff + tn->length))
-+                          TryNoteName(static_cast<JSTryNoteKind>(tn.kind)),
-+                          tn.stackDepth, startOff, startOff + tn.length))
-         {
-             return false;
-         }
--    } while (++tn != tnlimit);
-+    }
-     return true;
- }
- 
- static MOZ_MUST_USE bool
- ScopeNotes(JSContext* cx, HandleScript script, Sprinter* sp)
- {
-     if (!script->hasScopeNotes()) {
-         return true;
-     }
- 
-     if (!sp->put("\nScope notes:\n   index   parent    start      end\n")) {
-         return false;
-     }
- 
--    ScopeNoteArray* notes = script->scopeNotes();
--    for (uint32_t i = 0; i < notes->length; i++) {
--        const ScopeNote* note = &notes->vector[i];
--        if (note->index == ScopeNote::NoScopeIndex) {
-+    for (const ScopeNote& note : script->scopeNotes()) {
-+        if (note.index == ScopeNote::NoScopeIndex) {
-             if (!sp->jsprintf("%8s ", "(none)")) {
-                 return false;
-             }
-         } else {
--            if (!sp->jsprintf("%8u ", note->index)) {
--                return false;
--            }
--        }
--        if (note->parent == ScopeNote::NoScopeIndex) {
-+            if (!sp->jsprintf("%8u ", note.index)) {
-+                return false;
-+            }
-+        }
-+        if (note.parent == ScopeNote::NoScopeIndex) {
-             if (!sp->jsprintf("%8s ", "(none)")) {
-                 return false;
-             }
-         } else {
--            if (!sp->jsprintf("%8u ", note->parent)) {
--                return false;
--            }
--        }
--        if (!sp->jsprintf("%8u %8u\n", note->start, note->start + note->length)) {
-+            if (!sp->jsprintf("%8u ", note.parent)) {
-+                return false;
-+            }
-+        }
-+        if (!sp->jsprintf("%8u %8u\n", note.start, note.start + note.length)) {
-             return false;
-         }
-     }
-     return true;
- }
- 
- static MOZ_MUST_USE bool
- DisassembleScript(JSContext* cx, HandleScript script, HandleFunction fun,
-@@ -3184,19 +3180,17 @@ DisassembleScript(JSContext* cx, HandleS
-     if (!TryNotes(cx, script, sp)) {
-         return false;
-     }
-     if (!ScopeNotes(cx, script, sp)) {
-         return false;
-     }
- 
-     if (recursive && script->hasObjects()) {
--        ObjectArray* objects = script->objects();
--        for (unsigned i = 0; i != objects->length; ++i) {
--            JSObject* obj = objects->vector[i];
-+        for (JSObject* obj : script->objects()) {
-             if (obj->is<JSFunction>()) {
-                 if (!sp->put("\n")) {
-                     return false;
-                 }
- 
-                 RootedFunction fun(cx, &obj->as<JSFunction>());
-                 if (fun->isInterpreted()) {
-                     RootedScript script(cx, JSFunction::getOrCreateScript(cx, fun));
-diff --git a/js/src/vm/BytecodeUtil.cpp b/js/src/vm/BytecodeUtil.cpp
---- a/js/src/vm/BytecodeUtil.cpp
-+++ b/js/src/vm/BytecodeUtil.cpp
-@@ -8,16 +8,17 @@
-  * JS bytecode descriptors, disassemblers, and (expression) decompilers.
-  */
- 
- #include "vm/BytecodeUtil-inl.h"
- 
- #define __STDC_FORMAT_MACROS
- 
- #include "mozilla/Attributes.h"
-+#include "mozilla/ReverseIterator.h"
- #include "mozilla/Sprintf.h"
- #include "mozilla/Vector.h"
- 
- #include <algorithm>
- #include <ctype.h>
- #include <inttypes.h>
- #include <stdio.h>
- #include <string.h>
-@@ -940,29 +941,27 @@ BytecodeParser::parse()
-             break;
-           }
- 
-           case JSOP_TRY: {
-             // Everything between a try and corresponding catch or finally is conditional.
-             // Note that there is no problem with code which is skipped by a thrown
-             // exception but is not caught by a later handler in the same function:
-             // no more code will execute, and it does not matter what is defined.
--            JSTryNote* tn = script_->trynotes()->vector;
--            JSTryNote* tnlimit = tn + script_->trynotes()->length;
--            for (; tn < tnlimit; tn++) {
--                uint32_t startOffset = script_->mainOffset() + tn->start;
-+            for (const JSTryNote& tn : script_->trynotes()) {
-+                uint32_t startOffset = script_->mainOffset() + tn.start;
-                 if (startOffset == offset + 1) {
--                    uint32_t catchOffset = startOffset + tn->length;
--                    if (tn->kind == JSTRY_CATCH) {
-+                    uint32_t catchOffset = startOffset + tn.length;
-+                    if (tn.kind == JSTRY_CATCH) {
-                         if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack,
-                                      pc, JumpKind::TryCatch))
-                         {
-                             return false;
-                         }
--                    } else if (tn->kind == JSTRY_FINALLY) {
-+                    } else if (tn.kind == JSTRY_FINALLY) {
-                         if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack,
-                                      pc, JumpKind::TryFinally))
-                         {
-                             return false;
-                         }
-                     }
-                 }
-             }
-@@ -1450,25 +1449,22 @@ Disassemble1(JSContext* cx, HandleScript
-     int i;
-     switch (JOF_TYPE(cs->format)) {
-       case JOF_BYTE:
-           // Scan the trynotes to find the associated catch block
-           // and make the try opcode look like a jump instruction
-           // with an offset. This simplifies code coverage analysis
-           // based on this disassembled output.
-           if (op == JSOP_TRY) {
--              TryNoteArray* trynotes = script->trynotes();
--              uint32_t i;
-               size_t mainOffset = script->mainOffset();
--              for(i = 0; i < trynotes->length; i++) {
--                  JSTryNote note = trynotes->vector[i];
--                  if (note.kind == JSTRY_CATCH && note.start + mainOffset == loc + 1) {
-+              for (const JSTryNote& tn : script->trynotes()) {
-+                  if (tn.kind == JSTRY_CATCH && tn.start + mainOffset == loc + 1) {
-                       if (!sp->jsprintf(" %u (%+d)",
--                                        unsigned(loc + note.length + 1),
--                                        int(note.length + 1)))
-+                                        unsigned(loc + tn.length + 1),
-+                                        int(tn.length + 1)))
-                       {
-                           return 0;
-                       }
-                       break;
-                   }
-               }
-           }
-         break;
-@@ -3115,20 +3111,18 @@ GenerateLcovInfo(JSContext* cx, JS::Real
- 
-             // Iterate from the last to the first object in order to have
-             // the functions them visited in the opposite order when popping
-             // elements from the stack of remaining scripts, such that the
-             // functions are more-less listed with increasing line numbers.
-             if (!script->hasObjects()) {
-                 continue;
-             }
--            size_t idx = script->objects()->length;
--            while (idx--) {
--                JSObject* obj = script->getObject(idx);
--
-+            auto objects = script->objects();
-+            for (JSObject* obj : mozilla::Reversed(objects)) {
-                 // Only continue on JSFunction objects.
-                 if (!obj->is<JSFunction>()) {
-                     continue;
-                 }
-                 fun = &obj->as<JSFunction>();
- 
-                 // Let's skip wasm for now.
-                 if (!fun->isInterpreted()) {
-diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
---- a/js/src/vm/Debugger.cpp
-+++ b/js/src/vm/Debugger.cpp
-@@ -6233,22 +6233,20 @@ DebuggerScript_getChildScripts(JSContext
-     if (!result) {
-         return false;
-     }
-     if (script->hasObjects()) {
-         // script->savedCallerFun indicates that this is a direct eval script
-         // and the calling function is stored as script->objects()->vector[0].
-         // It is not really a child script of this script, so skip it using
-         // innerObjectsStart().
--        ObjectArray* objects = script->objects();
-         RootedFunction fun(cx);
-         RootedScript funScript(cx);
--        RootedObject obj(cx), s(cx);
--        for (uint32_t i = 0; i < objects->length; i++) {
--            obj = objects->vector[i];
-+        RootedObject s(cx);
-+        for (const GCPtrObject& obj : script->objects()) {
-             if (obj->is<JSFunction>()) {
-                 fun = &obj->as<JSFunction>();
-                 // The inner function could be a wasm native.
-                 if (fun->isNative()) {
-                     continue;
-                 }
-                 funScript = GetOrCreateFunctionScript(cx, fun);
-                 if (!funScript) {
-@@ -6424,23 +6422,21 @@ class FlowGraphSummary {
-                     pc += step;
-                 }
-             } else if (op == JSOP_TRY) {
-                 // As there is no literal incoming edge into the catch block, we
-                 // make a fake one by copying the JSOP_TRY location, as-if this
-                 // was an incoming edge of the catch block. This is needed
-                 // because we only report offsets of entry points which have
-                 // valid incoming edges.
--                JSTryNote* tn = script->trynotes()->vector;
--                JSTryNote* tnlimit = tn + script->trynotes()->length;
--                for (; tn < tnlimit; tn++) {
--                    uint32_t startOffset = script->mainOffset() + tn->start;
-+                for (const JSTryNote& tn : script->trynotes()) {
-+                    uint32_t startOffset = script->mainOffset() + tn.start;
-                     if (startOffset == r.frontOffset() + 1) {
--                        uint32_t catchOffset = startOffset + tn->length;
--                        if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) {
-+                        uint32_t catchOffset = startOffset + tn.length;
-+                        if (tn.kind == JSTRY_CATCH || tn.kind == JSTRY_FINALLY) {
-                             addEdge(lineno, column, catchOffset);
-                         }
-                     }
-                 }
-             }
- 
-             prevLineno = lineno;
-             prevColumn = column;
-@@ -7450,27 +7446,24 @@ class DebuggerScriptIsInCatchScopeMatche
-             return false;
-         }
- 
-         // Try note ranges are relative to the mainOffset of the script, so adjust
-         // offset accordingly.
-         size_t offset = offset_ - script->mainOffset();
- 
-         if (script->hasTrynotes()) {
--            JSTryNote* tnBegin = script->trynotes()->vector;
--            JSTryNote* tnEnd = tnBegin + script->trynotes()->length;
--            while (tnBegin != tnEnd) {
--                if (tnBegin->start <= offset &&
--                    offset <= tnBegin->start + tnBegin->length &&
--                    tnBegin->kind == JSTRY_CATCH)
-+            for (const JSTryNote& tn : script->trynotes()) {
-+                if (tn.start <= offset &&
-+                    offset <= tn.start + tn.length &&
-+                    tn.kind == JSTRY_CATCH)
-                 {
-                     isInCatch_ = true;
-                     return true;
-                 }
--                ++tnBegin;
-             }
-         }
-         isInCatch_ = false;
-         return true;
-     }
-     ReturnType match(Handle<LazyScript*> lazyScript) {
-         RootedScript script(cx_, DelazifyScript(cx_, lazyScript));
-         if (!script) {
-diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp
---- a/js/src/vm/EnvironmentObject.cpp
-+++ b/js/src/vm/EnvironmentObject.cpp
-@@ -3907,21 +3907,19 @@ RemoveReferencedNames(JSContext* cx, Han
-         }
- 
-         if (name) {
-             remainingNames.remove(name);
-         }
-     }
- 
-     if (script->hasObjects()) {
--        ObjectArray* objects = script->objects();
-         RootedFunction fun(cx);
-         RootedScript innerScript(cx);
--        for (size_t i = 0; i < objects->length; i++) {
--            JSObject* obj = objects->vector[i];
-+        for (JSObject* obj : script->objects()) {
-             if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpreted()) {
-                 fun = &obj->as<JSFunction>();
-                 innerScript = JSFunction::getOrCreateScript(cx, fun);
-                 if (!innerScript) {
-                     return false;
-                 }
- 
-                 if (!RemoveReferencedNames(cx, innerScript, remainingNames)) {
-@@ -3979,21 +3977,19 @@ AnalyzeEntrainedVariablesInScript(JSCont
-             buf.printf(" ");
-             buf.putString(r.front());
-         }
- 
-         printf("%s\n", buf.string());
-     }
- 
-     if (innerScript->hasObjects()) {
--        ObjectArray* objects = innerScript->objects();
-         RootedFunction fun(cx);
-         RootedScript innerInnerScript(cx);
--        for (size_t i = 0; i < objects->length; i++) {
--            JSObject* obj = objects->vector[i];
-+        for (JSObject* obj : script->objects()) {
-             if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpreted()) {
-                 fun = &obj->as<JSFunction>();
-                 innerInnerScript = JSFunction::getOrCreateScript(cx, fun);
-                 if (!innerInnerScript ||
-                     !AnalyzeEntrainedVariablesInScript(cx, script, innerInnerScript))
-                 {
-                     return false;
-                 }
-@@ -4017,21 +4013,19 @@ AnalyzeEntrainedVariablesInScript(JSCont
- // |bar| unnecessarily entrains |b|, and |baz| unnecessarily entrains |a|.
- bool
- js::AnalyzeEntrainedVariables(JSContext* cx, HandleScript script)
- {
-     if (!script->hasObjects()) {
-         return true;
-     }
- 
--    ObjectArray* objects = script->objects();
-     RootedFunction fun(cx);
-     RootedScript innerScript(cx);
--    for (size_t i = 0; i < objects->length; i++) {
--        JSObject* obj = objects->vector[i];
-+    for (JSObject* obj : script->objects()) {
-         if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpreted()) {
-             fun = &obj->as<JSFunction>();
-             innerScript = JSFunction::getOrCreateScript(cx, fun);
-             if (!innerScript) {
-                 return false;
-             }
- 
-             if (script->functionDelazifying() && script->functionDelazifying()->needsCallObject()) {
-diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
---- a/js/src/vm/Interpreter.cpp
-+++ b/js/src/vm/Interpreter.cpp
-@@ -1298,17 +1298,17 @@ js::UnwindAllEnvironmentsInFrame(JSConte
- // block. We cannot unwind to *after* the JSOP_TRY, because that might be the
- // first opcode of an inner scope, with the same problem as above. e.g.,
- //
- // try { { let x; } }
- //
- // will have no pc location distinguishing the try block scope from the inner
- // let block scope.
- jsbytecode*
--js::UnwindEnvironmentToTryPc(JSScript* script, JSTryNote* tn)
-+js::UnwindEnvironmentToTryPc(JSScript* script, const JSTryNote* tn)
- {
-     jsbytecode* pc = script->main() + tn->start;
-     if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) {
-         pc -= JSOP_TRY_LENGTH;
-         MOZ_ASSERT(*pc == JSOP_TRY);
-     } else if (tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE) {
-         pc -= JSOP_TRY_DESTRUCTURING_ITERCLOSE_LENGTH;
-         MOZ_ASSERT(*pc == JSOP_TRY_DESTRUCTURING_ITERCLOSE);
-@@ -1322,17 +1322,17 @@ ForcedReturn(JSContext* cx, InterpreterR
-     bool ok = Debugger::onLeaveFrame(cx, regs.fp(), regs.pc, true);
-     // Point the frame to the end of the script, regardless of error. The
-     // caller must jump to the correct continuation depending on 'ok'.
-     regs.setToEndOfScript();
-     return ok;
- }
- 
- static void
--SettleOnTryNote(JSContext* cx, JSTryNote* tn, EnvironmentIter& ei, InterpreterRegs& regs)
-+SettleOnTryNote(JSContext* cx, const JSTryNote* tn, EnvironmentIter& ei, InterpreterRegs& regs)
- {
-     // Unwind the environment to the beginning of the JSOP_TRY.
-     UnwindEnvironment(cx, ei, UnwindEnvironmentToTryPc(regs.fp()->script(), tn));
- 
-     // Set pc to the first bytecode after the the try note to point
-     // to the beginning of catch or finally.
-     regs.pc = regs.fp()->script()->main() + tn->start + tn->length;
-     regs.sp = regs.spForStackDepth(tn->stackDepth);
-@@ -1358,17 +1358,17 @@ class TryNoteIterInterpreter : public Tr
- 
- static void
- UnwindIteratorsForUncatchableException(JSContext* cx, const InterpreterRegs& regs)
- {
-     // c.f. the regular (catchable) TryNoteIterInterpreter loop in
-     // ProcessTryNotes.
-     bool inForOfIterClose = false;
-     for (TryNoteIterInterpreter tni(cx, regs); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
-         switch (tn->kind) {
-           case JSTRY_FOR_IN: {
-             // See corresponding comment in ProcessTryNotes.
-             if (inForOfIterClose) {
-                 break;
-             }
- 
-             Value* sp = regs.spForStackDepth(tn->stackDepth);
-@@ -1398,17 +1398,17 @@ enum HandleErrorContinuation
-     FinallyContinuation
- };
- 
- static HandleErrorContinuation
- ProcessTryNotes(JSContext* cx, EnvironmentIter& ei, InterpreterRegs& regs)
- {
-     bool inForOfIterClose = false;
-     for (TryNoteIterInterpreter tni(cx, regs); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
- 
-         switch (tn->kind) {
-           case JSTRY_CATCH:
-             /* Catch cannot intercept the closing of a generator. */
-             if (cx->isClosingGenerator()) {
-                 break;
-             }
- 
-diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h
---- a/js/src/vm/Interpreter.h
-+++ b/js/src/vm/Interpreter.h
-@@ -340,27 +340,28 @@ UnwindEnvironment(JSContext* cx, Environ
- 
- // Unwind all environments.
- extern void
- UnwindAllEnvironmentsInFrame(JSContext* cx, EnvironmentIter& ei);
- 
- // Compute the pc needed to unwind the scope to the beginning of the block
- // pointed to by the try note.
- extern jsbytecode*
--UnwindEnvironmentToTryPc(JSScript* script, JSTryNote* tn);
-+UnwindEnvironmentToTryPc(JSScript* script, const JSTryNote* tn);
- 
- template <class StackDepthOp>
- class MOZ_STACK_CLASS TryNoteIter
- {
-     RootedScript script_;
-     uint32_t pcOffset_;
--    JSTryNote* tn_;
--    JSTryNote* tnEnd_;
-     StackDepthOp getStackDepth_;
- 
-+    const JSTryNote* tn_;
-+    const JSTryNote* tnEnd_;
-+
-     void settle() {
-         for (; tn_ != tnEnd_; ++tn_) {
-             /* If pc is out of range, try the next one. */
-             if (pcOffset_ - tn_->start >= tn_->length) {
-                 continue;
-             }
- 
-             /*
-@@ -391,31 +392,34 @@ class MOZ_STACK_CLASS TryNoteIter
-   public:
-     TryNoteIter(JSContext* cx, JSScript* script, jsbytecode* pc,
-                 StackDepthOp getStackDepth)
-       : script_(cx, script),
-         pcOffset_(pc - script->main()),
-         getStackDepth_(getStackDepth)
-     {
-         if (script->hasTrynotes()) {
--            tn_ = script->trynotes()->vector;
--            tnEnd_ = tn_ + script->trynotes()->length;
-+            // NOTE: The Span is a temporary so we can't use begin()/end()
-+            // here or the iterator will outlive the span.
-+            auto trynotes = script->trynotes();
-+            tn_ = trynotes.data();
-+            tnEnd_ = tn_ + trynotes.size();
-         } else {
-             tn_ = tnEnd_ = nullptr;
-         }
-         settle();
-     }
- 
-     void operator++() {
-         ++tn_;
-         settle();
-     }
- 
-     bool done() const { return tn_ == tnEnd_; }
--    JSTryNote* operator*() const { return tn_; }
-+    const JSTryNote* operator*() const { return tn_; }
- };
- 
- bool
- HandleClosingGeneratorReturn(JSContext* cx, AbstractFramePtr frame, bool ok);
- 
- /************************************************************************/
- 
- bool
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -299,21 +299,20 @@ XDRRelazificationInfo(XDRState<mode>* xd
-     // have any.
- 
-     return Ok();
- }
- 
- static inline uint32_t
- FindScopeIndex(JSScript* script, Scope& scope)
- {
--    ScopeArray* scopes = script->scopes();
--    GCPtrScope* vector = scopes->vector;
--    unsigned length = scopes->length;
-+    auto scopes = script->scopes();
-+    unsigned length = scopes.size();
-     for (uint32_t i = 0; i < length; ++i) {
--        if (vector[i] == &scope) {
-+        if (scopes[i] == &scope) {
-             return i;
-         }
-     }
- 
-     MOZ_CRASH("Scope not found");
- }
- 
- enum XDRClassKind {
-@@ -353,17 +352,17 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         HasNonSyntacticScope,
-         HasInnerFunctions,
-         NeedsHomeObject,
-         IsDerivedClassConstructor,
-         IsDefaultClassConstructor,
-     };
- 
-     uint32_t length, lineno, column, nfixed, nslots;
--    uint32_t natoms, nsrcnotes, i;
-+    uint32_t natoms, nsrcnotes;
-     uint32_t nconsts, nobjects, nscopes, nregexps, ntrynotes, nscopenotes, nyieldoffsets;
-     uint32_t prologueLength;
-     uint32_t funLength = 0;
-     uint32_t nTypeSets = 0;
-     uint32_t scriptBits = 0;
-     uint32_t bodyScopeIndex = 0;
- 
-     JSContext* cx = xdr->cx();
-@@ -403,30 +402,30 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         nslots = script->nslots();
- 
-         bodyScopeIndex = script->bodyScopeIndex();
-         natoms = script->natoms();
- 
-         nsrcnotes = script->numNotes();
- 
-         if (script->hasConsts()) {
--            nconsts = script->consts()->length;
-+            nconsts = script->consts().size();
-         }
-         if (script->hasObjects()) {
--            nobjects = script->objects()->length;
-+            nobjects = script->objects().size();
-         }
--        nscopes = script->scopes()->length;
-+        nscopes = script->scopes().size();
-         if (script->hasTrynotes()) {
--            ntrynotes = script->trynotes()->length;
-+            ntrynotes = script->trynotes().size();
-         }
-         if (script->hasScopeNotes()) {
--            nscopenotes = script->scopeNotes()->length;
-+            nscopenotes = script->scopeNotes().size();
-         }
-         if (script->hasYieldAndAwaitOffsets()) {
--            nyieldoffsets = script->yieldAndAwaitOffsets().length();
-+            nyieldoffsets = script->yieldAndAwaitOffsets().size();
-         }
- 
-         nTypeSets = script->nTypeSets();
-         funLength = script->funLength();
- 
-         if (script->noScriptRval()) {
-             scriptBits |= (1 << NoScriptRval);
-         }
-@@ -699,17 +698,17 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-             script->freeScriptData();
-         }
-     });
- 
-     jsbytecode* code = script->code();
-     MOZ_TRY(xdr->codeBytes(code, length));
-     MOZ_TRY(xdr->codeBytes(code + length, nsrcnotes));
- 
--    for (i = 0; i != natoms; ++i) {
-+    for (uint32_t i = 0; i != natoms; ++i) {
-         if (mode == XDR_DECODE) {
-             RootedAtom tmp(cx);
-             MOZ_TRY(XDRAtom(xdr, &tmp));
-             script->atoms()[i].init(tmp);
-         } else {
-             RootedAtom tmp(cx, script->atoms()[i]);
-             MOZ_TRY(XDRAtom(xdr, &tmp));
-         }
-@@ -718,37 +717,36 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-     scriptDataGuard.release();
-     if (mode == XDR_DECODE) {
-         if (!script->shareScriptData(cx)) {
-             return xdr->fail(JS::TranscodeResult_Throw);
-         }
-     }
- 
-     if (nconsts) {
--        GCPtrValue* vector = script->consts()->vector;
-         RootedValue val(cx);
--        for (i = 0; i != nconsts; ++i) {
-+        for (GCPtrValue& elem : script->consts()) {
-             if (mode == XDR_ENCODE) {
--                val = vector[i];
-+                val = elem.get();
-             }
-             MOZ_TRY(XDRScriptConst(xdr, &val));
-             if (mode == XDR_DECODE) {
--                vector[i].init(val);
-+                elem.init(val);
-             }
-         }
-     }
- 
-     {
-         MOZ_ASSERT(nscopes != 0);
--        GCPtrScope* vector = script->scopes()->vector;
-+        GCPtrScope* vector = script->scopes().data();
-         RootedScope scope(cx);
-         RootedScope enclosing(cx);
-         ScopeKind scopeKind;
-         uint32_t enclosingScopeIndex = 0;
--        for (i = 0; i != nscopes; ++i) {
-+        for (uint32_t i = 0; i != nscopes; ++i) {
-             if (mode == XDR_ENCODE) {
-                 scope = vector[i];
-                 scopeKind = scope->kind();
-             } else {
-                 scope = nullptr;
-             }
- 
-             MOZ_TRY(xdr->codeEnum32(&scopeKind));
-@@ -829,128 +827,133 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         MOZ_TRY(xdr->codeMarker(0x48922BAB));
-     }
- 
-     /*
-      * Here looping from 0-to-length to xdr objects is essential to ensure that
-      * all references to enclosing blocks (via FindScopeIndex below) happen
-      * after the enclosing block has been XDR'd.
-      */
--    for (i = 0; i != nobjects; ++i) {
--        GCPtrObject* objp = &script->objects()->vector[i];
--        XDRClassKind classk;
--
--        if (mode == XDR_ENCODE) {
--            JSObject* obj = *objp;
--            if (obj->is<RegExpObject>()) {
--                classk = CK_RegexpObject;
--            } else if (obj->is<JSFunction>()) {
--                classk = CK_JSFunction;
--            } else if (obj->is<PlainObject>() || obj->is<ArrayObject>()) {
--                classk = CK_JSObject;
--            } else {
--                MOZ_CRASH("Cannot encode this class of object.");
--            }
--        }
--
--        MOZ_TRY(xdr->codeEnum32(&classk));
--
--        switch (classk) {
--          case CK_RegexpObject: {
--            Rooted<RegExpObject*> regexp(cx);
--            if (mode == XDR_ENCODE) {
--                regexp = &(*objp)->as<RegExpObject>();
--            }
--            MOZ_TRY(XDRScriptRegExpObject(xdr, &regexp));
--            if (mode == XDR_DECODE) {
--                *objp = regexp;
--            }
--            break;
--          }
--
--          case CK_JSFunction: {
--            /* Code the nested function's enclosing scope. */
--            uint32_t funEnclosingScopeIndex = 0;
--            RootedScope funEnclosingScope(cx);
-+    if (nobjects) {
-+        for (GCPtrObject& elem : script->objects()) {
-+            XDRClassKind classk;
-+
-             if (mode == XDR_ENCODE) {
--                RootedFunction function(cx, &(*objp)->as<JSFunction>());
--
--                if (function->isInterpretedLazy()) {
--                    funEnclosingScope = function->lazyScript()->enclosingScope();
--                } else if (function->isInterpreted()) {
--                    funEnclosingScope = function->nonLazyScript()->enclosingScope();
-+                JSObject* obj = elem.get();
-+                if (obj->is<RegExpObject>()) {
-+                    classk = CK_RegexpObject;
-+                } else if (obj->is<JSFunction>()) {
-+                    classk = CK_JSFunction;
-+                } else if (obj->is<PlainObject>() || obj->is<ArrayObject>()) {
-+                    classk = CK_JSObject;
-                 } else {
--                    MOZ_ASSERT(function->isAsmJSNative());
--                    return xdr->fail(JS::TranscodeResult_Failure_AsmJSNotSupported);
-+                    MOZ_CRASH("Cannot encode this class of object.");
-                 }
--
--                funEnclosingScopeIndex = FindScopeIndex(script, *funEnclosingScope);
--            }
--
--            MOZ_TRY(xdr->codeUint32(&funEnclosingScopeIndex));
--
--            if (mode == XDR_DECODE) {
--                MOZ_ASSERT(funEnclosingScopeIndex < script->scopes()->length);
--                funEnclosingScope = script->scopes()->vector[funEnclosingScopeIndex];
-             }
- 
--            // Code nested function and script.
--            RootedFunction tmp(cx);
--            if (mode == XDR_ENCODE) {
--                tmp = &(*objp)->as<JSFunction>();
-+            MOZ_TRY(xdr->codeEnum32(&classk));
-+
-+            switch (classk) {
-+              case CK_RegexpObject: {
-+                Rooted<RegExpObject*> regexp(cx);
-+                if (mode == XDR_ENCODE) {
-+                    regexp = &elem->as<RegExpObject>();
-+                }
-+                MOZ_TRY(XDRScriptRegExpObject(xdr, &regexp));
-+                if (mode == XDR_DECODE) {
-+                    elem.init(regexp);
-+                }
-+                break;
-+              }
-+
-+              case CK_JSFunction: {
-+                /* Code the nested function's enclosing scope. */
-+                uint32_t funEnclosingScopeIndex = 0;
-+                RootedScope funEnclosingScope(cx);
-+                if (mode == XDR_ENCODE) {
-+                    RootedFunction function(cx, &elem->as<JSFunction>());
-+
-+                    if (function->isInterpretedLazy()) {
-+                        funEnclosingScope = function->lazyScript()->enclosingScope();
-+                    } else if (function->isInterpreted()) {
-+                        funEnclosingScope = function->nonLazyScript()->enclosingScope();
-+                    } else {
-+                        MOZ_ASSERT(function->isAsmJSNative());
-+                        return xdr->fail(JS::TranscodeResult_Failure_AsmJSNotSupported);
-+                    }
-+
-+                    funEnclosingScopeIndex = FindScopeIndex(script, *funEnclosingScope);
-+                }
-+
-+                MOZ_TRY(xdr->codeUint32(&funEnclosingScopeIndex));
-+
-+                if (mode == XDR_DECODE) {
-+                    funEnclosingScope = script->getScope(funEnclosingScopeIndex);
-+                }
-+
-+                // Code nested function and script.
-+                RootedFunction tmp(cx);
-+                if (mode == XDR_ENCODE) {
-+                    tmp = &elem->as<JSFunction>();
-+                }
-+                MOZ_TRY(XDRInterpretedFunction(xdr, funEnclosingScope, sourceObject, &tmp));
-+                if (mode == XDR_DECODE) {
-+                    elem.init(tmp);
-+                }
-+                break;
-+              }
-+
-+              case CK_JSObject: {
-+                /* Code object literal. */
-+                RootedObject tmp(cx);
-+                if (mode == XDR_ENCODE) {
-+                    tmp = elem.get();
-+                }
-+                MOZ_TRY(XDRObjectLiteral(xdr, &tmp));
-+                if (mode == XDR_DECODE) {
-+                    elem.init(tmp);
-+                }
-+                break;
-+              }
-+
-+              default: {
-+                // Fail in debug, but only soft-fail in release
-+                MOZ_ASSERT(false, "Bad XDR class kind");
-+                return xdr->fail(JS::TranscodeResult_Failure_BadDecode);
-+              }
-             }
--            MOZ_TRY(XDRInterpretedFunction(xdr, funEnclosingScope, sourceObject, &tmp));
--            *objp = tmp;
--            break;
--          }
--
--          case CK_JSObject: {
--            /* Code object literal. */
--            RootedObject tmp(cx, *objp);
--            MOZ_TRY(XDRObjectLiteral(xdr, &tmp));
--            *objp = tmp;
--            break;
--          }
--
--          default: {
--            // Fail in debug, but only soft-fail in release
--            MOZ_ASSERT(false, "Bad XDR class kind");
--            return xdr->fail(JS::TranscodeResult_Failure_BadDecode);
--          }
-         }
-     }
- 
-     // Verify marker to detect data corruption after decoding object data. A
-     // mismatch here indicates we will almost certainly crash in release.
-     MOZ_TRY(xdr->codeMarker(0xF83B989A));
- 
--    if (ntrynotes != 0) {
--        JSTryNote* tnfirst = script->trynotes()->vector;
--        MOZ_ASSERT(script->trynotes()->length == ntrynotes);
--        JSTryNote* tn = tnfirst + ntrynotes;
--        do {
--            --tn;
--            MOZ_TRY(xdr->codeUint8(&tn->kind));
--            MOZ_TRY(xdr->codeUint32(&tn->stackDepth));
--            MOZ_TRY(xdr->codeUint32(&tn->start));
--            MOZ_TRY(xdr->codeUint32(&tn->length));
--        } while (tn != tnfirst);
--    }
--
--    for (i = 0; i < nscopenotes; ++i) {
--        ScopeNote* note = &script->scopeNotes()->vector[i];
--        MOZ_TRY(xdr->codeUint32(&note->index));
--        MOZ_TRY(xdr->codeUint32(&note->start));
--        MOZ_TRY(xdr->codeUint32(&note->length));
--        MOZ_TRY(xdr->codeUint32(&note->parent));
--    }
--
--    for (i = 0; i < nyieldoffsets; ++i) {
--        uint32_t* offset = &script->yieldAndAwaitOffsets()[i];
--        MOZ_TRY(xdr->codeUint32(offset));
-+    if (ntrynotes) {
-+        for (JSTryNote& elem : script->trynotes()) {
-+            MOZ_TRY(xdr->codeUint8(&elem.kind));
-+            MOZ_TRY(xdr->codeUint32(&elem.stackDepth));
-+            MOZ_TRY(xdr->codeUint32(&elem.start));
-+            MOZ_TRY(xdr->codeUint32(&elem.length));
-+        }
-+    }
-+
-+    if (nscopenotes) {
-+        for (ScopeNote& elem : script->scopeNotes()) {
-+            MOZ_TRY(xdr->codeUint32(&elem.index));
-+            MOZ_TRY(xdr->codeUint32(&elem.start));
-+            MOZ_TRY(xdr->codeUint32(&elem.length));
-+            MOZ_TRY(xdr->codeUint32(&elem.parent));
-+        }
-+    }
-+
-+    if (nyieldoffsets) {
-+        for (uint32_t& elem : script->yieldAndAwaitOffsets()) {
-+            MOZ_TRY(xdr->codeUint32(&elem));
-+        }
-     }
- 
-     if (scriptBits & (1 << HasLazyScript)) {
-         Rooted<LazyScript*> lazy(cx);
-         if (mode == XDR_ENCODE) {
-             lazy = script->maybeLazyScript();
-         }
- 
-@@ -2962,54 +2965,54 @@ JSScript::partiallyInit(JSContext* cx, H
-     YieldAndAwaitOffsetArray* yieldAndAwaitOffsets = nullptr;
-     if (nyieldoffsets != 0) {
-         yieldAndAwaitOffsets = reinterpret_cast<YieldAndAwaitOffsetArray*>(cursor);
-         cursor += sizeof(YieldAndAwaitOffsetArray);
-     }
- 
-     if (nconsts != 0) {
-         MOZ_ASSERT(reinterpret_cast<uintptr_t>(cursor) % sizeof(JS::Value) == 0);
--        script->consts()->length = nconsts;
--        script->consts()->vector = (GCPtrValue*)cursor;
--        cursor += nconsts * sizeof(script->consts()->vector[0]);
--    }
--
--    script->scopes()->length = nscopes;
--    script->scopes()->vector = (GCPtrScope*)cursor;
--    cursor += nscopes * sizeof(script->scopes()->vector[0]);
-+        script->constsRaw()->length = nconsts;
-+        script->constsRaw()->vector = (GCPtrValue*)cursor;
-+        cursor += nconsts * sizeof(script->constsRaw()->vector[0]);
-+    }
-+
-+    script->scopesRaw()->length = nscopes;
-+    script->scopesRaw()->vector = (GCPtrScope*)cursor;
-+    cursor += nscopes * sizeof(script->scopesRaw()->vector[0]);
- 
-     if (nobjects != 0) {
--        script->objects()->length = nobjects;
--        script->objects()->vector = (GCPtrObject*)cursor;
--        cursor += nobjects * sizeof(script->objects()->vector[0]);
-+        script->objectsRaw()->length = nobjects;
-+        script->objectsRaw()->vector = (GCPtrObject*)cursor;
-+        cursor += nobjects * sizeof(script->objectsRaw()->vector[0]);
-     }
- 
-     if (ntrynotes != 0) {
--        script->trynotes()->length = ntrynotes;
--        script->trynotes()->vector = reinterpret_cast<JSTryNote*>(cursor);
--        size_t vectorSize = ntrynotes * sizeof(script->trynotes()->vector[0]);
-+        script->trynotesRaw()->length = ntrynotes;
-+        script->trynotesRaw()->vector = reinterpret_cast<JSTryNote*>(cursor);
-+        size_t vectorSize = ntrynotes * sizeof(script->trynotesRaw()->vector[0]);
- #ifdef DEBUG
-         memset(cursor, 0, vectorSize);
- #endif
-         cursor += vectorSize;
-     }
- 
-     if (nscopenotes != 0) {
--        script->scopeNotes()->length = nscopenotes;
--        script->scopeNotes()->vector = reinterpret_cast<ScopeNote*>(cursor);
--        size_t vectorSize = nscopenotes * sizeof(script->scopeNotes()->vector[0]);
-+        script->scopeNotesRaw()->length = nscopenotes;
-+        script->scopeNotesRaw()->vector = reinterpret_cast<ScopeNote*>(cursor);
-+        size_t vectorSize = nscopenotes * sizeof(script->scopeNotesRaw()->vector[0]);
- #ifdef DEBUG
-         memset(cursor, 0, vectorSize);
- #endif
-         cursor += vectorSize;
-     }
- 
-     if (nyieldoffsets != 0) {
-         yieldAndAwaitOffsets->init(reinterpret_cast<uint32_t*>(cursor), nyieldoffsets);
--        size_t vectorSize = nyieldoffsets * sizeof(script->yieldAndAwaitOffsets()[0]);
-+        size_t vectorSize = nyieldoffsets * sizeof(script->yieldAndAwaitOffsetsRaw()[0]);
- #ifdef DEBUG
-         memset(cursor, 0, vectorSize);
- #endif
-         cursor += vectorSize;
-     }
- 
-     MOZ_ASSERT(cursor == script->data + size);
-     return true;
-@@ -3034,17 +3037,17 @@ JSScript::initFunctionPrototype(JSContex
-     script->nTypeSets_ = 0;
- 
-     RootedScope enclosing(cx, &cx->global()->emptyGlobalScope());
-     Scope* functionProtoScope = FunctionScope::create(cx, nullptr, false, false, functionProto,
-                                                       enclosing);
-     if (!functionProtoScope) {
-         return false;
-     }
--    script->scopes()->vector[0].init(functionProtoScope);
-+    script->scopesRaw()->vector[0].init(functionProtoScope);
- 
-     uint32_t codeLength = 1;
-     uint32_t srcNotesLength = 1;
-     uint32_t numAtoms = 0;
-     if (!script->createScriptData(cx, codeLength, srcNotesLength, numAtoms)) {
-         return false;
-     }
- 
-@@ -3267,27 +3270,25 @@ JSScript::assertValidJumpTargets() const
-                 MOZ_ASSERT_IF(off, mainEntry <= pc + off && pc + off < end);
-                 MOZ_ASSERT_IF(off, BytecodeIsJumpTarget(JSOp(*(pc + off))));
-             }
-         }
-     }
- 
-     // Check catch/finally blocks as jump targets.
-     if (hasTrynotes()) {
--        JSTryNote* tn = trynotes()->vector;
--        JSTryNote* tnlimit = tn + trynotes()->length;
--        for (; tn < tnlimit; tn++) {
--            jsbytecode* tryStart = mainEntry + tn->start;
-+        for (const JSTryNote& tn : trynotes()) {
-+            jsbytecode* tryStart = mainEntry + tn.start;
-             jsbytecode* tryPc = tryStart - 1;
--            if (tn->kind != JSTRY_CATCH && tn->kind != JSTRY_FINALLY) {
-+            if (tn.kind != JSTRY_CATCH && tn.kind != JSTRY_FINALLY) {
-                 continue;
-             }
- 
-             MOZ_ASSERT(JSOp(*tryPc) == JSOP_TRY);
--            jsbytecode* tryTarget = tryStart + tn->length;
-+            jsbytecode* tryTarget = tryStart + tn.length;
-             MOZ_ASSERT(mainEntry <= tryTarget && tryTarget < end);
-             MOZ_ASSERT(BytecodeIsJumpTarget(JSOp(*tryTarget)));
-         }
-     }
- }
- #endif
- 
- size_t
-@@ -3660,22 +3661,22 @@ js::detail::CopyScript(JSContext* cx, Ha
-         return false;
-     }
- 
-     /* NB: Keep this in sync with XDRScript. */
- 
-     /* Some embeddings are not careful to use ExposeObjectToActiveJS as needed. */
-     MOZ_ASSERT(!src->sourceObject()->isMarkedGray());
- 
--    uint32_t nconsts   = src->hasConsts()   ? src->consts()->length   : 0;
--    uint32_t nobjects  = src->hasObjects()  ? src->objects()->length  : 0;
--    uint32_t nscopes   = src->scopes()->length;
--    uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes()->length : 0;
--    uint32_t nscopenotes = src->hasScopeNotes() ? src->scopeNotes()->length : 0;
--    uint32_t nyieldoffsets = src->hasYieldAndAwaitOffsets() ? src->yieldAndAwaitOffsets().length() : 0;
-+    uint32_t nconsts = src->hasConsts() ? src->consts().size() : 0;
-+    uint32_t nobjects = src->hasObjects() ? src->objects().size() : 0;
-+    uint32_t nscopes = src->scopes().size();
-+    uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes().size() : 0;
-+    uint32_t nscopenotes = src->hasScopeNotes() ? src->scopeNotes().size() : 0;
-+    uint32_t nyieldoffsets = src->hasYieldAndAwaitOffsets() ? src->yieldAndAwaitOffsets().size() : 0;
- 
-     /* Script data */
- 
-     size_t size = src->dataSize();
-     UniquePtr<uint8_t, JS::FreePolicy> data(AllocScriptData(cx, size));
-     if (size && !data) {
-         return false;
-     }
-@@ -3684,37 +3685,35 @@ js::detail::CopyScript(JSContext* cx, Ha
- 
-     // The passed in scopes vector contains body scopes that needed to be
-     // cloned especially, depending on whether the script is a function or
-     // global scope. Starting at scopes.length() means we only deal with
-     // intra-body scopes.
-     {
-         MOZ_ASSERT(nscopes != 0);
-         MOZ_ASSERT(src->bodyScopeIndex() + 1 == scopes.length());
--        GCPtrScope* vector = src->scopes()->vector;
-         RootedScope original(cx);
-         RootedScope clone(cx);
--        for (uint32_t i = scopes.length(); i < nscopes; i++) {
--            original = vector[i];
-+        for (const GCPtrScope& elem : src->scopes().From(scopes.length())) {
-+            original = elem.get();
-             clone = Scope::clone(cx, original, scopes[FindScopeIndex(src, *original->enclosing())]);
-             if (!clone || !scopes.append(clone)) {
-                 return false;
-             }
-         }
-     }
- 
-     /* Objects */
- 
-     AutoObjectVector objects(cx);
-     if (nobjects != 0) {
--        GCPtrObject* vector = src->objects()->vector;
-         RootedObject obj(cx);
-         RootedObject clone(cx);
--        for (unsigned i = 0; i < nobjects; i++) {
--            obj = vector[i];
-+        for (const GCPtrObject& elem : src->objects()) {
-+            obj = elem.get();
-             clone = nullptr;
-             if (obj->is<RegExpObject>()) {
-                 clone = CloneScriptRegExpObject(cx, obj->as<RegExpObject>());
-             } else if (obj->is<JSFunction>()) {
-                 RootedFunction innerFun(cx, &obj->as<JSFunction>());
-                 if (innerFun->isNative()) {
-                     if (cx->compartment() != innerFun->compartment()) {
-                         MOZ_ASSERT(innerFun->isAsmJSNative());
-@@ -3791,45 +3790,45 @@ js::detail::CopyScript(JSContext* cx, Ha
-     dst->bitFields_.isDerivedClassConstructor_ = src->isDerivedClassConstructor();
-     dst->bitFields_.needsHomeObject_ = src->needsHomeObject();
-     dst->bitFields_.isDefaultClassConstructor_ = src->isDefaultClassConstructor();
-     dst->bitFields_.isAsync_ = src->bitFields_.isAsync_;
-     dst->bitFields_.hasRest_ = src->bitFields_.hasRest_;
-     dst->bitFields_.hideScriptFromDebugger_ = src->bitFields_.hideScriptFromDebugger_;
- 
-     if (nconsts != 0) {
--        GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->consts()->vector);
--        dst->consts()->vector = vector;
-+        GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->constsRaw()->vector);
-+        dst->constsRaw()->vector = vector;
-         for (unsigned i = 0; i < nconsts; ++i) {
-             MOZ_ASSERT_IF(vector[i].isGCThing(), vector[i].toString()->isAtom());
-         }
-     }
-     if (nobjects != 0) {
--        GCPtrObject* vector = Rebase<GCPtrObject>(dst, src, src->objects()->vector);
--        dst->objects()->vector = vector;
-+        GCPtrObject* vector = Rebase<GCPtrObject>(dst, src, src->objectsRaw()->vector);
-+        dst->objectsRaw()->vector = vector;
-         for (unsigned i = 0; i < nobjects; ++i) {
-             vector[i].init(&objects[i]->as<NativeObject>());
-         }
-     }
-     {
--        GCPtrScope* vector = Rebase<GCPtrScope>(dst, src, src->scopes()->vector);
--        dst->scopes()->vector = vector;
-+        GCPtrScope* vector = Rebase<GCPtrScope>(dst, src, src->scopesRaw()->vector);
-+        dst->scopesRaw()->vector = vector;
-         for (uint32_t i = 0; i < nscopes; ++i) {
-             vector[i].init(scopes[i]);
-         }
-     }
-     if (ntrynotes != 0) {
--        dst->trynotes()->vector = Rebase<JSTryNote>(dst, src, src->trynotes()->vector);
-+        dst->trynotesRaw()->vector = Rebase<JSTryNote>(dst, src, src->trynotesRaw()->vector);
-     }
-     if (nscopenotes != 0) {
--        dst->scopeNotes()->vector = Rebase<ScopeNote>(dst, src, src->scopeNotes()->vector);
-+        dst->scopeNotesRaw()->vector = Rebase<ScopeNote>(dst, src, src->scopeNotesRaw()->vector);
-     }
-     if (nyieldoffsets != 0) {
--        dst->yieldAndAwaitOffsets().vector_ =
--            Rebase<uint32_t>(dst, src, src->yieldAndAwaitOffsets().vector_);
-+        dst->yieldAndAwaitOffsetsRaw().vector_ =
-+            Rebase<uint32_t>(dst, src, src->yieldAndAwaitOffsetsRaw().vector_);
-     }
- 
-     return true;
- }
- 
- static JSScript*
- CreateEmptyScriptForClone(JSContext* cx, HandleScript src)
- {
-@@ -4168,28 +4167,29 @@ JSScript::traceChildren(JSTracer* trc)
-     MOZ_ASSERT_IF(trc->isMarkingTracer() &&
-                   GCMarker::fromTracer(trc)->shouldCheckCompartments(),
-                   zone()->isCollecting());
- 
-     if (scriptData()) {
-         scriptData()->traceChildren(trc);
-     }
- 
--    if (ScopeArray* scopearray = scopes()) {
--        TraceRange(trc, scopearray->length, scopearray->vector, "scopes");
-+    if (data) {
-+        auto array = scopes();
-+        TraceRange(trc, array.size(), array.data(), "scopes");
-     }
- 
-     if (hasConsts()) {
--        ConstArray* constarray = consts();
--        TraceRange(trc, constarray->length, constarray->vector, "consts");
-+        auto array = consts();
-+        TraceRange(trc, array.size(), array.data(), "consts");
-     }
- 
-     if (hasObjects()) {
--        ObjectArray* objarray = objects();
--        TraceRange(trc, objarray->length, objarray->vector, "objects");
-+        auto array = objects();
-+        TraceRange(trc, array.size(), array.data(), "objects");
-     }
- 
-     MOZ_ASSERT_IF(sourceObject(), MaybeForwarded(sourceObject())->compartment() == compartment());
-     TraceNullableEdge(trc, &sourceObject_, "sourceObject");
- 
-     if (maybeLazyScript()) {
-         TraceManuallyBarrieredEdge(trc, &lazyScript, "lazyScript");
-     }
-@@ -4247,35 +4247,35 @@ JSScript::lookupScope(jsbytecode* pc)
-     MOZ_ASSERT(containsPC(pc));
- 
-     if (!hasScopeNotes()) {
-         return nullptr;
-     }
- 
-     size_t offset = pc - code();
- 
--    ScopeNoteArray* notes = scopeNotes();
-+    auto notes = scopeNotes();
-     Scope* scope = nullptr;
- 
-     // Find the innermost block chain using a binary search.
-     size_t bottom = 0;
--    size_t top = notes->length;
-+    size_t top = notes.size();
- 
-     while (bottom < top) {
-         size_t mid = bottom + (top - bottom) / 2;
--        const ScopeNote* note = &notes->vector[mid];
-+        const ScopeNote* note = &notes[mid];
-         if (note->start <= offset) {
-             // Block scopes are ordered in the list by their starting offset, and since
-             // blocks form a tree ones earlier in the list may cover the pc even if
-             // later blocks end before the pc. This only happens when the earlier block
-             // is a parent of the later block, so we need to check parents of |mid| in
-             // the searched range for coverage.
-             size_t check = mid;
-             while (check >= bottom) {
--                const ScopeNote* checkNote = &notes->vector[check];
-+                const ScopeNote* checkNote = &notes[check];
-                 MOZ_ASSERT(checkNote->start <= offset);
-                 if (offset < checkNote->start + checkNote->length) {
-                     // We found a matching block chain but there may be inner ones
-                     // at a higher block chain index than mid. Continue the binary search.
-                     if (checkNote->index == ScopeNote::NoScopeIndex) {
-                         scope = nullptr;
-                     } else {
-                         scope = getScope(checkNote->index);
-@@ -4719,20 +4719,18 @@ JSScript::updateJitCodeRaw(JSRuntime* rt
- }
- 
- bool
- JSScript::hasLoops()
- {
-     if (!hasTrynotes()) {
-         return false;
-     }
--    JSTryNote* tn = trynotes()->vector;
--    JSTryNote* tnlimit = tn + trynotes()->length;
--    for (; tn < tnlimit; tn++) {
--        switch (tn->kind) {
-+    for (const JSTryNote& tn : trynotes()) {
-+        switch (tn.kind) {
-           case JSTRY_FOR_IN:
-           case JSTRY_FOR_OF:
-           case JSTRY_LOOP:
-             return true;
-           case JSTRY_CATCH:
-           case JSTRY_FINALLY:
-           case JSTRY_FOR_OF_ITERCLOSE:
-           case JSTRY_DESTRUCTURING_ITERCLOSE:
-diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h
---- a/js/src/vm/JSScript.h
-+++ b/js/src/vm/JSScript.h
-@@ -8,16 +8,17 @@
- 
- #ifndef vm_JSScript_h
- #define vm_JSScript_h
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/Atomics.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/MemoryReporting.h"
-+#include "mozilla/Span.h"
- #include "mozilla/Variant.h"
- 
- #include "jstypes.h"
- 
- #include "frontend/NameAnalysisTypes.h"
- #include "gc/Barrier.h"
- #include "gc/Rooting.h"
- #include "jit/IonCode.h"
-@@ -1820,28 +1821,26 @@ class JSScript : public js::gc::TenuredC
- 
-     bool functionHasExtraBodyVarScope() const {
-         MOZ_ASSERT_IF(bitFields_.functionHasExtraBodyVarScope_, functionHasParameterExprs());
-         return bitFields_.functionHasExtraBodyVarScope_;
-     }
- 
-     js::VarScope* functionExtraBodyVarScope() const {
-         MOZ_ASSERT(functionHasExtraBodyVarScope());
--        for (uint32_t i = 0; i < scopes()->length; i++) {
--            js::Scope* scope = getScope(i);
-+        for (js::Scope* scope : scopes()) {
-             if (scope->kind() == js::ScopeKind::FunctionBodyVar) {
-                 return &scope->as<js::VarScope>();
-             }
-         }
-         MOZ_CRASH("Function extra body var scope not found");
-     }
- 
-     bool needsBodyEnvironment() const {
--        for (uint32_t i = 0; i < scopes()->length; i++) {
--            js::Scope* scope = getScope(i);
-+        for (js::Scope* scope : scopes()) {
-             if (ScopeKindIsInBody(scope->kind()) && scope->hasEnvironment()) {
-                 return true;
-             }
-         }
-         return false;
-     }
- 
-     inline js::LexicalScope* maybeNamedLambdaScope() const;
-@@ -1926,46 +1925,80 @@ class JSScript : public js::gc::TenuredC
-     size_t yieldAndAwaitOffsetsOffset() const {
-         return OFF(scopeNotesOffset, hasScopeNotes, js::ScopeNoteArray);
-     }
- 
- #undef OFF
- 
-     size_t dataSize() const { return dataSize_; }
- 
--    js::ConstArray* consts() {
-+  private:
-+
-+    js::ConstArray* constsRaw() const {
-         MOZ_ASSERT(hasConsts());
-         return reinterpret_cast<js::ConstArray*>(data + constsOffset());
-     }
- 
--    js::ObjectArray* objects() {
-+    js::ObjectArray* objectsRaw() const {
-         MOZ_ASSERT(hasObjects());
-         return reinterpret_cast<js::ObjectArray*>(data + objectsOffset());
-     }
- 
--    js::ScopeArray* scopes() const {
-+    js::ScopeArray* scopesRaw() const {
-         return reinterpret_cast<js::ScopeArray*>(data + scopesOffset());
-     }
- 
--    js::TryNoteArray* trynotes() const {
-+    js::TryNoteArray* trynotesRaw() const {
-         MOZ_ASSERT(hasTrynotes());
-         return reinterpret_cast<js::TryNoteArray*>(data + trynotesOffset());
-     }
- 
--    js::ScopeNoteArray* scopeNotes() {
-+    js::ScopeNoteArray* scopeNotesRaw() const {
-         MOZ_ASSERT(hasScopeNotes());
-         return reinterpret_cast<js::ScopeNoteArray*>(data + scopeNotesOffset());
-     }
- 
--    js::YieldAndAwaitOffsetArray& yieldAndAwaitOffsets() {
-+    js::YieldAndAwaitOffsetArray& yieldAndAwaitOffsetsRaw() const {
-         MOZ_ASSERT(hasYieldAndAwaitOffsets());
-         return *reinterpret_cast<js::YieldAndAwaitOffsetArray*>(data +
-                                                                 yieldAndAwaitOffsetsOffset());
-     }
- 
-+  public:
-+
-+    mozilla::Span<js::GCPtrValue> consts() const {
-+        js::ConstArray* array = constsRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<js::GCPtrObject> objects() const {
-+        js::ObjectArray* array = objectsRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<js::GCPtrScope> scopes() const {
-+        js::ScopeArray* array = scopesRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<JSTryNote> trynotes() const {
-+        js::TryNoteArray* array = trynotesRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<js::ScopeNote> scopeNotes() const {
-+        js::ScopeNoteArray* array = scopeNotesRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<uint32_t> yieldAndAwaitOffsets() const {
-+        js::YieldAndAwaitOffsetArray& array = yieldAndAwaitOffsetsRaw();
-+        return mozilla::MakeSpan(&array[0], array.length());
-+    }
-+
-     bool hasLoops();
- 
-     uint32_t numNotes() const {
-         MOZ_ASSERT(scriptData_);
-         return scriptData_->numNotes();
-     }
-     jssrcnote* notes() const {
-         MOZ_ASSERT(scriptData_);
-@@ -1996,31 +2029,27 @@ class JSScript : public js::gc::TenuredC
-         return getAtom(index)->asPropertyName();
-     }
- 
-     js::PropertyName* getName(jsbytecode* pc) const {
-         return getAtom(pc)->asPropertyName();
-     }
- 
-     JSObject* getObject(size_t index) {
--        js::ObjectArray* arr = objects();
--        MOZ_ASSERT(index < arr->length);
--        MOZ_ASSERT(arr->vector[index]->isTenured());
--        return arr->vector[index];
-+        MOZ_ASSERT(objects()[index]->isTenured());
-+        return objects()[index];
-     }
- 
-     JSObject* getObject(jsbytecode* pc) {
-         MOZ_ASSERT(containsPC(pc) && containsPC(pc + sizeof(uint32_t)));
-         return getObject(GET_UINT32_INDEX(pc));
-     }
- 
-     js::Scope* getScope(size_t index) const {
--        js::ScopeArray* array = scopes();
--        MOZ_ASSERT(index < array->length);
--        return array->vector[index];
-+        return scopes()[index];
-     }
- 
-     js::Scope* getScope(jsbytecode* pc) const {
-         // This method is used to get a scope directly using a JSOp with an
-         // index. To search through ScopeNotes to look for a Scope using pc,
-         // use lookupScope.
-         MOZ_ASSERT(containsPC(pc) && containsPC(pc + sizeof(uint32_t)));
-         MOZ_ASSERT(js::JOF_OPTYPE(JSOp(*pc)) == JOF_SCOPE,
-@@ -2035,19 +2064,17 @@ class JSScript : public js::gc::TenuredC
-         }
-         return nullptr;
-     }
- 
-     inline js::RegExpObject* getRegExp(size_t index);
-     inline js::RegExpObject* getRegExp(jsbytecode* pc);
- 
-     const js::Value& getConst(size_t index) {
--        js::ConstArray* arr = consts();
--        MOZ_ASSERT(index < arr->length);
--        return arr->vector[index];
-+        return consts()[index];
-     }
- 
-     // The following 3 functions find the static scope just before the
-     // execution of the instruction pointed to by pc.
- 
-     js::Scope* lookupScope(jsbytecode* pc);
- 
-     js::Scope* innermostScope(jsbytecode* pc);
-diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
---- a/js/src/vm/ObjectGroup.cpp
-+++ b/js/src/vm/ObjectGroup.cpp
-@@ -235,25 +235,23 @@ ObjectGroup::useSingletonForAllocationSi
-     // All loops in the script will have a try note indicating their boundary.
- 
-     if (!script->hasTrynotes()) {
-         return SingletonObject;
-     }
- 
-     unsigned offset = script->pcToOffset(pc);
- 
--    JSTryNote* tn = script->trynotes()->vector;
--    JSTryNote* tnlimit = tn + script->trynotes()->length;
--    for (; tn < tnlimit; tn++) {
--        if (tn->kind != JSTRY_FOR_IN && tn->kind != JSTRY_FOR_OF && tn->kind != JSTRY_LOOP) {
-+    for (const JSTryNote& tn : script->trynotes()) {
-+        if (tn.kind != JSTRY_FOR_IN && tn.kind != JSTRY_FOR_OF && tn.kind != JSTRY_LOOP) {
-             continue;
-         }
- 
--        unsigned startOffset = script->mainOffset() + tn->start;
--        unsigned endOffset = startOffset + tn->length;
-+        unsigned startOffset = script->mainOffset() + tn.start;
-+        unsigned endOffset = startOffset + tn.length;
- 
-         if (offset >= startOffset && offset < endOffset) {
-             return GenericObject;
-         }
-     }
- 
-     return SingletonObject;
- }
-diff --git a/js/src/vm/Realm.cpp b/js/src/vm/Realm.cpp
---- a/js/src/vm/Realm.cpp
-+++ b/js/src/vm/Realm.cpp
-@@ -705,19 +705,17 @@ Realm::setNewObjectMetadata(JSContext* c
- }
- 
- static bool
- AddInnerLazyFunctionsFromScript(JSScript* script, AutoObjectVector& lazyFunctions)
- {
-     if (!script->hasObjects()) {
-         return true;
-     }
--    ObjectArray* objects = script->objects();
--    for (size_t i = 0; i < objects->length; i++) {
--        JSObject* obj = objects->vector[i];
-+    for (JSObject* obj : script->objects()) {
-         if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpretedLazy()) {
-             if (!lazyFunctions.append(obj)) {
-                 return false;
-             }
-         }
-     }
-     return true;
- }

+ 0 - 323
frg/work-js/mozilla-release/patches/mozilla-central2_434095.patch

@@ -1,323 +0,0 @@
-# HG changeset patch
-# User Myk Melez <myk@mykzilla.org>
-# Date 1535650194 0
-#      Thu Aug 30 17:29:54 2018 +0000
-# Node ID b9197ece79556d5e565bb5350383b75f1448f06c
-# Parent  7e58b028df95389c1994c268161a0c7ba6e7f957
-Bug 1482810 - set COMPILE_FLAGS var to hide warnings for Rust crates r=chmanchester
-
-In conjunction with the cc crate changes in https://github.com/alexcrichton/cc-rs/pull/342 (which I'll land in https://phabricator.services.mozilla.com/D4699), this hides warnings generated by C code in Rust crates (by removing warnings flags from CFLAGS when compiling Rust libraries).
-
-MozReview-Commit-ID: 9CZgLGbWjbA
-
-Differential Revision: https://phabricator.services.mozilla.com/D3939
-
-diff --git a/build/clang-plugin/tests/moz.build b/build/clang-plugin/tests/moz.build
---- a/build/clang-plugin/tests/moz.build
-+++ b/build/clang-plugin/tests/moz.build
-@@ -62,10 +62,14 @@ COMPILE_FLAGS['OS_CXXFLAGS'] = (
-     ['-fsyntax-only', '-Xclang', '-verify', '-ferror-limit=0', '-Wno-invalid-noreturn']
- )
- COMPILE_FLAGS['OS_CFLAGS'] = (
-     [f for f in COMPILE_FLAGS.get('OS_CFLAGS', []) if not f.startswith('-W')] +
-     ['-fsyntax-only', '-Xclang', '-verify', '-ferror-limit=0', '-std=c11',
-      '-Wno-invalid-noreturn']
- )
- 
-+# Don't reflect WARNINGS_CFLAGS into CFLAGS, as the warnings flags should be
-+# as specified in OS_CFLAGS above.
-+DisableCompilerWarnings()
-+
- if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
-     AllowCompilerWarnings()  # workaround for bug 1090497
-diff --git a/build/templates.mozbuild b/build/templates.mozbuild
---- a/build/templates.mozbuild
-+++ b/build/templates.mozbuild
-@@ -53,24 +53,33 @@ def Library(name):
-     '''Template for libraries.'''
-     LIBRARY_NAME = name
- 
- @template
- def AllowCompilerWarnings():
-     COMPILE_FLAGS['WARNINGS_AS_ERRORS'] = []
- 
- @template
-+def DisableCompilerWarnings():
-+    COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
-+
-+@template
- def RustLibrary(name, features=None, target_dir=None, output_category=None):
-     '''Template for Rust libraries.'''
-     Library(name)
- 
-     IS_RUST_LIBRARY = True
-     # Some Rust build scripts compile C/C++ sources, don't error on warnings for them.
-     AllowCompilerWarnings()
- 
-+    # And furthermore, don't even show warnings for them, so they don't regress
-+    # the Compiler Warnings build metric
-+    # <https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Automated_Performance_Testing_and_Sheriffing/Build_Metrics#compiler_warnings>.
-+    DisableCompilerWarnings()
-+
-     if features:
-         RUST_LIBRARY_FEATURES = features
- 
-     if target_dir:
-         RUST_LIBRARY_TARGET_DIR = target_dir
- 
-     if output_category:
-         RUST_LIBRARY_OUTPUT_CATEGORY = output_category
-diff --git a/config/rules.mk b/config/rules.mk
---- a/config/rules.mk
-+++ b/config/rules.mk
-@@ -900,48 +900,53 @@ rust_unlock_unstable =
- ifdef MOZ_RUST_SIMD
- rust_unlock_unstable += RUSTC_BOOTSTRAP=1
- endif
- 
- ifdef MOZ_USING_SCCACHE
- sccache_wrap := RUSTC_WRAPPER='$(CCACHE)'
- endif
- 
--ifneq (WINNT,$(HOST_OS_ARCH))
- ifndef MOZ_ASAN
- ifndef MOZ_TSAN
- ifndef MOZ_CODE_COVERAGE
- # Pass the compilers and flags in use to cargo for use in build scripts.
--# * Don't do this on Windows because msys path translation makes a mess of the paths, and
--#   we put MSVC in PATH there anyway.
- # * Don't do this for ASAN/TSAN builds because we don't pass our custom linker (see below)
- #   which will muck things up.
- # * Don't do this for code coverage builds because the way rustc invokes the linker doesn't
- #   work with GCC 6: https://bugzilla.mozilla.org/show_bug.cgi?id=1477305
- #
- # We don't pass HOST_{CC,CXX} down in any form because our host value might not match
- # what cargo chooses and there's no way to control cargo's selection, so we just have to
- # hope that if something needs to build a host C source file it can find a usable compiler!
- #
- # We're passing these for consumption by the `cc` crate, which doesn't use the same
- # convention as cargo itself:
- # https://github.com/alexcrichton/cc-rs/blob/baa71c0e298d9ad7ac30f0ad78f20b4b3b3a8fb2/src/lib.rs#L1715
- rust_cc_env_name := $(subst -,_,$(RUST_TARGET))
- 
-+ifeq (WINNT,$(HOST_OS_ARCH))
-+# Don't do most of this on Windows because msys path translation makes a mess of the paths, and
-+# we put MSVC in PATH there anyway.  But we do suppress warnings, since all such warnings
-+# are in third-party code.
-+cargo_c_compiler_envs := \
-+ CFLAGS_$(rust_cc_env_name)="-w" \
-+ $(NULL)
-+else
- cargo_c_compiler_envs := \
-  CC_$(rust_cc_env_name)="$(CC)" \
-  CXX_$(rust_cc_env_name)="$(CXX)" \
-  CFLAGS_$(rust_cc_env_name)="$(COMPUTED_CFLAGS)" \
-  CXXFLAGS_$(rust_cc_env_name)="$(COMPUTED_CXXFLAGS)" \
-  AR_$(rust_cc_env_name)="$(AR)" \
-  $(NULL)
-+endif # WINNT
- endif # MOZ_CODE_COVERAGE
- endif # MOZ_TSAN
- endif # MOZ_ASAN
--endif # WINNT
- 
- # We use the + prefix to pass down the jobserver fds to cargo, but we
- # don't use the prefix when make -n is used, so that cargo doesn't run
- # in that case)
- define RUN_CARGO
- $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleaner) $(rust_unlock_unstable) $(sccache_wrap) \
- 	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
- 	RUSTFLAGS='$(2)' \
-diff --git a/js/src/old-configure.in b/js/src/old-configure.in
---- a/js/src/old-configure.in
-+++ b/js/src/old-configure.in
-@@ -418,18 +418,19 @@ dnl computed above.
- dnl ========================================================
- 
- MOZ_ANDROID_CPU_ARCH
- MOZ_ANDROID_STLPORT
- 
- dnl ========================================================
- dnl Suppress Clang Argument Warnings
- dnl ========================================================
-+WARNINGS_CFLAGS="$_WARNINGS_CFLAGS"
- if test -n "${CLANG_CC}${CLANG_CL}"; then
--    _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
-+    WARNINGS_CFLAGS="-Qunused-arguments $WARNINGS_CFLAGS"
-     CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
- fi
- if test -n "${CLANG_CXX}${CLANG_CL}"; then
-     _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
- fi
- 
- MOZ_CONFIG_SANITIZE
- 
-@@ -1751,16 +1752,17 @@ AC_SUBST_LIST(ASFLAGS)
- AC_SUBST(AS_DASH_C_FLAG)
- AC_SUBST(RC)
- AC_SUBST(RCFLAGS)
- AC_SUBST(WINDRES)
- AC_SUBST(IMPLIB)
- AC_SUBST(FILTER)
- AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
- AC_SUBST(WARNINGS_AS_ERRORS)
-+AC_SUBST_LIST(WARNINGS_CFLAGS)
- AC_SUBST(LIBICONV)
- 
- AC_SUBST(ENABLE_STRIP)
- AC_SUBST(PKG_SKIP_STRIP)
- AC_SUBST(INCREMENTAL_LINKER)
- 
- AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
- 
-@@ -1778,17 +1780,16 @@ dnl ====================================
- 
- dnl top-level configure may override this with --without-intl-api
- _INTL_API=yes
- 
- MOZ_CONFIG_ICU()
- 
- dnl Echo the CFLAGS to remove extra whitespace.
- CFLAGS=`echo \
--	$_WARNINGS_CFLAGS \
- 	$_COMPILATION_CFLAGS \
- 	$CFLAGS`
- 
- CXXFLAGS=`echo \
- 	$_WARNINGS_CXXFLAGS \
- 	$_COMPILATION_CXXFLAGS \
- 	$CXXFLAGS`
- 
-diff --git a/old-configure.in b/old-configure.in
---- a/old-configure.in
-+++ b/old-configure.in
-@@ -472,18 +472,19 @@ dnl ====================================
- MOZ_ANDROID_CPU_ARCH
- if test "$COMPILE_ENVIRONMENT"; then
-     MOZ_ANDROID_STLPORT
- fi # COMPILE_ENVIRONMENT
- 
- dnl ========================================================
- dnl Suppress Clang Argument Warnings
- dnl ========================================================
-+WARNINGS_CFLAGS="$_WARNINGS_CFLAGS"
- if test -n "${CLANG_CC}${CLANG_CL}"; then
--    _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
-+    WARNINGS_CFLAGS="-Qunused-arguments $WARNINGS_CFLAGS"
-     CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
- fi
- if test -n "${CLANG_CXX}${CLANG_CL}"; then
-     _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
- fi
- 
- if test -n "$COMPILE_ENVIRONMENT"; then
-    MOZ_CONFIG_SANITIZE
-@@ -4102,16 +4103,17 @@ AC_SUBST(RC)
- AC_SUBST(RCFLAGS)
- AC_SUBST(WINDRES)
- AC_SUBST(IMPLIB)
- AC_SUBST(FILTER)
- AC_SUBST(MOZ_AUTH_EXTENSION)
- AC_SUBST(MOZ_PREF_EXTENSIONS)
- AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
- AC_SUBST(WARNINGS_AS_ERRORS)
-+AC_SUBST_LIST(WARNINGS_CFLAGS)
- AC_SUBST_SET(MOZ_EXTENSIONS)
- AC_SUBST(MOZ_TOOLKIT_SEARCH)
- AC_SUBST(MOZ_FEEDS)
- 
- AC_SUBST(MOZ_UNIVERSALCHARDET)
- AC_SUBST(ACCESSIBILITY)
- AC_SUBST(MOZ_SPELLCHECK)
- AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
-@@ -4370,17 +4372,16 @@ dnl ====================================
- if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
-     USE_ICU=1
- fi
- 
- MOZ_CONFIG_ICU()
- 
- dnl Echo the CFLAGS to remove extra whitespace.
- CFLAGS=`echo \
--    $_WARNINGS_CFLAGS \
-     $_COMPILATION_CFLAGS \
-     $CFLAGS`
- 
- CXXFLAGS=`echo \
-     $_WARNINGS_CXXFLAGS \
-     $_COMPILATION_CXXFLAGS \
-     $CXXFLAGS`
- 
-diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
---- a/python/mozbuild/mozbuild/frontend/context.py
-+++ b/python/mozbuild/mozbuild/frontend/context.py
-@@ -458,16 +458,18 @@ class CompileFlags(BaseCompileFlags):
-             ('CLANG_PLUGIN', context.config.substs.get('CLANG_PLUGIN_FLAGS'),
-              ('CFLAGS', 'CXXFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-             ('OPTIMIZE', self._optimize_flags(),
-              ('CFLAGS', 'CXXFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-             ('FRAMEPTR', context.config.substs.get('MOZ_FRAMEPTR_FLAGS'),
-              ('CFLAGS', 'CXXFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-             ('WARNINGS_AS_ERRORS', self._warnings_as_errors(),
-              ('CXXFLAGS', 'CFLAGS', 'CXX_LDFLAGS', 'C_LDFLAGS')),
-+            ('WARNINGS_CFLAGS', context.config.substs.get('WARNINGS_CFLAGS'),
-+             ('CFLAGS', 'C_LDFLAGS')),
-             ('MOZBUILD_CFLAGS', None, ('CFLAGS',)),
-             ('MOZBUILD_CXXFLAGS', None, ('CXXFLAGS',)),
-         )
- 
-         BaseCompileFlags.__init__(self, context)
- 
-     def _debug_flags(self):
-         if (self._context.config.substs.get('MOZ_DEBUG') or
-diff --git a/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/moz.build b/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/moz.build
-new file mode 100644
---- /dev/null
-+++ b/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/moz.build
-@@ -0,0 +1,17 @@
-+# Any copyright is dedicated to the Public Domain.
-+# http://creativecommons.org/publicdomain/zero/1.0/
-+
-+@template
-+def DisableCompilerWarnings():
-+    COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
-+
-+@template
-+def Library(name):
-+    '''Template for libraries.'''
-+    LIBRARY_NAME = name
-+
-+Library('dummy')
-+
-+UNIFIED_SOURCES += ['test1.c']
-+
-+DisableCompilerWarnings()
-diff --git a/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/test1.c b/python/mozbuild/mozbuild/test/frontend/data/disable-compiler-warnings/test1.c
-new file mode 100644
-diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
---- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
-+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
-@@ -418,16 +418,23 @@ class TestEmitterBasic(unittest.TestCase
- 
-     def test_allow_compiler_warnings(self):
-         reader = self.reader('allow-compiler-warnings', extra_substs={
-             'WARNINGS_AS_ERRORS': '-Werror',
-         })
-         sources, ldflags, lib, flags = self.read_topsrcdir(reader)
-         self.assertEqual(flags.flags['WARNINGS_AS_ERRORS'], [])
- 
-+    def test_disable_compiler_warnings(self):
-+        reader = self.reader('disable-compiler-warnings', extra_substs={
-+            'WARNINGS_CFLAGS': '-Wall',
-+        })
-+        sources, ldflags, lib, flags = self.read_topsrcdir(reader)
-+        self.assertEqual(flags.flags['WARNINGS_CFLAGS'], [])
-+
-     def test_use_yasm(self):
-         # When yasm is not available, this should raise.
-         reader = self.reader('use-yasm')
-         with self.assertRaisesRegexp(SandboxValidationError,
-             'yasm is not available'):
-             self.read_topsrcdir(reader)
- 
-         # When yasm is available, this should work.

+ 0 - 2030
frg/work-js/mozilla-release/patches/mozilla-central_438583.patch

@@ -1,2030 +0,0 @@
-# HG changeset patch
-# User Ted Campbell <tcampbell@mozilla.com>
-# Date 1534993363 14400
-#      Wed Aug 22 23:02:43 2018 -0400
-# Node ID 78d60776b5be58408a15de4346b302d1df1f8c14
-# Parent  dc4ca2dbed1fbabaa968cc1b802ba31406e45941
-Bug 1485347 - Part 3: Use mozilla::Span for JSScript::data arrays. r=jandem
-
-Replace various custom data-types in JSScript interfaces with
-mozilla::Span. This abstracts implementation details and supports
-range-based for-loops. Underlying storage is unchanged, but this sets us
-up to be able to more easily change it.
-
-MozReview-Commit-ID: FDfIYsAxTA8
-
-diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
---- a/js/src/frontend/BytecodeEmitter.cpp
-+++ b/js/src/frontend/BytecodeEmitter.cpp
-@@ -10,16 +10,17 @@
- 
- #include "frontend/BytecodeEmitter.h"
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/DebugOnly.h"
- #include "mozilla/FloatingPoint.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/PodOperations.h"
-+#include "mozilla/ReverseIterator.h"
- 
- #include <string.h>
- 
- #include "jsnum.h"
- #include "jstypes.h"
- #include "jsutil.h"
- 
- #include "ds/Nestable.h"
-@@ -9625,22 +9626,22 @@ BytecodeEmitter::copySrcNotes(jssrcnote*
-     unsigned mainCount = main.notes.length();
-     // nsrcnotes includes SN_MAKE_TERMINATOR in addition to main.notes.
-     MOZ_ASSERT(mainCount == nsrcnotes - 1);
-     PodCopy(destination, main.notes.begin(), mainCount);
-     SN_MAKE_TERMINATOR(&destination[mainCount]);
- }
- 
- void
--CGNumberList::finish(ConstArray* array)
--{
--    MOZ_ASSERT(length() == array->length);
-+CGNumberList::finish(mozilla::Span<GCPtrValue> array)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
--        array->vector[i] = DoubleValue(list[i]);
-+        array[i].init(DoubleValue(list[i]));
-     }
- }
- 
- /*
-  * Find the index of the given object for code generator.
-  *
-  * Since the emitter refers to each parsed object only once, for the index we
-  * use the number of already indexed objects. We also add the object to a list
-@@ -9652,42 +9653,41 @@ CGObjectList::add(ObjectBox* objbox)
- {
-     MOZ_ASSERT(!objbox->emitLink);
-     objbox->emitLink = lastbox;
-     lastbox = objbox;
-     return length++;
- }
- 
- void
--CGObjectList::finish(ObjectArray* array)
-+CGObjectList::finish(mozilla::Span<GCPtrObject> array)
- {
-     MOZ_ASSERT(length <= INDEX_LIMIT);
--    MOZ_ASSERT(length == array->length);
--
--    js::GCPtrObject* cursor = array->vector + array->length;
-+    MOZ_ASSERT(length == array.size());
-+
-     ObjectBox* objbox = lastbox;
--    do {
--        --cursor;
--        MOZ_ASSERT(!*cursor);
-+    for (GCPtrObject& obj : mozilla::Reversed(array)) {
-+        MOZ_ASSERT(obj == nullptr);
-         MOZ_ASSERT(objbox->object->isTenured());
-         if (objbox->isFunctionBox()) {
-             objbox->asFunctionBox()->finish();
-         }
--        *cursor = objbox->object;
--    } while ((objbox = objbox->emitLink) != nullptr);
--    MOZ_ASSERT(cursor == array->vector);
-+        obj.init(objbox->object);
-+        objbox = objbox->emitLink;
-+    }
- }
- 
- void
--CGScopeList::finish(ScopeArray* array)
-+CGScopeList::finish(mozilla::Span<GCPtrScope> array)
- {
-     MOZ_ASSERT(length() <= INDEX_LIMIT);
--    MOZ_ASSERT(length() == array->length);
-+    MOZ_ASSERT(length() == array.size());
-+
-     for (uint32_t i = 0; i < length(); i++) {
--        array->vector[i].init(vector[i]);
-+        array[i].init(vector[i]);
-     }
- }
- 
- bool
- CGTryNoteList::append(JSTryNoteKind kind, uint32_t stackDepth, size_t start, size_t end)
- {
-     MOZ_ASSERT(start <= end);
-     MOZ_ASSERT(size_t(uint32_t(start)) == start);
-@@ -9698,22 +9698,22 @@ CGTryNoteList::append(JSTryNoteKind kind
-     note.stackDepth = stackDepth;
-     note.start = uint32_t(start);
-     note.length = uint32_t(end - start);
- 
-     return list.append(note);
- }
- 
- void
--CGTryNoteList::finish(TryNoteArray* array)
--{
--    MOZ_ASSERT(length() == array->length);
-+CGTryNoteList::finish(mozilla::Span<JSTryNote> array)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
--        array->vector[i] = list[i];
-+        array[i] = list[i];
-     }
- }
- 
- bool
- CGScopeNoteList::append(uint32_t scopeIndex, uint32_t offset, bool inPrologue,
-                         uint32_t parent)
- {
-     CGScopeNote note;
-@@ -9732,37 +9732,37 @@ CGScopeNoteList::recordEnd(uint32_t inde
- {
-     MOZ_ASSERT(index < length());
-     MOZ_ASSERT(list[index].length == 0);
-     list[index].end = offset;
-     list[index].endInPrologue = inPrologue;
- }
- 
- void
--CGScopeNoteList::finish(ScopeNoteArray* array, uint32_t prologueLength)
--{
--    MOZ_ASSERT(length() == array->length);
-+CGScopeNoteList::finish(mozilla::Span<ScopeNote> array, uint32_t prologueLength)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
-         if (!list[i].startInPrologue) {
-             list[i].start += prologueLength;
-         }
-         if (!list[i].endInPrologue && list[i].end != UINT32_MAX) {
-             list[i].end += prologueLength;
-         }
-         MOZ_ASSERT(list[i].end >= list[i].start);
-         list[i].length = list[i].end - list[i].start;
--        array->vector[i] = list[i];
-+        array[i] = list[i];
-     }
- }
- 
- void
--CGYieldAndAwaitOffsetList::finish(YieldAndAwaitOffsetArray& array, uint32_t prologueLength)
--{
--    MOZ_ASSERT(length() == array.length());
-+CGYieldAndAwaitOffsetList::finish(mozilla::Span<uint32_t> array, uint32_t prologueLength)
-+{
-+    MOZ_ASSERT(length() == array.size());
- 
-     for (unsigned i = 0; i < length(); i++) {
-         array[i] = prologueLength + list[i];
-     }
- }
- 
- const JSSrcNoteSpec js_SrcNoteSpec[] = {
- #define DEFINE_SRC_NOTE_SPEC(sym, name, arity) { name, arity },
-diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h
---- a/js/src/frontend/BytecodeEmitter.h
-+++ b/js/src/frontend/BytecodeEmitter.h
-@@ -5,16 +5,17 @@
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
- /* JS bytecode generation. */
- 
- #ifndef frontend_BytecodeEmitter_h
- #define frontend_BytecodeEmitter_h
- 
- #include "mozilla/Attributes.h"
-+#include "mozilla/Span.h"
- 
- #include "ds/InlineTable.h"
- #include "frontend/BCEParserHandle.h"
- #include "frontend/EitherParser.h"
- #include "frontend/JumpList.h"
- #include "frontend/NameFunctions.h"
- #include "frontend/SharedContext.h"
- #include "frontend/SourceNotes.h"
-@@ -29,48 +30,48 @@ class CGNumberList {
-     Vector<double> list;
- 
-   public:
-     explicit CGNumberList(JSContext* cx) : list(cx) {}
-     MOZ_MUST_USE bool append(double v) {
-         return list.append(v);
-     }
-     size_t length() const { return list.length(); }
--    void finish(ConstArray* array);
-+    void finish(mozilla::Span<GCPtrValue> array);
- };
- 
- struct CGObjectList {
-     uint32_t            length;     /* number of emitted so far objects */
-     ObjectBox*          lastbox;   /* last emitted object */
- 
-     CGObjectList() : length(0), lastbox(nullptr) {}
- 
-     unsigned add(ObjectBox* objbox);
--    void finish(ObjectArray* array);
-+    void finish(mozilla::Span<GCPtrObject> array);
- };
- 
- struct MOZ_STACK_CLASS CGScopeList {
-     Rooted<GCVector<Scope*>> vector;
- 
-     explicit CGScopeList(JSContext* cx)
-       : vector(cx, GCVector<Scope*>(cx))
-     { }
- 
-     bool append(Scope* scope) { return vector.append(scope); }
-     uint32_t length() const { return vector.length(); }
--    void finish(ScopeArray* array);
-+    void finish(mozilla::Span<GCPtrScope> array);
- };
- 
- struct CGTryNoteList {
-     Vector<JSTryNote> list;
-     explicit CGTryNoteList(JSContext* cx) : list(cx) {}
- 
-     MOZ_MUST_USE bool append(JSTryNoteKind kind, uint32_t stackDepth, size_t start, size_t end);
-     size_t length() const { return list.length(); }
--    void finish(TryNoteArray* array);
-+    void finish(mozilla::Span<JSTryNote> array);
- };
- 
- struct CGScopeNote : public ScopeNote
- {
-     // The end offset. Used to compute the length; may need adjusting first if
-     // in the prologue.
-     uint32_t end;
- 
-@@ -84,28 +85,28 @@ struct CGScopeNote : public ScopeNote
- struct CGScopeNoteList {
-     Vector<CGScopeNote> list;
-     explicit CGScopeNoteList(JSContext* cx) : list(cx) {}
- 
-     MOZ_MUST_USE bool append(uint32_t scopeIndex, uint32_t offset, bool inPrologue,
-                              uint32_t parent);
-     void recordEnd(uint32_t index, uint32_t offset, bool inPrologue);
-     size_t length() const { return list.length(); }
--    void finish(ScopeNoteArray* array, uint32_t prologueLength);
-+    void finish(mozilla::Span<ScopeNote> array, uint32_t prologueLength);
- };
- 
- struct CGYieldAndAwaitOffsetList {
-     Vector<uint32_t> list;
-     uint32_t numYields;
-     uint32_t numAwaits;
-     explicit CGYieldAndAwaitOffsetList(JSContext* cx) : list(cx), numYields(0), numAwaits(0) {}
- 
-     MOZ_MUST_USE bool append(uint32_t offset) { return list.append(offset); }
-     size_t length() const { return list.length(); }
--    void finish(YieldAndAwaitOffsetArray& array, uint32_t prologueLength);
-+    void finish(mozilla::Span<uint32_t> array, uint32_t prologueLength);
- };
- 
- // Have a few inline elements, so as to avoid heap allocation for tiny
- // sequences.  See bug 1390526.
- typedef Vector<jsbytecode, 64> BytecodeVector;
- typedef Vector<jssrcnote, 64> SrcNotesVector;
- 
- // Used to control whether JSOP_CALL_IGNORES_RV is emitted for function calls.
-diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp
---- a/js/src/jit/BaselineBailouts.cpp
-+++ b/js/src/jit/BaselineBailouts.cpp
-@@ -484,49 +484,48 @@ GetNextNonLoopEntryPc(jsbytecode* pc, js
- 
- static bool
- HasLiveStackValueAtDepth(JSScript* script, jsbytecode* pc, uint32_t stackDepth)
- {
-     if (!script->hasTrynotes()) {
-         return false;
-     }
- 
--    JSTryNote* tn = script->trynotes()->vector;
--    JSTryNote* tnEnd = tn + script->trynotes()->length;
-     uint32_t pcOffset = uint32_t(pc - script->main());
--    for (; tn != tnEnd; ++tn) {
--        if (pcOffset < tn->start) {
-+
-+    for (const JSTryNote& tn : script->trynotes()) {
-+        if (pcOffset < tn.start) {
-             continue;
-         }
--        if (pcOffset >= tn->start + tn->length) {
-+        if (pcOffset >= tn.start + tn.length) {
-             continue;
-         }
- 
--        switch (tn->kind) {
-+        switch (tn.kind) {
-           case JSTRY_FOR_IN:
-             // For-in loops have only the iterator on stack.
--            if (stackDepth == tn->stackDepth) {
-+            if (stackDepth == tn.stackDepth) {
-                 return true;
-             }
-             break;
- 
-           case JSTRY_FOR_OF:
-             // For-of loops have the iterator, its next method and the
-             // result.value on stack.
-             // The iterator is below the result.value, the next method below
-             // the iterator.
--            if (stackDepth == tn->stackDepth - 1 || stackDepth == tn->stackDepth - 2) {
-+            if (stackDepth == tn.stackDepth - 1 || stackDepth == tn.stackDepth - 2) {
-                 return true;
-             }
-             break;
- 
-           case JSTRY_DESTRUCTURING_ITERCLOSE:
-             // Destructuring code that need to call IteratorClose have both
-             // the iterator and the "done" value on the stack.
--            if (stackDepth == tn->stackDepth || stackDepth == tn->stackDepth - 1) {
-+            if (stackDepth == tn.stackDepth || stackDepth == tn.stackDepth - 1) {
-                 return true;
-             }
-             break;
- 
-           default:
-             break;
-         }
-     }
-diff --git a/js/src/jit/BytecodeAnalysis.cpp b/js/src/jit/BytecodeAnalysis.cpp
---- a/js/src/jit/BytecodeAnalysis.cpp
-+++ b/js/src/jit/BytecodeAnalysis.cpp
-@@ -112,24 +112,22 @@ BytecodeAnalysis::init(TempAllocator& al
-                     infos_[targetOffset].jumpTarget = true;
-                 }
-                 pc2 += JUMP_OFFSET_LEN;
-             }
-             break;
-           }
- 
-           case JSOP_TRY: {
--            JSTryNote* tn = script_->trynotes()->vector;
--            JSTryNote* tnlimit = tn + script_->trynotes()->length;
--            for (; tn < tnlimit; tn++) {
--                unsigned startOffset = script_->mainOffset() + tn->start;
-+            for (const JSTryNote& tn : script_->trynotes()) {
-+                unsigned startOffset = script_->mainOffset() + tn.start;
-                 if (startOffset == offset + 1) {
--                    unsigned catchOffset = startOffset + tn->length;
-+                    unsigned catchOffset = startOffset + tn.length;
- 
--                    if (tn->kind != JSTRY_FOR_IN) {
-+                    if (tn.kind != JSTRY_FOR_IN) {
-                         infos_[catchOffset].init(stackDepth);
-                         infos_[catchOffset].jumpTarget = true;
-                     }
-                 }
-             }
- 
-             // Get the pc of the last instruction in the try block. It's a JSOP_GOTO to
-             // jump over the catch/finally blocks.
-diff --git a/js/src/jit/IonControlFlow.cpp b/js/src/jit/IonControlFlow.cpp
---- a/js/src/jit/IonControlFlow.cpp
-+++ b/js/src/jit/IonControlFlow.cpp
-@@ -559,20 +559,18 @@ ControlFlowGenerator::processLabelEnd(CF
- 
- ControlFlowGenerator::ControlStatus
- ControlFlowGenerator::processTry()
- {
-     MOZ_ASSERT(JSOp(*pc) == JSOP_TRY);
- 
-     // Try-finally is not yet supported.
-     if (!checkedTryFinally_) {
--        JSTryNote* tn = script->trynotes()->vector;
--        JSTryNote* tnlimit = tn + script->trynotes()->length;
--        for (; tn < tnlimit; tn++) {
--            if (tn->kind == JSTRY_FINALLY) {
-+        for (const JSTryNote& tn : script->trynotes()) {
-+            if (tn.kind == JSTRY_FINALLY) {
-                 return ControlStatus::Abort;
-             }
-         }
-         checkedTryFinally_ = true;
-     }
- 
-     jssrcnote* sn = GetSrcNote(gsn, script, pc);
-     MOZ_ASSERT(SN_TYPE(sn) == SRC_TRY);
-diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp
---- a/js/src/jit/JitFrames.cpp
-+++ b/js/src/jit/JitFrames.cpp
-@@ -100,17 +100,17 @@ ReadFrameBooleanSlot(JitFrameLayout* fp,
- static uint32_t
- NumArgAndLocalSlots(const InlineFrameIterator& frame)
- {
-     JSScript* script = frame.script();
-     return CountArgSlots(script, frame.maybeCalleeTemplate()) + script->nfixed();
- }
- 
- static void
--CloseLiveIteratorIon(JSContext* cx, const InlineFrameIterator& frame, JSTryNote* tn)
-+CloseLiveIteratorIon(JSContext* cx, const InlineFrameIterator& frame, const JSTryNote* tn)
- {
-     MOZ_ASSERT(tn->kind == JSTRY_FOR_IN ||
-                tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE);
- 
-     bool isDestructuring = tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE;
-     MOZ_ASSERT_IF(!isDestructuring, tn->stackDepth > 0);
-     MOZ_ASSERT_IF(isDestructuring, tn->stackDepth > 1);
- 
-@@ -218,17 +218,17 @@ HandleExceptionIon(JSContext* cx, const 
-     RootedScript script(cx, frame.script());
-     if (!script->hasTrynotes()) {
-         return;
-     }
- 
-     bool inForOfIterClose = false;
- 
-     for (TryNoteIterIon tni(cx, frame); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
- 
-         switch (tn->kind) {
-           case JSTRY_FOR_IN:
-           case JSTRY_DESTRUCTURING_ITERCLOSE:
-             // See corresponding comment in ProcessTryNotes.
-             if (inForOfIterClose) {
-                 break;
-             }
-@@ -300,27 +300,27 @@ OnLeaveBaselineFrame(JSContext* cx, cons
- static inline void
- ForcedReturn(JSContext* cx, const JSJitFrameIter& frame, jsbytecode* pc,
-              ResumeFromException* rfe)
- {
-     OnLeaveBaselineFrame(cx, frame, pc, rfe, true);
- }
- 
- static inline void
--BaselineFrameAndStackPointersFromTryNote(JSTryNote* tn, const JSJitFrameIter& frame,
-+BaselineFrameAndStackPointersFromTryNote(const JSTryNote* tn, const JSJitFrameIter& frame,
-                                          uint8_t** framePointer, uint8_t** stackPointer)
- {
-     JSScript* script = frame.baselineFrame()->script();
-     *framePointer = frame.fp() - BaselineFrame::FramePointerOffset;
-     *stackPointer = *framePointer - BaselineFrame::Size() -
-                     (script->nfixed() + tn->stackDepth) * sizeof(Value);
- }
- 
- static void
--SettleOnTryNote(JSContext* cx, JSTryNote* tn, const JSJitFrameIter& frame,
-+SettleOnTryNote(JSContext* cx, const JSTryNote* tn, const JSJitFrameIter& frame,
-                 EnvironmentIter& ei, ResumeFromException* rfe, jsbytecode** pc)
- {
-     RootedScript script(cx, frame.baselineFrame()->script());
- 
-     // Unwind environment chain (pop block objects).
-     if (cx->isExceptionPending()) {
-         UnwindEnvironment(cx, ei, UnwindEnvironmentToTryPc(script, tn));
-     }
-@@ -371,17 +371,17 @@ class TryNoteIterBaseline : public TryNo
- // Close all live iterators on a BaselineFrame due to exception unwinding. The
- // pc parameter is updated to where the envs have been unwound to.
- static void
- CloseLiveIteratorsBaselineForUncatchableException(JSContext* cx, const JSJitFrameIter& frame,
-                                                   jsbytecode* pc)
- {
-     bool inForOfIterClose = false;
-     for (TryNoteIterBaseline tni(cx, frame.baselineFrame(), pc); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
-         switch (tn->kind) {
-           case JSTRY_FOR_IN: {
-             // See corresponding comment in ProcessTryNotes.
-             if (inForOfIterClose) {
-                 break;
-             }
- 
-             uint8_t* framePointer;
-@@ -410,17 +410,17 @@ CloseLiveIteratorsBaselineForUncatchable
- static bool
- ProcessTryNotesBaseline(JSContext* cx, const JSJitFrameIter& frame, EnvironmentIter& ei,
-                         ResumeFromException* rfe, jsbytecode** pc)
- {
-     RootedScript script(cx, frame.baselineFrame()->script());
-     bool inForOfIterClose = false;
- 
-     for (TryNoteIterBaseline tni(cx, frame.baselineFrame(), *pc); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
- 
-         MOZ_ASSERT(cx->isExceptionPending());
-         switch (tn->kind) {
-           case JSTRY_CATCH: {
-             // If we're closing a legacy generator, we have to skip catch
-             // blocks.
-             if (cx->isClosingGenerator()) {
-                 break;
-diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
---- a/js/src/shell/js.cpp
-+++ b/js/src/shell/js.cpp
-@@ -3067,63 +3067,59 @@ TryNotes(JSContext* cx, HandleScript scr
-     if (!script->hasTrynotes()) {
-         return true;
-     }
- 
-     if (!sp->put("\nException table:\nkind               stack    start      end\n")) {
-         return false;
-     }
- 
--    JSTryNote* tn = script->trynotes()->vector;
--    JSTryNote* tnlimit = tn + script->trynotes()->length;
--    do {
--        uint32_t startOff = script->pcToOffset(script->main()) + tn->start;
-+    for (const JSTryNote& tn : script->trynotes()) {
-+        uint32_t startOff = script->pcToOffset(script->main()) + tn.start;
-         if (!sp->jsprintf(" %-16s %6u %8u %8u\n",
--                          TryNoteName(static_cast<JSTryNoteKind>(tn->kind)),
--                          tn->stackDepth, startOff, startOff + tn->length))
-+                          TryNoteName(static_cast<JSTryNoteKind>(tn.kind)),
-+                          tn.stackDepth, startOff, startOff + tn.length))
-         {
-             return false;
-         }
--    } while (++tn != tnlimit);
-+    }
-     return true;
- }
- 
- static MOZ_MUST_USE bool
- ScopeNotes(JSContext* cx, HandleScript script, Sprinter* sp)
- {
-     if (!script->hasScopeNotes()) {
-         return true;
-     }
- 
-     if (!sp->put("\nScope notes:\n   index   parent    start      end\n")) {
-         return false;
-     }
- 
--    ScopeNoteArray* notes = script->scopeNotes();
--    for (uint32_t i = 0; i < notes->length; i++) {
--        const ScopeNote* note = &notes->vector[i];
--        if (note->index == ScopeNote::NoScopeIndex) {
-+    for (const ScopeNote& note : script->scopeNotes()) {
-+        if (note.index == ScopeNote::NoScopeIndex) {
-             if (!sp->jsprintf("%8s ", "(none)")) {
-                 return false;
-             }
-         } else {
--            if (!sp->jsprintf("%8u ", note->index)) {
--                return false;
--            }
--        }
--        if (note->parent == ScopeNote::NoScopeIndex) {
-+            if (!sp->jsprintf("%8u ", note.index)) {
-+                return false;
-+            }
-+        }
-+        if (note.parent == ScopeNote::NoScopeIndex) {
-             if (!sp->jsprintf("%8s ", "(none)")) {
-                 return false;
-             }
-         } else {
--            if (!sp->jsprintf("%8u ", note->parent)) {
--                return false;
--            }
--        }
--        if (!sp->jsprintf("%8u %8u\n", note->start, note->start + note->length)) {
-+            if (!sp->jsprintf("%8u ", note.parent)) {
-+                return false;
-+            }
-+        }
-+        if (!sp->jsprintf("%8u %8u\n", note.start, note.start + note.length)) {
-             return false;
-         }
-     }
-     return true;
- }
- 
- static MOZ_MUST_USE bool
- DisassembleScript(JSContext* cx, HandleScript script, HandleFunction fun,
-@@ -3184,19 +3180,17 @@ DisassembleScript(JSContext* cx, HandleS
-     if (!TryNotes(cx, script, sp)) {
-         return false;
-     }
-     if (!ScopeNotes(cx, script, sp)) {
-         return false;
-     }
- 
-     if (recursive && script->hasObjects()) {
--        ObjectArray* objects = script->objects();
--        for (unsigned i = 0; i != objects->length; ++i) {
--            JSObject* obj = objects->vector[i];
-+        for (JSObject* obj : script->objects()) {
-             if (obj->is<JSFunction>()) {
-                 if (!sp->put("\n")) {
-                     return false;
-                 }
- 
-                 RootedFunction fun(cx, &obj->as<JSFunction>());
-                 if (fun->isInterpreted()) {
-                     RootedScript script(cx, JSFunction::getOrCreateScript(cx, fun));
-diff --git a/js/src/vm/BytecodeUtil.cpp b/js/src/vm/BytecodeUtil.cpp
---- a/js/src/vm/BytecodeUtil.cpp
-+++ b/js/src/vm/BytecodeUtil.cpp
-@@ -8,16 +8,17 @@
-  * JS bytecode descriptors, disassemblers, and (expression) decompilers.
-  */
- 
- #include "vm/BytecodeUtil-inl.h"
- 
- #define __STDC_FORMAT_MACROS
- 
- #include "mozilla/Attributes.h"
-+#include "mozilla/ReverseIterator.h"
- #include "mozilla/Sprintf.h"
- #include "mozilla/Vector.h"
- 
- #include <algorithm>
- #include <ctype.h>
- #include <inttypes.h>
- #include <stdio.h>
- #include <string.h>
-@@ -940,29 +941,27 @@ BytecodeParser::parse()
-             break;
-           }
- 
-           case JSOP_TRY: {
-             // Everything between a try and corresponding catch or finally is conditional.
-             // Note that there is no problem with code which is skipped by a thrown
-             // exception but is not caught by a later handler in the same function:
-             // no more code will execute, and it does not matter what is defined.
--            JSTryNote* tn = script_->trynotes()->vector;
--            JSTryNote* tnlimit = tn + script_->trynotes()->length;
--            for (; tn < tnlimit; tn++) {
--                uint32_t startOffset = script_->mainOffset() + tn->start;
-+            for (const JSTryNote& tn : script_->trynotes()) {
-+                uint32_t startOffset = script_->mainOffset() + tn.start;
-                 if (startOffset == offset + 1) {
--                    uint32_t catchOffset = startOffset + tn->length;
--                    if (tn->kind == JSTRY_CATCH) {
-+                    uint32_t catchOffset = startOffset + tn.length;
-+                    if (tn.kind == JSTRY_CATCH) {
-                         if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack,
-                                      pc, JumpKind::TryCatch))
-                         {
-                             return false;
-                         }
--                    } else if (tn->kind == JSTRY_FINALLY) {
-+                    } else if (tn.kind == JSTRY_FINALLY) {
-                         if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack,
-                                      pc, JumpKind::TryFinally))
-                         {
-                             return false;
-                         }
-                     }
-                 }
-             }
-@@ -1450,25 +1449,22 @@ Disassemble1(JSContext* cx, HandleScript
-     int i;
-     switch (JOF_TYPE(cs->format)) {
-       case JOF_BYTE:
-           // Scan the trynotes to find the associated catch block
-           // and make the try opcode look like a jump instruction
-           // with an offset. This simplifies code coverage analysis
-           // based on this disassembled output.
-           if (op == JSOP_TRY) {
--              TryNoteArray* trynotes = script->trynotes();
--              uint32_t i;
-               size_t mainOffset = script->mainOffset();
--              for(i = 0; i < trynotes->length; i++) {
--                  JSTryNote note = trynotes->vector[i];
--                  if (note.kind == JSTRY_CATCH && note.start + mainOffset == loc + 1) {
-+              for (const JSTryNote& tn : script->trynotes()) {
-+                  if (tn.kind == JSTRY_CATCH && tn.start + mainOffset == loc + 1) {
-                       if (!sp->jsprintf(" %u (%+d)",
--                                        unsigned(loc + note.length + 1),
--                                        int(note.length + 1)))
-+                                        unsigned(loc + tn.length + 1),
-+                                        int(tn.length + 1)))
-                       {
-                           return 0;
-                       }
-                       break;
-                   }
-               }
-           }
-         break;
-@@ -3115,20 +3111,18 @@ GenerateLcovInfo(JSContext* cx, JS::Real
- 
-             // Iterate from the last to the first object in order to have
-             // the functions them visited in the opposite order when popping
-             // elements from the stack of remaining scripts, such that the
-             // functions are more-less listed with increasing line numbers.
-             if (!script->hasObjects()) {
-                 continue;
-             }
--            size_t idx = script->objects()->length;
--            while (idx--) {
--                JSObject* obj = script->getObject(idx);
--
-+            auto objects = script->objects();
-+            for (JSObject* obj : mozilla::Reversed(objects)) {
-                 // Only continue on JSFunction objects.
-                 if (!obj->is<JSFunction>()) {
-                     continue;
-                 }
-                 fun = &obj->as<JSFunction>();
- 
-                 // Let's skip wasm for now.
-                 if (!fun->isInterpreted()) {
-diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
---- a/js/src/vm/Debugger.cpp
-+++ b/js/src/vm/Debugger.cpp
-@@ -6233,22 +6233,20 @@ DebuggerScript_getChildScripts(JSContext
-     if (!result) {
-         return false;
-     }
-     if (script->hasObjects()) {
-         // script->savedCallerFun indicates that this is a direct eval script
-         // and the calling function is stored as script->objects()->vector[0].
-         // It is not really a child script of this script, so skip it using
-         // innerObjectsStart().
--        ObjectArray* objects = script->objects();
-         RootedFunction fun(cx);
-         RootedScript funScript(cx);
--        RootedObject obj(cx), s(cx);
--        for (uint32_t i = 0; i < objects->length; i++) {
--            obj = objects->vector[i];
-+        RootedObject s(cx);
-+        for (const GCPtrObject& obj : script->objects()) {
-             if (obj->is<JSFunction>()) {
-                 fun = &obj->as<JSFunction>();
-                 // The inner function could be a wasm native.
-                 if (fun->isNative()) {
-                     continue;
-                 }
-                 funScript = GetOrCreateFunctionScript(cx, fun);
-                 if (!funScript) {
-@@ -6424,23 +6422,21 @@ class FlowGraphSummary {
-                     pc += step;
-                 }
-             } else if (op == JSOP_TRY) {
-                 // As there is no literal incoming edge into the catch block, we
-                 // make a fake one by copying the JSOP_TRY location, as-if this
-                 // was an incoming edge of the catch block. This is needed
-                 // because we only report offsets of entry points which have
-                 // valid incoming edges.
--                JSTryNote* tn = script->trynotes()->vector;
--                JSTryNote* tnlimit = tn + script->trynotes()->length;
--                for (; tn < tnlimit; tn++) {
--                    uint32_t startOffset = script->mainOffset() + tn->start;
-+                for (const JSTryNote& tn : script->trynotes()) {
-+                    uint32_t startOffset = script->mainOffset() + tn.start;
-                     if (startOffset == r.frontOffset() + 1) {
--                        uint32_t catchOffset = startOffset + tn->length;
--                        if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) {
-+                        uint32_t catchOffset = startOffset + tn.length;
-+                        if (tn.kind == JSTRY_CATCH || tn.kind == JSTRY_FINALLY) {
-                             addEdge(lineno, column, catchOffset);
-                         }
-                     }
-                 }
-             }
- 
-             prevLineno = lineno;
-             prevColumn = column;
-@@ -7450,27 +7446,24 @@ class DebuggerScriptIsInCatchScopeMatche
-             return false;
-         }
- 
-         // Try note ranges are relative to the mainOffset of the script, so adjust
-         // offset accordingly.
-         size_t offset = offset_ - script->mainOffset();
- 
-         if (script->hasTrynotes()) {
--            JSTryNote* tnBegin = script->trynotes()->vector;
--            JSTryNote* tnEnd = tnBegin + script->trynotes()->length;
--            while (tnBegin != tnEnd) {
--                if (tnBegin->start <= offset &&
--                    offset <= tnBegin->start + tnBegin->length &&
--                    tnBegin->kind == JSTRY_CATCH)
-+            for (const JSTryNote& tn : script->trynotes()) {
-+                if (tn.start <= offset &&
-+                    offset <= tn.start + tn.length &&
-+                    tn.kind == JSTRY_CATCH)
-                 {
-                     isInCatch_ = true;
-                     return true;
-                 }
--                ++tnBegin;
-             }
-         }
-         isInCatch_ = false;
-         return true;
-     }
-     ReturnType match(Handle<LazyScript*> lazyScript) {
-         RootedScript script(cx_, DelazifyScript(cx_, lazyScript));
-         if (!script) {
-diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp
---- a/js/src/vm/EnvironmentObject.cpp
-+++ b/js/src/vm/EnvironmentObject.cpp
-@@ -3907,21 +3907,19 @@ RemoveReferencedNames(JSContext* cx, Han
-         }
- 
-         if (name) {
-             remainingNames.remove(name);
-         }
-     }
- 
-     if (script->hasObjects()) {
--        ObjectArray* objects = script->objects();
-         RootedFunction fun(cx);
-         RootedScript innerScript(cx);
--        for (size_t i = 0; i < objects->length; i++) {
--            JSObject* obj = objects->vector[i];
-+        for (JSObject* obj : script->objects()) {
-             if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpreted()) {
-                 fun = &obj->as<JSFunction>();
-                 innerScript = JSFunction::getOrCreateScript(cx, fun);
-                 if (!innerScript) {
-                     return false;
-                 }
- 
-                 if (!RemoveReferencedNames(cx, innerScript, remainingNames)) {
-@@ -3979,21 +3977,19 @@ AnalyzeEntrainedVariablesInScript(JSCont
-             buf.printf(" ");
-             buf.putString(r.front());
-         }
- 
-         printf("%s\n", buf.string());
-     }
- 
-     if (innerScript->hasObjects()) {
--        ObjectArray* objects = innerScript->objects();
-         RootedFunction fun(cx);
-         RootedScript innerInnerScript(cx);
--        for (size_t i = 0; i < objects->length; i++) {
--            JSObject* obj = objects->vector[i];
-+        for (JSObject* obj : script->objects()) {
-             if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpreted()) {
-                 fun = &obj->as<JSFunction>();
-                 innerInnerScript = JSFunction::getOrCreateScript(cx, fun);
-                 if (!innerInnerScript ||
-                     !AnalyzeEntrainedVariablesInScript(cx, script, innerInnerScript))
-                 {
-                     return false;
-                 }
-@@ -4017,21 +4013,19 @@ AnalyzeEntrainedVariablesInScript(JSCont
- // |bar| unnecessarily entrains |b|, and |baz| unnecessarily entrains |a|.
- bool
- js::AnalyzeEntrainedVariables(JSContext* cx, HandleScript script)
- {
-     if (!script->hasObjects()) {
-         return true;
-     }
- 
--    ObjectArray* objects = script->objects();
-     RootedFunction fun(cx);
-     RootedScript innerScript(cx);
--    for (size_t i = 0; i < objects->length; i++) {
--        JSObject* obj = objects->vector[i];
-+    for (JSObject* obj : script->objects()) {
-         if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpreted()) {
-             fun = &obj->as<JSFunction>();
-             innerScript = JSFunction::getOrCreateScript(cx, fun);
-             if (!innerScript) {
-                 return false;
-             }
- 
-             if (script->functionDelazifying() && script->functionDelazifying()->needsCallObject()) {
-diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
---- a/js/src/vm/Interpreter.cpp
-+++ b/js/src/vm/Interpreter.cpp
-@@ -1298,17 +1298,17 @@ js::UnwindAllEnvironmentsInFrame(JSConte
- // block. We cannot unwind to *after* the JSOP_TRY, because that might be the
- // first opcode of an inner scope, with the same problem as above. e.g.,
- //
- // try { { let x; } }
- //
- // will have no pc location distinguishing the try block scope from the inner
- // let block scope.
- jsbytecode*
--js::UnwindEnvironmentToTryPc(JSScript* script, JSTryNote* tn)
-+js::UnwindEnvironmentToTryPc(JSScript* script, const JSTryNote* tn)
- {
-     jsbytecode* pc = script->main() + tn->start;
-     if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) {
-         pc -= JSOP_TRY_LENGTH;
-         MOZ_ASSERT(*pc == JSOP_TRY);
-     } else if (tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE) {
-         pc -= JSOP_TRY_DESTRUCTURING_ITERCLOSE_LENGTH;
-         MOZ_ASSERT(*pc == JSOP_TRY_DESTRUCTURING_ITERCLOSE);
-@@ -1322,17 +1322,17 @@ ForcedReturn(JSContext* cx, InterpreterR
-     bool ok = Debugger::onLeaveFrame(cx, regs.fp(), regs.pc, true);
-     // Point the frame to the end of the script, regardless of error. The
-     // caller must jump to the correct continuation depending on 'ok'.
-     regs.setToEndOfScript();
-     return ok;
- }
- 
- static void
--SettleOnTryNote(JSContext* cx, JSTryNote* tn, EnvironmentIter& ei, InterpreterRegs& regs)
-+SettleOnTryNote(JSContext* cx, const JSTryNote* tn, EnvironmentIter& ei, InterpreterRegs& regs)
- {
-     // Unwind the environment to the beginning of the JSOP_TRY.
-     UnwindEnvironment(cx, ei, UnwindEnvironmentToTryPc(regs.fp()->script(), tn));
- 
-     // Set pc to the first bytecode after the the try note to point
-     // to the beginning of catch or finally.
-     regs.pc = regs.fp()->script()->main() + tn->start + tn->length;
-     regs.sp = regs.spForStackDepth(tn->stackDepth);
-@@ -1358,17 +1358,17 @@ class TryNoteIterInterpreter : public Tr
- 
- static void
- UnwindIteratorsForUncatchableException(JSContext* cx, const InterpreterRegs& regs)
- {
-     // c.f. the regular (catchable) TryNoteIterInterpreter loop in
-     // ProcessTryNotes.
-     bool inForOfIterClose = false;
-     for (TryNoteIterInterpreter tni(cx, regs); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
-         switch (tn->kind) {
-           case JSTRY_FOR_IN: {
-             // See corresponding comment in ProcessTryNotes.
-             if (inForOfIterClose) {
-                 break;
-             }
- 
-             Value* sp = regs.spForStackDepth(tn->stackDepth);
-@@ -1398,17 +1398,17 @@ enum HandleErrorContinuation
-     FinallyContinuation
- };
- 
- static HandleErrorContinuation
- ProcessTryNotes(JSContext* cx, EnvironmentIter& ei, InterpreterRegs& regs)
- {
-     bool inForOfIterClose = false;
-     for (TryNoteIterInterpreter tni(cx, regs); !tni.done(); ++tni) {
--        JSTryNote* tn = *tni;
-+        const JSTryNote* tn = *tni;
- 
-         switch (tn->kind) {
-           case JSTRY_CATCH:
-             /* Catch cannot intercept the closing of a generator. */
-             if (cx->isClosingGenerator()) {
-                 break;
-             }
- 
-diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h
---- a/js/src/vm/Interpreter.h
-+++ b/js/src/vm/Interpreter.h
-@@ -340,27 +340,28 @@ UnwindEnvironment(JSContext* cx, Environ
- 
- // Unwind all environments.
- extern void
- UnwindAllEnvironmentsInFrame(JSContext* cx, EnvironmentIter& ei);
- 
- // Compute the pc needed to unwind the scope to the beginning of the block
- // pointed to by the try note.
- extern jsbytecode*
--UnwindEnvironmentToTryPc(JSScript* script, JSTryNote* tn);
-+UnwindEnvironmentToTryPc(JSScript* script, const JSTryNote* tn);
- 
- template <class StackDepthOp>
- class MOZ_STACK_CLASS TryNoteIter
- {
-     RootedScript script_;
-     uint32_t pcOffset_;
--    JSTryNote* tn_;
--    JSTryNote* tnEnd_;
-     StackDepthOp getStackDepth_;
- 
-+    const JSTryNote* tn_;
-+    const JSTryNote* tnEnd_;
-+
-     void settle() {
-         for (; tn_ != tnEnd_; ++tn_) {
-             /* If pc is out of range, try the next one. */
-             if (pcOffset_ - tn_->start >= tn_->length) {
-                 continue;
-             }
- 
-             /*
-@@ -391,31 +392,34 @@ class MOZ_STACK_CLASS TryNoteIter
-   public:
-     TryNoteIter(JSContext* cx, JSScript* script, jsbytecode* pc,
-                 StackDepthOp getStackDepth)
-       : script_(cx, script),
-         pcOffset_(pc - script->main()),
-         getStackDepth_(getStackDepth)
-     {
-         if (script->hasTrynotes()) {
--            tn_ = script->trynotes()->vector;
--            tnEnd_ = tn_ + script->trynotes()->length;
-+            // NOTE: The Span is a temporary so we can't use begin()/end()
-+            // here or the iterator will outlive the span.
-+            auto trynotes = script->trynotes();
-+            tn_ = trynotes.data();
-+            tnEnd_ = tn_ + trynotes.size();
-         } else {
-             tn_ = tnEnd_ = nullptr;
-         }
-         settle();
-     }
- 
-     void operator++() {
-         ++tn_;
-         settle();
-     }
- 
-     bool done() const { return tn_ == tnEnd_; }
--    JSTryNote* operator*() const { return tn_; }
-+    const JSTryNote* operator*() const { return tn_; }
- };
- 
- bool
- HandleClosingGeneratorReturn(JSContext* cx, AbstractFramePtr frame, bool ok);
- 
- /************************************************************************/
- 
- bool
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -299,21 +299,20 @@ XDRRelazificationInfo(XDRState<mode>* xd
-     // have any.
- 
-     return Ok();
- }
- 
- static inline uint32_t
- FindScopeIndex(JSScript* script, Scope& scope)
- {
--    ScopeArray* scopes = script->scopes();
--    GCPtrScope* vector = scopes->vector;
--    unsigned length = scopes->length;
-+    auto scopes = script->scopes();
-+    unsigned length = scopes.size();
-     for (uint32_t i = 0; i < length; ++i) {
--        if (vector[i] == &scope) {
-+        if (scopes[i] == &scope) {
-             return i;
-         }
-     }
- 
-     MOZ_CRASH("Scope not found");
- }
- 
- enum XDRClassKind {
-@@ -353,17 +352,17 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         HasNonSyntacticScope,
-         HasInnerFunctions,
-         NeedsHomeObject,
-         IsDerivedClassConstructor,
-         IsDefaultClassConstructor,
-     };
- 
-     uint32_t length, lineno, column, nfixed, nslots;
--    uint32_t natoms, nsrcnotes, i;
-+    uint32_t natoms, nsrcnotes;
-     uint32_t nconsts, nobjects, nscopes, nregexps, ntrynotes, nscopenotes, nyieldoffsets;
-     uint32_t prologueLength;
-     uint32_t funLength = 0;
-     uint32_t nTypeSets = 0;
-     uint32_t scriptBits = 0;
-     uint32_t bodyScopeIndex = 0;
- 
-     JSContext* cx = xdr->cx();
-@@ -403,30 +402,30 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         nslots = script->nslots();
- 
-         bodyScopeIndex = script->bodyScopeIndex();
-         natoms = script->natoms();
- 
-         nsrcnotes = script->numNotes();
- 
-         if (script->hasConsts()) {
--            nconsts = script->consts()->length;
-+            nconsts = script->consts().size();
-         }
-         if (script->hasObjects()) {
--            nobjects = script->objects()->length;
-+            nobjects = script->objects().size();
-         }
--        nscopes = script->scopes()->length;
-+        nscopes = script->scopes().size();
-         if (script->hasTrynotes()) {
--            ntrynotes = script->trynotes()->length;
-+            ntrynotes = script->trynotes().size();
-         }
-         if (script->hasScopeNotes()) {
--            nscopenotes = script->scopeNotes()->length;
-+            nscopenotes = script->scopeNotes().size();
-         }
-         if (script->hasYieldAndAwaitOffsets()) {
--            nyieldoffsets = script->yieldAndAwaitOffsets().length();
-+            nyieldoffsets = script->yieldAndAwaitOffsets().size();
-         }
- 
-         nTypeSets = script->nTypeSets();
-         funLength = script->funLength();
- 
-         if (script->noScriptRval()) {
-             scriptBits |= (1 << NoScriptRval);
-         }
-@@ -699,17 +698,17 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-             script->freeScriptData();
-         }
-     });
- 
-     jsbytecode* code = script->code();
-     MOZ_TRY(xdr->codeBytes(code, length));
-     MOZ_TRY(xdr->codeBytes(code + length, nsrcnotes));
- 
--    for (i = 0; i != natoms; ++i) {
-+    for (uint32_t i = 0; i != natoms; ++i) {
-         if (mode == XDR_DECODE) {
-             RootedAtom tmp(cx);
-             MOZ_TRY(XDRAtom(xdr, &tmp));
-             script->atoms()[i].init(tmp);
-         } else {
-             RootedAtom tmp(cx, script->atoms()[i]);
-             MOZ_TRY(XDRAtom(xdr, &tmp));
-         }
-@@ -718,37 +717,36 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-     scriptDataGuard.release();
-     if (mode == XDR_DECODE) {
-         if (!script->shareScriptData(cx)) {
-             return xdr->fail(JS::TranscodeResult_Throw);
-         }
-     }
- 
-     if (nconsts) {
--        GCPtrValue* vector = script->consts()->vector;
-         RootedValue val(cx);
--        for (i = 0; i != nconsts; ++i) {
-+        for (GCPtrValue& elem : script->consts()) {
-             if (mode == XDR_ENCODE) {
--                val = vector[i];
-+                val = elem.get();
-             }
-             MOZ_TRY(XDRScriptConst(xdr, &val));
-             if (mode == XDR_DECODE) {
--                vector[i].init(val);
-+                elem.init(val);
-             }
-         }
-     }
- 
-     {
-         MOZ_ASSERT(nscopes != 0);
--        GCPtrScope* vector = script->scopes()->vector;
-+        GCPtrScope* vector = script->scopes().data();
-         RootedScope scope(cx);
-         RootedScope enclosing(cx);
-         ScopeKind scopeKind;
-         uint32_t enclosingScopeIndex = 0;
--        for (i = 0; i != nscopes; ++i) {
-+        for (uint32_t i = 0; i != nscopes; ++i) {
-             if (mode == XDR_ENCODE) {
-                 scope = vector[i];
-                 scopeKind = scope->kind();
-             } else {
-                 scope = nullptr;
-             }
- 
-             MOZ_TRY(xdr->codeEnum32(&scopeKind));
-@@ -829,128 +827,133 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         MOZ_TRY(xdr->codeMarker(0x48922BAB));
-     }
- 
-     /*
-      * Here looping from 0-to-length to xdr objects is essential to ensure that
-      * all references to enclosing blocks (via FindScopeIndex below) happen
-      * after the enclosing block has been XDR'd.
-      */
--    for (i = 0; i != nobjects; ++i) {
--        GCPtrObject* objp = &script->objects()->vector[i];
--        XDRClassKind classk;
--
--        if (mode == XDR_ENCODE) {
--            JSObject* obj = *objp;
--            if (obj->is<RegExpObject>()) {
--                classk = CK_RegexpObject;
--            } else if (obj->is<JSFunction>()) {
--                classk = CK_JSFunction;
--            } else if (obj->is<PlainObject>() || obj->is<ArrayObject>()) {
--                classk = CK_JSObject;
--            } else {
--                MOZ_CRASH("Cannot encode this class of object.");
--            }
--        }
--
--        MOZ_TRY(xdr->codeEnum32(&classk));
--
--        switch (classk) {
--          case CK_RegexpObject: {
--            Rooted<RegExpObject*> regexp(cx);
--            if (mode == XDR_ENCODE) {
--                regexp = &(*objp)->as<RegExpObject>();
--            }
--            MOZ_TRY(XDRScriptRegExpObject(xdr, &regexp));
--            if (mode == XDR_DECODE) {
--                *objp = regexp;
--            }
--            break;
--          }
--
--          case CK_JSFunction: {
--            /* Code the nested function's enclosing scope. */
--            uint32_t funEnclosingScopeIndex = 0;
--            RootedScope funEnclosingScope(cx);
-+    if (nobjects) {
-+        for (GCPtrObject& elem : script->objects()) {
-+            XDRClassKind classk;
-+
-             if (mode == XDR_ENCODE) {
--                RootedFunction function(cx, &(*objp)->as<JSFunction>());
--
--                if (function->isInterpretedLazy()) {
--                    funEnclosingScope = function->lazyScript()->enclosingScope();
--                } else if (function->isInterpreted()) {
--                    funEnclosingScope = function->nonLazyScript()->enclosingScope();
-+                JSObject* obj = elem.get();
-+                if (obj->is<RegExpObject>()) {
-+                    classk = CK_RegexpObject;
-+                } else if (obj->is<JSFunction>()) {
-+                    classk = CK_JSFunction;
-+                } else if (obj->is<PlainObject>() || obj->is<ArrayObject>()) {
-+                    classk = CK_JSObject;
-                 } else {
--                    MOZ_ASSERT(function->isAsmJSNative());
--                    return xdr->fail(JS::TranscodeResult_Failure_AsmJSNotSupported);
-+                    MOZ_CRASH("Cannot encode this class of object.");
-                 }
--
--                funEnclosingScopeIndex = FindScopeIndex(script, *funEnclosingScope);
--            }
--
--            MOZ_TRY(xdr->codeUint32(&funEnclosingScopeIndex));
--
--            if (mode == XDR_DECODE) {
--                MOZ_ASSERT(funEnclosingScopeIndex < script->scopes()->length);
--                funEnclosingScope = script->scopes()->vector[funEnclosingScopeIndex];
-             }
- 
--            // Code nested function and script.
--            RootedFunction tmp(cx);
--            if (mode == XDR_ENCODE) {
--                tmp = &(*objp)->as<JSFunction>();
-+            MOZ_TRY(xdr->codeEnum32(&classk));
-+
-+            switch (classk) {
-+              case CK_RegexpObject: {
-+                Rooted<RegExpObject*> regexp(cx);
-+                if (mode == XDR_ENCODE) {
-+                    regexp = &elem->as<RegExpObject>();
-+                }
-+                MOZ_TRY(XDRScriptRegExpObject(xdr, &regexp));
-+                if (mode == XDR_DECODE) {
-+                    elem.init(regexp);
-+                }
-+                break;
-+              }
-+
-+              case CK_JSFunction: {
-+                /* Code the nested function's enclosing scope. */
-+                uint32_t funEnclosingScopeIndex = 0;
-+                RootedScope funEnclosingScope(cx);
-+                if (mode == XDR_ENCODE) {
-+                    RootedFunction function(cx, &elem->as<JSFunction>());
-+
-+                    if (function->isInterpretedLazy()) {
-+                        funEnclosingScope = function->lazyScript()->enclosingScope();
-+                    } else if (function->isInterpreted()) {
-+                        funEnclosingScope = function->nonLazyScript()->enclosingScope();
-+                    } else {
-+                        MOZ_ASSERT(function->isAsmJSNative());
-+                        return xdr->fail(JS::TranscodeResult_Failure_AsmJSNotSupported);
-+                    }
-+
-+                    funEnclosingScopeIndex = FindScopeIndex(script, *funEnclosingScope);
-+                }
-+
-+                MOZ_TRY(xdr->codeUint32(&funEnclosingScopeIndex));
-+
-+                if (mode == XDR_DECODE) {
-+                    funEnclosingScope = script->getScope(funEnclosingScopeIndex);
-+                }
-+
-+                // Code nested function and script.
-+                RootedFunction tmp(cx);
-+                if (mode == XDR_ENCODE) {
-+                    tmp = &elem->as<JSFunction>();
-+                }
-+                MOZ_TRY(XDRInterpretedFunction(xdr, funEnclosingScope, sourceObject, &tmp));
-+                if (mode == XDR_DECODE) {
-+                    elem.init(tmp);
-+                }
-+                break;
-+              }
-+
-+              case CK_JSObject: {
-+                /* Code object literal. */
-+                RootedObject tmp(cx);
-+                if (mode == XDR_ENCODE) {
-+                    tmp = elem.get();
-+                }
-+                MOZ_TRY(XDRObjectLiteral(xdr, &tmp));
-+                if (mode == XDR_DECODE) {
-+                    elem.init(tmp);
-+                }
-+                break;
-+              }
-+
-+              default: {
-+                // Fail in debug, but only soft-fail in release
-+                MOZ_ASSERT(false, "Bad XDR class kind");
-+                return xdr->fail(JS::TranscodeResult_Failure_BadDecode);
-+              }
-             }
--            MOZ_TRY(XDRInterpretedFunction(xdr, funEnclosingScope, sourceObject, &tmp));
--            *objp = tmp;
--            break;
--          }
--
--          case CK_JSObject: {
--            /* Code object literal. */
--            RootedObject tmp(cx, *objp);
--            MOZ_TRY(XDRObjectLiteral(xdr, &tmp));
--            *objp = tmp;
--            break;
--          }
--
--          default: {
--            // Fail in debug, but only soft-fail in release
--            MOZ_ASSERT(false, "Bad XDR class kind");
--            return xdr->fail(JS::TranscodeResult_Failure_BadDecode);
--          }
-         }
-     }
- 
-     // Verify marker to detect data corruption after decoding object data. A
-     // mismatch here indicates we will almost certainly crash in release.
-     MOZ_TRY(xdr->codeMarker(0xF83B989A));
- 
--    if (ntrynotes != 0) {
--        JSTryNote* tnfirst = script->trynotes()->vector;
--        MOZ_ASSERT(script->trynotes()->length == ntrynotes);
--        JSTryNote* tn = tnfirst + ntrynotes;
--        do {
--            --tn;
--            MOZ_TRY(xdr->codeUint8(&tn->kind));
--            MOZ_TRY(xdr->codeUint32(&tn->stackDepth));
--            MOZ_TRY(xdr->codeUint32(&tn->start));
--            MOZ_TRY(xdr->codeUint32(&tn->length));
--        } while (tn != tnfirst);
--    }
--
--    for (i = 0; i < nscopenotes; ++i) {
--        ScopeNote* note = &script->scopeNotes()->vector[i];
--        MOZ_TRY(xdr->codeUint32(&note->index));
--        MOZ_TRY(xdr->codeUint32(&note->start));
--        MOZ_TRY(xdr->codeUint32(&note->length));
--        MOZ_TRY(xdr->codeUint32(&note->parent));
--    }
--
--    for (i = 0; i < nyieldoffsets; ++i) {
--        uint32_t* offset = &script->yieldAndAwaitOffsets()[i];
--        MOZ_TRY(xdr->codeUint32(offset));
-+    if (ntrynotes) {
-+        for (JSTryNote& elem : script->trynotes()) {
-+            MOZ_TRY(xdr->codeUint8(&elem.kind));
-+            MOZ_TRY(xdr->codeUint32(&elem.stackDepth));
-+            MOZ_TRY(xdr->codeUint32(&elem.start));
-+            MOZ_TRY(xdr->codeUint32(&elem.length));
-+        }
-+    }
-+
-+    if (nscopenotes) {
-+        for (ScopeNote& elem : script->scopeNotes()) {
-+            MOZ_TRY(xdr->codeUint32(&elem.index));
-+            MOZ_TRY(xdr->codeUint32(&elem.start));
-+            MOZ_TRY(xdr->codeUint32(&elem.length));
-+            MOZ_TRY(xdr->codeUint32(&elem.parent));
-+        }
-+    }
-+
-+    if (nyieldoffsets) {
-+        for (uint32_t& elem : script->yieldAndAwaitOffsets()) {
-+            MOZ_TRY(xdr->codeUint32(&elem));
-+        }
-     }
- 
-     if (scriptBits & (1 << HasLazyScript)) {
-         Rooted<LazyScript*> lazy(cx);
-         if (mode == XDR_ENCODE) {
-             lazy = script->maybeLazyScript();
-         }
- 
-@@ -2962,54 +2965,54 @@ JSScript::partiallyInit(JSContext* cx, H
-     YieldAndAwaitOffsetArray* yieldAndAwaitOffsets = nullptr;
-     if (nyieldoffsets != 0) {
-         yieldAndAwaitOffsets = reinterpret_cast<YieldAndAwaitOffsetArray*>(cursor);
-         cursor += sizeof(YieldAndAwaitOffsetArray);
-     }
- 
-     if (nconsts != 0) {
-         MOZ_ASSERT(reinterpret_cast<uintptr_t>(cursor) % sizeof(JS::Value) == 0);
--        script->consts()->length = nconsts;
--        script->consts()->vector = (GCPtrValue*)cursor;
--        cursor += nconsts * sizeof(script->consts()->vector[0]);
--    }
--
--    script->scopes()->length = nscopes;
--    script->scopes()->vector = (GCPtrScope*)cursor;
--    cursor += nscopes * sizeof(script->scopes()->vector[0]);
-+        script->constsRaw()->length = nconsts;
-+        script->constsRaw()->vector = (GCPtrValue*)cursor;
-+        cursor += nconsts * sizeof(script->constsRaw()->vector[0]);
-+    }
-+
-+    script->scopesRaw()->length = nscopes;
-+    script->scopesRaw()->vector = (GCPtrScope*)cursor;
-+    cursor += nscopes * sizeof(script->scopesRaw()->vector[0]);
- 
-     if (nobjects != 0) {
--        script->objects()->length = nobjects;
--        script->objects()->vector = (GCPtrObject*)cursor;
--        cursor += nobjects * sizeof(script->objects()->vector[0]);
-+        script->objectsRaw()->length = nobjects;
-+        script->objectsRaw()->vector = (GCPtrObject*)cursor;
-+        cursor += nobjects * sizeof(script->objectsRaw()->vector[0]);
-     }
- 
-     if (ntrynotes != 0) {
--        script->trynotes()->length = ntrynotes;
--        script->trynotes()->vector = reinterpret_cast<JSTryNote*>(cursor);
--        size_t vectorSize = ntrynotes * sizeof(script->trynotes()->vector[0]);
-+        script->trynotesRaw()->length = ntrynotes;
-+        script->trynotesRaw()->vector = reinterpret_cast<JSTryNote*>(cursor);
-+        size_t vectorSize = ntrynotes * sizeof(script->trynotesRaw()->vector[0]);
- #ifdef DEBUG
-         memset(cursor, 0, vectorSize);
- #endif
-         cursor += vectorSize;
-     }
- 
-     if (nscopenotes != 0) {
--        script->scopeNotes()->length = nscopenotes;
--        script->scopeNotes()->vector = reinterpret_cast<ScopeNote*>(cursor);
--        size_t vectorSize = nscopenotes * sizeof(script->scopeNotes()->vector[0]);
-+        script->scopeNotesRaw()->length = nscopenotes;
-+        script->scopeNotesRaw()->vector = reinterpret_cast<ScopeNote*>(cursor);
-+        size_t vectorSize = nscopenotes * sizeof(script->scopeNotesRaw()->vector[0]);
- #ifdef DEBUG
-         memset(cursor, 0, vectorSize);
- #endif
-         cursor += vectorSize;
-     }
- 
-     if (nyieldoffsets != 0) {
-         yieldAndAwaitOffsets->init(reinterpret_cast<uint32_t*>(cursor), nyieldoffsets);
--        size_t vectorSize = nyieldoffsets * sizeof(script->yieldAndAwaitOffsets()[0]);
-+        size_t vectorSize = nyieldoffsets * sizeof(script->yieldAndAwaitOffsetsRaw()[0]);
- #ifdef DEBUG
-         memset(cursor, 0, vectorSize);
- #endif
-         cursor += vectorSize;
-     }
- 
-     MOZ_ASSERT(cursor == script->data + size);
-     return true;
-@@ -3034,17 +3037,17 @@ JSScript::initFunctionPrototype(JSContex
-     script->nTypeSets_ = 0;
- 
-     RootedScope enclosing(cx, &cx->global()->emptyGlobalScope());
-     Scope* functionProtoScope = FunctionScope::create(cx, nullptr, false, false, functionProto,
-                                                       enclosing);
-     if (!functionProtoScope) {
-         return false;
-     }
--    script->scopes()->vector[0].init(functionProtoScope);
-+    script->scopesRaw()->vector[0].init(functionProtoScope);
- 
-     uint32_t codeLength = 1;
-     uint32_t srcNotesLength = 1;
-     uint32_t numAtoms = 0;
-     if (!script->createScriptData(cx, codeLength, srcNotesLength, numAtoms)) {
-         return false;
-     }
- 
-@@ -3267,27 +3270,25 @@ JSScript::assertValidJumpTargets() const
-                 MOZ_ASSERT_IF(off, mainEntry <= pc + off && pc + off < end);
-                 MOZ_ASSERT_IF(off, BytecodeIsJumpTarget(JSOp(*(pc + off))));
-             }
-         }
-     }
- 
-     // Check catch/finally blocks as jump targets.
-     if (hasTrynotes()) {
--        JSTryNote* tn = trynotes()->vector;
--        JSTryNote* tnlimit = tn + trynotes()->length;
--        for (; tn < tnlimit; tn++) {
--            jsbytecode* tryStart = mainEntry + tn->start;
-+        for (const JSTryNote& tn : trynotes()) {
-+            jsbytecode* tryStart = mainEntry + tn.start;
-             jsbytecode* tryPc = tryStart - 1;
--            if (tn->kind != JSTRY_CATCH && tn->kind != JSTRY_FINALLY) {
-+            if (tn.kind != JSTRY_CATCH && tn.kind != JSTRY_FINALLY) {
-                 continue;
-             }
- 
-             MOZ_ASSERT(JSOp(*tryPc) == JSOP_TRY);
--            jsbytecode* tryTarget = tryStart + tn->length;
-+            jsbytecode* tryTarget = tryStart + tn.length;
-             MOZ_ASSERT(mainEntry <= tryTarget && tryTarget < end);
-             MOZ_ASSERT(BytecodeIsJumpTarget(JSOp(*tryTarget)));
-         }
-     }
- }
- #endif
- 
- size_t
-@@ -3660,22 +3661,22 @@ js::detail::CopyScript(JSContext* cx, Ha
-         return false;
-     }
- 
-     /* NB: Keep this in sync with XDRScript. */
- 
-     /* Some embeddings are not careful to use ExposeObjectToActiveJS as needed. */
-     MOZ_ASSERT(!src->sourceObject()->isMarkedGray());
- 
--    uint32_t nconsts   = src->hasConsts()   ? src->consts()->length   : 0;
--    uint32_t nobjects  = src->hasObjects()  ? src->objects()->length  : 0;
--    uint32_t nscopes   = src->scopes()->length;
--    uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes()->length : 0;
--    uint32_t nscopenotes = src->hasScopeNotes() ? src->scopeNotes()->length : 0;
--    uint32_t nyieldoffsets = src->hasYieldAndAwaitOffsets() ? src->yieldAndAwaitOffsets().length() : 0;
-+    uint32_t nconsts = src->hasConsts() ? src->consts().size() : 0;
-+    uint32_t nobjects = src->hasObjects() ? src->objects().size() : 0;
-+    uint32_t nscopes = src->scopes().size();
-+    uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes().size() : 0;
-+    uint32_t nscopenotes = src->hasScopeNotes() ? src->scopeNotes().size() : 0;
-+    uint32_t nyieldoffsets = src->hasYieldAndAwaitOffsets() ? src->yieldAndAwaitOffsets().size() : 0;
- 
-     /* Script data */
- 
-     size_t size = src->dataSize();
-     UniquePtr<uint8_t, JS::FreePolicy> data(AllocScriptData(cx, size));
-     if (size && !data) {
-         return false;
-     }
-@@ -3684,37 +3685,35 @@ js::detail::CopyScript(JSContext* cx, Ha
- 
-     // The passed in scopes vector contains body scopes that needed to be
-     // cloned especially, depending on whether the script is a function or
-     // global scope. Starting at scopes.length() means we only deal with
-     // intra-body scopes.
-     {
-         MOZ_ASSERT(nscopes != 0);
-         MOZ_ASSERT(src->bodyScopeIndex() + 1 == scopes.length());
--        GCPtrScope* vector = src->scopes()->vector;
-         RootedScope original(cx);
-         RootedScope clone(cx);
--        for (uint32_t i = scopes.length(); i < nscopes; i++) {
--            original = vector[i];
-+        for (const GCPtrScope& elem : src->scopes().From(scopes.length())) {
-+            original = elem.get();
-             clone = Scope::clone(cx, original, scopes[FindScopeIndex(src, *original->enclosing())]);
-             if (!clone || !scopes.append(clone)) {
-                 return false;
-             }
-         }
-     }
- 
-     /* Objects */
- 
-     AutoObjectVector objects(cx);
-     if (nobjects != 0) {
--        GCPtrObject* vector = src->objects()->vector;
-         RootedObject obj(cx);
-         RootedObject clone(cx);
--        for (unsigned i = 0; i < nobjects; i++) {
--            obj = vector[i];
-+        for (const GCPtrObject& elem : src->objects()) {
-+            obj = elem.get();
-             clone = nullptr;
-             if (obj->is<RegExpObject>()) {
-                 clone = CloneScriptRegExpObject(cx, obj->as<RegExpObject>());
-             } else if (obj->is<JSFunction>()) {
-                 RootedFunction innerFun(cx, &obj->as<JSFunction>());
-                 if (innerFun->isNative()) {
-                     if (cx->compartment() != innerFun->compartment()) {
-                         MOZ_ASSERT(innerFun->isAsmJSNative());
-@@ -3791,45 +3790,45 @@ js::detail::CopyScript(JSContext* cx, Ha
-     dst->bitFields_.isDerivedClassConstructor_ = src->isDerivedClassConstructor();
-     dst->bitFields_.needsHomeObject_ = src->needsHomeObject();
-     dst->bitFields_.isDefaultClassConstructor_ = src->isDefaultClassConstructor();
-     dst->bitFields_.isAsync_ = src->bitFields_.isAsync_;
-     dst->bitFields_.hasRest_ = src->bitFields_.hasRest_;
-     dst->bitFields_.hideScriptFromDebugger_ = src->bitFields_.hideScriptFromDebugger_;
- 
-     if (nconsts != 0) {
--        GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->consts()->vector);
--        dst->consts()->vector = vector;
-+        GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->constsRaw()->vector);
-+        dst->constsRaw()->vector = vector;
-         for (unsigned i = 0; i < nconsts; ++i) {
-             MOZ_ASSERT_IF(vector[i].isGCThing(), vector[i].toString()->isAtom());
-         }
-     }
-     if (nobjects != 0) {
--        GCPtrObject* vector = Rebase<GCPtrObject>(dst, src, src->objects()->vector);
--        dst->objects()->vector = vector;
-+        GCPtrObject* vector = Rebase<GCPtrObject>(dst, src, src->objectsRaw()->vector);
-+        dst->objectsRaw()->vector = vector;
-         for (unsigned i = 0; i < nobjects; ++i) {
-             vector[i].init(&objects[i]->as<NativeObject>());
-         }
-     }
-     {
--        GCPtrScope* vector = Rebase<GCPtrScope>(dst, src, src->scopes()->vector);
--        dst->scopes()->vector = vector;
-+        GCPtrScope* vector = Rebase<GCPtrScope>(dst, src, src->scopesRaw()->vector);
-+        dst->scopesRaw()->vector = vector;
-         for (uint32_t i = 0; i < nscopes; ++i) {
-             vector[i].init(scopes[i]);
-         }
-     }
-     if (ntrynotes != 0) {
--        dst->trynotes()->vector = Rebase<JSTryNote>(dst, src, src->trynotes()->vector);
-+        dst->trynotesRaw()->vector = Rebase<JSTryNote>(dst, src, src->trynotesRaw()->vector);
-     }
-     if (nscopenotes != 0) {
--        dst->scopeNotes()->vector = Rebase<ScopeNote>(dst, src, src->scopeNotes()->vector);
-+        dst->scopeNotesRaw()->vector = Rebase<ScopeNote>(dst, src, src->scopeNotesRaw()->vector);
-     }
-     if (nyieldoffsets != 0) {
--        dst->yieldAndAwaitOffsets().vector_ =
--            Rebase<uint32_t>(dst, src, src->yieldAndAwaitOffsets().vector_);
-+        dst->yieldAndAwaitOffsetsRaw().vector_ =
-+            Rebase<uint32_t>(dst, src, src->yieldAndAwaitOffsetsRaw().vector_);
-     }
- 
-     return true;
- }
- 
- static JSScript*
- CreateEmptyScriptForClone(JSContext* cx, HandleScript src)
- {
-@@ -4168,28 +4167,29 @@ JSScript::traceChildren(JSTracer* trc)
-     MOZ_ASSERT_IF(trc->isMarkingTracer() &&
-                   GCMarker::fromTracer(trc)->shouldCheckCompartments(),
-                   zone()->isCollecting());
- 
-     if (scriptData()) {
-         scriptData()->traceChildren(trc);
-     }
- 
--    if (ScopeArray* scopearray = scopes()) {
--        TraceRange(trc, scopearray->length, scopearray->vector, "scopes");
-+    if (data) {
-+        auto array = scopes();
-+        TraceRange(trc, array.size(), array.data(), "scopes");
-     }
- 
-     if (hasConsts()) {
--        ConstArray* constarray = consts();
--        TraceRange(trc, constarray->length, constarray->vector, "consts");
-+        auto array = consts();
-+        TraceRange(trc, array.size(), array.data(), "consts");
-     }
- 
-     if (hasObjects()) {
--        ObjectArray* objarray = objects();
--        TraceRange(trc, objarray->length, objarray->vector, "objects");
-+        auto array = objects();
-+        TraceRange(trc, array.size(), array.data(), "objects");
-     }
- 
-     MOZ_ASSERT_IF(sourceObject(), MaybeForwarded(sourceObject())->compartment() == compartment());
-     TraceNullableEdge(trc, &sourceObject_, "sourceObject");
- 
-     if (maybeLazyScript()) {
-         TraceManuallyBarrieredEdge(trc, &lazyScript, "lazyScript");
-     }
-@@ -4247,35 +4247,35 @@ JSScript::lookupScope(jsbytecode* pc)
-     MOZ_ASSERT(containsPC(pc));
- 
-     if (!hasScopeNotes()) {
-         return nullptr;
-     }
- 
-     size_t offset = pc - code();
- 
--    ScopeNoteArray* notes = scopeNotes();
-+    auto notes = scopeNotes();
-     Scope* scope = nullptr;
- 
-     // Find the innermost block chain using a binary search.
-     size_t bottom = 0;
--    size_t top = notes->length;
-+    size_t top = notes.size();
- 
-     while (bottom < top) {
-         size_t mid = bottom + (top - bottom) / 2;
--        const ScopeNote* note = &notes->vector[mid];
-+        const ScopeNote* note = &notes[mid];
-         if (note->start <= offset) {
-             // Block scopes are ordered in the list by their starting offset, and since
-             // blocks form a tree ones earlier in the list may cover the pc even if
-             // later blocks end before the pc. This only happens when the earlier block
-             // is a parent of the later block, so we need to check parents of |mid| in
-             // the searched range for coverage.
-             size_t check = mid;
-             while (check >= bottom) {
--                const ScopeNote* checkNote = &notes->vector[check];
-+                const ScopeNote* checkNote = &notes[check];
-                 MOZ_ASSERT(checkNote->start <= offset);
-                 if (offset < checkNote->start + checkNote->length) {
-                     // We found a matching block chain but there may be inner ones
-                     // at a higher block chain index than mid. Continue the binary search.
-                     if (checkNote->index == ScopeNote::NoScopeIndex) {
-                         scope = nullptr;
-                     } else {
-                         scope = getScope(checkNote->index);
-@@ -4719,20 +4719,18 @@ JSScript::updateJitCodeRaw(JSRuntime* rt
- }
- 
- bool
- JSScript::hasLoops()
- {
-     if (!hasTrynotes()) {
-         return false;
-     }
--    JSTryNote* tn = trynotes()->vector;
--    JSTryNote* tnlimit = tn + trynotes()->length;
--    for (; tn < tnlimit; tn++) {
--        switch (tn->kind) {
-+    for (const JSTryNote& tn : trynotes()) {
-+        switch (tn.kind) {
-           case JSTRY_FOR_IN:
-           case JSTRY_FOR_OF:
-           case JSTRY_LOOP:
-             return true;
-           case JSTRY_CATCH:
-           case JSTRY_FINALLY:
-           case JSTRY_FOR_OF_ITERCLOSE:
-           case JSTRY_DESTRUCTURING_ITERCLOSE:
-diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h
---- a/js/src/vm/JSScript.h
-+++ b/js/src/vm/JSScript.h
-@@ -8,16 +8,17 @@
- 
- #ifndef vm_JSScript_h
- #define vm_JSScript_h
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/Atomics.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/MemoryReporting.h"
-+#include "mozilla/Span.h"
- #include "mozilla/Variant.h"
- 
- #include "jstypes.h"
- 
- #include "frontend/NameAnalysisTypes.h"
- #include "gc/Barrier.h"
- #include "gc/Rooting.h"
- #include "jit/IonCode.h"
-@@ -1820,28 +1821,26 @@ class JSScript : public js::gc::TenuredC
- 
-     bool functionHasExtraBodyVarScope() const {
-         MOZ_ASSERT_IF(bitFields_.functionHasExtraBodyVarScope_, functionHasParameterExprs());
-         return bitFields_.functionHasExtraBodyVarScope_;
-     }
- 
-     js::VarScope* functionExtraBodyVarScope() const {
-         MOZ_ASSERT(functionHasExtraBodyVarScope());
--        for (uint32_t i = 0; i < scopes()->length; i++) {
--            js::Scope* scope = getScope(i);
-+        for (js::Scope* scope : scopes()) {
-             if (scope->kind() == js::ScopeKind::FunctionBodyVar) {
-                 return &scope->as<js::VarScope>();
-             }
-         }
-         MOZ_CRASH("Function extra body var scope not found");
-     }
- 
-     bool needsBodyEnvironment() const {
--        for (uint32_t i = 0; i < scopes()->length; i++) {
--            js::Scope* scope = getScope(i);
-+        for (js::Scope* scope : scopes()) {
-             if (ScopeKindIsInBody(scope->kind()) && scope->hasEnvironment()) {
-                 return true;
-             }
-         }
-         return false;
-     }
- 
-     inline js::LexicalScope* maybeNamedLambdaScope() const;
-@@ -1926,46 +1925,80 @@ class JSScript : public js::gc::TenuredC
-     size_t yieldAndAwaitOffsetsOffset() const {
-         return OFF(scopeNotesOffset, hasScopeNotes, js::ScopeNoteArray);
-     }
- 
- #undef OFF
- 
-     size_t dataSize() const { return dataSize_; }
- 
--    js::ConstArray* consts() {
-+  private:
-+
-+    js::ConstArray* constsRaw() const {
-         MOZ_ASSERT(hasConsts());
-         return reinterpret_cast<js::ConstArray*>(data + constsOffset());
-     }
- 
--    js::ObjectArray* objects() {
-+    js::ObjectArray* objectsRaw() const {
-         MOZ_ASSERT(hasObjects());
-         return reinterpret_cast<js::ObjectArray*>(data + objectsOffset());
-     }
- 
--    js::ScopeArray* scopes() const {
-+    js::ScopeArray* scopesRaw() const {
-         return reinterpret_cast<js::ScopeArray*>(data + scopesOffset());
-     }
- 
--    js::TryNoteArray* trynotes() const {
-+    js::TryNoteArray* trynotesRaw() const {
-         MOZ_ASSERT(hasTrynotes());
-         return reinterpret_cast<js::TryNoteArray*>(data + trynotesOffset());
-     }
- 
--    js::ScopeNoteArray* scopeNotes() {
-+    js::ScopeNoteArray* scopeNotesRaw() const {
-         MOZ_ASSERT(hasScopeNotes());
-         return reinterpret_cast<js::ScopeNoteArray*>(data + scopeNotesOffset());
-     }
- 
--    js::YieldAndAwaitOffsetArray& yieldAndAwaitOffsets() {
-+    js::YieldAndAwaitOffsetArray& yieldAndAwaitOffsetsRaw() const {
-         MOZ_ASSERT(hasYieldAndAwaitOffsets());
-         return *reinterpret_cast<js::YieldAndAwaitOffsetArray*>(data +
-                                                                 yieldAndAwaitOffsetsOffset());
-     }
- 
-+  public:
-+
-+    mozilla::Span<js::GCPtrValue> consts() const {
-+        js::ConstArray* array = constsRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<js::GCPtrObject> objects() const {
-+        js::ObjectArray* array = objectsRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<js::GCPtrScope> scopes() const {
-+        js::ScopeArray* array = scopesRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<JSTryNote> trynotes() const {
-+        js::TryNoteArray* array = trynotesRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<js::ScopeNote> scopeNotes() const {
-+        js::ScopeNoteArray* array = scopeNotesRaw();
-+        return mozilla::MakeSpan(array->vector, array->length);
-+    }
-+
-+    mozilla::Span<uint32_t> yieldAndAwaitOffsets() const {
-+        js::YieldAndAwaitOffsetArray& array = yieldAndAwaitOffsetsRaw();
-+        return mozilla::MakeSpan(&array[0], array.length());
-+    }
-+
-     bool hasLoops();
- 
-     uint32_t numNotes() const {
-         MOZ_ASSERT(scriptData_);
-         return scriptData_->numNotes();
-     }
-     jssrcnote* notes() const {
-         MOZ_ASSERT(scriptData_);
-@@ -1996,31 +2029,27 @@ class JSScript : public js::gc::TenuredC
-         return getAtom(index)->asPropertyName();
-     }
- 
-     js::PropertyName* getName(jsbytecode* pc) const {
-         return getAtom(pc)->asPropertyName();
-     }
- 
-     JSObject* getObject(size_t index) {
--        js::ObjectArray* arr = objects();
--        MOZ_ASSERT(index < arr->length);
--        MOZ_ASSERT(arr->vector[index]->isTenured());
--        return arr->vector[index];
-+        MOZ_ASSERT(objects()[index]->isTenured());
-+        return objects()[index];
-     }
- 
-     JSObject* getObject(jsbytecode* pc) {
-         MOZ_ASSERT(containsPC(pc) && containsPC(pc + sizeof(uint32_t)));
-         return getObject(GET_UINT32_INDEX(pc));
-     }
- 
-     js::Scope* getScope(size_t index) const {
--        js::ScopeArray* array = scopes();
--        MOZ_ASSERT(index < array->length);
--        return array->vector[index];
-+        return scopes()[index];
-     }
- 
-     js::Scope* getScope(jsbytecode* pc) const {
-         // This method is used to get a scope directly using a JSOp with an
-         // index. To search through ScopeNotes to look for a Scope using pc,
-         // use lookupScope.
-         MOZ_ASSERT(containsPC(pc) && containsPC(pc + sizeof(uint32_t)));
-         MOZ_ASSERT(js::JOF_OPTYPE(JSOp(*pc)) == JOF_SCOPE,
-@@ -2035,19 +2064,17 @@ class JSScript : public js::gc::TenuredC
-         }
-         return nullptr;
-     }
- 
-     inline js::RegExpObject* getRegExp(size_t index);
-     inline js::RegExpObject* getRegExp(jsbytecode* pc);
- 
-     const js::Value& getConst(size_t index) {
--        js::ConstArray* arr = consts();
--        MOZ_ASSERT(index < arr->length);
--        return arr->vector[index];
-+        return consts()[index];
-     }
- 
-     // The following 3 functions find the static scope just before the
-     // execution of the instruction pointed to by pc.
- 
-     js::Scope* lookupScope(jsbytecode* pc);
- 
-     js::Scope* innermostScope(jsbytecode* pc);
-diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
---- a/js/src/vm/ObjectGroup.cpp
-+++ b/js/src/vm/ObjectGroup.cpp
-@@ -235,25 +235,23 @@ ObjectGroup::useSingletonForAllocationSi
-     // All loops in the script will have a try note indicating their boundary.
- 
-     if (!script->hasTrynotes()) {
-         return SingletonObject;
-     }
- 
-     unsigned offset = script->pcToOffset(pc);
- 
--    JSTryNote* tn = script->trynotes()->vector;
--    JSTryNote* tnlimit = tn + script->trynotes()->length;
--    for (; tn < tnlimit; tn++) {
--        if (tn->kind != JSTRY_FOR_IN && tn->kind != JSTRY_FOR_OF && tn->kind != JSTRY_LOOP) {
-+    for (const JSTryNote& tn : script->trynotes()) {
-+        if (tn.kind != JSTRY_FOR_IN && tn.kind != JSTRY_FOR_OF && tn.kind != JSTRY_LOOP) {
-             continue;
-         }
- 
--        unsigned startOffset = script->mainOffset() + tn->start;
--        unsigned endOffset = startOffset + tn->length;
-+        unsigned startOffset = script->mainOffset() + tn.start;
-+        unsigned endOffset = startOffset + tn.length;
- 
-         if (offset >= startOffset && offset < endOffset) {
-             return GenericObject;
-         }
-     }
- 
-     return SingletonObject;
- }
-diff --git a/js/src/vm/Realm.cpp b/js/src/vm/Realm.cpp
---- a/js/src/vm/Realm.cpp
-+++ b/js/src/vm/Realm.cpp
-@@ -705,19 +705,17 @@ Realm::setNewObjectMetadata(JSContext* c
- }
- 
- static bool
- AddInnerLazyFunctionsFromScript(JSScript* script, AutoObjectVector& lazyFunctions)
- {
-     if (!script->hasObjects()) {
-         return true;
-     }
--    ObjectArray* objects = script->objects();
--    for (size_t i = 0; i < objects->length; i++) {
--        JSObject* obj = objects->vector[i];
-+    for (JSObject* obj : script->objects()) {
-         if (obj->is<JSFunction>() && obj->as<JSFunction>().isInterpretedLazy()) {
-             if (!lazyFunctions.append(obj)) {
-                 return false;
-             }
-         }
-     }
-     return true;
- }

+ 0 - 459
frg/work-js/mozilla-release/patches/mozilla-central_443893.patch

@@ -1,459 +0,0 @@
-# HG changeset patch
-# User Ted Campbell <tcampbell@mozilla.com>
-# Date 1534958731 14400
-#      Wed Aug 22 13:25:31 2018 -0400
-# Node ID 31db69b4f38d3d258e6cd886af06da94caf91d58
-# Parent  716e7d5c3da2378ced5c0b99032ac685799212e5
-Bug 1485347 - Part 4: Add js::PrivateScriptData type. r=waldo
-
-This will later be used to store variable length data that hangs off of
-each JSScript. This primarily is a refactor of existing JSScript code to
-put in its own data structure.
-
-- ScopeArray and friends now store offsets instead of pointers. This
-  saves memory on 64-bit platforms and simplifies cloning.
-- GCPtr constructors are used instead of relying on pod_calloc. This
-  fixes C++ object-model violations.
-- A packed bitfield is used to locate optional array headers instead of
-  previous daisy-chain approach. This also lets js::PrivateScriptData
-  understand array layout without coupling to JSScript.
-
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -3031,16 +3031,219 @@ js::FreeScriptData(JSRuntime* rt)
-                 scriptData, scriptData->refCount());
- #endif
-         js_free(e.front());
-     }
- 
-     table.clear();
- }
- 
-+// Placement-new elements of an array. This should optimize away for types with
-+// trivial default initiation.
-+template <typename T>
-+static void
-+DefaultInitializeElements(void* arrayPtr, size_t length)
-+{
-+    uintptr_t elem = reinterpret_cast<uintptr_t>(arrayPtr);
-+    MOZ_ASSERT(elem % alignof(T) == 0);
-+
-+    for (size_t i = 0; i < length; ++i) {
-+        new (reinterpret_cast<T*>(elem)) T;
-+        elem += sizeof(T);
-+    }
-+}
-+
-+/* static */ size_t
-+PrivateScriptData::AllocationSize(uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
-+                                  uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets)
-+{
-+    size_t size = sizeof(PrivateScriptData);
-+
-+    if (nconsts) { size += sizeof(PackedSpan); }
-+    if (nobjects) { size += sizeof(PackedSpan); }
-+    if (ntrynotes) { size += sizeof(PackedSpan); }
-+    if (nscopenotes) { size += sizeof(PackedSpan); }
-+    if (nyieldoffsets) { size += sizeof(PackedSpan); }
-+
-+    size += nscopes * sizeof(GCPtrScope);
-+
-+    if (nconsts) {
-+        // The scope array doesn't maintain Value alignment, so compute the
-+        // padding needed to remedy this.
-+        size = JS_ROUNDUP(size, alignof(GCPtrValue));
-+        size += nconsts * sizeof(GCPtrValue);
-+    }
-+    if (nobjects) {
-+        size += nobjects * sizeof(GCPtrObject);
-+    }
-+    if (ntrynotes) {
-+        size += ntrynotes * sizeof(JSTryNote);
-+    }
-+    if (nscopenotes) {
-+        size += nscopenotes * sizeof(ScopeNote);
-+    }
-+    if (nyieldoffsets) {
-+        size += nyieldoffsets * sizeof(uint32_t);
-+    }
-+
-+    return size;
-+}
-+
-+// Placement-new elements of an array. This should optimize away for types with
-+// trivial default initiation.
-+template <typename T>
-+void
-+PrivateScriptData::initElements(size_t offset, size_t length)
-+{
-+    uintptr_t base = reinterpret_cast<uintptr_t>(this);
-+    DefaultInitializeElements<T>(reinterpret_cast<void*>(base + offset), length);
-+}
-+
-+template <typename T>
-+void
-+PrivateScriptData::initSpan(size_t* cursor, uint32_t scaledSpanOffset, size_t length)
-+{
-+    // PackedSpans are elided when arrays are empty
-+    if (scaledSpanOffset == 0) {
-+        MOZ_ASSERT(length == 0);
-+        return;
-+    }
-+
-+    // Placement-new the PackedSpan
-+    PackedSpan* span = packedOffsetToPointer<PackedSpan>(scaledSpanOffset);
-+    span = new (span) PackedSpan { uint32_t(*cursor), uint32_t(length) };
-+
-+    // Placement-new the elements
-+    initElements<T>(*cursor, length);
-+
-+    // Advance cursor
-+    (*cursor) += length * sizeof(T);
-+}
-+
-+// Initialize PackedSpans and placement-new the trailing arrays.
-+PrivateScriptData::PrivateScriptData(uint32_t nscopes_, uint32_t nconsts, uint32_t nobjects,
-+                                     uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets)
-+  : nscopes(nscopes_)
-+{
-+    // Convert cursor possition to a packed offset.
-+    auto ToPackedOffset = [](size_t cursor) {
-+        MOZ_ASSERT(cursor % PackedOffsets::SCALE == 0);
-+        return cursor / PackedOffsets::SCALE;
-+    };
-+
-+    // Helper to allocate a PackedSpan from the variable length data.
-+    auto TakeSpan = [=](size_t* cursor) {
-+        size_t packedOffset = ToPackedOffset(*cursor);
-+        MOZ_ASSERT(packedOffset <= PackedOffsets::MAX_OFFSET);
-+
-+        (*cursor) += sizeof(PackedSpan);
-+        return packedOffset;
-+    };
-+
-+    // Variable-length data begins immediately after PrivateScriptData itself.
-+    // NOTE: Alignment is computed using cursor/offset so the alignment of
-+    // PrivateScriptData must be stricter than any trailing array type.
-+    size_t cursor = sizeof(*this);
-+
-+    // Layout PackedSpan structures and initialize packedOffsets fields.
-+    static_assert(alignof(PrivateScriptData) >= alignof(PackedSpan),
-+                  "Incompatible alignment");
-+    if (nconsts) { packedOffsets.constsSpanOffset = TakeSpan(&cursor); }
-+    if (nobjects) { packedOffsets.objectsSpanOffset = TakeSpan(&cursor); }
-+    if (ntrynotes) { packedOffsets.tryNotesSpanOffset = TakeSpan(&cursor); }
-+    if (nscopenotes) { packedOffsets.scopeNotesSpanOffset = TakeSpan(&cursor); }
-+    if (nyieldoffsets) { packedOffsets.yieldOffsetsSpanOffset = TakeSpan(&cursor); }
-+
-+    // Layout and initialize the scopes array. Manually insert padding so that
-+    // the subsequent |consts| array is aligned.
-+    {
-+        MOZ_ASSERT(nscopes > 0);
-+
-+        static_assert(alignof(PackedSpan) >= alignof(GCPtrScope),
-+                      "Incompatible alignment");
-+        initElements<GCPtrScope>(cursor, nscopes);
-+        packedOffsets.scopesOffset = ToPackedOffset(cursor);
-+
-+        cursor += nscopes * sizeof(GCPtrScope);
-+    }
-+
-+    if (nconsts) {
-+        // Pad to required alignment if we are emitting constant array.
-+        cursor = JS_ROUNDUP(cursor, alignof(GCPtrValue));
-+
-+        static_assert(alignof(PrivateScriptData) >= alignof(GCPtrValue),
-+                      "Incompatible alignment");
-+        initSpan<GCPtrValue>(&cursor, packedOffsets.constsSpanOffset, nconsts);
-+    }
-+
-+    // Layout arrays, initialize PackedSpans and placement-new the elements.
-+    static_assert(alignof(GCPtrValue) >= alignof(GCPtrObject),
-+                  "Incompatible alignment");
-+    static_assert(alignof(GCPtrScope) >= alignof(GCPtrObject),
-+                  "Incompatible alignment");
-+    initSpan<GCPtrObject>(&cursor, packedOffsets.objectsSpanOffset, nobjects);
-+    static_assert(alignof(GCPtrObject) >= alignof(JSTryNote),
-+                  "Incompatible alignment");
-+    initSpan<JSTryNote>(&cursor, packedOffsets.tryNotesSpanOffset, ntrynotes);
-+    static_assert(alignof(JSTryNote) >= alignof(ScopeNote),
-+                  "Incompatible alignment");
-+    initSpan<ScopeNote>(&cursor, packedOffsets.scopeNotesSpanOffset, nscopenotes);
-+    static_assert(alignof(ScopeNote) >= alignof(uint32_t),
-+                  "Incompatible alignment");
-+    initSpan<uint32_t>(&cursor, packedOffsets.yieldOffsetsSpanOffset, nyieldoffsets);
-+
-+    // Sanity check
-+    MOZ_ASSERT(AllocationSize(nscopes_, nconsts, nobjects,
-+                              ntrynotes, nscopenotes, nyieldoffsets) == cursor);
-+}
-+
-+/* static */ PrivateScriptData*
-+PrivateScriptData::new_(JSContext* cx,
-+                        uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
-+                        uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets,
-+                        uint32_t* dataSize)
-+{
-+    // Compute size including trailing arrays
-+    size_t size = AllocationSize(nscopes, nconsts, nobjects,
-+                                 ntrynotes, nscopenotes, nyieldoffsets);
-+
-+    // Allocate contiguous raw buffer
-+    void* raw = cx->pod_malloc<uint8_t>(size);
-+    MOZ_ASSERT(uintptr_t(raw) % alignof(PrivateScriptData) == 0);
-+    if (!raw) {
-+        return nullptr;
-+    }
-+
-+    if (dataSize) {
-+        *dataSize = size;
-+    }
-+
-+    // Constuct the PrivateScriptData. Trailing arrays are uninitialized but
-+    // GCPtrs are put into a safe state.
-+    return new (raw) PrivateScriptData(nscopes, nconsts, nobjects,
-+                                       ntrynotes, nscopenotes, nyieldoffsets);
-+}
-+
-+void
-+PrivateScriptData::traceChildren(JSTracer* trc)
-+{
-+    auto scopearray = scopes();
-+    TraceRange(trc, scopearray.size(), scopearray.data(), "scopes");
-+
-+    if (hasConsts()) {
-+        auto constarray = consts();
-+        TraceRange(trc, constarray.size(), constarray.data(), "consts");
-+    }
-+
-+    if (hasObjects()) {
-+        auto objarray = objects();
-+        TraceRange(trc, objarray.size(), objarray.data(), "objects");
-+    }
-+}
-+
- /*
-  * [SMDOC] JSScript data layout (unshared)
-  *
-  * JSScript::data and SharedScriptData::data have complex,
-  * manually-controlled, memory layouts.
-  *
-  * JSScript::data begins with some optional array headers. They are optional
-  * because they often aren't needed, i.e. the corresponding arrays often have
-@@ -4151,17 +4354,18 @@ js::detail::CopyScript(JSContext* cx, Ha
-     dst->bitFields_.isAsync_ = src->bitFields_.isAsync_;
-     dst->bitFields_.hasRest_ = src->bitFields_.hasRest_;
-     dst->bitFields_.hideScriptFromDebugger_ = src->bitFields_.hideScriptFromDebugger_;
- 
-     if (nconsts != 0) {
-         GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->constsRaw()->vector);
-         dst->constsRaw()->vector = vector;
-         for (unsigned i = 0; i < nconsts; ++i) {
--            MOZ_ASSERT_IF(vector[i].isGCThing(), vector[i].toString()->isAtom());
-+            // We don't support GCThings here and thus don't need to call |init|.
-+            MOZ_ASSERT(!vector[i].isGCThing());
-         }
-     }
-     if (nobjects != 0) {
-         GCPtrObject* vector = Rebase<GCPtrObject>(dst, src, src->objectsRaw()->vector);
-         dst->objectsRaw()->vector = vector;
-         for (unsigned i = 0; i < nobjects; ++i) {
-             vector[i].init(&objects[i]->as<NativeObject>());
-         }
-diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h
---- a/js/src/vm/JSScript.h
-+++ b/js/src/vm/JSScript.h
-@@ -1269,16 +1269,192 @@ XDRLazyScript(XDRState<mode>* xdr, Handl
- 
- /*
-  * Code any constant value.
-  */
- template<XDRMode mode>
- XDRResult
- XDRScriptConst(XDRState<mode>* xdr, MutableHandleValue vp);
- 
-+// [SMDOC] - JSScript data layout (unshared)
-+//
-+// PrivateScriptData stores variable-length data associated with a script.
-+// Abstractly a PrivateScriptData consists of all these arrays:
-+//
-+//   * A non-empty array of GCPtrScope in scopes()
-+//   * A possibly-empty array of GCPtrValue in consts()
-+//   * A possibly-empty array of JSObject* in objects()
-+//   * A possibly-empty array of JSTryNote in tryNotes()
-+//   * A possibly-empty array of ScopeNote in scopeNotes()
-+//   * A possibly-empty array of uint32_t in yieldAndAwaitOffsets()
-+//
-+// Accessing any of these arrays just requires calling the appropriate public
-+// Span-computing function.
-+//
-+// Under the hood, PrivateScriptData is a small class followed by a memory
-+// layout that compactly encodes all these arrays, in this manner (only
-+// explicit padding, "--" separators for readability only):
-+//
-+//   <PrivateScriptData itself>
-+//   --
-+//   (OPTIONAL) PackedSpan for consts()
-+//   (OPTIONAL) PackedSpan for objects()
-+//   (OPTIONAL) PackedSpan for tryNotes()
-+//   (OPTIONAL) PackedSpan for scopeNotes()
-+//   (OPTIONAL) PackedSpan for yieldAndAwaitOffsets()
-+//   --
-+//   (REQUIRED) All the GCPtrScopes that constitute scopes()
-+//   --
-+//   (OPTIONAL) If there are consts, padding needed for space so far to be
-+//              GCPtrValue-aligned
-+//   (OPTIONAL) All the GCPtrValues that constitute consts()
-+//   --
-+//   (OPTIONAL) All the GCPtrObjects that constitute objects()
-+//   --
-+//   (OPTIONAL) All the JSTryNotes that constitute tryNotes()
-+//   --
-+//   (OPTIONAL) All the ScopeNotes that constitute scopeNotes()
-+//   --
-+//   (OPTIONAL) All the uint32_t's that constitute yieldAndAwaitOffsets()
-+//
-+// The contents of PrivateScriptData indicate which optional items are present.
-+// PrivateScriptData::packedOffsets contains bit-fields, one per array.
-+// Multiply each packed offset by sizeof(uint32_t) to compute a *real* offset.
-+//
-+// PrivateScriptData::scopesOffset indicates where scopes() begins. The bound
-+// of five PackedSpans ensures we can encode this offset compactly.
-+// PrivateScriptData::nscopes indicates the number of GCPtrScopes in scopes().
-+//
-+// The other PackedScriptData::*Offset fields indicate where a potential
-+// corresponding PackedSpan resides. If the packed offset is 0, there is no
-+// PackedSpan, and the array is empty. Otherwise the PackedSpan's uint32_t
-+// offset and length fields store: 1) a *non-packed* offset (a literal count of
-+// bytes offset from the *start* of PrivateScriptData struct) to the
-+// corresponding array, and 2) the number of elements in the array,
-+// respectively.
-+//
-+// PrivateScriptData and PackedSpan are 64-bit-aligned, so manual alignment in
-+// trailing fields is only necessary before the first trailing fields with
-+// increased alignment -- before GCPtrValues for consts(), on 32-bit, where the
-+// preceding GCPtrScopes as pointers are only 32-bit-aligned.
-+class alignas(JS::Value) PrivateScriptData final
-+{
-+    struct PackedOffsets
-+    {
-+        static constexpr size_t SCALE = sizeof(uint32_t);
-+        static constexpr size_t MAX_OFFSET = 0b1111;
-+
-+        // (Scaled) offset to Scopes
-+        uint32_t scopesOffset : 8;
-+
-+        // (Scaled) offset to Spans. These are set to 0 if they don't exist.
-+        uint32_t constsSpanOffset : 4;
-+        uint32_t objectsSpanOffset : 4;
-+        uint32_t tryNotesSpanOffset : 4;
-+        uint32_t scopeNotesSpanOffset : 4;
-+        uint32_t yieldOffsetsSpanOffset : 4;
-+    };
-+
-+    // Detect accidental size regressions.
-+    static_assert(sizeof(PackedOffsets) == sizeof(uint32_t),
-+                  "unexpected bit-field packing");
-+
-+    // A span describes base offset and length of one variable length array in
-+    // the private data.
-+    struct alignas(uintptr_t) PackedSpan
-+    {
-+        uint32_t offset;
-+        uint32_t length;
-+    };
-+
-+    // Concrete Fields
-+    PackedOffsets packedOffsets = {}; // zeroes
-+    uint32_t nscopes;
-+
-+    // Translate an offset into a concrete pointer.
-+    template <typename T>
-+    T* offsetToPointer(size_t offset)
-+    {
-+        uintptr_t base = reinterpret_cast<uintptr_t>(this);
-+        uintptr_t elem = base + offset;
-+        return reinterpret_cast<T*>(elem);
-+    }
-+
-+    // Translate a PackedOffsets member into a pointer.
-+    template <typename T>
-+    T* packedOffsetToPointer(size_t packedOffset)
-+    {
-+        return offsetToPointer<T>(packedOffset * PackedOffsets::SCALE);
-+    }
-+
-+    // Translates a PackedOffsets member into a PackedSpan* and then unpacks
-+    // that to a mozilla::Span.
-+    template <typename T>
-+    mozilla::Span<T> packedOffsetToSpan(size_t scaledSpanOffset)
-+    {
-+        PackedSpan* span = packedOffsetToPointer<PackedSpan>(scaledSpanOffset);
-+        T* base = offsetToPointer<T>(span->offset);
-+        return mozilla::MakeSpan(base, span->length);
-+    }
-+
-+    // Helpers for creating initializing trailing data
-+    template <typename T>
-+    void initSpan(size_t* cursor, uint32_t scaledSpanOffset, size_t length);
-+
-+    template <typename T>
-+    void initElements(size_t offset, size_t length);
-+
-+    // Size to allocate
-+    static size_t AllocationSize(uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
-+                                 uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets);
-+
-+    // Initialize header and PackedSpans
-+    PrivateScriptData(uint32_t nscopes_, uint32_t nconsts, uint32_t nobjects,
-+                      uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets);
-+
-+  public:
-+
-+    // Accessors for typed array spans.
-+    mozilla::Span<GCPtrScope> scopes() {
-+        GCPtrScope* base = packedOffsetToPointer<GCPtrScope>(packedOffsets.scopesOffset);
-+        return mozilla::MakeSpan(base, nscopes);
-+    }
-+    mozilla::Span<GCPtrValue> consts() {
-+        return packedOffsetToSpan<GCPtrValue>(packedOffsets.constsSpanOffset);
-+    }
-+    mozilla::Span<GCPtrObject> objects() {
-+        return packedOffsetToSpan<GCPtrObject>(packedOffsets.objectsSpanOffset);
-+    }
-+    mozilla::Span<JSTryNote> tryNotes() {
-+        return packedOffsetToSpan<JSTryNote>(packedOffsets.tryNotesSpanOffset);
-+    }
-+    mozilla::Span<ScopeNote> scopeNotes() {
-+        return packedOffsetToSpan<ScopeNote>(packedOffsets.scopeNotesSpanOffset);
-+    }
-+    mozilla::Span<uint32_t> yieldAndAwaitOffsets() {
-+        return packedOffsetToSpan<uint32_t>(packedOffsets.yieldOffsetsSpanOffset);
-+    }
-+
-+    // Fast tests for if array exists
-+    bool hasConsts() const { return packedOffsets.constsSpanOffset != 0; }
-+    bool hasObjects() const { return packedOffsets.objectsSpanOffset != 0; }
-+    bool hasTryNotes() const { return packedOffsets.tryNotesSpanOffset != 0; }
-+    bool hasScopeNotes() const { return packedOffsets.scopeNotesSpanOffset != 0; }
-+    bool hasYieldOffsets() const { return packedOffsets.yieldOffsetsSpanOffset != 0; }
-+
-+    // Allocate a new PrivateScriptData. Headers and GCPtrs are initialized.
-+    // The size of allocation is returned as an out parameter.
-+    static PrivateScriptData* new_(JSContext* cx,
-+                                   uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
-+                                   uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets,
-+                                   uint32_t* dataSize);
-+
-+    void traceChildren(JSTracer* trc);
-+};
-+
- /*
-  * Common data that can be shared between many scripts in a single runtime.
-  */
- class SharedScriptData
- {
-     // This class is reference counted as follows: each pointer from a JSScript
-     // counts as one reference plus there may be one reference from the shared
-     // script data table.

+ 0 - 985
frg/work-js/mozilla-release/patches/mozilla-central_443894.patch

@@ -1,985 +0,0 @@
-# HG changeset patch
-# User Ted Campbell <tcampbell@mozilla.com>
-# Date 1535070478 14400
-#      Thu Aug 23 20:27:58 2018 -0400
-# Node ID 1fbd4a0e4473c96caacf49896901a2fa956f0d10
-# Parent  31db69b4f38d3d258e6cd886af06da94caf91d58
-Bug 1485347 - Part 5: Use js::PrivateScriptData for JSScript. r=jandem
-
-- This makes JSScript::data arrays read-only. Initialization code
- directly uses PrivateScriptData to mutate.
-
-MozReview-Commit-ID: LJFc8QazLfq
-
-diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp
---- a/js/src/jit/BaselineJIT.cpp
-+++ b/js/src/jit/BaselineJIT.cpp
-@@ -791,17 +791,17 @@ BaselineScript::computeYieldAndAwaitNati
-     auto computeNative = [this,script](uint32_t pcOffset) {
-         PCMappingSlotInfo slotInfo;
-         uint8_t* nativeCode = maybeNativeCodeForPC(script, script->offsetToPC(pcOffset), &slotInfo);
-         MOZ_ASSERT(slotInfo.isStackSynced());
- 
-         return nativeCode;
-     };
- 
--    mozilla::Span<uint32_t> pcOffsets = script->yieldAndAwaitOffsets();
-+    mozilla::Span<const uint32_t> pcOffsets = script->yieldAndAwaitOffsets();
-     uint8_t** nativeOffsets = yieldEntryList();
-     std::transform(pcOffsets.begin(), pcOffsets.end(), nativeOffsets, computeNative);
- }
- 
- void
- BaselineScript::copyICEntries(JSScript* script, const ICEntry* entries)
- {
-     // Fix up the return offset in the IC entries and copy them in.
-diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp
---- a/js/src/vm/JSScript.cpp
-+++ b/js/src/vm/JSScript.cpp
-@@ -409,23 +409,23 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         nfixed = script->nfixed();
-         nslots = script->nslots();
- 
-         bodyScopeIndex = script->bodyScopeIndex();
-         natoms = script->natoms();
- 
-         nsrcnotes = script->numNotes();
- 
-+        nscopes = script->scopes().size();
-         if (script->hasConsts()) {
-             nconsts = script->consts().size();
-         }
-         if (script->hasObjects()) {
-             nobjects = script->objects().size();
-         }
--        nscopes = script->scopes().size();
-         if (script->hasTrynotes()) {
-             ntrynotes = script->trynotes().size();
-         }
-         if (script->hasScopeNotes()) {
-             nscopenotes = script->scopeNotes().size();
-         }
-         if (script->hasYieldAndAwaitOffsets()) {
-             nyieldoffsets = script->yieldAndAwaitOffsets().size();
-@@ -727,32 +727,34 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-     }
- 
-     if (mode == XDR_DECODE) {
-         if (!script->shareScriptData(cx)) {
-             return xdr->fail(JS::TranscodeResult_Throw);
-         }
-     }
- 
-+    js::PrivateScriptData* data = script->data_;
-+
-     if (nconsts) {
-         RootedValue val(cx);
--        for (GCPtrValue& elem : script->consts()) {
-+        for (GCPtrValue& elem : data->consts()) {
-             if (mode == XDR_ENCODE) {
-                 val = elem.get();
-             }
-             MOZ_TRY(XDRScriptConst(xdr, &val));
-             if (mode == XDR_DECODE) {
-                 elem.init(val);
-             }
-         }
-     }
- 
-     {
-         MOZ_ASSERT(nscopes != 0);
--        GCPtrScope* vector = script->scopes().data();
-+        GCPtrScope* vector = data->scopes().data();
-         RootedScope scope(cx);
-         RootedScope enclosing(cx);
-         ScopeKind scopeKind;
-         uint32_t enclosingScopeIndex = 0;
-         for (uint32_t i = 0; i != nscopes; ++i) {
-             if (mode == XDR_ENCODE) {
-                 scope = vector[i];
-                 scopeKind = scope->kind();
-@@ -839,17 +841,17 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-     }
- 
-     /*
-      * Here looping from 0-to-length to xdr objects is essential to ensure that
-      * all references to enclosing blocks (via FindScopeIndex below) happen
-      * after the enclosing block has been XDR'd.
-      */
-     if (nobjects) {
--        for (GCPtrObject& elem : script->objects()) {
-+        for (GCPtrObject& elem : data->objects()) {
-             XDRClassKind classk;
- 
-             if (mode == XDR_ENCODE) {
-                 JSObject* obj = elem.get();
-                 if (obj->is<RegExpObject>()) {
-                     classk = CK_RegexpObject;
-                 } else if (obj->is<JSFunction>()) {
-                     classk = CK_JSFunction;
-@@ -934,35 +936,35 @@ js::XDRScript(XDRState<mode>* xdr, Handl
-         }
-     }
- 
-     // Verify marker to detect data corruption after decoding object data. A
-     // mismatch here indicates we will almost certainly crash in release.
-     MOZ_TRY(xdr->codeMarker(0xF83B989A));
- 
-     if (ntrynotes) {
--        for (JSTryNote& elem : script->trynotes()) {
-+        for (JSTryNote& elem : data->tryNotes()) {
-             MOZ_TRY(xdr->codeUint8(&elem.kind));
-             MOZ_TRY(xdr->codeUint32(&elem.stackDepth));
-             MOZ_TRY(xdr->codeUint32(&elem.start));
-             MOZ_TRY(xdr->codeUint32(&elem.length));
-         }
-     }
- 
-     if (nscopenotes) {
--        for (ScopeNote& elem : script->scopeNotes()) {
-+        for (ScopeNote& elem : data->scopeNotes()) {
-             MOZ_TRY(xdr->codeUint32(&elem.index));
-             MOZ_TRY(xdr->codeUint32(&elem.start));
-             MOZ_TRY(xdr->codeUint32(&elem.length));
-             MOZ_TRY(xdr->codeUint32(&elem.parent));
-         }
-     }
- 
-     if (nyieldoffsets) {
--        for (uint32_t& elem : script->yieldAndAwaitOffsets()) {
-+        for (uint32_t& elem : data->yieldAndAwaitOffsets()) {
-             MOZ_TRY(xdr->codeUint32(&elem));
-         }
-     }
- 
-     if (scriptBits & (1 << HasLazyScript)) {
-         Rooted<LazyScript*> lazy(cx);
-         if (mode == XDR_ENCODE) {
-             lazy = script->maybeLazyScript();
-@@ -3234,135 +3236,16 @@ PrivateScriptData::traceChildren(JSTrace
-     }
- 
-     if (hasObjects()) {
-         auto objarray = objects();
-         TraceRange(trc, objarray.size(), objarray.data(), "objects");
-     }
- }
- 
--/*
-- * [SMDOC] JSScript data layout (unshared)
-- *
-- * JSScript::data and SharedScriptData::data have complex,
-- * manually-controlled, memory layouts.
-- *
-- * JSScript::data begins with some optional array headers. They are optional
-- * because they often aren't needed, i.e. the corresponding arrays often have
-- * zero elements. Each header has a bit in JSScript::hasArrayBits that
-- * indicates if it's present within |data|; from this the offset of each
-- * present array header can be computed. Each header has an accessor function
-- * in JSScript that encapsulates this offset computation.
-- *
-- * Array type      Array elements  Accessor
-- * ----------      --------------  --------
-- * ConstArray      Consts          consts()
-- * ObjectArray     Objects         objects()
-- * ObjectArray     Regexps         regexps()
-- * TryNoteArray    Try notes       trynotes()
-- * ScopeNoteArray  Scope notes     scopeNotes()
-- *
-- * Then are the elements of several arrays.
-- * - Most of these arrays have headers listed above (if present). For each of
-- *   these, the array pointer and the array length is stored in the header.
-- * - The remaining arrays have pointers and lengths that are stored directly in
-- *   JSScript. This is because, unlike the others, they are nearly always
-- *   non-zero length and so the optional-header space optimization isn't
-- *   worthwhile.
-- *
-- * Array elements   Pointed to by         Length
-- * --------------   -------------         ------
-- * Consts           consts()->vector      consts()->length
-- * Objects          objects()->vector     objects()->length
-- * Regexps          regexps()->vector     regexps()->length
-- * Try notes        trynotes()->vector    trynotes()->length
-- * Scope notes      scopeNotes()->vector  scopeNotes()->length
-- *
-- * IMPORTANT: This layout has two key properties.
-- * - It ensures that everything has sufficient alignment; in particular, the
-- *   consts() elements need Value alignment.
-- * - It ensures there are no gaps between elements, which saves space and makes
-- *   manual layout easy. In particular, in the second part, arrays with larger
-- *   elements precede arrays with smaller elements.
-- *
-- * The following static assertions check JSScript::data's alignment properties.
-- */
--
--template<class T>
--constexpr bool
--KeepsValueAlignment() {
--    return alignof(JS::Value) % alignof(T) == 0 &&
--           sizeof(T) % sizeof(JS::Value) == 0;
--}
--
--template<class T>
--constexpr bool
--HasValueAlignment() {
--    return alignof(JS::Value) == alignof(T) &&
--           sizeof(T) == sizeof(JS::Value);
--}
--
--template<class T1, class T2>
--constexpr bool
--NoPaddingBetweenEntries() {
--    return alignof(T1) % alignof(T2) == 0;
--}
--
--/*
-- * These assertions ensure that there is no padding between the array headers,
-- * and also that the consts() elements (which follow immediately afterward) are
-- * Value-aligned.  (There is an assumption that |data| itself is Value-aligned;
-- * we check this below).
-- */
--JS_STATIC_ASSERT(KeepsValueAlignment<ConstArray>());
--JS_STATIC_ASSERT(KeepsValueAlignment<ObjectArray>());       /* there are two of these */
--JS_STATIC_ASSERT(KeepsValueAlignment<TryNoteArray>());
--JS_STATIC_ASSERT(KeepsValueAlignment<ScopeNoteArray>());
--
--/* These assertions ensure there is no padding required between array elements. */
--JS_STATIC_ASSERT(HasValueAlignment<GCPtrValue>());
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<GCPtrValue, GCPtrObject>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<GCPtrObject, GCPtrObject>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<GCPtrObject, JSTryNote>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<JSTryNote, uint32_t>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<uint32_t, uint32_t>()));
--
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<GCPtrValue, ScopeNote>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<ScopeNote, ScopeNote>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<JSTryNote, ScopeNote>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<GCPtrObject, ScopeNote>()));
--JS_STATIC_ASSERT((NoPaddingBetweenEntries<ScopeNote, uint32_t>()));
--
--static inline size_t
--ScriptDataSize(uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
--               uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nyieldoffsets)
--{
--    size_t size = 0;
--
--    MOZ_ASSERT(nscopes != 0);
--    size += sizeof(ScopeArray) + nscopes * sizeof(Scope*);
--    if (nconsts != 0) {
--        size += sizeof(ConstArray) + nconsts * sizeof(Value);
--    }
--    if (nobjects != 0) {
--        size += sizeof(ObjectArray) + nobjects * sizeof(NativeObject*);
--    }
--    if (ntrynotes != 0) {
--        size += sizeof(TryNoteArray) + ntrynotes * sizeof(JSTryNote);
--    }
--    if (nscopenotes != 0) {
--        size += sizeof(ScopeNoteArray) + nscopenotes * sizeof(ScopeNote);
--    }
--    if (nyieldoffsets != 0) {
--        size += sizeof(YieldAndAwaitOffsetArray) + nyieldoffsets * sizeof(uint32_t);
--    }
--
--     return size;
--}
--
- JSScript::JSScript(JS::Realm* realm, uint8_t* stubEntry, const ReadOnlyCompileOptions& options,
-                    HandleObject sourceObject, uint32_t bufStart, uint32_t bufEnd,
-                    uint32_t toStringStart, uint32_t toStringEnd)
-   :
- #ifndef JS_CODEGEN_NONE
-     jitCodeRaw_(stubEntry),
-     jitCodeSkipArgCheck_(stubEntry),
- #endif
-@@ -3486,102 +3369,26 @@ AllocScriptData(JSContext* cx, size_t si
- 
- /* static */ bool
- JSScript::partiallyInit(JSContext* cx, HandleScript script, uint32_t nscopes,
-                         uint32_t nconsts, uint32_t nobjects, uint32_t ntrynotes,
-                         uint32_t nscopenotes, uint32_t nyieldoffsets)
- {
-     cx->check(script);
- 
--    size_t size = ScriptDataSize(nscopes, nconsts, nobjects, ntrynotes,
--                                 nscopenotes, nyieldoffsets);
--    script->data = AllocScriptData(cx, size);
--    if (size && !script->data) {
-+    uint32_t dataSize;
-+
-+    PrivateScriptData* data = PrivateScriptData::new_(cx, nscopes, nconsts, nobjects, ntrynotes,
-+                                                      nscopenotes, nyieldoffsets, &dataSize);
-+    if (!data) {
-         return false;
-     }
- 
--    script->dataSize_ = size;
--
--    uint8_t* cursor = script->data;
--
--    // There must always be at least 1 scope, the body scope.
--    MOZ_ASSERT(nscopes != 0);
--    cursor += sizeof(ScopeArray);
--
--    if (nconsts != 0) {
--        script->setHasArray(CONSTS);
--        cursor += sizeof(ConstArray);
--    }
--    if (nobjects != 0) {
--        script->setHasArray(OBJECTS);
--        cursor += sizeof(ObjectArray);
--    }
--
--    if (ntrynotes != 0) {
--        script->setHasArray(TRYNOTES);
--        cursor += sizeof(TryNoteArray);
--    }
--    if (nscopenotes != 0) {
--        script->setHasArray(SCOPENOTES);
--        cursor += sizeof(ScopeNoteArray);
--    }
--
--    YieldAndAwaitOffsetArray* yieldAndAwaitOffsets = nullptr;
--    if (nyieldoffsets != 0) {
--        yieldAndAwaitOffsets = reinterpret_cast<YieldAndAwaitOffsetArray*>(cursor);
--        cursor += sizeof(YieldAndAwaitOffsetArray);
--    }
--
--    if (nconsts != 0) {
--        MOZ_ASSERT(reinterpret_cast<uintptr_t>(cursor) % sizeof(JS::Value) == 0);
--        script->constsRaw()->length = nconsts;
--        script->constsRaw()->vector = (GCPtrValue*)cursor;
--        cursor += nconsts * sizeof(script->constsRaw()->vector[0]);
--    }
--
--    script->scopesRaw()->length = nscopes;
--    script->scopesRaw()->vector = (GCPtrScope*)cursor;
--    cursor += nscopes * sizeof(script->scopesRaw()->vector[0]);
--
--    if (nobjects != 0) {
--        script->objectsRaw()->length = nobjects;
--        script->objectsRaw()->vector = (GCPtrObject*)cursor;
--        cursor += nobjects * sizeof(script->objectsRaw()->vector[0]);
--    }
--
--    if (ntrynotes != 0) {
--        script->trynotesRaw()->length = ntrynotes;
--        script->trynotesRaw()->vector = reinterpret_cast<JSTryNote*>(cursor);
--        size_t vectorSize = ntrynotes * sizeof(script->trynotesRaw()->vector[0]);
--#ifdef DEBUG
--        memset(cursor, 0, vectorSize);
--#endif
--        cursor += vectorSize;
--    }
--
--    if (nscopenotes != 0) {
--        script->scopeNotesRaw()->length = nscopenotes;
--        script->scopeNotesRaw()->vector = reinterpret_cast<ScopeNote*>(cursor);
--        size_t vectorSize = nscopenotes * sizeof(script->scopeNotesRaw()->vector[0]);
--#ifdef DEBUG
--        memset(cursor, 0, vectorSize);
--#endif
--        cursor += vectorSize;
--    }
--
--    if (nyieldoffsets != 0) {
--        yieldAndAwaitOffsets->init(reinterpret_cast<uint32_t*>(cursor), nyieldoffsets);
--        size_t vectorSize = nyieldoffsets * sizeof(script->yieldAndAwaitOffsetsRaw()[0]);
--#ifdef DEBUG
--        memset(cursor, 0, vectorSize);
--#endif
--        cursor += vectorSize;
--    }
--
--    MOZ_ASSERT(cursor == script->data + size);
-+    script->data_ = data;
-+    script->dataSize_ = dataSize;
-     return true;
- }
- 
- /* static */ bool
- JSScript::initFunctionPrototype(JSContext* cx, Handle<JSScript*> script,
-                                 HandleFunction functionProto)
- {
-     uint32_t numScopes = 1;
-@@ -3599,17 +3406,19 @@ JSScript::initFunctionPrototype(JSContex
-     script->nTypeSets_ = 0;
- 
-     RootedScope enclosing(cx, &cx->global()->emptyGlobalScope());
-     Scope* functionProtoScope = FunctionScope::create(cx, nullptr, false, false, functionProto,
-                                                       enclosing);
-     if (!functionProtoScope) {
-         return false;
-     }
--    script->scopesRaw()->vector[0].init(functionProtoScope);
-+
-+    js::PrivateScriptData* data = script->data_;
-+    data->scopes()[0].init(functionProtoScope);
- 
-     uint32_t codeLength = 1;
-     uint32_t srcNotesLength = 1;
-     uint32_t numAtoms = 0;
-     if (!script->createScriptData(cx, codeLength, srcNotesLength, numAtoms)) {
-         return false;
-     }
- 
-@@ -3737,31 +3546,33 @@ JSScript::fullyInitFromEmitter(JSContext
-     PodCopy<jsbytecode>(code + prologueLength, bce->main.code.begin(), mainLength);
-     bce->copySrcNotes((jssrcnote*)(code + script->length()), nsrcnotes);
-     InitAtomMap(*bce->atomIndices, script->atoms());
- 
-     if (!script->shareScriptData(cx)) {
-         return false;
-     }
- 
-+    js::PrivateScriptData* data = script->data_;
-     if (bce->numberList.length() != 0) {
--        bce->numberList.finish(script->consts());
-+        bce->numberList.finish(data->consts());
-     }
-     if (bce->objectList.length != 0) {
--        bce->objectList.finish(script->objects());
-+        bce->objectList.finish(data->objects());
-     }
-     if (bce->scopeList.length() != 0) {
--        bce->scopeList.finish(script->scopes());
-+        bce->scopeList.finish(data->scopes());
-     }
-     if (bce->tryNoteList.length() != 0) {
--        bce->tryNoteList.finish(script->trynotes(), prologueLength);
-+        bce->tryNoteList.finish(data->tryNotes(), prologueLength);
-     }
-     if (bce->scopeNoteList.length() != 0) {
--        bce->scopeNoteList.finish(script->scopeNotes(), prologueLength);
--    }
-+        bce->scopeNoteList.finish(data->scopeNotes(), prologueLength);
-+    }
-+
-     script->bitFields_.strict_ = bce->sc->strict();
-     script->bitFields_.explicitUseStrict_ = bce->sc->hasExplicitUseStrict();
-     script->bitFields_.bindingsAccessedDynamically_ = bce->sc->bindingsAccessedDynamically();
-     script->bitFields_.hasSingletons_ = bce->hasSingletons;
- 
-     script->nfixed_ = bce->maxFixedSlots;
-     script->nslots_ = nslots;
-     script->bodyScopeIndex_ = bce->bodyScopeIndex;
-@@ -3775,17 +3586,17 @@ JSScript::fullyInitFromEmitter(JSContext
-         initFromFunctionBox(script, bce->sc->asFunctionBox());
-     } else if (bce->sc->isModuleContext()) {
-         initFromModuleContext(script);
-     }
- 
-     // Copy yield offsets last, as the generator kind is set in
-     // initFromFunctionBox.
-     if (bce->yieldAndAwaitOffsetList.length() != 0) {
--        bce->yieldAndAwaitOffsetList.finish(script->yieldAndAwaitOffsets(), prologueLength);
-+        bce->yieldAndAwaitOffsetList.finish(data->yieldAndAwaitOffsets(), prologueLength);
-     }
- 
- #ifdef DEBUG
-     script->assertValidJumpTargets();
- #endif
- 
-     return true;
- }
-@@ -3856,17 +3667,17 @@ size_t
- JSScript::computedSizeOfData() const
- {
-     return dataSize();
- }
- 
- size_t
- JSScript::sizeOfData(mozilla::MallocSizeOf mallocSizeOf) const
- {
--    return mallocSizeOf(data);
-+    return mallocSizeOf(data_);
- }
- 
- size_t
- JSScript::sizeOfTypeScript(mozilla::MallocSizeOf mallocSizeOf) const
- {
-     return types_ ? types_->sizeOfIncludingThis(mallocSizeOf) : 0;
- }
- 
-@@ -3898,19 +3709,19 @@ JSScript::finalize(FreeOp* fop)
-         types_->destroy();
-     }
- 
-     jit::DestroyJitScripts(fop, this);
- 
-     destroyScriptCounts();
-     destroyDebugScript(fop);
- 
--    if (data) {
--        JS_POISON(data, 0xdb, computedSizeOfData(), MemCheckKind::MakeNoAccess);
--        fop->free_(data);
-+    if (data_) {
-+        JS_POISON(data_, 0xdb, computedSizeOfData(), MemCheckKind::MakeNoAccess);
-+        fop->free_(data_);
-     }
- 
-     if (scriptData_) {
-         scriptData_->decRefCount();
-     }
- 
-     // In most cases, our LazyScript's script pointer will reference this
-     // script, and thus be nulled out by normal weakref processing. However, if
-@@ -4152,24 +3963,16 @@ js::DescribeScriptedCallerForCompilation
-         maybeScript.set(iter.script());
-         *pcOffset = iter.pc() - maybeScript->code();
-     } else {
-         maybeScript.set(nullptr);
-         *pcOffset = 0;
-     }
- }
- 
--template <class T>
--static inline T*
--Rebase(JSScript* dst, JSScript* src, T* srcp)
--{
--    size_t off = reinterpret_cast<uint8_t*>(srcp) - src->data;
--    return reinterpret_cast<T*>(dst->data + off);
--}
--
- static JSObject*
- CloneInnerInterpretedFunction(JSContext* cx, HandleScope enclosingScope, HandleFunction srcFun)
- {
-     /* NB: Keep this in sync with XDRInterpretedFunction. */
-     RootedObject cloneProto(cx);
-     if (srcFun->isGenerator() || srcFun->isAsync()) {
-         cloneProto = GlobalObject::getOrCreateGeneratorFunctionPrototype(cx, cx->global());
-         if (!cloneProto) {
-@@ -4222,28 +4025,27 @@ js::detail::CopyScript(JSContext* cx, Ha
-         return false;
-     }
- 
-     /* NB: Keep this in sync with XDRScript. */
- 
-     /* Some embeddings are not careful to use ExposeObjectToActiveJS as needed. */
-     MOZ_ASSERT(!src->sourceObject()->isMarkedGray());
- 
-+    uint32_t nscopes = src->scopes().size();
-+#ifdef DEBUG
-     uint32_t nconsts = src->hasConsts() ? src->consts().size() : 0;
-+#endif
-     uint32_t nobjects = src->hasObjects() ? src->objects().size() : 0;
--    uint32_t nscopes = src->scopes().size();
--    uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes().size() : 0;
--    uint32_t nscopenotes = src->hasScopeNotes() ? src->scopeNotes().size() : 0;
--    uint32_t nyieldoffsets = src->hasYieldAndAwaitOffsets() ? src->yieldAndAwaitOffsets().size() : 0;
- 
-     /* Script data */
- 
-     size_t size = src->dataSize();
-     UniquePtr<uint8_t, JS::FreePolicy> data(AllocScriptData(cx, size));
--    if (size && !data) {
-+    if (!data) {
-         return false;
-     }
- 
-     /* Scopes */
- 
-     // The passed in scopes vector contains body scopes that needed to be
-     // cloned especially, depending on whether the script is a function or
-     // global scope. Starting at scopes.length() means we only deal with
-@@ -4299,23 +4101,19 @@ js::detail::CopyScript(JSContext* cx, Ha
-             }
- 
-             if (!clone || !objects.append(clone)) {
-                 return false;
-             }
-         }
-     }
- 
--    /* This assignment must occur before all the Rebase calls. */
--    dst->data = data.release();
-+    dst->data_ = reinterpret_cast<js::PrivateScriptData*>(data.release());
-     dst->dataSize_ = size;
--    MOZ_ASSERT(bool(dst->data) == bool(src->data));
--    if (dst->data) {
--        memcpy(dst->data, src->data, size);
--    }
-+    memcpy(dst->data_, src->data_, size);
- 
-     if (cx->zone() != src->zoneFromAnyThread()) {
-         for (size_t i = 0; i < src->scriptData()->natoms(); i++) {
-             cx->markAtom(src->scriptData()->atoms()[i]);
-         }
-     }
- 
-     /* Script filenames, bytecodes and atoms are runtime-wide. */
-@@ -4332,17 +4130,16 @@ js::detail::CopyScript(JSContext* cx, Ha
-         dst->setArgumentsHasVarBinding();
-         if (src->analyzedArgsUsage()) {
-             dst->setNeedsArgsObj(src->needsArgsObj());
-         }
-     }
-     dst->bitFields_.hasMappedArgsObj_ = src->hasMappedArgsObj();
-     dst->bitFields_.functionHasThisBinding_ = src->functionHasThisBinding();
-     dst->bitFields_.functionHasExtraBodyVarScope_ = src->functionHasExtraBodyVarScope();
--    dst->cloneHasArray(src);
-     dst->bitFields_.strict_ = src->strict();
-     dst->bitFields_.explicitUseStrict_ = src->explicitUseStrict();
-     dst->bitFields_.hasNonSyntacticScope_ = scopes[0]->hasOnChain(ScopeKind::NonSyntactic);
-     dst->bitFields_.bindingsAccessedDynamically_ = src->bindingsAccessedDynamically();
-     dst->bitFields_.funHasExtensibleScope_ = src->funHasExtensibleScope();
-     dst->bitFields_.funHasAnyAliasedFormal_ = src->funHasAnyAliasedFormal();
-     dst->bitFields_.hasSingletons_ = src->hasSingletons();
-     dst->bitFields_.treatAsRunOnce_ = src->treatAsRunOnce();
-@@ -4350,48 +4147,37 @@ js::detail::CopyScript(JSContext* cx, Ha
-     dst->setGeneratorKind(src->generatorKind());
-     dst->bitFields_.isDerivedClassConstructor_ = src->isDerivedClassConstructor();
-     dst->bitFields_.needsHomeObject_ = src->needsHomeObject();
-     dst->bitFields_.isDefaultClassConstructor_ = src->isDefaultClassConstructor();
-     dst->bitFields_.isAsync_ = src->bitFields_.isAsync_;
-     dst->bitFields_.hasRest_ = src->bitFields_.hasRest_;
-     dst->bitFields_.hideScriptFromDebugger_ = src->bitFields_.hideScriptFromDebugger_;
- 
--    if (nconsts != 0) {
--        GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->constsRaw()->vector);
--        dst->constsRaw()->vector = vector;
-+    {
-+        auto array = dst->data_->scopes();
-+        for (uint32_t i = 0; i < nscopes; ++i) {
-+            array[i].init(scopes[i]);
-+        }
-+    }
-+#ifdef DEBUG
-+    if (nconsts) {
-+        auto array = dst->data_->consts();
-         for (unsigned i = 0; i < nconsts; ++i) {
-             // We don't support GCThings here and thus don't need to call |init|.
--            MOZ_ASSERT(!vector[i].isGCThing());
--        }
--    }
--    if (nobjects != 0) {
--        GCPtrObject* vector = Rebase<GCPtrObject>(dst, src, src->objectsRaw()->vector);
--        dst->objectsRaw()->vector = vector;
--        for (unsigned i = 0; i < nobjects; ++i) {
--            vector[i].init(&objects[i]->as<NativeObject>());
-+            MOZ_ASSERT(!array[i].isGCThing());
-         }
-     }
--    {
--        GCPtrScope* vector = Rebase<GCPtrScope>(dst, src, src->scopesRaw()->vector);
--        dst->scopesRaw()->vector = vector;
--        for (uint32_t i = 0; i < nscopes; ++i) {
--            vector[i].init(scopes[i]);
-+#endif
-+    if (nobjects) {
-+        auto array = dst->data_->objects();
-+        for (unsigned i = 0; i < nobjects; ++i) {
-+            array[i].init(objects[i]);
-         }
-     }
--    if (ntrynotes != 0) {
--        dst->trynotesRaw()->vector = Rebase<JSTryNote>(dst, src, src->trynotesRaw()->vector);
--    }
--    if (nscopenotes != 0) {
--        dst->scopeNotesRaw()->vector = Rebase<ScopeNote>(dst, src, src->scopeNotesRaw()->vector);
--    }
--    if (nyieldoffsets != 0) {
--        dst->yieldAndAwaitOffsetsRaw().vector_ =
--            Rebase<uint32_t>(dst, src, src->yieldAndAwaitOffsetsRaw().vector_);
--    }
- 
-     return true;
- }
- 
- static JSScript*
- CreateEmptyScriptForClone(JSContext* cx, HandleScript src)
- {
-     /*
-@@ -4725,35 +4511,24 @@ JSScript::traceChildren(JSTracer* trc)
-     // may have created it and partially initialized it with
-     // JSScript::Create(), but not yet finished initializing it with
-     // fullyInitFromEmitter() or fullyInitTrivial().
- 
-     MOZ_ASSERT_IF(trc->isMarkingTracer() &&
-                   GCMarker::fromTracer(trc)->shouldCheckCompartments(),
-                   zone()->isCollecting());
- 
-+    if (data_) {
-+        data_->traceChildren(trc);
-+    }
-+
-     if (scriptData()) {
-         scriptData()->traceChildren(trc);
-     }
- 
--    if (data) {
--        auto array = scopes();
--        TraceRange(trc, array.size(), array.data(), "scopes");
--    }
--
--    if (hasConsts()) {
--        auto array = consts();
--        TraceRange(trc, array.size(), array.data(), "consts");
--    }
--
--    if (hasObjects()) {
--        auto array = objects();
--        TraceRange(trc, array.size(), array.data(), "objects");
--    }
--
-     MOZ_ASSERT_IF(sourceObject(), MaybeForwarded(sourceObject())->compartment() == compartment());
-     TraceNullableEdge(trc, &sourceObject_, "sourceObject");
- 
-     if (maybeLazyScript()) {
-         TraceManuallyBarrieredEdge(trc, &lazyScript, "lazyScript");
-     }
- 
-     if (trc->isMarkingTracer()) {
-diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h
---- a/js/src/vm/JSScript.h
-+++ b/js/src/vm/JSScript.h
-@@ -142,63 +142,16 @@ struct ScopeNote {
-                                 // NoScopeIndex if there is no block scope in
-                                 // this range.
-     uint32_t        start;      // Bytecode offset at which this scope starts
-                                 // relative to script->code().
-     uint32_t        length;     // Bytecode length of scope.
-     uint32_t        parent;     // Index of parent block scope in notes, or NoScopeNote.
- };
- 
--struct ConstArray {
--    js::GCPtrValue* vector;     // array of indexed constant values
--    uint32_t length;
--};
--
--struct ObjectArray {
--    js::GCPtrObject* vector;    // Array of indexed objects.
--    uint32_t length;            // Count of indexed objects.
--};
--
--struct ScopeArray {
--    js::GCPtrScope* vector;     // Array of indexed scopes.
--    uint32_t        length;     // Count of indexed scopes.
--};
--
--struct TryNoteArray {
--    JSTryNote*      vector;     // Array of indexed try notes.
--    uint32_t        length;     // Count of indexed try notes.
--};
--
--struct ScopeNoteArray {
--    ScopeNote* vector;          // Array of indexed ScopeNote records.
--    uint32_t   length;          // Count of indexed try notes.
--};
--
--class YieldAndAwaitOffsetArray {
--    friend bool
--    detail::CopyScript(JSContext* cx, HandleScript src, HandleScript dst,
--                       MutableHandle<GCVector<Scope*>> scopes);
--
--    uint32_t*       vector_;    // Array of bytecode offsets.
--    uint32_t        length_;    // Count of bytecode offsets.
--
--  public:
--    void init(uint32_t* vector, uint32_t length) {
--        vector_ = vector;
--        length_ = length;
--    }
--    uint32_t& operator[](uint32_t index) {
--        MOZ_ASSERT(index < length_);
--        return vector_[index];
--    }
--    uint32_t length() const {
--        return length_;
--    }
--};
--
- class ScriptCounts
- {
-   public:
-     typedef mozilla::Vector<PCCounts, 0, SystemAllocPolicy> PCCountsVector;
- 
-     inline ScriptCounts();
-     inline explicit ScriptCounts(PCCountsVector&& jumpTargets);
-     inline ScriptCounts(ScriptCounts&& src);
-@@ -1575,23 +1528,23 @@ class JSScript : public js::gc::TenuredC
- {
-   private:
-     // Pointer to baseline->method()->raw(), ion->method()->raw(), a wasm jit
-     // entry, the JIT's EnterInterpreter stub, or the lazy link stub. Must be
-     // non-null.
-     uint8_t* jitCodeRaw_ = nullptr;
-     uint8_t* jitCodeSkipArgCheck_ = nullptr;
- 
-+    // Shareable script data
-     js::SharedScriptData* scriptData_ = nullptr;
- 
-+    // Unshared variable-length data
-+    js::PrivateScriptData* data_ = nullptr;
-+
-   public:
--    // Pointer to variable-length data array (see comment above Create() for
--    // details).
--    uint8_t* data = nullptr;
--
-     JS::Realm* realm_ = nullptr;
- 
-   private:
-     /* Persistent type information retained across GCs. */
-     js::TypeScript* types_ = nullptr;
- 
-     // This script's ScriptSourceObject, or a CCW thereof.
-     //
-@@ -1710,24 +1663,16 @@ class JSScript : public js::gc::TenuredC
-     {
-         /*
-          * Bit-fields can't have member initializers til C++2a, i.e. probably
-          * C++20, so we can't initialize these to zero in place.  Instead we
-          * braced-init this to all zeroes in the JSScript constructor, then
-          * custom-assign particular bit-fields in the constructor body.
-          */
- 
--        // The bits in this field indicate the presence/non-presence of several
--        // optional arrays in |data|.  See the comments above Create() for details.
--        uint8_t hasArrayBits_ : ARRAY_KIND_BITS;
--
--        /*
--         * All remaining bit-fields are single-bit bools.
--         */
--
-         // No need for result value of last expression statement.
-         bool noScriptRval_ : 1;
- 
-         // Code is in strict mode.
-         bool strict_ : 1;
- 
-         // Code has "use strict"; explicitly.
-         bool explicitUseStrict_ : 1;
-@@ -2563,109 +2508,53 @@ class JSScript : public js::gc::TenuredC
-      * computedSizeOfData() is the in-use size of all the data sections.
-      * sizeOfData() is the size of the block allocated to hold all the data
-      * sections (which can be larger than the in-use size).
-      */
-     size_t computedSizeOfData() const;
-     size_t sizeOfData(mozilla::MallocSizeOf mallocSizeOf) const;
-     size_t sizeOfTypeScript(mozilla::MallocSizeOf mallocSizeOf) const;
- 
--    bool hasArray(ArrayKind kind) const {
--        return bitFields_.hasArrayBits_ & (1 << kind);
--    }
--    void setHasArray(ArrayKind kind) { bitFields_.hasArrayBits_ |= (1 << kind); }
--    void cloneHasArray(JSScript* script) {
--        bitFields_.hasArrayBits_ = script->bitFields_.hasArrayBits_;
--    }
--
--    bool hasConsts() const       { return hasArray(CONSTS); }
--    bool hasObjects() const      { return hasArray(OBJECTS); }
--    bool hasTrynotes() const     { return hasArray(TRYNOTES); }
--    bool hasScopeNotes() const   { return hasArray(SCOPENOTES); }
-+    size_t dataSize() const { return dataSize_; }
-+
-+    bool hasConsts() const       { return data_->hasConsts(); }
-+    bool hasObjects() const      { return data_->hasObjects(); }
-+    bool hasTrynotes() const     { return data_->hasTryNotes(); }
-+    bool hasScopeNotes() const   { return data_->hasScopeNotes(); }
-     bool hasYieldAndAwaitOffsets() const {
--        return isGenerator() || isAsync();
-+        return data_->hasYieldOffsets();
-     }
- 
--#define OFF(fooOff, hasFoo, t)   (fooOff() + (hasFoo() ? sizeof(t) : 0))
--
--    size_t scopesOffset() const       { return 0; }
--    size_t constsOffset() const       { return scopesOffset() + sizeof(js::ScopeArray); }
--    size_t objectsOffset() const      { return OFF(constsOffset,     hasConsts,     js::ConstArray); }
--    size_t trynotesOffset() const     { return OFF(objectsOffset,    hasObjects,    js::ObjectArray); }
--    size_t scopeNotesOffset() const   { return OFF(trynotesOffset,   hasTrynotes,   js::TryNoteArray); }
--    size_t yieldAndAwaitOffsetsOffset() const {
--        return OFF(scopeNotesOffset, hasScopeNotes, js::ScopeNoteArray);
-+    mozilla::Span<const js::GCPtrScope> scopes() const {
-+        return data_->scopes();
-     }
- 
--#undef OFF
--
--    size_t dataSize() const { return dataSize_; }
--
--  private:
--
--    js::ConstArray* constsRaw() const {
-+    mozilla::Span<const js::GCPtrValue> consts() const {
-         MOZ_ASSERT(hasConsts());
--        return reinterpret_cast<js::ConstArray*>(data + constsOffset());
--    }
--
--    js::ObjectArray* objectsRaw() const {
--        MOZ_ASSERT(hasObjects());
--        return reinterpret_cast<js::ObjectArray*>(data + objectsOffset());
--    }
--
--    js::ScopeArray* scopesRaw() const {
--        return reinterpret_cast<js::ScopeArray*>(data + scopesOffset());
-+        return data_->consts();
-     }
- 
--    js::TryNoteArray* trynotesRaw() const {
--        MOZ_ASSERT(hasTrynotes());
--        return reinterpret_cast<js::TryNoteArray*>(data + trynotesOffset());
--    }
--
--    js::ScopeNoteArray* scopeNotesRaw() const {
--        MOZ_ASSERT(hasScopeNotes());
--        return reinterpret_cast<js::ScopeNoteArray*>(data + scopeNotesOffset());
-+    mozilla::Span<const js::GCPtrObject> objects() const {
-+        MOZ_ASSERT(hasObjects());
-+        return data_->objects();
-     }
- 
--    js::YieldAndAwaitOffsetArray& yieldAndAwaitOffsetsRaw() const {
--        MOZ_ASSERT(hasYieldAndAwaitOffsets());
--        return *reinterpret_cast<js::YieldAndAwaitOffsetArray*>(data +
--                                                                yieldAndAwaitOffsetsOffset());
--    }
--
--  public:
--
--    mozilla::Span<js::GCPtrValue> consts() const {
--        js::ConstArray* array = constsRaw();
--        return mozilla::MakeSpan(array->vector, array->length);
-+    mozilla::Span<const JSTryNote> trynotes() const {
-+        MOZ_ASSERT(hasTrynotes());
-+        return data_->tryNotes();
-     }
- 
--    mozilla::Span<js::GCPtrObject> objects() const {
--        js::ObjectArray* array = objectsRaw();
--        return mozilla::MakeSpan(array->vector, array->length);
--    }
--
--    mozilla::Span<js::GCPtrScope> scopes() const {
--        js::ScopeArray* array = scopesRaw();
--        return mozilla::MakeSpan(array->vector, array->length);
-+    mozilla::Span<const js::ScopeNote> scopeNotes() const {
-+        MOZ_ASSERT(hasScopeNotes());
-+        return data_->scopeNotes();
-     }
- 
--    mozilla::Span<JSTryNote> trynotes() const {
--        js::TryNoteArray* array = trynotesRaw();
--        return mozilla::MakeSpan(array->vector, array->length);
--    }
--
--    mozilla::Span<js::ScopeNote> scopeNotes() const {
--        js::ScopeNoteArray* array = scopeNotesRaw();
--        return mozilla::MakeSpan(array->vector, array->length);
--    }
--
--    mozilla::Span<uint32_t> yieldAndAwaitOffsets() const {
--        js::YieldAndAwaitOffsetArray& array = yieldAndAwaitOffsetsRaw();
--        return mozilla::MakeSpan(&array[0], array.length());
-+    mozilla::Span<const uint32_t> yieldAndAwaitOffsets() const {
-+        MOZ_ASSERT(hasYieldAndAwaitOffsets());
-+        return data_->yieldAndAwaitOffsets();
-     }
- 
-     bool hasLoops();
- 
-     uint32_t numNotes() const {
-         MOZ_ASSERT(scriptData_);
-         return scriptData_->numNotes();
-     }

+ 0 - 47
frg/work-js/mozilla-release/patches/mozilla-esr60_450803.patch

@@ -1,47 +0,0 @@
-# HG changeset patch
-# User Ryan VanderMeulen <ryanvm@gmail.com>
-# Date 1546645264 18000
-#      Fr Jan 04 18:41:04 2019 -0500
-# Node ID 50fda92eb56ba1c584b80f123a110a8281d0e259
-# Parent  6590fd8ab9c3c1365dd852613bc6a54e28402609
-Bug 1516738 - Remove the test on ESR60 since it requires testing functions which aren't available on that branch. a=bustage DONTBUILD
-
-diff --git a/js/src/jit-test/tests/wasm/regress/baseline-extend8.js b/js/src/jit-test/tests/wasm/regress/baseline-extend8.js
-deleted file mode 100644
---- a/js/src/jit-test/tests/wasm/regress/baseline-extend8.js
-+++ /dev/null
-@@ -1,34 +0,0 @@
--// This attempts to test that we can do an 8-bit sign extend no matter what the
--// source register.  This test is arguably somewhat tied to the baseline
--// compiler's register allocator, but is still appropriate for most simple
--// register allocators.  It works by filling an increasing number of registers
--// with values so as eventually to force the source operand for extend8_s into a
--// register that does not have a byte personality.
--
--for ( let i=0; i < 8; i++) {
--    let txt =
--        `(module
--           (func (export "f") (param i32) (result i32)
--           ${adds(i)}
--           (set_local 0 (i32.extend8_s (i32.add (get_local 0) (i32.const 1))))
--           ${drops(i)}
--           (get_local 0)))`;
--    let ins = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(txt)));
--    assertEq(ins.exports.f(254), -1);
--}
--
--function adds(n) {
--    let s = ""
--    for ( let i=0; i < n; i++ )
--        s += "(i32.add (get_local 0) (i32.const 1))\n";
--    return s;
--}
--
--function drops(n) {
--    let s = "";
--    for ( let i=0; i < n; i++ )
--        s += "drop\n";
--    return s;
--}
--
--

+ 0 - 342
frg/work-js/mozilla-release/patches/mozilla-esr78-push_444862.patch

@@ -1,342 +0,0 @@
-# HG changeset patch
-# User Ben Kelly <ben@wanderview.com>
-# Date 1511295184 18000
-#      Tue Nov 21 15:13:04 2017 -0500
-# Node ID 0f356a5c4dea9aa3cc0f806f74338beb484b9f12
-# Parent  e6ace8b5531cd2f50b6685ef8fdb180afcd9344e
-Bug 1419536 P1 Add a helper to handle Client objects properly on nsIChannels. r=baku
-
-diff --git a/dom/clients/manager/ClientChannelHelper.cpp b/dom/clients/manager/ClientChannelHelper.cpp
-new file mode 100644
---- /dev/null
-+++ b/dom/clients/manager/ClientChannelHelper.cpp
-@@ -0,0 +1,256 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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/. */
-+
-+#include "ClientChannelHelper.h"
-+
-+#include "ClientManager.h"
-+#include "ClientSource.h"
-+#include "MainThreadUtils.h"
-+#include "mozilla/dom/ServiceWorkerDescriptor.h"
-+#include "mozilla/ipc/BackgroundUtils.h"
-+#include "nsContentUtils.h"
-+#include "nsIAsyncVerifyRedirectCallback.h"
-+#include "nsIChannel.h"
-+#include "nsIChannelEventSink.h"
-+#include "nsIDocShell.h"
-+#include "nsIInterfaceRequestor.h"
-+#include "nsIInterfaceRequestorUtils.h"
-+
-+namespace mozilla {
-+namespace dom {
-+
-+using mozilla::ipc::PrincipalInfoToPrincipal;
-+
-+namespace {
-+
-+class ClientChannelHelper final : public nsIInterfaceRequestor
-+                                , public nsIChannelEventSink
-+{
-+  nsCOMPtr<nsIInterfaceRequestor> mOuter;
-+  nsCOMPtr<nsISerialEventTarget> mEventTarget;
-+
-+  ~ClientChannelHelper() = default;
-+
-+  NS_IMETHOD
-+  GetInterface(const nsIID& aIID, void** aResultOut) override
-+  {
-+    if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) {
-+      *aResultOut = static_cast<nsIChannelEventSink*>(this);
-+      NS_ADDREF_THIS();
-+      return NS_OK;
-+    }
-+
-+    if (mOuter) {
-+      return mOuter->GetInterface(aIID, aResultOut);
-+    }
-+
-+    return NS_ERROR_NO_INTERFACE;
-+  }
-+
-+  NS_IMETHOD
-+  AsyncOnChannelRedirect(nsIChannel* aOldChannel,
-+                         nsIChannel* aNewChannel,
-+                         uint32_t aFlags,
-+                         nsIAsyncVerifyRedirectCallback *aCallback) override
-+  {
-+    MOZ_ASSERT(NS_IsMainThread());
-+
-+    nsCOMPtr<nsILoadInfo> oldLoadInfo;
-+    nsresult rv = aOldChannel->GetLoadInfo(getter_AddRefs(oldLoadInfo));
-+    NS_ENSURE_SUCCESS(rv, rv);
-+
-+    nsCOMPtr<nsILoadInfo> newLoadInfo;
-+    rv = aNewChannel->GetLoadInfo(getter_AddRefs(newLoadInfo));
-+    NS_ENSURE_SUCCESS(rv, rv);
-+
-+    rv = nsContentUtils::CheckSameOrigin(aOldChannel, aNewChannel);
-+    if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_DOM_BAD_URI)) {
-+      return rv;
-+    }
-+
-+    UniquePtr<ClientSource> reservedClient = oldLoadInfo->TakeReservedClientSource();
-+
-+    // If its a same-origin redirect we just move our reserved client to the
-+    // new channel.
-+    if (NS_SUCCEEDED(rv)) {
-+      if (reservedClient) {
-+        newLoadInfo->GiveReservedClientSource(Move(reservedClient));
-+      }
-+
-+      // It seems sometimes necko passes two channels with the same LoadInfo.
-+      // We only need to move the reserved/initial ClientInfo over if we
-+      // actually have a different LoadInfo.
-+      else if (oldLoadInfo != newLoadInfo) {
-+        const Maybe<ClientInfo>& reservedClientInfo =
-+          oldLoadInfo->GetReservedClientInfo();
-+
-+        const Maybe<ClientInfo>& initialClientInfo =
-+          oldLoadInfo->GetInitialClientInfo();
-+
-+        MOZ_DIAGNOSTIC_ASSERT(reservedClientInfo.isNothing() ||
-+                              initialClientInfo.isNothing());
-+
-+        if (reservedClientInfo.isSome()) {
-+          newLoadInfo->SetReservedClientInfo(reservedClientInfo.ref());
-+        }
-+
-+        if (initialClientInfo.isSome()) {
-+          newLoadInfo->SetInitialClientInfo(initialClientInfo.ref());
-+        }
-+      }
-+
-+      // Make sure we keep the service worker controller on same-origin
-+      // internal redirects.
-+      if (oldLoadInfo != newLoadInfo &&
-+          aFlags & nsIChannelEventSink::REDIRECT_INTERNAL) {
-+        const Maybe<ServiceWorkerDescriptor>& controller = oldLoadInfo->GetController();
-+        if (controller.isSome()) {
-+          newLoadInfo->SetController(controller.ref());
-+        }
-+      }
-+    }
-+
-+    // If it's a cross-origin redirect then we discard the old reserved client
-+    // and create a new one.
-+    else {
-+      // If CheckSameOrigin() worked, then the security manager must exist.
-+      nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
-+      MOZ_DIAGNOSTIC_ASSERT(ssm);
-+
-+      nsCOMPtr<nsIPrincipal> principal;
-+      rv = ssm->GetChannelResultPrincipal(aNewChannel, getter_AddRefs(principal));
-+      NS_ENSURE_SUCCESS(rv, rv);
-+
-+      // Create the new ClientSource.  This should only happen for window
-+      // Clients since support cross-origin redirects are blocked by the
-+      // same-origin security policy.
-+      reservedClient.reset();
-+      reservedClient = ClientManager::CreateSource(ClientType::Window,
-+                                                   mEventTarget, principal);
-+
-+      newLoadInfo->GiveReservedClientSource(Move(reservedClient));
-+    }
-+
-+    nsCOMPtr<nsIChannelEventSink> outerSink = do_GetInterface(mOuter);
-+    if (outerSink) {
-+      return outerSink->AsyncOnChannelRedirect(aOldChannel, aNewChannel, aFlags,
-+                                               aCallback);
-+    }
-+
-+    aCallback->OnRedirectVerifyCallback(NS_OK);
-+    return NS_OK;
-+  }
-+
-+public:
-+  ClientChannelHelper(nsIInterfaceRequestor* aOuter,
-+                      nsISerialEventTarget* aEventTarget)
-+    : mOuter(aOuter)
-+    , mEventTarget(aEventTarget)
-+  {
-+  }
-+
-+  NS_DECL_ISUPPORTS
-+};
-+
-+NS_IMPL_ISUPPORTS(ClientChannelHelper, nsIInterfaceRequestor,
-+                                       nsIChannelEventSink);
-+
-+} // anonymous namespace
-+
-+nsresult
-+AddClientChannelHelper(nsIChannel* aChannel,
-+                       Maybe<ClientInfo>&& aReservedClientInfo,
-+                       Maybe<ClientInfo>&& aInitialClientInfo,
-+                       nsISerialEventTarget* aEventTarget)
-+{
-+  MOZ_ASSERT(NS_IsMainThread());
-+
-+  Maybe<ClientInfo> initialClientInfo(Move(aInitialClientInfo));
-+  Maybe<ClientInfo> reservedClientInfo(Move(aReservedClientInfo));
-+  MOZ_DIAGNOSTIC_ASSERT(reservedClientInfo.isNothing() ||
-+                        initialClientInfo.isNothing());
-+
-+  nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
-+  NS_ENSURE_TRUE(loadInfo, NS_ERROR_FAILURE);
-+
-+  nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
-+  NS_ENSURE_TRUE(ssm, NS_ERROR_FAILURE);
-+
-+  nsCOMPtr<nsIPrincipal> channelPrincipal;
-+  nsresult rv = ssm->GetChannelResultPrincipal(aChannel, getter_AddRefs(channelPrincipal));
-+  NS_ENSURE_SUCCESS(rv, rv);
-+
-+  // Only allow the initial ClientInfo to be set if the current channel
-+  // principal matches.
-+  if (initialClientInfo.isSome()) {
-+    nsCOMPtr<nsIPrincipal> initialPrincipal =
-+      PrincipalInfoToPrincipal(initialClientInfo.ref().PrincipalInfo(), nullptr);
-+
-+    bool equals = false;
-+    rv = initialPrincipal ? initialPrincipal->Equals(channelPrincipal, &equals)
-+                          : NS_ERROR_FAILURE;
-+    if (NS_FAILED(rv) || !equals) {
-+      initialClientInfo.reset();
-+    }
-+  }
-+
-+  // Only allow the reserved ClientInfo to be set if the current channel
-+  // principal matches.
-+  if (reservedClientInfo.isSome()) {
-+    nsCOMPtr<nsIPrincipal> reservedPrincipal =
-+      PrincipalInfoToPrincipal(reservedClientInfo.ref().PrincipalInfo(), nullptr);
-+
-+    bool equals = false;
-+    rv = reservedPrincipal ? reservedPrincipal->Equals(channelPrincipal, &equals)
-+                           : NS_ERROR_FAILURE;
-+    if (NS_FAILED(rv) || !equals) {
-+      reservedClientInfo.reset();
-+    }
-+  }
-+
-+  nsCOMPtr<nsIInterfaceRequestor> outerCallbacks;
-+  rv = aChannel->GetNotificationCallbacks(getter_AddRefs(outerCallbacks));
-+  NS_ENSURE_SUCCESS(rv, rv);
-+
-+  UniquePtr<ClientSource> reservedClient;
-+  if (initialClientInfo.isNothing() && reservedClientInfo.isNothing()) {
-+    // Wait to reserve the client until we are reasonably sure this method
-+    // will succeed.  We should only follow this path for window clients.
-+    // Workers should always provide a reserved ClientInfo since their
-+    // ClientSource object is owned by a different thread.
-+    reservedClient = ClientManager::CreateSource(ClientType::Window,
-+                                                 aEventTarget,
-+                                                 channelPrincipal);
-+    NS_ENSURE_TRUE(reservedClient, NS_ERROR_FAILURE);
-+  }
-+
-+  RefPtr<ClientChannelHelper> helper =
-+    new ClientChannelHelper(outerCallbacks, aEventTarget);
-+
-+  // Only set the callbacks helper if we are able to reserve the client
-+  // successfully.
-+  rv = aChannel->SetNotificationCallbacks(helper);
-+  NS_ENSURE_SUCCESS(rv, rv);
-+
-+  // Finally preserve the various client values on the nsILoadInfo once the
-+  // redirect helper has been added to the channel.
-+  if (reservedClient) {
-+    loadInfo->GiveReservedClientSource(Move(reservedClient));
-+  }
-+
-+  if (initialClientInfo.isSome()) {
-+    loadInfo->SetInitialClientInfo(initialClientInfo.ref());
-+  }
-+
-+  if (reservedClientInfo.isSome()) {
-+    loadInfo->SetReservedClientInfo(reservedClientInfo.ref());
-+  }
-+
-+  return NS_OK;
-+}
-+
-+} // namespace dom
-+} // namespace mozilla
-diff --git a/dom/clients/manager/ClientChannelHelper.h b/dom/clients/manager/ClientChannelHelper.h
-new file mode 100644
---- /dev/null
-+++ b/dom/clients/manager/ClientChannelHelper.h
-@@ -0,0 +1,34 @@
-+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * 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_ClientChannelHelper_h
-+#define _mozilla_dom_ClientChannelHelper_h
-+
-+#include "mozilla/Maybe.h"
-+#include "nsError.h"
-+
-+class nsIChannel;
-+class nsISerialEventTarget;
-+
-+namespace mozilla {
-+namespace dom {
-+
-+class ClientInfo;
-+
-+// Attach a redirect listener to the given nsIChannel that will manage
-+// the various client values on the channel's LoadInfo.  This will
-+// properly handle creating a new ClientSource on cross-origin redirect
-+// and propagate the current reserved/initial client on same-origin
-+// redirect.
-+nsresult
-+AddClientChannelHelper(nsIChannel* aChannel,
-+                       Maybe<ClientInfo>&& aReservedClientInfo,
-+                       Maybe<ClientInfo>&& aInitialClientInfo,
-+                       nsISerialEventTarget* aEventTarget);
-+
-+} // namespace dom
-+} // namespace mozilla
-+
-+#endif // _mozilla_dom_ClientChannelHelper_h
-diff --git a/dom/clients/manager/moz.build b/dom/clients/manager/moz.build
---- a/dom/clients/manager/moz.build
-+++ b/dom/clients/manager/moz.build
-@@ -1,28 +1,30 @@
- # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
- # vim: set filetype=python:
- # This Source Code Form is subject to the terms of the Mozilla Public
- # 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/.
- 
- EXPORTS.mozilla.dom += [
-+  'ClientChannelHelper.h',
-   'ClientHandle.h',
-   'ClientInfo.h',
-   'ClientIPCUtils.h',
-   'ClientManager.h',
-   'ClientManagerActors.h',
-   'ClientOpenWindowOpActors.h',
-   'ClientOpPromise.h',
-   'ClientSource.h',
-   'ClientState.h',
-   'ClientThing.h',
- ]
- 
- UNIFIED_SOURCES += [
-+  'ClientChannelHelper.cpp',
-   'ClientHandle.cpp',
-   'ClientHandleChild.cpp',
-   'ClientHandleOpChild.cpp',
-   'ClientHandleOpParent.cpp',
-   'ClientHandleParent.cpp',
-   'ClientInfo.cpp',
-   'ClientManager.cpp',
-   'ClientManagerActors.cpp',

+ 0 - 343
frg/work-js/mozilla-release/patches/mozilla-esr78-push_444863.patch

@@ -1,343 +0,0 @@
-# HG changeset patch
-# User Ben Kelly <ben@wanderview.com>
-# Date 1511295184 18000
-#      Tue Nov 21 15:13:04 2017 -0500
-# Node ID 061c5b3ee4d4a7874f4496835cdf1b7c29875a67
-# Parent  0f356a5c4dea9aa3cc0f806f74338beb484b9f12
-Bug 1419536 P2 Create a ClientSource for the WorkerPrivate and mark it execution ready after the script loads. r=baku
-
-diff --git a/dom/webidl/Clients.webidl b/dom/webidl/Clients.webidl
---- a/dom/webidl/Clients.webidl
-+++ b/dom/webidl/Clients.webidl
-@@ -26,11 +26,13 @@ dictionary ClientQueryOptions {
-   boolean includeUncontrolled = false;
-   ClientType type = "window";
- };
- 
- enum ClientType {
-   "window",
-   "worker",
-   "sharedworker",
-+  // https://github.com/w3c/ServiceWorker/issues/1036
-+  "serviceworker",
-   "all"
- };
- 
-diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp
---- a/dom/workers/ScriptLoader.cpp
-+++ b/dom/workers/ScriptLoader.cpp
-@@ -45,16 +45,18 @@
- #include "mozilla/LoadContext.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/ipc/BackgroundUtils.h"
- #include "mozilla/dom/CacheBinding.h"
- #include "mozilla/dom/cache/CacheTypes.h"
- #include "mozilla/dom/cache/Cache.h"
- #include "mozilla/dom/cache/CacheStorage.h"
- #include "mozilla/dom/ChannelInfo.h"
-+#include "mozilla/dom/ClientChannelHelper.h"
-+#include "mozilla/dom/ClientInfo.h"
- #include "mozilla/dom/Exceptions.h"
- #include "mozilla/dom/InternalResponse.h"
- #include "mozilla/dom/nsCSPService.h"
- #include "mozilla/dom/nsCSPUtils.h"
- #include "mozilla/dom/Promise.h"
- #include "mozilla/dom/PromiseNativeHandler.h"
- #include "mozilla/dom/Response.h"
- #include "mozilla/dom/ScriptLoader.h"
-@@ -254,16 +256,17 @@ struct ScriptLoadInfo
-   // resolution.
-   RefPtr<Promise> mCachePromise;
- 
-   // The reader stream the cache entry should be filled from, for those cases
-   // when we're going to have an mCachePromise.
-   nsCOMPtr<nsIInputStream> mCacheReadStream;
- 
-   nsCOMPtr<nsIChannel> mChannel;
-+  Maybe<ClientInfo> mReservedClientInfo;
-   char16_t* mScriptTextBuf;
-   size_t mScriptTextLength;
- 
-   nsresult mLoadResult;
-   bool mLoadingFinished;
-   bool mExecutionScheduled;
-   bool mExecutionResult;
- 
-@@ -984,16 +987,27 @@ private:
-     // We don't care about progress so just use the simple stream loader for
-     // OnStreamComplete notification only.
-     nsCOMPtr<nsIStreamLoader> loader;
-     rv = NS_NewStreamLoader(getter_AddRefs(loader), listener);
-     if (NS_WARN_IF(NS_FAILED(rv))) {
-       return rv;
-     }
- 
-+    if (IsMainWorkerScript()) {
-+      MOZ_DIAGNOSTIC_ASSERT(loadInfo.mReservedClientInfo.isSome());
-+      rv = AddClientChannelHelper(channel,
-+                                  Move(loadInfo.mReservedClientInfo),
-+                                  Maybe<ClientInfo>(),
-+                                  mWorkerPrivate->HybridEventTarget());
-+      if (NS_WARN_IF(NS_FAILED(rv))) {
-+        return rv;
-+      }
-+    }
-+
-     if (loadInfo.mCacheStatus != ScriptLoadInfo::ToBeCached) {
-       rv = channel->AsyncOpen2(loader);
-       if (NS_WARN_IF(NS_FAILED(rv))) {
-         return rv;
-       }
-     } else {
-       nsCOMPtr<nsIOutputStream> writer;
- 
-@@ -1962,16 +1976,22 @@ ScriptExecutorRunnable::WorkerRun(JSCont
-                                     loadInfo.mLoadResult, loadInfo.mURL);
-       // Top level scripts only!
-       if (mIsWorkerScript) {
-         aWorkerPrivate->MaybeDispatchLoadFailedRunnable();
-       }
-       return true;
-     }
- 
-+    // If this is a top level script that succeeded, then mark the
-+    // Client execution ready.
-+    if (mIsWorkerScript) {
-+      aWorkerPrivate->ExecutionReady();
-+    }
-+
-     NS_ConvertUTF16toUTF8 filename(loadInfo.mURL);
- 
-     JS::CompileOptions options(aCx);
-     options.setFileAndLine(filename.get(), 1)
-            .setNoScriptRval(true);
- 
-     MOZ_ASSERT(loadInfo.mMutedErrorFlag.isSome());
-     options.setMutedErrors(loadInfo.mMutedErrorFlag.valueOr(true));
-@@ -2256,16 +2276,20 @@ LoadMainScript(WorkerPrivate* aWorkerPri
-                ErrorResult& aRv)
- {
-   nsTArray<ScriptLoadInfo> loadInfos;
- 
-   ScriptLoadInfo* info = loadInfos.AppendElement();
-   info->mURL = aScriptURL;
-   info->mLoadFlags = aWorkerPrivate->GetLoadFlags();
- 
-+  // We are loading the main script, so the worker's Client must be
-+  // reserved.
-+  info->mReservedClientInfo.emplace(aWorkerPrivate->GetClientInfo());
-+
-   LoadAllScripts(aWorkerPrivate, loadInfos, true, aWorkerScriptType, aRv);
- }
- 
- void
- Load(WorkerPrivate* aWorkerPrivate,
-      const nsTArray<nsString>& aScriptURLs, WorkerScriptType aWorkerScriptType,
-      ErrorResult& aRv)
- {
-diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
---- a/dom/workers/WorkerPrivate.cpp
-+++ b/dom/workers/WorkerPrivate.cpp
-@@ -42,16 +42,18 @@
- #include "mozilla/Assertions.h"
- #include "mozilla/Attributes.h"
- #include "mozilla/ContentEvents.h"
- #include "mozilla/EventDispatcher.h"
- #include "mozilla/Likely.h"
- #include "mozilla/LoadContext.h"
- #include "mozilla/Move.h"
- #include "mozilla/dom/BindingUtils.h"
-+#include "mozilla/dom/ClientManager.h"
-+#include "mozilla/dom/ClientSource.h"
- #include "mozilla/dom/Console.h"
- #include "mozilla/dom/DocGroup.h"
- #include "mozilla/dom/ErrorEvent.h"
- #include "mozilla/dom/ErrorEventBinding.h"
- #include "mozilla/dom/Exceptions.h"
- #include "mozilla/dom/ExtendableMessageEventBinding.h"
- #include "mozilla/dom/FunctionBinding.h"
- #include "mozilla/dom/IndexedDatabaseManager.h"
-@@ -593,16 +595,18 @@ private:
-   // run we have not yet done our load so don't know things like our final
-   // principal and whatnot.
- 
-   virtual bool
-   WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
-   {
-     aWorkerPrivate->AssertIsOnWorkerThread();
- 
-+    aWorkerPrivate->EnsureClientSource();
-+
-     ErrorResult rv;
-     scriptloader::LoadMainScript(aWorkerPrivate, mScriptURL, WorkerScript, rv);
-     rv.WouldReportJSException();
-     // Explicitly ignore NS_BINDING_ABORTED on rv.  Or more precisely, still
-     // return false and don't SetWorkerScriptExecutedSuccessfully() in that
-     // case, but don't throw anything on aCx.  The idea is to not dispatch error
-     // events if our load is canceled with that error code.
-     if (rv.ErrorCodeIs(NS_BINDING_ABORTED)) {
-@@ -663,16 +667,18 @@ private:
- 
-     WorkerDebuggerGlobalScope* globalScope =
-       aWorkerPrivate->CreateDebuggerGlobalScope(aCx);
-     if (!globalScope) {
-       NS_WARNING("Failed to make global!");
-       return false;
-     }
- 
-+    aWorkerPrivate->EnsureClientSource();
-+
-     JS::Rooted<JSObject*> global(aCx, globalScope->GetWrapper());
- 
-     ErrorResult rv;
-     JSAutoCompartment ac(aCx, global);
-     scriptloader::LoadMainScript(aWorkerPrivate, mScriptURL,
-                                  DebuggerScript, rv);
-     rv.WouldReportJSException();
-     // Explicitly ignore NS_BINDING_ABORTED on rv.  Or more precisely, still
-@@ -5123,16 +5129,18 @@ WorkerPrivate::DoRunLoop(JSContext* aCx)
-       }
- 
-       // If we're supposed to die then we should exit the loop.
-       if (currentStatus == Killing) {
-         // Flush uncaught rejections immediately, without
-         // waiting for a next tick.
-         PromiseDebugging::FlushUncaughtRejections();
- 
-+        mClientSource = nullptr;
-+
-         ShutdownGCTimers();
- 
-         DisableMemoryReporter();
- 
-         {
-           MutexAutoLock lock(mMutex);
- 
-           mStatus = Dead;
-@@ -5285,16 +5293,60 @@ WorkerPrivate::ControlEventTarget()
- 
- nsISerialEventTarget*
- WorkerPrivate::HybridEventTarget()
- {
-   return mWorkerHybridEventTarget;
- }
- 
- void
-+WorkerPrivate::EnsureClientSource()
-+{
-+  AssertIsOnWorkerThread();
-+
-+  if (mClientSource) {
-+    return;
-+  }
-+
-+  ClientType type;
-+  switch(Type()) {
-+    case WorkerTypeDedicated:
-+      type = ClientType::Worker;
-+      break;
-+    case WorkerTypeShared:
-+      type = ClientType::Sharedworker;
-+      break;
-+    case WorkerTypeService:
-+      type = ClientType::Serviceworker;
-+      break;
-+    default:
-+      MOZ_CRASH("unknown worker type!");
-+  }
-+
-+  mClientSource = ClientManager::CreateSource(type, mWorkerHybridEventTarget,
-+                                              GetPrincipalInfo());
-+}
-+
-+const ClientInfo&
-+WorkerPrivate::GetClientInfo() const
-+{
-+  AssertIsOnWorkerThread();
-+  MOZ_DIAGNOSTIC_ASSERT(mClientSource);
-+  return mClientSource->Info();
-+}
-+
-+void
-+WorkerPrivate::ExecutionReady()
-+{
-+  AssertIsOnWorkerThread();
-+  MOZ_DIAGNOSTIC_ASSERT(mClientSource);
-+  mClientSource->WorkerExecutionReady(this);
-+}
-+
-+void
- WorkerPrivate::InitializeGCTimers()
- {
-   AssertIsOnWorkerThread();
- 
-   // We need a timer for GC. The basic plan is to run a non-shrinking GC
-   // periodically (PERIODIC_GC_TIMER_DELAY_SEC) while the worker is running.
-   // Once the worker goes idle we set a short (IDLE_GC_TIMER_DELAY_SEC) timer to
-   // run a shrinking GC. If the worker receives more messages then the short
-diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h
---- a/dom/workers/WorkerPrivate.h
-+++ b/dom/workers/WorkerPrivate.h
-@@ -58,16 +58,18 @@ template<class T> class nsMainThreadPtrH
- 
- namespace JS {
- struct RuntimeStats;
- } // namespace JS
- 
- namespace mozilla {
- class ThrottledEventQueue;
- namespace dom {
-+class ClientInfo;
-+class ClientSource;
- class Function;
- class MessagePort;
- class MessagePortIdentifier;
- class PromiseNativeHandler;
- class StructuredCloneHolder;
- class WorkerDebuggerGlobalScope;
- class WorkerGlobalScope;
- struct WorkerOptions;
-@@ -1055,16 +1057,17 @@ class WorkerPrivate : public WorkerPriva
-   // fired on the main thread if the worker script fails to load
-   nsCOMPtr<nsIRunnable> mLoadFailedRunnable;
- 
-   JS::UniqueChars mDefaultLocale; // nulled during worker JSContext init
-   TimeStamp mKillTime;
-   uint32_t mErrorHandlerRecursionCount;
-   uint32_t mNextTimeoutId;
-   Status mStatus;
-+  UniquePtr<ClientSource> mClientSource;
-   bool mFrozen;
-   bool mTimerRunning;
-   bool mRunningExpiredTimeouts;
-   bool mPendingEventQueueClearing;
-   bool mCancelAllPendingRunnables;
-   bool mPeriodicGCTimerRunning;
-   bool mIdleGCTimerRunning;
-   bool mWorkerScriptExecutedSuccessfully;
-@@ -1489,16 +1492,25 @@ public:
-   // Get an event target that will attempt to dispatch a normal WorkerRunnable,
-   // but if that fails will then fall back to a control runnable.
-   nsISerialEventTarget*
-   HybridEventTarget();
- 
-   void
-   DumpCrashInformation(nsACString& aString);
- 
-+  void
-+  EnsureClientSource();
-+
-+  const ClientInfo&
-+  GetClientInfo() const;
-+
-+  void
-+  ExecutionReady();
-+
- private:
-   WorkerPrivate(WorkerPrivate* aParent,
-                 const nsAString& aScriptURL, bool aIsChromeWorker,
-                 WorkerType aWorkerType, const nsAString& aWorkerName,
-                 const nsACString& aServiceWorkerScope,
-                 WorkerLoadInfo& aLoadInfo);
- 
-   bool

+ 0 - 755
frg/work-js/mozilla-release/patches/mozilla-esr78-push_444864.patch

@@ -1,755 +0,0 @@
-# HG changeset patch
-# User Ben Kelly <ben@wanderview.com>
-# Date 1511295185 18000
-#      Tue Nov 21 15:13:05 2017 -0500
-# Node ID 3e2118a29baf7cb034e4c6d59e57eb67c8f40c37
-# Parent  061c5b3ee4d4a7874f4496835cdf1b7c29875a67
-Bug 1419536 P3 Handle creating and activating the ClientSource in nsDocShell and nsGlobalWindow. r=baku r=freesamael
-
-diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
---- a/docshell/base/nsDocShell.cpp
-+++ b/docshell/base/nsDocShell.cpp
-@@ -8,16 +8,21 @@
- 
- #include <algorithm>
- 
- #include "mozilla/ArrayUtils.h"
- #include "mozilla/Attributes.h"
- #include "mozilla/AutoRestore.h"
- #include "mozilla/BasePrincipal.h"
- #include "mozilla/Casting.h"
-+#include "mozilla/dom/ClientChannelHelper.h"
-+#include "mozilla/dom/ClientHandle.h"
-+#include "mozilla/dom/ClientInfo.h"
-+#include "mozilla/dom/ClientManager.h"
-+#include "mozilla/dom/ClientSource.h"
- #include "mozilla/dom/ContentChild.h"
- #include "mozilla/dom/Element.h"
- #include "mozilla/dom/HTMLAnchorElement.h"
- #include "mozilla/dom/PendingGlobalHistoryEntry.h"
- #include "mozilla/dom/TabChild.h"
- #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
- #include "mozilla/dom/ScreenOrientation.h"
- #include "mozilla/dom/ToJSValue.h"
-@@ -3385,16 +3390,90 @@ nsDocShell::GetParent(nsIDocShellTreeIte
- already_AddRefed<nsDocShell>
- nsDocShell::GetParentDocshell()
- {
-   nsCOMPtr<nsIDocShell> docshell = do_QueryInterface(GetAsSupports(mParent));
-   return docshell.forget().downcast<nsDocShell>();
- }
- 
- void
-+nsDocShell::MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal)
-+{
-+  // If there is an existing document then there is no need to create
-+  // a client for a future initial about:blank document.
-+  if (mScriptGlobal && mScriptGlobal->GetExtantDoc()) {
-+    MOZ_DIAGNOSTIC_ASSERT(
-+      mScriptGlobal->GetCurrentInnerWindowInternal()->GetClientInfo().isSome());
-+    MOZ_DIAGNOSTIC_ASSERT(!mInitialClientSource);
-+    return;
-+  }
-+
-+  // Don't recreate the initial client source.  We call this multiple times
-+  // when DoChannelLoad() is called before CreateAboutBlankContentViewer.
-+  if (mInitialClientSource) {
-+    return;
-+  }
-+
-+  // Don't pre-allocate the client when we are sandboxed.  The inherited
-+  // principal does not take sandboxing into account.
-+  // TODO: Refactor sandboxing principal code out so we can use it here.
-+  if (!aPrincipal && (mSandboxFlags & SANDBOXED_ORIGIN)) {
-+    return;
-+  }
-+
-+  nsIPrincipal* principal = aPrincipal ? aPrincipal
-+                                       : GetInheritedPrincipal(false);
-+
-+  // Sometimes there is no principal available when we are called from
-+  // CreateAboutBlankContentViewer.  For example, sometimes the principal
-+  // is only extracted from the load context after the document is created
-+  // in nsDocument::ResetToURI().  Ideally we would do something similar
-+  // here, but for now lets just avoid the issue by not preallocating the
-+  // client.
-+  if (!principal) {
-+    return;
-+  }
-+
-+  nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
-+  if (!win) {
-+    return;
-+  }
-+
-+  mInitialClientSource =
-+    ClientManager::CreateSource(ClientType::Window,
-+                                win->EventTargetFor(TaskCategory::Other),
-+                                principal);
-+
-+  // Mark the initial client as execution ready, but owned by the docshell.
-+  // If the client is actually used this will cause ClientSource to force
-+  // the creation of the initial about:blank by calling nsDocShell::GetDocument().
-+  mInitialClientSource->DocShellExecutionReady(this);
-+}
-+
-+Maybe<ClientInfo>
-+nsDocShell::GetInitialClientInfo() const
-+{
-+  if (mInitialClientSource) {
-+    Maybe<ClientInfo> result;
-+    result.emplace(mInitialClientSource->Info());
-+    return Move(result);
-+  }
-+
-+  nsGlobalWindowInner* innerWindow =
-+    mScriptGlobal ? mScriptGlobal->GetCurrentInnerWindowInternal() : nullptr;
-+  nsIDocument* doc = innerWindow ? innerWindow->GetExtantDoc() : nullptr;
-+
-+  if (!doc || !doc->IsInitialDocument()) {
-+    return Maybe<ClientInfo>();
-+  }
-+
-+  return innerWindow->GetClientInfo();
-+}
-+
-+void
- nsDocShell::RecomputeCanExecuteScripts()
- {
-   bool old = mCanExecuteScripts;
-   RefPtr<nsDocShell> parent = GetParentDocshell();
- 
-   // If we have no tree owner, that means that we've been detached from the
-   // docshell tree (this is distinct from having no parent dochshell, which
-   // is the case for root docshells). It would be nice to simply disallow
-@@ -5916,16 +5995,19 @@ nsDocShell::Destroy()
-       const char* msg = mItemType == typeContent ?
-         NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
-       serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
-     }
-   }
- 
-   mIsBeingDestroyed = true;
- 
-+  // Brak the cycle with the initial client, if present.
-+  mInitialClientSource.reset();
-+
-   // Make sure we don't record profile timeline markers anymore
-   SetRecordProfileTimelineMarkers(false);
- 
-   // Remove our pref observers
-   if (mObserveErrorPages) {
-     mObserveErrorPages = false;
-   }
- 
-@@ -7751,16 +7833,20 @@ nsDocShell::EndPageLoad(nsIWebProgress* 
-         internalLoadGroup->OnEndPageLoad(aChannel);
-       }
-     }
-   }
- 
-   // Timing is picked up by the window, we don't need it anymore
-   mTiming = nullptr;
- 
-+  // Make sure to discard the initial client if we never created the initial
-+  // about:blank document.
-+  mInitialClientSource.reset();
-+
-   // clean up reload state for meta charset
-   if (eCharsetReloadRequested == mCharsetReloadState) {
-     mCharsetReloadState = eCharsetReloadStopOrigional;
-   } else {
-     mCharsetReloadState = eCharsetReloadInit;
-   }
- 
-   // Save a pointer to the currently-loading history entry.
-@@ -8247,16 +8333,19 @@ nsDocShell::CreateAboutBlankContentViewe
-       if (aPrincipal) {
-         principal = NullPrincipal::CreateWithInheritedAttributes(aPrincipal);
-       } else {
-         principal = NullPrincipal::CreateWithInheritedAttributes(this);
-       }
-     } else {
-       principal = aPrincipal;
-     }
-+
-+    MaybeCreateInitialClientSource(principal);
-+
-     // generate (about:blank) document to load
-     blankDoc = nsContentDLF::CreateBlankDocument(mLoadGroup, principal, this);
-     if (blankDoc) {
-       // Hack: set the base URI manually, since this document never
-       // got Reset() with a channel.
-       blankDoc->SetBaseURI(aBaseURI);
- 
-       // Copy our sandbox flags to the document. These are immutable
-@@ -11742,16 +11831,34 @@ nsDocShell::DoChannelLoad(nsIChannel* aC
- 
-   uint32_t openFlags = 0;
-   if (mLoadType == LOAD_LINK) {
-     openFlags |= nsIURILoader::IS_CONTENT_PREFERRED;
-   }
-   if (!mAllowContentRetargeting) {
-     openFlags |= nsIURILoader::DONT_RETARGET;
-   }
-+
-+  nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
-+  NS_ENSURE_TRUE(win, NS_ERROR_FAILURE);
-+
-+  MaybeCreateInitialClientSource();
-+
-+  // Since we are loading a document we need to make sure the proper reserved
-+  // and initial client data is stored on the nsILoadInfo.  The
-+  // ClientChannelHelper does this and ensures that it is propagated properly
-+  // on redirects.  We pass no reserved client here so that the helper will
-+  // create the reserved ClientSource if necessary.
-+  Maybe<ClientInfo> noReservedClient;
-+  rv = AddClientChannelHelper(aChannel,
-+                              Move(noReservedClient),
-+                              GetInitialClientInfo(),
-+                              win->EventTargetFor(TaskCategory::Other));
-+  NS_ENSURE_SUCCESS(rv, rv);
-+
-   rv = aURILoader->OpenURI(aChannel, openFlags, this);
-   NS_ENSURE_SUCCESS(rv, rv);
- 
-   // We're about to load a new page and it may take time before necko
-   // gives back any data, so main thread might have a chance to process a
-   // collector slice
-   nsJSContext::MaybeRunNextCollectorSlice(this, JS::gcreason::DOCSHELL);
- 
-@@ -15144,16 +15251,22 @@ nsDocShell::InFrameSwap()
-     if (shell->mInFrameSwap) {
-       return true;
-     }
-     shell = shell->GetParentDocshell();
-   } while (shell);
-   return false;
- }
- 
-+UniquePtr<ClientSource>
-+nsDocShell::TakeInitialClientSource()
-+{
-+  return Move(mInitialClientSource);
-+}
-+
- NS_IMETHODIMP
- nsDocShell::IssueWarning(uint32_t aWarning, bool aAsError)
- {
-   if (mContentViewer) {
-     nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
-     if (doc) {
-       doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError);
-     }
-diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h
---- a/docshell/base/nsDocShell.h
-+++ b/docshell/base/nsDocShell.h
-@@ -14,16 +14,17 @@
- #include "nsIBaseWindow.h"
- #include "nsINetworkInterceptController.h"
- #include "nsIScrollable.h"
- #include "nsITextScroll.h"
- #include "nsIContentViewerContainer.h"
- #include "nsIDOMStorageManager.h"
- #include "nsDocLoader.h"
- #include "mozilla/BasePrincipal.h"
-+#include "mozilla/Maybe.h"
- #include "mozilla/Move.h"
- #include "mozilla/UniquePtr.h"
- #include "mozilla/WeakPtr.h"
- #include "mozilla/TimeStamp.h"
- #include "GeckoProfiler.h"
- #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
- #include "mozilla/LinkedList.h"
- #include "jsapi.h"
-@@ -64,16 +65,18 @@
- #include "nsIDeprecationWarner.h"
- #include "nsILoadURIDelegate.h"
- 
- namespace mozilla {
- class Encoding;
- class HTMLEditor;
- enum class TaskCategory;
- namespace dom {
-+class ClientInfo;
-+class ClientSource;
- class EventTarget;
- class PendingGlobalHistoryEntry;
- typedef uint32_t ScreenOrientationInternal;
- } // namespace dom
- } // namespace mozilla
- 
- class nsDocShell;
- class nsDOMNavigationTiming;
-@@ -818,16 +821,36 @@ protected:
- 
-   nsIChannel* GetCurrentDocChannel();
- 
-   bool ShouldBlockLoadingForBackButton();
- 
-   // Convenience method for getting our parent docshell. Can return null
-   already_AddRefed<nsDocShell> GetParentDocshell();
- 
-+  // Possibly create a ClientSource object to represent an initial about:blank
-+  // window that has not been allocated yet.  Normally we try not to create
-+  // this about:blank window until something calls GetDocument().  We still need
-+  // the ClientSource to exist for this conceptual window, though.
-+  //
-+  // The ClientSource is created with the given principal if specified.  If
-+  // the principal is not provided we will attempt to inherit it when we
-+  // are sure it will match what the real about:blank window principal
-+  // would have been.  There are some corner cases where we cannot easily
-+  // determine the correct principal and will not create the ClientSource.
-+  // In these cases the initial about:blank will appear to not exist until
-+  // its real document and window are created.
-+  void MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal = nullptr);
-+
-+  // Return the ClientInfo for the initial about:blank window, if it exists
-+  // or we have speculatively created a ClientSource in
-+  // MaybeCreateInitialClientSource().  This can return a ClientInfo object
-+  // even if GetExtantDoc() returns nullptr.
-+  mozilla::Maybe<mozilla::dom::ClientInfo> GetInitialClientInfo() const;
-+
- protected:
-   nsresult GetCurScrollPos(int32_t aScrollOrientation, int32_t* aCurPos);
-   nsresult SetCurScrollPosEx(int32_t aCurHorizontalPos,
-                              int32_t aCurVerticalPos);
- 
-   // Override the parent setter from nsDocLoader
-   virtual nsresult SetDocLoaderParent(nsDocLoader* aLoader) override;
- 
-@@ -1145,16 +1168,18 @@ private:
-   nsTObserverArray<nsWeakPtr> mReflowObservers;
-   nsTObserverArray<nsWeakPtr> mScrollObservers;
-   nsCString mOriginalUriString;
-   nsWeakPtr mOpener;
-   mozilla::OriginAttributes mOriginAttributes;
- 
-   mozilla::UniquePtr<mozilla::dom::PendingGlobalHistoryEntry> mPrerenderGlobalHistory;
- 
-+  mozilla::UniquePtr<mozilla::dom::ClientSource> mInitialClientSource;
-+
-   // A depth count of how many times NotifyRunToCompletionStart
-   // has been called without a matching NotifyRunToCompletionStop.
-   uint32_t mJSRunToCompletionDepth;
- 
-   // Whether or not touch events are overridden. Possible values are defined
-   // as constants in the nsIDocShell.idl file.
-   uint32_t mTouchEventsOverride;
- 
-diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl
---- a/docshell/base/nsIDocShell.idl
-+++ b/docshell/base/nsIDocShell.idl
-@@ -7,34 +7,39 @@
- #include "domstubs.idl"
- #include "nsIDocShellTreeItem.idl"
- #include "nsIRequest.idl"
- 
- %{ C++
- #include "js/TypeDecls.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/NotNull.h"
-+#include "mozilla/UniquePtr.h"
- #include "nsCOMPtr.h"
- #include "nsIURI.h"
- class nsPresContext;
- class nsIPresShell;
- namespace mozilla {
- class Encoding;
- class HTMLEditor;
-+namespace dom {
-+class ClientSource;
-+} // namespace dom
- }
- %}
- 
- /**
-  * The nsIDocShell interface.
-  */
- 
- [ptr] native nsPresContext(nsPresContext);
- [ptr] native nsIPresShell(nsIPresShell);
- [ref] native MaybeURI(mozilla::Maybe<nsCOMPtr<nsIURI>>);
- [ref] native Encoding(const mozilla::Encoding*);
-+      native UniqueClientSource(mozilla::UniquePtr<mozilla::dom::ClientSource>);
- 
- interface nsIURI;
- interface nsIChannel;
- interface nsIContentViewer;
- interface nsIDOMEventTarget;
- interface nsIDocShellLoadInfo;
- interface nsIEditor;
- interface nsIEditingSession;
-@@ -1167,16 +1172,27 @@ interface nsIDocShell : nsIDocShellTreeI
-    */
-   attribute boolean useTrackingProtection;
- 
-  /**
-   * Fire a dummy location change event asynchronously.
-   */
-   [noscript] void dispatchLocationChangeEvent();
- 
-+  /**
-+   * Take ownership of the ClientSource representing an initial about:blank
-+   * document that was never needed.  As an optimization we avoid creating
-+   * this document if no code calls GetDocument(), but we still need a
-+   * ClientSource object to represent the about:blank window.  This may return
-+   * nullptr; for example if the docshell has created a real window and document
-+   * already.
-+   */
-+  [noscript, nostdcall, notxpcom]
-+  UniqueClientSource TakeInitialClientSource();
-+
- %{C++
-   /**
-    * These methods call nsDocShell::GetHTMLEditorInternal() and
-    * nsDocShell::SetHTMLEditorInternal() with static_cast.
-    */
-   mozilla::HTMLEditor* GetHTMLEditor();
-   nsresult SetHTMLEditor(mozilla::HTMLEditor* aHTMLEditor);
- %}
-diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp
---- a/dom/base/nsGlobalWindowInner.cpp
-+++ b/dom/base/nsGlobalWindowInner.cpp
-@@ -1,14 +1,17 @@
- /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- /* vim: set ts=8 sts=2 et sw=2 tw=80: */
- /* This Source Code Form is subject to the terms of the Mozilla Public
-  * 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/. */
- 
-+#include "mozilla/dom/ClientManager.h"
-+#include "mozilla/dom/ClientSource.h"
-+
- #define FORWARD_TO_OUTER(method, args, err_rval)                        \
-   PR_BEGIN_MACRO                                                        \
-   MOZ_RELEASE_ASSERT(IsInnerWindow());                                  \
-   nsGlobalWindowOuter *outer = GetOuterWindowInternal();                \
-   if (!HasActiveDocument()) {                                           \
-     NS_WARNING(outer ?                                                  \
-                "Inner window does not have active document." :          \
-                "No outer window available!");                           \
-@@ -1095,16 +1098,19 @@ nsGlobalWindowInner::FreeInnerObjects()
-   DisableGamepadUpdates();
-   mHasGamepad = false;
-   mGamepads.Clear();
-   DisableVRUpdates();
-   mHasVREvents = false;
-   mHasVRDisplayActivateEvents = false;
-   mVRDisplays.Clear();
- 
-+  // This breaks a cycle between the window and the ClientSource object.
-+  mClientSource.reset();
-+
-   if (mTabChild) {
-     while (mBeforeUnloadListenerCount-- > 0) {
-       mTabChild->BeforeUnloadRemoved();
-     }
-   }
- }
- 
- //*****************************************************************************
-@@ -1349,16 +1355,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
- 
-   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
- 
-   tmp->UnlinkHostObjectURIs();
- 
-   NS_IMPL_CYCLE_COLLECTION_UNLINK(mIdleRequestExecutor)
-   tmp->DisableIdleCallbackRequests();
- 
-+  tmp->mClientSource.reset();
-+
-   if (tmp->IsChromeWindow()) {
-     NS_IMPL_CYCLE_COLLECTION_UNLINK(mChromeFields.mBrowserDOMWindow)
-     if (tmp->mChromeFields.mMessageManager) {
-       static_cast<nsFrameMessageManager*>(
-         tmp->mChromeFields.mMessageManager.get())->Disconnect();
-       NS_IMPL_CYCLE_COLLECTION_UNLINK(mChromeFields.mMessageManager)
-     }
-     tmp->DisconnectAndClearGroupMessageManagers();
-@@ -1514,16 +1522,78 @@ nsGlobalWindowInner::InnerSetNewDocument
- 
-   Telemetry::Accumulate(Telemetry::INNERWINDOWS_WITH_MUTATION_LISTENERS,
-                         mMutationBits ? 1 : 0);
- 
-   // Clear our mutation bitfield.
-   mMutationBits = 0;
- }
- 
-+nsresult
-+nsGlobalWindowInner::EnsureClientSource()
-+{
-+  MOZ_DIAGNOSTIC_ASSERT(mDoc);
-+
-+  nsCOMPtr<nsIChannel> channel = mDoc->GetChannel();
-+  nsCOMPtr<nsILoadInfo> loadInfo = channel ? channel->GetLoadInfo() : nullptr;
-+
-+  // Try to get the reserved client from the LoadInfo.  A Client is
-+  // reserved at the start of the channel load if there is not an
-+  // initial about:blank document that will be reused.  It is also
-+  // created if the channel load encounters a cross-origin redirect.
-+  if (loadInfo) {
-+    UniquePtr<ClientSource> reservedClient = loadInfo->TakeReservedClientSource();
-+    if (reservedClient) {
-+      mClientSource.reset();
-+      mClientSource = Move(reservedClient);
-+    }
-+  }
-+
-+  // We don't have a LoadInfo reserved client, but maybe we should
-+  // be inheriting an initial one from the docshell.  This means
-+  // that the docshell started the channel load before creating the
-+  // initial about:blank document.  This is an optimization, though,
-+  // and it created an initial Client as a placeholder for the document.
-+  // In this case we want to inherit this placeholder Client here.
-+  if (!mClientSource) {
-+    nsIDocShell* docshell = GetDocShell();
-+    if (docshell) {
-+      mClientSource = docshell->TakeInitialClientSource();
-+    }
-+  }
-+
-+  // If we don't have a reserved client or an initial client, then create
-+  // one now.  This can happen in certain cases where we avoid preallocating
-+  // the client in the docshell.  This mainly occurs in situations where
-+  // the principal is not clearly inherited from the parent; e.g. sandboxed
-+  // iframes, window.open(), etc.
-+  if (!mClientSource) {
-+    mClientSource = ClientManager::CreateSource(ClientType::Window,
-+                                                EventTargetFor(TaskCategory::Other),
-+                                                mDoc->NodePrincipal());
-+    if (NS_WARN_IF(!mClientSource)) {
-+      return NS_ERROR_FAILURE;
-+    }
-+  }
-+
-+  return NS_OK;
-+}
-+
-+nsresult
-+nsGlobalWindowInner::ExecutionReady()
-+{
-+  nsresult rv = EnsureClientSource();
-+  NS_ENSURE_SUCCESS(rv, rv);
-+
-+  rv = mClientSource->WindowExecutionReady(AsInner());
-+  NS_ENSURE_SUCCESS(rv, rv);
-+
-+  return NS_OK;
-+}
-+
- void
- nsGlobalWindowInner::SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
-                                      bool aOriginalOpener)
- {
-   FORWARD_TO_OUTER_VOID(SetOpenerWindow, (aOpener, aOriginalOpener));
- }
- 
- void
-@@ -2005,16 +2075,22 @@ nsPIDOMWindowInner::Thaw()
- }
- 
- void
- nsPIDOMWindowInner::SyncStateFromParentWindow()
- {
-   nsGlobalWindowInner::Cast(this)->SyncStateFromParentWindow();
- }
- 
-+Maybe<ClientInfo>
-+nsPIDOMWindowInner::GetClientInfo() const
-+{
-+  return Move(nsGlobalWindowInner::Cast(this)->GetClientInfo());
-+}
-+
- void
- nsGlobalWindowInner::UpdateTopInnerWindow()
- {
-   if (!IsInnerWindow() || IsTopInnerWindow() || !mTopInnerWindow) {
-     return;
-   }
- 
-   mTopInnerWindow->UpdateWebSocketCount(-(int32_t)mNumOfOpenWebSockets);
-@@ -6116,16 +6192,27 @@ nsGlobalWindowInner::CallOnChildren(Meth
-     if (!mDoc || !frame || mDoc != frame->OwnerDoc() || !inner) {
-       continue;
-     }
- 
-     (inner->*aMethod)();
-   }
- }
- 
-+Maybe<ClientInfo>
-+nsGlobalWindowInner::GetClientInfo() const
-+{
-+  MOZ_ASSERT(NS_IsMainThread());
-+  Maybe<ClientInfo> clientInfo;
-+  if (mClientSource) {
-+    clientInfo.emplace(mClientSource->Info());
-+  }
-+  return Move(clientInfo);
-+}
-+
- nsresult
- nsGlobalWindowInner::FireDelayedDOMEvents()
- {
-   if (mApplicationCache) {
-     static_cast<nsDOMOfflineResourceList*>(mApplicationCache.get())->FirePendingEvents();
-   }
- 
-   // Fires an offline status event if the offline status has changed
-diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h
---- a/dom/base/nsGlobalWindowInner.h
-+++ b/dom/base/nsGlobalWindowInner.h
-@@ -92,16 +92,17 @@ class DialogValueHolder;
- 
- namespace mozilla {
- class AbstractThread;
- class DOMEventTargetHelper;
- class ThrottledEventQueue;
- namespace dom {
- class BarProp;
- struct ChannelPixelLayout;
-+class ClientSource;
- class Console;
- class Crypto;
- class CustomElementRegistry;
- class DocGroup;
- class External;
- class Function;
- class Gamepad;
- enum class ImageBitmapFormat : uint8_t;
-@@ -366,16 +367,18 @@ public:
-   void Suspend();
-   void Resume();
-   virtual bool IsSuspended() const override;
-   void Freeze();
-   void Thaw();
-   virtual bool IsFrozen() const override;
-   void SyncStateFromParentWindow();
- 
-+  mozilla::Maybe<mozilla::dom::ClientInfo> GetClientInfo() const;
-+
-   virtual nsresult FireDelayedDOMEvents() override;
- 
-   virtual nsresult SetNewDocument(nsIDocument *aDocument,
-                                   nsISupports *aState,
-                                   bool aForceReuseInnerWindow) override;
- 
-   virtual void SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
-                                bool aOriginalOpener) override;
-@@ -1160,16 +1163,19 @@ protected:
- 
-   void FreeInnerObjects();
-   nsGlobalWindowInner *CallerInnerWindow();
- 
-   // Only to be called on an inner window.
-   // aDocument must not be null.
-   void InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument);
- 
-+  nsresult EnsureClientSource();
-+  nsresult ExecutionReady();
-+
-   // Inner windows only.
-   nsresult DefineArgumentsProperty(nsIArray *aArguments);
- 
-   // Get the parent, returns null if this is a toplevel window
-   nsPIDOMWindowOuter* GetParentInternal();
- 
- public:
-   // popup tracking
-@@ -1565,16 +1571,18 @@ protected:
-   // When non-zero, the document should receive a vrdisplayactivate event
-   // after loading.  The value is the ID of the VRDisplay that content should
-   // begin presentation on.
-   uint32_t mAutoActivateVRDisplayID; // Outer windows only
-   int64_t mBeforeUnloadListenerCount; // Inner windows only
- 
-   RefPtr<mozilla::dom::IntlUtils> mIntlUtils;
- 
-+  mozilla::UniquePtr<mozilla::dom::ClientSource> mClientSource;
-+
-   static InnerWindowByIdTable* sInnerWindowsById;
- 
-   // Members in the mChromeFields member should only be used in chrome windows.
-   // All accesses to this field should be guarded by a check of mIsChrome.
-   struct ChromeFields {
-     ChromeFields()
-       : mGroupMessageManagers(1)
-     {}
-diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp
---- a/dom/base/nsGlobalWindowOuter.cpp
-+++ b/dom/base/nsGlobalWindowOuter.cpp
-@@ -1927,24 +1927,32 @@ nsGlobalWindowOuter::SetNewDocument(nsID
-         newInnerWindow->mDoc = aDocument;
- 
-         // The storage objects contain the URL of the window. We have to
-         // recreate them when the innerWindow is reused.
-         newInnerWindow->mLocalStorage = nullptr;
-         newInnerWindow->mSessionStorage = nullptr;
- 
-         newInnerWindow->ClearDocumentDependentSlots(cx);
-+
-+        // When replacing an initial about:blank document we call
-+        // ExecutionReady again to update the client creation URL.
-+        rv = newInnerWindow->ExecutionReady();
-+        NS_ENSURE_SUCCESS(rv, rv);
-       }
-     } else {
-       newInnerWindow->InnerSetNewDocument(cx, aDocument);
- 
-       // Initialize DOM classes etc on the inner window.
-       JS::Rooted<JSObject*> obj(cx, newInnerGlobal);
-       rv = kungFuDeathGrip->InitClasses(obj);
-       NS_ENSURE_SUCCESS(rv, rv);
-+
-+      rv = newInnerWindow->ExecutionReady();
-+      NS_ENSURE_SUCCESS(rv, rv);
-     }
- 
-     // If the document comes from a JAR, check if the channel was determined
-     // to be unsafe. If so, permanently disable script on the compartment by
-     // calling Block() and throwing away the key.
-     nsCOMPtr<nsIJARChannel> jarChannel = do_QueryInterface(aDocument->GetChannel());
-     if (jarChannel && jarChannel->GetIsUnsafe()) {
-       xpc::Scriptability::Get(newInnerGlobal).Block();
-diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h
---- a/dom/base/nsPIDOMWindow.h
-+++ b/dom/base/nsPIDOMWindow.h
-@@ -41,16 +41,17 @@ class nsPIWindowRoot;
- class nsXBLPrototypeHandler;
- 
- typedef uint32_t SuspendTypes;
- 
- namespace mozilla {
- class ThrottledEventQueue;
- namespace dom {
- class AudioContext;
-+class ClientInfo;
- class DocGroup;
- class TabGroup;
- class Element;
- class Performance;
- class ServiceWorkerRegistration;
- class Timeout;
- class TimeoutManager;
- class CustomElementRegistry;
-@@ -926,16 +927,18 @@ public:
- 
-   // Increase/Decrease the number of open WebSockets.
-   void UpdateWebSocketCount(int32_t aDelta);
- 
-   // Return true if there are any open WebSockets that could block
-   // timeout-throttling.
-   bool HasOpenWebSockets() const;
- 
-+  mozilla::Maybe<mozilla::dom::ClientInfo> GetClientInfo() const;
-+
-   mozilla::dom::TabGroup* TabGroup();
- protected:
-   void CreatePerformanceObjectIfNeeded();
- };
- 
- NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowInner, NS_PIDOMWINDOWINNER_IID)
- 
- // NB: It's very very important that these two classes have identical vtables

+ 0 - 442
frg/work-js/mozilla-release/patches/mozilla-esr78-push_444865.patch

@@ -1,442 +0,0 @@
-# HG changeset patch
-# User Ben Kelly <ben@wanderview.com>
-# Date 1511295185 18000
-#      Tue Nov 21 15:13:05 2017 -0500
-# Node ID 61d93d8a46679c63f56b0ad4719834e87a7a7f72
-# Parent  3e2118a29baf7cb034e4c6d59e57eb67c8f40c37
-Bug 1419536 P4 Allow ClientSource objects to be frozen while in bfcache. r=baku
-
-diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp
---- a/dom/base/nsGlobalWindowInner.cpp
-+++ b/dom/base/nsGlobalWindowInner.cpp
-@@ -1527,56 +1527,69 @@ nsGlobalWindowInner::InnerSetNewDocument
-   mMutationBits = 0;
- }
- 
- nsresult
- nsGlobalWindowInner::EnsureClientSource()
- {
-   MOZ_DIAGNOSTIC_ASSERT(mDoc);
- 
-+  bool newClientSource = false;
-+
-   nsCOMPtr<nsIChannel> channel = mDoc->GetChannel();
-   nsCOMPtr<nsILoadInfo> loadInfo = channel ? channel->GetLoadInfo() : nullptr;
- 
-   // Try to get the reserved client from the LoadInfo.  A Client is
-   // reserved at the start of the channel load if there is not an
-   // initial about:blank document that will be reused.  It is also
-   // created if the channel load encounters a cross-origin redirect.
-   if (loadInfo) {
-     UniquePtr<ClientSource> reservedClient = loadInfo->TakeReservedClientSource();
-     if (reservedClient) {
-       mClientSource.reset();
-       mClientSource = Move(reservedClient);
-+      newClientSource = true;
-     }
-   }
- 
-   // We don't have a LoadInfo reserved client, but maybe we should
-   // be inheriting an initial one from the docshell.  This means
-   // that the docshell started the channel load before creating the
-   // initial about:blank document.  This is an optimization, though,
-   // and it created an initial Client as a placeholder for the document.
-   // In this case we want to inherit this placeholder Client here.
-   if (!mClientSource) {
-     nsIDocShell* docshell = GetDocShell();
-     if (docshell) {
-       mClientSource = docshell->TakeInitialClientSource();
-+      if (mClientSource) {
-+        newClientSource = true;
-+      }
-     }
-   }
- 
-   // If we don't have a reserved client or an initial client, then create
-   // one now.  This can happen in certain cases where we avoid preallocating
-   // the client in the docshell.  This mainly occurs in situations where
-   // the principal is not clearly inherited from the parent; e.g. sandboxed
-   // iframes, window.open(), etc.
-   if (!mClientSource) {
-     mClientSource = ClientManager::CreateSource(ClientType::Window,
-                                                 EventTargetFor(TaskCategory::Other),
-                                                 mDoc->NodePrincipal());
-     if (NS_WARN_IF(!mClientSource)) {
-       return NS_ERROR_FAILURE;
-     }
-+    newClientSource = true;
-+  }
-+
-+  // Its possible that we got a client just after being frozen in
-+  // the bfcache.  In that case freeze the client immediately.
-+  if (newClientSource && IsFrozen()) {
-+    mClientSource->Freeze();
-   }
- 
-   return NS_OK;
- }
- 
- nsresult
- nsGlobalWindowInner::ExecutionReady()
- {
-@@ -6058,16 +6071,19 @@ nsGlobalWindowInner::FreezeInternal()
-   MOZ_ASSERT(mSuspendDepth >= mFreezeDepth);
-   if (mFreezeDepth != 1) {
-     return;
-   }
- 
-   mozilla::dom::workers::FreezeWorkersForWindow(this);
- 
-   mTimeoutManager->Freeze();
-+  if (mClientSource) {
-+    mClientSource->Freeze();
-+  }
- 
-   if (IsInnerWindow()) {
-     NotifyDOMWindowFrozen(this);
-   }
- }
- 
- void
- nsGlobalWindowInner::Thaw()
-@@ -6089,16 +6105,19 @@ nsGlobalWindowInner::ThawInternal()
- 
-   MOZ_ASSERT(mFreezeDepth != 0);
-   mFreezeDepth -= 1;
-   MOZ_ASSERT(mSuspendDepth >= mFreezeDepth);
-   if (mFreezeDepth != 0) {
-     return;
-   }
- 
-+  if (mClientSource) {
-+    mClientSource->Thaw();
-+  }
-   mTimeoutManager->Thaw();
- 
-   mozilla::dom::workers::ThawWorkersForWindow(this);
- 
-   if (IsInnerWindow()) {
-     NotifyDOMWindowThawed(this);
-   }
- }
-diff --git a/dom/clients/manager/ClientManagerService.cpp b/dom/clients/manager/ClientManagerService.cpp
---- a/dom/clients/manager/ClientManagerService.cpp
-+++ b/dom/clients/manager/ClientManagerService.cpp
-@@ -121,17 +121,18 @@ ClientManagerService::FindSource(const n
-   AssertIsOnBackgroundThread();
- 
-   auto entry = mSourceTable.Lookup(aID);
-   if (!entry) {
-     return nullptr;
-   }
- 
-   ClientSourceParent* source = entry.Data();
--  if (!MatchPrincipalInfo(source->Info().PrincipalInfo(), aPrincipalInfo)) {
-+  if (source->IsFrozen() ||
-+      !MatchPrincipalInfo(source->Info().PrincipalInfo(), aPrincipalInfo)) {
-     return nullptr;
-   }
- 
-   return source;
- }
- 
- } // namespace dom
- } // namespace mozilla
-diff --git a/dom/clients/manager/ClientSource.cpp b/dom/clients/manager/ClientSource.cpp
---- a/dom/clients/manager/ClientSource.cpp
-+++ b/dom/clients/manager/ClientSource.cpp
-@@ -230,16 +230,32 @@ ClientSource::DocShellExecutionReady(nsI
- 
-   ClientSourceExecutionReadyArgs args(NS_LITERAL_CSTRING("about:blank"),
-                                       frameType);
-   ExecutionReady(args);
- 
-   return NS_OK;
- }
- 
-+void
-+ClientSource::Freeze()
-+{
-+  MaybeExecute([](PClientSourceChild* aActor) {
-+    aActor->SendFreeze();
-+  });
-+}
-+
-+void
-+ClientSource::Thaw()
-+{
-+  MaybeExecute([](PClientSourceChild* aActor) {
-+    aActor->SendThaw();
-+  });
-+}
-+
- const ClientInfo&
- ClientSource::Info() const
- {
-   return mClientInfo;
- }
- 
- nsISerialEventTarget*
- ClientSource::EventTarget() const
-diff --git a/dom/clients/manager/ClientSource.h b/dom/clients/manager/ClientSource.h
---- a/dom/clients/manager/ClientSource.h
-+++ b/dom/clients/manager/ClientSource.h
-@@ -77,16 +77,22 @@ public:
-   WorkerExecutionReady(mozilla::dom::workers::WorkerPrivate* aWorkerPrivate);
- 
-   nsresult
-   WindowExecutionReady(nsPIDOMWindowInner* aInnerWindow);
- 
-   nsresult
-   DocShellExecutionReady(nsIDocShell* aDocShell);
- 
-+  void
-+  Freeze();
-+
-+  void
-+  Thaw();
-+
-   const ClientInfo&
-   Info() const;
- 
-   nsISerialEventTarget*
-   EventTarget() const;
- };
- 
- } // namespace dom
-diff --git a/dom/clients/manager/ClientSourceParent.cpp b/dom/clients/manager/ClientSourceParent.cpp
---- a/dom/clients/manager/ClientSourceParent.cpp
-+++ b/dom/clients/manager/ClientSourceParent.cpp
-@@ -106,16 +106,40 @@ ClientSourceParent::RecvExecutionReady(c
- 
-   for (ClientHandleParent* handle : mHandleList) {
-     Unused << handle->SendExecutionReady(mClientInfo.ToIPC());
-   }
- 
-   return IPC_OK();
- };
- 
-+IPCResult
-+ClientSourceParent::RecvFreeze()
-+{
-+  MOZ_DIAGNOSTIC_ASSERT(!mFrozen);
-+  mFrozen = true;
-+
-+  // Frozen clients should not be observable.  Act as if the client has
-+  // been destroyed.
-+  nsTArray<ClientHandleParent*> handleList(mHandleList);
-+  for (ClientHandleParent* handle : handleList) {
-+    Unused << ClientHandleParent::Send__delete__(handle);
-+  }
-+
-+  return IPC_OK();
-+}
-+
-+IPCResult
-+ClientSourceParent::RecvThaw()
-+{
-+  MOZ_DIAGNOSTIC_ASSERT(mFrozen);
-+  mFrozen = false;
-+  return IPC_OK();
-+}
-+
- void
- ClientSourceParent::ActorDestroy(ActorDestroyReason aReason)
- {
-   DebugOnly<bool> removed = mService->RemoveSource(this);
-   MOZ_ASSERT(removed);
- 
-   nsTArray<ClientHandleParent*> handleList(mHandleList);
-   for (ClientHandleParent* handle : handleList) {
-@@ -139,16 +163,17 @@ ClientSourceParent::DeallocPClientSource
-   delete aActor;
-   return true;
- }
- 
- ClientSourceParent::ClientSourceParent(const ClientSourceConstructorArgs& aArgs)
-   : mClientInfo(aArgs.id(), aArgs.type(), aArgs.principalInfo(), aArgs.creationTime())
-   , mService(ClientManagerService::GetOrCreateInstance())
-   , mExecutionReady(false)
-+  , mFrozen(false)
- {
- }
- 
- ClientSourceParent::~ClientSourceParent()
- {
-   MOZ_DIAGNOSTIC_ASSERT(mHandleList.IsEmpty());
- }
- 
-@@ -173,20 +198,27 @@ ClientSourceParent::Init()
- }
- 
- const ClientInfo&
- ClientSourceParent::Info() const
- {
-   return mClientInfo;
- }
- 
-+bool
-+ClientSourceParent::IsFrozen() const
-+{
-+  return mFrozen;
-+}
-+
- void
- ClientSourceParent::AttachHandle(ClientHandleParent* aClientHandle)
- {
-   MOZ_DIAGNOSTIC_ASSERT(aClientHandle);
-+  MOZ_DIAGNOSTIC_ASSERT(!mFrozen);
-   MOZ_ASSERT(!mHandleList.Contains(aClientHandle));
-   mHandleList.AppendElement(aClientHandle);
- }
- 
- void
- ClientSourceParent::DetachHandle(ClientHandleParent* aClientHandle)
- {
-   MOZ_DIAGNOSTIC_ASSERT(aClientHandle);
-diff --git a/dom/clients/manager/ClientSourceParent.h b/dom/clients/manager/ClientSourceParent.h
---- a/dom/clients/manager/ClientSourceParent.h
-+++ b/dom/clients/manager/ClientSourceParent.h
-@@ -16,27 +16,34 @@ class ClientHandleParent;
- class ClientManagerService;
- 
- class ClientSourceParent final : public PClientSourceParent
- {
-   ClientInfo mClientInfo;
-   RefPtr<ClientManagerService> mService;
-   nsTArray<ClientHandleParent*> mHandleList;
-   bool mExecutionReady;
-+  bool mFrozen;
- 
-   void
-   KillInvalidChild();
- 
-   // PClientSourceParent
-   mozilla::ipc::IPCResult
-   RecvTeardown() override;
- 
-   mozilla::ipc::IPCResult
-   RecvExecutionReady(const ClientSourceExecutionReadyArgs& aArgs) override;
- 
-+  mozilla::ipc::IPCResult
-+  RecvFreeze() override;
-+
-+  mozilla::ipc::IPCResult
-+  RecvThaw() override;
-+
-   void
-   ActorDestroy(ActorDestroyReason aReason) override;
- 
-   PClientSourceOpParent*
-   AllocPClientSourceOpParent(const ClientOpConstructorArgs& aArgs) override;
- 
-   bool
-   DeallocPClientSourceOpParent(PClientSourceOpParent* aActor) override;
-@@ -46,16 +53,19 @@ public:
-   ~ClientSourceParent();
- 
-   void
-   Init();
- 
-   const ClientInfo&
-   Info() const;
- 
-+  bool
-+  IsFrozen() const;
-+
-   void
-   AttachHandle(ClientHandleParent* aClientSource);
- 
-   void
-   DetachHandle(ClientHandleParent* aClientSource);
- };
- 
- } // namespace dom
-diff --git a/dom/clients/manager/PClientSource.ipdl b/dom/clients/manager/PClientSource.ipdl
---- a/dom/clients/manager/PClientSource.ipdl
-+++ b/dom/clients/manager/PClientSource.ipdl
-@@ -17,16 +17,18 @@ sync protocol PClientSource
- {
-   manager PClientManager;
- 
-   manages PClientSourceOp;
- 
- parent:
-   async Teardown();
-   async ExecutionReady(ClientSourceExecutionReadyArgs aArgs);
-+  async Freeze();
-+  async Thaw();
- 
- child:
-   async PClientSourceOp(ClientOpConstructorArgs aArgs);
- 
-   async __delete__();
- };
- 
- } // namespace dom
-diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
---- a/dom/workers/WorkerPrivate.cpp
-+++ b/dom/workers/WorkerPrivate.cpp
-@@ -5318,16 +5318,19 @@ WorkerPrivate::EnsureClientSource()
-       type = ClientType::Serviceworker;
-       break;
-     default:
-       MOZ_CRASH("unknown worker type!");
-   }
- 
-   mClientSource = ClientManager::CreateSource(type, mWorkerHybridEventTarget,
-                                               GetPrincipalInfo());
-+  if (mFrozen) {
-+    mClientSource->Freeze();
-+  }
- }
- 
- const ClientInfo&
- WorkerPrivate::GetClientInfo() const
- {
-   AssertIsOnWorkerThread();
-   MOZ_DIAGNOSTIC_ASSERT(mClientSource);
-   return mClientSource->Info();
-@@ -5675,16 +5678,20 @@ WorkerPrivate::ClearDebuggerEventQueue()
- 
- bool
- WorkerPrivate::FreezeInternal()
- {
-   AssertIsOnWorkerThread();
- 
-   NS_ASSERTION(!mFrozen, "Already frozen!");
- 
-+  if (mClientSource) {
-+    mClientSource->Freeze();
-+  }
-+
-   mFrozen = true;
- 
-   for (uint32_t index = 0; index < mChildWorkers.Length(); index++) {
-     mChildWorkers[index]->Freeze(nullptr);
-   }
- 
-   return true;
- }
-@@ -5696,16 +5703,21 @@ WorkerPrivate::ThawInternal()
- 
-   NS_ASSERTION(mFrozen, "Not yet frozen!");
- 
-   for (uint32_t index = 0; index < mChildWorkers.Length(); index++) {
-     mChildWorkers[index]->Thaw(nullptr);
-   }
- 
-   mFrozen = false;
-+
-+  if (mClientSource) {
-+    mClientSource->Thaw();
-+  }
-+
-   return true;
- }
- 
- void
- WorkerPrivate::TraverseTimeouts(nsCycleCollectionTraversalCallback& cb)
- {
-   for (uint32_t i = 0; i < mTimeouts.Length(); ++i) {
-     TimeoutInfo* tmp = mTimeouts[i];

+ 0 - 37
frg/work-js/mozilla-release/patches/mozilla-esr78-push_444866.patch

@@ -1,37 +0,0 @@
-# HG changeset patch
-# User Ben Kelly <ben@wanderview.com>
-# Date 1511295185 18000
-#      Tue Nov 21 15:13:05 2017 -0500
-# Node ID dbbca05aa64a14580d3ab23950e148019a097218
-# Parent  61d93d8a46679c63f56b0ad4719834e87a7a7f72
-Bug 1419536 P5 Set ClientInfo on the LoadInfo for document owned network requests. r=baku
-
-diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp
---- a/netwerk/base/LoadInfo.cpp
-+++ b/netwerk/base/LoadInfo.cpp
-@@ -108,16 +108,25 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadin
-   // if the load is sandboxed, we can not also inherit the principal
-   if (mSecurityFlags & nsILoadInfo::SEC_SANDBOXED) {
-     mForceInheritPrincipalDropped =
-       (mSecurityFlags & nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL);
-     mSecurityFlags &= ~nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
-   }
- 
-   if (aLoadingContext) {
-+    // Ensure that all network requests for a window client have the ClientInfo
-+    // properly set.
-+    // TODO: The ClientInfo is not set properly for worker initiated requests yet.
-+    nsCOMPtr<nsPIDOMWindowInner> contextInner =
-+      aLoadingContext->OwnerDoc()->GetInnerWindow();
-+    if (contextInner) {
-+      mClientInfo = contextInner->GetClientInfo();
-+    }
-+
-     nsCOMPtr<nsPIDOMWindowOuter> contextOuter = aLoadingContext->OwnerDoc()->GetWindow();
-     if (contextOuter) {
-       ComputeIsThirdPartyContext(contextOuter);
-       mOuterWindowID = contextOuter->WindowID();
-       nsCOMPtr<nsPIDOMWindowOuter> parent = contextOuter->GetScriptableParent();
-       mParentOuterWindowID = parent ? parent->WindowID() : mOuterWindowID;
-       mTopOuterWindowID = FindTopOuterWindowID(contextOuter);
-     }

+ 53 - 105
frg/work-js/mozilla-release/patches/series

@@ -2973,7 +2973,6 @@ servo-20274-60a1.patch
 1382841-4-60a1.patch
 1382841-5-60a1.patch
 1444303-61a1.patch
-1447391-61a1.patch
 1444881-61a1.patch
 1421563-61a1.patch
 1401129-7-61a1.patch
@@ -3137,6 +3136,7 @@ NOBUG-20180313-inspector-61a1.patch
 1445633-61a1.patch
 1444834-61a1.patch
 1445592-61a1.patch
+1445551-6only-PARTIAL-61a1.patch
 977538-2-61a1.patch
 1435360-1-61a1.patch
 1435360-2-61a1.patch
@@ -3445,6 +3445,7 @@ servo-20351-61a1.patch
 1414286-1-61a1.patch
 1414286-2-61a1.patch
 1434007-2-61a1.patch
+1447391-61a1.patch
 1444033-61a1.patch
 1448138-61a1.patch
 servo-20407-61a1.patch
@@ -6000,7 +6001,6 @@ NOBUG-20180809-utf8-63a1.patch
 1483761-3-63a1.patch
 1483761-4-63a1.patch
 1485545-63a1.patch
-1485610-63a1.patch
 1480725-2-63a1.patch
 1467116-63a1.patch
 1482178-63a1.patch
@@ -6025,11 +6025,20 @@ NOBUG-20180809-utf8-63a1.patch
 1485162-1-63a1.patch
 1485162-2-63a1.patch
 1480998-63a1.patch
-taken-out-stuff-comes-here.patch
+1483030-63a1.patch
+1485610-63a1.patch
+1432135-63a1.patch
+1481670-1-63a1.patch
+1481670-2-63a1.patch
+1481670-3-63a1.patch
+1437065-4-63a1.patch
+1437065-5-63a1.patch
+1486027-63a1.patch
+1449985-63a1.patch
+1456973-63a1.patch
 1466427-63a1.patch
 NOBUG-20180824-buildsetting-63a1.patch
 1446923-63a1.patch
-1432135-63a1.patch
 1485949-63a1.patch
 1483953-63a1.patch
 1485396-63a1.patch
@@ -6037,12 +6046,19 @@ NOBUG-20180824-buildsetting-63a1.patch
 1486173-1-63a1.patch
 1486173-2-63a1.patch
 1486173-3-63a1.patch
+1486444-63a1.patch
+1485347-1-63a1.patch
+1485347-2-63a1.patch
+1480587-63a1.patch
+1485209-63a1.patch
+1472170-63a1.patch
 1471922-63a1.patch
 1486056-63a1.patch
 1486020-63a1.patch
 1485485-1-63a1.patch
 1485485-2-63a1.patch
 1486281-63a1.patch
+1486584-63a1.patch
 1486166-63a1.patch
 1485701-63a1.patch
 1486068-63a1.patch
@@ -6051,9 +6067,6 @@ NOBUG-20180824-buildsetting-63a1.patch
 1478269-3-63a1.patch
 1486654-63a1.patch
 1485759-63a1.patch
-1485347-1-63a1.patch
-1485347-2-63a1.patch
-1486444-63a1.patch
 1486729-63a1.patch
 1486957-63a1.patch
 1457092-5-63a1.patch
@@ -6070,13 +6083,28 @@ NOBUG-20180824-buildsetting-63a1.patch
 1486577-6-63a1.patch
 1486577-7-63a1.patch
 1486577-8-63a1.patch
+1328820-63a1.patch
+1486829-63a1.patch
+1480001-63a1.patch
+1486731-1-63a1.patch
+1486731-2-63a1.patch
+1486727-63a1.patch
+1486553-63a1.patch
+1479794-63a1.patch
+1461374-63a1.patch
+1486577-9-63a1.patch
+1476921-63a1.patch
+1479391-63a1.patch
+1487023-63a1.patch
 1471920-1-63a1.patch
 1482810-1-63a1.patch
 1482810-2-63a1.patch
 1486905-63a1.patch
+1442750-63a1.patch
+1487384-63a1.patch
 1485698-63a1.patch
 1486730-63a1.patch
-1476921-63a1.patch
+1486782-63a1.patch
 1487517-63a1.patch
 1480457-1-63a1.patch
 1480457-4-63a1.patch
@@ -6089,29 +6117,23 @@ NOBUG-20180824-buildsetting-63a1.patch
 1487595-1-63a1.patch
 1487595-2-63a1.patch
 1487346-1-63a1.patch
+1487483-63a1.patch
 1487346-2-63a1.patch
-1267297-63a1.patch
-1480552-63a1.patch
+1471136-63a1.patch
+1485738-63a1.patch
+1486397-63a1.patch
+1487662-63a1.patch
+1483962-63a1.patch
+1267297-64a1.patch
+1480552-64a1.patch
+taken-out-stuff-comes-here.patch
 1483323-6-64a1.patch
-#mozilla-central_434998.patch
-#mozilla-central_434999.patch
-#mozilla-central_435000.patch
-#mozilla-central_435001.patch
-#mozilla-central_435002.patch
-#mozilla-central_435003.patch
-#mozilla-central_435004.patch
-#mozilla-central_435005.patch
-#mozilla-central_435006.patch
-#mozilla-central_435007.patch
-#mozilla-central_435008.patch
-#mozilla-central_435009.patch
-#mozilla-central_435010.patch
-#mozilla-central_435011.patch
 1484611-2ano1-64a1.patch
 1484611-2b-64a1.patch
 1417646-1-64a1.patch
 1487419-64a1.patch
 1488698-2-PARTIAL-biginttype-64a1.patch
+1489601-64a1.patch
 1488698-7-WIP-64a1.patch
 #1488698-7-64a1.patch
 #1484948-64a1.patch
@@ -8497,6 +8519,7 @@ NOBUG-removessdks-25319.patch
 NOBUG-nukemozlinker-25319.patch
 1462261-3-25319.patch
 NOBUG-textrange-25319.patch
+1888364-openurl-25319.patch
 PPPPPPP-check_stdcxx-warn.patch
 PPPPPPP-NOBUG-PLASTER-getrandom.patch
 PPPPPPP-NSSgetentropy.patch
@@ -8555,7 +8578,6 @@ TOP-1846703-binutilsfix-11504.patch
 TOP-1859635-NSS3901-11506.patch
 TOP-1880562-NSS3902-11509.patch
 TOP-1864587-angle-11507.patch
-TOP-1472170-PARTIAL-NOTESTS-63a1.patch
 TOP-1466000-1-optchain-64a1-25313.patch
 TOP-1518661-3-67a1-25319.patch
 TOP-1566143-1to2-optchain-74a1-25313.patch
@@ -8568,12 +8590,12 @@ TOP-1629106-2-logicassign-25317.patch
 TOP-NOBUG-backout1440761-25318.patch
 TOP-NOBUG-killtelemetry-debugger-25319.patch
 TOP-NOBUG-fixcompile-25319.patch
-TOP-NOBUG-PLASTER-25319.patch
 TOP-NOBUG-JSFIXUPS-25319.patch
 TOP-NOBUG-REGEXP-01-Import-25318.patch
 TOP-NOBUG-REGEXP-02-1361856-1-dotall-76a1-25318.patch
 TOP-NOBUG-REGEXP-03-1537978-68a1-25318.patch
 TOP-NOBUG-REGEXP-04-1539690-68a1-25318.patch
+TOP-1541286-68a1.patch
 TOP-NOBUG-REGEXP-05-1546300-68a1-25318.patch
 TOP-NOBUG-REGEXP-06-1504947-10-68a1-25318.patch
 TOP-NOBUG-REGEXP-07-1626713-76a1-25318.patch
@@ -8619,7 +8641,6 @@ TOP-NOBUG-REGEXP-44-irregexp-25318.patch
 TOP-NOBUG-REGEXP-45-final-25318.patch
 TOP-NOBUG-REGEXP-46-fixes-25318.patch
 TOP-NOBUG-REGEXP-47-fixes-25319.patch
-1888364-openurl-25319.patch
 
 
 
@@ -8632,7 +8653,6 @@ ccccccc.fixit.patch
 
 
 
-L-1460489-6-63a1.patch
 
 1545354-68a1.patch
 
@@ -8755,11 +8775,6 @@ L-1641790-78a1.patch
 L-1670807-84a1.patch
 L-1672894-84a1.patch
 L-1694324-84a1.patch
-mozilla-esr78-push_444862.patch
-mozilla-esr78-push_444863.patch
-mozilla-esr78-push_444864.patch
-mozilla-esr78-push_444865.patch
-mozilla-esr78-push_444866.patch
 1478330-63a1.patch
 1484915-66a1.patch
 1519501-2-66a1.patch
@@ -8919,7 +8934,6 @@ PY_1646794-82a1.patch
 L-NOBUG-killwebrtctelemetry-25317.patch
 
 
-L-1423328-59a1.patch
 
 
 
@@ -8934,7 +8948,6 @@ L-1405491-4-58a1.patch
 
 
 mozilla-esr60_450802.patch
-mozilla-esr60_450803.patch
 mozilla-esr60_450554.patch
 mozilla-esr60_450936.patch
 mozilla-esr60_451240.patch
@@ -11277,7 +11290,7 @@ mozilla-central-push_421066.patch
 mozilla-central-push_421533.patch
 L-1478942-63a1.patch
 L-1477626-9-63a1.patch
-1486577-9-63a1.patch
+
 mozilla-central-push_421799.patch
 mozilla-central-push_421800.patch
 mozilla-central-push_421801.patch
@@ -11511,88 +11524,24 @@ mozilla-central-push_433229.patch
 mozilla-central-push_433233.patch
 mozilla-central-push_433238.patch
 mozilla-central-push_433239.patch
-
-
-
-the-taken-out-stuff-start.patch
-I-am-here.patch
-mozilla-central-push_433212.patch
-mozilla-central-push_433250.patch
-mozilla-central-push_433255.patch
-mozilla-central-push_433279.patch
-mozilla-central-push_433324.patch
-mozilla-central-push_433325.patch
-mozilla-central-push_433357.patch
-mozilla-central-push_433358.patch
-mozilla-central-push_433385.patch
-mozilla-central-push_433561.patch
-mozilla-central-push_433562.patch
-mozilla-central-push_433567.patch
-mozilla-central-push_433568.patch
-mozilla-central-push_433569.patch
-mozilla-central-push_433577.patch
-mozilla-central-push_433584.patch
-mozilla-central-push_433585.patch
-mozilla-central-push_433615.patch
-mozilla-central-push_433622.patch
-mozilla-central-push_433628.patch
-mozilla-central-push_433632.patch
-mozilla-central-push_433634.patch
 mozilla-central-push_433686.patch
 mozilla-central-push_433687.patch
 mozilla-central-push_433688.patch
-mozilla-central-push_433701.patch
-mozilla-central-push_433712.patch
-mozilla-central-push_433713.patch
-mozilla-central-push_433714.patch
-mozilla-central-push_433715.patch
-mozilla-central-push_433716.patch
-mozilla-central-push_433717.patch
-mozilla-central-push_433718.patch
-mozilla-central-push_433719.patch
-mozilla-central-push_433724.patch
 mozilla-central-push_433729.patch
 mozilla-central-push_433731.patch
 mozilla-central-push_433732.patch
-mozilla-central-push_433761.patch
-mozilla-central-push_433775.patch
-mozilla-central-push_433778.patch
-mozilla-central-push_433780.patch
-mozilla-central-push_433875.patch
-mozilla-central-push_433884.patch
-mozilla-central-push_433885.patch
 mozilla-central-push_433921.patch
 mozilla-central-push_433928.patch
 mozilla-central-push_433929.patch
 mozilla-central-push_433977.patch
-mozilla-central-push_433995.patch
-mozilla-central-push_433996.patch
-mozilla-central-push_433997.patch
-mozilla-central-push_433998.patch
-mozilla-central-push_434011.patch
 mozilla-central-push_434070.patch
 mozilla-central-push_434077.patch
-mozilla-central-push_434095.patch
-mozilla-central-push_434101.patch
-mozilla-central-push_434119.patch
-mozilla-central-push_434123.patch
-mozilla-central-push_434126.patch
-mozilla-central-push_434127.patch
-mozilla-central-push_434179.patch
-mozilla-central-push_434306.patch
-mozilla-central-push_434307.patch
-mozilla-central-push_434309.patch
-mozilla-central-push_434356.patch
-mozilla-central-push_434379.patch
-mozilla-central-push_434396.patch
-mozilla-central-push_434411.patch
-mozilla-central-push_434421.patch
-mozilla-central-push_434424.patch
 mozilla-central-push_434464.patch
-mozilla-central-push_434468.patch
-mozilla-central-push_434596.patch
+64a1-start
 mozilla-central-push_434599.patch
-mozilla-central-push_434600.patch
+
+the-taken-out-stuff-start.patch
+I-am-here.patch
 mozilla-central-push_434608.patch
 mozilla-central-push_434620.patch
 mozilla-central-push_434622.patch
@@ -11616,7 +11565,6 @@ mozilla-central-push_434823.patch
 mozilla-central-push_434824.patch
 mozilla-central-push_434931.patch
 mozilla-central-push_434932.patch
-mozilla-central-push_434942.patch
 mozilla-central-push_434955.patch
 mozilla-central-push_434956.patch
 mozilla-central-push_434986.patch

+ 47 - 12
frg/work-js/mozilla-release/patches/series-test

@@ -2973,7 +2973,6 @@ servo-20274-60a1.patch
 1382841-4-60a1.patch
 1382841-5-60a1.patch
 1444303-61a1.patch
-1447391-61a1.patch
 1444881-61a1.patch
 1421563-61a1.patch
 1401129-7-61a1.patch
@@ -3137,6 +3136,7 @@ NOBUG-20180313-inspector-61a1.patch
 1445633-61a1.patch
 1444834-61a1.patch
 1445592-61a1.patch
+1445551-6only-PARTIAL-61a1.patch
 977538-2-61a1.patch
 1435360-1-61a1.patch
 1435360-2-61a1.patch
@@ -3445,6 +3445,7 @@ servo-20351-61a1.patch
 1414286-1-61a1.patch
 1414286-2-61a1.patch
 1434007-2-61a1.patch
+1447391-61a1.patch
 1444033-61a1.patch
 1448138-61a1.patch
 servo-20407-61a1.patch
@@ -6000,7 +6001,6 @@ NOBUG-20180809-utf8-63a1.patch
 1483761-3-63a1.patch
 1483761-4-63a1.patch
 1485545-63a1.patch
-1485610-63a1.patch
 1480725-2-63a1.patch
 1467116-63a1.patch
 1482178-63a1.patch
@@ -6025,10 +6025,20 @@ NOBUG-20180809-utf8-63a1.patch
 1485162-1-63a1.patch
 1485162-2-63a1.patch
 1480998-63a1.patch
+1483030-63a1.patch
+1485610-63a1.patch
+1432135-63a1.patch
+1481670-1-63a1.patch
+1481670-2-63a1.patch
+1481670-3-63a1.patch
+1437065-4-63a1.patch
+1437065-5-63a1.patch
+1486027-63a1.patch
+1449985-63a1.patch
+1456973-63a1.patch
 1466427-63a1.patch
 NOBUG-20180824-buildsetting-63a1.patch
 1446923-63a1.patch
-1432135-63a1.patch
 1485949-63a1.patch
 1483953-63a1.patch
 1485396-63a1.patch
@@ -6036,12 +6046,19 @@ NOBUG-20180824-buildsetting-63a1.patch
 1486173-1-63a1.patch
 1486173-2-63a1.patch
 1486173-3-63a1.patch
+1486444-63a1.patch
+1485347-1-63a1.patch
+1485347-2-63a1.patch
+1480587-63a1.patch
+1485209-63a1.patch
+1472170-63a1.patch
 1471922-63a1.patch
 1486056-63a1.patch
 1486020-63a1.patch
 1485485-1-63a1.patch
 1485485-2-63a1.patch
 1486281-63a1.patch
+1486584-63a1.patch
 1486166-63a1.patch
 1485701-63a1.patch
 1486068-63a1.patch
@@ -6050,9 +6067,6 @@ NOBUG-20180824-buildsetting-63a1.patch
 1478269-3-63a1.patch
 1486654-63a1.patch
 1485759-63a1.patch
-1485347-1-63a1.patch
-1485347-2-63a1.patch
-1486444-63a1.patch
 1486729-63a1.patch
 1486957-63a1.patch
 1457092-5-63a1.patch
@@ -6069,13 +6083,28 @@ NOBUG-20180824-buildsetting-63a1.patch
 1486577-6-63a1.patch
 1486577-7-63a1.patch
 1486577-8-63a1.patch
+1328820-63a1.patch
+1486829-63a1.patch
+1480001-63a1.patch
+1486731-1-63a1.patch
+1486731-2-63a1.patch
+1486727-63a1.patch
+1486553-63a1.patch
+1479794-63a1.patch
+1461374-63a1.patch
+1486577-9-63a1.patch
+1476921-63a1.patch
+1479391-63a1.patch
+1487023-63a1.patch
 1471920-1-63a1.patch
 1482810-1-63a1.patch
 1482810-2-63a1.patch
 1486905-63a1.patch
+1442750-63a1.patch
+1487384-63a1.patch
 1485698-63a1.patch
 1486730-63a1.patch
-1476921-63a1.patch
+1486782-63a1.patch
 1487517-63a1.patch
 1480457-1-63a1.patch
 1480457-4-63a1.patch
@@ -6088,15 +6117,22 @@ NOBUG-20180824-buildsetting-63a1.patch
 1487595-1-63a1.patch
 1487595-2-63a1.patch
 1487346-1-63a1.patch
+1487483-63a1.patch
 1487346-2-63a1.patch
-1267297-63a1.patch
-1480552-63a1.patch
+1471136-63a1.patch
+1485738-63a1.patch
+1486397-63a1.patch
+1487662-63a1.patch
+1483962-63a1.patch
+1267297-64a1.patch
+1480552-64a1.patch
 1483323-6-64a1.patch
 1484611-2ano1-64a1.patch
 1484611-2b-64a1.patch
 1417646-1-64a1.patch
 1487419-64a1.patch
 1488698-2-PARTIAL-biginttype-64a1.patch
+1489601-64a1.patch
 1488698-7-WIP-64a1.patch
 1489944-64a1.patch
 1493227-64a1.patch
@@ -8405,6 +8441,7 @@ NOBUG-removessdks-25319.patch
 NOBUG-nukemozlinker-25319.patch
 1462261-3-25319.patch
 NOBUG-textrange-25319.patch
+1888364-openurl-25319.patch
 PPPPPPP-check_stdcxx-warn.patch
 PPPPPPP-NOBUG-PLASTER-getrandom.patch
 PPPPPPP-NSSgetentropy.patch
@@ -8463,7 +8500,6 @@ TOP-1846703-binutilsfix-11504.patch
 TOP-1859635-NSS3901-11506.patch
 TOP-1880562-NSS3902-11509.patch
 TOP-1864587-angle-11507.patch
-TOP-1472170-PARTIAL-NOTESTS-63a1.patch
 TOP-1466000-1-optchain-64a1-25313.patch
 TOP-1518661-3-67a1-25319.patch
 TOP-1566143-1to2-optchain-74a1-25313.patch
@@ -8476,12 +8512,12 @@ TOP-1629106-2-logicassign-25317.patch
 TOP-NOBUG-backout1440761-25318.patch
 TOP-NOBUG-killtelemetry-debugger-25319.patch
 TOP-NOBUG-fixcompile-25319.patch
-TOP-NOBUG-PLASTER-25319.patch
 TOP-NOBUG-JSFIXUPS-25319.patch
 TOP-NOBUG-REGEXP-01-Import-25318.patch
 TOP-NOBUG-REGEXP-02-1361856-1-dotall-76a1-25318.patch
 TOP-NOBUG-REGEXP-03-1537978-68a1-25318.patch
 TOP-NOBUG-REGEXP-04-1539690-68a1-25318.patch
+TOP-1541286-68a1.patch
 TOP-NOBUG-REGEXP-05-1546300-68a1-25318.patch
 TOP-NOBUG-REGEXP-06-1504947-10-68a1-25318.patch
 TOP-NOBUG-REGEXP-07-1626713-76a1-25318.patch
@@ -8527,4 +8563,3 @@ TOP-NOBUG-REGEXP-44-irregexp-25318.patch
 TOP-NOBUG-REGEXP-45-final-25318.patch
 TOP-NOBUG-REGEXP-46-fixes-25318.patch
 TOP-NOBUG-REGEXP-47-fixes-25319.patch
-1888364-openurl-25319.patch