Commit Graph

72388 Commits

Author SHA1 Message Date
Jon Coppeard
0983a25117 Bug 1571008 - Make background alloc kind selection less confusing r=jandem
This renames a couple of functions to hopefully make their intent clearer add adds comments and assertions.

Differential Revision: https://phabricator.services.mozilla.com/D44014

--HG--
extra : moz-landing-system : lando
2019-08-30 12:51:09 +00:00
Jan de Mooij
cc6958bf73 Bug 1573674 part 2 - Don't report OOM exceptions to Nightly-only error interceptor hook. r=Yoric
Depends on D43583

Differential Revision: https://phabricator.services.mozilla.com/D43584

--HG--
extra : moz-landing-system : lando
2019-08-30 11:44:14 +00:00
Jan de Mooij
4feca0fe03 Bug 1573674 part 1 - Move JSContext::setPendingException to the cpp file. r=Yoric
There's a lot of code and this path is slow enough that a non-inlined call isn't
going to be an issue.

Differential Revision: https://phabricator.services.mozilla.com/D43583

--HG--
extra : moz-landing-system : lando
2019-08-28 12:02:04 +00:00
Jeff Walden
9a616cf572 Bug 1577373 - Move various streams miscellaneous operations to a separate file. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D43910

--HG--
rename : js/src/builtin/Stream.cpp => js/src/builtin/streams/MiscellaneousOperations.cpp
extra : moz-landing-system : lando
2019-08-30 05:23:28 +00:00
Jeff Walden
7d68fbb3ce Bug 1577373 - Move queueing strategies details into builtin/streams/QueueingStrategies.*. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D43909

--HG--
rename : js/src/builtin/Stream.cpp => js/src/builtin/streams/QueueingStrategies.cpp
rename : js/src/builtin/Stream.h => js/src/builtin/streams/QueueingStrategies.h
extra : moz-landing-system : lando
2019-08-30 05:23:11 +00:00
Jeff Walden
44919405dd Bug 1577373 - Rename the streams CLASS_SPEC macro to JS_STREAMS_CLASS_SPEC and move it to its own header. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D43908

--HG--
extra : moz-landing-system : lando
2019-08-30 05:23:02 +00:00
Jeff Walden
cd97b0921d Bug 1577373 - Move queue-with-sizes operations out of builtin/Stream.* into builtin/streams/QueueWithSizes.*. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D43907

--HG--
rename : js/src/builtin/Stream.cpp => js/src/builtin/streams/QueueWithSizes.cpp
extra : moz-landing-system : lando
2019-08-30 05:22:51 +00:00
Jeff Walden
40f2ba98f0 Bug 1577373 - Rename SetNewList to StoreNewListInFixedSlot, and move it into vm/List-inl.h for use in multiple files. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D43906

--HG--
extra : moz-landing-system : lando
2019-08-30 05:22:41 +00:00
Cameron Kaiser
fc7944e672 Bug 1576303 - Temporary compiler workaround for crashes on ppc64le. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D43715

--HG--
extra : moz-landing-system : lando
2019-08-30 02:28:39 +00:00
Bogdan Tara
89d98a3a0a Backed out 9 changesets (bug 1518210) for hazard failure on ArrayBufferObject.cpp CLOSED TREE
Backed out changeset 6e2e9274465d (bug 1518210)
Backed out changeset 39fc18ada840 (bug 1518210)
Backed out changeset b88d66dddeff (bug 1518210)
Backed out changeset 40e3f38af193 (bug 1518210)
Backed out changeset 777aa22c9e8a (bug 1518210)
Backed out changeset eb3fbf8bfb2b (bug 1518210)
Backed out changeset dc63fd0bbe58 (bug 1518210)
Backed out changeset 12ea41537e05 (bug 1518210)
Backed out changeset 4c8fe76ad293 (bug 1518210)
2019-08-30 06:12:06 +03:00
Ryan Hunt
c1bc991a46 Bug 1518210 - Wasm: Don't run --wasm-disable-huge-memory if the platform doesn't support huge memory. r=lth
This commit extends the jit-test runner to support
'skip-variant-if: $FLAG, $COND', and uses this to not run
'--wasm-disable-huge-memory' tests when the platform doesn't support huge
memory.

Differential Revision: https://phabricator.services.mozilla.com/D43670

