Commit Graph

2642 Commits

Author SHA1 Message Date
Jon Coppeard
fb607e89b8 Bug 1395509 - Track malloc memory used by wasm objects, part 1 r=luke
This adds tracking of malloc memory to WasmInstanceObject, WasmGlobalObject, WasmMemoryObject and ResolveResponseClosure (the straightforward cases).

Differential Revision: https://phabricator.services.mozilla.com/D35485
2019-06-20 15:19:18 -07:00
Jan de Mooij
a261b8dc01 Bug 1551499 - Support Baseline Interpreter code in the profiler. r=djvj
Because the return address cannot be used to uniquely identify script/pc, this
is unfortunately quite different from what we do for Baseline/Ion code.

The strategy is as follows:

* When the profiler is enabled, ensure each JitScript has a pointer to the
  profile string (released when the script is finalized).

* The BaselineInterpreter code is registered with the JitcodeMap.

* The profiler code treats interpreter frames like C++ Interpreter frames,
  instead of doing the return address based mapping.

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

--HG--
extra : moz-landing-system : lando
2019-06-21 16:13:48 +00:00
Ciure Andrei
217ab9d060 Backed out 4 changesets (bug 1545582) for causing spidermonkey bustages CLOSED TREE
Backed out changeset c53f9e22d5f7 (bug 1545582)
Backed out changeset 6640b7f3d7e0 (bug 1545582)
Backed out changeset c65de5ec10da (bug 1545582)
Backed out changeset 3224107774b1 (bug 1545582)
2019-06-20 19:39:54 +03:00
Greg Tatum
c46b8c0571 Bug 1545582 - Add a JS runtime level of allocation logging; r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D28142

--HG--
extra : moz-landing-system : lando
2019-06-19 21:07:52 +00:00
Jan de Mooij
7542b540e4 Bug 1535154 - Merge PrivateScriptData scopes/objects/bigints arrays into a single array of GC things. r=tcampbell,jonco
Once the other data is moved out of PrivateScriptData, this GC-thing array will be stored
at a fixed offset. At that point we can simplify PrivateScriptData and get fast indexing
into this array, important for the Baseline Interpreter.

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

--HG--
extra : moz-landing-system : lando
2019-06-20 03:02:35 +00:00
Ted Campbell
1e2658e982 Bug 1559275 - Add TransistiveCompileOptions::forceFullParse. r=jandem
Check VM and Realm options that may disable syntax parsing up front in
the CompileOptions constructor. This is needed to make the frontend
closer to a pure-function.

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

--HG--
extra : moz-landing-system : lando
2019-06-19 01:43:06 +00:00
Ted Campbell
1138b5e8fc Bug 1559275 - Add TransistiveCompileOptions::discardSource. r=jandem
Check realm flags at when creating CompileOptions rather than during
compilation. This is helpful for pre-compiling self-hosting code.

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

--HG--
extra : moz-landing-system : lando
2019-06-19 00:27:40 +00:00
Ted Campbell
8a260ca538 Bug 1559275 - Remove unused CompileOptions::allowSyntaxParser. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D35070

--HG--
extra : moz-landing-system : lando
2019-06-19 00:27:41 +00:00
Ted Campbell
d2cb6059f3 Bug 1559275 - Remove unused CompileOptions::isProbablySystemCode. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D34977

--HG--
extra : moz-landing-system : lando
2019-06-19 00:27:40 +00:00
Ted Campbell
a68d5a818e Bug 1559275 - Only initialize JS::OwningCompileOptions by copying. r=jandem
All uses of OwningCompileOptions now are initialized from copy() so
remove the now-unused setters.

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

--HG--
extra : moz-landing-system : lando
2019-06-19 00:27:41 +00:00
shindli
e1240cd017 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-06-16 00:50:56 +03:00
Jeff Walden
563e73698d Bug 1554362 - Implement nsJSUtils::CompileModule for UTF-8 as well as UTF-16. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D34821

--HG--
extra : moz-landing-system : lando
2019-06-15 20:47:51 +00:00
Jon Coppeard
da44422dfb Bug 1395509 - Track malloc memory used by PerfMesaurement objects r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D34730
2019-06-12 16:22:13 +01:00
Mihai Alexandru Michis
cff1990963 Backed out 4 changesets (bug 1545582) for causing build bustages in SavedStacks.cpp CLOSED TREE
Backed out changeset a47c4a44bae0 (bug 1545582)
Backed out changeset c05a5d68d9a8 (bug 1545582)
Backed out changeset 699de45940b1 (bug 1545582)
Backed out changeset 285673afaa99 (bug 1545582)
2019-06-15 02:19:08 +03:00
Greg Tatum
808dfce0d8 Bug 1545582 - Add a JS runtime level of allocation logging; r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D28142

