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

76720 Коммитов

Автор SHA1 Сообщение Дата
Razvan Maries a1b92d521b Backed out 3 changesets (bug 1636495) for SM bustages at huge-01.binjs. CLOSED TREE
Backed out changeset 5be0a4315674 (bug 1636495)
Backed out changeset 7ac33283a786 (bug 1636495)
Backed out changeset 4b98c08423c9 (bug 1636495)
2020-05-12 20:19:37 +03:00
Tom Schuster b7db8a47f6 Bug 1636918 - Folding for MGuardNullOrUndefined. r=jandem
Depends on D74705

Differential Revision: https://phabricator.services.mozilla.com/D74706
2020-05-12 12:56:58 +00:00
Tom Schuster 06b716ad06 Bug 1636918 - Folding for MGuardValue. r=jandem
Depends on D74704

Differential Revision: https://phabricator.services.mozilla.com/D74705
2020-05-12 12:55:43 +00:00
Tom Schuster 1a134518a1 Bug 1636918 - Folding for MGuardSpecificAtom. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D74704
2020-05-12 12:54:48 +00:00
Lars T Hansen 3cafef45a1 Bug 1635917 - Correct RegsToPreserve in WasmStubs. r=bbouvier
RegsToPreserve must contain the correct float registers *and* be immune to
PushRegsInMask stripping out the SIMD registers in non-SIMD builds before
it performs register set reduction.  The correct mask to start with is
therefore AllMask, not AllVector128Mask, as the latter is stripped down to
an empty set, not reduced down to the set of doubles.

This bug came in with the SIMD patch and affects non-SIMD builds on x64
as well as all builds on x86.

Differential Revision: https://phabricator.services.mozilla.com/D74825
2020-05-12 15:33:10 +00:00
Iain Ireland 5a55340325 Bug 1636495: Add JS::CheckRegExpSyntax r=evilpie
To make sure that `<input>` elements with `pattern` attributes update their validation state (`:invalid`) properly, nsContentUtils::IsPatternMatching needs to be able to distinguish between parsing errors caused by an invalid pattern, vs parsing errors caused by OOM/overrecursion.

This patch also fixes up the places inside the new regexp engine where we can throw over-recursed to make sure that we set the right flag on the context, then fixes regexp/huge-01.js (and the binast variants) to accept a different error message.

Differential Revision: https://phabricator.services.mozilla.com/D74499
2020-05-12 14:08:40 +00:00
Ted Campbell f825a73afa Bug 1637283 - Use SFINAE to prevent Cell::is<JSFunction>() and friends. r=jonco
Introduce JS::IsBaseTraceType to check if a type is the canonical type
associated with a TraceKind. Use this with SFINAE to make footguns turn into
compile errors.

Differential Revision: https://phabricator.services.mozilla.com/D74869
2020-05-12 16:10:41 +00:00
Ted Campbell b73f4bfdae Bug 1637283 - Fix misuses of Cell::is<T>() and friends. r=jonco
The `{Cell,TenuredCell,GCCellPtr}::{is,as}<T>()` methods can be footguns if
called on derived types. Only the TraceKind must match which is rarely what
is expected.

Differential Revision: https://phabricator.services.mozilla.com/D74868
2020-05-12 16:10:33 +00:00
Iain Ireland ed16d4c775 Bug 1637199: Change name of irregexp version file r=mgaudet DONTBUILD
On OSX, mach is picking this up for `#include <version>`.

