Граф коммитов

84363 Коммитов

Автор SHA1 Сообщение Дата
Lars T Hansen ca918db2a1 Bug 1736531 - Fix. r=jseward
See bug for analysis.

Differential Revision: https://phabricator.services.mozilla.com/D129010
2021-10-21 15:46:28 +00:00
Yoshi Cheng-Hao Huang ae1dc1dcf2 Bug 1726141 : Add GetOrCreate helper functions. r=anba
Differential Revision: https://phabricator.services.mozilla.com/D126705
2021-10-21 06:55:58 +00:00
Yoshi Cheng-Hao Huang 7e53f41285 Bug 1719678 - Part 3: Remove js::intl::FormattedValueToString. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D128517
2021-10-21 06:55:57 +00:00
Yoshi Cheng-Hao Huang a3c54356eb Bug 1719678 - Part 2: Unify FormatDateTimeToParts and FormatDateTimeRangeToParts. r=platform-i18n-reviewers,anba,gregtatum,tcampbell
Add DateTimeFormat::TryFormatToParts and
DateIntervalFormat::TryFormattedToParts methods.

Differential Revision: https://phabricator.services.mozilla.com/D126342
2021-10-21 06:55:57 +00:00
Yoshi Cheng-Hao Huang 166ac0c418 Bug 1719678 - Part 1: Add a mozilla::intl::DateIntervalFormat. r=platform-i18n-reviewers,anba,gregtatum,tcampbell
Add a mozilla::intl::DateIntervalFormat class, with two methods:
- TryFormatCalendar
- TryFormatDateTime

and a mozilla::intl::AutoFormattedDateInterval class, which is a RAII
class calling udtitvfmt_openResult and udtitvfmt_closeResult for
DateIntervalFormat operations.

Differential Revision: https://phabricator.services.mozilla.com/D125642
2021-10-21 06:55:57 +00:00
Tooru Fujisawa e230b1eb42 Bug 1732923 - Part 2: Remove options parameter from XDRIncrementalStencilEncoder::setInitial. r=tcampbell
Depends on D128342

Differential Revision: https://phabricator.services.mozilla.com/D128343
2021-10-21 00:14:22 +00:00
Tooru Fujisawa 342914cc80 Bug 1732923 - Part 1: Remove options parameter from JS::EncodeStencil. r=tcampbell
Depends on D120201

Differential Revision: https://phabricator.services.mozilla.com/D128342
2021-10-21 00:14:21 +00:00
Csoregi Natalia 0aabf6df40 Backed out 2 changesets (bug 1667913) for causing assertion failures on Marking.cpp. CLOSED TREE
Backed out changeset 1688c63ebe62 (bug 1667913)
Backed out changeset 00cc848acd05 (bug 1667913)
2021-10-21 03:58:43 +03:00
Steve Fink ee65d04f45 Bug 1667913 - remove ephemeron edges that are invalidated by nuking r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D128959
2021-10-20 13:52:35 +00:00
Jon Coppeard 7ba8b7c009 Bug 1736604 - Part 3: Rename MapSweepPolicy to MapEntryGCPolicy r=sfink
It's only used for traceWeak it's true, but it's like a GCPolicy for the map
entry itself.

Differential Revision: https://phabricator.services.mozilla.com/D128904
2021-10-20 09:31:24 +00:00
Jon Coppeard 24960e27e3 Bug 1736604 - Part 2: Remove GCPolicy and container needsSweep and sweep methods r=sfink
This functionality has been replaced by the traceWeak methods.

Differential Revision: https://phabricator.services.mozilla.com/D128902
2021-10-20 09:31:23 +00:00
Jon Coppeard 3649131338 Bug 1736604 - Part 1: Replace sweeping with tracing weak edges in WeakRef implementation r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D128901
2021-10-20 09:31:23 +00:00
Jon Coppeard 48823d0e19 Bug 1736602 - Part 2: Use tracer when updating xpconnect weak pointers after GC r=mccr8,sfink
Pass the tracer through XPConnect's update methods and use it to call weak tracing APIs.

Differential Revision: https://phabricator.services.mozilla.com/D128900
2021-10-20 09:21:40 +00:00
Jon Coppeard 4c692b76eb Bug 1736602 - Part 1: Pass JSTracer to embedding callbacks which update weak pointers after moving GC r=sfink
The callbacks previously took a JSContext pointer which was never used.

Differential Revision: https://phabricator.services.mozilla.com/D128899
2021-10-20 09:21:39 +00:00
Jan de Mooij ee052141ae Bug 1736338 - Stop using Heap<> in ArrayBufferOrView. r=sfink
This was triggering post-barriers. This is unnecessary because this type is currently
only used on the stack.

