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

696 Коммитов

Автор SHA1 Сообщение Дата
Bill McCloskey 1f13f73c7f Bug 1306708 - Add prio() for message priority to IPDL (r=dvander) 2016-10-04 20:34:55 -07:00
Bill McCloskey f478d1188c Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
Bill McCloskey b83db28a45 Revert "Bug 1306708 - Rename prio to nested in IPDL (r=dvander)" on a CLOSED TREE
This reverts commit b1460c626078afbb9290e7d9ecaf3af605d5e893.
2016-10-04 15:55:19 -07:00
Bill McCloskey f2da85c062 Revert "Bug 1306708 - Add prio() for message priority to IPDL (r=dvander)"
This reverts commit 952e64ef2fb51f3e945d92b4ea27be271261e40d.
2016-10-04 15:55:09 -07:00
Bill McCloskey 3f54eaa3bc Bug 1306708 - Add prio() for message priority to IPDL (r=dvander) 2016-10-04 15:28:26 -07:00
Bill McCloskey eddd80027c Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 15:28:14 -07:00
Nathan Froyd 32b4accd77 Bug 1307500 - enhance string sharing between ipdl-generated MOZ_DIAGNOSTIC_ASSERT messages; r=billm
For every protocol's RemoveManagee method, and every sub-protocol that
protocol manages, we generate:

  MOZ_DIAGNOSTIC_ASSERT(mManagedPSubProtcolChild.Contains(actor), "...");

which dumps strings into the binary like:

(mManagedPAsmJSCacheEntryChild).Contains(actor) (actor not managed by this!)
MOZ_RELEASE_ASSERT((mManagedPAsmJSCacheEntryChild).Contains(actor)) (actor not managed by this!)

The linker is capable of merging multiple strings together, but
including the sub-protocol in every assert expression effectively
defeats this linker optimization, resulting in ~40KB of unnecessary
strings.

We can improve this situation by taking a reference to the managee
container, and using that reference in the assertion expression.  All
the assertion expressions are identical, and the linker can perform the
expected string merging, for a savings of ~40KB.
2016-10-04 23:42:55 -04:00
Matt Woodrow a8c2c8fb5b Bug 1297826 - Make FatalError virtual on IPDL generated classes, and propagate calls up to top-level protocols. r=billm 2016-10-04 21:31:25 +13:00
Aaron Klotz 98faee3572 Bug 1304876: Fix 64-bit build failure in IPC TestDataStructures test; r=billm
MozReview-Commit-ID: G0b0mvV8gus
2016-09-19 13:15:39 -06:00
Nicholas Nethercote d6cfd7634f Bug 1302309 - Cast some MaybeDestroy() calls to void. r=billm.
Most calls to MaybeDestroy() have their return value checked, but those that
take a T__None argument legitimately don't. Coverity gets upset by this, so
let's cast those calls to void to make Coverity happier.

--HG--
extra : rebase_source : 798c852371a682372c61cae953cc13c160b9ff9a
2016-09-13 13:48:42 +10:00
Bill McCloskey bb0a94054a Bug 1303499 - Fix broken IPDL tests (r=me, NPOTB) 2016-09-16 20:35:11 -07:00
Nathan Froyd 499fc0976b Bug 1297804 - part 4 - avoid array bounds checks in DestroySubtree loops; r=billm
The IPDL compiler generates code like this in DestroySubtree methods:

    // Recursively shutting down PAPZ kids
    nsTArray<PAPZChild*> kids((mManagedPAPZChild).Count());
    // Accumulate kids into a stable structure to iterate over
    ManagedPAPZChild(kids);
    for (uint32_t i = 0; (i) < ((kids).Length()); (++(i))) {
        // Guarding against a child removing a sibling from the list during the iteration.
        if ((mManagedPAPZChild).Contains(kids[i])) {
            (kids[i])->DestroySubtree(subtreewhy);
        }
    }

There are three problems with this code:

1) We initialize |kids| with a capacity, which is wasted work;
   ManagedPAPZChild() is going to resize the array for us anyway.
