Still rely on mozilla aliases though, for readability and to avoid
confusion in the case of NegativeInfinity.
As a bonus, provide MaxNumberValue that mirrors MinNumberValue.
Differential Revision: https://phabricator.services.mozilla.com/D222119
The intent is to use this after having temporarily increased the max dirty page threshold.
This API will be used off the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D220256
This patch adds machinery for collecting statistics on lazy tiering and
inlining. These are stored in the CodeMeta for a module and are printed, using
the MOZ_LOG facility, when the CodeMeta is destructed (at the end of the
module's lifetime). The collected data is minimal but is important for tuning
the LT and inlining heuristics.
* WasmMetadata.{h,cpp}, class CodeMetadata
- new struct ProtectedStats and lock-protected field `stats`
- new method CodeMetadata::dumpStats
* vm/Logging.h: new logging tag 'wasmCodeMetaStats'
* vm/MutexIDs.h: new mutex 'WasmCodeMetaStats' for serializing access to the
stats
* WasmCode.cpp: copy code-allocation info into CodeMeta::stats
* WasmGenerator.cpp, ModuleGenerator::finishModule: copy complete-tier info
into CodeMeta::stats
* WasmIonCompile.cpp, class FunctionCompiler:
- add comment explaining how the FunctionCompiler stack is organized
- new field `toplevelCompiler_`, to access the stack base quickly
- new fields `stats_*`, temporarily holding stats during compilation of one
function
- FunctionCompiler::~FunctionCompiler: copy stats into CodeMeta::stats
Differential Revision: https://phabricator.services.mozilla.com/D221936
This patch changes the lazy-tiering and inlining heuristics to be more suitable
for production use, and moves them into their own file, WasmHeuristics.h.
* StaticPrefList.yaml
- remove prefs
javascript.options.wasm_experimental_inline_depth_limit,
javascript.options.wasm_experimental_inline_size_limit
- add more abstract prefs
javascript.options.wasm_experimental_tiering_level,
javascript.options.wasm_experimental_inlining_level,
javascript.options.wasm_experimental_direct_inlining,
javascript.options.wasm_experimental_callRef_inlining.
* new file WasmHeuristics.h
* new class LazyTieringHeuristics. This reads
JS::Prefs::wasm_experimental_tiering_level when created and uses that
information in ::estimateIonCompilationCost to provide some estimate of the
Ion compilation cost for a function, which is used as the initial hotness
counter. The basic logic is unchanged from before.
* new class InliningHeuristics. This reads
JS::Prefs::wasm_experimental_inlining_level and two others at startup. These
are then used by ::isSmallEnoughToInline to answer inline/no-inline
questions. The logic is new -- it allows only smaller and smaller functions
to be inlined as the inlining depth insreases.
* Instance::computeInitialHotnessCounter: use
LazyTieringHeuristics::estimateIonCompilationCost.
* WasmIonCompile.cpp: shouldInlineCallDirect: rename to shouldInlineCall, and
use InliningHeuristics::isSmallEnoughToInline to make inlining decisions.
Differential Revision: https://phabricator.services.mozilla.com/D221935
Knowing the actual fetchPriority of the initial request is useful information
when computing the urgency. This allows us to not worry about the priority
being clobbered by another caller of nsISupportsPriority.
Differential Revision: https://phabricator.services.mozilla.com/D221957
Debian's firefox-esr package adds its own /usr/bin/firefox and diverts
it away, so we either need to do the same or clean up the diversion in
our postinst, otherwise /usr/bin/firefox goes permanently missing when
upgrading from Debian to Mozilla's firefox-esr package.
Differential Revision: https://phabricator.services.mozilla.com/D222752
In bug 1894106 we ensured that draw compositor tiles' tile rects and
clip rects were both calculated on the CPU, to avoid visible seams
whilst low-quality pinch zooming. However, the clip_rect's calculation
uses CompositeState::get_device_rect(), which rounds the rect, whereas
the newly added tile rect calculation used a raw call to
ScaleOffset::map_rect(), which does not. This means that seams still
sometimes flicker whilst zooming. This patch fixes this by using
CompositeState::get_device_rect() for the tile rect calculation as
well, ensuring consistent rounding.
Differential Revision: https://phabricator.services.mozilla.com/D222641
Underlay compositor surfaces require a cutout to be rendered to the
picture cache tiles above the underlay. During low-quality pinch zoom
the screen position of the cutout after the picture cache tiles have
been composited may not align exactly with the position of the
underlay surface which is composited directly. This can result in
visible seams along the edges of video.
Additionally, in underlay mode picture tiles still get invalidated
during a low quality zoom, which results in worse performance.
This patch therefore disallows Underlay compositor surfaces whilst a
low-quality pinch zoom is active.
Differential Revision: https://phabricator.services.mozilla.com/D222638
Previously if evaluating `isFullscreen` inside FullScreenFeature's `fullScreenChanged` callback
we would get the old value and not the current status of the tab.
This change fixes that.
Differential Revision: https://phabricator.services.mozilla.com/D222587
The initial Firefox support for network events for cached stylesheets fails in 2 known cases:
- when the stylesheet is loaded via @import (no event emitted)
- when the stylesheet is duplicated in several link tags (too many events emitted)
New tests are added to cover those use cases, which should all be fixed by Bug 1916960 on Firefox side.
All the added tests already pass on Chrome canary.
Differential Revision: https://phabricator.services.mozilla.com/D221685
The UI test failed on API 34 when trying to verify that the scan button is not displayed.
I've added a 1s wait for the app window to be updated (waitForAppWindowToBeUpdated)
The UI test successfully passed:
- 25x on API 30
- 50x on API 34
Differential Revision: https://phabricator.services.mozilla.com/D222618
`std::sort` is not a stable sorting function. To avoid relying on implementation-defined
ordering, extend the comparator function to compare the `to` position and the bundle id
when ranges start at the same position.
Bundles now store an 'id' in non-debug builds too. Each compilation has its own
counter that starts at 0 so that we don't need atomic operations to determine the next
id.
Differential Revision: https://phabricator.services.mozilla.com/D222610
The virtual register ranges are guaranteed to be sorted after the initial live range
building and grouping. After this phase, they can become unsorted when allocating
bundles to registers.
This patch adds an explicit `sortVirtualRegisterRanges` step to the allocator
to ensure the ranges are sorted after allocating all bundles. This is now the
only place where we can call `sortRanges`.
This makes it easier to reason about the sorting behavior and helps avoid pathological
behavior from future changes.
A `VirtualRegister::replaceLastRangeLinear` helper function is added to maintain
sort order so that we don't have to sort explicitly there.
Because sorting is now explicit, we can remove the `activeRangeIterators_` bookkeeping
because we no longer have this possible footgun from sorting while iterating.
Differential Revision: https://phabricator.services.mozilla.com/D222584
Now that LiveRange is part of a single linked list instead of two lists, we can
remove its bundleLink and make it a standard linked-list node.
Differential Revision: https://phabricator.services.mozilla.com/D222257
All ranges that start after the position that's passed in definitely can't overlap.
Use binary search to skip these ranges.
This reduces the Ion compilation time for the Wasm module in bug 1916442 from 16 seconds to
14 seconds locally.
The time complexity for `rangeFor` and how it affects some of the callers still isn't great,
but optimizing that will require more work.
Differential Revision: https://phabricator.services.mozilla.com/D222256
The vector is lazily sorted in order of descending start position for operations that
need it to be sorted.
This lets the list be unsorted during the core register allocation loop. A Vector also
has better cache locality and allows binary search when sorted. These changes improve
performance a lot: 276 seconds to 16 seconds locally for the Wasm module in bug 1916442
after some other changes.
A later patch will update the SMDOC comment.
Differential Revision: https://phabricator.services.mozilla.com/D222255
First remove all dead ranges before doing other operations on the ranges. It's easier
to reason about the other loops when they don't change the list of ranges at the same time.
Differential Revision: https://phabricator.services.mozilla.com/D222249
`FixedList` doesn't call destructors for the items. When `VirtualRegister` has a `Vector` in
later patches we need to call its destructor to not leak memory.
Differential Revision: https://phabricator.services.mozilla.com/D222248