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

87255 Коммитов

Автор SHA1 Сообщение Дата
Cosmin Sabou 2296078fe1 Bug 1787977 - Fix linting opt failure on make-source-package.py. r=glandium 2022-08-30 07:16:32 +03:00
Mike Hommey 4045d857ee Bug 1787977 - Include configure in the tree. r=firefox-build-system-reviewers,nalexander
Historically, we had configure.in in the tree, and generated configure
with autoconf via client.mk at build time, and we'd run that configure.
As a side effect, configure would be shipped in source tarballs, as with
traditional autoconf-driven software.

Bug 1671424 changed that, and made `mach build`/`mach configure` invoke
configure.py directly, without needing configure. As a side effect,
configure stopped being generated in source directories. An unexpected
side effect was that configure stopped being shipped in source tarballs.

Anyways, it has been long enough now that adding a configure file in the
tree shouldn't cause too many problems with people updating their trees
where a configure file might exist from those older builds.

Differential Revision: https://phabricator.services.mozilla.com/D155923
2022-08-30 04:02:12 +00:00
Sandor Molnar d3f5c8300e Backed out 2 changesets (bug 1775424) for causing linux hazard build bustage in js/loader/ModuleLoaderBase.cpp CLOSED TREE
Backed out changeset a043a84a771c (bug 1775424)
Backed out changeset 19bc4fafd300 (bug 1775424)
2022-08-30 02:51:29 +03:00
Yoshi Cheng-Hao Huang acd03a2a4c Bug 1775424 - Part 2: Impl import.meta.resolve in js shell. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D154791
2022-08-29 18:12:10 +00:00
Yoshi Cheng-Hao Huang a9970aa2ff Bug 1775424 - Part 1: Impl import.meta.resolve() on browser. r=jonco,yulia
Define 'resolve()' function on import.meta object on browser.

Add mochitests for import.meta.resolve, as some of the wpt tests for
import.meta.resolve cannot be run due to some bugs in wpt testing framework.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1785806

Differential Revision: https://phabricator.services.mozilla.com/D154105
2022-08-29 18:12:09 +00:00
André Bargull b5b2f20cb7 Bug 1787406 - Part 12: Remove duplicate parameter from NamedLambdaObject::create(). r=jandem
All callers are passing the same value for both parameters.

Depends on D155684

Differential Revision: https://phabricator.services.mozilla.com/D155685
2022-08-26 14:24:12 +00:00
André Bargull 8b32b89094 Bug 1787406 - Part 11: Inline CallObject::create() function into its only caller. r=jandem
Depends on D155683

Differential Revision: https://phabricator.services.mozilla.com/D155684
2022-08-26 14:24:11 +00:00
André Bargull 1948a4d2ca Bug 1787406 - Part 10: Add a post-Warp todo note. r=jandem
`noteHasDenseAdd` no longer exists, so we may want to revisit this function.

Depends on D155682

Differential Revision: https://phabricator.services.mozilla.com/D155683
2022-08-26 14:24:11 +00:00
André Bargull f0985ae95c Bug 1787406 - Part 9: Add MStoreElement::NewUnbarriered and MStoreFixedSlot::NewBarriered. r=jandem
This matches StoreFixedSlot and MStoreDynamicSlot and makes it more explicit
when pre-barriers are omitted.

Depends on D155681

Differential Revision: https://phabricator.services.mozilla.com/D155682
2022-08-26 14:24:10 +00:00
André Bargull a47880b7ae Bug 1787406 - Part 8: Remove slotType argument from MacroAssembler::storeUnboxedValue(). r=jandem
All callers are now passing `MIRType::Value`, so we can remove the `slotType` parameter
and simplify the methods.

Depends on D155680

Differential Revision: https://phabricator.services.mozilla.com/D155681
2022-08-26 14:24:10 +00:00
André Bargull 290df1f5b6 Bug 1787406 - Part 7: Remove MStoreDynamicSlot::slotType. r=jandem
There aren't any callers to `setSlotType()`, which means `slotType` is always
equal to `MIRType::Value`.