--HG--
extra : moz-landing-system : lando
2019-08-30 02:34:10 +00:00
Ryan Hunt
a1b2f83793 Bug 1518210 - Wasm: Make wasm::IsHugeMemoryEnabled() a component of the BuildID for correct invalidation of cached code. r=lth
We can't deserialize code that doesn't contain bounds checks if we have
dynamically switched to not using huge memory. This commit uses BuildID to
invalidate cached code correctly.

Differential Revision: https://phabricator.services.mozilla.com/D41870

--HG--
extra : moz-landing-system : lando
2019-08-30 02:33:56 +00:00
Ryan Hunt
b16d363657 Bug 1518210 - Wasm: Conditionally create huge memory's based on wasm::IsHugeMemoryEnabled. r=lth
This commit modifies WasmMemoryObject, ArrayBufferObject,
SharedArrayBufferObject to support conditionally using huge memory based on the
global flag.

The memory logic is fairly involved and entangled, making this change a bit
tricky.

The following changes were made:

* Stopped conditionally compiling huge memory constants and prefixed them with `Huge`
* Stopped conditionally compiling `ExtendBufferMapping` and `wasmMovingGrowToSize`
* Renamed `CreateBuffer` to `CreateSpecificWasmBuffer`
	* For clarity
* Moved maxSize clamping into `CreateSpecificWasmBuffer`
	* Lets us keep one callsite to `wasm::IsHugeMemoryEnabled` during memory creation
* Moved mappedSize computation out of `RawbufT::Allocate` to `CreateSpecificWasmBuffer`
	* Lets us keep one callsite to `wasm::IsHugeMemoryEnabled` during memory creation
* Moved `boundsCheckLimit` computation from `ArrayBufferObjectMaybeShared` to `WasmMemoryObject`
	* Lets WasmMemoryObject be responsible for knowing whether it is 'huge' or not
* Added method to determine if a `WasmMemoryObject` is huge or not
	* Lets use know whether we support `movingGrow` or have a `boundsCheckLimit`
* Refactored `WasmMemoryObject::grow` to have one callsite to `wasmMovingGrowToSize`
	* For clarity
* Added release assert in `Module::instantiateMemory`
	* Ensures we have a huge memory or bounds checks if needed

Differential Revision: https://phabricator.services.mozilla.com/D41869

--HG--
extra : moz-landing-system : lando
2019-08-30 02:38:20 +00:00
Ryan Hunt
469c582fd5 Bug 1518210 - Wasm: Conditionally compile bounds checks based on wasm::IsHugeMemoryEnabled. r=lth
This commit allows us to conditionally compile bounds checks based on runtime
support for huge memory.

New flags to CompileArgs and CompilerEnvironment are added for whether we are
using huge memory or not, and computed based on the global flag.

Differential Revision: https://phabricator.services.mozilla.com/D41868

--HG--
extra : moz-landing-system : lando
2019-08-30 02:33:27 +00:00
Ryan Hunt
5d32d4c9b7 Bug 1518210 - Wasm: Rename WASM_HUGE_MEMORY to WASM_SUPPORTS_HUGE_MEMORY. r=lth
To highlight that WASM_HUGE_MEMORY doesn't imply we are using huge memory, this
commit renames the #define.

Most usages of WASM_HUGE_MEMORY are not updated, as they will be removed in
later commits.

Differential Revision: https://phabricator.services.mozilla.com/D41867

--HG--
extra : moz-landing-system : lando
2019-08-30 02:33:13 +00:00
Ryan Hunt
bf066f7629 Bug 1518210 - Wasm: Add pref/flag boilerplate for making WASM_HUGE_MEMORY a runtime decision. r=lth
This commit is the boilerplate for making WASM_HUGE_MEMORY a runtime decision.

Because WasmModule's can be passed across threads with `postMessage`, we need
to make this decision once per process. The support for this kind of flag seems
ad-hoc, so I stubbed in a global flag in WasmProcess.

A new 'javascript.options.wasm_disable_huge_memory' pref and
'--disable-wasm-huge-memory' JS shell flag are added. These have no effect if
the current platform doesn't support huge memory.

Tests and fuzzing flags are modified to also test with these new flags.

Differential Revision: https://phabricator.services.mozilla.com/D41866

--HG--
extra : moz-landing-system : lando
2019-08-30 02:36:32 +00:00
Ryan Hunt
442874c425 Bug 1518210 - Wasm: Remove unused wasm::DeserializeModule API. r=luke
This API is no longer used by IndexDB and can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D41865

