Commit Graph

67049 Commits

Author SHA1 Message Date
Benjamin Bouvier
4c5347b2ed Bug 1490251: Add a pref switch to use Cranelift for wasm compilation; r=luke
--HG--
extra : rebase_source : 9814fd3836b7c06d84b5c8ae08f61a052f076215
extra : histedit_source : 31a2933472deb17e61e02432a69a86048227efde
2018-09-13 12:32:17 +02:00
Benjamin Bouvier
690bd720a5 Bug 1490948: Compile Cranelift on Nightlies except for Win32 static analysis builds; r=chmanchester
... where LLVM (32-bits toolchain) runs out of memory when compiling
gkrust.

--HG--
extra : rebase_source : f47ba34fddcb3913793781fd26cfa32293b5baf9
extra : histedit_source : 2f85d1864f963759bc97cb69b39648fb0d964578
2018-09-25 19:05:08 +02:00
Benjamin Bouvier
5523ac828b Bug 1490948: Adjustments for the source package; r=chmanchester
- Embed vendored Rust dependencies into the source package.
- Don't use --freeze with Cargo in JS standalone builds: since all the Rust
  dependencies are vendored in, it won't trigger an update of the toplevel
  Cargo.lock file for a standalone build in the non-package build case.

--HG--
extra : rebase_source : 06704eb326aad36a870586694a99964ad7a4dbfa
extra : histedit_source : 1502d976bc12a3eed17efaaf5dd2d4f46d0b00d5
2018-09-13 12:05:50 +02:00
Benjamin Bouvier
5dc668ca50 Bug 1490948: Link libjsrust into mozjs_sys if it's been compiled; r=fitzgen
Also make sure to precise the panic behavior before compiling Spidermonkey and
its Rust dependencies, to be compatible with the Rust bindings which want to
unwind Rust code properly and not abort as Gecko does.

--HG--
extra : rebase_source : a15e42f2cbfe94bdcd2d66d101bbc39ca385ddce
extra : histedit_source : a6dd8e0d913b911564e01b34eb9bb78087d694b5
2018-09-25 17:21:00 +02:00
Benjamin Bouvier
2ab4b1419f Bug 1490948: Add support for extra bindgen flags when compiling Cranelift; r=froydnj
Some build flags are being passed by the build system: they're passed in a text
file called extra-bindgen-flags.in that's filled at configure time.

Other flags have to be inferred from the current target/host combination, in
Cranelift's build script directly. This is mostly cargo-culted from the
ServoBindings.toml file, and should probably be merged in the build system at
some point.

Some Windows-specific adjustments were needed to provide access to libclang for
bindgen support, by adding clang-cl to the plain Spidermonkey Windows builds.

--HG--
extra : rebase_source : 0bda40b1d1eb38c2657593f094c951013711d00a
extra : histedit_source : aad930a5f9099e299d385ae4de2deb81aed9b6d5
2018-09-25 15:31:22 +02:00
Benjamin Bouvier
be8a563409 Bug 1490948: Add build system support for a Rust library in Spidermonkey; r=chmanchester
This introduces two new crates:
- jsrust, for standalone builds. This crate is compiled into a static library
  libjsrust.a, which gets linked into the shared Spidermonkey library when it's
  built, or into the static Spidermonkey library otherwise. This is just a
  static library wrapping jsrust_shared below.
- jsrust_shared, for Gecko embedding. It just references other Rust
  crates actively used in Spidermonkey. It is used to be embedded as part of
  a new Rust dependency in Gecko (in gkrust).

