diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 99295f123882..67c26f0267e7 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -856,6 +856,10 @@ class SkipRoot void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {} public: + ~SkipRoot() { + // An empty destructor is needed to avoid warnings from clang about + // unused local variables of this type. + } #endif /* DEBUG && JSGC_ROOT_ANALYSIS */ diff --git a/js/src/builtin/BinaryData.cpp b/js/src/builtin/BinaryData.cpp index f0155af8463c..344b1487fbce 100644 --- a/js/src/builtin/BinaryData.cpp +++ b/js/src/builtin/BinaryData.cpp @@ -23,6 +23,8 @@ #include "jsatominlines.h" #include "jsobjinlines.h" +using mozilla::DebugOnly; + using namespace js; /* @@ -1552,7 +1554,7 @@ StructType::layout(JSContext *cx, HandleObject structType, HandleObject fields) // If the field type is a BinaryType and we can't get its bytes, we have a problem. RootedValue fieldTypeBytes(cx); - bool r = JSObject::getProperty(cx, fieldType, fieldType, cx->names().bytes, &fieldTypeBytes); + DebugOnly r = JSObject::getProperty(cx, fieldType, fieldType, cx->names().bytes, &fieldTypeBytes); JS_ASSERT(r); JS_ASSERT(fieldTypeBytes.isInt32()); diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index c3f07e58e725..cc4ca41c80d2 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -18,6 +18,8 @@ #include "jsgcinlines.h" +#include "vm/ObjectImpl-inl.h" + using namespace js; using namespace js::gc; diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.cpp b/js/src/ion/shared/CodeGenerator-x86-shared.cpp index 3d65ec41bcdf..5a3fb234164a 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-x86-shared.cpp @@ -376,9 +376,10 @@ CodeGeneratorX86Shared::visitMinMaxD(LMinMaxD *ins) { FloatRegister first = ToFloatRegister(ins->first()); FloatRegister second = ToFloatRegister(ins->second()); +#ifdef DEBUG FloatRegister output = ToFloatRegister(ins->output()); - JS_ASSERT(first == output); +#endif Label done, nan, minMaxInst; diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index fea20621da6f..b11840b9ca60 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -433,6 +433,10 @@ class AutoLockForExclusiveAccess AutoLockForExclusiveAccess(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; } + ~AutoLockForExclusiveAccess() { + // An empty destructor is needed to avoid warnings from clang about + // unused local variables of this type. + } #endif // JS_THREADSAFE MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 2fa56bcd0293..fadc6a622a05 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -507,7 +507,7 @@ Class JSFunction::class_ = { fun_trace }; -JS_FRIEND_DATA(Class* const) js::FunctionClassPtr = &JSFunction::class_; +Class* const js::FunctionClassPtr = &JSFunction::class_; /* Find the body of a function (not including braces). */ static bool diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 527514296f84..792231fb6e36 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -80,7 +80,7 @@ Class JSObject::class_ = { JS_ConvertStub }; -JS_FRIEND_DATA(Class* const) js::ObjectClassPtr = &JSObject::class_; +Class* const js::ObjectClassPtr = &JSObject::class_; JS_FRIEND_API(JSObject *) JS_ObjectToInnerObject(JSContext *cx, JSObject *objArg) diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index 4101908bbe19..ee1df97431bc 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -3133,7 +3133,7 @@ Class js::ObjectProxyObject::class_ = { } }; -JS_FRIEND_DATA(Class* const) js::ObjectProxyClassPtr = &ObjectProxyObject::class_; +Class* const js::ObjectProxyClassPtr = &ObjectProxyObject::class_; Class js::OuterWindowProxyObject::class_ = { "Proxy", @@ -3192,7 +3192,7 @@ Class js::OuterWindowProxyObject::class_ = { } }; -JS_FRIEND_DATA(Class* const) js::OuterWindowProxyClassPtr = &OuterWindowProxyObject::class_; +Class* const js::OuterWindowProxyClassPtr = &OuterWindowProxyObject::class_; static bool proxy_Call(JSContext *cx, unsigned argc, Value *vp) @@ -3263,7 +3263,7 @@ Class js::FunctionProxyObject::class_ = { } }; -JS_FRIEND_DATA(Class* const) js::FunctionProxyClassPtr = &FunctionProxyObject::class_; +Class* const js::FunctionProxyClassPtr = &FunctionProxyObject::class_; /* static */ ProxyObject * ProxyObject::New(JSContext *cx, BaseProxyHandler *handler, HandleValue priv, TaggedProto proto_, diff --git a/js/src/jsworkers.h b/js/src/jsworkers.h index fcab0a960898..36dae078f0ee 100644 --- a/js/src/jsworkers.h +++ b/js/src/jsworkers.h @@ -289,8 +289,10 @@ class AutoUnlockWorkerThreadState /* Pause any threads that are running jobs off thread during GC activity. */ class AutoPauseWorkersForGC { +#ifdef JS_WORKER_THREADS JSRuntime *runtime; bool needsUnpause; +#endif MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER public: diff --git a/js/src/vm/ThreadPool.cpp b/js/src/vm/ThreadPool.cpp index faeb25e8be45..6f4c522252a9 100644 --- a/js/src/vm/ThreadPool.cpp +++ b/js/src/vm/ThreadPool.cpp @@ -186,7 +186,10 @@ ThreadPoolWorker::terminate() // them down when requested. ThreadPool::ThreadPool(JSRuntime *rt) - : runtime_(rt), + : +#if defined(JS_THREADSAFE) || defined(DEBUG) + runtime_(rt), +#endif numWorkers_(0), // updated during init() nextId_(0) { diff --git a/js/src/vm/ThreadPool.h b/js/src/vm/ThreadPool.h index eb5ff8467185..8e7f34838ace 100644 --- a/js/src/vm/ThreadPool.h +++ b/js/src/vm/ThreadPool.h @@ -70,7 +70,9 @@ class ThreadPool friend class ThreadPoolWorker; // Initialized at startup only: +#if defined(JS_THREADSAFE) || defined(DEBUG) JSRuntime *const runtime_; +#endif js::Vector workers_; // Number of workers we will start, when we actually start them