Differential Revision: https://phabricator.services.mozilla.com/D128880
2021-10-20 08:56:40 +00:00
Zhao Jiazhong 3b638bfadf Bug 1736783 - [MIPS] Implement `MacroAssembler::test{Number,Boolean,String,Symbol,BigInt}Set()`. r=anba
Port D128077 to MIPS platform.

Differential Revision: https://phabricator.services.mozilla.com/D128989
2021-10-20 08:28:58 +00:00
Lars T Hansen 567d5bdab3 Bug 1735481 - Memory64 - White-box tests for m64 bce. r=jseward
This tests that BCE works on 64-bit code and that no extraneous zero
constants are generated.

Differential Revision: https://phabricator.services.mozilla.com/D128353
2021-10-20 07:04:57 +00:00
Lars T Hansen dd8203bcfb Bug 1735481 - Memory64 - Make useRegisterOrZero work for i64 values. r=jseward
For addressing expressions we want to special-case zero.  Now that
pointers can be 64-bit values, recognize also 64-bit zeroes.

Differential Revision: https://phabricator.services.mozilla.com/D128377
2021-10-20 07:04:57 +00:00
Lars T Hansen 7663c6598e Bug 1736544 - Guard isMem32 when we don't yet know if there's a memory. r=jseward
The isMem32 predicate assumes that there's a memory present (and this
is the right thing), but sometimes we must call isMem32 before we've
checked for the presence of a memory, this is a consequence of the
structure of the compiler.  Specifically, we must determine the
appropriate signature for a bulk memory instance call before reading
the opcode, and the signature depends on the memory type, yet it's the
opcode reading that checks for the presence of the memory and throws
if one is not present.

Introduce a new predicate for these situations and use it as
appropriate.  It is safe to assume mem32 if a memory is not present,
as the presence of a memory will be checked properly subsequently.

The isMem64 predicate is not affected as it is not used in these
situations.

Only Ion is affected, baseline already has the necessary guard in all
the required situations.

The missing test cases were an oversight - I introduced tests like
these for the memory instructions previously, but I forgot wait and
notify.

Differential Revision: https://phabricator.services.mozilla.com/D128869
2021-10-20 06:40:20 +00:00
Lars T Hansen 3ad7cf290a Bug 1736546 - Update spec-test-importer config.toml. r=yury DONTBUILD
Upstream repos changed 'master' to 'main'.

Differential Revision: https://phabricator.services.mozilla.com/D128864
2021-10-20 06:06:39 +00:00
Lars T Hansen cb0785974c Bug 1736492 - allow memory64 tests to oom. r=yury
In general, these test cases may allocate a lot of memory and should be allowed
to OOM, cf the test in ../large-memory.js

Differential Revision: https://phabricator.services.mozilla.com/D128852
2021-10-20 06:06:17 +00:00
Jon Coppeard eee6b4bd94 Bug 1736397 - Part 6: Use tracing for the incremental read barrier on WeakCached maps and sets r=sfink
It's slightly annoying that we now have to store a tracer rather than just a
bool, but it's necessary because these container methods don't have any context
we can get it from.

Differential Revision: https://phabricator.services.mozilla.com/D128861
2021-10-19 14:43:32 +00:00
Jon Coppeard 3971108eb1 Bug 1736397 - Part 5: Replace sweeping with tracing weak edges for unspecialized WeakCached things r=sfink
Making this change meant fixing WeakCached things that supplied their own sweep
method at the same time because the custom sweep method would no longer be
called. This dragged in a bunch of other changes but it's all along the same
lines as the previous patches.

Depends on D128859

Differential Revision: https://phabricator.services.mozilla.com/D128860
2021-10-19 14:43:32 +00:00
Jon Coppeard 2adab4bb08 Bug 1736397 - Part 4: Replace sweeping with tracing weak edges for WeakCached HashSets r=sfink
Depends on D128858

Differential Revision: https://phabricator.services.mozilla.com/D128859
2021-10-19 14:43:31 +00:00
Jon Coppeard 2c01ccaa7b Bug 1736397 - Part 3: Replace sweeping with tracing weak edges for WeakCached HashMaps r=sfink
Depends on D128857

Differential Revision: https://phabricator.services.mozilla.com/D128858
2021-10-19 14:43:31 +00:00
Jon Coppeard 9f99318bb9 Bug 1736397 - Part 2: Give hash table traceWeak methods a boolean return value r=sfink
Depends on D128856