--HG--
extra : moz-landing-system : lando
2019-06-14 20:18:22 +00:00
Dorel Luca
bb47ceb7e9 Backed out 2 changesets (bug 1559275) for Mochitest failures in js/xpconnect/tests/chrome/test_discardSystemSource.xul. CLOSED TREE
Backed out changeset 41762079fd4c (bug 1559275)
Backed out changeset 248e294630c1 (bug 1559275)

--HG--
extra : rebase_source : 88e75469d7ad3dda9c969fa2c9ceee47b6d0169a
2019-06-14 23:52:03 +03:00
Ted Campbell
e35a46b5c0 Bug 1559275 - Remove unused CompileOptions::isProbablySystemCode. r=jandem
Depends on D34976

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

--HG--
extra : moz-landing-system : lando
2019-06-14 07:35:17 +00:00
Ted Campbell
d91ab6cc88 Bug 1559275 - Add CompileOptions::discardSource. r=jandem
Check realm flags at when creating CompileOptions rather than during
compilation. This is helpful for pre-compiling self-hosting code.

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

--HG--
extra : moz-landing-system : lando
2019-06-14 18:34:32 +00:00
Paul Bone
97cbd21e24 Bug 1557928 - Rename the DoNotCare tracer kind r=jonco
Depends on D34675

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

--HG--
extra : moz-landing-system : lando
2019-06-13 01:11:53 +00:00
Andreea Pavel
9d535a8d72 Backed out 4 changesets (bug 1557928) SM build bustages on a CLOSED TREE
Backed out changeset 5e5b8a770b18 (bug 1557928)
Backed out changeset 6096454af6f1 (bug 1557928)
Backed out changeset 618afaab2634 (bug 1557928)
Backed out changeset ef396dbaecf3 (bug 1557928)
2019-06-13 04:07:17 +03:00
Paul Bone
ee87fa7f84 Bug 1557928 - Rename the DoNotCare tracer kind r=jonco
Depends on D34675

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

--HG--
extra : moz-landing-system : lando
2019-06-12 16:23:47 +00:00
Ciure Andrei
916d8a7f73 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-06-13 00:44:53 +03:00
Iain Ireland
dd43b90d94 Bug 1558179: Canonicalize all NaNs on hardware that does not generate canonical NaNs natively r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D34403

--HG--
extra : moz-landing-system : lando
2019-06-11 15:16:40 +00:00
Iain Ireland
98788f0b1c Bug 1401624: Part 8: Convert C-style macros to JS::detail constexprs r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D33503

--HG--
extra : moz-landing-system : lando
2019-06-12 17:49:52 +00:00
Jon Coppeard
94009e206b Bug 1395509 - Track malloc memory associated with ctypes objects r=jandem
Use memory tracking APIs to track malloc memory associated with the different ctypes objects.

I ended up creating new public APIs because ctypes currently mostly uses our public APIs, but I actaully don't know why.  I don't think it can be built standalone.  Maybe this should use the internal APIs instead.

Differential Revision: https://phabricator.services.mozilla.com/D34375
2019-06-10 16:11:25 +01:00
Iain Ireland
e68b24eb5b Bug 1548908: Remove IsCanonical and simplify StructuredCloneReader r=tcampbell
IsCanonical was only used in StructuredCloneReader::CheckDouble. Two of CheckDouble's three uses already canonicalized the double before checking it, and the third *should* have already done so.

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

--HG--
extra : moz-landing-system : lando
2019-06-03 15:59:29 +00:00
Iain Ireland
4bb0dc7bd0 Bug 1548908: Remove "well-known numbers" from JSRuntime r=tcampbell
Back when we first freed the lizard in 1998, it made sense to have copies of NaN/+Inf/-Inf living on the runtime, because Values didn't store doubles inline. That hasn't been true for a long time. This patch gets rid of those.

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

--HG--
extra : moz-landing-system : lando
2019-06-03 15:59:25 +00:00
Iain Ireland
00ae116a04 Bug 1548908: Add InfinityBits to FloatingPoint.h r=jwalden
We can't generate a constexpr uint64_t containing the bits for positive/negative infinity, because of a (very sensible) static_assert in SpecificNaNBits. This patch adds support to FloatingPoint.h for infinity. The next patch will use it to make JS::InfinityValue constexpr (to match JS::NaNValue).

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

