These functions incorrectly passed sizeof(T) instead of 1, so we would allocate sizeof(T) * sizeof(T) bytes instead of sizeof(T) bytes. This was used for PcScriptCache where we would allocate a few extra megabytes due to this bug. The patch changes PcScriptCache to use UniquePtr + MakeUnique.
Differential Revision: https://phabricator.services.mozilla.com/D4343
--HG--
extra : amend_source : e9e3e906ac649a4b05d91c10e60bc10bc858fb98
For the same reason as previous commit, the code clang generates for
~AutoOutputRegister when inlined in CacheIRCompiler::emitArrayJoinResult
makes valgrind unhappy. The reason is that TypedOrValueRegister contains
a union with two types of different sizes, where clang makes the code do
a check against the larger variant before validating the union tag says
that's the type in use, and that doesn't go well under valgrind when the
union value was set for the smaller variant.
One way to fix this is to make the TypedOrValueRegister constructor fill
the uninitialized bytes of the union, but it also appears that the types
used in the union, as well as the union tag itself, are larger than they
actually need to be:
- AnyRegister::Code is a 32-bits integer representing a register number,
when no supported platform has more than 254 registers (accounting for
AnyRegister::Invalid),
- MIRType is a 32-bits integer (enum, actually) representing values that
are all below 256.
Changing only the former would make valgrind happy, avoiding the
uninitialized bytes being tested against in ~AutoOutputRegister, but it
was too tempting to do MIRType as well.
clang likes to transform conditions like:
if (A && B)
into
if (B && A)
where B might be undefined when A is true (or variants of the above with
! and ||, or split between multiple ifs). This doesn't go well with
valgrind, although it's valid (albeit seemingly convoluted).
In both cases fixed here, the condition A involves calling a function
with a pointer to a variable on the stack that may or may not be filled
by the function call, and the condition B checking the value of said
variable.
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.
Differential Revision: https://phabricator.services.mozilla.com/D3728
--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
This patch allows us to define methods or getters/setters for any of the
current set of well-known symbols. Those are defined by adding the [symbol]
attribute to a method:
[symbol]
Iterator iterator();
which causes the method to define a property with the well-known symbol which
matches its method name (Symbol.iterator, in this case).
Due to the implementation details of the XPIDL parser, this currently does not
support defining a non-symbol function with the same name as a symbol
function:
[symbol]
Iterator iterator();
[binaryname(OtherIterator)]
Thing iterator(in nsIDRef aIID);
throws for a duplicate method name, even though there is no actual conflict.
Differential Revision: https://phabricator.services.mozilla.com/D3724
--HG--
extra : rebase_source : 1385e2da93113306730f7c087fe7385dbe668e91
extra : histedit_source : 3afd9fe38e7cbddc5576c2bd1673496dd623e489
- Move SimpleTypeDescrKey functions into CacheIR.h. This matches the set of callers
- Move LoadTypedThingData into CacheIRCompiler, matching usage
- Push definition of StripPreliminaryObjectStubs up in file, and remove header declaration
- Consolidate LoadTypedThingLength into CacheIR files
- Remove now dead ICMultiStubCompiler
- Remove BinarySharedStub classes. Can do this now that Compare and BinaryArith ICs have been converted to CacheIR
- Rename comapreSharedStub, and use correct flag to disable it.
- Remove SharedStubInfo
- Collapse SharedICList.h back into SharedIC.h
- Remove unimplemented declaration
--HG--
extra : rebase_source : 8ac2b2644d970e0828903f91035c1b692874b203
The changes in shell/js.cpp silence warnings about unreachable return
statements.
The constant being removed in testErrorInterceptor.cpp is unused.
--HG--
extra : rebase_source : 8f57e671265a82a3baeb9d74cf38711383239a76
Fixes a hazard introduced by allowing the analysis to correctly see through more of the callgraph.
--HG--
extra : topic : hazard
extra : rebase_source : a2b20f3a4c5127c502c1402ca9abbd1e2ad0d382
TC39 has decided to rename Atomics.wake as the more conventional
Atomics.notify. The webcompat fallout from this should be roughly
zero, as browser currently have disabled SAB as a result of the
Spectre kerfuffle.
This patch introduces Atomics.notify, and changes a number of names in
the code and in test cases as a result, but retains Atomics.wake as an
alias until we're happy that we don't need it.
A note on nomenclature used in the code: Though Atomics.notify
/notifies/ the target agent, we still say that the agent was /woken/
by the notification if it becomes schedulable. An agent can be
notified without being woken in obscure implementation-specific
settings, normally having to do with waiting in interrupt handlers.
Also fixes a completely blatant and impossible-not-to-discover bug in
tests/shell/futex.js. Do we never run shell tests marked "slow"?
This makes me nervous.
--HG--
extra : rebase_source : db86f1c1b92ad831d081dd606e057d2919deb466
extra : histedit_source : eadfd80f068f7dec8c34f5cdfaadeecd31d001b4
When enabling the tracelogger, it will automatically spew the data to disk in the location specified by TLDIR or /tmp, if undefined. However, there needs to be a way to enable the tracelogger without spewing so that we can write this data as part of the gecko profiler JSON output, and ultimately visualized with perf.html.
Differential Revision: https://phabricator.services.mozilla.com/D3138
--HG--
extra : moz-landing-system : lando
Atomic operations are stress-tested by having multiple workers work on
the same location in ways that would reveal non-atomicity in an
incorrect result.
We run these tests only on native implementations, not on simulators.
Our simulators don't implement atomicity well.
This patch has the bare minimum, testing multiple agents that perform
the same operation. It's possible to do more, notably, to combine
different operations.
--HG--
extra : rebase_source : ddc2f611e87d099d15eedaec81304056b2ed14ac
extra : histedit_source : 466994c25d0d33986c41f5420bcc1dfa235f08fe
Normally ReadScalar uses memcpy from the source stream to the
destination object. This is only well-defined if the destination
argument is a POD type, which ExprType is not. So specialize
ReadScalar for ExprType and make the memcpy target the data payload in
that type instead.
--HG--
extra : rebase_source : 20df55aa1358e2bbceb3a06a386732897abaff27
extra : histedit_source : 1097641e4da9d4f656d7e2900878a116cd080efb
The pod member needs to be POD but has members that have evolved no
longer to be POD - a ValType and a LitVal. We work around the problem
locally by using ValType's representation type PackedTypeCode to
represent types, and by specializing LitVal as LitValPOD for use in
this structure.
--HG--
extra : rebase_source : 76194d811f28316ad890d6c9f1978773f3570838
Currently lookupOrAdd() will allocate if the table has no storage. But it
doesn't report an error if the allocation fails, which can cause problems.
This patch changes things so that lookupOrAdd() doesn't allocate when the table
has no storage. Instead, it returns an AddPtr that is not *valid* (its mTable
is empty) but it is *live*, and can be used in add(), whereupon the allocation
will occur.
The patch also makes Ptr::isValid() and AddPtr::isValid() non-public, because
the valid vs. live distinction is non-obvious and best kept hidden within the
classes.
--HG--
extra : rebase_source : 95d58725d92cc83332e27a61f98fa61185440e26
Bug 1484382 - Use mozilla::ScopeExit in jit/JitFrames.cpp
Bug 1484382 - Use mozilla::ScopeExit in vm/TypeInference.cpp
Bug 1484382 - Use mozilla::ScopeExit in jit/JitcodeMap.cpp
Bug 1484382 - Use mozilla::ScopeExit in jit/JitFrames.cpp
Differential Revision: https://phabricator.services.mozilla.com/D3685
--HG--
extra : moz-landing-system : lando
As the comment for SetJitExceptionHandler makes clear, the
infrastructure we have for generating unwind information on 64-bit
Windows is only necessary to permit Breakpad to generate crash reports.
We don't even have crash reporting for our non-existent AArch64 Windows
builds, and it will likely take us some time to make the necessary
changes in Breakpad and elsewhere. In addition, the unwind information
format is completely different on AArch64, and there's no decent
documentation on it yet.
Given all of this, the easiest way forward right now is to simply
disable this code to get things compiling. We can reenable it later
once we understand how to add appropriate support.
We were checking for cross-compartment wrappers in the Debugger constructor, but this patch also fixes addDebuggee and addAllGlobalsAsDebuggees.
Differential Revision: https://phabricator.services.mozilla.com/D3495
--HG--
extra : rebase_source : 3346baa677b4eae1ed8b7b13d93c1c8c89753d97