--HG--
extra : moz-landing-system : lando
2019-08-30 02:32:44 +00:00
Ryan Hunt
bda6e43374 Bug 1518210 - Wasm: Bounds checking support for ARM64. r=lth
The only observed change needed to get bounds checking working on ARM64 was to
implement `wasmBoundsCheck` in MacroAssembler-arm64.

ARM64 doesn't support predicated instructions like ARM32, so to support spectre
mitigations `wasmBoundsCheck` emits a 'csel' instruction. I'm not familiar with
how ARM performs speculative execution or how spidermonkey mitigates it, so this
was only a guess.

Differential Revision: https://phabricator.services.mozilla.com/D41864

--HG--
extra : moz-landing-system : lando
2019-08-30 02:35:42 +00:00
Ryan Hunt
21846c8c78 Bug 1518210 - Wasm: Bounds checking support for x64. r=lth
x86_64 can re-use MacroAssembler-x86-shared for its wasmBoundsCheck, and so it
doesn't require any new assembler code.

It does require a small baseline compiler change to ensure that TlsData is
loaded if we are going to do a bounds check.

I tested this commit with a x64 try run and manually disabling WASM_HUGE_MEMORY.

Differential Revision: https://phabricator.services.mozilla.com/D41863

--HG--
extra : moz-landing-system : lando
2019-08-30 02:32:21 +00:00
Brian Hackett
55a87b9190 Bug 1529991 Part 2 - Avoid unnecessary delazification in the Debugger, r=jorendorff.
Differential Revision: https://phabricator.services.mozilla.com/D38801

--HG--
extra : moz-landing-system : lando
2019-07-26 02:19:30 +00:00
Brian Hackett
cea4a22b91 Bug 1529991 Part 1 - Ensure Debugger.Script identity for scripts that can't be relazified, r=tcampbell.
Differential Revision: https://phabricator.services.mozilla.com/D38800

--HG--
extra : moz-landing-system : lando
2019-08-29 23:21:58 +00:00
Jeff Walden
6dfc6a5499 Bug 1577066 - Fix an implicit-conversion-changes-value warning with new-enough clang in Nursery.cpp by doing a less-than comparison with the actually-representable next higher value. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D43708

--HG--
extra : moz-landing-system : lando
2019-08-29 23:16:33 +00:00
Noemi Erli
e2fb7680c0 Backed out changeset fcaf8571985f (bug 1577066) for causing build bustages in Nursery.cpp CLOSED TREE
--HG--
extra : amend_source : 87d22aaa9eeafffb69b51385d9d0216f5d158231
2019-08-30 02:03:38 +03:00
Jeff Walden
fba530c06e Bug 1577066 - Fix an implicit-conversion-changes-value warning with new-enough clang in Nursery.cpp by doing a less-than comparison with the actually-representable next higher value. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D43708

--HG--
extra : moz-landing-system : lando
2019-08-29 22:34:42 +00:00
Boris Zbarsky
0fa2371ff1 Bug 1577573. Make sure we actually have a function in exportFunction before we try to get its name. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D44038

--HG--
extra : moz-landing-system : lando
2019-08-29 19:51:11 +00:00
Jim Blandy
47cbefc716 Bug 1577355: Delete js::Zone::debuggers, which is unused. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D43862

--HG--
extra : moz-landing-system : lando
2019-08-29 18:02:20 +00:00
Sylvestre Ledru
903e6b61aa Bug 1577236 - clang-10: Fix -Wimplicit-int-float-conversion warnings in /js/ r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D43783

--HG--
extra : moz-landing-system : lando
2019-08-29 16:44:31 +00:00
Brian Hackett
f00e1f1678 Bug 1577273 - Use strnlen to test if source URLs are too long, r=tcampbell.
Differential Revision: https://phabricator.services.mozilla.com/D43848

--HG--
extra : moz-landing-system : lando
2019-08-28 22:48:45 +00:00
Jeff Walden
39de34a911 Bug 1577065 - Fix an implicit-conversion-changes-value warning with new-enough clang in AtomicsObject.cpp by explicitly converting. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D43706

--HG--
extra : moz-landing-system : lando
2019-08-28 06:44:50 +00:00
Jan de Mooij
ee9632c4ba Bug 1576567 part 3 - Use real NOPs for debug trap handler calls in interpreter loop. r=tcampbell
We now use real NOPs on all platforms. On x86/x64 this used to be a CMP
instruction and on ARM64 this involved an unconditional LDR with some
other instructions.

Depends on D43413

Differential Revision: https://phabricator.services.mozilla.com/D43414