Differential Revision: https://phabricator.services.mozilla.com/D74852
2020-05-12 14:34:52 +00:00
Dorel Luca 609e319c24 Merge mozilla-central to autoland. CLOSED TREE 2020-05-12 17:32:56 +03:00
Sebastian Hengst 211cd02676 Backed out 3 changesets (bug 1636495) for crashes when e.g. a url gets pasted into Slack (bug 1637243). a=backout
Backed out changeset 4cbaef432cb8 (bug 1636495)
Backed out changeset 87f9a3035dd8 (bug 1636495)
Backed out changeset cb0d2a799a63 (bug 1636495)
2020-05-12 16:01:28 +02:00
Sebastian Hengst ff55bf0ffc Backed out 12 changesets (bug 1634135) for causing crashes e.g. when urls get pasted in Slack (bug 1637243). a=backout
Backed out changeset ee1018a8611a (bug 1634135)
Backed out changeset 0081b4c73633 (bug 1634135)
Backed out changeset 4eda5acc8e1f (bug 1634135)
Backed out changeset d8f770d123f2 (bug 1634135)
Backed out changeset 3f680457842f (bug 1634135)
Backed out changeset f3b9c956fa85 (bug 1634135)
Backed out changeset b3b82e1cda7f (bug 1634135)
Backed out changeset 9dddfd577a3d (bug 1634135)
Backed out changeset ba01ceb63cf3 (bug 1634135)
Backed out changeset f53110858cb9 (bug 1634135)
Backed out changeset 49b9d6a8a3a5 (bug 1634135)
Backed out changeset a73e5ff68480 (bug 1634135)
2020-05-12 16:00:06 +02:00
Ted Campbell 62a97bd824 Bug 1631407 - Move inferred/guessed names into FunctionBox. r=mgaudet
Use the FunctionFlags in the FunctionBox to distinguish explict, inferred,
and guessed atom types. When inter-converting between FunctionBox and
JSFunctions we now sync all types of atoms.

Note that if the function pre-exists, we still propagate the name directly.
The code coverage initialization is triggered by fullyInitFromStencil which
is not fully deferred yet, so we need to the setInferredName to take effect
before then.

Differential Revision: https://phabricator.services.mozilla.com/D74728
2020-05-12 12:36:32 +00:00
André Bargull a3a9f4d7f1 Bug 1636414 - Part 2: Remove MStoreUnboxedScalar::storageType. r=jandem
`StoreUnboxedScalarBase::writeType` provides the same information.

Differential Revision: https://phabricator.services.mozilla.com/D74389
2020-05-12 10:15:33 +00:00
André Bargull 1a0f26d50b Bug 1636414 - Part 1: Remove TruncateInputKind from MStoreUnboxedScalar. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D74388
2020-05-12 10:15:07 +00:00
André Bargull 82cd88c0c4 Bug 1636424 - Part 3: Use mozilla::NativeEndian to swap bytes in DataViews. r=jandem
Depends on D74395

Differential Revision: https://phabricator.services.mozilla.com/D74396
2020-05-12 10:14:54 +00:00
Lars T Hansen 43173e9f50 Bug 1635783 - Add a fast path for stack normalization. r=rhunt
Stack normalization is uber-slow on emulator because it relies on
regexes that are compiled to native instructions which are then
emulated.  That makes stack normalization very slow too, and as it's
very hot some tests will time out nearly always.

This patch inserts a simple cache for previously matched strings in
stack normalization to avoid the regex engine altogether.  This speeds
up normalization and hence stack matching greatly (I observed a factor
of four speedup per test iteration on an arm-sim noopt debug build for
ion-error-ool.js).

I also attempted some other fixes (filtering on simple strings,
avoiding regex.replace, etc) but caching is by far the most effective
fix, and with caching in place the other fixes still don't really move
the needle.

Depends on D74220

Differential Revision: https://phabricator.services.mozilla.com/D74607
2020-05-11 14:30:44 +00:00
André Bargull 1aa89989ab Bug 1636424 - Part 2: Replace MOZ_ALIGNOF with alignof. r=jandem
Depends on D74394

Differential Revision: https://phabricator.services.mozilla.com/D74395
2020-05-11 09:04:41 +00:00
André Bargull a95b197b89 Bug 1636424 - Part 1: Use UnsignedStdintTypeForSize to determine the unsigned integer representation. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D74394
2020-05-11 09:04:11 +00:00
Yoshi Cheng-Hao Huang ede21ac58b Bug 1634720 - use UniquePtr::reset to release the pointer. r=KrisWright
After fixing the timeout, I found there's a leak for the RunnableTask
dispatched to HelperThreadPool.

Differential Revision: https://phabricator.services.mozilla.com/D74736
2020-05-12 07:15:24 +00:00
Yoshi Cheng-Hao Huang abb43a4823 Bug 1634720 : Add HelperThreadPoolShutdownObserver to shut down HelperThreadPool. r=KrisWright
When nsThreadManager shuts down, it will shutdown all the threads,
including the main thread of HelperThreadPool.

However the main thread of HelperThreadPool has been waiting.
https://searchfox.org/mozilla-central/rev/446160560bf32ebf4cb7c4e25d7386ee22667255/xpcom/threads/nsThreadPool.cpp#277

