This commit removes TypedObject's type system (StructTypeDescr,
ArrayTypeDescr, ScalarTypeDescr) and replaces it with a
wasm::TypeHandle to a wasm::TypeDef inside the global
wasm::TypeContext. TypeDescr is left as a JSObject that
wraps a wasm::TypeHandle for a TypedObject. In the future
it will likely be re-used for a RttValue.
When instantiating a module, types are transferred to
the global context and TypeDescr objects wrapping the type handles
are created. The TypeDescr objects are placed in TlsData
for the TypeIdDesc corresponding to the StructType.
Differential Revision: https://phabricator.services.mozilla.com/D96223
This commit combines the two independent ToWebAssemblyValue and
ToJSValue implementations now that they have the same functional
behavior.
Differential Revision: https://phabricator.services.mozilla.com/D96222
The major difference between the two separate implementations
of ToJSValue is that the one operating on void* to have
!isExposable() filtered out by callers and generates a plausible
value for !isExposable() values. This allows the function to be
used by the debugger and not trigger errors in functions that have
v128.
This commit unifies both ToJSValue implementations to expect
!isExposable() values filtered out by callers and will return
a plausible value (now 'undefined') for users like debuggers
who want something. All callers that expect an error now check
isExposable() before calling the coercion function.
Differential Revision: https://phabricator.services.mozilla.com/D96221
A previous commit added ValType::isExposable() for types
that have no JS representation (currently (ref T) and v128).
This commit changes stub generation to check !isExposable()
instead of !isV128() so that (ref T) will be excluded.
Differential Revision: https://phabricator.services.mozilla.com/D96220
There are two independent implementations of ToWebAssemblyValue/
ToJSValue. One in WasmJS.cpp and another in WasmInstance.cpp. The
first was moved to WasmTypes.cpp in the previous commit. This commit
moves the second over to WasmTypes.cpp as well. A later commit
will unify the two implementations.
Differential Revision: https://phabricator.services.mozilla.com/D96219
wasm::Val and WasmGlobalObject both have a tagged WebAssembly value
implementation. Replace WasmGlobalObject's implementation with
wasm::Val's. wasm::Val gains the ability to have proper write
barriers as a result.
Differential Revision: https://phabricator.services.mozilla.com/D96218
This commit introduces wasm::TypeContext as a semantic type index space
over wasm funcs, structs, and arrays. Module validation is updated
to use this.
Differential Revision: https://phabricator.services.mozilla.com/D96216
Currently function types needed for runtime signature checks (can't fit in an
immediate) are transferred through wasm::Metadata. This commit generalizes this
method to transfer a vector of TypeDef's representing all types that need a
runtime representation. Some types are not transferred, such as function
types that fit in an machine word.
The dense structTypes_ vector in Instance is recreated as a stopgap during
instantiation. StructType::moduleIndex_ is removed and TypeIdDesc allocates
global data space to store the index to the dense structTypes_ vector in
Instance. The baseline compiler loads the index before calling struct.new/
narrow. This is suboptimal and a stopgap until the TypeIdDesc allocates space
for a TypeDescr* later in this commit stack and the structTypes_ vector
is removed.
Differential Revision: https://phabricator.services.mozilla.com/D96215
This commit is a non-functional change to rename FuncTypeIdDesc
to TypeIdDesc. A later commit will re-use this type for all types
that require a runtime representation, not just functions.
Differential Revision: https://phabricator.services.mozilla.com/D96214
A later commit will re-use TypeDef for a wasm::TypeContext that
can be used during compilation and at runtime. Currently
TypeDef::IsFunction indicates there is a FuncTypeIdDesc which
describes the runtime representation of a function runtime-type.
This commit removes FuncTypeIdDesc from TypeDef and moves it to
ModuleEnvironment so that TypeDef can be used at runtime.
Differential Revision: https://phabricator.services.mozilla.com/D96213
This is a non-functional change. Adds a FuncDesc similar to TableDesc and GlobalDesc
instead of the the array-of-structs funcTypes and funcTypeIndices. This will be
expanded in a later commit that removes FuncTypeIdDesc from TypeDef.
Differential Revision: https://phabricator.services.mozilla.com/D96212
This hides the platform provided printing dialog which shows progress while printing.
The dialog is dated but does provide an actual 0-100% progress indicator which
unfortunately this does not replace. It also provides a "Cancel" button which
also unfortunately doesn't work and gets us into a bad state.
This provides a simple spinner and a Printing... message to replace that dialog
so that the user knows that something is still happening.
Differential Revision: https://phabricator.services.mozilla.com/D99504
Turns out this causes a bit of overhead when appending to an AutoString,
because Truncate() calls SetToEmptyBuffer(), which makes it go from
inline-string to buffer string, and next time we append we need to turn
the string from a buffer-based string to an inline string again, which
is some minor, but measurable, work, while profiling some
micro-benchmarks.
Probably we should make Truncate() a no-op for a zero-length string, but
I'll send that separately.
Differential Revision: https://phabricator.services.mozilla.com/D99493
Because of part1, now we would activate controller in different momemt, so we have to modify our test to make them work or reduce the possible intermittent failure.
Depends on D98830
Differential Revision: https://phabricator.services.mozilla.com/D98831
Based on the comment, the logic here wants to ensure that we would only notify that change if the change happens on the active media session, so correct the condition to make it right.
Depends on D98829
Differential Revision: https://phabricator.services.mozilla.com/D98830
We currently activate the controller when it first becomes audible, which is possible to drop the first `playbackstatechange` event if the task to dispatch that evnt runs before we activate the controller.
The audible change always comes later than the playback change, so if we want to 100% ensure the first `playbackstatechange` can happen after `activated` event, then we have to activate the controller earlier. Therefore, this patch would activate the controller once it becomes playing.
Note that, even if we remove the audible check in media controller, we would still only control audible media because we have filtered out inaudible media in the content process.
Differential Revision: https://phabricator.services.mozilla.com/D98829
In GTest, xul.dll is considered untrusted because only the `FirefoxDirectory`
flag of `ModuleTrustFlags` is turned on. In CCov build, however, xul.dll is
considered trusted because the `FirefoxDirectoryAndVersion` flag is also turned
on. In the former case, the `FirefoxDirectoryAndVersion` is not turned on
because when xul.dll is re-built for GTest, its version becomes newer than
firefox.exe. In the CCov build, the version of firefox.exe was also reset
probaly during instrumentation. As a result, the loding event contains a value
in `mXULLoadDurationMS` in CCov build, but normally not.
This fix removes the check for `mXULLoadDurationMS` in GTest.
Differential Revision: https://phabricator.services.mozilla.com/D99564