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

3500 Коммитов

Автор SHA1 Сообщение Дата
Jan de Mooij b5bfe51dc3 Bug 1702196 - Add testing functions for verifying shape invariants. r=jonco
This allows taking a snapshot of an object's state and then at a later point
checking invariants that we expect to hold for shapes. This will let us catch
bugs where an object or shape is mutated in ways that would be a problem for
JIT code.

Differential Revision: https://phabricator.services.mozilla.com/D111266
2021-04-10 09:15:43 +00:00
Ryan Hunt 492ca0fcc5 Bug 1677204 - wasm: Remove reftypes flag. r=lth
Reftypes has shipped and so we can remove the feature flag.

Differential Revision: https://phabricator.services.mozilla.com/D110823
2021-04-09 20:03:53 +00:00
Ryan Hunt f37dc5a46c Bug 1677204 - wasm: Factor out feature gating to declarative macro. r=lth
This commit adds a declarative `JS_FOR_WASM_FEATURES` macro which
expands for every WebAssembly proposal we are gating. Most feature
gating code is refactored to use this macro so that we have one place
we need to change to get the majority of this code working. The only
place that needs to be updated for new features is the browser pref
declaration code, as that cannot use this macro. This is documented
in the new WasmFeatures.h header.

The feature gating logic should work almost identically as before.
The changes are:
 * All browser prefs are moved to StaticPrefList.yaml
 * The code to enable a feature was conditionally compiled to not
   enable the feature at variously stages of the "flag-flow". Now
   the only place that is conditionally compiled to not work is
   in the WasmXFlag functions. This is to make the macro simpler
   and might be able to be reverted if need be.
 * The flag for gc is shortened from gcTypes to gc so that the
   existing usages of the wasmGcEnabled shell function don't have
   to change.

This commit also has the effect of giving function-references/gc/
exception-handling a proper browser pref for enabling the features.

Differential Revision: https://phabricator.services.mozilla.com/D110820
2021-04-09 20:03:51 +00:00
Ryan Hunt 90c8728cc9 Bug 1677204 - wasm: Remove multi-value flag. r=lth
Multi-value has shipped and can remove its feature flag.

Differential Revision: https://phabricator.services.mozilla.com/D110819
2021-04-09 20:03:51 +00:00
Jan de Mooij 614ab3ef46 Bug 1704042 part 9 - Report an exception for large lengths from JS::GetArrayLength API. r=lth
There are a number of callers in Gecko, most of them are using this to iterate over an object
expected to be an array. This should be okay for now; if there are callers that need the
full length we can add a separate API that returns uint64_t.

This lets us remove ToLengthClamped and the GetLengthProperty overload returning uint32_t.

Differential Revision: https://phabricator.services.mozilla.com/D111389
2021-04-09 13:20:48 +00:00
Tooru Fujisawa 55af083348 Bug 1702863 - Use a dedicate object for cross-realm weak map key. r=jandem,peterv
Differential Revision: https://phabricator.services.mozilla.com/D110954
2021-04-08 15:54:21 +00:00
Yulia Startsev 685df4d56e Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-08 08:21:56 +00:00
smolnar 8844e16700 Backed out 3 changesets (bug 1681046) for causing jsreftest failures in ScriptLoader. CLOSED TREE
Backed out changeset 6704600819ed (bug 1681046)
Backed out changeset 37f56518116b (bug 1681046)
Backed out changeset f61cb7496a35 (bug 1681046)
2021-04-07 12:50:28 +03:00
Yulia Startsev 2b2111b9b2 Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-07 08:45:37 +00:00
Brindusan Cristian 08e2af1cf7 Backed out 2 changesets (bug 1681046) for causing wpt failures in bare-specifiers.sub.html. CLOSED TREE
Backed out changeset a26ecd8063ea (bug 1681046)
Backed out changeset e161663a5a7c (bug 1681046)
2021-04-06 18:02:15 +03:00
Yulia Startsev 735bb5aa2a Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-06 12:10:12 +00:00
Tom Schuster 93d66b057f Bug 1701904 - Use Maybe<PropertyDescriptor> in DebuggerObject and a few resulting places. r=jandem
I am not super happy with having to do `Rooted<PropertyDescriptor> desc(cx, *desc_);` in DebuggerObject::getOwnPropertyDescriptor.
However PropertyDescriptor::value() can't be resolved properly, unlike MutableHandle<PropertyDescriptor>::value().

I wonder if Maybe could return Handle/MutableHandle as well somehow.

