summaryrefslogtreecommitdiffstats
path: root/xpcom/base
diff options
context:
space:
mode:
Diffstat (limited to 'xpcom/base')
-rw-r--r--xpcom/base/nsCycleCollector.cpp5
-rw-r--r--xpcom/base/nsCycleCollectorTraceJSHelpers.cpp5
-rw-r--r--xpcom/base/nsDebugImpl.cpp8
-rw-r--r--xpcom/base/nsMemoryReporterManager.cpp83
-rw-r--r--xpcom/base/nsObjCExceptions.h78
5 files changed, 5 insertions, 174 deletions
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
index d6dc26954..06ed42326 100644
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2265,7 +2265,7 @@ CCGraphBuilder::BuildGraph(SliceBudget& aBudget)
SetFirstChild();
if (pi->mParticipant) {
- nsresult rv = pi->mParticipant->Traverse(pi->mPointer, *this);
+ nsresult rv = pi->mParticipant->TraverseNativeAndJS(pi->mPointer, *this);
MOZ_RELEASE_ASSERT(!NS_FAILED(rv), "Cycle collector Traverse method failed");
}
@@ -2539,7 +2539,7 @@ static bool
MayHaveChild(void* aObj, nsCycleCollectionParticipant* aCp)
{
ChildFinder cf;
- aCp->Traverse(aObj, cf);
+ aCp->TraverseNativeAndJS(aObj, cf);
return cf.MayHaveChild();
}
@@ -2596,7 +2596,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(JSPurpleBuffer)
CycleCollectionNoteChild(cb, tmp, "self");
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
#define NS_TRACE_SEGMENTED_ARRAY(_field, _type) \
diff --git a/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp b/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp
index 7c48002e3..f65a92e61 100644
--- a/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp
+++ b/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp
@@ -21,8 +21,9 @@ CycleCollectionNoteEdgeNameImpl(nsCycleCollectionTraversalCallback& aCallback,
}
void
-nsScriptObjectTracer::NoteJSChild(JS::GCCellPtr aGCThing, const char* aName,
- void* aClosure)
+nsCycleCollectionParticipant::NoteJSChild(JS::GCCellPtr aGCThing,
+ const char* aName,
+ void* aClosure)
{
nsCycleCollectionTraversalCallback* cb =
static_cast<nsCycleCollectionTraversalCallback*>(aClosure);
diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp
index 96487acda..a81eb3d71 100644
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -450,12 +450,6 @@ RealBreak()
".object_arch armv4t\n"
#endif
"BKPT #0");
-#elif defined(SOLARIS)
-#if defined(__i386__) || defined(__i386) || defined(__x86_64__)
- asm("int $3");
-#else
- raise(SIGTRAP);
-#endif
#else
#warning do not know how to break on this platform
#endif
@@ -530,8 +524,6 @@ Break(const char* aMsg)
RealBreak();
#elif defined(__arm__)
RealBreak();
-#elif defined(SOLARIS)
- RealBreak();
#else
#warning do not know how to break on this platform
#endif
diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp
index bfeda063b..88964f9b5 100644
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -317,85 +317,6 @@ VsizeMaxContiguousDistinguishedAmount(int64_t* aN)
}
#endif // FreeBSD
-#elif defined(SOLARIS)
-
-#include <procfs.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-static void
-XMappingIter(int64_t& aVsize, int64_t& aResident)
-{
- aVsize = -1;
- aResident = -1;
- int mapfd = open("/proc/self/xmap", O_RDONLY);
- struct stat st;
- prxmap_t* prmapp = nullptr;
- if (mapfd >= 0) {
- if (!fstat(mapfd, &st)) {
- int nmap = st.st_size / sizeof(prxmap_t);
- while (1) {
- // stat(2) on /proc/<pid>/xmap returns an incorrect value,
- // prior to the release of Solaris 11.
- // Here is a workaround for it.
- nmap *= 2;
- prmapp = (prxmap_t*)malloc((nmap + 1) * sizeof(prxmap_t));
- if (!prmapp) {
- // out of memory
- break;
- }
- int n = pread(mapfd, prmapp, (nmap + 1) * sizeof(prxmap_t), 0);
- if (n < 0) {
- break;
- }
- if (nmap >= n / sizeof(prxmap_t)) {
- aVsize = 0;
- aResident = 0;
- for (int i = 0; i < n / sizeof(prxmap_t); i++) {
- aVsize += prmapp[i].pr_size;
- aResident += prmapp[i].pr_rss * prmapp[i].pr_pagesize;
- }
- break;
- }
- free(prmapp);
- }
- free(prmapp);
- }
- close(mapfd);
- }
-}
-
-#define HAVE_VSIZE_AND_RESIDENT_REPORTERS 1
-static MOZ_MUST_USE nsresult
-VsizeDistinguishedAmount(int64_t* aN)
-{
- int64_t vsize, resident;
- XMappingIter(vsize, resident);
- if (vsize == -1) {
- return NS_ERROR_FAILURE;
- }
- *aN = vsize;
- return NS_OK;
-}
-
-static MOZ_MUST_USE nsresult
-ResidentDistinguishedAmount(int64_t* aN)
-{
- int64_t vsize, resident;
- XMappingIter(vsize, resident);
- if (resident == -1) {
- return NS_ERROR_FAILURE;
- }
- *aN = resident;
- return NS_OK;
-}
-
-static MOZ_MUST_USE nsresult
-ResidentFastDistinguishedAmount(int64_t* aN)
-{
- return ResidentDistinguishedAmount(aN);
-}
-
#elif defined(XP_MACOSX)
#include <mach/mach_init.h>
@@ -1145,13 +1066,9 @@ ResidentPeakDistinguishedAmount(int64_t* aN)
if (0 == getrusage(RUSAGE_SELF, &usage)) {
// The units for ru_maxrrs:
// - Mac: bytes
- // - Solaris: pages? But some sources it actually always returns 0, so
- // check for that
// - Linux, {Net/Open/Free}BSD, DragonFly: KiB
#ifdef XP_MACOSX
*aN = usage.ru_maxrss;
-#elif defined(SOLARIS)
- *aN = usage.ru_maxrss * getpagesize();
#else
*aN = usage.ru_maxrss * 1024;
#endif
diff --git a/xpcom/base/nsObjCExceptions.h b/xpcom/base/nsObjCExceptions.h
index b3ed532ec..e542a22f8 100644
--- a/xpcom/base/nsObjCExceptions.h
+++ b/xpcom/base/nsObjCExceptions.h
@@ -13,10 +13,6 @@
#import <Foundation/Foundation.h>
-#ifdef DEBUG
-#import <ExceptionHandling/NSExceptionHandler.h>
-#endif
-
#include <unistd.h>
#include <signal.h>
#include "nsError.h"
@@ -40,80 +36,6 @@ nsObjCExceptionLog(NSException* aException)
{
NSLog(@"Mozilla has caught an Obj-C exception [%@: %@]",
[aException name], [aException reason]);
-
-#ifdef DEBUG
- @try {
- // Try to get stack information out of the exception. 10.5 returns the stack
- // info with the callStackReturnAddresses selector.
- NSArray* stackTrace = nil;
- if ([aException respondsToSelector:@selector(callStackReturnAddresses)]) {
- NSArray* addresses = (NSArray*)
- [aException performSelector:@selector(callStackReturnAddresses)];
- if ([addresses count]) {
- stackTrace = addresses;
- }
- }
-
- // 10.4 doesn't respond to callStackReturnAddresses so we'll try to pull the
- // stack info out of the userInfo. It might not be there, sadly :(
- if (!stackTrace) {
- stackTrace = [[aException userInfo] objectForKey:NSStackTraceKey];
- }
-
- if (stackTrace) {
- // The command line should look like this:
- // /usr/bin/atos -p <pid> -printHeader <stack frame addresses>
- NSMutableArray* args =
- [NSMutableArray arrayWithCapacity:[stackTrace count] + 3];
-
- [args addObject:@"-p"];
- int pid = [[NSProcessInfo processInfo] processIdentifier];
- [args addObject:[NSString stringWithFormat:@"%d", pid]];
-
- [args addObject:@"-printHeader"];
-
- unsigned int stackCount = [stackTrace count];
- unsigned int stackIndex = 0;
- for (; stackIndex < stackCount; stackIndex++) {
- unsigned long address =
- [[stackTrace objectAtIndex:stackIndex] unsignedLongValue];
- [args addObject:[NSString stringWithFormat:@"0x%lx", address]];
- }
-
- NSPipe* outPipe = [NSPipe pipe];
-
- NSTask* task = [[NSTask alloc] init];
- [task setLaunchPath:@"/usr/bin/atos"];
- [task setArguments:args];
- [task setStandardOutput:outPipe];
- [task setStandardError:outPipe];
-
- NSLog(@"Generating stack trace for Obj-C exception...");
-
- // This will throw an exception if the atos tool cannot be found, and in
- // that case we'll just hit our @catch block below.
- [task launch];
-
- [task waitUntilExit];
- [task release];
-
- NSData* outData =
- [[outPipe fileHandleForReading] readDataToEndOfFile];
- NSString* outString =
- [[NSString alloc] initWithData:outData encoding:NSUTF8StringEncoding];
-
- NSLog(@"Stack trace:\n%@", outString);
-
- [outString release];
- } else {
- NSLog(@"<No stack information available for Obj-C exception>");
- }
- }
- @catch (NSException* exn) {
- NSLog(@"Failed to generate stack trace for Obj-C exception [%@: %@]",
- [exn name], [exn reason]);
- }
-#endif
}
__attribute__((unused))