The native allocations feature added stackwalking that can happen anywhere that
memory is allocated. This means that stackwalking happens in places where the
execution already has a very large execution stack. Stackwalking was relying
on stack-allocated buffers used for merging stacks. This was taking up 64kb of
stack space. On Linux, this was causing a stack overflow, as there is only 256kb of
stack space. I encountered a crash while using GDB. Using pointer arithmetic,
I determined that the stack size before stack walking was around 20kb, and during
stackwalking, we overflowed the stack (>256kb). The largest culprit was the
JS::ProfilingFrameIterator::Frame jsFrames[MAX_JS_FRAMES]. In addition,
Bug 1468789 added another member to the Frame class, also increasing the size
of the stack allocation.
I changed the implementation to allocate some memory on the CorePS class, and
share that with every stackwalk that happens. I tested this loading a large news
site, and didn't get any crashes.
Differential Revision: https://phabricator.services.mozilla.com/D54072
--HG--
extra : moz-landing-system : lando
As with AggregateError, `Promise.any` is only enabled in Nightly.
Now that everything is in place, the actual `Promise.any` implementation is
relatively straight forward. The only tricky part is probably just the
`ThrowAggregateError` function, when the async stack is created to give a
better stack trace.
Differential Revision: https://phabricator.services.mozilla.com/D51659
--HG--
rename : js/src/jit-test/tests/promise/promise-race-with-non-default-resolving.js => js/src/jit-test/tests/promise/promise-any-with-non-default-resolving.js
extra : moz-landing-system : lando
Adds a separate struct to hold the elements arrays and to apply wrapping and
unwrapping at the correct points. This will let us avoid copying this code
another time for the `Promise.any` proposal.
Differential Revision: https://phabricator.services.mozilla.com/D51658
--HG--
extra : moz-landing-system : lando
The first five steps in each Promise combinator element function are always the
same. Add a helper function for this task to reduce more code duplication.
Differential Revision: https://phabricator.services.mozilla.com/D51656
--HG--
extra : moz-landing-system : lando
Moves the `NewNativeFunction` and the two `setExtendedSlot` calls into a helper
function to reduce code duplication.
Differential Revision: https://phabricator.services.mozilla.com/D51655
--HG--
extra : moz-landing-system : lando
The draft proposal calls `Promise.all`, `Promise.allSettled`, `Promise.any`, and
`Promise.race` "Promise combinators". Let's reuse that name to avoid having to
spell each function name in shared functions. For example instead of
`CommonStaticAllRace`, or soon `CommonStaticAllRaceAny`, we get
`CommonPromiseCombinator`.
- `PromiseAllDataHolder` is currently used for `Promise.all` and
`Promise.allSettled`, and soon also for `Promise.any`. Rename it to
`PromiseCombinatorDataHolder` to express that different Promise combinators use
this object.
Differential Revision: https://phabricator.services.mozilla.com/D51654
--HG--
extra : moz-landing-system : lando
Adds AggregateError, but only enables it for Nightly builds, because the draft
proposal is still incomplete, so it doesn't make sense to let this feature ride
the trains at this moment.
- The `other_error_properties` array was changed to individual static variables,
because AggregateError has more than three properties, which prevents it to be
stored in `JSPropertySpec[][3]`.
- `AggregateErrorObject` can't use the normal `ErrorObject` class, because it
needs an additional slot for the [[AggregateErrors]].
- For similar reasons it can't use the shared `Error` constructor function,
because the `AggregateError` constructor has an additional `errors` iterable
argument which it needs to process.
Differential Revision: https://phabricator.services.mozilla.com/D51653
--HG--
extra : moz-landing-system : lando
The ErrorObject classes are already declared in ErrorObject.h, so it seems
useful to also move their definitions into the corresponding cpp file.
Also adds `js::CaptureStack` to jsexn.h so it can be called from ErrorObject.cpp
and to remove the duplicated implementation in JSContext.cpp.
Differential Revision: https://phabricator.services.mozilla.com/D51651
--HG--
extra : moz-landing-system : lando
GlobalObject.h had an unnecessary #include for ErrorObject.h, which led to
recompiling more or less all of SpiderMonkey when modifying ErrorObject.h,
because GlobalObject.h is (transitively) included in most files.
Differential Revision: https://phabricator.services.mozilla.com/D51649
--HG--
extra : moz-landing-system : lando
As a side-effect this will also update runtime data for all suites using
'--chunk-by-runtime'.
This change simultaneously:
1. Stores runtime data from all suites
2. Stores runtime data from all tests (no more percentile)
3. Stores distinct data for android, unix (osx/linux) and windows
4. Reduces the size of 'testing/runtimes' from 408k -> 168k
The chunks look more balanced from my unscientific glance (especially on Windows).
Differential Revision: https://phabricator.services.mozilla.com/D53702
--HG--
extra : moz-landing-system : lando
The script should just do the thing that we want. Providing options just
increases the chance of user error. I don't see any need to specify either of
these things.
Depends on D53699
Differential Revision: https://phabricator.services.mozilla.com/D53700
--HG--
extra : moz-landing-system : lando
The main motivation here was to gain access to the mach enviroment for the
future refactor.
Depends on D53698
Differential Revision: https://phabricator.services.mozilla.com/D53699
--HG--
rename : testing/runtimes/writeruntimes.py => testing/runtimes/writeruntimes
extra : moz-landing-system : lando
Build flavors are defined in 'python/mozbuild/mozbuild/testing.py'.
This change is needed by D52729 but it's also a good way to tell which suites
are integrated into the TestManifestBackend in the build system. So I'm landing
it here instead.
Depends on D53030
Differential Revision: https://phabricator.services.mozilla.com/D53698
--HG--
extra : moz-landing-system : lando
Unlink must not cause an AddRef on the unlinked object, or it is at risk of
leaking. See 1593739 for an example of where this happens.
EndCloningVisually is dangerous in that it tries to do more than just unlink the
video element. It does AddRef in NotifyUAWidgetSetupOrChange, so that must be
avoided.
Previous patches to this bug make sure that MediaDecoder shutdown takes care of
clearing the secondary video container in the MediaDecoder stack, so this is not
actually necessary anymore.
Differential Revision: https://phabricator.services.mozilla.com/D53832
--HG--
extra : moz-landing-system : lando
This patch does the following:
- Makes cloneElementVisually() return a promise
- Plumbs an event from the MediaDecoderStateMachine's VideoSink to
HTMLVideoElement
- Hooks the event up to resolve the promise from cloneElementVisually()
- Updates tests and their expectations.
Differential Revision: https://phabricator.services.mozilla.com/D53831
--HG--
extra : moz-landing-system : lando
This better follows how MediaDecoder and MediaDecoderStateMachine was
architected.
Differential Revision: https://phabricator.services.mozilla.com/D53710
--HG--
extra : moz-landing-system : lando
The initialization cost of `AutoStyleCacheArray` is still expensive and it's
used only by `HTMLEditor`. Therefore, we should make it `Maybe` and construct
it only when the editor is an `HTMLEditor`.
Depends on D54253
Differential Revision: https://phabricator.services.mozilla.com/D54254
--HG--
extra : moz-landing-system : lando
Calling `AppendElement()` a lot causes the constructor appearing in profile.
`AutoTArray` has a constructor taking initialization list. Let's use it.
Differential Revision: https://phabricator.services.mozilla.com/D54253
--HG--
extra : moz-landing-system : lando
Examples are currently in github. They should be kept alongside the documentation and code and built along with other projects in Android Studio.
Differential Revision: https://phabricator.services.mozilla.com/D53978
--HG--
extra : moz-landing-system : lando