Differential Revision: https://phabricator.services.mozilla.com/D128857
2021-10-19 14:43:30 +00:00
Jon Coppeard 26baa599bc Bug 1736397 - Part 1: Change the WeakCache interface to traceWeak(), but still call sweep() internally r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D128856
2021-10-19 14:43:30 +00:00
Jon Coppeard edd2c5903f Bug 1588830 - Use TraceWeakEdge for tracing WeakMap keys r=sfink
This refactors some of the code to remove indirection from Zone methods to
WeakMapBase where it's simpler just to implement the method on Zone.

Differential Revision: https://phabricator.services.mozilla.com/D128352
2021-10-19 14:21:53 +00:00
André Bargull 84875cdcbe Bug 1736409 - Part 3: Return void instead of bool from initFromTemplateObject(). r=iain
Both `initFromTemplateObject()` methods are always returning `true`, so we might
as well change the return type to `void`.

Depends on D128765

Differential Revision: https://phabricator.services.mozilla.com/D128766
2021-10-19 09:19:56 +00:00
André Bargull 7748d3a5f4 Bug 1736409 - Part 2: Inline visitObjectGuard() into visitGuardShape(). r=iain
The other caller to `visitObjectGuard()` was removed when unboxed objects were
removed, so we can move the function back into `visitGuardShape()`.

Depends on D128764

Differential Revision: https://phabricator.services.mozilla.com/D128765
2021-10-19 09:19:56 +00:00
André Bargull 99cd8c4e6f Bug 1736409 - Part 1: Use MDefinitionIterator when iterating over definitions. r=iain
`ArgumentsReplacer::run()` ignores any resume points, so we can directly use
`MDefinitionIterator` to iterate over all definitions.

Differential Revision: https://phabricator.services.mozilla.com/D128764
2021-10-19 09:19:56 +00:00
André Bargull e5b87e74e0 Bug 1736405: Remove MLoadElementHole::needsHoleCheck. r=jandem
`MLoadElementHole::needsHoleCheck` is never set to `false`.

Drive-by change:
- Remove two method declarations without definitions.

Differential Revision: https://phabricator.services.mozilla.com/D128762
2021-10-19 09:19:49 +00:00
Jan de Mooij 0e2b3de693 Bug 1736353 part 1 - Remove barrier after megamorphic property gets. r=iain
We added a speculation barrier after calls into C++ from ICs (bug 1444473).
In hindsight, it seems we were overly cautious with the calls for megamorhic property
gets because the slot number comes from the shape's property map. This makes it very
different from the typical Spectre v1 attack with a user-controlled index into a
(typed) array, where the bounds check then gets delayed/speculated.

Furthermore, this happens in C++ code that's not user-controlled and it'd need a
large speculation window that includes the return to JIT code. There we have
additional mitigations when unboxing the returned Value.

This barrier has a large impact on performance: on a simple micro-benchmark it
increases our numbers from 75 ms to 170 ms on Linux x64, more than a 2x slowdown
for one of our hottest code paths. This makes it hard to justify keeping it.

Differential Revision: https://phabricator.services.mozilla.com/D128744
2021-10-19 09:12:48 +00:00
Jan de Mooij 33dfe17cd2 Bug 1735993 - Use HeapPtr instead of GCPtr in ShapeSnapshot. r=jonco
Not adding the test case because it's so large, and this is just a testing function.

Differential Revision: https://phabricator.services.mozilla.com/D128724
2021-10-19 08:46:16 +00:00
Jon Coppeard 3fd29393b3 Bug 1736396 - Replace sweeping with traceing weak edges in NurseryAwareHashMap r=sfink
Depends on D128759

Differential Revision: https://phabricator.services.mozilla.com/D128760
2021-10-19 08:43:21 +00:00
Jon Coppeard 8d9c758b46 Bug 1736396 - Replace sweeping with tracing weak edges in the FinalizationRegistry implementation r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D128759
2021-10-19 08:43:20 +00:00
Jon Coppeard 03ccf4bce6 Bug 1736396 - Fix SweepingTracer to work correctly on things in zones that are not being swept r=sfink
Most of the time we only sweep things in zones that are being swept, but there
are a couple of places where this isn't true. This fixes the sweeping tracer to
take account of that.

Differential Revision: https://phabricator.services.mozilla.com/D128758
2021-10-19 08:43:20 +00:00
Zhao Jiazhong 5d18f2ec27 Bug 1735772 - Fix some 32-bit value sign-extension issues when computing hash. r=anba
On mips64, when 64-bit GPRs carrying 32-bit values, the upper bits are the sign extension
of the lower bits, and 32-bit instructions will check this invariant.
But on x64 and arm64, the upper bits are zero, and 32-bit instructions don't care about
the upper 32 bits of the inputs.