--HG--
extra : moz-landing-system : lando
2019-08-27 15:57:33 +00:00
Jan de Mooij
1072abd991 Bug 1576567 part 2 - Allow using nopPatchableToCall outside Wasm code and fix non-sensical return value. r=lth
Depends on D43398

Differential Revision: https://phabricator.services.mozilla.com/D43413

--HG--
extra : moz-landing-system : lando
2019-08-28 06:35:24 +00:00
Jan de Mooij
fd93357cf9 Bug 1576567 part 1 - Optimize table address loads in interpreter code. r=lth
This affects the following platforms:

* x64: use a RIP-relative LEA instead of an immediate MOV. This saves a few
  hundred bytes total and seems to be a little bit faster on interpreter
  micro-benchmarks.

* arm64: use ADR instead of LDR. Seems to be a measurable speedup running
  Speedometer on Pixel 2 with the JITs disabled.

Differential Revision: https://phabricator.services.mozilla.com/D43398

--HG--
extra : moz-landing-system : lando
2019-08-28 06:30:56 +00:00
Ted Campbell
9e850c74a6 Bug 1576865 - Add missing call to ReportOutOfMemory in LazyScriptCreationData. r=jwalden
The closedOverBinding set uses the SystemAllocPolicy so we must manually
raise OOM exceptions.

Differential Revision: https://phabricator.services.mozilla.com/D43650

--HG--
extra : moz-landing-system : lando
2019-08-27 23:02:37 +00:00
Mike Hommey
02f319bd8c Bug 1577046 - Tie extra-bindgen-flags file creation to cranelift. r=chmanchester
We only recurse into js/src/rust when jsrust is built, which it may not
be in Gecko builds. But cranelift, which may be enabled either way,
needs the extra-bindgen-flags file.

Differential Revision: https://phabricator.services.mozilla.com/D43699

--HG--
extra : moz-landing-system : lando
2019-08-27 23:19:17 +00:00
Mike Hommey
37be9d3076 Bug 1575198 - Reenable cranelift on central. r=nalexander
Bug 1555894 disabled it for gecko builds, but since then bug 1576003
and https://github.com/CraneStation/cranelift/pull/924 landed, which
should make its cost to the build less problematic.

Differential Revision: https://phabricator.services.mozilla.com/D43581

--HG--
extra : moz-landing-system : lando
2019-08-27 16:08:40 +00:00
Brindusan Cristian
1c3044638e Backed out changeset 48fe03f87287 (bug 1576865) for spidermonkey bustages at bug-1576865-1.js:46:1. CLOSED TREE 2019-08-27 22:31:09 +03:00
Ted Campbell
6eee55e15d Bug 1576865 - Add missing call to ReportOutOfMemory in LazyScriptCreationData. r=jwalden
The closedOverBinding set uses the SystemAllocPolicy so we must manually
raise OOM exceptions.

Differential Revision: https://phabricator.services.mozilla.com/D43650

--HG--
extra : moz-landing-system : lando
2019-08-27 18:08:43 +00:00
Sylvestre Ledru
d264b841c9 Bug 1576502 - Fix some wording issues r=mhoye
Differential Revision: https://phabricator.services.mozilla.com/D43363

--HG--
extra : moz-landing-system : lando
2019-08-27 15:38:58 +00:00
Christian Holler
6784c1b46d Bug 1576922 - Don't build JS fuzz-tests when JS shell is disabled. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D43615

--HG--
extra : moz-landing-system : lando
2019-08-27 14:56:50 +00:00
Mark Banner
676f82a489 Bug 1540982 - Upgrade to ESLint 6.2.2 and switch to ECMA version 11 (BigInt support, Dynamic imports). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D43590

--HG--
extra : moz-landing-system : lando
2019-08-27 14:51:29 +00:00
Ted Campbell
1f82932860 Bug 1575077 - Use SharedImmutableStringCache for SharedScript urls r=jandem
Pages that use 'new Function' heavily create a lot of ScriptSource
objects and waste memory duplicating filenames. This is particularly
problematic if the filename is a data-url. Use the existing runtime
strings cache as a straightforward way to share this. The source text
already is using this cache.

For the XDR case, we expect filenames to almost always be unique so we
can eagerly allocate the owned strings without worrying.

Differential Revision: https://phabricator.services.mozilla.com/D43186

--HG--
extra : moz-landing-system : lando
2019-08-27 12:48:31 +00:00
Ted Campbell
bcd4f2a178 Bug 1575077 - Cleanup ScriptSource::sourceMapURL/displayURL r=jandem
Add accessors to avoid direct access to fields so storage can be changed
later.