and nsThreadManager will have to wait until HelperThreadPool wakes up to
shutdown the main thread of HelperThreadPool.

Adding a HelperThreadPoolShutdownObserver to observe the
xpcom-shutdown-threads notification, and shut down HelperThreadPool
accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D74735
2020-05-12 03:38:54 +00:00
Lars T Hansen cf386712a1 Bug 1635783 - Make an error message match more flexible. r=rhunt
When SIMD is not enabled, v128 is not mentioned in the error message,
so make allowances for that.

Differential Revision: https://phabricator.services.mozilla.com/D74220
2020-05-11 08:30:06 +00:00
Jan de Mooij de2f4c690d Bug 1636916 part 4 - Use branchValueIsNurseryCell instead of branchValueIsNurseryObject. r=jonco
Now that branchValueIsNurseryCell is as efficient as branchValueIsNurseryObject
we no longer need branchValueIsNurseryObject.

Depends on D74649

Differential Revision: https://phabricator.services.mozilla.com/D74650
2020-05-11 17:24:27 +00:00
Jan de Mooij cd89fa3820 Bug 1636916 part 3 - Optimize branchValueIsNurseryCell using branchTestGCThing. r=jonco
It's more efficient now to check for all GC things with a single branch instead of
checking for object/string/BigInt separately. This generates more compact code with
fewer branches and is also more maintainable.

Depends on D74648

Differential Revision: https://phabricator.services.mozilla.com/D74649
2020-05-11 17:24:27 +00:00
Jan de Mooij 5d0033b51b Bug 1636916 part 2 - Add branchTestGCThing to the MacroAssembler. r=jonco
Depends on D74647

Differential Revision: https://phabricator.services.mozilla.com/D74648
2020-05-11 17:24:27 +00:00
Jan de Mooij 020463c39c Bug 1636916 part 1 - Rename unboxGCThingForPreBarrierTrampoline to unboxGCThingForGCBarrier. r=jonco
Also add ValueOperand overloads on 64-bit platforms.

A later patch will also call this for the post barrier.

Differential Revision: https://phabricator.services.mozilla.com/D74647
2020-05-11 17:24:26 +00:00
Andrew McCreight f9c07914d4 Bug 1636990 - Inline NS_NewBackstagePass. r=kmag
Also, make an NS_ERROR in ~mozJSComponentLoader() into an assertion.

Differential Revision: https://phabricator.services.mozilla.com/D74691
2020-05-11 22:46:24 +00:00
Tom Schuster 7824fc6e57 Bug 1277801 - Remove Object.prototype.toString classname fallback. r=jwalden
Similar to a patch by Robin Templeton <robin@igalia.com>

Differential Revision: https://phabricator.services.mozilla.com/D72459
2020-05-11 20:53:10 +00:00
Tom Schuster 25a8ce26ec Bug 1277801 - Introduce Cu.isOpaqueWrapper. r=peterv
With the following changes Object.prototype.toString is not using the JSClass' name
anymore. This means we now fail to detect opaque wrappers, because they just get the default string: [object Object]

Differential Revision: https://phabricator.services.mozilla.com/D74016
2020-05-11 20:53:10 +00:00
Iain Ireland 3b3ca714ac Bug 1635275: Add fuzzing target r=decoder
This patch adds a C++ libfuzzer target for differential testing between the interpreter and compiler of the new regexp engine.

Differential Revision: https://phabricator.services.mozilla.com/D73768
2020-05-11 09:41:13 +00:00
Iain Ireland 52982ba943 Bug 1634135: Turn new regexp engine on by default in Nightly r=mgaudet
Pull the lever!

(After responsibly waiting for 78 to open.)

Differential Revision: https://phabricator.services.mozilla.com/D73120
2020-05-10 16:00:26 +00:00
Iain Ireland c329847916 Bug 1634135: Update test_xrayToJS to handle Regexp.prototype.dotAll r=bholley
We are adding support for the dotAll (/s) RegExp flag, so the list of expected properties on the RegExp prototype has to be updated.

Differential Revision: https://phabricator.services.mozilla.com/D74149
2020-05-10 16:00:27 +00:00
Iain Ireland cb0db7ce7c Bug 1634135: Don't leak Isolate r=mgaudet
ASAN found a leak.

We destroy the isolate with a level of indirection through RegexpAPI so that JSContext doesn't have to be able to see the full definition of Isolate.