Drive-by change:
- Remove unused method `setNeedsBarrier()`.

Depends on D155679

Differential Revision: https://phabricator.services.mozilla.com/D155680
2022-08-26 14:24:10 +00:00
André Bargull 789c52f3ed Bug 1787406 - Part 6: Change "callStub" label to a local variable. r=jandem
Depends on D155678

Differential Revision: https://phabricator.services.mozilla.com/D155679
2022-08-26 14:24:09 +00:00
André Bargull 595734451f Bug 1787406 - Part 5: Always jump to the rejoinStore label. r=jandem
After the previous patches it's no longer necessary to special-case StoreElementHoleT.

Depends on D155677

Differential Revision: https://phabricator.services.mozilla.com/D155678
2022-08-26 14:24:09 +00:00
André Bargull 7640f7b76e Bug 1787406 - Part 4: Always pass MIRType::Value to MacroAssembler::storeUnboxedValue(). r=jandem
Change the `StoreElementHoleT` to also pass `MIRType::Value` instead of `MIRType::None`.
This doesn't change the behaviour because `valueType` is definitely specialized, so we
will still store the type tag.

Depends on D155676

Differential Revision: https://phabricator.services.mozilla.com/D155677
2022-08-26 14:24:08 +00:00
André Bargull f733b08523 Bug 1787406 - Part 3: MStoreElementHole is always barriered. r=jandem
`MStoreElementHole` is always barriered, so we can remove the `needsBarrier` flag.

Depends on D155675

Differential Revision: https://phabricator.services.mozilla.com/D155676
2022-08-26 14:24:08 +00:00
André Bargull 5b01a7435d Bug 1787406 - Part 2: Remove MStoreElementCommon. r=jandem
Inline `MStoreElementCommon` into its two sub-classes in preparation for the
next parts.

Depends on D155674

Differential Revision: https://phabricator.services.mozilla.com/D155675
2022-08-26 14:24:08 +00:00
André Bargull 0fb616e5b9 Bug 1787406 - Part 1: Remove MStoreElementCommon::elementType. r=jandem
There are no callers to `setElementType()`, which means `elementType` is
always equal to `MIRType::Value`.

Differential Revision: https://phabricator.services.mozilla.com/D155674
2022-08-26 14:24:07 +00:00
Julian Seward 1f92414b13 Bug 1778945 - Ion's RA: add documentation. r=jandem.
This patch adds an overview of the data structures and core algorithms of the
backtracking allocator.  NO FUNCTIONAL CHANGE.

Differential Revision: https://phabricator.services.mozilla.com/D151729
2022-08-26 13:52:54 +00:00
Mark Banner 145c8af411 Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for js/src/builtin. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D155164
2022-08-26 13:39:33 +00:00
Jon Coppeard 520b9862fc Bug 1787263 - Part 4: Don't use background threads in non-incremental GCs r=sfink
There's no point using a helper thread if we're going to wait for it
immediately. We do perform non-incremental GCs sometimes (and in shutdown) and
this avoids the possibility of scheduling issues affecting us.

This applies to background sweeping, decommiting and unmarking.

