Bug 1603845 - Fix clang-format issues in js/ r=iain

Differential Revision: https://phabricator.services.mozilla.com/D57163

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ted Campbell 2019-12-13 21:35:17 +00:00
Родитель e57173377f
Коммит 736ef5b81f
10 изменённых файлов: 41 добавлений и 40 удалений

Просмотреть файл

@ -37,7 +37,8 @@ class JS_PUBLIC_API ContextOptions {
werror_(false),
strictMode_(false),
extraWarnings_(false),
fuzzing_(false) {}
fuzzing_(false) {
}
bool asmJS() const { return asmJS_; }
ContextOptions& setAsmJS(bool flag) {

Просмотреть файл

@ -437,7 +437,7 @@ inline void TraceEdge(JSTracer* trc, JS::TenuredHeap<T>* thingp,
//
// Note that while |edgep| must never be null, it is fine for |*edgep| to be
// nullptr.
#define JS_DECLARE_UNSAFE_TRACE_ROOT(type) \
#define JS_DECLARE_UNSAFE_TRACE_ROOT(type) \
extern JS_PUBLIC_API void UnsafeTraceRoot(JSTracer* trc, type* edgep, \
const char* name);

Просмотреть файл

@ -15,10 +15,10 @@
#include <stdint.h> // size_t
#include "js/CallArgs.h" // JS::CallArgs
#include "js/GCVector.h" // JS::RootedVector
#include "js/CallArgs.h" // JS::CallArgs
#include "js/GCVector.h" // JS::RootedVector
#include "js/RootingAPI.h" // JS::AutoGCRooter, JS::{,Mutable}Handle
#include "js/Value.h" // JS::Value
#include "js/Value.h" // JS::Value
namespace JS {

Просмотреть файл

@ -116,7 +116,6 @@ class FinalizationRecordVectorObject : public NativeObject {
enum { RecordsSlot = 0, SlotCount };
public:
static const JSClass class_;
static FinalizationRecordVectorObject* create(JSContext* cx);

Просмотреть файл

@ -19,7 +19,7 @@
#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" // js::ReadableStreamControllerClearAlgorithms
#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{AddReadOrReadIntoRequest,CloseInternal,CreateReadResult,ErrorInternal,FulfillReadOrReadIntoRequest,GetNumReadRequests,HasDefaultReader}
#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStream{,Default}Reader, js::CreateReadableStreamDefaultReader, js::ReadableStreamReaderGeneric{Cancel,Initialize,Release}, js::ReadableStreamDefaultReaderRead
#include "js/ArrayBuffer.h" // JS::NewArrayBuffer
#include "js/ArrayBuffer.h" // JS::NewArrayBuffer
#include "js/PropertySpec.h"
#include "vm/Interpreter.h"
#include "vm/JSContext.h"

Просмотреть файл

@ -114,17 +114,19 @@ void WeakRefObject::finalize(JSFreeOp* fop, JSObject* obj) {
gc->unregisterWeakRef(cx, target, weakRef);
}
const JSClassOps WeakRefObject::classOps_ = {nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* enumerate */
nullptr, /* newEnumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
trace};
const JSClassOps WeakRefObject::classOps_ = {
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* enumerate */
nullptr, /* newEnumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
finalize, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
trace /* trace */
};
const ClassSpec WeakRefObject::classSpec_ = {
GenericCreateConstructor<WeakRefObject::construct, 0,

Просмотреть файл

@ -25,8 +25,8 @@
#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStream{,Default}Reader
#include "builtin/streams/StreamController.h" // js::StreamController
#include "builtin/streams/TeeState.h" // js::TeeState
#include "js/ArrayBuffer.h" // JS::NewArrayBuffer
#include "js/Class.h" // js::ClassSpec
#include "js/ArrayBuffer.h" // JS::NewArrayBuffer
#include "js/Class.h" // js::ClassSpec
#include "js/PropertySpec.h"
#include "vm/Interpreter.h"
#include "vm/JSContext.h"

Просмотреть файл

@ -711,14 +711,14 @@ static MOZ_ALWAYS_INLINE void RetractPointerToCodePointBoundary(
}
// Otherwise rewind past trailing units to the start of the code point.
# ifdef DEBUG
#ifdef DEBUG
size_t retracted = 0;
# endif
#endif
while (MOZ_UNLIKELY(IsTrailingUnit((*ptr)[0]))) {
--*ptr;
# ifdef DEBUG
#ifdef DEBUG
retracted++;
# endif
#endif
}
MOZ_ASSERT(retracted < 4,
@ -848,9 +848,9 @@ uint32_t TokenStreamAnyChars::computePartialColumn(
const Unit* const limit = sourceUnits.codeUnitPtrAt(offset);
auto RetractedOffsetOfChunk = [
# ifdef DEBUG
#ifdef DEBUG
this,
# endif
#endif
start, limit,
&sourceUnits](uint32_t index) {
MOZ_ASSERT(index < this->lastChunkVectorForLine_->length());
@ -861,12 +861,12 @@ uint32_t TokenStreamAnyChars::computePartialColumn(
const Unit* actualPtr = naivePtr;
RetractPointerToCodePointBoundary(&actualPtr, limit);
# ifdef DEBUG
#ifdef DEBUG
if ((*this->lastChunkVectorForLine_)[index].unitsType() ==
UnitsType::GuaranteedSingleUnit) {
MOZ_ASSERT(naivePtr == actualPtr, "miscomputed unitsType value");
}
# endif
#endif
return naiveOffset - PointerRangeSize(actualPtr, naivePtr);
};
@ -928,10 +928,10 @@ uint32_t TokenStreamAnyChars::computePartialColumn(
MOZ_ASSERT(begin < chunkLimit);
MOZ_ASSERT(chunkLimit <= limit);
static_assert(ColumnChunkLength >
SourceUnitTraits<Unit>::maxUnitsLength - 1,
"any retraction below is assumed to never underflow to the "
"preceding chunk, even for the longest code point");
static_assert(
ColumnChunkLength > SourceUnitTraits<Unit>::maxUnitsLength - 1,
"any retraction below is assumed to never underflow to the "
"preceding chunk, even for the longest code point");
// Prior tokenizing ensured that [begin, limit) is validly encoded, and
// |begin < chunkLimit|, so any retraction here can't underflow.

Просмотреть файл

@ -468,10 +468,10 @@ DEFINE_TRACE_EXTERNAL_EDGE_FUNCTION(SavedFrame*)
#undef DEFINE_TRACE_EXTERNAL_EDGE_FUNCTION
#define DEFINE_UNSAFE_TRACE_ROOT_FUNCTION(type) \
#define DEFINE_UNSAFE_TRACE_ROOT_FUNCTION(type) \
JS_PUBLIC_API void JS::UnsafeTraceRoot(JSTracer* trc, type* thingp, \
const char* name) { \
UnsafeTraceRootHelper(trc, thingp, name); \
const char* name) { \
UnsafeTraceRootHelper(trc, thingp, name); \
}
// Define UnsafeTraceRoot for each public GC pointer type.
@ -2622,7 +2622,8 @@ void GCMarker::enterWeakMarkingMode() {
for (SweepGroupZonesIter zone(runtime()); !zone.done(); zone.next()) {
for (auto r = zone->gcWeakKeys().all(); !r.empty(); r.popFront()) {
for (auto markable : r.front().value) {
MOZ_ASSERT(markable.weakmap->mapColor, "unmarked weakmaps in weak keys table");
MOZ_ASSERT(markable.weakmap->mapColor,
"unmarked weakmaps in weak keys table");
}
}
}

Просмотреть файл

@ -549,8 +549,7 @@ void js::gc::MarkingValidator::nonIncrementalMark(AutoGCSession& session) {
AutoEnterOOMUnsafeRegion oomUnsafe;
for (gc::WeakKeyTable::Range r = zone->gcWeakKeys().all(); !r.empty();
r.popFront()) {
if (!savedWeakKeys.put(r.front().key,
std::move(r.front().value))) {
if (!savedWeakKeys.put(r.front().key, std::move(r.front().value))) {
oomUnsafe.crash("saving weak keys table for validator");
}
}
@ -651,8 +650,7 @@ void js::gc::MarkingValidator::nonIncrementalMark(AutoGCSession& session) {
r.popFront()) {
AutoEnterOOMUnsafeRegion oomUnsafe;
Zone* zone = gc::TenuredCell::fromPointer(r.front().key)->zone();
if (!zone->gcWeakKeys().put(r.front().key,
std::move(r.front().value))) {
if (!zone->gcWeakKeys().put(r.front().key, std::move(r.front().value))) {
oomUnsafe.crash("restoring weak keys table for validator");
}
}