Differential Revision: https://phabricator.services.mozilla.com/D74151
2020-05-10 16:00:27 +00:00
Iain Ireland ea3297a5fd Bug 1634135: Update tests to expect RegExp.prototype.dotAll r=mgaudet
These two tests need to be updated to be aware of the new dotAll flag.

If we ever have to turn off the new engine, this patch should also be temporarily reverted.

Depends on D73118

Differential Revision: https://phabricator.services.mozilla.com/D73119
2020-05-10 16:00:26 +00:00
Iain Ireland bc9396b9ab Bug 1634135: Throw 'regexp too big' errors properly r=mgaudet
If a regular expression is too big, the assembler may fail with RegExpError::kTooLarge. When it does so, we want to throw an error: "regexp too big".

Until the most recent reimport of irregexp, we were actually reporting an OOM in these cases, because `CompilationResult::code` was default-constructed as an UndefinedValue and we took the "OOM in GetCode" path. Now `CompilationResult::code` is a Handle, so we crash if we try to access the value.

Making the situation slightly more complicated is the fact that we still have a macroassembler live, which means that we can't GC, which means that we can't report an error. The old code used an AutoSuppressGC for this (https://searchfox.org/mozilla-central/source/js/src/irregexp/RegExpEngine.cpp#1703), but that seems like an extremely blunt instrument.

Instead, I've refactored `CompilePattern` to call a separate `Assemble` function. This means that we clean up the macroassembler before we call `JS_ReportErrorASCII`. The new function is a straight copy-paste of the old code, except for error handling and `.` to `->` conversions for the values being passed by reference. Note that the order of checks has changed after calling `compiler->Assemble(...)`: now we check `result.Succeeded()` before examining `result.code`.

We also change the shared labels in SMRegExpMacroAssembler to be NonAssertingLabels. This suppresses assertions in the Label destructor that they are not used without being bound. The assertion is already suppressed for OOM (https://searchfox.org/mozilla-central/source/js/src/jit/Label.h#82-86), which is why we did not trigger it previously.

Differential Revision: https://phabricator.services.mozilla.com/D73758
2020-05-10 16:00:26 +00:00
Iain Ireland b682d4ed50 Bug 1634135: Update shim code r=mgaudet
There are a few changes here:

1. The code that used to be in wrapBody was moved to RegExpCompiler::PreprocessRegExp.

2. The `code` field in RegExpCompileData used to be a bare Object, and is now a Handle<Object>. (This makes named captures way easier to implement, because it lets us to allocate GC things while parsing a regexp without angering the hazard analysis.) I also took this opportunity to remove some dead code in the shim implementation of Handle.

3. Upstream V8 made a change to simplify the interface with the interpreter. Previously, the caller of IrregexpInterpreter::MatchForCallFromRuntime was responsible for allocating enough memory to hold both the capture results and the scratch registers. Now, the interpreter has the same interface as the compiler: the caller passes in a buffer large enough to hold the capture results, and the memory for the scratch registers is allocated internally. This requires a few small additions to the shim (IsInRange plus new methods on JSRegExp and SmallVector).

Depends on D73117

Differential Revision: https://phabricator.services.mozilla.com/D73118
2020-05-10 16:00:26 +00:00
Iain Ireland c382d6024a Bug 1634135: Fresh import of irregexp r=mgaudet
This is as good a time as any to pull in some recent upstream changes (many of which I wrote). This patch was auto-generated using import-irregexp.py. The necessary changes to the shim code are in the next patch.

Depends on D73116

Differential Revision: https://phabricator.services.mozilla.com/D73117
2020-05-10 16:00:25 +00:00
Iain Ireland 07213c14be Bug 1634135: Eagerly tier up for long regexp inputs r=mgaudet
Interpreted bytecode is ~3-5 times slower than compiled code, but ~5-10 times smaller. In general it seems like this is a good trade-off for the first few iterations, but for particularly long input strings this can cause a significant slowdown before we tier up. V8 eagerly tiers up to compiled code when the input string is 1000+ characters long. Following their lead on this fixes a significant regression in sunspider-regexp-dna.

Differential Revision: https://phabricator.services.mozilla.com/D73116
2020-05-10 16:00:25 +00:00
Iain Ireland b53b307279 Bug 1634135: Disable named capture parsing until fully supported r=mgaudet
The engine supports parsing named captures, but we don't have the code in place to expose the captured groups. Until we do, this code will make sure that we get a syntax error when parsing them.

Differential Revision: https://phabricator.services.mozilla.com/D73115
2020-05-10 16:00:25 +00:00
Iain Ireland c649d7049e Bug 1634135: Fix look-behind back-references r=jandem
If a look-behind back-reference succeeds, we have to subtract the length of the capture from the current position (so that the current position points to the beginning of the capture). We don't have the length in a register, so we have to read it from the capture registers, which are stored on the stack. However, we pushed the initial value of the current position, so the stack pointer is offset by one word from where we expect.

The fix is to pop the saved value *before* subtracting the length.

With this fix, we pass all the test262 tests for look-behind assertions, dotAll, and unicode property escapes. (I will turn them on in a separate bug.)

Depends on D73112

Differential Revision: https://phabricator.services.mozilla.com/D73113
2020-05-10 16:00:25 +00:00
Iain Ireland 465770d528 Bug 1634135: Fix dummy TokenStream r=djvj
This was broken by changes to token streams in bug 1592105.

Differential Revision: https://phabricator.services.mozilla.com/D73112
2020-05-10 16:00:24 +00:00
Iain Ireland 560559ea48 Bug 1636495: Add JS::CheckRegExpSyntax r=evilpie
To make sure that `<input>` elements with `pattern` attributes update their validation state (`:invalid`) properly, nsContentUtils::IsPatternMatching needs to be able to distinguish between parsing errors caused by an invalid pattern, vs parsing errors caused by OOM/overrecursion.

This patch also fixes up the places inside the new regexp engine where we can throw over-recursed to make sure that we set the right flag on the context, then fixes regexp/huge-01.js (and the binast variants) to accept a different error message.

Differential Revision: https://phabricator.services.mozilla.com/D74499
2020-05-11 17:46:17 +00:00
André Bargull 8da12608b3 Bug 1568464: Generate list of sanctioned unit identifiers. r=jwalden
With this patch the list of sanctioned identifiers in the C++ and JS source
files is automatically generated from the yaml file. And we also check that
the ICU data filter file includes all necessary unit resources.

This also renames `MeasureUnit::subtype` to `MeasureUnit::name` for clarity.

Differential Revision: https://phabricator.services.mozilla.com/D73031
2020-05-11 15:16:53 +00:00
Kannan Vijayan 3f48c7f050 Bug 1636183 - Expose QuoteString internals via header files. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D74263
2020-05-11 16:05:01 +00:00
Ted Campbell c7ee2ad411 Bug 1636796 - Add ScriptStencil::intoScript. r=mgaudet
This performs JSScript allocation by consuming the Stencil. For now we leave
handling of delazification compiles alone.

Differential Revision: https://phabricator.services.mozilla.com/D74572
2020-05-11 14:41:52 +00:00
Ted Campbell 967be3648e Bug 1636796 - Use ScriptStencil::immutableFlags to create JSScript. r=mgaudet
Use the ScriptStencil copy of flags which also includes computed flags. We
also fix up the flag computation in the SmooshFrontend to be more complete
and explicit.

Differential Revision: https://phabricator.services.mozilla.com/D74571
2020-05-11 14:41:44 +00:00
Ted Campbell 06cf2c7e46 Bug 1636795 - Remove ScriptStencil::finishGCThings. r=mgaudet
BytecodeEmitter and Smoosh use the same implementation so de-virtualize and
inline the implementation.

Differential Revision: https://phabricator.services.mozilla.com/D74570
2020-05-11 14:41:42 +00:00
Ted Campbell f8ae8df48b Bug 1636795 - Remove ScriptStencil::finishInnerFunctions. r=mgaudet
Instead, have a batch process at end of bytecode emission just before reading
out the result script. We do this for functions that are inner to a script we
are generating bytecode code. These functions may still be lazy but they are
potentially exposed in JSOp::Lambda/LambdaArray ops.

Differential Revision: https://phabricator.services.mozilla.com/D74569
2020-05-11 14:41:40 +00:00
Ted Campbell 5d07273da7 Bug 1636794 - Reflect.parse no longer needs to allocate gc-things. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D74568
2020-05-11 12:14:46 +00:00
Tom Schuster c585c049dc Bug 1635958 - Warp: Transpile GuardIsNull/Undefined. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D74460
2020-05-11 08:51:22 +00:00