2) We're constantly reading from |kids.Length()| in the loop, when we
   only really need to read from it once.
3) We're repeatedly accessing kids[i], and doing needless bounds checks.

Let's fix those three problems.
2016-09-02 16:14:28 -04:00
Nathan Froyd 4de7ea1914 Bug 1297804 - part 2 - eschew array bounds checking in nsTArray IPDL-generated code, writer-side; r=billm
For better or worse, the IPDL compiler, for protocols that send or
receive arrays, generates Write methods for transferring those arrays,
rather than going through the standard ParamTraits specializations.
These generated methods perform unnecessary bounds checks when accessing
elements; such checks can be safely bypassed because we know the exact
length of all the arrays involved.  (Some compilers are not smart enough
to eliminate the bounds checks on their own.)
2016-09-02 16:14:28 -04:00
Nathan Froyd b086521c81 Bug 1297804 - part 1 - eschew array bounds checking in nsTArray IPDL-generated code, reader-side; r=billm
For better or worse, the IPDL compiler, for protocols that send or
receive arrays, generates Read methods for transferring those arrays,
rather than going through the standard ParamTraits specializations.
These generated methods perform unnecessary bounds checks when accessing
elements; such checks can be safely bypassed because we know the exact
length of all the arrays involved.  (Some compilers are not smart enough
to eliminate the bounds checks on their own.)
2016-09-02 16:14:28 -04:00
Nathan Froyd 25c7ca2c50 Bug 1297804 - part 0 - add a RangedFor stament type to IPDL's code generator; r=billm
This addition makes many of the upcoming patches significantly easier to
write, and enables us to avoid unpleasantness trying to fiddle with
ipdl.py's notions of C++ types.  (For instance, there's no good way,
when you have a type in-hand, to say the moral equivalent of
std::add_pointer<T>::type.)
2016-09-02 16:14:28 -04:00
Nathan Froyd 29e8bfeb34 Bug 1299594 - part 2 - remove opened actor tracking from IToplevelProtocol; r=billm
The only thing we needed opened actor tracking for was the ability to
clone all the actors.  But now that we no longer have support for
cloning actors, we no longer need to track the actors that we've cloned,
which makes a number of things significantly simpler.
2016-09-02 16:13:50 -04:00
Nathan Froyd fff9bd3854 Bug 1299594 - part 1 - remove CloneManagees/CloneToplevel code from IPDL; r=billm
CloneOpenedToplevels, which is never called, is the only interesting
caller of CloneToplevel.  And CloneToplevel, in turn, is the only
interesting caller of CloneManagees.  Which means we can ditch all this
code for a decent amount of space savings, both in code and writable
static data (no more useless virtual function entries in vtables).
2016-09-02 16:13:50 -04:00
Nathan Froyd 286887898c Bug 1297801 - part 4 - use non-null-checked operator new in IPDL code; r=billm
The standard placement new function requires a null check, implicitly
generated by the compiler, on its returned value.  For places we know
don't deal with null pointers, such as all the generated methods of IPDL
code, we can use an overloaded operator new that doesn't require the
null check.
2016-08-29 20:41:22 -04:00
Nathan Froyd 72439d5587 Bug 1297801 - part 3 - make mozilla::ipc::Trigger 4 bytes instead of 8; r=billm
We construct Trigger structures for every IPDL send and recv to run
the (currently defunct) IPDL state machine for each protocol.  These
structures are 64 bits to hold an enum that could be represented in 1
bit and an IPDL message enum that can easily be represented in 31 bits.
Therefore, we can make the Trigger structure smaller by storing the
members as bitfields, rather than full-width integers.  (The message
enums are formed from a 16-bit protocol enum and a 16-bit
protocol-specific message enum; since the protocol enum goes in the
upper bits, we'd need 32768 protocols to overflow the bitfield we're
using in Trigger...a number that we're not going to hit anytime soon.)

This change saves ~15K of space on x86-64 Linux.
2016-08-29 20:41:22 -04:00
Nathan Froyd fda65898ab Bug 1297801 - part 2 - make IPDL Transition functions take an inout parameter for State; r=billm
The calls to IPDL Transition() functions consistently look like:

  Transition(VAR, ..., &VAR);

We can save space by only passing &VAR and deriving the state we're
coming from by loading VAR in Transition itself.  It's not great using
inout parameters here, but we call Transition enough times that this
change saves a reasonable amount of space: about 10K on x86-64 Linux.
The unsightliness of inout parameters here is lessened by the only
callers of Transition being generated code.
2016-08-29 20:41:22 -04:00
Nathan Froyd a8474a5f11 Bug 1297801 - part 1 - commonize the managee->array functions in IPDL generated code; r=billm
There's no reason to generate identical code for every kind of managed
protocol; we can have a single instance that operates on void* and cast
our way to victory.  This change saves ~60K of text on x86-64 Linux.
2016-08-29 20:41:22 -04:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
David Anderson 7bdb79f9ac Generate template-friendly value readers for IPDL unions. (bug 1288259 part 1, r?=billm)
--HG--
extra : rebase_source : 7376052d8a50427ab64205246463917fbd0e0d61
2016-08-04 11:13:38 -07:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
David Anderson 6b2b817ec9 Add a callback for top-level actors to free themselves. (bug 1285364, r=billm)
--HG--
extra : rebase_source : 6954a2b34b521c886fba536cd7bedd5f30b94763
2016-07-13 11:21:58 -07:00
David Anderson e6a98dc91b Clean up Transport memory management in IPDL. (bug 1283744, r=billm) 2016-07-06 18:51:20 -07:00
Gabor Krizsanits 34e5765a00 Bug 1277614 - Guarding child iteration in DestroySubtree. r=wmccloskey 2016-06-22 13:21:48 +02:00
Cervantes Yu ce65905912 Bug 1268900 - Part 3: Test case for the IPDL keyword 'verify'. r=billm
MozReview-Commit-ID: KZeiDniAkoX
2016-06-22 17:52:07 +08:00
Cervantes Yu e4edd8f2c6 Bug 1268900 - Part 2: Code generation for the IPC message verifier. r=billm
MozReview-Commit-ID: 8mJ53UeuHWu
2016-06-22 17:51:49 +08:00
Cervantes Yu 1873f9d596 Bug 1268900 - Part 1: IPDL parser change for message verifier. r=billm
MozReview-Commit-ID: 4i9AiyP2AzN
2016-06-22 17:51:32 +08:00
Jonathan Watt b15368cfcb Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Bill McCloskey 7dbc02ed0f Bug 1262671 - Use BufferList for Pickle (r=froydnj) 2016-05-27 09:57:41 -07:00
Bill McCloskey b7441af61a Bug 1262671 - IPC sentinel checking (r=froydnj) 2016-05-27 09:57:38 -07:00
Bill McCloskey 291c555f34 Bug 1262671 - void** -> PickleIterator (r=froydnj) 2016-05-27 09:57:38 -07:00
Bill McCloskey f159cad060 Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
Nathan Froyd a5f42fc63a Bug 1262937 - part 8 - factor out array length deserialization errors; r=jld 2016-05-21 04:07:56 -04:00
Nathan Froyd 647562c2d2 Bug 1262937 - part 7 - factor out union type deserialization errors; r=jld 2016-05-21 04:07:56 -04:00
Nathan Froyd dfe775eb9f Bug 1262937 - part 6 - enable custom error message for ipdl.py's checkedRead; r=jld
To enable string sharing, we're going to have helpful functions that
take a small, distinguishable, sharable string and construct a more
complete error message out of that.  To do that easily with checkedRead,
we need to be able to pass custom parameters into the error function.
2016-05-21 04:07:56 -04:00
Nathan Froyd dcc74a62c9 Bug 1262937 - part 5 - factor out actor reading code to a common base class; r=jld
Actor reading from IPC message is codegen'd with a lot of repeated code.
We can improve that by moving the core actor reading code out of
subclasses into IProtocolmanager.  While we still need to codegen a bit
of code to cast the read actor to the proper type, the code overall is
smaller.  The lone downside is that if we do encounter an error reading
the actor id out of the message, the precision of our crash messages is
reduced somewhat: we no longer have the protocol name doing the reading,
nor do we get crash report annotations, since we can't tell whether
we're in the parent or child process.
2016-05-21 04:07:56 -04:00
Nathan Froyd 2b69fc29e3 Bug 1262937 - part 3 - move quoting out of checkedRead; r=jld
checkedRead is set up to single-quote whatever message is passed in.
This scheme works great for all existing messages, but it makes some
callsites a little surprising ("where's the matching quote?") and
doesn't work well with message changes to be made in future patches.
Let's move the quoting out to client code.
2016-05-21 04:07:56 -04:00
Nathan Froyd 99e5f4a2e6 Bug 1262937 - part 2 - don't include the message name when complaining about handler failure; r=jld
Similar to part 1, this change enables the strings passed to
ProtocolErrorBreakpoint to be collapsed into a single string, saving
~60K of read-only data (!).  This change does affect debuggability
slightly, but given that ProtocolErrorBreakpoint only tries to throw the
passed-in string to stderr, I don't think it's a huge deal.
2016-05-21 04:07:56 -04:00
Nathan Froyd 558d2f2756 Bug 1262937 - part 1 - don't include the protocol name in Clone error messages; r=jld
We have better ways of getting the protocol name at the point of the
error (e.g. backtraces).  Removing it means the error message can be
condensed to a single string by the compiler/linking, saving ~8k of
read-only data.
2016-05-21 04:07:56 -04:00
Bob Owen 2447fbb7fa Bug 1035125 Part 1: Back out changeset 1910714b56c6 and associated subsequent changes. r=bsmedberg
The original changeset that is being backed out had comment:
Bug 1023941 - Part 5: Loader hook to redirect the missing import.

The changes made in bug 1023941 were to work around the fact that with VS2013, msvcr120.dll imports kernel32!GetLogicalProcessorInformation, which is not available on Windows XP SP2.
In VS2015, the GetLogicalProcessorInformation requirement has moved into concrt140.dll (concurrency runtime), which we don't use.
So, now that our build infra is building with VS2015, we can remove the hooking and static runtime linking required to get the VS2013 fix to work.

In addition we need to do that to be able us to link the Chromium sandbox code into firefox.exe and get it to build and run with both VS2015 and VS2013.

MozReview-Commit-ID: 1tlXaYJ8dHH

--HG--
extra : rebase_source : 49b216e34fc5c77af96df1f67ee44c46d5368bfe
2016-05-15 16:23:56 +01:00
Chris Peterson 8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Jed Davis 7e91f65f43 Bug 1191452 - Limit IPDL-generated Move()s to Recv methods. r=billm
Specifically, it's important not to try to use Move() in the
Alloc+SendConstructor convenience method, because that Move()s the same
value twice (as discovered in bug 1186706), and neither callee
requires rvalue references in that case anyway.

This also removes the previous feature of calling makeCxxArgs with
params=0 to omit the message's input parameters, because it's not being
used and doesn't appear to have ever been used; it could be restored
(e.g., as paramsems=None) if needed.
2016-05-11 09:37:00 +02:00
Kyle Huey c1f8ae3c88 Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
Kyle Huey b15d2f593c Bug 1266595: Followup to fix IPDL tests. r=billm
--HG--
extra : rebase_source : a0142b175ef1e0d46a6139dccdbdb8b7debda1c9
2016-05-03 22:36:50 -07:00
Andrew McCreight a1f8b0904f Bug 1269365, part 3 - Use infallible array allocation in implementSpecialArrayPickling. r=froydnj
As with part 2, this will turn some allocation failures during
deserialization from IPC FatalError crashes into OOM crashes.
2016-05-03 09:29:39 -07:00
Nicholas Nethercote 2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Andrea Marchesini a9b65ecfb0 Bug 1261094 - Improve how MessageChannel::mInterruptStack is used in IPC code, r=jld 2016-04-28 07:21:49 +08:00