Differential Revision: https://phabricator.services.mozilla.com/D43185

--HG--
extra : moz-landing-system : lando
2019-08-27 12:46:05 +00:00
Ted Campbell
cbdc34e90d Bug 1575077 - Cleanup handling of ScriptSource::setFilename/setIntroducerFilename r=jandem
Use accessors instead of directly accessing fields so that we can later
do automatic deduplication. Add setters that can be passed owned strings
when they are available.

Replace the XDRState::codeCString mechanism entirely. First restrict
string lengths to JSString::MAX_LENGTH as a reasonable upper bound.
Introduce XDRState::codeCharsZ to generate owned strings while decoding.
In practice we would duplicate the string anyways and this better
supports unaligned and endian-safe char16_t strings as well.

Together we do the same number of copies as before.

Differential Revision: https://phabricator.services.mozilla.com/D43184

--HG--
extra : moz-landing-system : lando
2019-08-27 12:45:58 +00:00
Mike Hommey
3cf5ef2f97 Bug 1576082 - Don't build jsapi-tests, gdb-tests and js tests when disabling js shell. r=sfink
For starters, js tests require the js shell, so recursing js/src/tests
make no sense.

As for the other, it feels like it's reasonably that if one didn't
opt-in to build the js shell for Gecko builds, they are not interested
in jsapi-tests and gdb-tests either.

The default for Spidermonkey standalone build being to build the shell,
nothing changes for them.

Building jsapi-tests and gdb-tests forces to build jsrust, which can be
a drag when building Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D43537

--HG--
extra : moz-landing-system : lando
2019-08-27 05:33:58 +00:00
Mihai Alexandru Michis
ac5564a095 Merge mozilla-central to autoland. 2019-08-27 02:02:26 +03:00
Mihai Alexandru Michis
42b26a5a1a Merge inbound to mozilla-central. a=merge
--HG--
rename : dom/base/Location.cpp => dom/base/LocationBase.cpp
rename : dom/base/Location.h => dom/base/LocationBase.h
2019-08-27 01:31:58 +03:00
Mike Hommey
8afaba2056 Bug 1575760 - Make mach vendor rust create a .cargo/config and check it in the tree. r=nalexander
Maybe back when .cargo/config.in was added, the directory indicated for
vendored crates needed to be absolute. That is at least not the case
with the current supported versions of rust.

The current setup has a few caveats:
- .cargo/config.in has shown to become stale (it currently contains
  multiple unused entries)
- non-gecko build tasks have to generate a .cargo/config on their own if
  they want to use vendored crates
- in turn, non-gecko build tasks that don't, may unknowingly get their
  dependencies from crates.io (see the recent attempt at moving
  geckodriver builds to a separate task).

By checking in a .cargo/config file, we can alleviate the last two, but
that comes at the price of `cargo update` not wanting to act when
.cargo/config exists, because of the source replacement configuration.

But rust vendor gently generates a suitable configuration on its own, so
we can use that to generate a .cargo/config automatically. Which
addresses the first caveat of the current setup. That leaves us with
`cargo update` not working out of the box, but that just requires people
running it to manually remove .cargo/config first. Which is arguably
what rust wants you to do in the first place. It's kind of incidental
that we started with a .cargo/config.in rather than .cargo/config.

Now, while a simple .cargo/config works, that's not enough for the case
where the objdir doesn't live inside the source directory. In that case
cargo looks for the configuration from the objdir, and fails to find it.
So we still need a .cargo/config.in, which we generate with a little
trick.

Differential Revision: https://phabricator.services.mozilla.com/D43012

--HG--
rename : .cargo/config.in => .cargo/config
extra : moz-landing-system : lando
2019-08-26 22:20:32 +00:00
Andreea Pavel
fb6a57f9b8 Backed out 2 changesets (bug 1532994) for build bustages on a CLOSED TREE
Backed out changeset 5b1337b35e30 (bug 1532994)
Backed out changeset c906462eddc7 (bug 1532994)
2019-08-26 21:22:39 +03:00
Kris Maglione
4814bcf9a6 Bug 1532994: Part 2 - Support SetHref() and Replace() in RemoteLocationProxy. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D43328

--HG--
extra : moz-landing-system : lando
2019-08-26 11:45:16 +00:00
Tom Ritter
93683129de Bug 1456544 - Remove mms-bitfields from the MinGW build r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D43459

--HG--
extra : moz-landing-system : lando
2019-08-26 16:16:36 +00:00