Permalink
Browse files

upgrade smjs to doublec/mozilla-central@34e7fd6

  • Loading branch information...
1 parent f3f2839 commit 58d0aba2beb94d3cd72f60562089cc123b7f4daa @bnoordhuis committed May 10, 2012
Showing 1,007 changed files with 34,770 additions and 29,448 deletions.
View
Oops, something went wrong.
@@ -94,11 +94,8 @@ struct CompartmentStats
size_t shapesExtraTreeShapeKids;
size_t shapesCompartmentTables;
size_t scriptData;
-
-#ifdef JS_METHODJIT
- size_t mjitCode;
size_t mjitData;
-#endif
+
TypeInferenceSizes typeInferenceSizes;
};
@@ -110,24 +107,25 @@ struct RuntimeStats
, runtimeContexts(0)
, runtimeNormal(0)
, runtimeTemporary(0)
+ , runtimeMjitCode(0)
, runtimeRegexpCode(0)
+ , runtimeUnusedCodeMemory(0)
, runtimeStackCommitted(0)
, runtimeGCMarker(0)
, gcHeapChunkTotal(0)
+ , gcHeapCommitted(0)
+ , gcHeapUnused(0)
, gcHeapChunkCleanUnused(0)
, gcHeapChunkDirtyUnused(0)
, gcHeapChunkCleanDecommitted(0)
, gcHeapChunkDirtyDecommitted(0)
, gcHeapArenaUnused(0)
, gcHeapChunkAdmin(0)
- , gcHeapUnusedPercentage(0)
, totalObjects(0)
, totalShapes(0)
, totalScripts(0)
, totalStrings(0)
-#ifdef JS_METHODJIT
, totalMjit(0)
-#endif
, totalTypeInference(0)
, totalAnalysisTemp(0)
, compartmentStatsVector()
@@ -140,24 +138,25 @@ struct RuntimeStats
size_t runtimeContexts;
size_t runtimeNormal;
size_t runtimeTemporary;
+ size_t runtimeMjitCode;
size_t runtimeRegexpCode;
+ size_t runtimeUnusedCodeMemory;
size_t runtimeStackCommitted;
size_t runtimeGCMarker;
size_t gcHeapChunkTotal;
+ size_t gcHeapCommitted;
+ size_t gcHeapUnused;
size_t gcHeapChunkCleanUnused;
size_t gcHeapChunkDirtyUnused;
size_t gcHeapChunkCleanDecommitted;
size_t gcHeapChunkDirtyDecommitted;
size_t gcHeapArenaUnused;
size_t gcHeapChunkAdmin;
- size_t gcHeapUnusedPercentage;
size_t totalObjects;
size_t totalShapes;
size_t totalScripts;
size_t totalStrings;
-#ifdef JS_METHODJIT
size_t totalMjit;
-#endif
size_t totalTypeInference;
size_t totalAnalysisTemp;
@@ -174,6 +174,11 @@ template <typename T> struct IsPodType<T *> { static const bool result =
template <bool cond, typename T, T v1, T v2> struct If { static const T result = v1; };
template <typename T, T v1, T v2> struct If<false, T, v1, v2> { static const T result = v2; };
+/*
+ * Traits class for identifying types that are implicitly barriered.
+ */
+template <class T> struct IsPostBarrieredType { static const bool result = false; };
+
} /* namespace tl */
} /* namespace js */
View
@@ -158,9 +158,20 @@ PrintBacktrace()
} \
} while (0)
+# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \
+ do \
+ { \
+ if (++OOM_counter > OOM_maxAllocations) { \
+ JS_OOM_EMIT_BACKTRACE();\
+ js_ReportOutOfMemory(cx);\
+ return NULL; \
+ } \
+ } while (0)
+
# else
# define JS_OOM_POSSIBLY_FAIL() do {} while(0)
-# endif
+# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)
+# endif /* DEBUG */
/*
* SpiderMonkey code should not be calling these allocation functions directly.
@@ -332,22 +343,6 @@ __BitScanReverse64(unsigned __int64 val)
JS_END_MACRO
#endif
-/*
- * Internal function.
- * Compute the log of the least power of 2 greater than or equal to n. This is
- * a version of JS_CeilingLog2 that operates on unsigned integers with
- * CPU-dependant size.
- */
-#define JS_CEILING_LOG2W(n) ((n) <= 1 ? 0 : 1 + JS_FLOOR_LOG2W((n) - 1))
-
-/*
- * Internal function.
- * Compute the log of the greatest power of 2 less than or equal to n.
- * This is a version of JS_FloorLog2 that operates on unsigned integers with
- * CPU-dependant size and requires that n != 0.
- */
-#define JS_FLOOR_LOG2W(n) (JS_ASSERT((n) != 0), js_FloorLog2wImpl(n))
-
#if JS_BYTES_PER_WORD == 4
# ifdef JS_HAS_BUILTIN_BITSCAN32
# define js_FloorLog2wImpl(n) \
@@ -366,6 +361,27 @@ JS_PUBLIC_API(size_t) js_FloorLog2wImpl(size_t n);
# error "NOT SUPPORTED"
#endif
+/*
+ * Internal function.
+ * Compute the log of the least power of 2 greater than or equal to n. This is
+ * a version of JS_CeilingLog2 that operates on unsigned integers with
+ * CPU-dependant size.
+ */
+#define JS_CEILING_LOG2W(n) ((n) <= 1 ? 0 : 1 + JS_FLOOR_LOG2W((n) - 1))
+
+/*
+ * Internal function.
+ * Compute the log of the greatest power of 2 less than or equal to n.
+ * This is a version of JS_FloorLog2 that operates on unsigned integers with
+ * CPU-dependant size and requires that n != 0.
+ */
+static MOZ_ALWAYS_INLINE size_t
+JS_FLOOR_LOG2W(size_t n)
+{
+ JS_ASSERT(n != 0);
+ return js_FloorLog2wImpl(n);
+}
+
JS_END_EXTERN_C
#ifdef __cplusplus
@@ -831,7 +847,7 @@ class MoveRef {
explicit MoveRef(T &t) : pointer(&t) { }
T &operator*() const { return *pointer; }
T *operator->() const { return pointer; }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(__clang__)
/*
* If MoveRef is used in a rvalue position (which is expected), we can
* end up in a situation where, without this ifdef, we would try to pass
@@ -899,6 +915,40 @@ RoundUpPow2(size_t x)
} /* namespace js */
+namespace JS {
+
+/*
+ * Methods for poisoning GC heap pointer words and checking for poisoned words.
+ * These are in this file for use in Value methods and so forth.
+ *
+ * If the moving GC hazard analysis is in use and detects a non-rooted stack
+ * pointer to a GC thing, one byte of that pointer is poisoned to refer to an
+ * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the
+ * pointer is overwritten, to reduce the likelihood of accidentally changing
+ * a live integer value.
+ */
+
+inline void PoisonPtr(uintptr_t *v)
+{
+#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)
+ uint8_t *ptr = (uint8_t *) v + 3;
+ *ptr = JS_FREE_PATTERN;
+#endif
+}
+
+template <typename T>
+inline bool IsPoisonedPtr(T *v)
+{
+#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)
+ uint32_t mask = uintptr_t(v) & 0xff000000;
+ return mask == uint32_t(JS_FREE_PATTERN << 24);
+#else
+ return false;
+#endif
+}
+
+}
+
#endif /* defined(__cplusplus) */
/*
View
@@ -213,6 +213,8 @@ struct VectorImpl<T, N, AP, true>
template <class T, size_t N, class AllocPolicy>
class Vector : private AllocPolicy
{
+ typedef typename tl::StaticAssert<!tl::IsPostBarrieredType<T>::result>::result _;
+
/* utilities */
static const bool sElemIsPod = tl::IsPodType<T>::result;
@@ -505,7 +507,7 @@ class Vector : private AllocPolicy
*/
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const;
- /*
+ /*
* Like sizeOfExcludingThis, but also measures the size of the Vector
* object (which must be heap-allocated) itself.
*/
@@ -38,54 +38,17 @@
*
* ***** END LICENSE BLOCK ***** */
-#include "mozilla/Attributes.h"
-#include "mozilla/Types.h"
-
-#include <cstdio>
-#include <cstdlib>
-#ifndef WIN32
-#include <signal.h>
-#endif
+#include "mozilla/Assertions.h"
/* Implementations of runtime and static assertion macros for C and C++. */
extern "C" {
MOZ_EXPORT_API(void)
-MOZ_Crash()
-{
- /*
- * We write 123 here so that the machine code for this function is
- * unique. Otherwise the linker, trying to be smart, might use the
- * same code for MOZ_Crash and for some other function. That
- * messes up the signature in minidumps.
- */
-
-#if defined(WIN32)
- /*
- * We used to call DebugBreak() on Windows, but amazingly, it causes
- * the MSVS 2010 debugger not to be able to recover a call stack.
- */
- *((volatile int *) NULL) = 123;
- exit(3);
-#elif defined(__APPLE__)
- /*
- * On Mac OS X, Breakpad ignores signals. Only real Mach exceptions are
- * trapped.
- */
- *((volatile int *) NULL) = 123; /* To continue from here in GDB: "return" then "continue". */
- raise(SIGABRT); /* In case above statement gets nixed by the optimizer. */
-#else
- raise(SIGABRT); /* To continue from here in GDB: "signal 0". */
-#endif
-}
-
-MOZ_EXPORT_API(void)
MOZ_Assert(const char* s, const char* file, int ln)
{
- fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
- fflush(stderr);
- MOZ_Crash();
+ MOZ_OutputAssertMessage(s, file, ln);
+ MOZ_CRASH();
}
}
Oops, something went wrong.

0 comments on commit 58d0aba

Please sign in to comment.