--HG--
extra : moz-landing-system : lando
2019-06-03 15:59:21 +00:00
Iain Ireland
5a8c83aeaa Bug 1548908: Clean up JS::CanonicalizedDoubleValue r=tcampbell
1. CanonicalizedDoubleValue should reuse the logic in CanonicalizeNaN.
2. Places that call DoubleValue(CanonicalizeNaN(d)) should just use CanonicalizedDoubleValue(d).

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

--HG--
extra : moz-landing-system : lando
2019-06-03 15:59:17 +00:00
Iain Ireland
b4d7776503 Bug 1401624: Part 5: Change Value representation r=tcampbell,jwalden
This patch is where the actual changes to our value representation happens. A few notes:

1. We did some weird macro tricks to work around a GCC bug with enums in bitfields. Those bitfields were only useful for poking at values in gdb, and the trick no longer worked with object-biased nanboxing, so I removed it. I also got rid of asDouble_, because it's no longer possible to read the double value right out of the enum without unboxing.

2. In the previous boxing scheme, there was a mechanical conversion between a JSValueType and a JSValueTag. That's no longer true, which is why the big conversion switches exist.

3. Waldo, you were included as a reviewer specifically to look at Value.h and make sure that our gross bit twiddling is just gross and not undefined.

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

--HG--
extra : moz-landing-system : lando
2019-06-12 17:51:06 +00:00
Andreea Pavel
9eda2afac1 Backed out 7 changesets (bug 1401624) for build bustages at MacroAssembler-inl.h on a CLOSED TREE
Backed out changeset 46030572ffde (bug 1401624)
Backed out changeset bccc5a509ebe (bug 1401624)
Backed out changeset 1a488ead5ac5 (bug 1401624)
Backed out changeset caac1da9ae80 (bug 1401624)
Backed out changeset 8f02092ab0b4 (bug 1401624)
Backed out changeset 90a104231405 (bug 1401624)
Backed out changeset d5d97222de6f (bug 1401624)
2019-06-12 20:47:42 +03:00
Iain Ireland
ae7d6752b5 Bug 1401624: Part 5: Change Value representation r=tcampbell,jwalden
This patch is where the actual changes to our value representation happens. A few notes:

1. We did some weird macro tricks to work around a GCC bug with enums in bitfields. Those bitfields were only useful for poking at values in gdb, and the trick no longer worked with object-biased nanboxing, so I removed it. I also got rid of asDouble_, because it's no longer possible to read the double value right out of the enum without unboxing.

2. In the previous boxing scheme, there was a mechanical conversion between a JSValueType and a JSValueTag. That's no longer true, which is why the big conversion switches exist.

3. Waldo, you were included as a reviewer specifically to look at Value.h and make sure that our gross bit twiddling is just gross and not undefined.

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

--HG--
extra : moz-landing-system : lando
2019-06-12 15:56:52 +00:00
Gurzau Raul
227f5329f7 Merge inbound to mozilla-central. a=merge 2019-06-12 00:34:32 +03:00
Jan de Mooij
7db26e7b68 Bug 1557664 - Add AutoHoldPrincipals RAII class and use it to fix a leak in the JS shell. r=jwalden
Unfortunately JS_DropPrincipals wants the cx so it's hard to use RefPtr<>.

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

--HG--
extra : moz-landing-system : lando
2019-06-11 10:11:21 +00:00
Jon Coppeard
3291e3d4b5 Bug 1395509 - Add a separate byte count for malloc allocations r=sfink
Previously I rolled the malloc byte count into a total byte count for each zone but this may adversely affect GC scheduling (e.g. by triggering more non-incremental GCs because allocation volumes appear higher with this change). So that we can land this machinery without disturbing benchmarks too much, this patch splits out the new malloc memory accounting into a separate counter and uses the maxMallocBytes setting as the threshold (default value is 128MB vs 30MB for the GC heap threshold) and a growth factor of 2. This should make the behaviour closer to the original behaviour for now. We can go back and adjust the parameters later to obtain the desired behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D34181
2019-06-07 17:03:08 +01:00
Karl Tomlinson
c606cdd6d0 Bug 1558131 permit PersistentRooted::init() with RootingContext r=sfink
https://hg.mozilla.org/mozilla-central/rev/79d18ff4fe2853abadab372bc3bc00872f52403e#l1.143
added support for PersistentRooted initialization from a RootingContext.
https://hg.mozilla.org/mozilla-central/rev/d2758f635f72f779f712bf9c6e838868ed53c9f7#l5.97
changed the init() methods to require JSContext but continued to support
RootingContext for constructors.

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