(I think I argued against this at one point, but I've come round to thinking
it's a good idea.)

Differential Revision: https://phabricator.services.mozilla.com/D155610
2022-08-26 10:24:11 +00:00
Jon Coppeard 71b7973097 Bug 1787263 - Part 3: Refactor zone state checks into Zone::shouldMarkInZone r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D155606
2022-08-26 10:24:10 +00:00
Jon Coppeard c343b85b53 Bug 1787263 - Part 2: Remove atoms zone special case by starting it in marking black and gray state r=sfink
We have an extra check in DoMarking that allows gray marking in the atoms zone
even when it's in the marking black only state. It's simpler to start this zone
in the marking black and gray state and remove the special case.

The reason for this case is that we can't delay gray marking in zones that are
marking black only for atoms like we do for objects. In that case we push the
CCWs into the black zone on a list and mark them later when that zone
transitions to black and gray marking. But the atoms zone may have direct
references from any zone that don't go through CCWs.

Differential Revision: https://phabricator.services.mozilla.com/D155605
2022-08-26 10:24:10 +00:00
Jon Coppeard bccb5e57b2 Bug 1787263 - Part 1: Make some things non-atomic that are only written on the main thread r=sfink
Previously these were atomic because we supported allocation off-main-thread.

Differential Revision: https://phabricator.services.mozilla.com/D155604
2022-08-26 10:24:09 +00:00
criss 3c12109fa0 Merge autoland to mozilla-central. a=merge 2022-08-26 07:22:58 +03:00
Steve Fink 4d9a288912 Bug 1785942 - Use constructors for JSString subclasses. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D155136
2022-08-25 23:26:55 +00:00
Steve Fink b2fd00d6f2 Bug 1785942 - Expose function that avoids some excess NUL termination r=arai
Differential Revision: https://phabricator.services.mozilla.com/D155135
2022-08-25 23:26:54 +00:00
Steve Fink 942688b7df Bug 1785942 - Move more allocation code into the friend-able js::gc::CellAllocator class (was struct) r=arai
Differential Revision: https://phabricator.services.mozilla.com/D155137
2022-08-25 23:26:54 +00:00
Steve Fink ab9ba4bc66 Bug 1628014 - Replace StringT::emplace() methods with direct calls to constructor (from a friend struct). r=arai
Differential Revision: https://phabricator.services.mozilla.com/D155138
2022-08-25 23:26:54 +00:00
Steve Fink 0d809970b9 Bug 1628014 - Add typed Cell::NewCell<T>() and cx->newCell<T>() methods r=jonco,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D135435
2022-08-25 23:26:53 +00:00
Steve Fink b2212f1aed Bug 1746699 - Change all callers of js::Allocate<T>() to properly use placement new instead of casting r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D134116
2022-08-25 23:26:53 +00:00
Steve Fink ef07643994 Bug 1746699 - Avoid pointing to untyped memory with TenuredChunk* pointers (reduces UB) r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D134096
2022-08-25 23:26:52 +00:00
Steve Fink 876f784fce Bug 1746699 - Avoid UB when allocating JSStrings and BigInts r=tcampbell
Add emplace methods to JSString and BigInt types to reduce amount of C++
undefined-behaviour by running the constructor of the concrete derived type.
This is in contrast to previous behaviour of allocating a gc::Cell and then
simply casting to the final type. We still first allocate as a Cell from the GC
and then use placement-new to initialize as the correct type.

Differential Revision: https://phabricator.services.mozilla.com/D134095
2022-08-25 23:26:51 +00:00
Butkovits Atila cf88b36513 Backed out changeset eb01cc5511fc (bug 1782450) for causing Bug 1787244. CLOSED TREE 2022-08-25 23:10:01 +03:00
Iain Ireland a9feeaaf61 Bug 1785200: Fix receiver handling in sparse and generic element ICs r=jandem
It's probably possible to juggle registers around to make this work on 32-bit x86, but it doesn't seem worthwhile. `copyToScratchValueRegister` doesn't work, because `AutoCallVM::prepare` uses the output as a scratch register.

I added one testcase specifically targeting the original fuzzbug, and another slightly broader testcase based on the testcase we added for `tryAttachGenericElement` (bug1488786.js).

Differential Revision: https://phabricator.services.mozilla.com/D155298
2022-08-25 19:53:49 +00:00
André Bargull 1b906313da Bug 1786844: Handle MGuardToFunction and MGuardFunctionScript during scalar replacement. r=iain
This allows to scalar replace the `MNewCallObject` in cases like:
```js
function f() {
  var r = 0;
  for (var i = 0; i < 100; ++i) {
    var fn = i => () => i;
    r += fn(i)();
  }
  return r;
}
```

This code is compiled to:
```
48 lambda newcallobject43:Object constant47:Object
53 guardtofunction lambda48:Object
54 guardfunctionscript guardtofunction53:Object
57 functionenvironment guardfunctionscript54:Object
```

`MGuardToFunction` and `MGuardFunctionScript` weren't present in Ion when scalar
replacement support for `MNewCallObject` was originally implemented. For Warp
we need to handle those two instructions, too.

There aren't any new tests, because `MNewCallObject` is an implementation detail
and can't be tested from JS. (The `MLambda` is already scalar replaced without
this change.)

