Browse Source

align with release and backports

Frank-Rainer Grahl 8 months ago
parent
commit
af23104cf3
100 changed files with 1408 additions and 875 deletions
  1. 0 0
      frg/work-js/mozilla-release/patches/1308735-62a1.patch
  2. 0 0
      frg/work-js/mozilla-release/patches/1329321-62a1.patch
  3. 8 8
      frg/work-js/mozilla-release/patches/1346211-6-63a1.patch
  4. 12 12
      frg/work-js/mozilla-release/patches/1351501-1-64a1.patch
  5. 0 0
      frg/work-js/mozilla-release/patches/1391688-1-58a1.patch
  6. 0 0
      frg/work-js/mozilla-release/patches/1405070-2-58a1.patch
  7. 21 25
      frg/work-js/mozilla-release/patches/1425280-59a1.patch
  8. 5 6
      frg/work-js/mozilla-release/patches/1435813-1a-62a1.patch
  9. 1 1
      frg/work-js/mozilla-release/patches/1437548-1-60a1.patch
  10. 6 7
      frg/work-js/mozilla-release/patches/1456118-62a1.patch
  11. 0 0
      frg/work-js/mozilla-release/patches/1457560-62a1.patch
  12. 0 0
      frg/work-js/mozilla-release/patches/1459754-62a1.patch
  13. 0 0
      frg/work-js/mozilla-release/patches/1460154-1-62a1.patch
  14. 0 0
      frg/work-js/mozilla-release/patches/1460154-2-62a1.patch
  15. 0 0
      frg/work-js/mozilla-release/patches/1461375-62a1.patch
  16. 0 0
      frg/work-js/mozilla-release/patches/1461948-1-62a1.patch
  17. 0 0
      frg/work-js/mozilla-release/patches/1461948-2-62a1.patch
  18. 0 0
      frg/work-js/mozilla-release/patches/1462286-62a1.patch
  19. 0 0
      frg/work-js/mozilla-release/patches/1464772-5-62a1.patch
  20. 0 0
      frg/work-js/mozilla-release/patches/1464790-62a1.patch
  21. 25 54
      frg/work-js/mozilla-release/patches/1464869-08-62a1.patch
  22. 297 145
      frg/work-js/mozilla-release/patches/1464869-09-62a1.patch
  23. 0 0
      frg/work-js/mozilla-release/patches/1465081-62a1.patch
  24. 0 0
      frg/work-js/mozilla-release/patches/1465472-1-62a1.patch
  25. 0 0
      frg/work-js/mozilla-release/patches/1465472-2-62a1.patch
  26. 21 19
      frg/work-js/mozilla-release/patches/1465728-1-62a1.patch
  27. 36 28
      frg/work-js/mozilla-release/patches/1465728-2-62a1.patch
  28. 10 10
      frg/work-js/mozilla-release/patches/1465728-3-62a1.patch
  29. 0 0
      frg/work-js/mozilla-release/patches/1466083-2-62a1.patch
  30. 0 0
      frg/work-js/mozilla-release/patches/1466083-3-62a1.patch
  31. 0 0
      frg/work-js/mozilla-release/patches/1466083-4-62a1.patch
  32. 0 0
      frg/work-js/mozilla-release/patches/1466083-5-62a1.patch
  33. 0 0
      frg/work-js/mozilla-release/patches/1466083-6-62a1.patch
  34. 0 0
      frg/work-js/mozilla-release/patches/1466083-7-62a1.patch
  35. 13 13
      frg/work-js/mozilla-release/patches/1466083-8-62a1.patch
  36. 0 0
      frg/work-js/mozilla-release/patches/1466083-9-62a1.patch
  37. 0 0
      frg/work-js/mozilla-release/patches/1466189-1-62a1.patch
  38. 0 0
      frg/work-js/mozilla-release/patches/1466189-2-62a1.patch
  39. 0 0
      frg/work-js/mozilla-release/patches/1466792-62a1.patch
  40. 0 0
      frg/work-js/mozilla-release/patches/1466931-62a1.patch
  41. 0 0
      frg/work-js/mozilla-release/patches/1467052-62a1.patch
  42. 1 23
      frg/work-js/mozilla-release/patches/1467071-62a1.patch
  43. 3 3
      frg/work-js/mozilla-release/patches/1467334-62a1.patch
  44. 0 0
      frg/work-js/mozilla-release/patches/1467335-62a1.patch
  45. 0 0
      frg/work-js/mozilla-release/patches/1467336-01-62a1.patch
  46. 0 0
      frg/work-js/mozilla-release/patches/1467336-02-62a1.patch
  47. 0 0
      frg/work-js/mozilla-release/patches/1467336-03-62a1.patch
  48. 0 0
      frg/work-js/mozilla-release/patches/1467336-04-62a1.patch
  49. 171 0
      frg/work-js/mozilla-release/patches/1467336-05-62a1.patch
  50. 0 0
      frg/work-js/mozilla-release/patches/1467336-06-62a1.patch
  51. 0 0
      frg/work-js/mozilla-release/patches/1467336-07-62a1.patch
  52. 0 0
      frg/work-js/mozilla-release/patches/1467336-09-62a1.patch
  53. 0 0
      frg/work-js/mozilla-release/patches/1467336-10-62a1.patch
  54. 0 0
      frg/work-js/mozilla-release/patches/1467336-11-62a1.patch
  55. 0 0
      frg/work-js/mozilla-release/patches/1467336-12-62a1.patch
  56. 0 0
      frg/work-js/mozilla-release/patches/1467336-13-62a1.patch
  57. 0 0
      frg/work-js/mozilla-release/patches/1467336-14-62a1.patch
  58. 0 0
      frg/work-js/mozilla-release/patches/1467336-15-62a1.patch
  59. 0 0
      frg/work-js/mozilla-release/patches/1467336-16-62a1.patch
  60. 0 0
      frg/work-js/mozilla-release/patches/1467336-17-62a1.patch
  61. 0 0
      frg/work-js/mozilla-release/patches/1467336-18-62a1.patch
  62. 0 0
      frg/work-js/mozilla-release/patches/1467336-19-62a1.patch
  63. 0 0
      frg/work-js/mozilla-release/patches/1467336-20-62a1.patch
  64. 2 2
      frg/work-js/mozilla-release/patches/1467336-21-62a1.patch
  65. 0 0
      frg/work-js/mozilla-release/patches/1467336-22-62a1.patch
  66. 0 0
      frg/work-js/mozilla-release/patches/1467336-23-62a1.patch
  67. 0 0
      frg/work-js/mozilla-release/patches/1467403-62a1.patch
  68. 0 0
      frg/work-js/mozilla-release/patches/1467496-62a1.patch
  69. 5 4
      frg/work-js/mozilla-release/patches/1468449-1-62a1.patch
  70. 28 27
      frg/work-js/mozilla-release/patches/1468449-2-62a1.patch
  71. 0 0
      frg/work-js/mozilla-release/patches/1468629-62a1.patch
  72. 9 9
      frg/work-js/mozilla-release/patches/1468786-62a1.patch
  73. 0 0
      frg/work-js/mozilla-release/patches/1468984-62a1.patch
  74. 0 0
      frg/work-js/mozilla-release/patches/1469444-62a1.patch
  75. 0 0
      frg/work-js/mozilla-release/patches/1469469-62a1.patch
  76. 0 0
      frg/work-js/mozilla-release/patches/1469593-62a1.patch
  77. 15 20
      frg/work-js/mozilla-release/patches/1473297-63a1.patch
  78. 9 9
      frg/work-js/mozilla-release/patches/1483323-6-64a1.patch
  79. 23 23
      frg/work-js/mozilla-release/patches/1490130-64a1.patch
  80. 12 14
      frg/work-js/mozilla-release/patches/1490589-64a1.patch
  81. 29 40
      frg/work-js/mozilla-release/patches/1494752-604.patch
  82. 265 0
      frg/work-js/mozilla-release/patches/1514625-66a1.patch
  83. 10 10
      frg/work-js/mozilla-release/patches/1559975-10-70a1.patch
  84. 38 35
      frg/work-js/mozilla-release/patches/1563797-3-70a1.patch
  85. 16 16
      frg/work-js/mozilla-release/patches/1566141-1-72a1.patch
  86. 12 12
      frg/work-js/mozilla-release/patches/1566141-7-72a1.patch
  87. 5 5
      frg/work-js/mozilla-release/patches/1567642-8-71a1.patch
  88. 5 5
      frg/work-js/mozilla-release/patches/1587206-1-71a1.patch
  89. 4 4
      frg/work-js/mozilla-release/patches/1590907-2-72a1.patch
  90. 5 5
      frg/work-js/mozilla-release/patches/1614518-6-75a1.patch
  91. 54 52
      frg/work-js/mozilla-release/patches/1618620-5-75a1.patch
  92. 6 6
      frg/work-js/mozilla-release/patches/1618620-9-75a1.patch
  93. 45 46
      frg/work-js/mozilla-release/patches/1619475-1-75a1.patch
  94. 15 21
      frg/work-js/mozilla-release/patches/1619475-2-75a1.patch
  95. 7 7
      frg/work-js/mozilla-release/patches/1632916-78a1.patch
  96. 2 20
      frg/work-js/mozilla-release/patches/1711872-91a1.patch
  97. 29 0
      frg/work-js/mozilla-release/patches/NOBUG-20170801-promisehelper-57a1.patch
  98. 58 59
      frg/work-js/mozilla-release/patches/TOP-1378808-optchain-63a1-25313.patch
  99. 34 34
      frg/work-js/mozilla-release/patches/TOP-1566143-1to2-optchain-74a1-25313.patch
  100. 36 36
      frg/work-js/mozilla-release/patches/TOP-1566143-3-optchain-74a1-25313.patch

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422490.patch → frg/work-js/mozilla-release/patches/1308735-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422489.patch → frg/work-js/mozilla-release/patches/1329321-62a1.patch


+ 8 - 8
frg/work-js/mozilla-release/patches/1346211-6-63a1.patch

@@ -2,7 +2,7 @@
 # User Andre Bargull <andre.bargull@gmail.com>
 # Date 1534500279 25200
 # Node ID 7b1a3a49547dc9564aaa6ecf90b919b66b7ada8d
-# Parent  c3811faa910c7829ab20f1afa4ff8a3eaf76cdfc
+# Parent  2bf9e6f3316cf8511f6299eb6cc5cf1b6a8302ed
 Bug 1346211 - Part 6: Use ICU for all time zone computations when available. r=Waldo
 
 diff --git a/browser/components/resistfingerprinting/test/browser/browser_timezone.js b/browser/components/resistfingerprinting/test/browser/browser_timezone.js
@@ -87,15 +87,15 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  #include "mozilla/Unused.h"
  
 +#include <algorithm>
+ #include <cfloat>
  #include <cmath>
  #include <cstdlib>
  #include <ctime>
  
- #include "jsapi.h"
- #include "jsfriendapi.h"
- 
- #include "builtin/Promise.h"
-@@ -4944,16 +4946,95 @@ SetTimeZone(JSContext* cx, unsigned argc
+ #if defined(XP_UNIX) && !defined(XP_DARWIN)
+ #include <time.h>
+ #else
+@@ -4986,16 +4988,95 @@ SetTimeZone(JSContext* cx, unsigned argc
  #endif /* _WIN32 */
  
      JS::ResetTimeZone();
@@ -191,7 +191,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  
      uint32_t max_cnt;
      if (!ToUint32(cx, args.get(0), &max_cnt))
-@@ -5802,16 +5883,20 @@ gc::ZealModeHelpText),
+@@ -5900,16 +5981,20 @@ gc::ZealModeHelpText),
      JS_FN_HELP("isLegacyIterator", IsLegacyIterator, 1, 0,
  "isLegacyIterator(value)",
  "  Returns whether the value is considered is a legacy iterator.\n"),
@@ -212,7 +212,7 @@ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctio
  "  running the jitcode rather than staying in the interpreter:\n"
  "    baselineCompile();  for (var i=0; i<1; i++) {} ...\n"
  "  The interpreter will enter the new jitcode at the loop header.\n"),
-@@ -5835,16 +5920,22 @@ static const JSFunctionSpecWithHelp Fuzz
+@@ -5933,16 +6018,22 @@ static const JSFunctionSpecWithHelp Fuzz
  "  Returns an array of error notes."),
  
      JS_FN_HELP("setTimeZone", SetTimeZone, 1, 0,

+ 12 - 12
frg/work-js/mozilla-release/patches/1351501-1-64a1.patch

@@ -3,7 +3,7 @@
 # Date 1537554033 0
 #      Fri Sep 21 18:20:33 2018 +0000
 # Node ID ab2856e070b9de566ec676655ac42431cdb8c17f
-# Parent  2b507c6838c5edcb533615b50828a0b9f62f48ea
+# Parent  ced758ef38797011db61371c0105bf58b54f73df
 Bug 1351501, part 1 - Handlify TryPreserveWrapper r=bzbarsky
 
 The patch in the next part will need a handle to the object in
@@ -14,7 +14,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D6197
 diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp
 --- a/dom/bindings/BindingUtils.cpp
 +++ b/dom/bindings/BindingUtils.cpp
-@@ -1058,17 +1058,17 @@ NativeInterface2JSObjectAndThrowIfFailed
+@@ -1063,17 +1063,17 @@ NativeInterface2JSObjectAndThrowIfFailed
        Throw(aCx, NS_FAILED(rv) ? rv : NS_ERROR_UNEXPECTED);
      }
      return false;
@@ -36,7 +36,7 @@ diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp
 diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
 --- a/dom/bindings/BindingUtils.h
 +++ b/dom/bindings/BindingUtils.h
