Commit Graph

38 Commits

Author SHA1 Message Date
Nicholas Nethercote
c768a954ae Bug 1358320 - Make TimeStamp::ProcessCreation()'s outparam optional. r=gsvelto.
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.
2017-04-26 14:55:54 +10:00
Andrew McCreight
df7cef86b2 Bug 1350435 - Compute snapshot ID in the parent process. r=fitzgen,smaug
The parent and content processes can have different temp directories
when sandboxing is enabled, so the process that creates the file for a
heap snapshot must also determine the snapshot ID.

MozReview-Commit-ID: 2UuncT54NXc
2017-03-24 10:34:44 -07:00
Sylvestre Ledru
03b0353571 Bug 1338086 - Remove useless else blocks in order to reduce complexity devtools/shared/ r=fitzgen
MozReview-Commit-ID: CxMopblOFVp
2017-02-09 10:09:21 +01:00
Jan de Mooij
b402a91ead Bug 1302448 part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8 2016-09-14 15:47:32 +02:00
Nicholas Nethercote
b5810a1eb4 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");
2016-09-02 17:12:24 +10:00
Jan de Mooij
8f880df8da Bug 1295967 - Share Shapes and BaseShapes across compartments. r=jonco,fitzgen,njn 2016-08-23 11:25:54 +02:00
Jan de Mooij
7745591aa5 Bug 1286795 part 5 - Change some classes to take JSContext instead of JSRuntime. r=terrence 2016-07-23 19:53:03 +02:00
Jan de Mooij
1e309e5dfb Bug 1286795 part 3 - Change UbiNode APIs to take JSContext instead of JSRuntime. r=fitzgen 2016-07-23 19:52:25 +02:00
Chris Peterson
6c0f810682 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
Terrence Cole
a1f2c85caa Bug 1232686 - Use decltype to infer Variant::match return type; r=fitzgen 2015-12-15 07:45:22 -08:00
Chris Peterson
c35faf4632 Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
Boris Zbarsky
7f8a9fb70a Bug 1281061. Do an atom equality compare instead of a string compare on the script filename string in SavedFrame::isSelfHosted. r=fitzgen 2016-07-08 22:53:53 -04:00
Jan de Mooij
23850549c8 Bug 1283855 part 17 - Make {Get,Set}DebuggerMallocSizeOf take JSContext instead of JSRuntime. r=jimb 2016-07-06 11:40:20 +02:00
Carsten "Tomcat" Book
8cde20b993 Backed out changeset e673dbc9848f (bug 1232686) for breaking VS2013 Builds 2016-04-16 10:57:53 +02:00
Terrence Cole
005914496e Bug 1232686 - Use decltype to infer Variant::match return type; r=fitzgen 2015-12-15 07:45:22 -08:00
Nick Fitzgerald
94868fc94d Bug 1258236 - Change the way we test for end-of-stream in ReadHeapSnapshot; r=sfink
Fold reading the size of the next message and testing whether the stream has
more data into the same operation.

MozReview-Commit-ID: GUJymKy7qsj
2016-03-25 14:53:00 +01:00
Nick Fitzgerald
29677fe39a Bug 1254092 - TraceIncomingCCWs should work at the JSCompartment level of granularity. r=jimb
There can be multiple compartments within the same zone, only one of which is a
debuggee. In this scenario, CCWs from other compartments into the debuggee
compartment should be traced and treated as roots. Therefore, dealing with CCWs
at the JS::Zone level is incorrect, and this patch changes the granularity level
to JSCompartments. If you look at the callers and uses of the function, it makes
much more sense now.

