Commit Graph

2628 Commits

Author SHA1 Message Date
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
Jan de Mooij
d9d5e4ef64 Bug 1551796 part 1 - Rename TypeScript to JitScript. r=tcampbell
Also JSScript::makeTypes => JSScript::createJitScript for consistency with code
elsewhere.

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

--HG--
extra : moz-landing-system : lando
2019-05-23 07:28:00 +00:00
Denis Palmeiro
a559bca492 Bug 1553362 - Add empty spew inline functions for when tracelogger is disabled r=iain
The new trace logger spew routines do not have a corresponding empty inline version for when --disable-trace-logging is used.

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

--HG--
extra : moz-landing-system : lando
2019-05-22 15:59:05 +00:00
Denis Palmeiro
49502b1ffa Bug 1545091 - Spew tracelogger statistics with IONFLAGS=tracelogger r=iain,mstange
Add Jitspewing control for tracelogger data.  This can be enabled from the profiler or from the JS shell.  Usage is as follows:

From browser (ION_SPEW_FILENAME is recommended here so stdout doesn't get clobbered by each process):
  1.  JS_TRACE_LOGGING=1 IONFLAGS=tracelogger ION_SPEW_FILENAME=tracelogger ./mach run
  2.  Enable JSTracer feature in profiler addon
  3.  Start profiling and ctrl+shift+2 to view profile, and the data will be automatically spewed during profile collection.

From shell:
  1.  JS_TRACE_LOGGING=1 IONFLAGS=tracelogger dist/bin/js test.js
  2.  Data is automatically spewed to stdout when the shell exits, or use ION_SPEW_FILENAME.

There is an optional environment variable JS_TRACELOGGER_SPEW that can be used to emit specific events, for example JS_TRACELOGGER_SPEW="Interpreter,Baseline,GC" will emit only those specific events along with the script and self time of each script.

The structured spewer is also supported with SPEW=tracelogger, and this will emit the tracelogger data for every recorded event.

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

--HG--
extra : moz-landing-system : lando
2019-05-21 15:25:32 +00:00
Jon Coppeard
22445824ad Bug 1537909 - Optimise external read barriers r=sfink?
Add a special path for the external read barrier API where we inline most of the checks and then always perform the barrier if we call into the engine.  This also skips dispatching on trace kind since we know the barrier tracer is always a GCMarker.

This is kind of hacky and I'm not sure how much it gains us (it's difficult to tell in profiles where GC may occur at different times).  What do you think?

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

--HG--
extra : moz-landing-system : lando
2019-05-20 17:58:16 +00:00
Jeff Walden
38ead4474b Bug 1552977 - Add JS::EvaluateUtf8PathDontInflate that doesn't inflate UTF-8 file contents to UTF-16 before evaluating them. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D31881

--HG--
extra : moz-landing-system : lando
2019-05-21 01:31:53 +00:00
Jeff Walden
bf9676ac23 Bug 1552977 - Add JS::CompileUtf8PathDontInflate with clear non-inflating nature and make existing JS::CompileUtf8Path callers inflate again. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D31880

--HG--
extra : moz-landing-system : lando
2019-05-21 01:31:33 +00:00
Jeff Walden
1e8a4f44fd Bug 1553001 - Move module APIs out of jsapi.{cpp,h} into js/public/Modules.h and js/src/vm/Modules.cpp for better isolation of module-related APIs. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D31917

--HG--
rename : js/src/jsapi.h => js/public/Modules.h
rename : js/src/jsapi.cpp => js/src/vm/Modules.cpp
extra : moz-landing-system : lando
2019-05-21 00:57:38 +00:00
Andrew McCreight
d1648e5525 Bug 1552597, part 2 - Handlify RemapAllWrappersForObject. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D31689

--HG--
extra : moz-landing-system : lando
2019-05-20 08:40:01 +00:00
Edgar Chen
e336502f67 Bug 1549351 - Promise rejection event should not be sent for cross-origin scripts; r=smaug,till
Differential Revision: https://phabricator.services.mozilla.com/D31565

--HG--
extra : moz-landing-system : lando
2019-05-19 01:18:04 +00:00
Tooru Fujisawa
66e25f6243 Bug 1549340 - Part 2: Use union instead of reinterpret_cast to initialize const char* with symbol for JSPropertySpec.name. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D30493

--HG--
extra : moz-landing-system : lando
2019-05-13 10:26:48 +00:00
Jon Coppeard
dd05bccccd Bug 1542184 - Use PersistentRooted for rooting vectors of GC things from rust code r=fitzgen?
This replaces the use of heap-alloced Rooted with PersistentRooted which is safe wrt destruction order.

I had to add PersistentRooted and StackGCVector to OPAQUE_TYPES to make this work... I'm not really sure what this does.

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

--HG--
extra : moz-landing-system : lando
2019-05-10 17:36:34 +00:00
Jeff Walden
353b248b45 Bug 1548729 - Move SourceHook-related functionality into its own public header for reduced dependencies. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D29781

--HG--
rename : js/src/jsfriendapi.h => js/public/experimental/SourceHook.h
rename : js/src/jsfriendapi.cpp => js/src/vm/SourceHook.cpp
extra : moz-landing-system : lando
2019-05-10 23:38:56 +00:00
Coroiu Cristina
d2d1ba5805 Backed out changeset 45ff6c2d30e5 (bug 1548729) for SpiderMonkey failure at build/src/js/src/vm/SourceHook.cpp 2019-05-11 02:15:15 +03:00
Jeff Walden
684ce81117 Bug 1548729 - Move SourceHook-related functionality into its own public header for reduced dependencies. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D29781

--HG--
rename : js/src/jsfriendapi.h => js/public/experimental/SourceHook.h
rename : js/src/jsfriendapi.cpp => js/src/vm/SourceHook.cpp
extra : moz-landing-system : lando
2019-05-10 22:42:27 +00:00