-@@ -1541,17 +1541,17 @@ UpdateWrapper(T* p, void*, JSObject* obj
+@@ -1550,17 +1550,17 @@ UpdateWrapper(T* p, void*, JSObject* obj
  // Return true if we successfully preserved the wrapper, or there is no wrapper
  // to preserve. In the latter case we don't need to preserve the wrapper, because
  // the object can only be obtained by JS once, or they cannot be meaningfully
@@ -58,7 +58,7 @@ diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
 diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp
 --- a/dom/workers/RuntimeService.cpp
 +++ b/dom/workers/RuntimeService.cpp
-@@ -910,17 +910,17 @@ InitJSContextForWorker(WorkerPrivate* aW
+@@ -925,17 +925,17 @@ InitJSContextForWorker(WorkerPrivate* aW
  #ifdef JS_GC_ZEAL
    JS_SetGCZeal(aWorkerCx, settings.gcZeal, settings.gcZealFrequency);
  #endif
@@ -106,13 +106,13 @@ new file mode 100644
 diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
 --- a/js/src/jsfriendapi.h
 +++ b/js/src/jsfriendapi.h
-@@ -453,17 +453,17 @@ StopDrainingJobQueue(JSContext* cx);
+@@ -457,17 +457,17 @@ StopDrainingJobQueue(JSContext* cx);
  
  extern JS_FRIEND_API(void)
  RunJobs(JSContext* cx);
  
  extern JS_FRIEND_API(JS::Zone*)
- GetCompartmentZone(JSCompartment* comp);
+ GetRealmZone(JS::Realm* realm);
  
  typedef bool
 -(* PreserveWrapperCallback)(JSContext* cx, JSObject* obj);
@@ -128,7 +128,7 @@ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.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
-@@ -3121,17 +3121,17 @@ DisassWithSrc(JSContext* cx, unsigned ar
+@@ -3211,17 +3211,17 @@ DisassWithSrc(JSContext* cx, unsigned ar
      args.rval().setUndefined();
      return true;
  }
@@ -150,12 +150,12 @@ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
 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
-@@ -2724,17 +2724,17 @@ DestroyRealm(JSFreeOp* fop, JS::Realm* r
- static void
- GetRealmName(JSContext* cx, Handle<Realm*> realm, char* buf, size_t bufsize)
+@@ -2760,17 +2760,17 @@ DestroyRealm(JSFreeOp* fop, JS::Realm* r
  {
-     JSCompartment* comp = GetCompartmentForRealm(realm);
-     CompartmentNameCallback(cx, comp, buf, bufsize);
+     // Get the current compartment private into an AutoPtr (which will do the
+     // cleanup for us), and null out the private field.
+     mozilla::UniquePtr<RealmPrivate> priv(RealmPrivate::Get(realm));
+     JS::SetRealmPrivate(realm, nullptr);
  }
  
  static bool

+ 0 - 0
frg/work-js/mozilla-release/patches/1391688-1no2-58a1.patch → frg/work-js/mozilla-release/patches/1391688-1-58a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/1405070-2only-58a1.patch → frg/work-js/mozilla-release/patches/1405070-2-58a1.patch


+ 21 - 25
frg/work-js/mozilla-release/patches/1425280-59a1.patch

@@ -2,7 +2,7 @@
 # User Julian Descottes <jdescottes@mozilla.com>
 # Date 1513287817 21600
 # Node ID 889f51eea06ec20c7d3c040c0cbe8571f96cd3fb
-# Parent  70d32d6669476ef8e8050ba33881e5caac73d81e
+# Parent  f492ea98166c0263d09cbd656f95af66b479911b
 Bug 1425280 - Fix localization note mismatch in devtools files;r=pbro
 
 MozReview-Commit-ID: FVJUjB25smI
@@ -243,30 +243,26 @@ diff --git a/devtools/client/locales/en-US/debugger.properties b/devtools/client
  # in the variables list on certain variables or properties as tooltips.
  # Expanations of what these represent can be found at the following links:
  # https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
-diff --git a/devtools/client/locales/en-US/font-inspector.properties.1425280.earlier b/devtools/client/locales/en-US/font-inspector.properties.1425280.earlier
-new file mode 100644
---- /dev/null
-+++ b/devtools/client/locales/en-US/font-inspector.properties.1425280.earlier
-@@ -0,0 +1,19 @@
-+--- font-inspector.properties
-++++ font-inspector.properties
-+@@ -19,15 +19,15 @@ fontinspector.usedAs=Used as:
-+ # LOCALIZATION NOTE (fontinspector.system) This label indicates that the font is a local
-+ # system font.
-+ fontinspector.system=system
-+ 
-+ # LOCALIZATION NOTE (fontinspector.remote) This label indicates that the font is a remote
-+ # font.
-+ fontinspector.remote=remote
-+ 
-+-# LOCALIZATION NOTE (fontinspector.previewHint):
-++# LOCALIZATION NOTE (fontinspector.previewText):
-+ # This is the label shown as the placeholder in font inspector preview text box.
-+ fontinspector.previewText=Preview Text
-+ 
-+ # LOCALIZATION NOTE (fontinspector.noFontsOnSelectedElement): This label is shown when
-+ # no fonts found on the selected element.
-+ fontinspector.noFontsOnSelectedElement=No fonts were found for the current element.
+diff --git a/devtools/client/locales/en-US/font-inspector.properties b/devtools/client/locales/en-US/font-inspector.properties
+--- a/devtools/client/locales/en-US/font-inspector.properties
++++ b/devtools/client/locales/en-US/font-inspector.properties
+@@ -19,15 +19,15 @@ fontinspector.usedAs=Used as:
+ # LOCALIZATION NOTE (fontinspector.system) This label indicates that the font is a local
+ # system font.
+ fontinspector.system=system
+ 
+ # LOCALIZATION NOTE (fontinspector.remote) This label indicates that the font is a remote
+ # font.
+ fontinspector.remote=remote
+ 
+-# LOCALIZATION NOTE (fontinspector.previewHint):
++# LOCALIZATION NOTE (fontinspector.previewText):
+ # This is the label shown as the placeholder in font inspector preview text box.
+ fontinspector.previewText=Preview Text
+ 
+ # LOCALIZATION NOTE (fontinspector.noFontsOnSelectedElement): This label is shown when
+ # no fonts found on the selected element.
+ fontinspector.noFontsOnSelectedElement=No fonts were found for the current element.
 diff --git a/devtools/client/locales/en-US/har.properties b/devtools/client/locales/en-US/har.properties
 --- a/devtools/client/locales/en-US/har.properties
 +++ b/devtools/client/locales/en-US/har.properties

+ 5 - 6
frg/work-js/mozilla-release/patches/1435813-1a-62a1.patch

@@ -1,16 +1,14 @@
 # HG changeset patch
 # User Tom Schuster <evilpies@gmail.com>
 # Date 1528202501 -7200
-# Node ID 6bb5431a0374fb2456a0a98a8e37fe4d1e8ceedd
-# Parent  25253631307214e600266a7dd71f10e0846961e6
+# Node ID cdf66457cb244501e4b9a018cc71c956cc25113b
+# Parent  1ccef101954500f32fb9fadce0cab9ea1c94a948
 Bug 1435813 - Enable Array.prototype.flat and Array.prototype.flatMap in release builds. r=till
 
-Fix previous patch.
-
 diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
 --- a/js/src/tests/jstests.list
 +++ b/js/src/tests/jstests.list
-@@ -41,20 +41,16 @@ skip-if(!this.hasOwnProperty("Intl")) in
+@@ -41,21 +41,16 @@ skip-if(!this.hasOwnProperty("Intl")) in
  # Skip built-ins/Simd tests when SIMD isn't available.
  skip-if(!this.hasOwnProperty("SIMD")) include test262/built-ins/Simd/jstests.list
  
@@ -23,7 +21,7 @@ diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
 -skip-if(!Array.prototype.flatMap) include test262/built-ins/Array/prototype/flatMap/jstests.list
 -skip-if(!Array.prototype.flat) include test262/built-ins/Array/prototype/flat/jstests.list
 -
- 
+-
  #####################################
  # Test262 tests disabled on browser #
  #####################################
@@ -31,6 +29,7 @@ diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
  # Defines a non-configurable property on the WindowProxy object.
  skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-global-update.js
  skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-global-update.js
+ skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-global-update.js
 diff --git a/js/src/tests/jstests.list.later.1435813 b/js/src/tests/jstests.list.later.1435813
 deleted file mode 100644
 --- a/js/src/tests/jstests.list.later.1435813

+ 1 - 1
frg/work-js/mozilla-release/patches/1437548-1-60a1.patch

@@ -1063,7 +1063,7 @@ diff --git a/devtools/client/locales/en-US/font-inspector.properties b/devtools/
  # font.
  fontinspector.remote=remote
  
--# LOCALIZATION NOTE (fontinspector.previewHint):
+-# LOCALIZATION NOTE (fontinspector.previewText):
 -# This is the label shown as the placeholder in font inspector preview text box.
 -fontinspector.previewText=Preview Text
 -

+ 6 - 7
frg/work-js/mozilla-release/patches/1456118-62a1.patch

@@ -2,7 +2,7 @@
 # User Andre Bargull <andre.bargull@gmail.com>
 # Date 1525852257 25200
 # Node ID 6fd7afdec053740c24fca7ac7a8330005ac157c6
-# Parent  0cee566594fe64e35944c200e82867945d064942
+# Parent  d0031a8422ce87b11df7ce05ad16b263dfc5cc55
 Bug 1456118: Update helper scripts for Python 3 compatibility. r=anba
 
 diff --git a/js/src/builtin/intl/make_intl_data.py b/js/src/builtin/intl/make_intl_data.py
@@ -557,7 +557,7 @@ diff --git a/js/src/tests/non262/String/make-normalize-generateddata-input.py b/
 diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
 --- a/js/src/tests/test262-update.py
 +++ b/js/src/tests/test262-update.py
-@@ -10,17 +10,18 @@ from __future__ import print_function
+@@ -10,17 +10,17 @@ from __future__ import print_function
  import contextlib
  import io
  import os
@@ -568,7 +568,6 @@ diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
  from functools import partial
 -from itertools import chain, imap
 +from itertools import chain
-+
  
  # Skip all tests which use features not supported in SpiderMonkey.
  UNSUPPORTED_FEATURES = set([
@@ -577,7 +576,7 @@ diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
                              "class-fields-private",
                              "regexp-dotall",
                              "regexp-lookbehind",
-@@ -104,32 +105,35 @@ def createRefTestEntry(skip, skipIf, err
+@@ -104,32 +104,35 @@ def createRefTestEntry(skip, skipIf, err
  
      return line
  
@@ -620,7 +619,7 @@ diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
  
      with io.open(os.path.join(test262OutDir, testFileName), "wb") as output:
          output.write(source)
-@@ -158,52 +162,52 @@ def writeShellAndBrowserFiles(test262Out
+@@ -158,52 +161,52 @@ def writeShellAndBrowserFiles(test262Out
      def findIncludes():
          parentIncludes = findParentIncludes()
          for include in includesMap[relPath]:
@@ -679,7 +678,7 @@ diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
      # Skip all files which contain YAML errors.
      if testRec is None:
          refTestSkip.append("has YAML errors")
-@@ -218,17 +222,17 @@ def convertTestFile(test262parser, testS
+@@ -218,17 +221,17 @@ def convertTestFile(test262parser, testS
      # The "raw" attribute is used in the default test262 runner to prevent
      # prepending additional content (use-strict directive, harness files)
      # before the actual test source code.
@@ -698,7 +697,7 @@ diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
      # when the error is issued (runtime error or early parse error). We're
      # currently ignoring the error phase attribute.
      # testRec["negative"] == {type=<error name>, phase=parse|resolution|runtime}
-@@ -534,17 +538,17 @@ def general_update(inDir, outDir, strict
+@@ -534,17 +537,17 @@ def general_update(inDir, outDir, strict
      if os.path.isdir(outDir):
          shutil.rmtree(outDir)
      os.makedirs(outDir)

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421919.patch → frg/work-js/mozilla-release/patches/1457560-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421691.patch → frg/work-js/mozilla-release/patches/1459754-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421776.patch → frg/work-js/mozilla-release/patches/1460154-1-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421777.patch → frg/work-js/mozilla-release/patches/1460154-2-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422046.patch → frg/work-js/mozilla-release/patches/1461375-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421588.patch → frg/work-js/mozilla-release/patches/1461948-1-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421589.patch → frg/work-js/mozilla-release/patches/1461948-2-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422635.patch → frg/work-js/mozilla-release/patches/1462286-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421580.patch → frg/work-js/mozilla-release/patches/1464772-5-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422648.patch → frg/work-js/mozilla-release/patches/1464790-62a1.patch


+ 25 - 54
frg/work-js/mozilla-release/patches/1464869-08-62a1.patch

@@ -1,8 +1,9 @@
 # HG changeset patch
 # User Sylvestre Ledru <sledru@mozilla.com>
 # Date 1527337746 25200
+#      Sat May 26 05:29:06 2018 -0700
 # Node ID 4924d6ee1b83a0a00acff3c40b0ba95e4914231c
-# Parent  f2c1f77e2a723d7315acdc689cdb504ba1c722cc
+# Parent  e88de9834a6e32d6bc9e65989bc702592973ecc5
 Bug 1464869 - Run autopep8 on js/ r=jorendorff
 
 MozReview-Commit-ID: GtOMQZ0K2bv
@@ -1243,7 +1244,7 @@ diff --git a/js/src/ctypes/libffi/generate-darwin-source-and-headers.py b/js/src
 diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automation/autospider.py
 --- a/js/src/devtools/automation/autospider.py
 +++ b/js/src/devtools/automation/autospider.py
-@@ -23,16 +23,17 @@ Dirs = namedtuple('Dirs', ['scripts', 'j
+@@ -21,16 +21,17 @@ Dirs = namedtuple('Dirs', ['scripts', 'j
  def directories(pathmodule, cwd, fixup=lambda s: s):
      scripts = pathmodule.join(fixup(cwd), fixup(pathmodule.dirname(__file__)))
      js_src = pathmodule.abspath(pathmodule.join(scripts, "..", ".."))
@@ -1259,43 +1260,24 @@ diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automati
  DIR = directories(os.path, os.getcwd())
  PDIR = directories(posixpath, os.environ["PWD"],
                     fixup=lambda s: re.sub(r'^(\w):', r'/\1', s))
- env['CPP_UNIT_TESTS_DIR_JS_SRC'] = DIR.js_src
  
-@@ -99,16 +100,17 @@ OBJDIR = args.objdir
- OUTDIR = os.path.join(OBJDIR, "out")
- POBJDIR = posixpath.join(PDIR.source, args.objdir)
- MAKE = env.get('MAKE', 'make')
- MAKEFLAGS = env.get('MAKEFLAGS', '-j6' + ('' if AUTOMATION else ' -s'))
+ parser = argparse.ArgumentParser(
+@@ -138,25 +139,27 @@ def set_vars_from_script(script, vars):
+             if var in originals and len(originals[var]) > 0:
+                 env[var] = "%s;%s" % (env[var], originals[var])
  
- for d in ('scripts', 'js_src', 'source', 'tooltool'):
-     info("DIR.{name} = {dir}".format(name=d, dir=getattr(DIR, d)))
- 
-+
- def set_vars_from_script(script, vars):
-     '''Run a shell script, then dump out chosen environment variables. The build
-        system uses shell scripts to do some configuration that we need to
-        borrow. On Windows, the script itself must output the variable settings
-        (in the form "export FOO=<value>"), since otherwise there will be
-        problems with mismatched Windows/POSIX formats.
-     '''
-     script_text = 'source %s' % script
-@@ -151,26 +153,28 @@ def set_vars_from_script(script, vars):
  
  def ensure_dir_exists(name, clobber=True, creation_marker_filename="CREATED-BY-AUTOSPIDER"):
-     if creation_marker_filename is None:
-         marker = None
-     else:
-         marker = os.path.join(name, creation_marker_filename)
+     marker = os.path.join(name, creation_marker_filename)
      if clobber:
-         if not AUTOMATION and marker and os.path.exists(name) and not os.path.exists(marker):
+         if not AUTOMATION and os.path.exists(name) and not os.path.exists(marker):
 -            raise Exception("Refusing to delete objdir %s because it was not created by autospider" % name)
 +            raise Exception(
 +                "Refusing to delete objdir %s because it was not created by autospider" % name)
          shutil.rmtree(name, ignore_errors=True)
      try:
          os.mkdir(name)
-         if marker:
-             open(marker, 'a').close()
+         open(marker, 'a').close()
      except OSError:
          if clobber:
              raise
@@ -1309,7 +1291,7 @@ diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automati
      # Note that this modifies the current checkout.
      for dirpath, dirnames, filenames in os.walk(DIR.js_src):
          if 'moz.build' in filenames:
-@@ -296,16 +300,17 @@ if platform.system() == 'Linux' and AUTO
+@@ -272,16 +275,17 @@ if platform.system() == 'Linux':
  ACTIVE_PROCESSES = set()
  
  
@@ -1327,7 +1309,7 @@ diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automati
  ensure_dir_exists(OUTDIR, clobber=not args.keep)
  
  # Any jobs that wish to produce additional output can save them into the upload
-@@ -325,16 +330,17 @@ def run_command(command, check=False, **
+@@ -299,16 +303,17 @@ def run_command(command, check=False, **
          stdout, stderr = proc.communicate()
      finally:
          ACTIVE_PROCESSES.discard(proc)
@@ -1345,7 +1327,7 @@ diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automati
          TOOLTOOL_CHECKOUT=DIR.tooltool,
          MOZ_UPLOAD_DIR=env['MOZ_UPLOAD_DIR'],
          OUTDIR=OUTDIR,
-@@ -376,29 +382,31 @@ def need_updating_configure(configure):
+@@ -344,29 +349,31 @@ def need_updating_configure(configure):
          os.path.join(DIR.js_src, 'old-configure.in'),
      ]
      for file in dep_files:
@@ -1378,7 +1360,7 @@ diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automati
          # Convert symbols to breakpad format.
          hostdir = os.path.join(OBJDIR, "dist", "host", "bin")
          if not os.path.isdir(hostdir):
-@@ -419,24 +427,26 @@ COMMAND_PREFIX = []
+@@ -387,24 +394,26 @@ COMMAND_PREFIX = []
  if subprocess.call("type setarch >/dev/null 2>&1", shell=True) == 0:
      COMMAND_PREFIX.extend(['setarch', platform.machine(), '-R'])
  
@@ -1604,7 +1586,7 @@ diff --git a/js/src/devtools/gc/gc-test.py b/js/src/devtools/gc/gc-test.py
 diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnalysis/analyze.py
 --- a/js/src/devtools/rootAnalysis/analyze.py
 +++ b/js/src/devtools/rootAnalysis/analyze.py
-@@ -21,47 +21,51 @@ import re
+@@ -21,45 +21,49 @@ import re
  anystring_t = str if sys.version_info[0] > 2 else basestring
  
  try:
@@ -1622,8 +1604,6 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
      e['XDB'] = '%(sixgill_bin)s/xdb.so' % config
      e['SOURCE'] = config['source']
      e['ANALYZED_OBJDIR'] = config['objdir']
-     bindir = os.path.dirname(config['js'])
-     e['LD_LIBRARY_PATH'] = ':'.join(p for p in (e.get('LD_LIBRARY_PATH'), bindir) if p)
      return e
  
 +
@@ -1659,7 +1639,7 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
                  if key in e and e[key] in value:
                      start = value.index(e[key])
                      end = start + len(e[key])
-@@ -70,16 +74,17 @@ def print_command(command, outfile=None,
+@@ -68,16 +72,17 @@ def print_command(command, outfile=None,
                                                         key,
                                                         value[end:]))
                  else:
@@ -1677,7 +1657,7 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
                          '%(gcFunctions_list)s',
                          '%(gcEdges)s',
                          '%(suppressedFunctions_list)s',
-@@ -92,83 +97,86 @@ def generate_hazards(config, outfilename
+@@ -90,83 +95,86 @@ def generate_hazards(config, outfilename
          output = open(outfile, 'w')
          if config['verbose']:
              print_command(command, outfile=outfile, env=env(config))
@@ -1806,7 +1786,7 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
      else:
          temp_map = {}
          cmdspec = fill(cmdspec, config)
-@@ -202,20 +210,21 @@ def run_job(name, config):
+@@ -200,20 +208,21 @@ def run_job(name, config):
                  subprocess.check_call(command, stdout=output, env=env(config))
          for (temp, final) in temp_map.items():
              try:
@@ -1831,7 +1811,7 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
                      help='source code to analyze')
  parser.add_argument('--objdir', metavar='DIR', type=str, nargs='?',
                      help='object directory of compiled files')
-@@ -246,22 +255,22 @@ for default in defaults:
+@@ -244,22 +253,22 @@ for default in defaults:
          execfile(default, config)
          if args.verbose:
              print("Loaded %s" % default)
@@ -1856,7 +1836,7 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
  
  if args.buildcommand:
      data['buildcommand'] = args.buildcommand
-@@ -273,30 +282,32 @@ else:
+@@ -271,30 +280,32 @@ else:
  if 'ANALYZED_OBJDIR' in os.environ:
      data['objdir'] = os.environ['ANALYZED_OBJDIR']
  
@@ -1899,7 +1879,7 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
              print("%s -> %s" % (step, outfilename))
          else:
              print(step)
-@@ -306,17 +317,18 @@ for step in steps:
+@@ -304,17 +315,18 @@ for step in steps:
      command, outfiles = JOBS[step]
      if isinstance(outfiles, anystring_t):
          data[step] = outfiles
@@ -5352,7 +5332,7 @@ diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
      AdaptorOptions = namedtuple("AdaptorOptions", [
          "worker_count", "passthrough", "timeout", "output_fp",
          "hide_progress", "run_skipped", "show_cmd"])
-@@ -676,51 +694,56 @@ def run_tests_local(tests, num_tests, pr
+@@ -676,44 +694,48 @@ def run_tests_local(tests, num_tests, pr
      # The test runner wants the prefix as a static on the Test class.
      JitTest.js_cmd_prefix = prefix
  
@@ -5384,7 +5364,6 @@ diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
          if file in required_libs:
              remote_file = posixpath.join(options.remote_test_root, file)
              device.push(os.path.join(options.local_lib, file), remote_file)
-             device.chmod(remote_file, root=True)
  
 +
  def push_progs(options, device, progs):
@@ -5392,13 +5371,6 @@ diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
          remote_file = posixpath.join(options.remote_test_root,
                                       os.path.basename(local_file))
          device.push(local_file, remote_file)
-         device.chmod(remote_file, root=True)
- 
-+
- def init_remote_dir(device, path, root=True):
-     device.rm(path, recursive=True, force=True, root=root)
-     device.mkdir(path, parents=True, root=root)
-     device.chmod(path, recursive=True, root=root)
  
 +
  def run_tests_remote(tests, num_tests, prefix, options, slog):
@@ -5407,9 +5379,9 @@ diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
      device = ADBAndroid(device=options.device_serial,
                          test_root=options.remote_test_root)
  
-     init_remote_dir(device, options.remote_test_root)
- 
-@@ -748,24 +771,27 @@ def run_tests_remote(tests, num_tests, p
+     # Update the test root to point to our test directory.
+     jit_tests_dir = posixpath.join(options.remote_test_root, 'jit-tests')
+@@ -737,24 +759,27 @@ def run_tests_remote(tests, num_tests, p
      prefix[0] = os.path.join(options.remote_test_root, 'js')
  
      # Run all tests.
@@ -8217,4 +8189,3 @@ diff --git a/js/src/vm/opcode.py b/js/src/vm/opcode.py
      opcodes = dict()
      index = []
  
-

File diff suppressed because it is too large
+ 297 - 145
frg/work-js/mozilla-release/patches/1464869-09-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422613.patch → frg/work-js/mozilla-release/patches/1465081-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/1465472-62a1.patch → frg/work-js/mozilla-release/patches/1465472-1-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421797.patch → frg/work-js/mozilla-release/patches/1465472-2-62a1.patch


+ 21 - 19
frg/work-js/mozilla-release/patches/mozilla-central-push_421577.patch → frg/work-js/mozilla-release/patches/1465728-1-62a1.patch

@@ -3,7 +3,7 @@
 # Date 1528278257 -7200
 #      Wed Jun 06 11:44:17 2018 +0200
 # Node ID 2d422fb97474917892bc35d37532d33fd1a39fa0
-# Parent  4ab0fba87583700c837de47c7a1ecbd55d0c7664
+# Parent  f9ceee7c4773277c1901e02f52aa6e1da0940216
 Bug 1465728 part 1 - Move location and locationURI fields from CompartmentPrivate to RealmPrivate. r=bz
 
 The xpcprivate.h changes are just code motion, except I changed the order of the GetLocationURI methods to get a much more readable diff.
@@ -11,7 +11,7 @@ The xpcprivate.h changes are just code motion, except I changed the order of the
 diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp
 --- a/js/xpconnect/src/XPCComponents.cpp
 +++ b/js/xpconnect/src/XPCComponents.cpp
-@@ -3016,17 +3016,17 @@ nsXPCComponents_Utils::GetCompartmentLoc
+@@ -3113,17 +3113,17 @@ nsXPCComponents_Utils::GetCompartmentLoc
                                                nsACString& result)
  {
      if (!val.isObject())
@@ -26,16 +26,16 @@ diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents
  }
  
  NS_IMETHODIMP
- nsXPCComponents_Utils::ReadUTF8File(nsIFile* aFile, nsACString& aResult)
+ nsXPCComponents_Utils::SetAddonInterposition(const nsACString& addonIdStr,
+                                              nsIAddonInterposition* interposition,
+                                              JSContext* cx)
  {
-     NS_ENSURE_TRUE(aFile, NS_ERROR_INVALID_ARG);
- 
 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
-@@ -201,24 +201,24 @@ CompartmentPrivate::SystemIsBeingShutDow
- RealmPrivate::RealmPrivate(JS::Realm* realm)
-     : scriptability(realm)
+@@ -203,24 +203,24 @@ RealmPrivate::RealmPrivate(JS::Realm* re
+     , skipWriteToGlobalPrototype(false)
+     , scriptability(realm)
      , scope(nullptr)
  {
  }
@@ -60,7 +60,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
  
          // -- GROSS HACK ALERT --
          // The Yandex Elements 8.10.2 extension implements its own "xb://" URL
-@@ -244,18 +244,19 @@ TryParseLocationURICandidate(const nsACS
+@@ -246,18 +246,19 @@ TryParseLocationURICandidate(const nsACS
      // for memory reporter use.
      if (scheme.EqualsLiteral("data") || scheme.EqualsLiteral("blob"))
          return false;
@@ -82,7 +82,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
      if (location.IsEmpty())
          return false;
  
-@@ -1084,23 +1085,23 @@ GetCompartmentName(JSCompartment* c, nsC
+@@ -1122,23 +1123,23 @@ GetCompartmentName(JSCompartment* c, nsC
          name.AppendPrintf("<anonymized-%d>", *anonymizeID);
          *anonymizeID += 1;
      } else if (JSPrincipals* principals = JS::GetRealmPrincipals(realm)) {
@@ -116,7 +116,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
 diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp
 --- a/js/xpconnect/src/nsXPConnect.cpp
 +++ b/js/xpconnect/src/nsXPConnect.cpp
-@@ -959,24 +959,24 @@ Base64Decode(JSContext* cx, HandleValue 
+@@ -1068,24 +1068,24 @@ Base64Decode(JSContext* cx, HandleValue 
      out.setString(str);
      return true;
  }
@@ -139,14 +139,14 @@ diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp
  
  } // namespace xpc
  
- static nsresult
- WriteScriptOrFunction(nsIObjectOutputStream* stream, JSContext* cx,
-                       JSScript* scriptArg, HandleObject functionObj)
+ NS_IMETHODIMP
+ nsXPConnect::NotifyDidPaint()
  {
+     JS::NotifyDidPaint(XPCJSContext::Get()->Context());
 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
-@@ -2829,21 +2829,16 @@ bool ReportWrapperDenial(JSContext* cx, 
+@@ -3001,21 +3001,16 @@ bool ReportWrapperDenial(JSContext* cx, 
  // information needed to select the right security policy for cross-compartment
  // wrappers.
  class CompartmentPrivate
@@ -168,7 +168,7 @@ diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
      {
          MOZ_ASSERT(compartment);
          void* priv = JS_GetCompartmentPrivate(compartment);
-@@ -2906,71 +2901,25 @@ public:
+@@ -3104,73 +3099,27 @@ public:
      // True if this compartment has been nuked. If true, any wrappers into or
      // out of it should be considered invalid.
      bool wasNuked;
@@ -219,6 +219,8 @@ diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
 -        locationURI = aLocationURI;
 -    }
 -
+     void SetAddonCallInterposition() { addonCallInterposition = true; }
+ 
      JSObject2WrappedJSMap* GetWrappedJSMap() const { return mWrappedJSMap; }
      void UpdateWeakPointersAfterGC();
  
@@ -240,7 +242,7 @@ diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
  
  inline void
  CrashIfNotInAutomation()
-@@ -2979,23 +2928,28 @@ CrashIfNotInAutomation()
+@@ -3179,23 +3128,28 @@ CrashIfNotInAutomation()
  }
  
  // XPConnect-specific data associated with each JavaScript realm. Per-Window
@@ -270,8 +272,8 @@ diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
          void* priv = JS::GetRealmPrivate(realm);
          return static_cast<RealmPrivate*>(priv);
      }
-@@ -3010,16 +2964,65 @@ public:
-     }
+@@ -3221,16 +3175,65 @@ public:
+     bool skipWriteToGlobalPrototype;
  
      // The scriptability of this realm.
      Scriptability scriptability;

+ 36 - 28
frg/work-js/mozilla-release/patches/mozilla-central-push_421578.patch → frg/work-js/mozilla-release/patches/1465728-2-62a1.patch

@@ -3,14 +3,13 @@
 # Date 1528278257 -7200
 #      Wed Jun 06 11:44:17 2018 +0200
 # Node ID 84aa50d4663a10d18cb305b9157134139f4cc867
-# Parent  2d422fb97474917892bc35d37532d33fd1a39fa0
+# Parent  9669477229bacbfc6c28c4f8063c4c5959ff3682
 Bug 1465728 part 2 - Remove the compartment name callback. r=luke
 
 diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
 --- a/js/src/jsapi.cpp
 +++ b/js/src/jsapi.cpp
-@@ -617,22 +617,16 @@ JS_SetDestroyCompartmentCallback(JSConte
- 
+@@ -618,22 +618,16 @@ JS_SetDestroyCompartmentCallback(JSConte
  JS_PUBLIC_API(void)
  JS_SetSizeOfIncludingThisCompartmentCallback(JSContext* cx,
                                               JSSizeOfIncludingThisCompartmentCallback callback)
@@ -18,24 +17,25 @@ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
      cx->runtime()->sizeOfIncludingThisCompartmentCallback = callback;
  }
  
--JS_PUBLIC_API(void)
+ JS_PUBLIC_API(void)
 -JS_SetCompartmentNameCallback(JSContext* cx, JSCompartmentNameCallback callback)
 -{
 -    cx->runtime()->compartmentNameCallback = callback;
 -}
 -
- #if defined(NIGHTLY_BUILD)
- JS_PUBLIC_API(void)
- JS_SetErrorInterceptorCallback(JSRuntime* rt, JSErrorInterceptor* callback)
+-JS_PUBLIC_API(void)
+ JS_SetWrapObjectCallbacks(JSContext* cx, const JSWrapObjectCallbacks* callbacks)
  {
-     rt->errorInterception.interceptor = callback;
+     cx->runtime()->wrapObjectCallbacks = callbacks;
  }
  
- JS_PUBLIC_API(JSErrorInterceptor*)
+ JS_PUBLIC_API(void)
+ JS_SetExternalStringSizeofCallback(JSContext* cx, JSExternalStringSizeofCallback callback)
+ {
 diff --git a/js/src/jsapi.h b/js/src/jsapi.h
 --- a/js/src/jsapi.h
 +++ b/js/src/jsapi.h
-@@ -959,19 +959,16 @@ JS_GetImplementationVersion(void);
+@@ -939,19 +939,16 @@ JS_GetImplementationVersion(void);
  extern JS_PUBLIC_API(void)
  JS_SetDestroyCompartmentCallback(JSContext* cx, JSDestroyCompartmentCallback callback);
  
@@ -52,13 +52,13 @@ diff --git a/js/src/jsapi.h b/js/src/jsapi.h
  extern JS_PUBLIC_API(void)
  JS_SetExternalStringSizeofCallback(JSContext* cx, JSExternalStringSizeofCallback callback);
  
- #if defined(NIGHTLY_BUILD)
+ extern JS_PUBLIC_API(void)
+ JS_SetCompartmentPrivate(JSCompartment* compartment, void* data);
  
- // Set a callback that will be called whenever an error
 diff --git a/js/src/vm/CodeCoverage.cpp b/js/src/vm/CodeCoverage.cpp
 --- a/js/src/vm/CodeCoverage.cpp
 +++ b/js/src/vm/CodeCoverage.cpp
-@@ -551,23 +551,23 @@ LCovRealm::writeRealmName(JS::Realm* rea
+@@ -557,23 +557,23 @@ LCovRealm::writeRealmName(JS::Realm* rea
  
      // lcov trace files are starting with an optional test case name, that we
      // recycle to be a realm name.
@@ -109,7 +109,7 @@ diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp
 diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h
 --- a/js/src/vm/Runtime.h
 +++ b/js/src/vm/Runtime.h
-@@ -349,19 +349,16 @@ struct JSRuntime : public js::MallocProv
+@@ -348,19 +348,16 @@ struct JSRuntime : public js::MallocProv
      js::MainThreadData<bool> allowRelazificationForTesting;
  
      /* Compartment destroy callback. */
@@ -132,7 +132,7 @@ diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h
 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
-@@ -1069,23 +1069,23 @@ XPCJSRuntime::Shutdown(JSContext* cx)
+@@ -1107,23 +1107,23 @@ XPCJSRuntime::Shutdown(JSContext* cx)
      CycleCollectedJSRuntime::Shutdown(cx);
  }
  
@@ -160,7 +160,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
          if (NS_FAILED(rv)) {
              name.AssignLiteral("(unknown)");
          }
-@@ -1152,27 +1152,27 @@ GetCompartmentName(JSCompartment* c, nsC
+@@ -1190,27 +1190,27 @@ GetCompartmentName(JSCompartment* c, nsC
          if (replaceSlashes)
              name.ReplaceChar('/', '\\');
      } else {
@@ -191,7 +191,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
      XPCJSRuntime::Get()->AddGCCallback(cb);
  }
  
-@@ -2042,20 +2042,20 @@ class JSMainRuntimeRealmsReporter final 
+@@ -2119,20 +2119,20 @@ class JSMainRuntimeRealmsReporter final 
  
      struct Data {
          int anonymizeID;
@@ -214,7 +214,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
      }
  
      NS_IMETHOD CollectReports(nsIHandleReportCallback* handleReport,
-@@ -2190,20 +2190,19 @@ class XPCJSRuntimeStats : public JS::Run
+@@ -2269,24 +2269,24 @@ class XPCJSRuntimeStats : public JS::Run
          MOZ_ASSERT(StartsWithExplicit(extras->pathPrefix));
  
          zStats->extra = extras;
@@ -227,17 +227,25 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
          xpc::RealmStatsExtras* extras = new xpc::RealmStatsExtras;
 -        nsCString cName;
 -        GetCompartmentName(c, cName, &mAnonymizeID, /* replaceSlashes = */ true);
+-        CompartmentPrivate* cp = CompartmentPrivate::Get(c);
+-        if (cp) {
 +        nsCString rName;
 +        GetRealmName(realm, rName, &mAnonymizeID, /* replaceSlashes = */ true);
++
++        RealmPrivate* realmPrivate = RealmPrivate::Get(realm);
++        if (realmPrivate) {
+             if (mGetLocations) {
+-                cp->GetLocationURI(CompartmentPrivate::LocationHintAddon,
++                realmPrivate->GetLocationURI(RealmPrivate::LocationHintAddon,
+                                    getter_AddRefs(extras->location));
+             }
+             // Note: cannot use amIAddonManager implementation at this point,
+             // as it is a JS service and the JS heap is currently not idle.
+             // Otherwise, we could have computed the add-on id at this point.
+         }
  
          // Get the realm's global.
-         AutoSafeJSContext cx;
-         bool needZone = true;
-         RootedObject global(cx, JS::GetRealmGlobalOrNull(realm));
-         if (global) {
-             RefPtr<nsGlobalWindow> window;
-             if (NS_SUCCEEDED(UNWRAP_OBJECT(Window, global, window))) {
-@@ -2223,20 +2222,22 @@ class XPCJSRuntimeStats : public JS::Run
+@@ -2312,20 +2312,22 @@ class XPCJSRuntimeStats : public JS::Run
                  extras->jsPathPrefix.AssignLiteral("explicit/js-non-window/zones/");
                  extras->domPathPrefix.AssignLiteral("explicit/dom/non-window-global?!/");
              }
@@ -263,7 +271,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
          // extras->domPathPrefix is used for DOM orphan nodes, which are
          // counted by the JS reporter but reported as part of the DOM
          // measurements. At this point it has the form "<something>/dom/" if
-@@ -2638,45 +2639,38 @@ SetUseCounterCallback(JSObject* obj, JSU
+@@ -2738,45 +2740,38 @@ SetUseCounterCallback(JSObject* obj, JSU
          SetDocumentAndPageUseCounter(obj, eUseCounter_custom_JS_wasm);
          break;
        default:
@@ -313,7 +321,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
      MOZ_ASSERT(IS_WN_REFLECTOR(obj) || mozilla::dom::IsDOMObject(obj));
  
      return mozilla::dom::IsDOMObject(obj) && mozilla::dom::TryPreserveWrapper(obj);
-@@ -2836,19 +2830,18 @@ XPCJSRuntime::Initialize(JSContext* cx)
+@@ -2937,19 +2932,18 @@ XPCJSRuntime::Initialize(JSContext* cx)
      // finite threshold (0xffffffff is infinity for uint32_t parameters).
      // This leaves the maximum-JS_malloc-bytes threshold still in effect
      // to cause period, and we hope hygienic, last-ditch GCs from within
@@ -337,7 +345,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
 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
-@@ -610,21 +610,21 @@ DispatchScriptErrorEvent(nsPIDOMWindowIn
+@@ -617,21 +617,21 @@ DispatchScriptErrorEvent(nsPIDOMWindowIn
  // WindowID() is used to initialize the xpc::ErrorReport.  This may be null, of
  // course.  If it's not null, this function may return a null stack object if
  // the window is far enough gone, because in those cases we don't want to have

+ 10 - 10
frg/work-js/mozilla-release/patches/mozilla-central-push_421579.patch → frg/work-js/mozilla-release/patches/1465728-3-62a1.patch

@@ -3,13 +3,13 @@
 # Date 1528278257 -7200
 #      Wed Jun 06 11:44:17 2018 +0200
 # Node ID ff7f3a604779d591ac9e451cf6db71e1be3933f4
-# Parent  84aa50d4663a10d18cb305b9157134139f4cc867
+# Parent  62293ff51a2ca9e635c41dc78db55f50beeae214
 Bug 1465728 part 3 - Rename Cu.getCompartmentLocation to Cu.getRealmLocation. r=bz
 
 diff --git a/dom/base/test/chrome/cpows_child.js b/dom/base/test/chrome/cpows_child.js
 --- a/dom/base/test/chrome/cpows_child.js
 +++ b/dom/base/test/chrome/cpows_child.js
-@@ -179,17 +179,17 @@ function compartment_test(finish)
+@@ -171,17 +171,17 @@ function compartment_test(finish)
  
    let sb = Cu.Sandbox('http://www.example.com', { wantGlobalProperties: ['XMLHttpRequest'] });
    sb.eval('function getUnprivilegedObject() { var xhr = new XMLHttpRequest(); xhr.expando = 42; return xhr; }');
@@ -31,7 +31,7 @@ diff --git a/dom/base/test/chrome/cpows_child.js b/dom/base/test/chrome/cpows_ch
 diff --git a/dom/base/test/chrome/cpows_parent.xul b/dom/base/test/chrome/cpows_parent.xul
 --- a/dom/base/test/chrome/cpows_parent.xul
 +++ b/dom/base/test/chrome/cpows_parent.xul
-@@ -296,17 +296,17 @@
+@@ -295,17 +295,17 @@
        let getUnprivilegedObject = message.objects.getUnprivilegedObject;
        let testParentObject = message.objects.testParentObject;
  
@@ -53,7 +53,7 @@ diff --git a/dom/base/test/chrome/cpows_parent.xul b/dom/base/test/chrome/cpows_
 diff --git a/js/xpconnect/idl/xpccomponents.idl b/js/xpconnect/idl/xpccomponents.idl
 --- a/js/xpconnect/idl/xpccomponents.idl
 +++ b/js/xpconnect/idl/xpccomponents.idl
-@@ -646,25 +646,25 @@ interface nsIXPCComponents_Utils : nsISu
+@@ -663,25 +663,25 @@ interface nsIXPCComponents_Utils : nsISu
       * Gets the principal of a script object, after unwrapping any cross-
       * compartment wrappers.
       */
@@ -74,17 +74,17 @@ diff --git a/js/xpconnect/idl/xpccomponents.idl b/js/xpconnect/idl/xpccomponents
 -    ACString getCompartmentLocation(in jsval obj);
 +    ACString getRealmLocation(in jsval obj);
  
-     /*
-      * Return a fractional number of milliseconds from process
-      * startup, measured with a monotonic clock.
-      */
-     double now();
+     [implicit_jscontext]
+     void setAddonInterposition(in ACString addonId, in nsIAddonInterposition interposition);
  
      /*
+      * Enables call interpositions from addon scopes to any functions in the scope of |target|.
+      */
+     [implicit_jscontext]
 diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp
 --- a/js/xpconnect/src/XPCComponents.cpp
 +++ b/js/xpconnect/src/XPCComponents.cpp
-@@ -3006,19 +3006,19 @@ nsXPCComponents_Utils::GetObjectPrincipa
+@@ -3103,19 +3103,19 @@ nsXPCComponents_Utils::GetObjectPrincipa
      MOZ_ASSERT(obj);
  
      nsCOMPtr<nsIPrincipal> prin = nsContentUtils::ObjectPrincipal(obj);

+ 0 - 0
frg/work-js/mozilla-release/patches/1466083-2-62a1.patch-62a1.patch → frg/work-js/mozilla-release/patches/1466083-2-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/1466083-3-62a1.patch-62a1.patch → frg/work-js/mozilla-release/patches/1466083-3-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/1466083-4-62a1.patch-62a1.patch → frg/work-js/mozilla-release/patches/1466083-4-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/1466083-5-62a1.patch-62a1.patch → frg/work-js/mozilla-release/patches/1466083-5-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/1466083-6-62a1.patch-62a1.patch → frg/work-js/mozilla-release/patches/1466083-6-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421585.patch → frg/work-js/mozilla-release/patches/1466083-7-62a1.patch


+ 13 - 13
frg/work-js/mozilla-release/patches/mozilla-central-push_421586.patch → frg/work-js/mozilla-release/patches/1466083-8-62a1.patch

@@ -3,7 +3,7 @@
 # Date 1528282550 -7200
 #      Wed Jun 06 12:55:50 2018 +0200
 # Node ID bf5be9b21c3c33949a6a855a8a5a559cd888a496
-# Parent  eff5e370cb33c11fd6fea6768e872675eb0e72ac
+# Parent  bfb6fd55e564255082e8681c2a3bf4ecaf86b6d2
 Bug 1466083 part 8 - Various minor API changes. r=luke
 
 * GetScriptCompartment => GetScriptRealm
@@ -13,11 +13,11 @@ Bug 1466083 part 8 - Various minor API changes. r=luke
 diff --git a/dom/base/WindowDestroyedEvent.cpp b/dom/base/WindowDestroyedEvent.cpp
 --- a/dom/base/WindowDestroyedEvent.cpp
 +++ b/dom/base/WindowDestroyedEvent.cpp
-@@ -105,17 +105,17 @@ WindowDestroyedEvent::Run()
-         } else {
-           nsGlobalWindowOuter* outer = nsGlobalWindowOuter::FromSupports(window);
-           currentInner = outer->GetCurrentInnerWindowInternal();
-         }
+@@ -88,17 +88,17 @@ WindowDestroyedEvent::Run()
+       nsCOMPtr<nsISupports> window = do_QueryReferent(mWindow);
+       if (window) {
+         nsGlobalWindow* win = nsGlobalWindow::FromSupports(window);
+         nsGlobalWindow* currentInner = win->IsInnerWindow() ? win : win->GetCurrentInnerWindowInternal();
          NS_ENSURE_TRUE(currentInner, NS_OK);
  
          AutoSafeJSContext cx;
@@ -30,8 +30,8 @@ diff --git a/dom/base/WindowDestroyedEvent.cpp b/dom/base/WindowDestroyedEvent.c
            if (BasePrincipal::Cast(pc)->AddonPolicy()) {
              // We want to nuke all references to the add-on compartment.
              xpc::NukeAllWrappersForCompartment(cx, cpt,
-                                                mIsInnerWindow ? js::DontNukeWindowReferences
-                                                               : js::NukeWindowReferences);
+                                                win->IsInnerWindow() ? js::DontNukeWindowReferences
+                                                                     : js::NukeWindowReferences);
 diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
 --- a/js/src/jsfriendapi.cpp
 +++ b/js/src/jsfriendapi.cpp
@@ -117,7 +117,7 @@ diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
 diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
 --- a/js/src/jsfriendapi.h
 +++ b/js/src/jsfriendapi.h
-@@ -186,18 +186,18 @@ JS_SetSetUseCounterCallback(JSContext* c
+@@ -187,18 +187,18 @@ JS_SetSetUseCounterCallback(JSContext* c
  
  extern JS_FRIEND_API(JSPrincipals*)
  JS_GetCompartmentPrincipals(JSCompartment* compartment);
@@ -138,7 +138,7 @@ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
  extern JS_FRIEND_API(JSObject*)
  JS_CloneObject(JSContext* cx, JS::HandleObject obj, JS::HandleObject proto);
  
-@@ -476,16 +476,19 @@ extern JS_FRIEND_API(void)
+@@ -477,16 +477,19 @@ extern JS_FRIEND_API(void)
  DumpHeap(JSContext* cx, FILE* fp, DumpHeapNurseryBehaviour nurseryBehaviour);
  
  #ifdef JS_OLD_GETTER_SETTER_METHODS
@@ -161,7 +161,7 @@ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
 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
-@@ -1075,18 +1075,17 @@ XPCJSRuntime::~XPCJSRuntime()
+@@ -1113,18 +1113,17 @@ XPCJSRuntime::~XPCJSRuntime()
  }
  
  // If |*anonymizeID| is non-zero and this is a user realm, the name will
@@ -181,7 +181,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
              name.AssignLiteral("(unknown)");
          }
  
-@@ -2045,18 +2044,17 @@ class JSMainRuntimeRealmsReporter final 
+@@ -2122,18 +2121,17 @@ class JSMainRuntimeRealmsReporter final 
          js::Vector<nsCString, 0, js::SystemAllocPolicy> paths;
      };
  
@@ -204,7 +204,7 @@ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.c
 diff --git a/tools/profiler/core/ProfileBuffer.cpp b/tools/profiler/core/ProfileBuffer.cpp
 --- a/tools/profiler/core/ProfileBuffer.cpp
 +++ b/tools/profiler/core/ProfileBuffer.cpp
-@@ -125,18 +125,18 @@ ProfileBuffer::SizeOfIncludingThis(mozil
+@@ -136,18 +136,18 @@ ProfileBuffer::SizeOfIncludingThis(mozil
  }
  
  /* ProfileBufferCollector */

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421587.patch → frg/work-js/mozilla-release/patches/1466083-9-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421809.patch → frg/work-js/mozilla-release/patches/1466189-1-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421824.patch → frg/work-js/mozilla-release/patches/1466189-2-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421582.patch → frg/work-js/mozilla-release/patches/1466792-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421590.patch → frg/work-js/mozilla-release/patches/1466931-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421912.patch → frg/work-js/mozilla-release/patches/1467052-62a1.patch


+ 1 - 23
frg/work-js/mozilla-release/patches/mozilla-central-push_422043.patch → frg/work-js/mozilla-release/patches/1467071-62a1.patch

@@ -3,7 +3,7 @@
 # Date 1528475862 -7200
 #      Fri Jun 08 18:37:42 2018 +0200
 # Node ID 710e191b76ff7f9d4afb8b6f47a51ed9b003d4d7
-# Parent  5a26880a2b24fc5a54595a3432c3484cea5d0e5f
+# Parent  a3833e949e86beb24a4cc0ae143c1b2c3eb2a010
 Bug 1467071 - Wasm: import embedding_limits "limits.js" test and fix any resulting failures.  r=lth.
 
 The WebAssembly Specification, branch [1] (see also, more generally,
@@ -693,25 +693,3 @@ diff --git a/js/src/wasm/WasmValidate.cpp b/js/src/wasm/WasmValidate.cpp
      return tables->emplaceBack(TableKind::AnyFunction, limits);
  }
  
-diff --git a/testing/web-platform/mozilla/tests/wasm/js/jsapi.js b/testing/web-platform/mozilla/tests/wasm/js/jsapi.js
---- a/testing/web-platform/mozilla/tests/wasm/js/jsapi.js
-+++ b/testing/web-platform/mozilla/tests/wasm/js/jsapi.js
-@@ -521,17 +521,17 @@ test(() => {
-     assertThrows(() => new Table({initial:{valueOf() { throw new Error("here")}}, element:"anyfunc"}), Error);
-     assertThrows(() => new Table({initial:-1, element:"anyfunc"}), RangeError);
-     assertThrows(() => new Table({initial:Math.pow(2,32), element:"anyfunc"}), RangeError);
-     assertThrows(() => new Table({initial:2, maximum:1, element:"anyfunc"}), RangeError);
-     assertThrows(() => new Table({initial:2, maximum:Math.pow(2,32), element:"anyfunc"}), RangeError);
-     assert_equals(new Table({initial:1, element:"anyfunc"}) instanceof Table, true);
-     assert_equals(new Table({initial:1.5, element:"anyfunc"}) instanceof Table, true);
-     assert_equals(new Table({initial:1, maximum:1.5, element:"anyfunc"}) instanceof Table, true);
--    assert_equals(new Table({initial:1, maximum:Math.pow(2,32)-1, element:"anyfunc"}) instanceof Table, true);
-+    assertThrows(() => new Table({initial:1, maximum:Math.pow(2,32)-1, element:"anyfunc"}), RangeError);
- }, "'WebAssembly.Table' constructor function");
- 
- test(() => {
-     const tableProtoDesc = Object.getOwnPropertyDescriptor(Table, 'prototype');
-     assert_equals(typeof tableProtoDesc.value, "object");
-     assert_equals(tableProtoDesc.writable, false);
-     assert_equals(tableProtoDesc.enumerable, false);
-     assert_equals(tableProtoDesc.configurable, false);

+ 3 - 3
frg/work-js/mozilla-release/patches/1467334-62a1.patch

@@ -3,13 +3,13 @@
 # Date 1528362791 25200
 #      Thu Jun 07 02:13:11 2018 -0700
 # Node ID 75662fe4c9c525111f8a60d5de273aef22b9a65c
-# Parent  ce4745d3ab3fe627d3a469637f75f45ed66c1202
+# Parent  51238c5a88c51fc4e35bf4571c9c4e6a3dc79821
 Bug 1467334 - Make TokenStreamAnyChars::isExprEnding a well-documented array of bool, zero-initialize it using a member initializer, then overwrite its few true elements in the constructor body.  r=arai
 
 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
-@@ -34,17 +34,16 @@
+@@ -35,17 +35,16 @@
  #include "vm/JSAtom.h"
  #include "vm/JSCompartment.h"
  #include "vm/JSContext.h"
@@ -27,7 +27,7 @@ diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
      js::frontend::TokenKind tokentype;
  };
  
-@@ -414,28 +413,23 @@ TokenStreamAnyChars::TokenStreamAnyChars
+@@ -415,28 +414,23 @@ TokenStreamAnyChars::TokenStreamAnyChars
      prevLinebase(size_t(-1)),
      filename_(options.filename()),
      displayURL_(nullptr),

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421921.patch → frg/work-js/mozilla-release/patches/1467335-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421922.patch → frg/work-js/mozilla-release/patches/1467336-01-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421923.patch → frg/work-js/mozilla-release/patches/1467336-02-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421924.patch → frg/work-js/mozilla-release/patches/1467336-03-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421925.patch → frg/work-js/mozilla-release/patches/1467336-04-62a1.patch


+ 171 - 0
frg/work-js/mozilla-release/patches/1467336-05-62a1.patch

@@ -0,0 +1,171 @@
+# HG changeset patch
+# User Jeff Walden <jwalden@mit.edu>
+# Date 1528363030 25200
+# Node ID 2dac13bda7237ea6d069bed9d52f01a65f6a1c67
+# Parent  b2b3d152d7eada7a400326875331b2d454564145
+Bug 1467336 - Implement mozilla::IsAscii to detect pure ASCII characters.  r=froydnj
+
+diff --git a/mfbt/TextUtils.h b/mfbt/TextUtils.h
+--- a/mfbt/TextUtils.h
++++ b/mfbt/TextUtils.h
+@@ -32,16 +32,26 @@ template<>
+ class MakeUnsignedChar<char32_t>
+ {
+ public:
+   using Type = char32_t;
+ };
+ 
+ } // namespace detail
+ 
++/** Returns true iff |aChar| is ASCII, i.e. in the range [0, 0x80). */
++template<typename Char>
++constexpr bool
++IsAscii(Char aChar)
++{
++  using UnsignedChar = typename detail::MakeUnsignedChar<Char>::Type;
++  auto uc = static_cast<UnsignedChar>(aChar);
++  return uc < 0x80;
++}
++
+ /**
+  * Returns true iff |aChar| matches [a-z].
+  *
+  * This function is basically what you thought islower was, except its behavior
+  * doesn't depend on the user's current locale.
+  */
+ template<typename Char>
+ constexpr bool
+diff --git a/mfbt/tests/TestTextUtils.cpp b/mfbt/tests/TestTextUtils.cpp
+--- a/mfbt/tests/TestTextUtils.cpp
++++ b/mfbt/tests/TestTextUtils.cpp
+@@ -3,23 +3,112 @@
+ /* 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/Assertions.h"
+ #include "mozilla/TextUtils.h"
+ 
+ using mozilla::AsciiAlphanumericToNumber;
++using mozilla::IsAscii;
+ using mozilla::IsAsciiAlpha;
+ using mozilla::IsAsciiAlphanumeric;
+ using mozilla::IsAsciiDigit;
+ using mozilla::IsAsciiLowercaseAlpha;
+ using mozilla::IsAsciiUppercaseAlpha;
+ 
+ static void
++TestIsAscii()
++{
++  // char
++
++  static_assert(!IsAscii(char(-1)), "char(-1) isn't ASCII");
++
++  static_assert(IsAscii('\0'), "nul is ASCII");
++
++  static_assert(IsAscii('A'), "'A' is ASCII");
++  static_assert(IsAscii('B'), "'B' is ASCII");
++  static_assert(IsAscii('M'), "'M' is ASCII");
++  static_assert(IsAscii('Y'), "'Y' is ASCII");
++  static_assert(IsAscii('Z'), "'Z' is ASCII");
++
++  static_assert(IsAscii('['), "'[' is ASCII");
++  static_assert(IsAscii('`'), "'`' is ASCII");
++
++  static_assert(IsAscii('a'), "'a' is ASCII");
++  static_assert(IsAscii('b'), "'b' is ASCII");
++  static_assert(IsAscii('m'), "'m' is ASCII");
++  static_assert(IsAscii('y'), "'y' is ASCII");
++  static_assert(IsAscii('z'), "'z' is ASCII");
++
++  static_assert(IsAscii('{'), "'{' is ASCII");
++
++  static_assert(IsAscii('5'), "'5' is ASCII");
++
++  static_assert(IsAscii('\x7F'), "'\\x7F' is ASCII");
++  static_assert(!IsAscii('\x80'), "'\\x80' isn't ASCII");
++
++  // char16_t
++
++  static_assert(!IsAscii(char16_t(-1)), "char16_t(-1) isn't ASCII");
++
++  static_assert(IsAscii(u'\0'), "nul is ASCII");
++
++  static_assert(IsAscii(u'A'), "u'A' is ASCII");
++  static_assert(IsAscii(u'B'), "u'B' is ASCII");
++  static_assert(IsAscii(u'M'), "u'M' is ASCII");
++  static_assert(IsAscii(u'Y'), "u'Y' is ASCII");
++  static_assert(IsAscii(u'Z'), "u'Z' is ASCII");
++
++  static_assert(IsAscii(u'['), "u'[' is ASCII");
++  static_assert(IsAscii(u'`'), "u'`' is ASCII");
++
++  static_assert(IsAscii(u'a'), "u'a' is ASCII");
++  static_assert(IsAscii(u'b'), "u'b' is ASCII");
++  static_assert(IsAscii(u'm'), "u'm' is ASCII");
++  static_assert(IsAscii(u'y'), "u'y' is ASCII");
++  static_assert(IsAscii(u'z'), "u'z' is ASCII");
++
++  static_assert(IsAscii(u'{'), "u'{' is ASCII");
++
++  static_assert(IsAscii(u'5'), "u'5' is ASCII");
++
++  static_assert(IsAscii(u'\x7F'), "u'\\x7F' is ASCII");
++  static_assert(!IsAscii(u'\x80'), "u'\\x80' isn't ASCII");
++
++  // char32_t
++
++  static_assert(!IsAscii(char32_t(-1)), "char32_t(-1) isn't ASCII");
++
++  static_assert(IsAscii(U'\0'), "nul is ASCII");
++
++  static_assert(IsAscii(U'A'), "U'A' is ASCII");
++  static_assert(IsAscii(U'B'), "U'B' is ASCII");
++  static_assert(IsAscii(U'M'), "U'M' is ASCII");
++  static_assert(IsAscii(U'Y'), "U'Y' is ASCII");
++  static_assert(IsAscii(U'Z'), "U'Z' is ASCII");
++
++  static_assert(IsAscii(U'['), "U'[' is ASCII");
++  static_assert(IsAscii(U'`'), "U'`' is ASCII");
++
++  static_assert(IsAscii(U'a'), "U'a' is ASCII");
++  static_assert(IsAscii(U'b'), "U'b' is ASCII");
++  static_assert(IsAscii(U'm'), "U'm' is ASCII");
++  static_assert(IsAscii(U'y'), "U'y' is ASCII");
++  static_assert(IsAscii(U'z'), "U'z' is ASCII");
++
++  static_assert(IsAscii(U'{'), "U'{' is ASCII");
++
++  static_assert(IsAscii(U'5'), "U'5' is ASCII");
++
++  static_assert(IsAscii(U'\x7F'), "U'\\x7F' is ASCII");
++  static_assert(!IsAscii(U'\x80'), "U'\\x80' isn't ASCII");
++}
++
++static void
+ TestIsAsciiAlpha()
+ {
+   // char
+ 
+   static_assert(!IsAsciiAlpha('@'), "'@' isn't ASCII alpha");
+   static_assert('@' == 0x40, "'@' has value 0x40");
+ 
+   static_assert('A' == 0x41, "'A' has value 0x41");
+@@ -704,15 +793,16 @@ TestIsAsciiDigit()
+   static_assert(!IsAsciiDigit(U'y'), "U'y' isn't an ASCII digit");
+   static_assert(!IsAsciiDigit(U'z'), "U'z' isn't an ASCII digit");
+   static_assert(!IsAsciiDigit(U'{'), "U'{' isn't an ASCII digit");
+ }
+ 
+ int
+ main()
+ {
++  TestIsAscii();
+   TestIsAsciiAlpha();
+   TestIsAsciiUppercaseAlpha();
+   TestIsAsciiLowercaseAlpha();
+   TestIsAsciiAlphanumeric();
+   TestAsciiAlphanumericToNumber();
+   TestIsAsciiDigit();
+ }
+

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421927.patch → frg/work-js/mozilla-release/patches/1467336-06-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421928.patch → frg/work-js/mozilla-release/patches/1467336-07-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_421929.patch → frg/work-js/mozilla-release/patches/1467336-09-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422502.patch → frg/work-js/mozilla-release/patches/1467336-10-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422503.patch → frg/work-js/mozilla-release/patches/1467336-11-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422504.patch → frg/work-js/mozilla-release/patches/1467336-12-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422505.patch → frg/work-js/mozilla-release/patches/1467336-13-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422506.patch → frg/work-js/mozilla-release/patches/1467336-14-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422507.patch → frg/work-js/mozilla-release/patches/1467336-15-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422508.patch → frg/work-js/mozilla-release/patches/1467336-16-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422509.patch → frg/work-js/mozilla-release/patches/1467336-17-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422510.patch → frg/work-js/mozilla-release/patches/1467336-18-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422511.patch → frg/work-js/mozilla-release/patches/1467336-19-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422512.patch → frg/work-js/mozilla-release/patches/1467336-20-62a1.patch


+ 2 - 2
frg/work-js/mozilla-release/patches/mozilla-central-push_422513.patch → frg/work-js/mozilla-release/patches/1467336-21-62a1.patch

@@ -3,7 +3,7 @@
 # Date 1528598971 25200
 #      Sat Jun 09 19:49:31 2018 -0700
 # Node ID dba0ac1d0a0f402b2ef0372b3c92e3479c343dd5
-# Parent  57a1edba27d75ed4d748d8b6fae992e82baeaef7
+# Parent  e55dc60f38ad2ca1fb9287bbdbdf6c45d76723bb
 Bug 1467336 - Make TokenStreamSpecific::putIdentInTokenbuf read identifier characters a code unit at a time.  r=arai
 
 diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
@@ -14,8 +14,8 @@ diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
  #include "util/Unicode.h"
  #include "vm/HelperThreads.h"
  #include "vm/JSAtom.h"
+ #include "vm/JSCompartment.h"
  #include "vm/JSContext.h"
- #include "vm/Realm.h"
  
  using mozilla::ArrayLength;
 +using mozilla::AssertedCast;

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422514.patch → frg/work-js/mozilla-release/patches/1467336-22-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422515.patch → frg/work-js/mozilla-release/patches/1467336-23-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422291.patch → frg/work-js/mozilla-release/patches/1467403-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422298.patch → frg/work-js/mozilla-release/patches/1467496-62a1.patch


+ 5 - 4
frg/work-js/mozilla-release/patches/1468449-1-62a1.patch

@@ -1,8 +1,9 @@
 # HG changeset patch
 # User Jeff Walden <jwalden@mit.edu>
 # Date 1528750584 25200
+#      Mon Jun 11 13:56:24 2018 -0700
 # Node ID 9b3683e49b733bf9302e01e308709b4d272381e2
-# Parent  476c73e0ba7542b33e02005e032f922e9f3ff33d
+# Parent  8949f1ff42ac2e850f61537cd0cb3da3eee11995
 Bug 1468449 - Use std::uninitialized_copy to implement FreshlyInitializeBindings.  r=jonco
 
 diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
@@ -26,7 +27,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  #include "builtin/ModuleObject.h"
  #include "builtin/SelfHostingDefines.h"
  #include "frontend/BytecodeCompiler.h"
-@@ -1776,19 +1777,17 @@ NewEmptyBindingData(JSContext* cx, LifoA
+@@ -1775,19 +1776,17 @@ NewEmptyBindingData(JSContext* cx, LifoA
  
  /**
   * Copy-construct |BindingName|s from |bindings| into |cursor|, then return
@@ -44,6 +45,6 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<GlobalScope::Data*>
  NewGlobalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& alloc, ParseContext* pc)
  {
- 
-     Vector<BindingName> funs(context);
      Vector<BindingName> vars(context);
+     Vector<BindingName> lets(context);
+     Vector<BindingName> consts(context);

+ 28 - 27
frg/work-js/mozilla-release/patches/1468449-2-62a1.patch

@@ -1,14 +1,15 @@
 # HG changeset patch
 # User Jeff Walden <jwalden@mit.edu>
 # Date 1528866762 25200
+#      Tue Jun 12 22:12:42 2018 -0700
 # Node ID bace341bdc89502a4d643be9321b6e00bc4ae7d5
-# Parent  a355ebda81b34a02b1865ea784d344b1755ad8ea
+# Parent  9b3683e49b733bf9302e01e308709b4d272381e2
 Bug 1468449 - Use std::uninitialized_copy_n to copy over BindingNames in a parser-lifetime Data to a long-lived Scope.  r=jonco
 
 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
-@@ -1763,17 +1763,17 @@ Parser<FullParseHandler, CharT>::checkSt
+@@ -1762,17 +1762,17 @@ Parser<FullParseHandler, CharT>::checkSt
      return true;
  }
  
@@ -50,7 +51,7 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
  #include "vm/JSScript.h"
  #include "wasm/WasmInstance.h"
  
-@@ -139,42 +142,34 @@ CreateEnvironmentShape(JSContext* cx, Bi
+@@ -138,42 +141,34 @@ CreateEnvironmentShape(JSContext* cx, Bi
  }
  
  template <typename ConcreteScope>
@@ -100,7 +101,7 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
  PrepareScopeData(JSContext* cx, BindingIter& bi, Handle<UniquePtr<typename ConcreteScope::Data>> data,
                   const Class* cls, uint32_t baseShapeFlags, MutableHandleShape envShape)
  {
-@@ -199,17 +194,18 @@ PrepareScopeData(JSContext* cx, BindingI
+@@ -198,17 +193,18 @@ PrepareScopeData(JSContext* cx, BindingI
  
      return true;
  }
@@ -145,7 +146,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
  #include "js/UbiNode.h"
  #include "js/UniquePtr.h"
  #include "vm/BytecodeUtil.h"
-@@ -383,16 +386,30 @@ class Scope : public js::gc::TenuredCell
+@@ -399,16 +402,30 @@ class Scope : public js::gc::TenuredCell
      void traceChildren(JSTracer* trc);
      void finalize(FreeOp* fop);
  
@@ -176,7 +177,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
  //   A plain lexical scope.
  //
  // SimpleCatch
-@@ -412,17 +429,17 @@ class Scope : public js::gc::TenuredCell
+@@ -428,17 +445,17 @@ class Scope : public js::gc::TenuredCell
  class LexicalScope : public Scope
  {
      friend class Scope;
@@ -195,7 +196,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
          uint32_t constStart = 0;
          uint32_t length = 0;
  
-@@ -435,25 +452,16 @@ class LexicalScope : public Scope
+@@ -451,25 +468,16 @@ class LexicalScope : public Scope
          TrailingNamesArray trailingNames;
  
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
@@ -221,7 +222,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
                      MutableHandleScope scope);
  
    private:
-@@ -518,17 +526,17 @@ class FunctionScope : public Scope
+@@ -534,17 +542,17 @@ class FunctionScope : public Scope
      friend class BindingIter;
      friend class PositionalFormalParameterIter;
      friend class Scope;
@@ -240,7 +241,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
  
          // If parameter expressions are present, parameters act like lexical
          // bindings.
-@@ -561,25 +569,16 @@ class FunctionScope : public Scope
+@@ -577,25 +585,16 @@ class FunctionScope : public Scope
  
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
          Data() = delete;
@@ -266,7 +267,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
                                  HandleScope enclosing);
  
      template <XDRMode mode>
-@@ -646,17 +645,17 @@ class VarScope : public Scope
+@@ -662,17 +661,17 @@ class VarScope : public Scope
  {
      friend class GCMarker;
      friend class BindingIter;
@@ -285,7 +286,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
          // the innermost scope.
          uint32_t nextFrameSlot = 0;
  
-@@ -665,25 +664,16 @@ class VarScope : public Scope
+@@ -681,25 +680,16 @@ class VarScope : public Scope
          TrailingNamesArray trailingNames;
  
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
@@ -311,7 +312,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
      static XDRResult XDR(XDRState<mode>* xdr, ScopeKind kind, HandleScope enclosing,
                      MutableHandleScope scope);
  
-@@ -739,17 +729,17 @@ Scope::is<VarScope>() const
+@@ -755,17 +745,17 @@ Scope::is<VarScope>() const
  class GlobalScope : public Scope
  {
      friend class Scope;
@@ -324,13 +325,13 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
 +    struct Data : BaseScopeData
      {
          // Bindings are sorted by kind.
+         // `vars` includes top-level functions which is distinguished by a bit
+         // on the BindingName.
          //
-         // top-level funcs - [0, varStart)
-         //            vars - [varStart, letStart)
+         //            vars - [0, letStart)
          //            lets - [letStart, constStart)
          //          consts - [constStart, length)
-         uint32_t varStart = 0;
-@@ -762,25 +752,16 @@ class GlobalScope : public Scope
+@@ -778,25 +768,16 @@ class GlobalScope : public Scope
          TrailingNamesArray trailingNames;
  
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
@@ -356,7 +357,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
  
      static GlobalScope* clone(JSContext* cx, Handle<GlobalScope*> scope, ScopeKind kind);
  
-@@ -844,17 +825,17 @@ class WithScope : public Scope
+@@ -860,17 +841,17 @@ class WithScope : public Scope
  class EvalScope : public Scope
  {
      friend class Scope;
@@ -370,12 +371,12 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
      {
          // All bindings in an eval script are 'var' bindings. The implicit
          // lexical scope around the eval is present regardless of strictness
-         // and is its own LexicalScope. However, we need to track top-level
-         // functions specially for redeclaration checks.
+         // and is its own LexicalScope.
+         // `vars` includes top-level functions which is distinguished by a bit
+         // on the BindingName.
          //
-         // top-level funcs - [0, varStart)
-         //            vars - [varStart, length)
-@@ -870,25 +851,16 @@ class EvalScope : public Scope
+         //            vars - [0, length)
+@@ -886,25 +867,16 @@ class EvalScope : public Scope
          TrailingNamesArray trailingNames;
  
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
@@ -401,7 +402,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
                      MutableHandleScope scope);
  
    private:
-@@ -949,17 +921,17 @@ class ModuleScope : public Scope
+@@ -965,17 +937,17 @@ class ModuleScope : public Scope
      friend class GCMarker;
      friend class BindingIter;
      friend class Scope;
@@ -420,7 +421,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
          //
          // imports - [0, varStart)
          //    vars - [varStart, letStart)
-@@ -980,25 +952,16 @@ class ModuleScope : public Scope
+@@ -996,25 +968,16 @@ class ModuleScope : public Scope
  
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
          Data() = delete;
@@ -446,7 +447,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
                                         Handle<ModuleObject*> module, HandleScope enclosing);
  
      Data& data() {
-@@ -1025,17 +988,17 @@ class ModuleScope : public Scope
+@@ -1041,17 +1004,17 @@ class ModuleScope : public Scope
  
  class WasmInstanceScope : public Scope
  {
@@ -465,7 +466,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
  
          // The wasm instance of the scope.
          GCPtr<WasmInstanceObject*> instance = {};
-@@ -1045,20 +1008,16 @@ class WasmInstanceScope : public Scope
+@@ -1061,20 +1024,16 @@ class WasmInstanceScope : public Scope
          explicit Data(size_t nameCount) : trailingNames(nameCount) {}
          Data() = delete;
  
@@ -486,7 +487,7 @@ diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h
      const Data& data() const {
          return *reinterpret_cast<Data*>(data_);
      }
-@@ -1088,36 +1047,32 @@ class WasmInstanceScope : public Scope
+@@ -1104,36 +1063,32 @@ class WasmInstanceScope : public Scope
  //
  class WasmFunctionScope : public Scope
  {

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422656.patch → frg/work-js/mozilla-release/patches/1468629-62a1.patch


+ 9 - 9
frg/work-js/mozilla-release/patches/mozilla-central-push_422774.patch → frg/work-js/mozilla-release/patches/1468786-62a1.patch

@@ -3,13 +3,13 @@
 # Date 1529013386 25200
 #      Thu Jun 14 14:56:26 2018 -0700
 # Node ID e8b27362214617f1d47e867bcc4dd2619441d986
-# Parent  05070f7aa5bf180a97a76dc23b3ab194f9cd4622
+# Parent  2cf978a6ae5206b15647ec515f78004de5c1021d
 Bug 1468786 - Don't check isIncremental for unmarking r=jonco
 
 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
-@@ -4400,20 +4400,18 @@ GCRuntime::beginMarkPhase(JS::gcreason::
+@@ -4412,20 +4412,18 @@ GCRuntime::beginMarkPhase(JS::gcreason::
      if (!atomsZone->isCollecting())
          session.maybeLock.reset();
  
@@ -32,7 +32,7 @@ diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
          gcstats::AutoPhase ap1(stats(), gcstats::PhaseKind::PREPARE);
          AutoLockHelperThreadState helperLock;
  
-@@ -5724,18 +5722,17 @@ GCRuntime::beginSweepingSweepGroup(FreeO
+@@ -5736,18 +5734,17 @@ GCRuntime::beginSweepingSweepGroup(FreeO
      AutoSCC scc(stats(), sweepGroupIndex);
  
      bool sweepingAtoms = false;
@@ -52,7 +52,7 @@ diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
  #ifdef DEBUG
          zone->gcLastSweepGroupIndex = sweepGroupIndex;
  #endif
-@@ -5855,18 +5852,17 @@ GCRuntime::endSweepingSweepGroup(FreeOp*
+@@ -5867,18 +5864,17 @@ GCRuntime::endSweepingSweepGroup(FreeOp*
  
      /* Update the GC state for zones we have swept. */
      for (SweepGroupZonesIter zone(rt); !zone.done(); zone.next()) {
@@ -72,14 +72,14 @@ diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
       */
      bool sweepAtomsZone = false;
      ZoneList zones;
-@@ -6941,16 +6937,21 @@ GCRuntime::resetIncrementalGC(gc::AbortR
+@@ -6968,16 +6964,21 @@ GCRuntime::resetIncrementalGC(gc::AbortR
        }
  
        case State::Sweep: {
          marker.reset();
  
          for (CompartmentsIter c(rt); !c.done(); c.next())
-             c->gcState.scheduledForDestruction = false;
+             c->scheduledForDestruction = false;
  
 +        for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
 +            if (zone->isGCMarking())
@@ -94,7 +94,7 @@ diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
          isCompacting = false;
  
          auto unlimited = SliceBudget::unlimited();
-@@ -7069,27 +7070,16 @@ GCRuntime::pushZealSelectedObjects()
+@@ -7096,27 +7097,16 @@ GCRuntime::pushZealSelectedObjects()
  {
  #ifdef JS_GC_ZEAL
      /* Push selected objects onto the mark stack and clear the list. */
@@ -122,7 +122,7 @@ diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
  
  static bool
  ShouldCleanUpEverything(JS::gcreason::Reason reason, JSGCInvocationKind gckind)
-@@ -7132,18 +7122,16 @@ GCRuntime::incrementalCollectSlice(Slice
+@@ -7159,18 +7149,16 @@ GCRuntime::incrementalCollectSlice(Slice
      {
          char budgetBuffer[32];
          budget.describe(budgetBuffer, 32);
@@ -144,7 +144,7 @@ diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
 diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h
 --- a/js/src/gc/GCRuntime.h
 +++ b/js/src/gc/GCRuntime.h
-@@ -557,17 +557,16 @@ class GCRuntime
+@@ -558,17 +558,16 @@ class GCRuntime
                                             JS::gcreason::Reason reason);
      bool shouldRepeatForDeadZone(JS::gcreason::Reason reason);
      void incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason reason,

+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_422766.patch → frg/work-js/mozilla-release/patches/1468984-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_423354.patch → frg/work-js/mozilla-release/patches/1469444-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_423355.patch → frg/work-js/mozilla-release/patches/1469469-62a1.patch


+ 0 - 0
frg/work-js/mozilla-release/patches/mozilla-central-push_423353.patch → frg/work-js/mozilla-release/patches/1469593-62a1.patch


+ 15 - 20
frg/work-js/mozilla-release/patches/1473297-63a1.patch

@@ -2,13 +2,13 @@
 # User Jon Coppeard <jcoppeard@mozilla.com>
 # Date 1530891121 -3600
 # Node ID b8474706578ccc96abe77be1b95c0d1cc0df10fd
-# Parent  c96f69757173ee4887214ac2a0d0adef1afdbf84
+# Parent  b7d546df21fb4cfeed59365b274ad8878e5705c4
 Bug 1473297 - Use inline data for stack allocated binding name vectors in the parser r=Waldo
 
 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
-@@ -65,16 +65,18 @@ using JS::AutoGCRooter;
+@@ -64,16 +64,18 @@ using JS::AutoGCRooter;
  namespace js {
  namespace frontend {
  
@@ -27,7 +27,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
          if (!tokenStream.getToken(&token, modifier))                                        \
              return null();                                                                  \
          if (!(cond)) {                                                                      \
-@@ -1775,29 +1777,29 @@ NewEmptyBindingData(JSContext* cx, LifoA
+@@ -1768,27 +1770,27 @@ NewEmptyBindingData(JSContext* cx, LifoA
      return bindings;
  }
  
@@ -45,24 +45,21 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<GlobalScope::Data*>
  NewGlobalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& alloc, ParseContext* pc)
  {
- 
--    Vector<BindingName> funs(context);
 -    Vector<BindingName> vars(context);
 -    Vector<BindingName> lets(context);
 -    Vector<BindingName> consts(context);
-+    BindingNameVector funs(context);
 +    BindingNameVector vars(context);
 +    BindingNameVector lets(context);
 +    BindingNameVector consts(context);
  
      bool allBindingsClosedOver = pc->sc()->allBindingsClosedOver();
      for (BindingIter bi = scope.bindings(pc); bi; bi++) {
-         BindingName binding(bi.name(), allBindingsClosedOver || bi.closedOver());
+         bool closedOver = allBindingsClosedOver || bi.closedOver();
+ 
          switch (bi.kind()) {
-           case BindingKind::Var:
-             if (bi.declarationKind() == DeclarationKind::BodyLevelFunction) {
-                 if (!funs.append(binding))
-@@ -1853,20 +1855,20 @@ Maybe<GlobalScope::Data*>
+           case BindingKind::Var: {
+             bool isTopLevelFunction = bi.declarationKind() == DeclarationKind::BodyLevelFunction;
+@@ -1844,20 +1846,20 @@ Maybe<GlobalScope::Data*>
  ParserBase::newGlobalScopeData(ParseContext::Scope& scope)
  {
      return NewGlobalScopeData(context, scope, alloc, pc);
@@ -87,7 +84,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
                                         bi.kind() != BindingKind::Import);
          switch (bi.kind()) {
            case BindingKind::Import:
-@@ -1923,18 +1925,18 @@ Maybe<ModuleScope::Data*>
+@@ -1914,17 +1916,17 @@ Maybe<ModuleScope::Data*>
  ParserBase::newModuleScopeData(ParseContext::Scope& scope)
  {
      return NewModuleScopeData(context, scope, alloc, pc);
@@ -96,19 +93,17 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<EvalScope::Data*>
  NewEvalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& alloc, ParseContext* pc)
  {
--    Vector<BindingName> funs(context);
 -    Vector<BindingName> vars(context);
-+    BindingNameVector funs(context);
 +    BindingNameVector vars(context);
  
      for (BindingIter bi = scope.bindings(pc); bi; bi++) {
          // Eval scopes only contain 'var' bindings. Make all bindings aliased
          // for now.
          MOZ_ASSERT(bi.kind() == BindingKind::Var);
-         BindingName binding(bi.name(), true);
-         if (bi.declarationKind() == DeclarationKind::BodyLevelFunction) {
-             if (!funs.append(binding))
-@@ -1973,19 +1975,19 @@ Maybe<EvalScope::Data*>
+         bool isTopLevelFunction = bi.declarationKind() == DeclarationKind::BodyLevelFunction;
+         BindingName binding(bi.name(), true, isTopLevelFunction);
+         if (!vars.append(binding))
+@@ -1954,19 +1956,19 @@ Maybe<EvalScope::Data*>
  ParserBase::newEvalScopeData(ParseContext::Scope& scope)
  {
      return NewEvalScopeData(context, scope, alloc, pc);
@@ -131,7 +126,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
      // referenced using argument slots.
      for (size_t i = 0; i < pc->positionalFormalParameterNames().length(); i++) {
          JSAtom* name = pc->positionalFormalParameterNames()[i];
-@@ -2072,17 +2074,17 @@ Maybe<FunctionScope::Data*>
+@@ -2053,17 +2055,17 @@ Maybe<FunctionScope::Data*>
  ParserBase::newFunctionScopeData(ParseContext::Scope& scope, bool hasParameterExprs)
  {
      return NewFunctionScopeData(context, scope, hasParameterExprs, alloc, pc);
@@ -150,7 +145,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              BindingName binding(bi.name(), allBindingsClosedOver || bi.closedOver());
              if (!vars.append(binding))
                  return Nothing();
-@@ -2113,18 +2115,18 @@ Maybe<VarScope::Data*>
+@@ -2094,18 +2096,18 @@ Maybe<VarScope::Data*>
  ParserBase::newVarScopeData(ParseContext::Scope& scope)
  {
      return NewVarScopeData(context, scope, alloc, pc);

+ 9 - 9
frg/work-js/mozilla-release/patches/1483323-6-64a1.patch

@@ -3,7 +3,7 @@
 # Date 1536173543 0
 #      Wed Sep 05 18:52:23 2018 +0000
 # Node ID 1f62e4c2870def144c9e3a1d31993242234e4082
-# Parent  a14112274719acbf30bbc68692b74b1019cfa262
+# Parent  0056ad047cd110848eb78e9c81a08dc35306b7ed
 Bug 1483323 part 6 - Fix recognizing JSID_EMPTY r=tromey
 
 Bug 1464036 changed how JSID_EMPTY was defined; this patch updates the gdb
@@ -16,17 +16,17 @@ Differential Revision: https://phabricator.services.mozilla.com/D4612
 diff --git a/js/src/gdb/mozilla/jsid.py b/js/src/gdb/mozilla/jsid.py
 --- a/js/src/gdb/mozilla/jsid.py
 +++ b/js/src/gdb/mozilla/jsid.py
-@@ -14,16 +14,17 @@ class jsid(object):
+@@ -15,16 +15,17 @@ class jsid(object):
      # Since people don't always build with macro debugging info, I can't
      # think of any way to avoid copying these values here, short of using
      # inferior calls for every operation (which, I hear, is broken from
      # pretty-printers in some recent GDBs).
-     TYPE_STRING                 = 0x0
-     TYPE_INT                    = 0x1
-     TYPE_VOID                   = 0x2
-     TYPE_SYMBOL                 = 0x4
-+    TYPE_EMPTY                  = 0x6
-     TYPE_MASK                   = 0x7
+     TYPE_STRING = 0x0
+     TYPE_INT = 0x1
+     TYPE_VOID = 0x2
+     TYPE_SYMBOL = 0x4
++    TYPE_EMPTY = 0x6
+     TYPE_MASK = 0x7
  
      def __init__(self, value, cache):
          self.value = value
@@ -34,7 +34,7 @@ diff --git a/js/src/gdb/mozilla/jsid.py b/js/src/gdb/mozilla/jsid.py
          self.concrete_type = self.value.type.strip_typedefs()
  
      # SpiderMonkey has two alternative definitions of jsid: a typedef for
-@@ -43,20 +44,20 @@ class jsid(object):
+@@ -44,20 +45,20 @@ class jsid(object):
          tag = bits & jsid.TYPE_MASK
          if tag == jsid.TYPE_STRING:
              body = bits.cast(self.cache.JSString_ptr_t)

+ 23 - 23
frg/work-js/mozilla-release/patches/1490130-64a1.patch

@@ -2,50 +2,50 @@
 # User Ted Mielczarek <ted@mielczarek.org>
 # Date 1536619652 14400
 # Node ID 4e39cac7e8d5bb08d8616678529baa5302afb39e
-# Parent  f6851467bd4e3708a8316494e6375493ca1788b2
+# Parent  1135fa02e30fbd955e4321c96182357b9b34e960
 Bug 1490130 - fix embedjs.py script to use relative paths to source files; r=froydnj
 
 diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
 --- a/js/src/builtin/embedjs.py
 +++ b/js/src/builtin/embedjs.py
-@@ -33,16 +33,17 @@
- 
- # This utility converts JS files containing self-hosted builtins into a C
+@@ -35,16 +35,17 @@
  # header file that can be embedded into SpiderMonkey.
  #
  # It uses the C preprocessor to process its inputs.
  
  from __future__ import with_statement
- import re, sys, os, subprocess
+ import re
+ import sys
+ import os
 +import mozpack.path as mozpath
+ import subprocess
  import shlex
  import which
  import buildconfig
  
+ 
  def ToCAsciiArray(lines):
-   result = []
-   for chr in lines:
-     value = ord(chr)
-@@ -74,17 +75,21 @@ namespace %(namespace)s {
-     uint32_t GetRawScriptsSize() {
+     result = []
+@@ -81,18 +82,21 @@ namespace %(namespace)s {
          return %(raw_total_length)i;
      }
  } // selfhosted
  } // js
  """  # NOQA: E501
  
+ 
  def embed(cxx, preprocessorOption, cppflags, msgs, sources, c_out, js_out, namespace, env):
--  combinedSources = '\n'.join([msgs] + ['#include "%(s)s"' % { 's': source } for source in sources])
-+  objdir = os.getcwd()
-+  # Use relative pathnames to avoid path translation issues in WSL.
-+  combinedSources = '\n'.join([msgs] + ['#include "%(s)s"' %
-+                                        {'s': mozpath.relpath(source, objdir)}
-+                                        for source in sources])
-   args = cppflags + ['-D%(k)s=%(v)s' % { 'k': k, 'v': env[k] } for k in env]
-   preprocessed = preprocess(cxx, preprocessorOption, combinedSources, args)
-   processed = '\n'.join([line for line in preprocessed.splitlines() if \
-                          (line.strip() and not line.startswith('#'))])
++    objdir = os.getcwd()
++    # Use relative pathnames to avoid path translation issues in WSL.
+     combinedSources = '\n'.join([msgs] + ['#include "%(s)s"' %
+-                                          {'s': source} for source in sources])
++                                          {'s': mozpath.relpath(source, objdir)}
++                                          for source in sources])
+     args = cppflags + ['-D%(k)s=%(v)s' % {'k': k, 'v': env[k]} for k in env]
+     preprocessed = preprocess(cxx, preprocessorOption, combinedSources, args)
+     processed = '\n'.join([line for line in preprocessed.splitlines() if
+                            (line.strip() and not line.startswith('#'))])
  
-   js_out.write(processed)
-   import zlib
-   compressed = zlib.compress(processed)
+     js_out.write(processed)
+     import zlib
+     compressed = zlib.compress(processed)

+ 12 - 14
frg/work-js/mozilla-release/patches/1490589-64a1.patch

@@ -2,7 +2,7 @@
 # User Jan de Mooij <jdemooij@mozilla.com>
 # Date 1536736010 0
 # Node ID cab441a582e82e1875fd9271b78f3b5e8462376d
-# Parent  c15c5382c28e25296a134dc1d4d1e65d62529bf8
+# Parent  1be26c15d717f6ecfad51becb9413f0ccde412e8
 Bug 1490589 - Add braces for if-statements in make_unicode.py. r=arai
 
 Differential Revision: https://phabricator.services.mozilla.com/D5645
@@ -2634,7 +2634,7 @@ diff --git a/js/src/util/Unicode.cpp b/js/src/util/Unicode.cpp
 diff --git a/js/src/util/make_unicode.py b/js/src/util/make_unicode.py
 --- a/js/src/util/make_unicode.py
 +++ b/js/src/util/make_unicode.py
-@@ -699,32 +699,34 @@ def write_special_casing_methods(uncondi
+@@ -720,32 +720,34 @@ def write_special_casing_methods(uncondi
          child_ranges = list(int_ranges(child_list))
          has_successor = max_child != max_parent
  
@@ -2671,7 +2671,7 @@ diff --git a/js/src/util/make_unicode.py b/js/src/util/make_unicode.py
              println(indent, 'return {};'.format(range_test_expr))
          else:
              println(indent, 'if (ch <= {}) {{'.format(hexlit(max_child)))
-@@ -739,18 +741,19 @@ def write_special_casing_methods(uncondi
+@@ -760,18 +762,19 @@ def write_special_casing_methods(uncondi
          println('{')
  
          assert unconditional_toupper, "|unconditional_toupper| is not empty"
@@ -2692,7 +2692,7 @@ diff --git a/js/src/util/make_unicode.py b/js/src/util/make_unicode.py
              end_point = (i + 1) << 12
              matches = [cu for cu in code_list if start_point <= cu < end_point]
  
-@@ -767,18 +770,19 @@ def write_special_casing_methods(uncondi
+@@ -788,18 +791,19 @@ def write_special_casing_methods(uncondi
              # Otherwise split into further subranges.
  
              # Only enter the if-block if the input is less-or-equals to the
@@ -2713,7 +2713,7 @@ diff --git a/js/src/util/make_unicode.py b/js/src/util/make_unicode.py
  
                  if inner_matches:
                      d = 1 if is_last_block else 2
-@@ -1169,21 +1173,23 @@ def make_unicode_file(version,
+@@ -1201,22 +1205,24 @@ def make_unicode_file(version,
          dump(idx2, idx2_name, println)
          println('')
  
@@ -2722,17 +2722,15 @@ diff --git a/js/src/util/make_unicode.py b/js/src/util/make_unicode.py
          println('js::unicode::{}(uint32_t codePoint)'.format(name))
          println('{')
          for (from_code, to_code) in int_ranges(group_set.keys()):
--            println('    if (codePoint >= 0x{:X} && codePoint <= 0x{:X}) // {} .. {}'.format(from_code,
--                                                                                             to_code,
--                                                                                             codepoint_table.name(from_code),
--                                                                                             codepoint_table.name(to_code)))
+-            println('    if (codePoint >= 0x{:X} && codePoint <= 0x{:X}) // {} .. {}'
 +            println('    if (codePoint >= 0x{:X} && codePoint <= 0x{:X}) {{ // {} .. {}'
-+                    .format(from_code,
-+                            to_code,
-+                            codepoint_table.name(from_code),
-+                            codepoint_table.name(to_code)))
+                     .format(from_code,
+                             to_code,
+                             codepoint_table.name(from_code),
+                             codepoint_table.name(to_code)))
              println('        return true;')
 +            println('    }')
++
          println('    return false;')
          println('}')
          println('')
@@ -2741,7 +2739,7 @@ diff --git a/js/src/util/make_unicode.py b/js/src/util/make_unicode.py
      with io.open(file_name, 'w', encoding='utf-8') as data_file:
          write = partial(print, file=data_file, sep='', end='')
          println = partial(print, file=data_file, sep='', end='\n')
-@@ -1398,26 +1404,28 @@ def make_irregexp_tables(version,
+@@ -1434,26 +1440,28 @@ def make_irregexp_tables(version,
          println('    if (unicode) {')
          for ch in casefolded_to_latin1:
              casefolded = casefold(ch)

+ 29 - 40
frg/work-js/mozilla-release/patches/1494752-604.patch

@@ -3,7 +3,7 @@
 # Date 1541688097 18000
 #      Thu Nov 08 09:41:37 2018 -0500
 # Node ID c264774b89130cd7759c40977835e2a0d32fd684
-# Parent  5a2315ce078da620fd3ca026b7590c3522773fb0
+# Parent  22f71e06ad70f2e6d8cb7ea4c5ad76660b328b4e
 Bug 1494752. r=jonco, a=RyanVM
 
 diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
@@ -52,7 +52,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  namespace frontend {
  
  using DeclaredNamePtr = ParseContext::Scope::DeclaredNamePtr;
-@@ -1771,24 +1775,67 @@ NewEmptyBindingData(JSContext* cx, LifoA
+@@ -1765,24 +1769,67 @@ NewEmptyBindingData(JSContext* cx, LifoA
      using Data = typename Scope::Data;
      size_t allocSize = SizeOfData<typename Scope::Data>(numBindings);
      auto* bindings = alloc.allocInSize<Data>(allocSize, numBindings);
@@ -125,11 +125,11 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<GlobalScope::Data*>
  NewGlobalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& alloc, ParseContext* pc)
  {
- 
-     BindingNameVector funs(context);
      BindingNameVector vars(context);
-@@ -1825,31 +1872,21 @@ NewGlobalScopeData(JSContext* context, P
-     uint32_t numBindings = funs.length() + vars.length() + lets.length() + consts.length();
+     BindingNameVector lets(context);
+     BindingNameVector consts(context);
+@@ -1820,28 +1867,20 @@ NewGlobalScopeData(JSContext* context, P
+     uint32_t numBindings = vars.length() + lets.length() + consts.length();
  
      if (numBindings > 0) {
          bindings = NewEmptyBindingData<GlobalScope>(context, alloc, numBindings);
@@ -140,9 +140,6 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 -        BindingName* start = bindings->trailingNames.start();
 -        BindingName* cursor = start;
 -
--        cursor = FreshlyInitializeBindings(cursor, funs);
--
--        bindings->varStart = cursor - start;
 -        cursor = FreshlyInitializeBindings(cursor, vars);
 -
 -        bindings->letStart = cursor - start;
@@ -153,8 +150,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 -
 -        bindings->length = numBindings;
 +        InitializeBindingData(bindings, numBindings,
-+                              funs,
-+                              &GlobalScope::Data::varStart, vars,
++                              vars,
 +                              &GlobalScope::Data::letStart, lets,
 +                              &GlobalScope::Data::constStart, consts);
      }
@@ -165,7 +161,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<GlobalScope::Data*>
  ParserBase::newGlobalScopeData(ParseContext::Scope& scope)
  {
-@@ -1895,31 +1932,21 @@ NewModuleScopeData(JSContext* context, P
+@@ -1887,31 +1926,21 @@ NewModuleScopeData(JSContext* context, P
      uint32_t numBindings = imports.length() + vars.length() + lets.length() + consts.length();
  
      if (numBindings > 0) {
@@ -202,9 +198,9 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<ModuleScope::Data*>
  ParserBase::newModuleScopeData(ParseContext::Scope& scope)
  {
-@@ -1949,27 +1976,21 @@ NewEvalScopeData(JSContext* context, Par
+@@ -1936,22 +1965,17 @@ NewEvalScopeData(JSContext* context, Par
      EvalScope::Data* bindings = nullptr;
-     uint32_t numBindings = funs.length() + vars.length();
+     uint32_t numBindings = vars.length();
  
      if (numBindings > 0) {
          bindings = NewEmptyBindingData<EvalScope>(context, alloc, numBindings);
@@ -214,17 +210,10 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 -        BindingName* start = bindings->trailingNames.start();
 -        BindingName* cursor = start;
 -
-         // Keep track of what vars are functions. This is only used in BCE to omit
-         // superfluous DEFVARs.
--        cursor = FreshlyInitializeBindings(cursor, funs);
--
--        bindings->varStart = cursor - start;
 -        cursor = FreshlyInitializeBindings(cursor, vars);
 -
 -        bindings->length = numBindings;
-+        InitializeBindingData(bindings, numBindings,
-+                              funs,
-+                              &EvalScope::Data::varStart, vars);
++        InitializeBindingData(bindings, numBindings, vars);
      }
  
      return Some(bindings);
@@ -233,7 +222,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<EvalScope::Data*>
  ParserBase::newEvalScopeData(ParseContext::Scope& scope)
  {
-@@ -2047,28 +2068,20 @@ NewFunctionScopeData(JSContext* context,
+@@ -2029,28 +2053,20 @@ NewFunctionScopeData(JSContext* context,
      uint32_t numBindings = positionalFormals.length() + formals.length() + vars.length();
  
      if (numBindings > 0) {
@@ -266,7 +255,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<FunctionScope::Data*>
  ParserBase::newFunctionScopeData(ParseContext::Scope& scope, bool hasParameterExprs)
  {
-@@ -2093,23 +2106,17 @@ NewVarScopeData(JSContext* context, Pars
+@@ -2075,23 +2091,17 @@ NewVarScopeData(JSContext* context, Pars
      VarScope::Data* bindings = nullptr;
      uint32_t numBindings = vars.length();
  
@@ -291,7 +280,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  Maybe<VarScope::Data*>
  ParserBase::newVarScopeData(ParseContext::Scope& scope)
  {
-@@ -2148,25 +2155,19 @@ NewLexicalScopeData(JSContext* context, 
+@@ -2130,25 +2140,19 @@ NewLexicalScopeData(JSContext* context, 
      uint32_t numBindings = lets.length() + consts.length();
  
      if (numBindings > 0) {
@@ -323,14 +312,14 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
 --- a/js/src/vm/Scope.cpp
 +++ b/js/src/vm/Scope.cpp
-@@ -204,48 +204,49 @@ NewEmptyScopeData(JSContext* cx, uint32_
-         ReportOutOfMemory(cx);
-     auto data = reinterpret_cast<typename ConcreteScope::Data*>(bytes);
-     if (data)
+@@ -207,17 +207,17 @@ NewEmptyScopeData(JSContext* cx, uint32_
          new (data) typename ConcreteScope::Data(length);
      return UniquePtr<typename ConcreteScope::Data>(data);
  }
  
+ static constexpr size_t HasAtomMask = 1;
+ static constexpr size_t HasAtomShift = 1;
+ 
  static XDRResult
 -XDRBindingName(XDRState<XDR_ENCODE>* xdr, BindingName* bindingName)
 +XDRTrailingName(XDRState<XDR_ENCODE>* xdr, BindingName* bindingName, const uint32_t* length)
@@ -340,8 +329,9 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
      RootedAtom atom(cx, bindingName->name());
      bool hasAtom = !!atom;
  
-     uint8_t u8 = uint8_t(hasAtom << 1) | uint8_t(bindingName->closedOver());
-     MOZ_TRY(xdr->codeUint8(&u8));
+     uint8_t flags = bindingName->flagsForXDR();
+     MOZ_ASSERT(((flags << HasAtomShift) >> HasAtomShift) == flags);
+@@ -226,30 +226,31 @@ XDRBindingName(XDRState<XDR_ENCODE>* xdr
  
      if (hasAtom)
          MOZ_TRY(XDRAtom(xdr, &atom));
@@ -358,15 +348,14 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
      uint8_t u8;
      MOZ_TRY(xdr->codeUint8(&u8));
  
-     bool closedOver = u8 & 1;
-     bool hasAtom = u8 >> 1;
- 
+     bool hasAtom = u8 & HasAtomMask;
      RootedAtom atom(cx);
      if (hasAtom)
          MOZ_TRY(XDRAtom(xdr, &atom));
  
--    *bindingName = BindingName(atom, closedOver);
-+    new (bindingName) BindingName(atom, closedOver);
+     uint8_t flags = u8 >> HasAtomShift;
+-    *bindingName = BindingName::fromXDR(atom, flags);
++    new (bindingName) BindingName(BindingName::fromXDR(atom, flags));
 +    ++*length;
  
      return Ok();
@@ -376,7 +365,7 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
  static void
  DeleteScopeData(ConcreteScopeData* data)
  {
-@@ -269,28 +270,32 @@ Scope::XDRSizedBindingNames(XDRState<mod
+@@ -273,28 +274,32 @@ Scope::XDRSizedBindingNames(XDRState<mod
      MOZ_TRY(xdr->codeUint32(&length));
  
      if (mode == XDR_ENCODE) {
@@ -412,7 +401,7 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
  /* static */ Scope*
  Scope::create(JSContext* cx, ScopeKind kind, HandleScope enclosing, HandleShape envShape)
  {
-@@ -1222,16 +1227,31 @@ GenerateWasmName(JSContext* cx, const ch
+@@ -1224,16 +1229,31 @@ GenerateWasmName(JSContext* cx, const ch
      if (!sb.append(prefix))
          return nullptr;
      if (!NumberValueToStringBuffer(cx, Int32Value(index), sb))
@@ -444,7 +433,7 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
      Rooted<WasmInstanceScope*> wasmInstanceScope(cx);
  
      {
-@@ -1242,38 +1262,38 @@ WasmInstanceScope::create(JSContext* cx,
+@@ -1244,38 +1264,38 @@ WasmInstanceScope::create(JSContext* cx,
          size_t globalsStart = namesCount;
          size_t globalsCount = instance->instance().metadata().globals.length();
          namesCount += globalsCount;
@@ -495,7 +484,7 @@ diff --git a/js/src/vm/Scope.cpp b/js/src/vm/Scope.cpp
              return nullptr;
  
          wasmInstanceScope = &scope->as<WasmInstanceScope>();
-@@ -1310,25 +1330,27 @@ WasmFunctionScope::create(JSContext* cx,
+@@ -1312,25 +1332,27 @@ WasmFunctionScope::create(JSContext* cx,
      if (!instance->instance().debug().debugGetLocalTypes(funcIndex, &locals, &argsLength))
          return nullptr;
      uint32_t namesCount = locals.length();

+ 265 - 0
frg/work-js/mozilla-release/patches/1514625-66a1.patch

@@ -0,0 +1,265 @@
+# HG changeset patch
+# User Jan de Mooij <jdemooij@mozilla.com>
+# Date 1546876851 0
+# Node ID 10276b98cd16c4537cbd2f344354f2c38b5b7e04
+# Parent  206ac183402b2433aaf7d1817b6350521052cc4b
+Bug 1514625 - Clean up and simplify loop entry code in Ion more. r=nbp
+
+For a broken loop we used to change CFGLoopEntry to CFGGoto, but that really
+complicates IonBuilder. It's simpler to keep the CFGLoopEntry and set a flag
+on it.
+
+Differential Revision: https://phabricator.services.mozilla.com/D15575
+
+diff --git a/js/src/jit-test/tests/ion/bug1514625.js b/js/src/jit-test/tests/ion/bug1514625.js
+new file mode 100644
+--- /dev/null
++++ b/js/src/jit-test/tests/ion/bug1514625.js
+@@ -0,0 +1,11 @@
++var i = 0;
++evaluate("");
++while (--i >= 0) {
++    if (x > 0) {
++        continue;
++    }
++    switch (i) {
++        default:
++          i(i);
++    }
++}
+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
+@@ -1609,57 +1609,25 @@ IonBuilder::visitBlock(const CFGBlock* c
+ #endif
+ 
+         pc += CodeSpec[op].length;
+         current->updateTrackedSite(bytecodeSite(pc));
+     }
+     return Ok();
+ }
+ 
+-bool
+-IonBuilder::blockIsOSREntry(const CFGBlock* block, const CFGBlock* predecessor)
+-{
+-    jsbytecode* entryPc = block->startPc();
+-
+-    if (!info().osrPc())
+-        return false;
+-
+-    if (entryPc == predecessor->startPc()) {
+-        // The predecessor is the actual osr entry block. Since it is empty
+-        // the current block also starts a the osr pc. But it isn't the osr entry.
+-        MOZ_ASSERT(predecessor->stopPc() == predecessor->startPc());
+-        return false;
+-    }
+-
+-    if (block->stopPc() == block->startPc() && block->stopIns()->isBackEdge()) {
+-        // An empty block with only a backedge can never be a loop entry.
+-        return false;
+-    }
+-
+-    MOZ_ASSERT(*info().osrPc() == JSOP_LOOPENTRY);
+-    return info().osrPc() == entryPc;
+-}
+-
+-AbortReasonOr<Ok>
+-IonBuilder::visitGoto(CFGGoto* ins)
+-{
+-    // Test if this potentially was a fake loop and create OSR entry if that is
+-    // the case.
+-    const CFGBlock* successor = ins->getSuccessor(0);
+-    if (blockIsOSREntry(successor, cfgCurrent)) {
+-        MBasicBlock* preheader;
+-        MOZ_TRY_VAR(preheader, newOsrPreheader(current, successor->startPc(), pc));
+-        current->end(MGoto::New(alloc(), preheader));
+-        MOZ_TRY(setCurrentAndSpecializePhis(preheader));
+-    }
+-
++AbortReasonOr<Ok> IonBuilder::visitGoto(CFGGoto* ins) {
++  return emitGoto(ins->successor(), ins->popAmount());
++}
++
++AbortReasonOr<Ok> IonBuilder::emitGoto(CFGBlock* successor, size_t popAmount) {
+     size_t id = successor->id();
+     bool create = !blockWorklist[id] || blockWorklist[id]->isDead();
+ 
+-    current->popn(ins->popAmount());
++    current->popn(popAmount);
+ 
+     if (create)
+         MOZ_TRY_VAR(blockWorklist[id], newBlock(current, successor->startPc()));
+ 
+     MBasicBlock* succ = blockWorklist[id];
+     current->end(MGoto::New(alloc(), succ));
+ 
+     if (!create) {
+@@ -1706,25 +1674,37 @@ IonBuilder::visitBackEdge(CFGBackEdge* i
+     }
+ }
+ 
+ AbortReasonOr<Ok>
+ IonBuilder::visitLoopEntry(CFGLoopEntry* loopEntry)
+ {
+     unsigned stackPhiCount = loopEntry->stackPhiCount();
+     const CFGBlock* successor = loopEntry->getSuccessor(0);
+-    bool osr = blockIsOSREntry(successor, cfgCurrent);
++    bool osr = successor->startPc() == info().osrPc();
+     if (osr) {
+         MOZ_ASSERT(loopEntry->canOsr());
+         MBasicBlock* preheader;
+         MOZ_TRY_VAR(preheader, newOsrPreheader(current, successor->startPc(), pc));
+         current->end(MGoto::New(alloc(), preheader));
+         MOZ_TRY(setCurrentAndSpecializePhis(preheader));
+     }
+ 
++  if (loopEntry->isBrokenLoop()) {
++    // A "broken loop" is a loop that does not actually loop, for example:
++    //
++    //   while (x) {
++    //      return true;
++    //   }
++    //
++    // A broken loop has no backedge so we don't need a loop header and loop
++    // phis. Just emit a Goto to the loop entry.
++    return emitGoto(loopEntry->successor(), /* popAmount = */ 0);
++  }
++
+     loopDepth_++;
+     MBasicBlock* header;
+     MOZ_TRY_VAR(header, newPendingLoopHeader(current, successor->startPc(), osr,
+                                              loopEntry->canOsr(), stackPhiCount));
+     blockWorklist[successor->id()] = header;
+ 
+     current->end(MGoto::New(alloc(), header));
+ 
+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
+@@ -128,17 +128,17 @@ class IonBuilder
+ 
+     // Please see the Big Honkin' Comment about how resume points work in
+     // IonBuilder.cpp, near the definition for this function.
+     AbortReasonOr<Ok> resume(MInstruction* ins, jsbytecode* pc, MResumePoint::Mode mode);
+     AbortReasonOr<Ok> resumeAt(MInstruction* ins, jsbytecode* pc);
+     AbortReasonOr<Ok> resumeAfter(MInstruction* ins);
+     AbortReasonOr<Ok> maybeInsertResume();
+ 
+-    bool blockIsOSREntry(const CFGBlock* block, const CFGBlock* predecessor);
++    AbortReasonOr<Ok> emitGoto(CFGBlock* successor, size_t popAmount);
+ 
+     void insertRecompileCheck();
+ 
+     bool usesEnvironmentChain();
+ 
+     AbortReasonOr<Ok> initParameters();
+     void initLocals();
+     void rewriteParameter(uint32_t slotIdx, MDefinition* param);
+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
+@@ -961,20 +961,17 @@ ControlFlowGenerator::processWhileOrForI
+     return ControlStatus::Jumped;
+ }
+ 
+ ControlFlowGenerator::ControlStatus
+ ControlFlowGenerator::processBrokenLoop(CFGState& state)
+ {
+     MOZ_ASSERT(!current);
+ 
+-    {
+-        state.loop.entry->setStopIns(
+-            CFGGoto::New(alloc(), state.loop.entry->stopIns()->toLoopEntry()->successor()));
+-    }
++    state.loop.entry->stopIns()->toLoopEntry()->setIsBrokenLoop();
+ 
+     // If the loop started with a condition (while/for) then even if the
+     // structure never actually loops, the condition itself can still fail and
+     // thus we must resume at the successor, if one exists.
+     current = state.loop.successor;
+     if (current) {
+         if (!addBlock(current))
+             return ControlStatus::Error;
+diff --git a/js/src/jit/IonControlFlow.h b/js/src/jit/IonControlFlow.h
+--- a/js/src/jit/IonControlFlow.h
++++ b/js/src/jit/IonControlFlow.h
+@@ -546,66 +546,75 @@ class CFGBackEdge : public CFGUnaryContr
+  *
+  * JMP block
+  *
+  */
+ class CFGLoopEntry : public CFGUnaryControlInstruction
+ {
+     bool canOsr_;
+     bool isForIn_;
++    bool isBrokenLoop_;
+     size_t stackPhiCount_;
+     jsbytecode* loopStopPc_;
+ 
+     CFGLoopEntry(CFGBlock* block, size_t stackPhiCount)
+       : CFGUnaryControlInstruction(block),
+         canOsr_(false),
+         isForIn_(false),
++        isBrokenLoop_(false),
+         stackPhiCount_(stackPhiCount),
+         loopStopPc_(nullptr)
+     {}
+ 
+-    CFGLoopEntry(CFGBlock* block, bool canOsr, bool isForIn, size_t stackPhiCount,
+-                 jsbytecode* loopStopPc)
++    CFGLoopEntry(CFGBlock* block, bool canOsr, bool isForIn, bool isBrokenLoop,
++                 size_t stackPhiCount, jsbytecode* loopStopPc)
+       : CFGUnaryControlInstruction(block),
+         canOsr_(canOsr),
+         isForIn_(isForIn),
++        isBrokenLoop_(isBrokenLoop),
+         stackPhiCount_(stackPhiCount),
+         loopStopPc_(loopStopPc)
+     {}
+ 
+   public:
+     CFG_CONTROL_HEADER(LoopEntry);
+     TRIVIAL_CFG_NEW_WRAPPERS
+ 
+     static CFGLoopEntry* CopyWithNewTargets(TempAllocator& alloc, CFGLoopEntry* old,
+                                             CFGBlock* loopEntry)
+     {
+-        return new(alloc) CFGLoopEntry(loopEntry, old->canOsr(), old->isForIn(),
+-                                       old->stackPhiCount(), old->loopStopPc());
++      return new (alloc) CFGLoopEntry(loopEntry, old->canOsr(), old->isForIn(),
++                                      old->isBrokenLoop(), old->stackPhiCount(),
++                                      old->maybeLoopStopPc());
+     }
+ 
+     void setCanOsr() {
+         canOsr_ = true;
+     }
+ 
++    bool isBrokenLoop() const { return isBrokenLoop_; }
++    void setIsBrokenLoop() { isBrokenLoop_ = true; }
++
+     bool canOsr() const {
+         return canOsr_;
+     }
+ 
+     void setIsForIn() {
+         isForIn_ = true;
+     }
+     bool isForIn() const {
+         return isForIn_;
+     }
+ 
+     size_t stackPhiCount() const {
+         return stackPhiCount_;
+     }
+ 
++    jsbytecode* maybeLoopStopPc() const { return loopStopPc_; }
++
+     jsbytecode* loopStopPc() const {
+         MOZ_ASSERT(loopStopPc_);
+         return loopStopPc_;
+     }
+ 
+     void setLoopStopPc(jsbytecode* loopStopPc) {
+         loopStopPc_ = loopStopPc;
+     }

+ 10 - 10
frg/work-js/mozilla-release/patches/1559975-10-70a1.patch

@@ -2,7 +2,7 @@
 # User Edwin Gao <egao@mozilla.com>
 # Date 1562337295 0
 # Node ID d0dda220d0d270babd2026b7f88ebd368fef4fa1
-# Parent  2f25f3ab7ea9d5b92963ccb5d70700ee07fa82ef
+# Parent  0575d90d2975225cd9a752630b8c1b1891346220
 Bug 1559975 - Fix python3 lint issues on js/src, r=ahal
 
 Differential Revision: https://phabricator.services.mozilla.com/D35243
@@ -10,7 +10,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D35243
 diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automation/autospider.py
 --- a/js/src/devtools/automation/autospider.py
 +++ b/js/src/devtools/automation/autospider.py
-@@ -344,17 +344,17 @@ def need_updating_configure(configure):
+@@ -361,17 +361,17 @@ def need_updating_configure(configure):
  if not args.nobuild:
      CONFIGURE_ARGS += ' --enable-nspr-build'
      CONFIGURE_ARGS += ' --prefix={OBJDIR}/dist'.format(OBJDIR=POBJDIR)
@@ -32,8 +32,8 @@ diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automati
 diff --git a/js/src/frontend/GenerateReservedWords.py b/js/src/frontend/GenerateReservedWords.py
 --- a/js/src/frontend/GenerateReservedWords.py
 +++ b/js/src/frontend/GenerateReservedWords.py
-@@ -75,17 +75,17 @@ def split_list_per_column(reserved_word_
-     assert(len(reserved_word_list) != 0);
+@@ -82,17 +82,17 @@ def split_list_per_column(reserved_word_
+     assert(len(reserved_word_list) != 0)
  
      column_dict = {}
      for item in reserved_word_list:
@@ -44,15 +44,15 @@ diff --git a/js/src/frontend/GenerateReservedWords.py b/js/src/frontend/Generate
 -    return sorted(column_dict.items(), key=lambda (char, word): ord(char))
 +    return sorted(column_dict.items())
  
+ 
  def generate_letter_switch(opt, unprocessed_columns, reserved_word_list,
                             columns=None):
-     assert(len(reserved_word_list) != 0);
+     assert(len(reserved_word_list) != 0)
  
      if not columns:
          columns = range(0, unprocessed_columns)
- 
-@@ -156,17 +156,17 @@ def split_list_per_length(reserved_word_
-     assert(len(reserved_word_list) != 0);
+@@ -165,17 +165,17 @@ def split_list_per_length(reserved_word_
+     assert(len(reserved_word_list) != 0)
  
      length_dict = {}
      for item in reserved_word_list:
@@ -63,13 +63,13 @@ diff --git a/js/src/frontend/GenerateReservedWords.py b/js/src/frontend/Generate
 -    return sorted(length_dict.items(), key=lambda (length, word): length)
 +    return sorted(length_dict.items())
  
+ 
  def generate_switch(opt, reserved_word_list):
-     assert(len(reserved_word_list) != 0);
+     assert(len(reserved_word_list) != 0)
  
      line(opt, '/*')
      line(opt, ' * Generating switch for the list of {} entries:'.format(len(reserved_word_list)))
      for index, word in reserved_word_list:
-         line(opt, ' * {}'.format(word))
 diff --git a/tools/lint/py3.yml b/tools/lint/py3.yml
 --- a/tools/lint/py3.yml
 +++ b/tools/lint/py3.yml

+ 38 - 35
frg/work-js/mozilla-release/patches/1563797-3-70a1.patch

@@ -2,7 +2,7 @@
 # User Andrew Halberstadt <ahalberstadt@mozilla.com>
 # Date 1562853819 0
 # Node ID 7f92f148ea546a606b4e434049ea3f4d29450b1c
-# Parent  bad333922574c6e7261f31ef33ac7d0a5df1de90
+# Parent  440fbcefc985b550165d97347ac0c00cb7b3da7f
 Bug 1563797 - Use 'backports.shutil_which' instead of 'which' across the tree r=Callek
 
 Differential Revision: https://phabricator.services.mozilla.com/D37097
@@ -10,7 +10,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D37097
 diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
 --- a/js/src/builtin/embedjs.py
 +++ b/js/src/builtin/embedjs.py
-@@ -32,21 +32,24 @@
+@@ -32,24 +32,27 @@
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  # This utility converts JS files containing self-hosted builtins into a C
@@ -21,8 +21,11 @@ diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
  from __future__ import with_statement
 +
 +import errno
- import re, sys, os, subprocess
+ import re
+ import sys
+ import os
 -import mozpack.path as mozpath
+ import subprocess
  import shlex
 -import which
 +
@@ -30,36 +33,36 @@ diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
 +import mozpack.path as mozpath
 +from mozfile import which
  
+ 
  def ToCAsciiArray(lines):
-   result = []
-   for chr in lines:
-     value = ord(chr)
-     assert value < 128
-     result.append(str(value))
-   return ", ".join(result)
-@@ -100,17 +103,21 @@ def embed(cxx, preprocessorOption, cppfl
-     'sources_name': 'compressedSources',
-     'compressed_total_length': len(compressed),
-     'raw_total_length': len(processed),
-     'namespace': namespace
-   })
- 
- def preprocess(cxx, preprocessorOption, source, args = []):
-   if (not os.path.exists(cxx[0])):
--    cxx[0] = which.which(cxx[0])
-+      binary = cxx[0]
-+      cxx[0] = which(binary)
-+      if not cxx[0]:
-+          raise OSError(errno.ENOENT, "%s not found on PATH" % binary)
+     result = []
+     for chr in lines:
+         value = ord(chr)
+         assert value < 128
+         result.append(str(value))
+@@ -108,17 +111,21 @@ def embed(cxx, preprocessorOption, cppfl
+         'compressed_total_length': len(compressed),
+         'raw_total_length': len(processed),
+         'namespace': namespace
+     })
+ 
+ 
+ def preprocess(cxx, preprocessorOption, source, args=[]):
+     if (not os.path.exists(cxx[0])):
+-        cxx[0] = which.which(cxx[0])
++        binary = cxx[0]
++        cxx[0] = which(binary)
++        if not cxx[0]:
++            raise OSError(errno.ENOENT, "%s not found on PATH" % binary)
 +
-   # Clang seems to complain and not output anything if the extension of the
-   # input is not something it recognizes, so just fake a .cpp here.
-   tmpIn = 'self-hosting-cpp-input.cpp';
-   tmpOut = 'self-hosting-preprocessed.pp';
-   outputArg = shlex.split(preprocessorOption + tmpOut)
- 
-   with open(tmpIn, 'wb') as input:
-     input.write(source)
+     # Clang seems to complain and not output anything if the extension of the
+     # input is not something it recognizes, so just fake a .cpp here.
+     tmpIn = 'self-hosting-cpp-input.cpp'
+     tmpOut = 'self-hosting-preprocessed.pp'
+     outputArg = shlex.split(preprocessorOption + tmpOut)
+ 
+     with open(tmpIn, 'wb') as input:
+         input.write(source)
 diff --git a/python/mozboot/mozboot/mach_commands.py b/python/mozboot/mozboot/mach_commands.py
 --- a/python/mozboot/mozboot/mach_commands.py
 +++ b/python/mozboot/mozboot/mach_commands.py
@@ -79,7 +82,7 @@ diff --git a/python/mozboot/mozboot/mach_commands.py b/python/mozboot/mozboot/ma
      Command,
  )
  
-@@ -57,33 +58,34 @@ class VersionControlCommands(object):
+@@ -62,33 +63,34 @@ class VersionControlCommands(object):
  
          User choice is respected: no changes are made without explicit
          confirmation from you.
@@ -144,7 +147,7 @@ diff --git a/testing/mach_commands.py b/testing/mach_commands.py
  import subprocess
  import shutil
  
-@@ -567,19 +568,18 @@ class TestInfoCommand(MachCommandBase):
+@@ -562,19 +563,18 @@ class TestInfoCommand(MachCommandBase):
                       help='Retrieve and display ActiveData test result summary.')
      @CommandArgument('--show-durations', action='store_true',
                       help='Retrieve and display ActiveData test duration summary.')
@@ -165,7 +168,7 @@ diff --git a/testing/mach_commands.py b/testing/mach_commands.py
          self.show_results = params['show_results']
          self.show_durations = params['show_durations']
          self.show_bugs = params['show_bugs']
-@@ -595,27 +595,25 @@ class TestInfoCommand(MachCommandBase):
+@@ -590,27 +590,25 @@ class TestInfoCommand(MachCommandBase):
              self.show_durations = True
              self.show_bugs = True
  
@@ -428,7 +431,7 @@ diff --git a/tools/lint/spell/__init__.py b/tools/lint/spell/__init__.py
  CODESPELL_REQUIREMENTS_PATH = os.path.join(here, 'codespell_requirements.txt')
  
  CODESPELL_NOT_FOUND = """
-@@ -87,20 +87,17 @@ def get_codespell_binary():
+@@ -85,20 +85,17 @@ def get_codespell_binary():
      """
      Returns the path of the first codespell binary available
      if not found returns None

+ 16 - 16
frg/work-js/mozilla-release/patches/1566141-1-72a1.patch

@@ -3,7 +3,7 @@
 # Date 1572542191 0
 #      Thu Oct 31 17:16:31 2019 +0000
 # Node ID 28aa763e7834023b28c2462a078f1bd91baa7f7b
-# Parent  875e9d2578c9c3fb037b878a052543b1a4666572
+# Parent  0294de7f995a812f331643b5e2afbe88cdb353b5
 Bug 1566141 - Nullish coalesce operator tokens r=jorendorff
 
 Fake it till you make it
@@ -13,7 +13,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D50056
 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
-@@ -2486,17 +2486,18 @@ ASTSerializer::classMethod(ParseNode* pn
+@@ -2485,17 +2485,18 @@ ASTSerializer::classMethod(ParseNode* pn
  
  bool
  ASTSerializer::leftAssociate(ParseNode* pn, MutableHandleValue dst)
@@ -54,7 +54,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  using mozilla::NumberIsInt32;
  using mozilla::PodCopy;
  using mozilla::Some;
-@@ -3425,16 +3426,17 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3600,16 +3601,17 @@ BytecodeEmitter::checkSideEffects(ParseN
        case ParseNodeKind::SetThis:
          MOZ_ASSERT(pn->isArity(PN_BINARY));
          *answer = true;
@@ -72,7 +72,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
        case ParseNodeKind::Comma:
          MOZ_ASSERT(pn->pn_count > 0);
          MOZ_FALLTHROUGH;
-@@ -9506,20 +9508,25 @@ BytecodeEmitter::emitCallOrNew(ParseNode
+@@ -9684,20 +9686,25 @@ BytecodeEmitter::emitCallOrNew(ParseNode
          uint32_t lineNum = parser->errorReporter().lineAt(pn->pn_pos.begin);
          if (!emitUint32Operand(JSOP_LINENO, lineNum))
              return false;
@@ -98,7 +98,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      JSOP_STRICTEQ,
      JSOP_EQ,
      JSOP_STRICTNE,
-@@ -9536,22 +9543,27 @@ static const JSOp ParseNodeKindToJSOp[] 
+@@ -9714,22 +9721,27 @@ static const JSOp ParseNodeKindToJSOp[] 
      JSOP_ADD,
      JSOP_SUB,
      JSOP_MUL,
@@ -132,7 +132,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      // ** is the only right-associative operator.
      MOZ_ASSERT(pn->isKind(ParseNodeKind::Pow));
      MOZ_ASSERT(pn->isArity(PN_LIST));
-@@ -9586,17 +9598,19 @@ BytecodeEmitter::emitLeftAssociative(Par
+@@ -9764,17 +9776,19 @@ BytecodeEmitter::emitLeftAssociative(Par
      } while ((nextExpr = nextExpr->pn_next));
      return true;
  }
@@ -153,7 +153,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
       * The jump goes around the right operand evaluation.
       *
       * JSOP_AND converts the operand on the stack to boolean and jumps if false;
-@@ -9604,17 +9618,20 @@ BytecodeEmitter::emitLogical(ParseNode* 
+@@ -9782,17 +9796,20 @@ BytecodeEmitter::emitLogical(ParseNode* 
       */
  
      TDZCheckCache tdzCache(this);
@@ -175,7 +175,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  
      /* Emit nodes between the head and the tail. */
      while ((pn2 = pn2->pn_next)->pn_next) {
-@@ -10866,16 +10883,17 @@ BytecodeEmitter::emitTree(ParseNode* pn,
+@@ -11044,16 +11061,17 @@ BytecodeEmitter::emitTree(ParseNode* pn,
              return false;
          break;
  
@@ -307,7 +307,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
 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
-@@ -8016,43 +8016,44 @@ static ParseNodeKind
+@@ -8007,43 +8007,44 @@ static ParseNodeKind
  BinaryOpTokenKindToParseNodeKind(TokenKind tok)
  {
      MOZ_ASSERT(TokenKindIsBinaryOp(tok));
@@ -410,7 +410,7 @@ diff --git a/js/src/frontend/TokenKind.h b/js/src/frontend/TokenKind.h
 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
-@@ -1451,63 +1451,61 @@ enum FirstCharKind {
+@@ -1512,63 +1512,61 @@ enum FirstCharKind {
      String,
      EOL,
      ZeroDigit,
@@ -477,22 +477,22 @@ diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp
  
  static_assert(LastCharKind < (1 << (sizeof(firstCharKinds[0]) * 8)),
                "Elements of firstCharKinds[] are too small");
-@@ -1976,16 +1974,20 @@ TokenStreamSpecific<CharT, AnyCharsAcces
+@@ -2145,16 +2143,20 @@ TokenStreamSpecific<CharT, AnyCharsAcces
  
            case '&':
-             if (matchChar('&'))
+             if (matchCodeUnit('&'))
                  simpleKind = TokenKind::And;
              else
-                 simpleKind = matchChar('=') ? TokenKind::BitAndAssign : TokenKind::BitAnd;
+                 simpleKind = matchCodeUnit('=') ? TokenKind::BitAndAssign : TokenKind::BitAnd;
              break;
  
 +          case '?':
-+            simpleKind = matchChar('?') ? TokenKind::Coalesce : TokenKind::Hook;
++            simpleKind = matchCodeUnit('?') ? TokenKind::Coalesce : TokenKind::Hook;
 +            break;
 +
            case '!':
-             if (matchChar('='))
-                 simpleKind = matchChar('=') ? TokenKind::StrictNe : TokenKind::Ne;
+             if (matchCodeUnit('='))
+                 simpleKind = matchCodeUnit('=') ? TokenKind::StrictNe : TokenKind::Ne;
              else
                  simpleKind = TokenKind::Not;
              break;

+ 12 - 12
frg/work-js/mozilla-release/patches/1566141-7-72a1.patch

@@ -3,7 +3,7 @@
 # Date 1573577859 0
 #      Tue Nov 12 16:57:39 2019 +0000
 # Node ID ddc6fa7e24f2eb5e96e0e0215a943b06d4607b95
-# Parent  159aea7806d6711b63ce95a105aa51cbfa3ad4e0
+# Parent  ee12ff8df27a5bcfaffc1e725991dde00eb8afba
 Bug 1566141 - implement nullish coalescence in ion monkey r=jandem
 
 Differential Revision: https://phabricator.services.mozilla.com/D51640
@@ -11,7 +11,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D51640
 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
-@@ -12625,16 +12625,32 @@ CodeGenerator::visitIsObject(LIsObject* 
+@@ -12704,16 +12704,32 @@ CodeGenerator::visitIsObject(LIsObject* 
  
  void
  CodeGenerator::visitIsObjectAndBranch(LIsObjectAndBranch* ins)
@@ -47,7 +47,7 @@ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
 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
-@@ -1800,16 +1800,17 @@ IonBuilder::inspectOpcode(JSOp op)
+@@ -1796,16 +1796,17 @@ IonBuilder::inspectOpcode(JSOp op)
          return Ok();
  
        case JSOP_IFNE:
@@ -61,11 +61,11 @@ diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
        case JSOP_THROW:
        case JSOP_GOTO:
        case JSOP_CONDSWITCH:
-       case JSOP_LOOPENTRY:
        case JSOP_TABLESWITCH:
        case JSOP_CASE:
        case JSOP_DEFAULT:
-@@ -2955,25 +2956,35 @@ IonBuilder::jsop_dup2()
+         // Control flow opcodes should be handled in the ControlFlowGenerator.
+@@ -2952,25 +2953,35 @@ IonBuilder::jsop_dup2()
      current->pushSlot(lhsSlot);
      current->pushSlot(rhsSlot);
      return Ok();
@@ -149,7 +149,7 @@ diff --git a/js/src/jit/IonControlFlow.cpp b/js/src/jit/IonControlFlow.cpp
          return processTryEnd(state);
  
        default:
-@@ -1357,18 +1358,17 @@ ControlFlowGenerator::processCondSwitchB
+@@ -1354,18 +1355,17 @@ ControlFlowGenerator::processCondSwitchB
      if (currentIdx < bodies.length())
          state.stopAt = bodies[currentIdx]->startPc();
      else
@@ -169,7 +169,7 @@ diff --git a/js/src/jit/IonControlFlow.cpp b/js/src/jit/IonControlFlow.cpp
  
      // End the rhs.
      current->setStopIns(CFGGoto::New(alloc(), join));
-@@ -2046,21 +2046,20 @@ ControlFlowGenerator::CFGState::IfElse(j
+@@ -2043,21 +2043,20 @@ ControlFlowGenerator::CFGState::IfElse(j
                    : IF_ELSE_TRUE;
      state.stopAt = trueEnd;
      state.branch.falseEnd = falseEnd;
@@ -194,7 +194,7 @@ diff --git a/js/src/jit/IonControlFlow.cpp b/js/src/jit/IonControlFlow.cpp
  
  ControlFlowGenerator::CFGState
  ControlFlowGenerator::CFGState::TableSwitch(TempAllocator& alloc, jsbytecode* exitpc)
-@@ -2105,38 +2104,49 @@ ControlFlowGenerator::CFGState::Try(jsby
+@@ -2102,38 +2101,49 @@ ControlFlowGenerator::CFGState::Try(jsby
  {
      CFGState state;
      state.state = TRY;
@@ -336,7 +336,7 @@ diff --git a/js/src/jit/IonControlFlow.h b/js/src/jit/IonControlFlow.h
   * POP
   * RETURN popped value
   *
-@@ -710,17 +700,17 @@ class ControlFlowGenerator
+@@ -719,17 +709,17 @@ class ControlFlowGenerator
              WHILE_LOOP_COND,    // while (x) { }
              WHILE_LOOP_BODY,    // while () { x }
              FOR_LOOP_COND,      // for (; x;) { }
@@ -355,7 +355,7 @@ diff --git a/js/src/jit/IonControlFlow.h b/js/src/jit/IonControlFlow.h
          jsbytecode* stopAt;     // Bytecode at which to stop the processing loop.
  
          // For if structures, this contains branch information.
-@@ -797,17 +787,17 @@ class ControlFlowGenerator
+@@ -806,17 +796,17 @@ class ControlFlowGenerator
                  return true;
                default:
                  return false;
@@ -374,7 +374,7 @@ diff --git a/js/src/jit/IonControlFlow.h b/js/src/jit/IonControlFlow.h
      };
  
      Vector<CFGState, 8, JitAllocPolicy> cfgStack_;
-@@ -868,18 +858,18 @@ class ControlFlowGenerator
+@@ -877,18 +867,18 @@ class ControlFlowGenerator
      ControlStatus processTableSwitch(JSOp op, jssrcnote* sn);
      ControlStatus processContinue(JSOp op);
      ControlStatus processBreak(JSOp op, jssrcnote* sn);
@@ -519,7 +519,7 @@ diff --git a/js/src/vm/BytecodeUtil-inl.h b/js/src/vm/BytecodeUtil-inl.h
 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
-@@ -682,16 +682,17 @@ BytecodeParser::simulateOp(JSOp op, uint
+@@ -683,16 +683,17 @@ BytecodeParser::simulateOp(JSOp op, uint
        case JSOP_CHECKOBJCOERCIBLE:
        case JSOP_CHECKTHIS:
        case JSOP_CHECKTHISREINIT:

+ 5 - 5
frg/work-js/mozilla-release/patches/1567642-8-71a1.patch

@@ -2,7 +2,7 @@
 # User Andrew Halberstadt <ahalberstadt@mozilla.com>
 # Date 1569336241 0
 # Node ID bb843f6f9594b817a48166e3621266d4688464dc
-# Parent  ee9b6e24417c7358f189e2a00bac570918fcbc0c
+# Parent  bb00f283d1c624d4a9f04c22d4b84dbd0e20fdc5
 Bug 1567642 - [lint.flake8] Fix misc flake8 under Python 3 lint issues r=gbrown
 
 Differential Revision: https://phabricator.services.mozilla.com/D45417
@@ -62,17 +62,17 @@ diff --git a/js/src/gdb/mozilla/JSString.py b/js/src/gdb/mozilla/JSString.py
  from mozilla.prettyprinters import ptr_pretty_printer
  
  try:
-     chr(10000) # UPPER RIGHT PENCIL
--except ValueError as exc: # yuck, we are in Python 2.x, so chr() is 8-bit
+     chr(10000)  # UPPER RIGHT PENCIL
+-except ValueError as exc:  # yuck, we are in Python 2.x, so chr() is 8-bit
 +except ValueError:  # yuck, we are in Python 2.x, so chr() is 8-bit
-     chr = unichr # replace with teh unicodes
+     chr = unichr  # replace with teh unicodes
  
  # Forget any printers from previous loads of this module.
  mozilla.prettyprinters.clear_module_printers(__name__)
  
+ 
  class JSStringTypeCache(object):
      # Cache information about the JSString type for this objfile.
-     def __init__(self, cache):
 diff --git a/python/mach_commands.py b/python/mach_commands.py
 --- a/python/mach_commands.py
 +++ b/python/mach_commands.py

+ 5 - 5
frg/work-js/mozilla-release/patches/1587206-1-71a1.patch

@@ -2,7 +2,7 @@
 # User Andrew Halberstadt <ahalberstadt@mozilla.com>
 # Date 1570733433 0
 # Node ID 2921dbcceadc9adb0f12188f62a8f86bd18b0f93
-# Parent  85f31ffaf2a9f317bd8614127fe6913ab913d461
+# Parent  a4203ca5e31455b0659cb383668833d03039d4c9
 Bug 1587206 - [lint.flake8] Enable F632 across the tree, r=sylvestre
 
 This ensures we use ==/!= to strings and ints (instead of is/is not).
@@ -34,7 +34,7 @@ diff --git a/.flake8 b/.flake8
 diff --git a/js/src/gdb/mozilla/unwind.py b/js/src/gdb/mozilla/unwind.py
 --- a/js/src/gdb/mozilla/unwind.py
 +++ b/js/src/gdb/mozilla/unwind.py
-@@ -502,17 +502,17 @@ class x64UnwinderState(UnwinderState):
+@@ -521,17 +521,17 @@ class x64UnwinderState(UnwinderState):
      def unwind_entry_frame_registers(self, sp, unwind_info):
          sp = sp.cast(self.typecache.void_starstar)
          # Skip the "result" push.
@@ -50,13 +50,13 @@ diff --git a/js/src/gdb/mozilla/unwind.py b/js/src/gdb/mozilla/unwind.py
  # The unwinder object.  This provides the "user interface" to the JIT
  # unwinder, and also handles constructing or destroying UnwinderState
  # objects as needed.
+ 
+ 
  class SpiderMonkeyUnwinder(Unwinder):
-     # A list of all the possible unwinders.  See |self.make_unwinder|.
-     UNWINDERS = [x64UnwinderState]
 diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
 --- a/js/src/tests/jstests.py
 +++ b/js/src/tests/jstests.py
-@@ -299,17 +299,17 @@ def load_tests(options, requested_paths,
+@@ -302,17 +302,17 @@ def load_tests(options, requested_paths,
  
      if options.js_shell is None:
          xul_tester = manifest.NullXULInfoTester()

+ 4 - 4
frg/work-js/mozilla-release/patches/1590907-2-72a1.patch

@@ -2,7 +2,7 @@
 # User Philip Chimento <philip.chimento@gmail.com>
 # Date 1573595948 0
 # Node ID cee3ca35e416b8de5d6698fabc7d5d8fc21690ac
-# Parent  40fbb4784292b61f0db0c880e8575be303c592d3
+# Parent  0fd3906662b77b381a84a64713ae3f5c5ca8db6e
 Bug 1590907 - Remove obsolete macro JS_OLD_GETTER_SETTER_METHODS. r=sfink
 
 This macro is never defined, and the functions that it hides are missing
@@ -28,10 +28,10 @@ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
 -#endif
 -
  extern JS_FRIEND_API(bool)
- IsSystemCompartment(JSCompartment* comp);
+ IsSystemRealm(JS::Realm* realm);
  
  extern JS_FRIEND_API(bool)
- IsSystemZone(JS::Zone* zone);
+ IsSystemCompartment(JSCompartment* comp);
  
  extern JS_FRIEND_API(bool)
- IsAtomsZone(JS::Zone* zone);
+ IsSystemZone(JS::Zone* zone);

+ 5 - 5
frg/work-js/mozilla-release/patches/1614518-6-75a1.patch

@@ -2,7 +2,7 @@
 # User Steve Fink <sfink@mozilla.com>
 # Date 1581560724 0
 # Node ID 1d8c4130b3896bb9bb60759035995ef529484383
-# Parent  54808f272c716f0cee8155e06f1d4d1198cd12b2
+# Parent  5d075b4beefd4ed7b6985f880e259d7a91a3cec1
 Bug 1614518 - Quote shell commands properly r=ahal
 
 Differential Revision: https://phabricator.services.mozilla.com/D62386
@@ -33,13 +33,13 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
  anystring_t = str if sys.version_info[0] > 2 else basestring
  
  try:
-@@ -45,17 +46,17 @@ def fill(command, config):
-         for fragment in command:
+@@ -48,17 +49,17 @@ def fill(command, config):
              try:
                  fragment % config
              except Exception:
                  problems.append(fragment)
-         raise Exception("\n".join(["Substitution failed:"] + [ "  %s" % s for s in problems ]))
+         raise Exception("\n".join(["Substitution failed:"] + ["  %s" % s for s in problems]))
+ 
  
  def print_command(command, outfile=None, env=None):
 -    output = ' '.join(command)
@@ -49,6 +49,6 @@ diff --git a/js/src/devtools/rootAnalysis/analyze.py b/js/src/devtools/rootAnaly
      if env:
          changed = {}
          e = os.environ
-         for key,value in env.items():
+         for key, value in env.items():
              if (key not in e) or (e[key] != value):
                  changed[key] = value

+ 54 - 52
frg/work-js/mozilla-release/patches/1618620-5-75a1.patch

@@ -2,7 +2,7 @@
 # User Mike Shal <mshal@mozilla.com>
 # Date 1582849706 0
 # Node ID 4568949079a59fe26a56a63475ebc4d22f91d42c
-# Parent  c3ad8590c2657ee4c7f489a5f01a76ea68a2ea3e
+# Parent  371ba7e48df501dc4822712b193f888c07ef2e0e
 Bug 1618620 - Convert embedjs.py to py3; r=firefox-build-system-reviewers,rstewart
 
 Differential Revision: https://phabricator.services.mozilla.com/D64623
@@ -10,10 +10,10 @@ Differential Revision: https://phabricator.services.mozilla.com/D64623
 diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
 --- a/js/src/builtin/embedjs.py
 +++ b/js/src/builtin/embedjs.py
-@@ -40,29 +40,30 @@ from __future__ import with_statement
- 
- import errno
- import re, sys, os, subprocess
+@@ -43,31 +43,32 @@ import re
+ import sys
+ import os
+ import subprocess
  import shlex
  
  import buildconfig
@@ -21,62 +21,64 @@ diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
  from mozfile import which
 +from mozbuild.util import ensure_bytes
  
+ 
  def ToCAsciiArray(lines):
-   result = []
-   for chr in lines:
-     value = ord(chr)
-     assert value < 128
-     result.append(str(value))
-   return ", ".join(result)
+     result = []
+     for chr in lines:
+         value = ord(chr)
+         assert value < 128
+         result.append(str(value))
+     return ", ".join(result)
+ 
  
  def ToCArray(lines):
-   result = []
-   for chr in lines:
--    result.append(str(ord(chr)))
-+      result.append(str(chr))
-   return ", ".join(result)
+     result = []
+     for chr in lines:
+-        result.append(str(ord(chr)))
++        result.append(str(chr))
+     return ", ".join(result)
+ 
  
  HEADER_TEMPLATE = """\
  /* 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/. */
  
- namespace js {
-@@ -90,17 +91,17 @@ def embed(cxx, preprocessorOption, cppfl
-                                         for source in sources])
-   args = cppflags + ['-D%(k)s=%(v)s' % { 'k': k, 'v': env[k] } for k in env]
-   preprocessed = preprocess(cxx, preprocessorOption, combinedSources, args)
-   processed = '\n'.join([line for line in preprocessed.splitlines() if \
-                          (line.strip() and not line.startswith('#'))])
+@@ -97,17 +98,17 @@ def embed(cxx, preprocessorOption, cppfl
+                                           for source in sources])
+     args = cppflags + ['-D%(k)s=%(v)s' % {'k': k, 'v': env[k]} for k in env]
+     preprocessed = preprocess(cxx, preprocessorOption, combinedSources, args)
+     processed = '\n'.join([line for line in preprocessed.splitlines() if
+                            (line.strip() and not line.startswith('#'))])
  
-   js_out.write(processed)
-   import zlib
--  compressed = zlib.compress(processed)
-+  compressed = zlib.compress(ensure_bytes(processed))
-   data = ToCArray(compressed)
-   c_out.write(HEADER_TEMPLATE % {
-     'sources_type': 'unsigned char',
-     'sources_data': data,
-     'sources_name': 'compressedSources',
-     'compressed_total_length': len(compressed),
-     'raw_total_length': len(processed),
-     'namespace': namespace
-@@ -115,17 +116,17 @@ def preprocess(cxx, preprocessorOption, 
+     js_out.write(processed)
+     import zlib
+-    compressed = zlib.compress(processed)
++    compressed = zlib.compress(ensure_bytes(processed))
+     data = ToCArray(compressed)
+     c_out.write(HEADER_TEMPLATE % {
+         'sources_type': 'unsigned char',
+         'sources_data': data,
+         'sources_name': 'compressedSources',
+         'compressed_total_length': len(compressed),
+         'raw_total_length': len(processed),
+         'namespace': namespace
+@@ -123,17 +124,17 @@ def preprocess(cxx, preprocessorOption, 
  
-   # Clang seems to complain and not output anything if the extension of the
-   # input is not something it recognizes, so just fake a .cpp here.
-   tmpIn = 'self-hosting-cpp-input.cpp';
-   tmpOut = 'self-hosting-preprocessed.pp';
-   outputArg = shlex.split(preprocessorOption + tmpOut)
+     # Clang seems to complain and not output anything if the extension of the
+     # input is not something it recognizes, so just fake a .cpp here.
+     tmpIn = 'self-hosting-cpp-input.cpp'
+     tmpOut = 'self-hosting-preprocessed.pp'
+     outputArg = shlex.split(preprocessorOption + tmpOut)
  
-   with open(tmpIn, 'wb') as input:
--    input.write(source)
-+    input.write(ensure_bytes(source))
-   print(' '.join(cxx + outputArg + args + [tmpIn]))
-   result = subprocess.Popen(cxx + outputArg + args + [tmpIn]).wait()
-   if (result != 0):
-     sys.exit(result);
-   with open(tmpOut, 'r') as output:
-     processed = output.read();
-   os.remove(tmpIn)
-   os.remove(tmpOut)
+     with open(tmpIn, 'wb') as input:
+-        input.write(source)
++        input.write(ensure_bytes(source))
+     print(' '.join(cxx + outputArg + args + [tmpIn]))
+     result = subprocess.Popen(cxx + outputArg + args + [tmpIn]).wait()
+     if (result != 0):
+         sys.exit(result)
+     with open(tmpOut, 'r') as output:
+         processed = output.read()
+     os.remove(tmpIn)
+     os.remove(tmpOut)

+ 6 - 6
frg/work-js/mozilla-release/patches/1618620-9-75a1.patch

@@ -2,7 +2,7 @@
 # User Mike Shal <mshal@mozilla.com>
 # Date 1582849726 0
 # Node ID f6830de40a956cba81268c05ebdf9a79470b7b82
-# Parent  a84ec2cad8ec1fc149ed49b1ff58fb6433c4e6de
+# Parent  374a84b292b60eecd3cc742e193f69bf4b729171
 Bug 1618620 - Convert GenerateStatsPhases.py to py3; r=firefox-build-system-reviewers,rstewart
 
 Differential Revision: https://phabricator.services.mozilla.com/D64627
@@ -10,22 +10,22 @@ Differential Revision: https://phabricator.services.mozilla.com/D64627
 diff --git a/js/src/gc/GenerateStatsPhases.py b/js/src/gc/GenerateStatsPhases.py
 --- a/js/src/gc/GenerateStatsPhases.py
 +++ b/js/src/gc/GenerateStatsPhases.py
-@@ -253,17 +253,17 @@ MaxPhaseNesting = max(phase.depth for ph
+@@ -260,17 +260,17 @@ MaxPhaseNesting = max(phase.depth for ph
  
- # Generate code.
  
  def writeList(out, items):
      if items:
          out.write(",\n".join("  " + item for item in items) + "\n")
  
+ 
  def writeEnumClass(out, name, type, items, extraItems):
--    items = [ "FIRST" ] + items + [ "LIMIT" ] + extraItems
+-    items = ["FIRST"] + items + ["LIMIT"] + extraItems
 +    items = ["FIRST"] + list(items) + ["LIMIT"] + list(extraItems)
      items[1] += " = " + items[0]
-     out.write("enum class %s : %s {\n" % (name, type));
+     out.write("enum class %s : %s {\n" % (name, type))
      writeList(out, items)
      out.write("};\n")
  
+ 
  def generateHeader(out):
      #
-     # Generate PhaseKind enum.

+ 45 - 46
frg/work-js/mozilla-release/patches/1619475-1-75a1.patch

@@ -2,7 +2,7 @@
 # User Steve Fink <sfink@mozilla.com>
 # Date 1583518058 0
 # Node ID c753faaef709238ccb8ce33e9f4830a4acb8f6b7
-# Parent  7319881f6e05a562a88edb94d9c8adc3e7fb9436
+# Parent  6b4dec9c294c992bbad2b1e9438caafd71e5f7af
 Bug 1619475 - partial Python 3 compatibility for jit-tests and jstests r=arai
 
 This fixes all of the jit-test problems I encountered, and fixes all but the wpt portion of jstests. This is unnecessary, but it also ports jstests from optparse to argparse (because optparse is deprecated, because I like argparse better, and because it happened to fix the minor compatibility issue I ran into even though it has a trivial fix on its own.)
@@ -12,14 +12,14 @@ Differential Revision: https://phabricator.services.mozilla.com/D65047
 diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
 --- a/js/src/jit-test/jit_test.py
 +++ b/js/src/jit-test/jit_test.py
-@@ -2,28 +2,32 @@
- # 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/.
- 
- from __future__ import print_function, unicode_literals
+@@ -11,29 +11,34 @@ import platform
+ import posixpath
+ import shlex
+ import shutil
+ import subprocess
+ import sys
+ import traceback
  
- import math, os, platform, posixpath, shlex, shutil, subprocess, sys, traceback
  
 -def add_libdir_to_path():
 +def add_tests_dir_to_path():
@@ -29,14 +29,14 @@ diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
 -    sys.path.insert(0, join(js_src_dir, 'lib'))
 -    sys.path.insert(0, join(js_src_dir, 'tests', 'lib'))
 +    sys.path.insert(0, join(js_src_dir, 'tests'))
-+
-+add_tests_dir_to_path()
+ 
  
 -add_libdir_to_path()
--
++add_tests_dir_to_path()
+ 
 -import jittests
 -from tests import get_jitflags, valid_jitflags, get_cpu_count, get_environment_overlay, \
--                  change_env
+-    change_env
 +from lib import jittests
 +from lib.tests import (
 +    get_jitflags,
@@ -45,20 +45,21 @@ diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
 +    get_environment_overlay,
 +    change_env,
 +)
++
  
  # Python 3.3 added shutil.which, but we can't use that yet.
+ 
+ 
  def which(name):
      if name.find(os.path.sep) != -1:
          return os.path.abspath(name)
  
-     for path in os.environ["PATH"].split(os.pathsep):
-         full = os.path.join(path, name)
-@@ -50,131 +54,142 @@ def choose_item(jobs, max_items, display
-     except ValueError:
+@@ -64,131 +69,142 @@ def choose_item(jobs, max_items, display
          raise Exception('Unrecognized input')
  
      return jobs[item - 1]
  
+ 
  def main(argv):
      # The [TESTS] optional arguments are paths of test files relative
      # to the jit-test/tests directory.
@@ -308,7 +309,7 @@ diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
          if (platform.system() != 'Windows' or
              os.path.isfile(js_shell) or not
              os.path.isfile(js_shell + ".exe") or not
-             os.access(js_shell + ".exe", os.X_OK)):
+                 os.access(js_shell + ".exe", os.X_OK)):
              op.error('shell is not executable: ' + js_shell)
 diff --git a/js/src/jit-test/tests/basic/bug1033946.js b/js/src/jit-test/tests/basic/bug1033946.js
 --- a/js/src/jit-test/tests/basic/bug1033946.js
@@ -320,10 +321,10 @@ diff --git a/js/src/jit-test/tests/basic/bug1033946.js b/js/src/jit-test/tests/b
 diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
 --- a/js/src/tests/lib/jittests.py
 +++ b/js/src/tests/lib/jittests.py
-@@ -8,23 +8,23 @@
- 
- from __future__ import print_function
- import os, posixpath, sys, traceback
+@@ -11,23 +11,23 @@ import os
+ import posixpath
+ import sys
+ import traceback
  import subprocess
  from collections import namedtuple
  from datetime import datetime
@@ -349,15 +350,15 @@ diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
  LIB_DIR = os.path.join(JS_DIR, 'jit-test', 'lib') + os.path.sep
  MODULE_DIR = os.path.join(JS_DIR, 'jit-test', 'modules') + os.path.sep
  JS_CACHE_DIR = os.path.join(JS_DIR, 'jit-test', '.js-cache')
-@@ -178,27 +178,28 @@ class JitTest:
+@@ -187,27 +187,28 @@ class JitTest:
+         # test_join.  This will multiply the number of variants by 2 for set of
          # options.
          for join_opts in self.test_join:
-             variants = variants + [ opts + join_opts for opts in variants ];
+             variants = variants + [opts + join_opts for opts in variants]
  
          # For each list of jit flags, make a copy of the test.
          return [self.copy_and_extend_jitflags(v) for v in variants]
  
- 
 -    COOKIE = '|jit-test|'
 +    COOKIE = b'|jit-test|'
 +
@@ -384,13 +385,13 @@ diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py
 diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
 --- a/js/src/tests/lib/manifest.py
 +++ b/js/src/tests/lib/manifest.py
-@@ -2,17 +2,17 @@
- #
- # This includes classes for representing and parsing JS manifests.
+@@ -4,17 +4,17 @@
  
  from __future__ import print_function
  
- import os, re, sys
+ import os
+ import re
+ import sys
  from subprocess import Popen, PIPE
  
 -from tests import RefTestCase
@@ -403,7 +404,7 @@ diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
      while True:
          path, tail = os.path.split(path)
          if not tail:
-@@ -94,17 +94,17 @@ class XULInfoTester:
+@@ -98,17 +98,17 @@ class XULInfoTester:
                  self.js_bin,
                  # run in safe configuration, since it is hard to debug
                  # crashes when running code here. In particular, msan will
@@ -441,13 +442,13 @@ diff --git a/js/src/tests/lib/progressbar.py b/js/src/tests/lib/progressbar.py
 -    from terminal_unix import Terminal
 +    from .terminal_unix import Terminal
  
+ 
  class NullProgressBar(object):
      def update(self, current, data): pass
+ 
      def poke(self): pass
+ 
      def finish(self, complete=True): pass
-     def beginline(self): pass
-     def message(self, msg): sys.stdout.write(msg + '\n')
-     @staticmethod
 diff --git a/js/src/tests/lib/results.py b/js/src/tests/lib/results.py
 --- a/js/src/tests/lib/results.py
 +++ b/js/src/tests/lib/results.py
@@ -463,26 +464,24 @@ diff --git a/js/src/tests/lib/results.py b/js/src/tests/lib/results.py
 +from .structuredlog import TestLogger
  
  # subprocess.list2cmdline does not properly escape for sh-like shells
+ 
+ 
  def escape_cmdline(args):
      return ' '.join([pipes.quote(a) for a in args])
  
- class TestOutput:
-     """Output from a test run."""
-     def __init__(self, test, cmd, out, err, rc, dt, timed_out, extra=None):
+ 
 diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py
 --- a/js/src/tests/lib/tasks_unix.py
 +++ b/js/src/tests/lib/tasks_unix.py
-@@ -1,16 +1,26 @@
- # A unix-oriented process dispatcher.  Uses a single thread with select and
+@@ -2,19 +2,25 @@
  # waitpid to dispatch tasks.  This avoids several deadlocks that are possible
  # with fork/exec + threads + Python.
  
--import errno, os, select, signal, sys
-+import errno
-+import os
-+import select
-+import signal
-+import sys
+ import errno
+ import os
+ import select
+ import signal
+ import sys
 +
  from datetime import datetime, timedelta
 -from progressbar import ProgressBar
@@ -495,14 +494,14 @@ diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py
 +    escape_cmdline,
 +)
  
+ 
  class Task(object):
      def __init__(self, test, prefix, pid, stdout, stderr):
          self.test = test
          self.cmd = test.get_command(prefix)
          self.pid = pid
          self.stdout = stdout
-         self.stderr = stderr
-@@ -169,18 +179,18 @@ def reap_zombies(tasks, timeout):
+@@ -181,18 +187,18 @@ def reap_zombies(tasks, timeout):
          returncode = os.WEXITSTATUS(status)
          if os.WIFSIGNALED(status):
              returncode = -os.WTERMSIG(status)
@@ -521,8 +520,8 @@ diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py
                  {'pid': ended.pid}))
      return tasks, finished
  
+ 
  def kill_undead(tasks, timeout):
-     """
 diff --git a/js/src/tests/lib/tasks_win.py b/js/src/tests/lib/tasks_win.py
 --- a/js/src/tests/lib/tasks_win.py
 +++ b/js/src/tests/lib/tasks_win.py

+ 15 - 21
frg/work-js/mozilla-release/patches/1619475-2-75a1.patch

@@ -2,7 +2,7 @@
 # User Steve Fink <sfink@mozilla.com>
 # Date 1583518630 0
 # Node ID eb037e72681e29f6bcfcd9ff59973cb050c7a323
-# Parent  18a0b64556953a7f9e7b37f489d1fcf38cb21a04
+# Parent  5b48f6aaa015dace2ba6769f03f22eb8cf17dfdb
 Bug 1619475 - also convert jstests from optparse to argparse r=arai
 
 Differential Revision: https://phabricator.services.mozilla.com/D65400
@@ -10,29 +10,25 @@ Differential Revision: https://phabricator.services.mozilla.com/D65400
 diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
 --- a/js/src/tests/jstests.py
 +++ b/js/src/tests/jstests.py
-@@ -6,17 +6,20 @@
- """
- The JS Shell Test Harness.
+@@ -8,17 +8,16 @@ The JS Shell Test Harness.
  
  See the adjacent README.txt for more details.
  """
  
  from __future__ import print_function
  
--import os, sys, textwrap, platform
-+import os
-+import sys
-+import platform
-+
+ import os
+ import sys
+-import textwrap
+ import platform
  from os.path import abspath, dirname, isfile, realpath
  from contextlib import contextmanager
  from copy import copy
  from subprocess import list2cmdline, call
  
  from lib.tests import RefTestCase, get_jitflags, get_cpu_count, \
-                       get_environment_overlay, change_env
- from lib.results import ResultsSink
-@@ -42,150 +45,148 @@ def parse_args():
+     get_environment_overlay, change_env
+@@ -82,150 +81,148 @@ def parse_args():
      """
      Parse command line arguments.
      Returns a tuple of: (options, js_shell, requested_paths, excluded_paths)
@@ -233,8 +229,8 @@ diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
 -                         const='automation',
 -                         help='Use automation-parseable output format.')
 -    output_og.add_option('--format', dest='format', default='none',
--                          type='choice', choices=['automation', 'none'],
--                          help='Output format. Either automation or none'
+-                         type='choice', choices=['automation', 'none'],
+-                         help='Output format. Either automation or none'
 -                         ' (default %default).')
 -    op.add_option_group(output_og)
 +    output_og = op.add_argument_group("Output", "Modify the harness and tests output.")
@@ -310,18 +306,17 @@ diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py
 diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
 --- a/js/src/tests/lib/manifest.py
 +++ b/js/src/tests/lib/manifest.py
-@@ -1,15 +1,18 @@
+@@ -1,16 +1,17 @@
  # Library for JSTest manifests.
  #
  # This includes classes for representing and parsing JS manifests.
  
  from __future__ import print_function
  
--import os, re, sys
-+import os
-+import re
+ import os
+ import re
 +import six
-+import sys
+ import sys
  from subprocess import Popen, PIPE
  
  from .tests import RefTestCase
@@ -329,8 +324,7 @@ diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
  
  def split_path_into_dirs(path):
      dirs = [path]
- 
-@@ -218,17 +221,17 @@ def _emit_manifest_at(location, relative
+@@ -228,17 +229,17 @@ def _emit_manifest_at(location, relative
      test_gen  - (str): generator of all test paths and directorys
      depth     - int: number of dirs we are below the topmost manifest dir
      """

+ 7 - 7
frg/work-js/mozilla-release/patches/1632916-78a1.patch

@@ -2,7 +2,7 @@
 # User Ricky Stewart <rstewart@mozilla.com>
 # Date 1588710732 0
 # Node ID b79ab69854b0d71c1f5dddc88b0ec12d9da40d8d
-# Parent  39088a1deb839c57d2710837905b166cf8107fa7
+# Parent  b48a2237d65ddf3fa50d15350de25d1d362be1f3
 Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium
 
 Differential Revision: https://phabricator.services.mozilla.com/D72478
@@ -604,7 +604,7 @@ diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
  
  from .tests import RefTestCase
  
-@@ -64,17 +65,17 @@ class XULInfo:
+@@ -65,17 +66,17 @@ class XULInfo:
          if path is None:
              print("Can't find config/autoconf.mk on a directory containing"
                    " the JS shell (searched from {})".format(jsdir))
@@ -623,7 +623,7 @@ diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
                      kw['abi'] = val
                  if key == 'OS_TARGET':
                      kw['os'] = val
-@@ -243,17 +244,17 @@ def _emit_manifest_at(location, relative
+@@ -252,17 +253,17 @@ def _emit_manifest_at(location, relative
      # Always present our manifest in sorted order.
      manifest.sort()
  
@@ -639,13 +639,13 @@ diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
      finally:
          fp.close()
  
+ 
  def make_manifests(location, test_gen):
      _emit_manifest_at(location, '', test_gen, 0)
- 
-@@ -278,17 +279,17 @@ def _append_terms_and_comment(testcase, 
-     elif comment:
+@@ -292,17 +293,17 @@ def _append_terms_and_comment(testcase, 
          testcase.comment += "; " + comment
  
+ 
  def _parse_test_header(fullpath, testcase, xul_tester):
      """
      This looks a bit weird.  The reason is that it needs to be efficient, since
@@ -661,7 +661,7 @@ diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
      # Bail early if we do not start with a single comment.
      if not buf.startswith("//"):
          return
-@@ -311,17 +312,17 @@ def _parse_external_manifest(filename, r
+@@ -326,17 +327,17 @@ def _parse_external_manifest(filename, r
      Reads an external manifest file for test suites whose individual test cases
      can't be decorated with reftest comments.
      filename - str: name of the manifest file

+ 2 - 20
frg/work-js/mozilla-release/patches/1711872-91a1.patch

@@ -2,7 +2,7 @@
 # User Yulia Startsev <ystartsev@mozilla.com>
 # Date 1623167189 0
 # Node ID 9c839a5373102ca45f10f96ceec060ba84dff49b
-# Parent  e13205f0cf419d8fdf716461b3bca1c8cf8b843b
+# Parent  3c0f7a6d02fe8ba71ad2a52ee73da21afc05ef7e
 Bug 1711872 - Implement Object.hasOwn proposal; r=evilpie
 
 Differential Revision: https://phabricator.services.mozilla.com/D115483
@@ -55,25 +55,7 @@ diff --git a/js/src/builtin/Object.js b/js/src/builtin/Object.js
 diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
 --- a/js/src/tests/jstests.list
 +++ b/js/src/tests/jstests.list
-@@ -41,17 +41,16 @@ skip-if(!this.hasOwnProperty("Intl")) in
- # Skip built-ins/Simd tests when SIMD isn't available.
- skip-if(!this.hasOwnProperty("SIMD")) include test262/built-ins/Simd/jstests.list
- 
- # https://bugzilla.mozilla.org/show_bug.cgi?id=1415303
- skip-if(!this.hasOwnProperty("SharedArrayBuffer")) script non262/SIMD/load-sab-buffer-compat.js
- skip-if(!this.hasOwnProperty("Atomics")) include test262/built-ins/Atomics/jstests.list
- skip-if(!this.hasOwnProperty("SharedArrayBuffer")) include test262/built-ins/SharedArrayBuffer/jstests.list
- 
--
- #####################################
- # Test262 tests disabled on browser #
- #####################################
- 
- # Defines a non-configurable property on the WindowProxy object.
- skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-global-update.js
- skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-global-update.js
- skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-global-update.js
-@@ -488,8 +487,9 @@ random script test262/built-ins/Atomics/
+@@ -482,8 +482,9 @@ random script test262/built-ins/Atomics/
  random script test262/built-ins/Atomics/wake/wake-all.js
  random script test262/built-ins/Atomics/wake/wake-in-order.js
  

+ 29 - 0
frg/work-js/mozilla-release/patches/NOBUG-20170801-promisehelper-57a1.patch

@@ -0,0 +1,29 @@
+# HG changeset patch
+# User Shu-yu Guo <shu@rfrn.org>
+# Date 1501629591 25200
+# Node ID 15744cd370e0e274244681121836ba2dbac1526f
+# Parent  727ed3b85a4829280d80dfcb7bea7af14f23c5ab
+No bug - PromiseHelper.js -> promiseHelper.js due to rename in test262-update.py (r=me)
+
+diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py
+--- a/js/src/tests/test262-update.py
++++ b/js/src/tests/test262-update.py
+@@ -322,17 +322,17 @@ def process_test262(test262Dir, test262O
+     writeShellAndBrowserFiles(test262OutDir, harnessDir, includesMap, localIncludesMap, "")
+ 
+     # Additional explicit includes inserted at well-chosen locations to reduce
+     # code duplication in shell.js files.
+     explicitIncludes = {}
+     explicitIncludes[os.path.join("built-ins", "Atomics")] = ["testAtomics.js",
+         "testTypedArray.js"]
+     explicitIncludes[os.path.join("built-ins", "DataView")] = ["byteConversionValues.js"]
+-    explicitIncludes[os.path.join("built-ins", "Promise")] = ["PromiseHelper.js"]
++    explicitIncludes[os.path.join("built-ins", "Promise")] = ["promiseHelper.js"]
+     explicitIncludes[os.path.join("built-ins", "TypedArray")] = ["byteConversionValues.js",
+         "detachArrayBuffer.js", "nans.js"]
+     explicitIncludes[os.path.join("built-ins", "TypedArrays")] = ["detachArrayBuffer.js"]
+ 
+     # Process all test directories recursively.
+     for (dirPath, dirNames, fileNames) in os.walk(testDir):
+         relPath = os.path.relpath(dirPath, testDir)
+         if relPath == ".":

+ 58 - 59
frg/work-js/mozilla-release/patches/TOP-1378808-optchain-63a1-25313.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1649886657 -7200
-# Parent  a172a95aba2b752161964f848c75ec4716eb8969
+# Parent  565f6c571105c0398fa19cd402e653723bf8eb64
 Bug 1378808 - Optional chaining prerequsites.
 
 Backport of Mozilla's bug 1378808 and others, mostly to prepare code for
@@ -13,7 +13,7 @@ backporting of optional chaining support.
 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
-@@ -2727,34 +2727,35 @@ ASTSerializer::expression(ParseNode* pn,
+@@ -2721,34 +2721,35 @@ ASTSerializer::expression(ParseNode* pn,
                 builder.unaryExpression(op, expr, &pn->pn_pos, dst);
        }
  
@@ -56,7 +56,7 @@ diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp
              args.infallibleAppend(arg);
          }
  
-@@ -2765,27 +2766,27 @@ ASTSerializer::expression(ParseNode* pn,
+@@ -2759,27 +2760,27 @@ ASTSerializer::expression(ParseNode* pn,
          return pn->isKind(ParseNodeKind::New)
                 ? builder.newExpression(callee, args, &pn->pn_pos, dst)
  
@@ -91,7 +91,7 @@ diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp
 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
-@@ -3330,17 +3330,17 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3483,17 +3483,17 @@ BytecodeEmitter::checkSideEffects(ParseN
        case ParseNodeKind::Continue:
        case ParseNodeKind::Debugger:
          MOZ_ASSERT(pn->isArity(PN_NULLARY));
@@ -110,7 +110,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
        case ParseNodeKind::Void:
        case ParseNodeKind::Not:
          MOZ_ASSERT(pn->isArity(PN_UNARY));
-@@ -3569,16 +3569,24 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3722,16 +3722,24 @@ BytecodeEmitter::checkSideEffects(ParseN
              goto restart;
          return true;
  
@@ -135,7 +135,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
          MOZ_ASSERT(pn->isArity(PN_LIST));
          MOZ_ASSERT(pn->pn_count >= 2);
          *answer = true;
-@@ -3703,16 +3711,17 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3856,16 +3864,17 @@ BytecodeEmitter::checkSideEffects(ParseN
        case ParseNodeKind::ImportSpecList:   // byParseNodeKind::Import
        case ParseNodeKind::ImportSpec:       // byParseNodeKind::Import
        case ParseNodeKind::ExportBatchSpec:  // byParseNodeKind::Export
@@ -153,7 +153,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  
      MOZ_CRASH("invalid, unenumerated ParseNodeKind value encountered in "
                "BytecodeEmitter::checkSideEffects");
-@@ -4144,49 +4153,49 @@ BytecodeEmitter::emitTDZCheckIfNeeded(JS
+@@ -4297,49 +4306,49 @@ BytecodeEmitter::emitTDZCheckIfNeeded(JS
  }
  
  bool
@@ -214,7 +214,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      // The non-optimized case.
      return emitTree(pn2);
  }
-@@ -4201,41 +4210,41 @@ BytecodeEmitter::emitSuperPropLHS(ParseN
+@@ -4354,41 +4363,41 @@ BytecodeEmitter::emitSuperPropLHS(ParseN
      if (!emit1(JSOP_SUPERBASE))
          return false;
      return true;
@@ -259,7 +259,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      return true;
  }
  
-@@ -4255,17 +4264,17 @@ BytecodeEmitter::emitPropIncDec(ParseNod
+@@ -4408,17 +4417,17 @@ BytecodeEmitter::emitPropIncDec(ParseNod
          if (!emit1(JSOP_DUP2))                      // THIS OBJ THIS OBJ
              return false;
      } else {
@@ -278,7 +278,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      if (!emit1(JSOP_ONE))                           // OBJ N? N 1
          return false;
      if (!emit1(binop))                              // OBJ N? N+1
-@@ -4281,17 +4290,17 @@ BytecodeEmitter::emitPropIncDec(ParseNod
+@@ -4434,17 +4443,17 @@ BytecodeEmitter::emitPropIncDec(ParseNod
                  return false;
              if (!emit1(JSOP_SWAP))                 // N THIS OBJ N+1
                  return false;
@@ -297,7 +297,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  }
  
  bool
-@@ -5247,17 +5256,17 @@ BytecodeEmitter::emitDestructuringLHSRef
+@@ -5356,17 +5365,17 @@ BytecodeEmitter::emitDestructuringLHSRef
  
      switch (target->getKind()) {
        case ParseNodeKind::Dot: {
@@ -316,7 +316,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  
        case ParseNodeKind::Elem: {
          if (target->as<PropertyByValue>().isSuper()) {
-@@ -5365,17 +5374,17 @@ BytecodeEmitter::emitSetOrInitializeDest
+@@ -5474,17 +5483,17 @@ BytecodeEmitter::emitSetOrInitializeDest
  
            case ParseNodeKind::Dot: {
              // The reference is already pushed by emitDestructuringLHSRef.
@@ -335,7 +335,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
              // The reference is already pushed by emitDestructuringLHSRef.
              if (target->as<PropertyByValue>().isSuper()) {
                  JSOp setOp = sc->strict() ? JSOP_STRICTSETELEM_SUPER : JSOP_SETELEM_SUPER;
-@@ -6478,21 +6487,21 @@ BytecodeEmitter::emitAssignment(ParseNod
+@@ -6586,21 +6595,21 @@ BytecodeEmitter::emitAssignment(ParseNod
  
      switch (lhs->getKind()) {
        case ParseNodeKind::Dot:
@@ -359,7 +359,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
          if (lhs->as<PropertyByValue>().isSuper()) {
              if (!emitSuperElemOperands(lhs, opt))
                  return false;
-@@ -6531,17 +6540,17 @@ BytecodeEmitter::emitAssignment(ParseNod
+@@ -6639,17 +6648,17 @@ BytecodeEmitter::emitAssignment(ParseNod
              JSOp getOp;
              if (lhs->as<PropertyAccess>().isSuper()) {
                  if (!emit1(JSOP_DUP2))
@@ -378,7 +378,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
            }
            case ParseNodeKind::Elem: {
              JSOp elemOp;
-@@ -7364,17 +7373,17 @@ BytecodeEmitter::emitForOf(ParseNode* fo
+@@ -7477,17 +7486,17 @@ BytecodeEmitter::emitForOf(ParseNode* fo
  
      ParseNode* forHeadExpr = forOfHead->pn_kid3;
  
@@ -397,7 +397,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      // distinct TDZCheckCache to evaluate since (abstractly) it runs in its own
      // LexicalEnvironment.
      if (!emitTreeInBranch(forHeadExpr))                   // ITERABLE
-@@ -9063,45 +9072,47 @@ BytecodeEmitter::emitSelfHostedCallFunct
+@@ -9175,45 +9184,47 @@ BytecodeEmitter::emitSelfHostedCallFunct
      // invokes the callee with the correct |this| object and arguments.
      // callFunction(fun, thisArg, arg0, arg1) thus becomes:
      // - emit lookup for fun
@@ -452,7 +452,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  
      ParseNode* thisOrNewTarget = funNode->pn_next;
      if (constructing) {
-@@ -9120,36 +9131,36 @@ BytecodeEmitter::emitSelfHostedCallFunct
+@@ -9232,36 +9243,36 @@ BytecodeEmitter::emitSelfHostedCallFunct
              return false;
      }
  
@@ -494,7 +494,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
          return false;
  
      ParseNode* kindNode = valNode->pn_next;
-@@ -9171,34 +9182,36 @@ BytecodeEmitter::emitSelfHostedForceInte
+@@ -9283,34 +9294,36 @@ BytecodeEmitter::emitSelfHostedForceInte
      if (!emit1(JSOP_UNDEFINED))
          return false;
      return true;
@@ -539,7 +539,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
          return false;
  
      ParseNode* valNode = idNode->pn_next;
-@@ -9209,24 +9222,24 @@ BytecodeEmitter::emitSelfHostedDefineDat
+@@ -9321,24 +9334,24 @@ BytecodeEmitter::emitSelfHostedDefineDat
      // but that's fine because the self-hosted code doesn't use the return
      // value.
      return emit1(JSOP_INITELEM);
@@ -568,7 +568,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
          return false;
  
      return emit1(JSOP_HASOWN);
-@@ -9266,21 +9279,21 @@ BytecodeEmitter::isRestParameter(ParseNo
+@@ -9378,21 +9391,21 @@ BytecodeEmitter::isRestParameter(ParseNo
  
      FunctionBox* funbox = sc->asFunctionBox();
      RootedFunction fun(cx, funbox->function());
@@ -594,7 +594,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      JSAtom* name = pn->name();
      Maybe<NameLocation> paramLoc = locationOfNameBoundInFunctionScope(name);
      if (paramLoc && lookupName(name) == *paramLoc) {
-@@ -9399,114 +9412,34 @@ BytecodeEmitter::emitPipeline(ParseNode*
+@@ -9512,114 +9525,34 @@ BytecodeEmitter::emitPipeline(ParseNode*
  
          checkTypeSet(JSOP_CALL);
      } while ((callee = callee->pn_next));
@@ -623,11 +623,10 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
 -     * will box into the global object).
 -     */
 -    uint32_t argc = pn->pn_count - 1;
--
 +BytecodeEmitter::emitArguments(ParseNode* pn, bool callop, bool spread)
 +{
 +    uint32_t argc = pn->pn_count;
-+ 
+ 
      if (argc >= ARGC_LIMIT) {
          reportError(pn, callop ? JSMSG_TOO_MANY_FUN_ARGS : JSMSG_TOO_MANY_CON_ARGS);
          return false;
@@ -705,7 +704,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
 -        ParseNode* args = pn2->pn_next;
 +        ParseNode* args = pn->pn_head;
          bool emitOptCode = (argc == 1) && isRestParameter(args->pn_kid);
-         IfThenElseEmitter ifNotOptimizable(this);
+         InternalIfEmitter ifNotOptimizable(this);
 -
          if (emitOptCode) {
              // Emit a preparation code to optimize the spread call with a rest
@@ -715,7 +714,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
              //     g(...args);
              //   }
              //
-@@ -9533,39 +9466,160 @@ BytecodeEmitter::emitCallOrNew(ParseNode
+@@ -9646,39 +9579,160 @@ BytecodeEmitter::emitCallOrNew(ParseNode
  
          if (!emitArray(args, argc))
              return false;
@@ -886,7 +885,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
          pn->isOp(JSOP_STRICTEVAL) ||
          pn->isOp(JSOP_SPREADEVAL) ||
          pn->isOp(JSOP_STRICTSPREADEVAL))
-@@ -10152,17 +10206,17 @@ BytecodeEmitter::emitArray(ParseNode* pn
+@@ -10265,17 +10319,17 @@ BytecodeEmitter::emitArray(ParseNode* pn
                  return false;
          } else {
              ParseNode* expr;
@@ -905,7 +904,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
              }
              if (!emitTree(expr))                                         // ARRAY INDEX? VALUE
                  return false;
-@@ -11188,18 +11242,19 @@ BytecodeEmitter::emitTree(ParseNode* pn,
+@@ -11306,18 +11360,19 @@ BytecodeEmitter::emitTree(ParseNode* pn,
              return false;
          break;
  
@@ -929,7 +928,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
 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
-@@ -854,16 +854,17 @@ struct MOZ_STACK_CLASS BytecodeEmitter
+@@ -849,16 +849,17 @@ struct MOZ_STACK_CLASS BytecodeEmitter
  
      MOZ_NEVER_INLINE MOZ_MUST_USE bool emitIncOrDec(ParseNode* pn);
  
@@ -971,7 +970,7 @@ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.c
        case ParseNodeKind::CallSiteObj:
        case ParseNodeKind::String:
        case ParseNodeKind::RegExp:
-@@ -1257,17 +1259,20 @@ FoldElement(JSContext* cx, ParseNode** n
+@@ -1258,17 +1260,20 @@ FoldElement(JSContext* cx, ParseNode** n
      }
  
      // If we don't have a name, we can't optimize to getprop.
@@ -993,7 +992,7 @@ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.c
      return true;
  }
  
-@@ -1413,34 +1418,51 @@ FoldAdd(JSContext* cx, ParseNode** nodeP
+@@ -1414,34 +1419,51 @@ FoldAdd(JSContext* cx, ParseNode** nodeP
      return true;
  }
  
@@ -1049,7 +1048,7 @@ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.c
      // If the last node in the list was replaced, pn_tail points into the wrong node.
      node->pn_tail = listp;
  
-@@ -1486,24 +1508,24 @@ FoldForHead(JSContext* cx, ParseNode* no
+@@ -1487,24 +1509,24 @@ FoldForHead(JSContext* cx, ParseNode* no
  
      return true;
  }
@@ -1078,7 +1077,7 @@ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.c
  static bool
  FoldName(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
  {
-@@ -1647,17 +1669,16 @@ Fold(JSContext* cx, ParseNode** pnp, Per
+@@ -1648,17 +1670,16 @@ Fold(JSContext* cx, ParseNode** pnp, Per
        case ParseNodeKind::Ne:
        case ParseNodeKind::Lt:
        case ParseNodeKind::Le:
@@ -1096,7 +1095,7 @@ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.c
        case ParseNodeKind::Var:
        case ParseNodeKind::Const:
        case ParseNodeKind::Let:
-@@ -1699,20 +1720,24 @@ Fold(JSContext* cx, ParseNode** pnp, Per
+@@ -1700,20 +1721,24 @@ Fold(JSContext* cx, ParseNode** pnp, Per
  
        case ParseNodeKind::Elem:
          return FoldElement(cx, pnp, parser);
@@ -1121,7 +1120,7 @@ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.c
        case ParseNodeKind::BitOrAssign:
        case ParseNodeKind::BitAndAssign:
        case ParseNodeKind::BitXorAssign:
-@@ -1781,16 +1806,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
+@@ -1783,16 +1808,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
  
        case ParseNodeKind::ForHead:
          return FoldForHead(cx, pn, parser);
@@ -1181,7 +1180,7 @@ diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandl
  
      ParseNode* newClass(ParseNode* name, ParseNode* heritage, ParseNode* methodBlock,
                          const TokenPos& pos)
-@@ -657,20 +661,24 @@ class FullParseHandler
+@@ -654,20 +658,24 @@ class FullParseHandler
          TokenPos pos(begin, (finallyBlock ? finallyBlock : catchScope)->pn_pos.end);
          return new_<TernaryNode>(ParseNodeKind::Try, body, catchScope, finallyBlock, pos);
      }
@@ -1208,7 +1207,7 @@ diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandl
          ParseNode* catchpn;
          if (catchName) {
              catchpn = new_<BinaryNode>(ParseNodeKind::Catch, JSOP_NOP, catchName, catchBody);
-@@ -732,23 +740,18 @@ class FullParseHandler
+@@ -729,23 +737,18 @@ class FullParseHandler
      ParseNode* newModule(const TokenPos& pos) {
          return new_<CodeNode>(ParseNodeKind::Module, JSOP_NOP, pos);
      }
@@ -1294,7 +1293,7 @@ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.c
              for (ParseNode* kid = array->pn_head; kid; kid = kid->pn_next)
                  MOZ_ASSERT(kid->isKind(ParseNodeKind::TemplateString));
              for (ParseNode* next = array->pn_next; next; next = next->pn_next) {
-@@ -691,19 +691,16 @@ class NameResolver
+@@ -692,19 +692,16 @@ class NameResolver
            case ParseNodeKind::Add:
            case ParseNodeKind::Sub:
            case ParseNodeKind::Star:
@@ -1314,7 +1313,7 @@ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.c
            case ParseNodeKind::Var:
            case ParseNodeKind::Const:
            case ParseNodeKind::Let:
-@@ -727,21 +724,42 @@ class NameResolver
+@@ -728,21 +725,42 @@ class NameResolver
            // contents with expressions interpolated into the overall literal.
            case ParseNodeKind::TemplateStringList:
              MOZ_ASSERT(cur->isArity(PN_LIST));
@@ -1358,7 +1357,7 @@ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.c
              MOZ_ASSERT(cur->isArity(PN_LIST));
  #ifdef DEBUG
              bool isImport = cur->isKind(ParseNodeKind::ImportSpecList);
-@@ -760,22 +778,22 @@ class NameResolver
+@@ -761,22 +779,22 @@ class NameResolver
                  MOZ_ASSERT(item->pn_right->isKind(ParseNodeKind::Name));
                  MOZ_ASSERT(!item->pn_right->expr());
              }
@@ -1383,7 +1382,7 @@ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.c
              if (!resolve(cur->expr(), prefix))
                  return false;
              break;
-@@ -804,16 +822,17 @@ class NameResolver
+@@ -805,16 +823,17 @@ class NameResolver
              break;
  
            // Kinds that should be handled by parent node resolution.
@@ -1511,7 +1510,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
      F(TemplateStringList) \
      F(TemplateString) \
      F(TaggedTemplate) \
-@@ -378,34 +380,35 @@ IsTypeofKind(ParseNodeKind kind)
+@@ -379,34 +381,35 @@ IsTypeofKind(ParseNodeKind kind)
   * Not,
   * BitNot
   * TypeOfName, unary    pn_kid: UNARY expr
@@ -1555,7 +1554,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
   *                          destructuring lhs
   *                          pn_left: property id, pn_right: value
   * Shorthand binary     Same fields as Colon. This is used for object
-@@ -415,30 +418,31 @@ IsTypeofKind(ParseNodeKind kind)
+@@ -416,30 +419,31 @@ IsTypeofKind(ParseNodeKind kind)
   * Name,    name        pn_atom: name, string, or object atom
   * String               pn_op: JSOP_GETNAME, JSOP_STRING, or JSOP_OBJECT
   *                          If JSOP_GETNAME, pn_op may be JSOP_*ARG or JSOP_*VAR
@@ -1590,7 +1589,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
   * InitialYield unary   pn_kid: generator object
   * Yield,       unary   pn_kid: expr or null
   * YieldStar,
-@@ -578,18 +582,17 @@ class ParseNode
+@@ -579,18 +583,17 @@ class ParseNode
          } unary;
          struct {                        /* name, labeled statement, etc. */
              union {
@@ -1665,7 +1664,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
 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
-@@ -3371,34 +3371,34 @@ GeneralParser<ParseHandler, CharT>::addE
+@@ -3369,34 +3369,34 @@ GeneralParser<ParseHandler, CharT>::addE
          return false;
      }
  
@@ -1704,7 +1703,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  GeneralParser<ParseHandler, CharT>::templateLiteral(YieldHandling yieldHandling)
  {
      Node pn = noSubstitutionUntaggedTemplate();
-@@ -8622,68 +8622,71 @@ GeneralParser<ParseHandler, CharT>::assi
+@@ -8643,68 +8643,71 @@ GeneralParser<ParseHandler, CharT>::assi
              errorAt(pc->lastAwaitOffset, JSMSG_AWAIT_IN_DEFAULT);
              return null();
          }
@@ -1791,7 +1790,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
      if (!pc->sc()->allowSuperProperty())
          return false;
  
-@@ -8719,30 +8722,37 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8740,30 +8743,37 @@ GeneralParser<ParseHandler, CharT>::memb
              // Gotten by tryNewTarget
              tt = anyChars.currentToken().type;
              Node ctorExpr = memberExpr(yieldHandling, TripledotProhibited, tt,
@@ -1838,7 +1837,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
          lhs = handler.newSuperBase(thisName, pos());
          if (!lhs)
              return null();
-@@ -8765,17 +8775,22 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8790,17 +8800,22 @@ GeneralParser<ParseHandler, CharT>::memb
              if (!tokenStream.getToken(&tt))
                  return null();
              if (TokenKindIsPossibleIdentifierName(tt)) {
@@ -1862,7 +1861,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              }
          } else if (tt == TokenKind::LeftBracket) {
              Node propExpr = expr(InAllowed, yieldHandling, TripledotProhibited);
-@@ -8801,25 +8816,26 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8826,25 +8841,26 @@ GeneralParser<ParseHandler, CharT>::memb
                      return null();
                  }
  
@@ -1894,7 +1893,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
                  Node thisName = newThisName();
                  if (!thisName)
                      return null();
-@@ -8828,23 +8844,16 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8853,23 +8869,16 @@ GeneralParser<ParseHandler, CharT>::memb
                  if (!nextMember)
                      return null();
              } else {
@@ -1918,7 +1917,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
                      if (prop == context->names().apply) {
                          op = JSOP_FUNAPPLY;
                          if (pc->isFunctionBox())
-@@ -8876,34 +8885,44 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8901,34 +8910,44 @@ 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
@@ -1971,7 +1970,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 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
-@@ -536,18 +536,22 @@ class PerHandlerParser
+@@ -562,18 +562,22 @@ class MOZ_STACK_CLASS PerHandlerParser
      // If ParseHandler is FullParseHandler:
      //   Do nothing.
      inline void clearAbortedSyntaxParse();
@@ -1996,7 +1995,7 @@ diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
  };
  
  #define ABORTED_SYNTAX_PARSE_SENTINEL reinterpret_cast<void*>(0x1)
-@@ -1125,17 +1129,17 @@ class GeneralParser
+@@ -1148,17 +1152,17 @@ class MOZ_STACK_CLASS GeneralParser
      enum FunctionBodyType { StatementListBody, ExpressionBody };
      Node functionBody(InHandling inHandling, YieldHandling yieldHandling, FunctionSyntaxKind kind,
                        FunctionBodyType type);
@@ -2043,7 +2042,7 @@ diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseH
  
      Node newNewTarget(Node newHolder, Node targetHolder) { return NodeGeneric; }
      Node newPosHolder(const TokenPos& pos) { return NodeGeneric; }
-@@ -320,18 +322,22 @@ class SyntaxParseHandler
+@@ -323,18 +325,22 @@ class SyntaxParseHandler
      }
  
      Node newThrowStatement(Node expr, const TokenPos& pos) { return NodeThrow; }
@@ -2068,7 +2067,7 @@ diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseH
      MOZ_MUST_USE bool setupCatchScope(Node letBlock, Node catchName, Node catchBody) {
          return true;
      }
-@@ -416,17 +422,17 @@ class SyntaxParseHandler
+@@ -419,17 +425,17 @@ class SyntaxParseHandler
          MOZ_ASSERT(list == NodeGeneric ||
                     list == NodeUnparenthesizedArray ||
                     list == NodeUnparenthesizedObject ||
@@ -2090,7 +2089,7 @@ diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseH
 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
-@@ -448,32 +448,31 @@ ListLength(ParseNode* pn)
+@@ -451,32 +451,31 @@ ListLength(ParseNode* pn)
      MOZ_ASSERT(pn->isArity(PN_LIST));
      return pn->pn_count;
  }
@@ -2126,7 +2125,7 @@ diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
      MOZ_ASSERT(pn->isKind(ParseNodeKind::Var) || pn->isKind(ParseNodeKind::Const));
      return ListHead(pn);
  }
-@@ -626,26 +625,26 @@ NumberNodeHasFrac(ParseNode* pn)
+@@ -629,26 +628,26 @@ NumberNodeHasFrac(ParseNode* pn)
      MOZ_ASSERT(pn->isKind(ParseNodeKind::Number));
      return pn->pn_u.number.decimalPoint == HasDecimal;
  }
@@ -2157,7 +2156,7 @@ diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
      MOZ_ASSERT(pn->isKind(ParseNodeKind::Elem));
      return BinaryLeft(pn);
  }
-@@ -3553,19 +3552,21 @@ IsArrayViewCtorName(ModuleValidator& m, 
+@@ -3556,19 +3555,21 @@ IsArrayViewCtorName(ModuleValidator& m, 
          *type = Scalar::Float64;
      } else {
          return false;
@@ -2182,7 +2181,7 @@ diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
  
      return true;
  }
-@@ -3576,17 +3577,17 @@ CheckNewArrayView(ModuleValidator& m, Pr
+@@ -3579,17 +3580,17 @@ CheckNewArrayView(ModuleValidator& m, Pr
      PropertyName* globalName = m.globalArgumentName();
      if (!globalName)
          return m.fail(newExpr, "cannot create array view without an asm.js global parameter");
@@ -2201,7 +2200,7 @@ diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
  
          if (!IsUseOfName(base, globalName))
              return m.failName(base, "expecting '%s.*Array", globalName);
-@@ -3605,17 +3606,17 @@ CheckNewArrayView(ModuleValidator& m, Pr
+@@ -3608,17 +3609,17 @@ CheckNewArrayView(ModuleValidator& m, Pr
  
          if (global->which() != ModuleValidator::Global::ArrayViewCtor)
              return m.failName(ctorExpr, "%s must be an imported array view constructor", globalName);

+ 34 - 34
frg/work-js/mozilla-release/patches/TOP-1566143-1to2-optchain-74a1-25313.patch

@@ -1,13 +1,13 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1649886977 -7200
-# Parent  5c724cd951b7d94760ea9821f4bab6fbf0dffd6f
+# Parent  db5784cbcf62afe51628e914e5510e9b7c9b768e
 Bug 1566143 - Part 0, 1 and 2: Optional chaining support.
 
 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
-@@ -9353,16 +9353,52 @@ BytecodeEmitter::emitPipeline(ParseNode*
+@@ -9531,16 +9531,52 @@ BytecodeEmitter::emitPipeline(ParseNode*
              return false;
  
          checkTypeSet(JSOP_CALL);
@@ -56,11 +56,11 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  BytecodeEmitter::emitArguments(ParseNode* pn, bool callop, bool spread)
  {
      uint32_t argc = pn->pn_count;
-  
+ 
      if (argc >= ARGC_LIMIT) {
          reportError(pn, callop ? JSMSG_TOO_MANY_FUN_ARGS : JSMSG_TOO_MANY_CON_ARGS);
          return false;
-@@ -9495,46 +9531,17 @@ BytecodeEmitter::emitCallOrNew(ParseNode
+@@ -9673,46 +9709,17 @@ BytecodeEmitter::emitCallOrNew(ParseNode
              if (!emitDupAt(argc + 1))
                  return false;
          } else {
@@ -111,7 +111,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
 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
-@@ -845,16 +845,19 @@ struct MOZ_STACK_CLASS BytecodeEmitter
+@@ -849,16 +849,19 @@ struct MOZ_STACK_CLASS BytecodeEmitter
  
      MOZ_NEVER_INLINE MOZ_MUST_USE bool emitIncOrDec(ParseNode* pn);
  
@@ -440,7 +440,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
 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
-@@ -8512,16 +8512,117 @@ GeneralParser<ParseHandler, CharT>::unar
+@@ -8503,16 +8503,117 @@ GeneralParser<ParseHandler, CharT>::unar
      Node kid = unaryExpr(yieldHandling, TripledotProhibited);
      if (!kid)
          return null();
@@ -558,7 +558,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
      if (!CheckRecursionLimit(context))
          return null();
  
-@@ -8607,18 +8708,18 @@ GeneralParser<ParseHandler, CharT>::unar
+@@ -8598,18 +8699,18 @@ GeneralParser<ParseHandler, CharT>::unar
              pc->lastAwaitOffset = begin;
              return handler.newAwaitExpression(begin, kid);
          }
@@ -579,7 +579,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              return null();
  
          if (tt != TokenKind::Inc && tt != TokenKind::Dec)
-@@ -8752,16 +8853,28 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8743,16 +8844,28 @@ GeneralParser<ParseHandler, CharT>::memb
              // Gotten by tryNewTarget
              tt = anyChars.currentToken().type;
              Node ctorExpr = memberExpr(yieldHandling, TripledotProhibited, tt,
@@ -608,7 +608,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              Node args;
              if (matched) {
                  args = argumentList(yieldHandling, &isSpread);
-@@ -8804,45 +8917,25 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8795,45 +8908,25 @@ GeneralParser<ParseHandler, CharT>::memb
          if (tt == TokenKind::Eof)
              break;
  
@@ -656,7 +656,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
          {
              if (handler.isSuperBase(lhs)) {
                  if (!pc->sc()->allowSuperCall()) {
-@@ -8850,116 +8943,24 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8841,116 +8934,24 @@ GeneralParser<ParseHandler, CharT>::memb
                      return null();
                  }
  
@@ -776,7 +776,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              return lhs;
          }
  
-@@ -8984,16 +8985,203 @@ PerHandlerParser<ParseHandler>::newName(
+@@ -8975,16 +8976,203 @@ PerHandlerParser<ParseHandler>::newName(
  template <class ParseHandler>
  inline typename ParseHandler::Node
  PerHandlerParser<ParseHandler>::newName(PropertyName* name, TokenPos pos)
@@ -983,7 +983,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 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
-@@ -1110,16 +1110,20 @@ class MOZ_STACK_CLASS GeneralParser
+@@ -1116,16 +1116,20 @@ class MOZ_STACK_CLASS GeneralParser
                    TripledotHandling tripledotHandling, PossibleError* possibleError,
                    InvokedPrediction invoked = PredictUninvoked);
      Node orExpr(InHandling inHandling, YieldHandling yieldHandling,
@@ -1004,7 +1004,7 @@ diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
                       InvokedPrediction invoked = PredictUninvoked);
      Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
                        TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
-@@ -1236,16 +1240,28 @@ class MOZ_STACK_CLASS GeneralParser
+@@ -1242,16 +1246,28 @@ class MOZ_STACK_CLASS GeneralParser
      bool checkDestructuringAssignmentElement(Node expr, TokenPos exprPos,
                                               PossibleError* exprPossibleError,
                                               PossibleError* possibleError);
@@ -1158,38 +1158,38 @@ diff --git a/js/src/frontend/TokenKind.h b/js/src/frontend/TokenKind.h
 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
-@@ -1975,17 +1975,33 @@ TokenStreamSpecific<CharT, AnyCharsAcces
+@@ -2144,17 +2144,33 @@ TokenStreamSpecific<CharT, AnyCharsAcces
            case '&':
-             if (matchChar('&'))
+             if (matchCodeUnit('&'))
                  simpleKind = TokenKind::And;
              else
-                 simpleKind = matchChar('=') ? TokenKind::BitAndAssign : TokenKind::BitAnd;
+                 simpleKind = matchCodeUnit('=') ? TokenKind::BitAndAssign : TokenKind::BitAnd;
              break;
  
            case '?':
--            simpleKind = matchChar('?') ? TokenKind::Coalesce : TokenKind::Hook;
-+            if (matchChar('.')) {
-+                c = getCharIgnoreEOL();
-+                if (IsAsciiDigit(c)) {
-+                    // if the code unit is followed by a number, for example it has the
-+                    // following form `<...> ?.5 <..> then it should be treated as a
-+                    // ternary rather than as an optional chain
-+                    simpleKind = TokenKind::Hook;
-+                    ungetCharIgnoreEOL(c);
-+                    ungetCharIgnoreEOL('.');
-+                } else {
-+                    ungetCharIgnoreEOL(c);
-+                    simpleKind = TokenKind::OptionalChain;
-+                }
+-            simpleKind = matchCodeUnit('?') ? TokenKind::Coalesce : TokenKind::Hook;
++            if (matchCodeUnit('.')) {
++              unit = getCodeUnit();
++              if (IsAsciiDigit(unit)) {
++                // if the code unit is followed by a number, for example it has the
++                // following form `<...> ?.5 <..> then it should be treated as a
++                // ternary rather than as an optional chain
++                simpleKind = TokenKind::Hook;
++                ungetCodeUnit(unit);
++                ungetCodeUnit('.');
++              } else {
++                ungetCodeUnit(unit);
++                simpleKind = TokenKind::OptionalChain;
++              }
 +            } else {
-+                simpleKind = matchChar('?') ? TokenKind::Coalesce : TokenKind::Hook;
++                simpleKind = matchCodeUnit('?') ? TokenKind::Coalesce : TokenKind::Hook;
 +            }
-+
+++
              break;
  
            case '!':
-             if (matchChar('='))
-                 simpleKind = matchChar('=') ? TokenKind::StrictNe : TokenKind::Ne;
+             if (matchCodeUnit('='))
+                 simpleKind = matchCodeUnit('=') ? TokenKind::StrictNe : TokenKind::Ne;
              else
                  simpleKind = TokenKind::Not;
              break;

+ 36 - 36
frg/work-js/mozilla-release/patches/TOP-1566143-3-optchain-74a1-25313.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1649887163 -7200
-# Parent  a518a2a2fded872f18160df7dfd49f0bb46de9be
+# Parent  6a44f5e5cb5aa3443f536607260e46e6b524f035
 Bug 1566143 - Part 3: Optional chaining support.
 
 The core part of backporting support for optional chaining to SeaMonkey 2.53.10.1
@@ -25,13 +25,13 @@ Includes:
 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
-@@ -2123,16 +2123,131 @@ class MOZ_STACK_CLASS IfThenElseEmitter
-     // `then_block` and `else_block`.
-     // Can be used in assertion after emitting if-then-else.
-     int32_t popped() const {
-         return -pushed_;
-     }
- #endif
+@@ -2299,16 +2299,131 @@ class MOZ_STACK_CLASS IfEmitter
+ class MOZ_STACK_CLASS InternalIfEmitter : public IfEmitter
+ {
+   public:
+     explicit InternalIfEmitter(BytecodeEmitter* bce)
+       : IfEmitter(bce, Kind::NoLexicalAccessInBranch)
+     {}
  };
  
 +// OOOEEE start
@@ -63,7 +63,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
 +
 +    bool emitJumpShortCircuit() {
 +        MOZ_ASSERT(initialDepth_ + 1 == bce_->stackDepth);
-+        IfThenElseEmitter ifEmitter(bce_);
++        InternalIfEmitter ifEmitter(bce_);
 +        if (!bce_->emitPushNotUndefinedOrNull())
 +            return false;
 +
@@ -88,7 +88,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
 +        if (!bce_->emit1(JSOP_SWAP))
 +            return false;
 +
-+        IfThenElseEmitter ifEmitter(bce_);
++        InternalIfEmitter ifEmitter(bce_);
 +        if (!bce_->emitPushNotUndefinedOrNull())
 +            return false;
 +
@@ -157,7 +157,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      int32_t iterDepth_;
  
      // for-of loops, when throwing from non-iterator code (i.e. from the body
-@@ -3307,16 +3422,17 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3482,16 +3597,17 @@ BytecodeEmitter::checkSideEffects(ParseN
        case ParseNodeKind::Break:
        case ParseNodeKind::Continue:
        case ParseNodeKind::Debugger:
@@ -175,7 +175,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
        // Unary cases with side effects only if the child has them.
        case ParseNodeKind::TypeOfExpr:
        case ParseNodeKind::Void:
-@@ -3388,16 +3504,17 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3563,16 +3679,17 @@ BytecodeEmitter::checkSideEffects(ParseN
          MOZ_ASSERT(pn->isArity(PN_UNARY));
          *answer = true;
          return true;
@@ -193,7 +193,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
        // evaluating the expression.
        case ParseNodeKind::DeleteExpr: {
          MOZ_ASSERT(pn->isArity(PN_UNARY));
-@@ -3488,16 +3605,17 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3663,16 +3780,17 @@ BytecodeEmitter::checkSideEffects(ParseN
          MOZ_ASSERT(pn->isArity(PN_BINARY));
          if (!checkSideEffects(pn->pn_left, answer))
              return false;
@@ -211,7 +211,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
        // These affect visible names in this code, or in other code.
        case ParseNodeKind::Import:
        case ParseNodeKind::ExportFrom:
-@@ -3545,30 +3663,36 @@ BytecodeEmitter::checkSideEffects(ParseN
+@@ -3720,30 +3838,36 @@ BytecodeEmitter::checkSideEffects(ParseN
              return true;
          if ((pn = pn->pn_kid3))
              goto restart;
@@ -248,7 +248,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  
        // Classes typically introduce names.  Even if no name is introduced,
        // the heritage and/or class body (through computed property names)
-@@ -8981,16 +9105,91 @@ BytecodeEmitter::emitDeleteExpression(Pa
+@@ -9159,16 +9283,91 @@ BytecodeEmitter::emitDeleteExpression(Pa
              return false;
          if (!emit1(JSOP_POP))
              return false;
@@ -340,7 +340,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      if (name == cx->names().callContentFunction)
          return "callContentFunction";
      if (name == cx->names().constructContentFunction)
-@@ -9239,16 +9438,123 @@ BytecodeEmitter::isRestParameter(ParseNo
+@@ -9417,16 +9616,123 @@ BytecodeEmitter::isRestParameter(ParseNo
                  bindings->trailingNames[bindings->nonPositionalFormalStart - 1].name();
              return paramName && name == paramName;
          }
@@ -464,7 +464,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
        case ParseNodeKind::Name:
          if (!emitGetName(callee, isCall))
              return false;
-@@ -9303,16 +9609,19 @@ BytecodeEmitter::emitCalleeAndThis(Parse
+@@ -9481,16 +9787,19 @@ BytecodeEmitter::emitCalleeAndThis(Parse
          needsThis = true;
          break;
        case ParseNodeKind::SuperBase:
@@ -484,7 +484,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
      }
  
      if (needsThis) {
-@@ -9449,16 +9758,99 @@ BytecodeEmitter::emitArguments(ParseNode
+@@ -9627,16 +9936,99 @@ BytecodeEmitter::emitArguments(ParseNode
              if (!ifNotOptimizable.emitEnd())
                  return false;
          }
@@ -584,7 +584,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
  
      /*
       * Emit callable invocation or operator new (constructor call) code.
-@@ -9652,16 +10044,236 @@ BytecodeEmitter::emitLeftAssociative(Par
+@@ -9830,16 +10222,236 @@ BytecodeEmitter::emitLeftAssociative(Par
          if (!emitTree(nextExpr))
              return false;
          if (!emit1(op))
@@ -821,7 +821,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitt
                 pn->isKind(ParseNodeKind::CoalesceExpr) ||
                 pn->isKind(ParseNodeKind::And));
  
-@@ -11044,16 +11656,26 @@ BytecodeEmitter::emitTree(ParseNode* pn,
+@@ -11222,16 +11834,26 @@ BytecodeEmitter::emitTree(ParseNode* pn,
              return false;
          break;
  
@@ -869,7 +869,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter
      BytecodeEmitter* const parent;  /* enclosing function or global context */
  
      Rooted<JSScript*> script;       /* the JSScript we're ultimately producing */
-@@ -512,16 +513,19 @@ struct MOZ_STACK_CLASS BytecodeEmitter
+@@ -516,16 +517,19 @@ struct MOZ_STACK_CLASS BytecodeEmitter
          EMIT_LINENOTE,
          SUPPRESS_LINENOTE
      };
@@ -889,7 +889,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter
      // encompasses the entire source.
      MOZ_MUST_USE bool emitScript(ParseNode* body);
  
-@@ -828,16 +832,38 @@ struct MOZ_STACK_CLASS BytecodeEmitter
+@@ -832,16 +836,38 @@ struct MOZ_STACK_CLASS BytecodeEmitter
      MOZ_MUST_USE bool emitExpressionStatement(ParseNode* pn);
      MOZ_MUST_USE bool emitStatementList(ParseNode* pn);
  
@@ -928,7 +928,7 @@ diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter
      MOZ_MUST_USE bool emitLeftAssociative(ParseNode* pn);
      MOZ_MUST_USE bool emitShortCircuit(ParseNode* pn);
      MOZ_MUST_USE bool emitSequenceExpr(ParseNode* pn,
-@@ -897,16 +923,20 @@ struct MOZ_STACK_CLASS BytecodeEmitter
+@@ -901,16 +927,20 @@ struct MOZ_STACK_CLASS BytecodeEmitter
      MOZ_MUST_USE bool emitSuperPropOp(ParseNode* pn, JSOp op, bool isCall = false);
      MOZ_MUST_USE bool emitSuperElemOperands(ParseNode* pn,
                                              EmitElemOption opts = EmitElemOption::Get);
@@ -1373,7 +1373,7 @@ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h
 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
-@@ -7325,17 +7325,17 @@ GeneralParser<ParseHandler, CharT>::clas
+@@ -7316,17 +7316,17 @@ GeneralParser<ParseHandler, CharT>::clas
  
      Node classHeritage = null();
      bool hasHeritage;
@@ -1392,7 +1392,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  
      Node classMethods = handler.newClassMethodList(pos().begin);
      if (!classMethods)
-@@ -8062,20 +8062,21 @@ Precedence(ParseNodeKind pnk) {
+@@ -8053,20 +8053,21 @@ Precedence(ParseNodeKind pnk) {
      MOZ_ASSERT(pnk <= ParseNodeKind::BinOpLast);
      return PrecedenceTable[size_t(pnk) - size_t(ParseNodeKind::BinOpFirst)];
  }
@@ -1416,7 +1416,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
      // It's implemented using two separate arrays, though.
      Node nodeStack[PRECEDENCE_CLASSES];
      ParseNodeKind kindStack[PRECEDENCE_CLASSES];
-@@ -8182,17 +8183,17 @@ GeneralParser<ParseHandler, CharT>::orEx
+@@ -8173,17 +8174,17 @@ GeneralParser<ParseHandler, CharT>::orEx
      return pn;
  }
  
@@ -1435,7 +1435,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
      bool matched;
      if (!tokenStream.matchToken(&matched, TokenKind::Hook))
          return null();
-@@ -8514,18 +8515,17 @@ GeneralParser<ParseHandler, CharT>::unar
+@@ -8505,18 +8506,17 @@ GeneralParser<ParseHandler, CharT>::unar
          return null();
      return handler.newUnary(kind, begin, kid);
  }
@@ -1455,7 +1455,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
    
      uint32_t begin = pos().begin;
    
-@@ -8534,17 +8534,17 @@ GeneralParser<ParseHandler, CharT>::opti
+@@ -8525,17 +8525,17 @@ GeneralParser<ParseHandler, CharT>::opti
      if (!lhs) {
          return null();
      }
@@ -1474,7 +1474,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              return null();
          }
      
-@@ -8589,33 +8589,32 @@ GeneralParser<ParseHandler, CharT>::opti
+@@ -8580,33 +8580,32 @@ GeneralParser<ParseHandler, CharT>::opti
                  error(JSMSG_NAME_AFTER_DOT);
                  return null();
              }
@@ -1511,7 +1511,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  template <class ParseHandler, typename CharT>
  typename ParseHandler::Node
  GeneralParser<ParseHandler, CharT>::unaryExpr(YieldHandling yieldHandling,
-@@ -8709,17 +8708,17 @@ GeneralParser<ParseHandler, CharT>::unar
+@@ -8700,17 +8699,17 @@ GeneralParser<ParseHandler, CharT>::unar
              return handler.newAwaitExpression(begin, kid);
          }
        }
@@ -1530,7 +1530,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
              return null();
  
          if (tt != TokenKind::Inc && tt != TokenKind::Dec)
-@@ -8824,19 +8823,19 @@ ParserBase::checkAndMarkSuperScope()
+@@ -8815,19 +8814,19 @@ ParserBase::checkAndMarkSuperScope()
      pc->setSuperScopeNeedsHomeObject();
      return true;
  }
@@ -1553,7 +1553,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
      if (!CheckRecursionLimit(context))
          return null();
  
-@@ -9002,16 +9001,17 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -8993,16 +8992,17 @@ GeneralParser<ParseHandler, CharT>::memb
      }
  
      Node name = handler.newPropertyName(field, pos());
@@ -1571,7 +1571,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  template <class ParseHandler, typename CharT>
  typename ParseHandler::Node
  GeneralParser<ParseHandler, CharT>::memberElemAccess(Node lhs, YieldHandling yieldHandling,
-@@ -9025,16 +9025,17 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -9016,16 +9016,17 @@ GeneralParser<ParseHandler, CharT>::memb
  
      MUST_MATCH_TOKEN_MOD(TokenKind::RightBracket, TokenStream::Operand, JSMSG_BRACKET_IN_INDEX);
  
@@ -1589,7 +1589,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
  template <class ParseHandler, typename CharT>
  typename ParseHandler::Node
  GeneralParser<ParseHandler, CharT>::memberSuperCall(Node lhs, YieldHandling yieldHandling)
-@@ -9067,17 +9068,18 @@ GeneralParser<ParseHandler, CharT>::memb
+@@ -9058,17 +9059,18 @@ GeneralParser<ParseHandler, CharT>::memb
  }
  
  template <class ParseHandler, typename CharT>
@@ -1609,7 +1609,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
                 "Unexpected token kind for member call");
  
      JSOp op = JSOP_CALL;
-@@ -10202,17 +10204,17 @@ GeneralParser<ParseHandler, CharT>::impo
+@@ -10193,17 +10195,17 @@ GeneralParser<ParseHandler, CharT>::impo
      return handler.newImportMeta(importHolder, metaHolder);
  }
  
@@ -1631,7 +1631,7 @@ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
 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
-@@ -1094,44 +1094,48 @@ class MOZ_STACK_CLASS GeneralParser
+@@ -1100,44 +1100,48 @@ class MOZ_STACK_CLASS GeneralParser
      // consume trailing in/of and subsequent expression, if so directed by
      // |forHeadKind|.
      bool initializerInNameDeclaration(Node binding,

Some files were not shown because too many files changed in this diff