Differential Revision: https://phabricator.services.mozilla.com/D110663
2021-04-06 11:42:44 +00:00
Jan de Mooij 9041351aa8 Bug 1700052 part 9 - Add js::GetterSetter GC thing. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D110256
2021-04-06 11:06:16 +00:00
smolnar 6a3619551b Backed out 20 changesets (bug 1662559) for causing fuzzing failures. CLOSED TREE
Backed out changeset 4c69d3aabee4 (bug 1662559)
Backed out changeset 0fbfd31e0f78 (bug 1662559)
Backed out changeset 5e4ca6c62d4b (bug 1662559)
Backed out changeset bd328ac14770 (bug 1662559)
Backed out changeset be3069057f5a (bug 1662559)
Backed out changeset 405a80f38f5c (bug 1662559)
Backed out changeset cc3a2fadee36 (bug 1662559)
Backed out changeset 118b19a448fa (bug 1662559)
Backed out changeset 0f5bcb3ca09f (bug 1662559)
Backed out changeset 1bac4e440311 (bug 1662559)
Backed out changeset 0b14a97cd0fb (bug 1662559)
Backed out changeset 1420d94f0d59 (bug 1662559)
Backed out changeset 70d767bf04ad (bug 1662559)
Backed out changeset 3902d4cb84cc (bug 1662559)
Backed out changeset 0b01a60bb702 (bug 1662559)
Backed out changeset e200366e7e3a (bug 1662559)
Backed out changeset ae45d407929f (bug 1662559)
Backed out changeset 547e0b38d66e (bug 1662559)
Backed out changeset 8970e82f0312 (bug 1662559)
Backed out changeset 88203b6f2e5a (bug 1662559)
2021-04-01 17:14:35 +03:00
Alexandru Michis 7ef047faaa Backed out changeset 0da564b9ec2e (bug 1681046) for causing dt failures in browser_webconsole_worklet_error.js
CLOSED TREE
2021-04-01 15:27:02 +03:00
Yulia Startsev cfb0da74ab Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-01 11:08:44 +00:00
Jason Orendorff 37db8e0f5f Bug 1662559 - Part 16: Add PrivateOpEmitter, based on PropOpEmitter. r=arai
Depends on D108297

Differential Revision: https://phabricator.services.mozilla.com/D108298
2021-03-30 19:44:34 +00:00
Matthew Gaudet 987970aa33 Bug 1662559 - Part 13: Disallow invocation of private methods inside of evalInFrame r=arai
In order to correctly support this with the optimized storage for methods we
would need new bytecode like GetAliasedVar which is able to traverse
non-EnvironmentObject environments like DebugEnvironmentProxy.

Unfortunately, for safety this means we will ultimately disable this for a number of
different private field and accessor invocations.

Differential Revision: https://phabricator.services.mozilla.com/D109402
2021-03-30 19:44:32 +00:00
Tom Schuster cf21f18c06 Bug 1701904 - Add methods directly on PropertyDescriptor. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D110229
2021-03-30 18:48:49 +00:00
Ted Campbell c31c204d6c Bug 1701305 - Add off-thread compile API for JS::Stencil. r=arai
Note that starting the off-thread compile simply uses the existing
mechanisms. We only need a special "finish" function to avoid automatic
instantiation.

Differential Revision: https://phabricator.services.mozilla.com/D109958
2021-03-29 16:04:03 +00:00
Ted Campbell df57c04148 Bug 1701305 - Add ES-module support to JS::Stencil API. r=arai
While this API also parses to a Stencil, care must be taken by callers since
parsing JavaScript text as a module vs global script as different semantics
(as defined in ECMAScript spec).

Differential Revision: https://phabricator.services.mozilla.com/D109974
2021-03-29 16:04:03 +00:00
Ted Campbell ad4995ae80 Bug 1701305 - Add char16_t overload for JS::Stencil API. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D109956
2021-03-29 16:04:02 +00:00
Gerald Squelart d88c934229 Bug 1700869 - JS::ProfilingFrameIterator::getCppEntryRegisters() skeleton - r=jandem
getCppEntryRegisters() for JIT frames delegates to jit::JitRuntime::getCppEntryRegisters(JitFrameLayout*), which retrieves relevant state registers pointing at the native calling frame.

For now implementations on all platforms do nothing. They will be implemented in subsequent patches and bugs, to be used with modified stack walkers, so that they may resume sampling past JIT frames -- see main bug 1635987.

Differential Revision: https://phabricator.services.mozilla.com/D109696
2021-03-29 01:04:10 +00:00
Jan de Mooij 030f2d48ac Bug 1404885 part 1 - Replace GetterOp/SetterOp with a property attribute. r=jonco
At this point the old GetterOp/SetterOp mechanism is only used for the special
array.length and ArgumentsObject properties. This means we no longer need the
generic GetterOp/SetterOp function pointers.

