зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1060976 - Fix more bad implicit constructors in the JS engine; r=jorendorff
This commit is contained in:
Родитель
2c36fac925
Коммит
21a9749477
|
@ -450,7 +450,7 @@ class TracerConcreteWithCompartment : public TracerConcrete<Referent> {
|
|||
return TracerBase::get().compartment();
|
||||
}
|
||||
|
||||
TracerConcreteWithCompartment(Referent *ptr) : TracerBase(ptr) { }
|
||||
explicit TracerConcreteWithCompartment(Referent *ptr) : TracerBase(ptr) { }
|
||||
|
||||
public:
|
||||
static void construct(void *storage, Referent *ptr) {
|
||||
|
|
|
@ -4302,7 +4302,7 @@ class WrapMGetPropertyCache
|
|||
}
|
||||
|
||||
public:
|
||||
WrapMGetPropertyCache(MGetPropertyCache *cache)
|
||||
explicit WrapMGetPropertyCache(MGetPropertyCache *cache)
|
||||
: cache_(cache)
|
||||
{ }
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ struct JitcodeMapBufferWriteSpewer
|
|||
|
||||
static const uint32_t DumpMaxBytes = 50;
|
||||
|
||||
JitcodeMapBufferWriteSpewer(CompactBufferWriter &w)
|
||||
explicit JitcodeMapBufferWriteSpewer(CompactBufferWriter &w)
|
||||
: writer(&w), startPos(writer->length())
|
||||
{}
|
||||
|
||||
|
|
|
@ -314,19 +314,19 @@ class JitcodeGlobalEntry
|
|||
base_.init();
|
||||
}
|
||||
|
||||
JitcodeGlobalEntry(const IonEntry &ion) {
|
||||
explicit JitcodeGlobalEntry(const IonEntry &ion) {
|
||||
ion_ = ion;
|
||||
}
|
||||
|
||||
JitcodeGlobalEntry(const BaselineEntry &baseline) {
|
||||
explicit JitcodeGlobalEntry(const BaselineEntry &baseline) {
|
||||
baseline_ = baseline;
|
||||
}
|
||||
|
||||
JitcodeGlobalEntry(const IonCacheEntry &ionCache) {
|
||||
explicit JitcodeGlobalEntry(const IonCacheEntry &ionCache) {
|
||||
ionCache_ = ionCache;
|
||||
}
|
||||
|
||||
JitcodeGlobalEntry(const QueryEntry &query) {
|
||||
explicit JitcodeGlobalEntry(const QueryEntry &query) {
|
||||
query_ = query;
|
||||
}
|
||||
|
||||
|
@ -804,7 +804,7 @@ class JitcodeIonTable
|
|||
}
|
||||
|
||||
public:
|
||||
JitcodeIonTable(uint32_t numRegions)
|
||||
explicit JitcodeIonTable(uint32_t numRegions)
|
||||
: numRegions_(numRegions)
|
||||
{
|
||||
for (uint32_t i = 0; i < numRegions; i++)
|
||||
|
|
|
@ -205,7 +205,7 @@ class LSimdSignMaskX4 : public LInstructionHelper<1, 1, 0>
|
|||
public:
|
||||
LIR_HEADER(SimdSignMaskX4);
|
||||
|
||||
LSimdSignMaskX4(const LAllocation &input) {
|
||||
explicit LSimdSignMaskX4(const LAllocation &input) {
|
||||
setOperand(0, input);
|
||||
}
|
||||
};
|
||||
|
@ -2794,7 +2794,7 @@ class LClzI : public LInstructionHelper<1, 1, 0>
|
|||
{
|
||||
public:
|
||||
LIR_HEADER(ClzI)
|
||||
LClzI(const LAllocation &num) {
|
||||
explicit LClzI(const LAllocation &num) {
|
||||
setOperand(0, num);
|
||||
}
|
||||
|
||||
|
|
|
@ -2489,7 +2489,7 @@ class MArrayState : public MVariadicInstruction
|
|||
private:
|
||||
uint32_t numElements_;
|
||||
|
||||
MArrayState(MDefinition *arr)
|
||||
explicit MArrayState(MDefinition *arr)
|
||||
{
|
||||
// This instruction is only used as a summary for bailout paths.
|
||||
setRecoveredOnBailout();
|
||||
|
@ -4755,7 +4755,7 @@ class MClz
|
|||
{
|
||||
bool operandIsNeverZero_;
|
||||
|
||||
MClz(MDefinition *num)
|
||||
explicit MClz(MDefinition *num)
|
||||
: MUnaryInstruction(num),
|
||||
operandIsNeverZero_(false)
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
|||
SimdConstant value;
|
||||
NonAssertingLabel uses;
|
||||
|
||||
SimdData(const SimdConstant &v) : value(v) {}
|
||||
explicit SimdData(const SimdConstant &v) : value(v) {}
|
||||
SimdConstant::Type type() { return value.type(); }
|
||||
};
|
||||
Vector<SimdData, 0, SystemAllocPolicy> simds_;
|
||||
|
|
|
@ -201,7 +201,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
|||
|
||||
struct AllocationSite : public mozilla::LinkedListElement<AllocationSite>
|
||||
{
|
||||
AllocationSite(HandleObject frame) : frame(frame) {
|
||||
explicit AllocationSite(HandleObject frame) : frame(frame) {
|
||||
JS_ASSERT_IF(frame, UncheckedUnwrap(frame)->is<SavedFrame>());
|
||||
};
|
||||
RelocatablePtrObject frame;
|
||||
|
|
|
@ -264,7 +264,7 @@ struct Census {
|
|||
Zone::ZoneSet debuggeeZones;
|
||||
Zone *atomsZone;
|
||||
|
||||
Census(JSContext *cx) : cx(cx), atomsZone(nullptr) { }
|
||||
explicit Census(JSContext *cx) : cx(cx), atomsZone(nullptr) { }
|
||||
|
||||
bool init() {
|
||||
AutoLockForExclusiveAccess lock(cx);
|
||||
|
@ -304,7 +304,7 @@ class Tally {
|
|||
size_t total_;
|
||||
|
||||
public:
|
||||
Tally(Census &census) : total_(0) { }
|
||||
explicit Tally(Census &census) : total_(0) { }
|
||||
Tally(Tally &&rhs) : total_(rhs.total_) { }
|
||||
Tally &operator=(Tally &&rhs) { total_ = rhs.total_; return *this; }
|
||||
|
||||
|
@ -348,7 +348,7 @@ class ByJSType {
|
|||
EachOther other;
|
||||
|
||||
public:
|
||||
ByJSType(Census &census)
|
||||
explicit ByJSType(Census &census)
|
||||
: total_(0),
|
||||
objects(census),
|
||||
scripts(census),
|
||||
|
@ -462,7 +462,7 @@ class ByObjectClass {
|
|||
}
|
||||
|
||||
public:
|
||||
ByObjectClass(Census &census) : total_(0), other(census) { }
|
||||
explicit ByObjectClass(Census &census) : total_(0), other(census) { }
|
||||
ByObjectClass(ByObjectClass &&rhs)
|
||||
: total_(rhs.total_), table(Move(rhs.table)), other(Move(rhs.other))
|
||||
{ }
|
||||
|
@ -561,7 +561,7 @@ class ByUbinodeType {
|
|||
Table table;
|
||||
|
||||
public:
|
||||
ByUbinodeType(Census &census) : total_(0) { }
|
||||
explicit ByUbinodeType(Census &census) : total_(0) { }
|
||||
ByUbinodeType(ByUbinodeType &&rhs) : total_(rhs.total_), table(Move(rhs.table)) { }
|
||||
ByUbinodeType &operator=(ByUbinodeType &&rhs) {
|
||||
MOZ_ASSERT(&rhs != this);
|
||||
|
@ -650,7 +650,7 @@ class CensusHandler {
|
|||
Assorter assorter;
|
||||
|
||||
public:
|
||||
CensusHandler(Census &census) : census(census), assorter(census) { }
|
||||
explicit CensusHandler(Census &census) : census(census), assorter(census) { }
|
||||
|
||||
bool init(Census &census) { return assorter.init(census); }
|
||||
bool report(Census &census, MutableHandleValue report) {
|
||||
|
|
|
@ -388,7 +388,7 @@ class FreeOp : public JSFreeOp
|
|||
return static_cast<FreeOp *>(fop);
|
||||
}
|
||||
|
||||
FreeOp(JSRuntime *rt)
|
||||
explicit FreeOp(JSRuntime *rt)
|
||||
: JSFreeOp(rt)
|
||||
{}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "gc/Marking.h"
|
||||
#include "js/Vector.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "vm/Debugger.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/StringBuffer.h"
|
||||
|
@ -76,7 +77,7 @@ class SavedFrame::AutoLookupRooter : public JS::CustomAutoRooter
|
|||
class SavedFrame::HandleLookup
|
||||
{
|
||||
public:
|
||||
HandleLookup(SavedFrame::AutoLookupRooter &lookup) : ref(lookup) { }
|
||||
MOZ_IMPLICIT HandleLookup(SavedFrame::AutoLookupRooter &lookup) : ref(lookup) { }
|
||||
SavedFrame::Lookup *operator->() { return &ref.get(); }
|
||||
operator const SavedFrame::Lookup&() const { return ref; }
|
||||
private:
|
||||
|
|
Загрузка…
Ссылка в новой задаче