Differential Revision: https://phabricator.services.mozilla.com/D155470
2022-08-25 17:27:53 +00:00
Nicolas B. Pierron c7e2579b91 Bug 1779940 part 4 - Use ScopeBindingCache to speed-up binding lookup. r=arai
When generating bytecode, we are looking for names locations, using
`ScopeContext::searchInEnclosingScope`, to replace them by integers, which
improve the speed of the generated code.

However, looking for these names can it-self be extremlly costly if there is a
scope with a very large number of bindings. Multiple attempts have been made in
the past to improve this situation by caching bindings within the scope of each
compilation. Unfortunately, this was either a regression or a non-improvement,
as these lookups might be done by thousands of inner functions.

This patch adds content to the `ScopeBindingCache`, introduced in the previous
patch as placeholder. The `ScopeBindingCache` is a cache which persists across
multiple compilations. Therefore, if a scope chain is shared by multiple
delazified inner function, the caching cost would be mutualized.

The `ScopeBindingCache`, as the `searchInEnclosingScope` function have to deal
with 2 different kind of scopes. Either we are manipulating stencils, in case of
concurrent delazification, or we are manipulating GC objects, in case of
on-demand delazification. Thus the interface provide overloaded functions to be
able to write generic code, and contains 2 `ScopeBindingMap`, one for each type
of atoms `TaggedParserAtomIndex` and `JSAtom*` respectively coming from scope
`*::ParserData` and `*::RuntimeData` of each scope.

The `ScopeBindingMap` is a `HashMap` indexed on the `AbstactBaseScopeData` for
each Atom type. It maps the scope data, i-e the pointer to the array of
bindings, to the `BindingMap`.

The `BindingMap` provides a `HashMap` and a `catchAll` field. The `HashMap` is
used to map each binding to its `NameLocation`, while the `catchAll` is used to
handle the case where the scope is used to collect all new names, when
dynamically created.

The `BindingMap`'s `hashMap` makes use of the lookup capability of `HashTable`
in order to avoid storing the context of each atom next to each key. As all
bindings are coming from the same scope data. Thus the `Lookup` provides the
context to interpret the keys which are stored in the `hashMap`. This `HashMap`
also feature the ability to compare all 3 different atoms possible. The
comparisons between these 3 different atoms is handled by the `GenericAtom`
class.

The `GenericAtom` class provides a uniform interface for comparing the 3
different type of atoms against each others, such that atoms can be registered
in the `BindingMap` with one type, while being look up with the same or
different type. The `GenericAtom` exposes a `hash` field, which is consistent
across all atoms types, as well as an equality operator. The 3 different atoms
types are: `TaggedParserAtomIndex` provided by the `ScopeStencilRef`, the
`TaggedParserAtomIndex` provided by the `ParserAtomTable` and the `JSAtom*` from
GC objects.

Differential Revision: https://phabricator.services.mozilla.com/D154514
2022-08-25 15:03:30 +00:00
Nicolas B. Pierron 16d8e1e10e Bug 1779940 part 3 - Add dummy ScopeBindingCache, and get it across. r=arai
This patch isolate the boiler plate code to create a dummy ScopeBindingCache
with no logic to split the noise of this not-so mechanical patch driven by
compiler error messages.

This patch modify the interface of every function, adding the option to provide
a custom ScopeBindingCache when parsing a Stencil, except for publicly facing
functions such as from `js/public/experimental/JSStencil.h`.