Instead, we now flag these properties as JSPROP_CUSTOM_DATA_PROP and use a nullptr
getter and setter. At the point where we used to call the old GetterOp/SetterOp,
we now dispatch on the JSClass and call the getter/setter code directly.

This still isn't perfect, but it unblocks further cleanup and optimization work.
For example, this patch also cleans up the Shape code to use JS objects directly
for getters/setters, instead of casting these objects to GetterOp/SetterOp.

We still use addAccessorProperty and putAccessorProperty to add/redefine the
custom data properties on array and arguments objects. When we change how the
accessor properties are implemented, we can rename this to addCustomDataProperty
and putCustomDataProperty and simplify the code more.

Differential Revision: https://phabricator.services.mozilla.com/D109516
2021-03-28 08:09:13 +00:00
Yoshi Cheng-Hao Huang deef568b93 Bug 1660006 - Part 2: Rename decommittedPages and update commit behavior. r=jonco
Change the unit of decommitted memory to pages.
And will commit first if there's no free committed arena.

Differential Revision: https://phabricator.services.mozilla.com/D109297
2021-03-27 09:02:54 +00:00
Yoshi Cheng-Hao Huang 30b357ccfa Bug 1660006 - Part 1: Add PageSize, ArenasPerPage, and PagesPerChunk. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D109296
2021-03-27 09:02:54 +00:00
Jan de Mooij c4a7509d06 Bug 1470081 part 4 - Remove JSGetterOp and JSSetterOp. r=evilpie
Depends on D109359

Differential Revision: https://phabricator.services.mozilla.com/D109360
2021-03-26 08:51:26 +00:00
Jan de Mooij 2f81799232 Bug 1470081 part 2 - Remove JSGetterOp/JSSetterOp from PropertyDescriptor. r=evilpie,anba
GetterOp/SetterOp are now only used internally for array and arguments objects.
PropertyDescriptor no longer has to know about these properties.

Differential Revision: https://phabricator.services.mozilla.com/D109358
2021-03-26 08:51:25 +00:00
Tom Schuster 610b70603a Bug 1684316 - Implement highWaterMark as required by WebIDL. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D109239
2021-03-22 16:38:19 +00:00
Simon Giesecke 951cfd1012 Bug 1678374 - Fix includes in js/public. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D97615
2021-03-12 10:42:21 +00:00
Ryan Hunt 11b1ab5345 Bug 1670104 - Add rtt.sub and ref.test/ref.cast/br_on_cast. r=lth
This commit adds rtt.sub as an instruction to form new RttValue's with
an explicit subtyping chain. This is implemented as a link from sub
rtt to parent rtt. Validation ensures that chains can only be formed
from a T <: U. Each execution of an rtt.sub instruction creates a new
rtt value. This may be changed in the future to align with the proper
spec semantics.

With rtt.sub, we can now implement ref.test/ref.cast/br_on_cast
instructions that operate on structs with an rtt. The subtyping
check is implemented as an instance call performing a linear
search through rtt chains.

Differential Revision: https://phabricator.services.mozilla.com/D104269
2021-03-11 04:49:50 +00:00
Iain Ireland ca22d6b543 Bug 1519483: Add hasIndices to RegExpFlags r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D107135
2021-03-10 22:10:14 +00:00
André Bargull a8fd7d4d4e Bug 1696920 - Part 4: Require non-nullptr JSContext in CharsToNewUTF8CharsZ. r=jandem
Support for `nullptr` context was added in bug 1229642 for the SPSProfiler. This
code is no longer present, so we can require a non-nullptr context in
CharsToNewUTF8CharsZ again.

Depends on D107473

Differential Revision: https://phabricator.services.mozilla.com/D107474
2021-03-09 10:07:58 +00:00
Jan de Mooij 2eb2d5e541 Bug 1694685 part 5 - Replace JS_CHECK_ACCESSOR_FLAGS macro with a C++ template. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D106409
2021-03-08 12:07:15 +00:00
Jan de Mooij 39f486ec3a Bug 1694685 part 4 - Rename JSPropertySpec flags_ to attributes_. r=tcampbell
Depends on D106283

Differential Revision: https://phabricator.services.mozilla.com/D106408
2021-03-08 12:07:15 +00:00
Jan de Mooij 5d04487626 Bug 1694685 part 3 - Replace JSPROP_INTERNAL_USE_BIT with an isAccessor_ flag. r=tcampbell
JSPropertySpec used this bit to distinguish accessor vs value properties. Fortunately
we have unused padding bytes so we can use a bool instead.

Differential Revision: https://phabricator.services.mozilla.com/D106283
2021-03-08 12:07:14 +00:00
Jan de Mooij e5c2c0f5ef Bug 1694685 part 2 - Use enum class for ValueWrapper::type. r=tcampbell
Use a custom enum class instead of JSValueType so it's more obvious what the
supported types are.