--HG--
rename : js/src/wasm/cranelift/Cargo.toml => js/src/rust/Cargo.toml
extra : rebase_source : 84e440e3f669b73776653182cb7b006cc7febb10
extra : histedit_source : 3a67575ff6871b7dc3558c10a0251b73cedb090c
2018-09-25 15:56:56 +02:00
Benjamin Bouvier
21dc79a9f2 Bug 1469027: Integrate Cranelift in Spidermonkey; r=sunfish, r=luke
--HG--
extra : rebase_source : 20ec9c410ca88b37feff17f4906ce79d3d8664da
2018-09-11 17:01:46 +02:00
Lars T Hansen
bf0f25b9dc Bug 1494231 - Accept memory/table index for data/elem segments. r=jseward
For now, we only allow one memory / one table, so we verify that the index,
if present, is zero, and then go on as before.

--HG--
extra : amend_source : 37d0084d17e8be857a28377a43ae9dc4b34018ea
2018-09-26 12:00:10 +02:00
Lars T Hansen
2e21be038e Bug 1494625 - Support struct field names in wast syntax. r=bbouvier
Field names are unique within the module, so we handle them like
most other names.

--HG--
extra : amend_source : 0a09a6d8c9f0aa65af8015d08b24924efe7ba931
2018-09-11 14:29:47 +02:00
Lars T Hansen
6d82541227 Bug 1494134 - clean up ifdefs in wasm::Classify. r=luke
This code is a little messy since we define opcodes unconditionally but
switch on them conditionally.  Cleaning up ifdefs in previous patches
uncovered brittleness here.  This patch takes a principled approach:
we always test all cases, but whether we succeed with a classification
or fail with undefined opcode is hidden inside macros that are subject
to feature definitions.

--HG--
extra : amend_source : 47350a30cfa6737d868144e53ec7f8beea150524
2018-09-26 09:59:31 +02:00
Coroiu Cristina
35b751d9cd Merge mozilla-central to inbound a=merge 2018-09-28 07:37:58 +03:00
Coroiu Cristina
8f256026f1 Merge mozilla-central to autoland a=merge ona CLOSED TREE 2018-09-28 00:41:04 +03:00
Coroiu Cristina
71988c7b7e Merge inbound to mozilla-central a=merge 2018-09-28 00:36:46 +03:00
Ted Campbell
7d5a651b91 Bug 1485347 - Part 3: Use mozilla::Span for JSScript::data arrays. r=jandem
Replace various custom data-types in JSScript interfaces with
mozilla::Span. This abstracts implementation details and supports
range-based for-loops. Underlying storage is unchanged, but this sets us
up to be able to more easily change it.

MozReview-Commit-ID: FDfIYsAxTA8
2018-09-27 14:27:20 -04:00
Gurzau Raul
a8d8876e9e Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-09-27 19:45:35 +03:00
Ted Campbell
af49304413 Bug 1494159 - Allow LIR to throw muliple errors r=jandem
Error handling for LIRGenerator lets us defer handling until the end of
the instruction but this can result in tripping some sanity checks. Only
report the first error up to caller.

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

--HG--
extra : moz-landing-system : lando
2018-09-27 12:54:11 +00:00
shindli
a8d55dae12 Merge inbound to mozilla-central. a=merge 2018-09-27 00:52:12 +03:00
Nathan Froyd
dfd0baf157 Bug 1494389 - tweak TraceLogging's no-op rdtsc function for non-x86 MSVC; r=sfink
GCC/clang are happy with the current formulation, but MSVC would like
something slightly different, closer to what we use for the x86-ish
version.
2018-09-26 14:49:51 -04:00
Narcis Beleuzu
b585d65902 Backed out changeset 7df169d72b50 (bug 1469027) for assertion failures on env.optimizedBackend() == OptimizedBackend::Ion. CLOSED TREE 2018-09-26 20:36:47 +03:00
Robin Templeton
df28b205eb Bug 1492685 - Remove obsolete Ion optimization for JSOP_SETARG. r=jandem
IonBuilder::jsop_setarg optimizes asm.js-style argument coercions
using JSOP_BITAND, JSOP_BITOR, or JSOP_POS. The optimization
assumes that bitwise operations always produce Int32 results, but
they may produce Value results due to BigInt-related changes in
bug 1490387.
2018-09-26 13:03:18 -04:00
Noemi Erli
10ffb9dea8 Backed out changeset 92cde451be94 (bug 1444013) for failures in tests/dom/media/tests/crashtests/1453030.html 2018-09-26 19:54:04 +03:00
Emilio Cobos Álvarez
d8c0080a10 Bug 1493222 - Expose InspectorUtils to fuzzers. r=bzbarsky
I can be more granular if we want, by adding more ChromeOnly annotations for the
functions that we don't want to expose.

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

