This will run the SpiderMonkey promise jobs more or less the same way that we
run Promise jobs right now, including using a Web IDL callback for the actual
invocation.
nsWrapperCache expects the object it stores to have an ObjectMoved op that will
notify the wrapper cache when the object is moved. SpiderMonkey promises don't
have a way to do this.
The XPCConvert changes are needed to allow code that passes around Promise
objects as nsISupports to continue working instead of ending up with
double-wrapped nsISupports (XPCWrappedNative for an nsISupports XPCWrappedJS)
around the SpiderMonkey Promise.
This patch introduces a fake IDL interface just to get the benefits of
cycle collection for the JS-to-C++ link we now need for PromiseNativeHandler
(because the SpiderMonkey Promise somehow needs to point to the
PromiseNativeHandler). Now in practice a bunch of our PromiseNativeHandlers
are not cycle collected. That kinda freaks me out, but spot-checking a few
suggests they do not in fact leak (either because they don't form cycles or
because the Promise they're observing always settles and then releases them).
Either way, that's a problem that exists with or without this patch...
This is the one part of this set of patches that is actually a substantive change
even without SPIDERMONKEY_PROMISE defined. This is being done because I don't
want to create ResolveInternal/RejectInternal methods on dom::Promise in the
new world.
In practice, the difference between MaybeResolve/Reject and
ResolveInternal/RejectInternal is that the former will do nothing if the
Promise is "resolved" in terms of spec terminology: either settled or locked in
to track another Promise. A resolved but still pending Promise can still get
fulfilled (what we call ResolveInternal) or rejected when the promise it's
tracking settles.
So the difference only matters if PromiseWorkerProxy can be working with a
"resolved" Promise (in which case what it's doing now would settle it, while
what I'm switching to would not). But I don't believe PromiseWorkerProxy ever
points to a "resolved" Promise.
These are basically the minimal changes needed to make PromiseDebugging compile
in the new world. It will NOT function correctly (see the XXX comments); Till
will be fixing it up more in bug 911216 as he transitions the relevant bits in
our devtools to work on top of SpiderMonkey promises.
The idea is to not define a "Promise" property on the global and not generate
any of the methods, since SpiderMonkey will implement all of those, but to keep
some of the conversion to/from JS logic and the IDL parser validation bits that
we have right now. Once we can assume SPIDERMONKEY_PROMISE we can probably
change how the "Promise" identifier is handled by the IDL parser and how the
resulting type is handled by codegen, but for now we're aiming for minimal
changes.
This will perform a single HTTP request that completes in <1s. Contrast
with before when we performed multiple HTTP requests and the process
took several seconds.
DONTBUILD (NPOTB)
MozReview-Commit-ID: DjX3LBdSOIk
They were disabled in bug 657569 because of a miscompilation from MSVC,
but back then, we were using one of 2005, 2008 or 2010 (not entirely
sure which). Even if it was the latter, there has been two releases of
MSVC since, if stopping at the one we're currently using.
This patch reverts the "measure-in-advance" approach added in part 1 of bug
1050108 -- because that doesn't interact well with DMD -- and adds locking to
avoid races between the url-classifier thread and the main thread.
Improve the performance of JNI calls by making JNI calls require a
Context object. LocalRef inherits from Context and can make calls
directly. Non-local Ref classes will generate a Context object when
making a call. The patch also makes the template design cleaner in
several cases.
Currently it will fail with errors such as:
Insufficient debug information (private symbols are needed) or code from
unknown language. The following modules didn't have full symbols:
nsBrowserApp.obj
AppData.obj (xpcomglue_staticruntime.lib)
FileUtils.obj (xpcomglue_staticruntime.lib)
nsCRTGlue.obj (xpcomglue_staticruntime.lib)
nsXPCOMGlue.obj (xpcomglue_staticruntime.lib)
We need to turn this back on when clang-cl grows more debug
info support.
Now that all the MSimd* instructions require unboxed arguments of the right
type, there is no need to explicitly pass in the specialization MIRType when
creating these instructions.
- Remove the specialization MIRType argument from instruction constructors,
::New() and ::NewAsmJS() functions.
- Add tighter argument checking assertions in the constructors.
The MIRType is not specific enough for MSimdUnbox to distinguish signed from
unsigned SIMD types, and when generating code for a MSimdBox, we can't look at
the templateObject to get the SimdType because it belongs to a different thread.
Pass a SimdType to CodeGenerator::registerSimdTemplate() instead of inspecting
the template object.
Delete MIRTypeToSimdType() which can't be accurate because MIRType doesn't
carry signedness information.
Add an optimization to unboxSimd(): With a SimdType on MSimdBox, we can
recognize the very common pattern where unboxSimd() gets called with an MSimdBox
value. In the types check out, just reuse the MSimdBox input and don't even
inert the check code.
The SIMD type policies no longer needd to insert MSimdUnbox instructions before
SIMD operations. This is already handled before the SIMD operations are created.
Assert that the MIRTypes are as expected instead.
When inlining SIMD operations that take a SIMD type as an argument, explicitly
insert a type checking MSimdUnbox using the new unboxSimd() function. This
requires passing down the SimdType argument from inlineSimd().
- Remove SimdSign and other arguments that can be inferred from the SimdType.
- Add a new function inlineSimdShift() to handle the shift operations where the
second argument is a scalar.
- Add a GetSimdLanes() function to SIMD.h which counts the number of lanes in a
SIMD type.
This helper function inserts an MUnboxSimd node which checks the arguments to
an inlined SIMD operation.
Use it for inlineSimdCheck() which now takes a SimdType argument. Also make
inlineSimdCheck produce a value that is a box/unbox pair instead of simply
returning its argument. This means that any SIMD type checking and unboxing
will happen at the time the check() function is executed, rather than when its
result is used. This is usually what you want.
We now have functions to create a (MIRType, SimdSign) from a SimdType, so use
those instead.
Calling SimdTypeToMIRType() also has the benefit of verifying that the list of
supported types in this function is consistent with the types in InlinableNative.
Following patches will push the SimdType to MIRType conversion further down the
call tree.
Provide two versions of this function:
- MaybeSimdTypeToMIRType returns false for unsupported SimdTypes.
- SimdTypeToMIRType asserts that the type is supported.
The conditional one is used in IonBuilder::inlineConstructSimdObject() to
provide a 'SimdTypeNotOptimized' outcome for JIT coach.