Depends on D106406

Differential Revision: https://phabricator.services.mozilla.com/D106407
2021-03-08 12:07:14 +00:00
Jan de Mooij 8fed47db9b Bug 1694685 part 1 - Add static_assert for JSPropertySpec size. r=tcampbell
There are multiple (nested) unions so the size isn't obvious.
Adding a sanity check helps catch regressions.

Differential Revision: https://phabricator.services.mozilla.com/D106406
2021-03-08 12:07:13 +00:00
André Bargull 6a2fc29e9c Bug 1696666 - Part 7: Remove WTF8Chars. r=tcampbell
Depends on D107342

Differential Revision: https://phabricator.services.mozilla.com/D107343
2021-03-06 22:00:14 +00:00
André Bargull b619ae69a8 Bug 1696666 - Part 1: Remove AtomizeWTF8Chars and JS::WTF8CharsToNewTwoByteCharsZ functions. r=tcampbell
Neither of two functions are called anymore anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D107337
2021-03-06 22:00:12 +00:00
Jan de Mooij 2acffb58a7 Bug 1689413 part 17 - Remove ObjectGroup. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D106987
2021-03-06 01:05:26 +00:00
Jan de Mooij 84c437d6e3 Bug 1689413 part 16 - Remove JSObject group field. r=tcampbell,jonco
Note that on 32-bit platforms, JSObject is still 8 bytes. This means we don't have
to worry about misaligned DoubleValue stores to fixed slots on ARM32/MIPS32.

Differential Revision: https://phabricator.services.mozilla.com/D106986
2021-03-06 01:05:25 +00:00
Jan de Mooij 44e73e7ae9 Bug 1689413 part 8 - Remove shadow::ObjectGroup. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D106978
2021-03-06 01:05:22 +00:00
Jan de Mooij 2204818bf0 Bug 1689413 part 6 - Move Realm* from ObjectGroup to BaseShape. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D106976
2021-03-06 01:05:21 +00:00
Jan de Mooij dbd6f24a18 Bug 1689413 part 5 - Remove JSClass* from ObjectGroup. r=jonco
BaseShape stores the JSClass* too so this patch changes the code to get the JSClass*
from there instead of from the ObjectGroup.

Differential Revision: https://phabricator.services.mozilla.com/D106975
2021-03-06 01:05:20 +00:00
Narcis Beleuzu c21715e694 Backed out 18 changesets (bug 1689413) for wpt failures on Event-subclasses-constructors.html CLOSED TREE
Backed out changeset 2fe249306030 (bug 1689413)
Backed out changeset 4d4d052bf8d3 (bug 1689413)
Backed out changeset a11a96dce11b (bug 1689413)
Backed out changeset d1411da6c254 (bug 1689413)
Backed out changeset 8262ed245e27 (bug 1689413)
Backed out changeset ed3ef7b5c8c8 (bug 1689413)
Backed out changeset 63eb8f93c6d8 (bug 1689413)
Backed out changeset 558e0b0af7b7 (bug 1689413)
Backed out changeset 5595064ffb60 (bug 1689413)
Backed out changeset e15f1a6f5a38 (bug 1689413)
Backed out changeset 95fa0ec36f7a (bug 1689413)
Backed out changeset 80d594d926ad (bug 1689413)
Backed out changeset 22854b710fbf (bug 1689413)
Backed out changeset 4531d5c25694 (bug 1689413)
Backed out changeset f1bb16079c0e (bug 1689413)
Backed out changeset 211c4f80a286 (bug 1689413)
Backed out changeset 6f7514b0a657 (bug 1689413)
Backed out changeset 76db3b04dedd (bug 1689413)
2021-03-06 01:11:29 +02:00
Jan de Mooij 8f52a7a890 Bug 1689413 part 17 - Remove ObjectGroup. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D106987
2021-03-05 19:10:12 +00:00
Jan de Mooij 1eaa0dbe85 Bug 1689413 part 16 - Remove JSObject group field. r=tcampbell,jonco
Note that on 32-bit platforms, JSObject is still 8 bytes. This means we don't have
to worry about misaligned DoubleValue stores to fixed slots on ARM32/MIPS32.

Differential Revision: https://phabricator.services.mozilla.com/D106986
2021-03-05 19:10:12 +00:00
Jan de Mooij fdae645a41 Bug 1689413 part 8 - Remove shadow::ObjectGroup. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D106978
2021-03-05 19:10:08 +00:00
Jan de Mooij 66e41f2096 Bug 1689413 part 6 - Move Realm* from ObjectGroup to BaseShape. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D106976
2021-03-05 19:10:07 +00:00