--HG--
extra : moz-landing-system : lando
2018-09-27 19:00:33 +00:00
Iain Ireland
4de01379de Bug 1492574: Remove unnecessary MutableHandle r=tcampbell
Depends on D7123

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

--HG--
extra : moz-landing-system : lando
2018-09-27 19:13:48 +00:00
Iain Ireland
0e0311a584 Bug 1492574: Rewrite GetDynamicName to return false if lookup can't be completed r=tcampbell
Depends on D7122

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

--HG--
extra : moz-landing-system : lando
2018-09-27 19:17:06 +00:00
Iain Ireland
e1f5fb98a5 Bug 1492574: Fix OOM handling in NewRope testing function r=tcampbell
Depends on D6404

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

--HG--
extra : moz-landing-system : lando
2018-09-27 19:13:52 +00:00
Iain Ireland
20456aeee2 Bug 1492574 - Avoid leaking OOM exception flag from GetDynamicName r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D6404

--HG--
extra : moz-landing-system : lando
2018-09-27 19:18:07 +00:00
Tooru Fujisawa
12a859a177 Bug 1494518 - Do not pass non-PromiseObject to JSRuntime::enqueuePromiseJob. r=till 2018-09-28 00:06:51 +09:00
Nazım Can Altınova
8d44ed5ac7 Bug 1490794 - Add profiling stack frame for script compilation r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D5861

--HG--
extra : moz-landing-system : lando
2018-09-26 14:40:18 +00:00
arthur.iakab
e1e94e3d20 Merge mozilla-central to autoland 2018-09-26 15:57:12 +03:00
Jan de Mooij
0143ee21c0 Bug 1492416 - Always use braces for if/for/while statements in js/src/ds. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D6884

--HG--
extra : moz-landing-system : lando
2018-09-26 07:29:21 +00:00
Ciure Andrei
ce57be88b8 Merge inbound to mozilla-central. a=merge 2018-09-26 00:49:06 +03:00
Boris Zbarsky
f1812532b6 Bug 1493849 part 1. Back out the instrumentation added in bug 1491313. r=mccr8 2018-09-25 13:34:59 -04:00
Jason Orendorff
e6ab602a75 Bug 1491939 - Part 4: Enable streams on a per-realm basis. Drop dom.streams.enabled and dom.workers.options.streams; use only javascript.options.streams. r=baku
Depends on D6555

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

--HG--
extra : moz-landing-system : lando
2018-09-25 14:11:41 +00:00
Jason Orendorff
aaf539046b Bug 1491939 - Part 3: Centralize configuration of JS realm options from prefs. r=baku
Depends on D6554

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

--HG--
extra : moz-landing-system : lando
2018-09-25 14:11:13 +00:00
Jason Orendorff
fbad3f4692 Bug 1491939 - Part 2: Throw, rather than crash, on trying to instantiate a runtime-disabled class. r=jwalden
The new error is thrown if, for example, you try to create a ReadableStream via
the C++ API while streams are disabled.

Depends on D6553

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

--HG--
extra : moz-landing-system : lando
2018-09-25 17:00:32 +00:00
Jason Orendorff
7cf8a82f09 Bug 1491939 - Part 1: Remove remaining traces of build-time ENABLE_STREAMS option. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D6553