Additionally, it renames `JS_TraceIncomingCCWs` to `JS::TraceIncomingCCWs`.
2016-03-14 16:11:00 +01:00
Nick Fitzgerald
172834fb05 Bug 1247658 - Expose a method to JS for find the shortest retaining paths of some nodes in a heap snapshot; r=bz r=jimb
This commit adds the `computeShortestPaths` method to the `HeapSnapshot` webidl
interface. It implements this new method on the
`mozilla::devtools::HeapSnapshot` class.
2016-02-11 14:32:00 +01:00
Nick Fitzgerald
deecaa1ebf Bug 1231883 - Implement HeapSnapshot.describeNode; r=mrbkap
This commit implements the HeapSnapshot.describeNode method which allows chrome
JS code to request a description of a given node as specified by our existing
"breakdown" language. This description can be used to generate a human-readable
label for the node.
2015-12-18 12:05:14 -08:00
Nick Fitzgerald
f27c858435 Bug 1231763 - Extract breakdown parsing from JS::ubi::Census. r=jimb 2015-12-16 09:19:00 +01:00
Nick Fitzgerald
79d5400df7 Bug 1226217 - Use less verbose cycle collection macros for mozilla::devtools::HeapSnapshot; r=bz 2015-11-19 07:45:00 +01:00
Jan Varga
86cf1daebe Bug 961049 - Part 3: Move PersistenceType serializer from indexedDB to quota module; r=baku 2015-11-22 10:43:34 +01:00
Nick Fitzgerald
526bf1ab61 Bug 1226176 - Compute retained sizes in dominator trees and expose them to JavaScript; r=bz,sfink 2015-11-20 09:08:15 -08:00
Nick Fitzgerald
fe902708b3 Bug 1225588 - Expose DominatorTree to JavaScript; r=sfink,bz
This commit adds the DominatorTree.webidl interface, which is only exposed to
chrome JS. The interface is implemented by mozilla::devtools::DominatorTree,
which is a thin wrapper around JS::ubi::DominatorTree. This does not expose any
methods on the DominatorTree interface, those will come as follow up changesets.
2015-11-18 14:12:23 -08:00
Tom Tromey
38351dc381 Bug 1223954 - don't use implicitJSContext for readHeapSnapshot and saveHeapSnapshot; r=bz 2015-11-12 08:51:00 +01:00
Nick Fitzgerald
503d3406a7 Bug 1223512 - Validate that every edge referent is in the heap snapshot; r=shu 2015-11-13 11:11:09 -08:00
Nick Fitzgerald
65a4685cc8 Bug 1220918 - Serialize and deseriliaze JS::ubi::Node's script filenames in heap snapshots; r=sfink 2015-11-04 05:49:33 -08:00
Nick Fitzgerald
d36eb54a78 Bug 1219066 - Make sure to traverse and unlink HeapSnapshot::mParent in cycle collection; r=mccr8 2015-10-28 22:46:25 -07:00
Carsten "Tomcat" Book
958995e6a3 Backed out changeset 2e4f2de05673 (bug 1219066) 2015-10-28 13:09:40 +01:00
Nick Fitzgerald
7bfa8ce35e Bug 1219066 - Make sure to traverse and unlink HeapSnapshot::mParent in cycle collection; r=mccr8 2015-10-28 02:11:06 -07:00
Nick Fitzgerald
675c05f5de Bug 1218597 - Limit the number of stack frames serialized in core dumps; r=froydnj 2015-10-27 14:13:39 -07:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Nick Fitzgerald
1784a308ee Bug 1213436 - Reject core dumps with node IDs that don't fit in an IEEE 754 double; r=sfink 2015-10-13 11:59:00 +02:00
Nick Fitzgerald
1d821c15c6 Bug 1196461 - De-duplicate strings in heap snapshot core dumps; r=shu,jimb
This changeset replaces all of the

    // char16_t[]
    optional bytes someProperty = 1;

one- and two-byte string properties in the CoreDump.proto protobuf definition
file with:

    oneof {
        // char16_t[]
        bytes  someProperty    = 1;
        uint64 somePropertyRef = 2;
    }

The first time the N^th unique string is serialized, then someProperty is used
and the full string is serialized in the protobuf message. All following times
that string is serialized, somePropertyRef is used and its value is N.

Among the other things, this also changes JS::ubi::Edge::name from a raw pointer
with commented rules about who does or doesn't own and should and shouldn't free
the raw pointer to a UniquePtr that enforces those rules rather than relying on
developers reading and obeying the rules in the comments.
2015-09-30 16:03:31 -07:00
Nick Fitzgerald
af011b3ca2 Bug 1206290 - Part 0: Move js/UbiNodeTraverse.h to js/UbiNodeBreadthFirst.h; r=sfink 2015-09-24 14:01:22 -07:00
Nick Fitzgerald
963dd4d79a Bug 1182653 - Use JSRuntime* instead of JSContext* in ubi::Node infrastructure; r=sfink
This enables the use of ubi::Node in situations where a JSContext* is not
available, and paves the way for debugging utilities to dump shortest paths from
GC roots to a given ubi::Node that can be used while paused in a debugger.
2015-09-23 09:39:56 -07:00
Nick Fitzgerald
935452bc55 Bug 1201597 - Part 2: Add an IPDL subprotocol for opening core dump files to
save heap snapsots into; r=mrbkap
2015-09-22 12:09:42 -07:00
J. Ryan Stinnett
a3073e0420 Bug 912121 - Migrate major DevTools directories. rs=devtools
Move major DevTools files to new directories using the following steps:

hg mv browser/devtools devtools/client
hg mv toolkit/devtools/server devtools/server
hg mv toolkit/devtools devtools/shared

No other changes are made.
2015-09-21 12:02:24 -05:00