The intent being that Helper thread functions, which are relying on Stencil
should have their own ScopeBindingCache which is either unused, or dedicated to
caching the bindings of multiple delazifications. The reasons are that in the
future we are interested in stripping the JSContext* out of HelperThreads, and
that there is no value in sharing the content across threads.

Differential Revision: https://phabricator.services.mozilla.com/D154513
2022-08-25 15:03:30 +00:00
Nicolas B. Pierron 13f4bc063d Bug 1779940 part 1 - Short circuit TaggedParserAtomIndex and JSAtom comparisons. r=arai
This patch adds 2 short-circuits to improve the lookup of bindings in the
enclosing scope chain, during on-demand delazification.

The first short-circuit is in Function scope, by comparing bindings against each
others, we can compare either `JSAtom` directly against `JSAtom` or
`TaggedParserAtomIndex` directly with `TaggedParserAtomIndex` from the
CompilationStencil context.

The second short-circuit is in `InputName::isEqualTo`, in the case where we are
comparing a `JSAtom` against the `TaggedParserAtomIndex` from the compiled
script, we can query the hash of both and compare them before converting the
`TaggedParserAtomIndex` into a `JSAtom`, which should make the comparison
faster.

Differential Revision: https://phabricator.services.mozilla.com/D154511
2022-08-25 15:03:29 +00:00
Nicolas B. Pierron 77532801d8 Bug 1779940 part 0 - Move the hops offsetting out of searchInEnclosingScope. r=arai
This patch moves the hops offseting out of the `searchInEnclosingScope`
computation such that `searchInEnclosingScope` computation can provide a result
which is independent from where the named is looked for. Making the NameLocation
independent enables us to later cache the NameLocation.

Differential Revision: https://phabricator.services.mozilla.com/D154510
2022-08-25 15:03:28 +00:00
Tooru Fujisawa 4ce6d539fd Bug 1782450 - Update comment for EnvironmentObject.h and add testcases for non-syntactic scope. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D153727
2022-08-25 11:28:56 +00:00
André Bargull 9cd55c2eb2 Bug 1786803: Add missing includes for JSONPrinter. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D155461
2022-08-24 12:06:51 +00:00
Jon Coppeard 7debf672ba Bug 1785772 - Part 4: Give pre-barrier verification its own Zone GC state to simply marking check r=sfink
We check for pre-barrier verification during marking. This simplifies the
shouldMarkInZone() check so we only need to check the zone's GC state.

Differential Revision: https://phabricator.services.mozilla.com/D154971
2022-08-24 09:52:45 +00:00
Jon Coppeard 0e44729a3f Bug 1785772 - Part 3: Optimise checking multiple zone states at once using a bitmask r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D154970
2022-08-24 09:52:44 +00:00
Jon Coppeard a490ae0bf9 Bug 1785772 - Part 2: Make GenericTracerImpl onEdge methods final r=sfink
These are never overriden so can be marked final.

Differential Revision: https://phabricator.services.mozilla.com/D154968
2022-08-24 09:52:44 +00:00
Jon Coppeard f99450930d Bug 1785772 - Part 1: Use macros to reduce boilerplate when defining methods/functions for every trace kind r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D154967
2022-08-24 09:52:44 +00:00
Jon Coppeard 97e106597e Bug 1786506 - Part 4: Remove checks for GC things owned by other runtimes where possible r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D155380
2022-08-24 09:43:07 +00:00
Jon Coppeard ec14e40c56 Bug 1786506 - Part 3: Make Zone GC state non-atomic r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D155379
2022-08-24 09:43:07 +00:00
Jon Coppeard 1e45c6a381 Bug 1786506 - Part 2: Give shared permanent things their own zone r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D155378
2022-08-24 09:43:06 +00:00
Jon Coppeard 9114e9b70b Bug 1786506 - Part 1: Add ZoneList prepend operation and use move semantics to indicate argument list is consumed r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D155377
2022-08-24 09:43:06 +00:00
Jon Coppeard 1a8fbf7ec2 Bug 1786309 - Part 4: Simplify zone iteration r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D155227
2022-08-24 09:00:37 +00:00