So when some 32-bit operations like mul32 are used, we should keep the inputs sign-extended.
And if we want a zero-extended 32-bit value, like for some bitwise operations, an explicit
zero-extension is needed.

Differential Revision: https://phabricator.services.mozilla.com/D128564
2021-10-19 08:16:45 +00:00
Paul Bone a5ee7d34fd Bug 1725539 - p4. Document the new GC scheduling code r=smaug
Depends on D123098

Differential Revision: https://phabricator.services.mozilla.com/D123099
2021-10-19 02:31:15 +00:00
Gerald Squelart df50ece611 Bug 1735697 - Remove profiler_can_accept_markers(), use profiler_thread_is_being_profiled() instead - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D128577
2021-10-18 23:11:30 +00:00
Cristian Tuns 168746c50e Bug 1582898 Fix lint failure r=fix CLOSED TREE 2021-10-18 17:04:33 -04:00
Steve Fink 01d04a3348 Bug 1582898 - Split up the callgraph generation step r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D46688
2021-10-18 20:34:39 +00:00
Steve Fink f292ed793a Bug 1582895 - Minor irrelevant jorendb tweaks r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D46686
2021-10-18 20:34:38 +00:00
Steve Fink fdc5d6c23c Bug 1582895 - Stop using global variables for so much state, and make separate rawCallees/calleesOf representations. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D46684
2021-10-18 20:34:38 +00:00
Steve Fink cdb7e82fce Bug 1582895 - Move more information into the actual callgraph using special "function" names like `(js-code)`, `(any-function)`, etc. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D46683
2021-10-18 20:34:37 +00:00
Steve Fink 58dbce0931 Bug 1582599 - Instead of a single "limits" value ("all paths that can reach this function have this property"), compute both "all" and "any" values: the old "limits" is now "all"; the new "any" means "a path exists to this function in which this... r=jonco
...property is true". r=jonco

Currently unused, but an example usage would be to enforce a rule where you're supposed to annotate functions as safe, meaning they cannot invoke some function F. We would set a bit for annotated functions. Then if there is any route to F where that bit is set, we know we have a problem. (The currently intended use is a bit more complicated.)

Differential Revision: https://phabricator.services.mozilla.com/D46545
2021-10-18 20:34:37 +00:00
Iain Ireland 1c0ee2953c Bug 1735157: Add AliasSet::RNG r=jandem
If we bail out of Warp based on the result of an inlined call to Math.random and then resume prior to the call, the RNG state will be updated and we won't generate the same value when we resume in baseline. This can lead to repeated bailouts and in extreme cases skew the distribution of random numbers. The most straightforward fix is to make `MRandom` effectful, with a new alias set representing the RNG state. Since MRandom already isn't movable, I think this doesn't change much; there are only a few ops with `AliasSet::Load(AliasSet::Any)` that can no longer be moved past `MRandom`.

Differential Revision: https://phabricator.services.mozilla.com/D128654
2021-10-18 17:40:21 +00:00
Tooru Fujisawa 0792d1689a Bug 1720619 - Part 2: Add JS::InstantiateOptions. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D120201
2021-10-18 17:08:06 +00:00
Tooru Fujisawa 10ab81b8c7 Bug 1720619 - Part 1: Make instantiation parameters more specific. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D120200
2021-10-18 17:08:05 +00:00
Jon Coppeard fd5c145b49 Bug 1736310 - Replace WeakCache::needsSweep method with empty() r=sfink
We use the 'needsSweep' method name for two separate things. We use it in
WeakCache to check whether a cache needs to be swept at all, i.e. whether it is
not empty. We also use it in the GCPolicy trait as a method to sweep something.
GCHashMap/Set/GCVector implement it for the former reason, and so if we attempt
to use one for something that will be swept with GCPolicy it won't work.

I was going to rename the WeakCache method later anyway (because it's clearer
just to provide an empty() method) but I hadn't realised this collision was
going to happen. The patch in bug 1736021 causes a GCVector to be swept via
GCPolicy which calls the existing needsSweep() method which doesn't sweep at
all. The fix is to provide a version that does.

This will itself go away soon and be replaced with traceWeak(), but we'll fix
this problem first.

Differential Revision: https://phabricator.services.mozilla.com/D128740
2021-10-18 16:32:14 +00:00