--HG--
extra : moz-landing-system : lando
2018-09-25 14:10:16 +00:00
Sean Stangl
2c6a795f6d Bug 1492302 - Implement visitDivI(). r=nbp 2018-09-24 15:11:00 +03:00
André Bargull
4c5a158dfe Bug 1463529: Don't add modifiers to built-in or bound function toString representation. r=jorendorff 2018-09-24 10:59:05 -04:00
Tooru Fujisawa
9bc0d5d15d Bug 1490548 - Always use braces for if/for/while statements in BinAST auto-generated code r=Yoric 2018-09-25 11:04:11 +09:00
Ted Campbell
f9261f9103 Bug 1493475 - Fixup broken test. r=bustage 2018-09-24 20:22:16 -04:00
Ted Campbell
f90432bc92 Bug 1493475 - Cleanup asm.js parser cleanup. r=luke 2018-09-24 19:54:03 -04:00
shindli
a7b6d373bb Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-09-24 19:50:53 +03:00
Jan de Mooij
2ddc8e66b8 Bug 1492759 - Use the principal stored in CompartmentOriginInfo instead of JS_GetCompartmentPrincipals for Xray expandos. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D6467

--HG--
extra : moz-landing-system : lando
2018-09-24 11:20:23 +00:00
Luke Wagner
3e68321279 Bug 1493373 - Baldr: store ProcessSegmentMap in Atomic pointer to avoid shutdown race (r=lth,bbouvier)
--HG--
extra : rebase_source : c87c23cc0817830fddce75febd0eabc4172bd4d8
2018-09-25 17:10:09 -05:00
Ciure Andrei
6760739b90 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-09-26 00:53:40 +03:00
Jason Orendorff
e54b8a5d48 Bug 1493715 - Use unsigned arithmetic for possibly overflowing DateParse computation. r=jwalden
I can't currently dedicate time to a breaking change to date parsing, so this
patch implements exactly what the previous code probably does already, but
without the undefined behavior.

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

--HG--
extra : rebase_source : 9994d4afae95a0024d0d6fd6d9ad54b94cad1ddf
2018-09-24 11:15:29 -05:00
Jason Orendorff
dfbcb7c596 Bug 1492872 - Remove JSProto_Iterator. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D6405

--HG--
extra : moz-landing-system : lando
2018-09-20 18:04:41 +00:00
Logan F Smyth
486d98a2d8 Bug 888390 - Expose a get/setProperty function on Debugger.Object instances. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D5915

--HG--
extra : moz-landing-system : lando
2018-09-21 22:14:31 +00:00
Bogdan Tara
0eedaf7640 Merge inbound to mozilla-central. a=merge 2018-09-22 00:59:34 +03:00
Andrew McCreight
fee317ab0d Bug 1351501, part 2 - Preserve wrappers for non-nsISupports cycle collected weak map keys r=bzbarsky
A C++ object that is exposed to JS can have its reflector used as a
key in a weak map. Because a weak map does not keep its keys alive,
this means that the reflector can be discarded if it has no other
references aside from the C++ object, which will in turn remove its
weak map entry. If the C++ object can be accessed again later from JS,
it will get a new reflector which will have no weak map entry. This is
bad because it means some internal implementation detail has resulted
in data loss that is visible to JS. (Side note: this is also an issue
for cross compartment wrappers, which is handled by another
mechanism.)

To fix this, we can preserve the wrapper of any DOM reflector used as
a weak map key. This ensures that the reflector and its C++ object
have the same lifetime. If a WebIDL object is not wrapper cached, that
means that it cannot be accessed via C++, so we don't need to preserve
the wrapper. This is currently implemented for nsISupports classes,
but not other classes. For non-nsISupports classes, it would throw an
error rather than silently fail.

My patch adds support for non-nsISupports cycle collected objects. It
turns out that the existing addProperty hook just does wrapper
preservation, so we just call it for cycle collected classes. This
does mean that if addProperty changes in the future to do something
else, this code will need to be changed.

I verified that this test fails if TryPreserveWrapper is changed to do
nothing besides return true in the non-nsISuports case.

Depends on D6197

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

--HG--
extra : moz-landing-system : lando
2018-09-21 18:20:35 +00:00