In order to try and mitigate crashes on 64-bit FF 57+ on AMD Bobcat
CPUs, insert NOPs before the JIT code buffers. On earlier versions of
these processors, hardware bugs cause crashes to occur in locations
before the JIT code stub. For simplicity, the JitCode* pointer is
shifted even on machines that are unaffected. With the previous patch
fixing over allocation, we end up being size-neutral.
MozReview-Commit-ID: 4LqBfOzv6Qy
When computing worst-case alignment padding, we don't take into account
the buffer already being partially aligned. This saves one word per
JitCode buffer allocation.
MozReview-Commit-ID: ZMwBzp97xy
Removing some more porting interfaces here because they are not
necessary. This was informed by ongoing ARM64 work (hence there's a
generalization here for ARM64) but is really independent of it.
MozReview-Commit-ID: 6L8qZaOzUFi
--HG--
extra : rebase_source : ff4f1aef90049eb99517a7d7077c063a225d5825
A few ifdefs that were on platform names were really supposed to be on
JS_PUNBOX64.
Changes temp register management so that functions in the platform
layer now allocate and return the temp registers when appropriate and
return invalid registers when not appropriate. This cleans up a bit
of code in the platform-independent layer.
MozReview-Commit-ID: K69Bj1gUNbZ
--HG--
extra : rebase_source : 39a536cfad462707689e3dc3cdc9e64ed3f598fc
Change the methods on the BaseFrame so that they take the source first
and destination last. Generally rename operands so that they are
called 'src' and 'dest', when meaningful.
MozReview-Commit-ID: K3tldAmfice
--HG--
extra : rebase_source : 167fd38a59fa11f0f3d3a11a899f255b54c0313c
Change the layer in BaseCompiler that operates on Stk& values so that
it always takes source first and destination last. Generally rename
operands so that they are called 'src' and 'dest', to further reduce
confusion.
MozReview-Commit-ID: 4sldPz1mYtw
--HG--
extra : rebase_source : ec8b3db539485e1dacad310fc1500f7e85de0261
Clean up the handling of invalid registers by adding predicates to the
register wrapper types as well as static constructors to construct
invalid register values.
Move code around so that register management code is separated from
the value stack code.
Generally clean up and use abstractions that load constants and
perform register-to-register moves.
MozReview-Commit-ID: KpJisW1HEV2
--HG--
extra : rebase_source : a21aee1fced94f3ffc2e6e8af892caeb89a4a235
This patch adds better error detection to XDR decoding to reduce memory
corruption in the event that XDR data is corrupt (which is not
*supposed* to happen).
Add missing default cases. Make out-of-range values fail the decode by
asserting in debug, and returning a TranscodeError in release. Mix a
magic value into enum value before transcoding to buffer (to reduce
chance of garbage data being decoded).
MozReview-Commit-ID: 1wPkho9dm8c
This patch does several interconnected things with Rabaldr's stack
frame.
First, it abstracts the stack frame logic from BaseCompiler into
BaseStackFrame; BaseCompiler now only knows very little about the
frame, and what it is allowed to know is documented (mostly that there
is a static part and a dynamic part and that masm.framePushed() is
always correct). In particular, BaseCompiler must use BaseStackFrame
to push and pop values from its value stack, it can't use masm
directly. This abstraction is important for ARM64, where we can't
freely push and pop, because SP must be aligned on a 16-byte boundary.
BaseStackFrame is also in charge of allocating locals to frame slots
and to access the locals. Crucially, these abstractions do not
require us to use a frame pointer.
Second, it removes all uses of the StackPointer variable (not defined
on ARM64) and most uses of masm.getStackPointer() from BaseCompiler;
the few that are left are well-defined cross-platform and are not
sensitive to the layout of the frame, only its size.
Third, it makes BaseLocalIter the property of BaseStackFrame (but
defined outside the latter since the iter class is accessed
externally).
MozReview-Commit-ID: 5BWCTeK1NOR
--HG--
extra : rebase_source : 5955d2cc47e94d855c117fd1f508c94398d6a990
extra : source : 3c874514716acf7b55fb2c0805e138b636071c88
These guards were mistakenly removed when bug 1377576 landed, because
I misunderstood how the allocators for these five node types could
fail - they can return nullptr for reasons other than allocation
failure.
MozReview-Commit-ID: 4A0GdFRkeHn
--HG--
extra : rebase_source : 3b5ac3aa6a0ca37e0e664c0addc96ece7b3e143c