--HG--
extra : moz-landing-system : lando
2019-06-11 00:41:32 +00:00
Cosmin Sabou
7658be0902 Backed out 6 changesets (bug 1556321, bug 1556430, bug 1167452) for causing multiple regressions.
Backed out changeset 667da63fb2b1 (bug 1556430)
Backed out changeset 5ec3133f6457 (bug 1556321)
Backed out changeset 585157ab153a (bug 1556321)
Backed out changeset 72fc109fe0f2 (bug 1167452)
Backed out changeset 11d3f2265b35 (bug 1167452)
Backed out changeset 37f9bd277c34 (bug 1167452)
2019-06-11 07:04:16 +03:00
Brindusan Cristian
d957131916 Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-06-11 12:44:12 +03:00
Yoshi Cheng-Hao Huang
f606c5e9fd Bug 1556762 - Part 1: move FullBufferReason to each instance, and add a new GCReason. r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D33652
2019-06-11 11:36:27 +02:00
Narcis Beleuzu
e360889d62 Merge inbound to mozilla-central. a=merge 2019-06-08 12:41:03 +03:00
Kristen Wright
cae8e5b60b Bug 1556861 - Adding ThreadType to js::RunnableTask r=jonco
Added thread type as ThreadType enum. Default is ThreadType::THREAD_TYPE_NONE. RunnableTasks must specify their own thread type.

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

--HG--
extra : moz-landing-system : lando
2019-06-07 21:09:05 +00:00
Jeff Walden
8891db5940 Bug 1557193 - Move Unit-agnostic code out of the Evaluate helper function in testScriptSourceCompression.cpp. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D33887

--HG--
extra : rebase_source : 552b8c6da5a247dc9e7cc6356b4abca39d147a14
2019-06-05 17:50:39 -07:00
Steve Fink
6eee7b5e6f Bug 1167452 - Barrier weakmap operations and maintain weak keys table during incremental collections. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D31958

--HG--
extra : moz-landing-system : lando
2019-05-31 23:33:48 +00:00
Jon Coppeard
77f4a218f6 Bug 1554954 - Add size parameter to GCRuntime::maybeAllocTriggerZoneGC and use this when determining whether to trigger a GC slice during an incremental GC r=sfink
There are a couple of places where this method is just used to check the thresholds so I made the size parameter default to zero.  Perhaps we should make this a separate trigger.

This also adds a separate GC reason for incremental slices trigger from this method so we can distinguish incremental and non-incremental triggers.

Differential Revision: https://phabricator.services.mozilla.com/D33000
2019-05-29 13:36:30 +01:00
Steve Fink
995829d42a No bug. Reformat js/** to fix accumulated divergences.
# ignore-this-changeset

--HG--
extra : amend_source : 7b51d539061710bf4939e687b4ca4b74af757cf3
2019-05-24 11:57:18 -07:00
Jeff Walden
4169070923 Bug 1552979 - Add a JS::CompileModule overload for direct UTF-8 compilation. r=arai
--HG--
extra : rebase_source : d63374cb56fab0a5077202462a07f2083229a5ab
2019-05-21 15:39:05 -07:00
Jeff Walden
964550bb3e Bug 1552979 - Make JS::CompileModule return the module directly, rather than by outparam duplicative of a boolean return value. r=arai
--HG--
extra : rebase_source : e5db95557dd8c1c3712395a0141badd6e8edbc8e
2019-05-21 10:21:56 -07:00
Jeff Walden
3a69834cbc Bug 1552979 - Begin fleshing out off-thread script/module compilation support for UTF-8. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D31896

--HG--
extra : rebase_source : dda3b1ae77361a5ab0a0ad52c0beaf7498553c20
2019-05-18 16:46:38 -07:00
Ciure Andrei
1f4007dfc0 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2019-05-24 01:38:06 +03:00
Jon Coppeard
6d785a4384 Bug 1395509 - Pack MemoryTracker hashtable keys into a single word on 64bit platforms r=sfink
This code is debug-only, but it seems a shame to waste have this key structure take up two words when it will fix into one. This also moves the MemoryUse enum definition to gc/GCEnum.h.

Differential Revision: https://phabricator.services.mozilla.com/D32170
2019-05-22 17:45:03 +01:00