Bug 1422362: Remove unused parameters from various methods in js/src. r=tcampbell

This commit is contained in:
André Bargull 2017-12-01 10:04:31 -08:00
Родитель 587ed9ddc7
Коммит 27c04d3eaa
50 изменённых файлов: 98 добавлений и 151 удалений

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

@ -4408,9 +4408,7 @@ enum class DisplayNameStyle
template<typename ConstChar>
static JSString*
ComputeSingleDisplayName(JSContext* cx, UDateFormat* fmt, UDateTimePatternGenerator* dtpg,
DisplayNameStyle style,
Vector<char16_t, INITIAL_CHAR_BUFFER_SIZE>& chars,
const Range<ConstChar>& pattern)
DisplayNameStyle style, const Range<ConstChar>& pattern)
{
RangedPtr<ConstChar> iter = pattern.begin();
const RangedPtr<ConstChar> end = pattern.end();
@ -4647,10 +4645,6 @@ js::intl_ComputeDisplayNames(JSContext* cx, unsigned argc, Value* vp)
}
ScopedICUObject<UDateTimePatternGenerator, udatpg_close> datPgToClose(dtpg);
Vector<char16_t, INITIAL_CHAR_BUFFER_SIZE> chars(cx);
if (!chars.resize(INITIAL_CHAR_BUFFER_SIZE))
return false;
// 5. For each element of keys,
RootedString keyValStr(cx);
RootedValue v(cx);
@ -4668,10 +4662,8 @@ js::intl_ComputeDisplayNames(JSContext* cx, unsigned argc, Value* vp)
// corresponding display name.
JSString* displayName =
stablePatternChars.isLatin1()
? ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, chars,
stablePatternChars.latin1Range())
: ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, chars,
stablePatternChars.twoByteRange());
? ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, stablePatternChars.latin1Range())
: ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, stablePatternChars.twoByteRange());
if (!displayName)
return false;

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

@ -591,7 +591,7 @@ WriteBarrierPost(JSRuntime* rt, SetObject* set, const Value& key)
}
bool
MapObject::getKeysAndValuesInterleaved(JSContext* cx, HandleObject obj,
MapObject::getKeysAndValuesInterleaved(HandleObject obj,
JS::MutableHandle<GCVector<JS::Value>> entries)
{
ValueMap* map = obj->as<MapObject>().getData();
@ -1372,7 +1372,7 @@ SetObject::sweepAfterMinorGC(FreeOp* fop, SetObject* setobj)
}
bool
SetObject::isBuiltinAdd(HandleValue add, JSContext* cx)
SetObject::isBuiltinAdd(HandleValue add)
{
return IsNativeFunction(add, SetObject::add);
}

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

@ -108,7 +108,7 @@ class MapObject : public NativeObject {
enum { NurseryKeysSlot, HasNurseryMemorySlot, SlotCount };
static MOZ_MUST_USE bool getKeysAndValuesInterleaved(JSContext* cx, HandleObject obj,
static MOZ_MUST_USE bool getKeysAndValuesInterleaved(HandleObject obj,
JS::MutableHandle<GCVector<JS::Value>> entries);
static MOZ_MUST_USE bool entries(JSContext* cx, unsigned argc, Value* vp);
static MOZ_MUST_USE bool has(JSContext* cx, unsigned argc, Value* vp);
@ -257,7 +257,7 @@ class SetObject : public NativeObject {
static bool is(HandleValue v);
static bool is(HandleObject o);
static bool isBuiltinAdd(HandleValue add, JSContext* cx);
static bool isBuiltinAdd(HandleValue add);
static MOZ_MUST_USE bool iterator_impl(JSContext* cx, const CallArgs& args, IteratorKind kind);
@ -305,7 +305,7 @@ class SetIteratorObject : public NativeObject
};
using SetInitGetPrototypeOp = NativeObject* (*)(JSContext*, Handle<GlobalObject*>);
using SetInitIsBuiltinOp = bool (*)(HandleValue, JSContext*);
using SetInitIsBuiltinOp = bool (*)(HandleValue);
template <SetInitGetPrototypeOp getPrototypeOp, SetInitIsBuiltinOp isBuiltinOp>
static MOZ_MUST_USE bool
@ -336,7 +336,7 @@ IsOptimizableInitForSet(JSContext* cx, HandleObject setObject, HandleValue itera
// Get the referred value, ensure it holds the canonical add function.
RootedValue add(cx, setProto->getSlot(addShape->slot()));
if (!isBuiltinOp(add, cx))
if (!isBuiltinOp(add))
return true;
ForOfPIC::Chain* stubChain = ForOfPIC::getOrCreate(cx);

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

@ -108,7 +108,7 @@ js::CreateRegExpMatchResult(JSContext* cx, HandleString input, const MatchPairs&
}
static int32_t
CreateRegExpSearchResult(JSContext* cx, const MatchPairs& matches)
CreateRegExpSearchResult(const MatchPairs& matches)
{
/* Fit the start and limit of match into a int32_t. */
uint32_t position = matches[0].start;
@ -1078,7 +1078,7 @@ RegExpSearcherImpl(JSContext* cx, HandleObject regexp, HandleString string,
}
/* Steps 16-25 */
*result = CreateRegExpSearchResult(cx, matches);
*result = CreateRegExpSearchResult(matches);
return true;
}
@ -1123,7 +1123,7 @@ js::RegExpSearcherRaw(JSContext* cx, HandleObject regexp, HandleString input,
// The MatchPairs will always be passed in, but RegExp execution was
// successful only if the pairs have actually been filled in.
if (maybeMatches && maybeMatches->pairsRaw()[0] >= 0) {
*result = CreateRegExpSearchResult(cx, *maybeMatches);
*result = CreateRegExpSearchResult(*maybeMatches);
return true;
}
return RegExpSearcherImpl(cx, regexp, input, lastIndex,

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

@ -178,7 +178,7 @@ WeakSetObject::create(JSContext* cx, HandleObject proto /* = nullptr */)
}
bool
WeakSetObject::isBuiltinAdd(HandleValue add, JSContext* cx)
WeakSetObject::isBuiltinAdd(HandleValue add)
{
return IsNativeFunction(add, WeakSet_add);
}

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

@ -24,7 +24,7 @@ class WeakSetObject : public WeakCollectionObject
static WeakSetObject* create(JSContext* cx, HandleObject proto = nullptr);
static MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp);
static bool isBuiltinAdd(HandleValue add, JSContext* cx);
static bool isBuiltinAdd(HandleValue add);
};
extern JSObject*

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

@ -450,7 +450,7 @@ UsedNameTracker::rewind(RewindToken token)
r.front().value().resetToScope(token.scriptId, token.scopeId);
}
FunctionBox::FunctionBox(JSContext* cx, LifoAlloc& alloc, ObjectBox* traceListHead,
FunctionBox::FunctionBox(JSContext* cx, ObjectBox* traceListHead,
JSFunction* fun, uint32_t toStringStart,
Directives directives, bool extraWarnings,
GeneratorKind generatorKind, FunctionAsyncKind asyncKind)
@ -835,8 +835,7 @@ ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
const ReadOnlyCompileOptions& options,
const char16_t* chars, size_t length,
bool foldConstants,
UsedNameTracker& usedNames,
LazyScript* lazyOuterFunction)
UsedNameTracker& usedNames)
: context(cx),
alloc(alloc),
tokenStream(cx, options, chars, length, thisForCtor()),
@ -878,7 +877,7 @@ Parser<ParseHandler, CharT>::Parser(JSContext* cx, LifoAlloc& alloc,
UsedNameTracker& usedNames,
SyntaxParser* syntaxParser,
LazyScript* lazyOuterFunction)
: ParserBase(cx, alloc, options, chars, length, foldConstants, usedNames, lazyOuterFunction),
: ParserBase(cx, alloc, options, chars, length, foldConstants, usedNames),
AutoGCRooter(cx, PARSER),
syntaxParser_(syntaxParser),
handler(cx, alloc, lazyOuterFunction)
@ -964,7 +963,7 @@ Parser<ParseHandler, CharT>::newFunctionBox(Node fn, JSFunction* fun, uint32_t t
* function.
*/
FunctionBox* funbox =
alloc.new_<FunctionBox>(context, alloc, traceListHead, fun, toStringStart,
alloc.new_<FunctionBox>(context, traceListHead, fun, toStringStart,
inheritedDirectives, options().extraWarningsOption,
generatorKind, asyncKind);
if (!funbox) {
@ -3468,9 +3467,8 @@ Parser<FullParseHandler, char16_t>::trySyntaxParseInnerFunction(ParseNode* pn, H
funbox->initWithEnclosingParseContext(pc, kind);
if (!syntaxParser_->innerFunction(SyntaxParseHandler::NodeGeneric,
pc, funbox, toStringStart,
inHandling, yieldHandling, kind,
inheritedDirectives, newDirectives))
pc, funbox, inHandling, yieldHandling, kind,
newDirectives))
{
if (syntaxParser_->hadAbortedSyntaxParse()) {
// Try again with a full parse. UsedNameTracker needs to be
@ -3526,9 +3524,8 @@ Parser<SyntaxParseHandler, char16_t>::trySyntaxParseInnerFunction(Node pn, Handl
template <class ParseHandler, typename CharT>
bool
Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox,
uint32_t toStringStart, InHandling inHandling,
InHandling inHandling,
YieldHandling yieldHandling, FunctionSyntaxKind kind,
Directives inheritedDirectives,
Directives* newDirectives)
{
// Note that it is possible for outerpc != this->pc, as we may be
@ -3568,11 +3565,8 @@ Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, Handl
return false;
funbox->initWithEnclosingParseContext(outerpc, kind);
if (!innerFunction(pn, outerpc, funbox, toStringStart, inHandling, yieldHandling, kind,
inheritedDirectives, newDirectives))
{
if (!innerFunction(pn, outerpc, funbox, inHandling, yieldHandling, kind, newDirectives))
return false;
}
// Append possible Annex B function box only upon successfully parsing.
if (tryAnnexB && !pc->innermostScope()->addPossibleAnnexBFunctionBox(pc, funbox))
@ -4726,7 +4720,7 @@ Parser<ParseHandler, CharT>::expressionAfterForInOrOf(ParseNodeKind forHeadKind,
template <class ParseHandler, typename CharT>
typename ParseHandler::Node
Parser<ParseHandler, CharT>::declarationPattern(Node decl, DeclarationKind declKind, TokenKind tt,
Parser<ParseHandler, CharT>::declarationPattern(DeclarationKind declKind, TokenKind tt,
bool initialDeclaration,
YieldHandling yieldHandling,
ParseNodeKind* forHeadKind,
@ -4779,8 +4773,7 @@ Parser<ParseHandler, CharT>::declarationPattern(Node decl, DeclarationKind declK
template <class ParseHandler, typename CharT>
bool
Parser<ParseHandler, CharT>::initializerInNameDeclaration(Node decl, Node binding,
Handle<PropertyName*> name,
Parser<ParseHandler, CharT>::initializerInNameDeclaration(Node binding,
DeclarationKind declKind,
bool initialDeclaration,
YieldHandling yieldHandling,
@ -4841,7 +4834,7 @@ Parser<ParseHandler, CharT>::initializerInNameDeclaration(Node decl, Node bindin
template <class ParseHandler, typename CharT>
typename ParseHandler::Node
Parser<ParseHandler, CharT>::declarationName(Node decl, DeclarationKind declKind, TokenKind tt,
Parser<ParseHandler, CharT>::declarationName(DeclarationKind declKind, TokenKind tt,
bool initialDeclaration, YieldHandling yieldHandling,
ParseNodeKind* forHeadKind, Node* forInOrOfExpression)
{
@ -4873,7 +4866,7 @@ Parser<ParseHandler, CharT>::declarationName(Node decl, DeclarationKind declKind
return null();
if (matched) {
if (!initializerInNameDeclaration(decl, binding, name, declKind, initialDeclaration,
if (!initializerInNameDeclaration(binding, declKind, initialDeclaration,
yieldHandling, forHeadKind, forInOrOfExpression))
{
return null();
@ -4958,9 +4951,9 @@ Parser<ParseHandler, CharT>::declarationList(YieldHandling yieldHandling,
return null();
Node binding = (tt == TOK_LB || tt == TOK_LC)
? declarationPattern(decl, declKind, tt, initialDeclaration, yieldHandling,
? declarationPattern(declKind, tt, initialDeclaration, yieldHandling,
forHeadKind, forInOrOfExpression)
: declarationName(decl, declKind, tt, initialDeclaration, yieldHandling,
: declarationName(declKind, tt, initialDeclaration, yieldHandling,
forHeadKind, forInOrOfExpression);
if (!binding)
return null();
@ -6029,7 +6022,6 @@ Parser<ParseHandler, CharT>::matchInOrOf(bool* isForInp, bool* isForOfp)
template <class ParseHandler, typename CharT>
bool
Parser<ParseHandler, CharT>::forHeadStart(YieldHandling yieldHandling,
IteratorKind iterKind,
ParseNodeKind* forHeadKind,
Node* forInitialPart,
Maybe<ParseContext::Scope>& forLoopLexicalScope,
@ -6243,11 +6235,8 @@ Parser<ParseHandler, CharT>::forStatement(YieldHandling yieldHandling)
//
// In either case the subsequent token can be consistently accessed using
// TokenStream::None semantics.
if (!forHeadStart(yieldHandling, iterKind, &headKind, &startNode, forLoopLexicalScope,
&iteratedExpr))
{
if (!forHeadStart(yieldHandling, &headKind, &startNode, forLoopLexicalScope, &iteratedExpr))
return null();
}
MOZ_ASSERT(headKind == PNK_FORIN || headKind == PNK_FOROF || headKind == PNK_FORHEAD);

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

@ -164,7 +164,7 @@ class ParserBase : public StrictModeGetter
ParserBase(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
const char16_t* chars, size_t length, bool foldConstants,
UsedNameTracker& usedNames, LazyScript* lazyOuterFunction);
UsedNameTracker& usedNames);
~ParserBase();
const char* getFilename() const { return tokenStream.getFilename(); }
@ -558,9 +558,9 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
// Parse an inner function given an enclosing ParseContext and a
// FunctionBox for the inner function.
bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox, uint32_t toStringStart,
bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox,
InHandling inHandling, YieldHandling yieldHandling, FunctionSyntaxKind kind,
Directives inheritedDirectives, Directives* newDirectives);
Directives* newDirectives);
// Parse a function's formal parameters and its body assuming its function
// ParseContext is already on the stack.
@ -608,7 +608,6 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
Node forStatement(YieldHandling yieldHandling);
bool forHeadStart(YieldHandling yieldHandling,
IteratorKind iterKind,
ParseNodeKind* forHeadKind,
Node* forInitialPart,
mozilla::Maybe<ParseContext::Scope>& forLetImpliedScope,
@ -698,10 +697,10 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
// |*forInOrOfExpression|. (An "initial declaration" is the first
// declaration in a declaration list: |a| but not |b| in |var a, b|, |{c}|
// but not |d| in |let {c} = 3, d|.)
Node declarationPattern(Node decl, DeclarationKind declKind, TokenKind tt,
Node declarationPattern(DeclarationKind declKind, TokenKind tt,
bool initialDeclaration, YieldHandling yieldHandling,
ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
Node declarationName(Node decl, DeclarationKind declKind, TokenKind tt,
Node declarationName(DeclarationKind declKind, TokenKind tt,
bool initialDeclaration, YieldHandling yieldHandling,
ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
@ -710,7 +709,7 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
// from its initializer, parse and bind that initializer -- and possibly
// consume trailing in/of and subsequent expression, if so directed by
// |forHeadKind|.
bool initializerInNameDeclaration(Node decl, Node binding, Handle<PropertyName*> name,
bool initializerInNameDeclaration(Node binding,
DeclarationKind declKind, bool initialDeclaration,
YieldHandling yieldHandling, ParseNodeKind* forHeadKind,
Node* forInOrOfExpression);

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

@ -397,7 +397,7 @@ class FunctionBox : public ObjectBox, public SharedContext
// Whether this function has nested functions.
bool hasInnerFunctions_:1;
FunctionBox(JSContext* cx, LifoAlloc& alloc, ObjectBox* traceListHead, JSFunction* fun,
FunctionBox(JSContext* cx, ObjectBox* traceListHead, JSFunction* fun,
uint32_t toStringStart, Directives directives, bool extraWarnings,
GeneratorKind generatorKind, FunctionAsyncKind asyncKind);

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

@ -423,7 +423,7 @@ TokenStreamAnyChars::TokenStreamAnyChars(JSContext* cx, const ReadOnlyCompileOpt
TokenStream::TokenStream(JSContext* cx, const ReadOnlyCompileOptions& options,
const CharT* base, size_t length, StrictModeGetter* smg)
: TokenStreamAnyChars(cx, options, smg),
userbuf(cx, base, length, options.scriptSourceOffset),
userbuf(base, length, options.scriptSourceOffset),
tokenbuf(cx)
{
// Nb: the following tables could be static, but initializing them here is

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

@ -952,7 +952,7 @@ class MOZ_STACK_CLASS TokenStream final : public TokenStreamAnyChars
// begins, the offset of |buf[0]|.
class TokenBuf {
public:
TokenBuf(JSContext* cx, const CharT* buf, size_t length, size_t startOffset)
TokenBuf(const CharT* buf, size_t length, size_t startOffset)
: base_(buf),
startOffset_(startOffset),
limit_(buf + length),

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

@ -822,10 +822,6 @@ class ZonesIter
next();
}
bool atAtomsZone(JSRuntime* rt) const {
return !!atomsZone;
}
bool done() const { return !atomsZone && group.done(); }
void next() {

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

@ -856,7 +856,7 @@ BaselineCacheIRCompiler::emitLoadTypedObjectResult()
masm.addPtr(scratch2, scratch1);
Address fieldAddr(scratch1, 0);
emitLoadTypedObjectResultShared(fieldAddr, scratch2, layout, typeDescr, output);
emitLoadTypedObjectResultShared(fieldAddr, scratch2, typeDescr, output);
return true;
}

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

@ -1430,7 +1430,7 @@ static const VMFunction ThrowUninitializedThisInfo =
FunctionInfo<ThrowUninitializedThisFn>(BaselineThrowUninitializedThis,
"BaselineThrowUninitializedThis");
typedef bool (*ThrowInitializedThisFn)(JSContext*, BaselineFrame* frame);
typedef bool (*ThrowInitializedThisFn)(JSContext*);
static const VMFunction ThrowInitializedThisInfo =
FunctionInfo<ThrowInitializedThisFn>(BaselineThrowInitializedThis,
"BaselineThrowInitializedThis");
@ -1464,13 +1464,13 @@ BaselineCompiler::emitCheckThis(ValueOperand val, bool reinit)
prepareVMCall();
masm.loadBaselineFramePtr(BaselineFrameReg, val.scratchReg());
pushArg(val.scratchReg());
if (reinit) {
if (!callVM(ThrowInitializedThisInfo))
return false;
} else {
masm.loadBaselineFramePtr(BaselineFrameReg, val.scratchReg());
pushArg(val.scratchReg());
if (!callVM(ThrowUninitializedThisInfo))
return false;
}
@ -4013,7 +4013,7 @@ BaselineCompiler::emit_JSOP_RETRVAL()
return emitReturn();
}
typedef bool (*ToIdFn)(JSContext*, HandleScript, jsbytecode*, HandleValue, MutableHandleValue);
typedef bool (*ToIdFn)(JSContext*, HandleValue, MutableHandleValue);
static const VMFunction ToIdInfo = FunctionInfo<ToIdFn>(js::ToIdOperation, "ToIdOperation");
bool
@ -4032,8 +4032,6 @@ BaselineCompiler::emit_JSOP_TOID()
prepareVMCall();
pushArg(R0);
pushArg(ImmPtr(pc));
pushArg(ImmGCPtr(script));
if (!callVM(ToIdInfo))
return false;

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

@ -2148,7 +2148,7 @@ CacheIRCompiler::emitLoadTypedElementResult()
void
CacheIRCompiler::emitLoadTypedObjectResultShared(const Address& fieldAddr, Register scratch,
TypedThingLayout layout, uint32_t typeDescr,
uint32_t typeDescr,
const AutoOutputRegister& output)
{
MOZ_ASSERT(output.hasValue());

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

@ -560,7 +560,7 @@ class MOZ_RAII CacheIRCompiler
}
void emitLoadTypedObjectResultShared(const Address& fieldAddr, Register scratch,
TypedThingLayout layout, uint32_t typeDescr,
uint32_t typeDescr,
const AutoOutputRegister& output);
void emitStoreTypedObjectReferenceProp(ValueOperand val, ReferenceTypeDescr::Type type,

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

@ -10697,8 +10697,7 @@ CodeGenerator::visitToAsyncIter(LToAsyncIter* lir)
callVM(ToAsyncIterInfo, lir);
}
typedef bool (*ToIdFn)(JSContext*, HandleScript, jsbytecode*, HandleValue,
MutableHandleValue);
typedef bool (*ToIdFn)(JSContext*, HandleValue, MutableHandleValue);
static const VMFunction ToIdInfo = FunctionInfo<ToIdFn>(ToIdOperation, "ToIdOperation");
void
@ -10710,9 +10709,7 @@ CodeGenerator::visitToIdV(LToIdV* lir)
ValueOperand input = ToValue(lir, LToIdV::Input);
OutOfLineCode* ool = oolCallVM(ToIdInfo, lir,
ArgList(ImmGCPtr(current->mir()->info().script()),
ImmPtr(lir->mir()->resumePoint()->pc()),
ToValue(lir, LToIdV::Input)),
ArgList(ToValue(lir, LToIdV::Input)),
StoreValueTo(out));
Register tag = masm.splitTagForTest(input);

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

@ -2190,7 +2190,7 @@ IonCacheIRCompiler::emitLoadTypedObjectResult()
LoadTypedThingData(masm, layout, obj, scratch1);
Address fieldAddr(scratch1, fieldOffset);
emitLoadTypedObjectResultShared(fieldAddr, scratch2, layout, typeDescr, output);
emitLoadTypedObjectResultShared(fieldAddr, scratch2, typeDescr, output);
return true;
}

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

@ -977,7 +977,7 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo)
current->add(end->toInstruction());
}
MArraySlice* ins = MArraySlice::New(alloc(), constraints(),
MArraySlice* ins = MArraySlice::New(alloc(),
obj, begin, end,
templateObj,
templateObj->group()->initialHeap(constraints()));

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

@ -10112,8 +10112,7 @@ class MArraySlice
CompilerObject templateObj_;
gc::InitialHeap initialHeap_;
MArraySlice(CompilerConstraintList* constraints, MDefinition* obj,
MDefinition* begin, MDefinition* end,
MArraySlice(MDefinition* obj, MDefinition* begin, MDefinition* end,
JSObject* templateObj, gc::InitialHeap initialHeap)
: MTernaryInstruction(classOpcode, obj, begin, end),
templateObj_(templateObj),

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

@ -1253,7 +1253,6 @@ DoUnaryArithFallback(JSContext* cx, void* payload, ICUnaryArith_Fallback* stub_,
{
SharedStubInfo info(cx, payload, stub_->icEntry());
ICStubCompiler::Engine engine = info.engine();
HandleScript script = info.innerScript();
// This fallback stub may trigger debug mode toggling.
DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> stub(engine, info.maybeFrame(), stub_);
@ -1271,7 +1270,7 @@ DoUnaryArithFallback(JSContext* cx, void* payload, ICUnaryArith_Fallback* stub_,
break;
}
case JSOP_NEG:
if (!NegOperation(cx, script, pc, val, res))
if (!NegOperation(cx, val, res))
return false;
break;
default:

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

@ -1519,9 +1519,9 @@ BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame)
}
bool
BaselineThrowInitializedThis(JSContext* cx, BaselineFrame* frame)
BaselineThrowInitializedThis(JSContext* cx)
{
return ThrowInitializedThis(cx, frame);
return ThrowInitializedThis(cx);
}

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

@ -888,7 +888,7 @@ MOZ_MUST_USE bool
BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
BaselineThrowInitializedThis(JSContext* cx, BaselineFrame* frame);
BaselineThrowInitializedThis(JSContext* cx);
MOZ_MUST_USE bool
ThrowBadDerivedReturn(JSContext* cx, HandleValue v);

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

@ -6648,7 +6648,7 @@ JS_SetRegExpInput(JSContext* cx, HandleObject obj, HandleString input)
if (!res)
return false;
res->reset(cx, input);
res->reset(input);
return true;
}

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

@ -67,7 +67,7 @@ JSCompartment::JSCompartment(Zone* zone, const JS::CompartmentOptions& options =
realmData(nullptr),
allocationMetadataBuilder(nullptr),
lastAnimationTime(0),
regExps(zone),
regExps(),
globalWriteBarriered(0),
detachedTypedObjects(0),
objectMetadataState(ImmediateMetadata()),
@ -874,15 +874,14 @@ JSCompartment::sweepRegExps()
* code for the lifetime of the JIT script. Thus, we must perform
* sweeping after clearing jit code.
*/
regExps.sweep(runtimeFromAnyThread());
regExps.sweep();
}
void
JSCompartment::sweepDebugEnvironments()
{
JSRuntime* rt = runtimeFromAnyThread();
if (debugEnvs)
debugEnvs->sweep(rt);
debugEnvs->sweep();
}
void

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

@ -827,9 +827,6 @@ struct JSCompartment
js::TemplateRegistry templateLiteralMap_;
public:
/* During GC, stores the index of this compartment in rt->compartments. */
unsigned gcIndex;
/*
* During GC, stores the head of a list of incoming pointers from gray cells.
*

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

@ -73,13 +73,9 @@ static const uint8_t dtoaModes[] = {
2}; /* DTOSTR_PRECISION */
double
js_strtod_harder(DtoaState* state, const char* s00, char** se, int* err)
js_strtod_harder(DtoaState* state, const char* s00, char** se)
{
double retval;
if (err)
*err = 0;
retval = _strtod(state, s00, se);
return retval;
return _strtod(state, s00, se);
}
char*

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

@ -36,12 +36,9 @@ DestroyDtoaState(DtoaState* state);
* unparseable character in s00, and zero is returned.
*
* On overflow, this function returns infinity and does not indicate an error.
*
* *err is set to zero on success; it's set to JS_DTOA_ENOMEM on memory failure.
*/
#define JS_DTOA_ENOMEM 2
double
js_strtod_harder(DtoaState* state, const char* s00, char** se, int* err);
js_strtod_harder(DtoaState* state, const char* s00, char** se);
/*
* Modes for converting floating-point numbers to strings.

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

@ -94,12 +94,7 @@ ComputeAccurateDecimalInteger(JSContext* cx, const CharT* start, const CharT* en
return false;
char* estr;
int err = 0;
*dp = js_strtod_harder(cx->dtoaState, cstr, &estr, &err);
if (err == JS_DTOA_ENOMEM) {
ReportOutOfMemory(cx);
return false;
}
*dp = js_strtod_harder(cx->dtoaState, cstr, &estr);
return true;
}
@ -1846,9 +1841,8 @@ js_strtod(JSContext* cx, const CharT* begin, const CharT* end, const CharT** dEn
return false;
/* Everything else. */
int err;
char* ep;
*d = js_strtod_harder(cx->dtoaState, chars.begin(), &ep, &err);
*d = js_strtod_harder(cx->dtoaState, chars.begin(), &ep);
MOZ_ASSERT(ep >= chars.begin());

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

@ -2440,7 +2440,7 @@ DebugEnvironments::trace(JSTracer* trc)
}
void
DebugEnvironments::sweep(JSRuntime* rt)
DebugEnvironments::sweep()
{
/*
* missingEnvs points to debug envs weakly so that debug envs can be

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

@ -985,7 +985,7 @@ class DebugEnvironments
public:
void trace(JSTracer* trc);
void sweep(JSRuntime* rt);
void sweep();
void finish();
#ifdef JS_GC_ZEAL
void checkHashTablesAfterMovingGC(JSRuntime* rt);

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

@ -447,8 +447,7 @@ DefVarOperation(JSContext* cx, HandleObject varobj, HandlePropertyName dn, unsig
}
static MOZ_ALWAYS_INLINE bool
NegOperation(JSContext* cx, HandleScript script, jsbytecode* pc, HandleValue val,
MutableHandleValue res)
NegOperation(JSContext* cx, HandleValue val, MutableHandleValue res)
{
/*
* When the operand is int jsval, INT32_FITS_IN_JSVAL(i) implies
@ -469,8 +468,7 @@ NegOperation(JSContext* cx, HandleScript script, jsbytecode* pc, HandleValue val
}
static MOZ_ALWAYS_INLINE bool
ToIdOperation(JSContext* cx, HandleScript script, jsbytecode* pc, HandleValue idval,
MutableHandleValue res)
ToIdOperation(JSContext* cx, HandleValue idval, MutableHandleValue res)
{
if (idval.isInt32()) {
res.set(idval);

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

@ -2650,7 +2650,7 @@ CASE(JSOP_NEG)
{
ReservedRooted<Value> val(&rootValue0, REGS.sp[-1]);
MutableHandleValue res = REGS.stackHandleAt(-1);
if (!NegOperation(cx, script, REGS.pc, val, res))
if (!NegOperation(cx, val, res))
goto error;
}
END_CASE(JSOP_NEG)
@ -2730,7 +2730,7 @@ CASE(JSOP_TOID)
*/
ReservedRooted<Value> idval(&rootValue1, REGS.sp[-1]);
MutableHandleValue res = REGS.stackHandleAt(-1);
if (!ToIdOperation(cx, script, REGS.pc, idval, res))
if (!ToIdOperation(cx, idval, res))
goto error;
}
END_CASE(JSOP_TOID)
@ -2793,7 +2793,7 @@ END_CASE(JSOP_CHECKTHIS)
CASE(JSOP_CHECKTHISREINIT)
{
if (!REGS.sp[-1].isMagic(JS_UNINITIALIZED_LEXICAL)) {
MOZ_ALWAYS_FALSE(ThrowInitializedThis(cx, REGS.fp()));
MOZ_ALWAYS_FALSE(ThrowInitializedThis(cx));
goto error;
}
}
@ -5256,7 +5256,7 @@ js::SuperFunOperation(JSContext* cx, HandleObject callee)
}
bool
js::ThrowInitializedThis(JSContext* cx, AbstractFramePtr frame)
js::ThrowInitializedThis(JSContext* cx)
{
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_REINIT_THIS);
return false;

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

@ -583,7 +583,7 @@ bool
ThrowUninitializedThis(JSContext* cx, AbstractFramePtr frame);
bool
ThrowInitializedThis(JSContext* cx, AbstractFramePtr frame);
ThrowInitializedThis(JSContext* cx);
bool
DefaultClassConstructor(JSContext* cx, unsigned argc, Value* vp);

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

@ -280,8 +280,7 @@ NativeObject::moveDenseElementsNoPreBarrier(uint32_t dstStart, uint32_t srcStart
}
inline void
NativeObject::ensureDenseInitializedLengthNoPackedCheck(JSContext* cx, uint32_t index,
uint32_t extra)
NativeObject::ensureDenseInitializedLengthNoPackedCheck(uint32_t index, uint32_t extra)
{
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
MOZ_ASSERT(!denseElementsAreFrozen());
@ -312,7 +311,7 @@ NativeObject::ensureDenseInitializedLength(JSContext* cx, uint32_t index, uint32
{
if (writeToIndexWouldMarkNotPacked(index))
markDenseElementsNotPacked(cx);
ensureDenseInitializedLengthNoPackedCheck(cx, index, extra);
ensureDenseInitializedLengthNoPackedCheck(index, extra);
}
DenseElementResult
@ -372,7 +371,7 @@ NativeObject::ensureDenseElements(JSContext* cx, uint32_t index, uint32_t extra)
if (extra == 1) {
/* Optimize for the common case. */
if (index < currentCapacity) {
ensureDenseInitializedLengthNoPackedCheck(cx, index, 1);
ensureDenseInitializedLengthNoPackedCheck(index, 1);
return DenseElementResult::Success;
}
requiredCapacity = index + 1;
@ -387,7 +386,7 @@ NativeObject::ensureDenseElements(JSContext* cx, uint32_t index, uint32_t extra)
return DenseElementResult::Incomplete;
}
if (requiredCapacity <= currentCapacity) {
ensureDenseInitializedLengthNoPackedCheck(cx, index, extra);
ensureDenseInitializedLengthNoPackedCheck(index, extra);
return DenseElementResult::Success;
}
}
@ -396,7 +395,7 @@ NativeObject::ensureDenseElements(JSContext* cx, uint32_t index, uint32_t extra)
if (result != DenseElementResult::Success)
return result;
ensureDenseInitializedLengthNoPackedCheck(cx, index, extra);
ensureDenseInitializedLengthNoPackedCheck(index, extra);
return DenseElementResult::Success;
}

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

@ -1174,8 +1174,7 @@ class NativeObject : public ShapedObject
}
private:
inline void ensureDenseInitializedLengthNoPackedCheck(JSContext* cx,
uint32_t index, uint32_t extra);
inline void ensureDenseInitializedLengthNoPackedCheck(uint32_t index, uint32_t extra);
// Run a post write barrier that encompasses multiple contiguous elements in a
// single step.

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

@ -1196,7 +1196,7 @@ RegExpShared::sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf)
/* RegExpCompartment */
RegExpCompartment::RegExpCompartment(Zone* zone)
RegExpCompartment::RegExpCompartment()
: matchResultTemplateObject_(nullptr),
optimizableRegExpPrototypeShape_(nullptr),
optimizableRegExpInstanceShape_(nullptr)
@ -1260,7 +1260,7 @@ RegExpZone::init()
}
void
RegExpCompartment::sweep(JSRuntime* rt)
RegExpCompartment::sweep()
{
if (matchResultTemplateObject_ &&
IsAboutToBeFinalized(&matchResultTemplateObject_))

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

@ -324,9 +324,9 @@ class RegExpCompartment
ArrayObject* createMatchResultTemplateObject(JSContext* cx);
public:
explicit RegExpCompartment(Zone* zone);
explicit RegExpCompartment();
void sweep(JSRuntime* rt);
void sweep();
/* Get or create template object used to base the result of .exec() on. */
ArrayObject* getOrCreateMatchResultTemplateObject(JSContext* cx) {

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

@ -68,7 +68,7 @@ class RegExpStatics
inline void clear();
/* Corresponds to JSAPI functionality to set the pending RegExp input. */
void reset(JSContext* cx, JSString* newInput) {
void reset(JSString* newInput) {
clear();
pendingInput = newInput;
checkInvariants();

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

@ -174,7 +174,7 @@ JSRuntime::JSRuntime(JSRuntime* parentRuntime)
oomCallback(nullptr),
debuggerMallocSizeOf(ReturnZeroSize),
lastAnimationTime(0),
performanceMonitoring_(thisFromCtor()),
performanceMonitoring_(),
stackFormat_(parentRuntime ? js::StackFormat::Default
: js::StackFormat::SpiderMonkey)
{

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

@ -128,7 +128,7 @@ CreateEnvironmentShape(JSContext* cx, BindingIter& bi, const Class* cls,
return nullptr;
RootedAtom name(cx);
StackBaseShape stackBase(cx, cls, baseShapeFlags);
StackBaseShape stackBase(cls, baseShapeFlags);
for (; bi; bi++) {
BindingLocation loc = bi.location();
if (loc.kind() == BindingLocation::Kind::Environment) {

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

@ -38,7 +38,7 @@ AutoKeepShapeTables::~AutoKeepShapeTables()
}
inline
StackBaseShape::StackBaseShape(JSContext* cx, const Class* clasp, uint32_t objectFlags)
StackBaseShape::StackBaseShape(const Class* clasp, uint32_t objectFlags)
: flags(objectFlags),
clasp(clasp)
{}

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

@ -2115,7 +2115,7 @@ EmptyShape::getInitialShape(JSContext* cx, const Class* clasp, TaggedProto proto
}
if (!shape) {
StackBaseShape base(cx, clasp, objectFlags);
StackBaseShape base(clasp, objectFlags);
Rooted<UnownedBaseShape*> nbase(cx, BaseShape::getUnowned(cx, base));
if (!nbase)
return nullptr;

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

@ -636,7 +636,7 @@ struct StackBaseShape : public DefaultHasher<ReadBarriered<UnownedBaseShape*>>
clasp(base->clasp_)
{}
inline StackBaseShape(JSContext* cx, const Class* clasp, uint32_t objectFlags);
inline StackBaseShape(const Class* clasp, uint32_t objectFlags);
explicit inline StackBaseShape(Shape* shape);
struct Lookup

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

@ -56,7 +56,7 @@ InterpreterFrame::extensibleLexicalEnvironment() const
}
inline void
InterpreterFrame::initCallFrame(JSContext* cx, InterpreterFrame* prev, jsbytecode* prevpc,
InterpreterFrame::initCallFrame(InterpreterFrame* prev, jsbytecode* prevpc,
Value* prevsp, JSFunction& callee, JSScript* script, Value* argv,
uint32_t nactual, MaybeConstruct constructing)
{
@ -310,7 +310,7 @@ InterpreterStack::pushInlineFrame(JSContext* cx, InterpreterRegs& regs, const Ca
fp->mark_ = mark;
/* Initialize frame, locals, regs. */
fp->initCallFrame(cx, prev, prevpc, prevsp, *callee, script, argv, args.length(),
fp->initCallFrame(prev, prevpc, prevsp, *callee, script, argv, args.length(),
constructing);
regs.prepareToRun(*fp, script);
@ -352,7 +352,7 @@ InterpreterStack::resumeGeneratorCallFrame(JSContext* cx, InterpreterRegs& regs,
InterpreterFrame* fp = reinterpret_cast<InterpreterFrame*>(argv + nformal + constructing);
fp->mark_ = mark;
fp->initCallFrame(cx, prev, prevpc, prevsp, *callee, script, argv, 0, constructing);
fp->initCallFrame(prev, prevpc, prevsp, *callee, script, argv, 0, constructing);
fp->resumeGeneratorFrame(envChain);
regs.prepareToRun(*fp, script);

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

@ -445,7 +445,7 @@ InterpreterStack::pushInvokeFrame(JSContext* cx, const CallArgs& args, MaybeCons
return nullptr;
fp->mark_ = mark;
fp->initCallFrame(cx, nullptr, nullptr, nullptr, *fun, script, argv, args.length(),
fp->initCallFrame(nullptr, nullptr, nullptr, *fun, script, argv, args.length(),
constructing);
return fp;
}

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

@ -398,7 +398,7 @@ class InterpreterFrame
*/
/* Used for Invoke and Interpret. */
void initCallFrame(JSContext* cx, InterpreterFrame* prev, jsbytecode* prevpc, Value* prevsp,
void initCallFrame(InterpreterFrame* prev, jsbytecode* prevpc, Value* prevsp,
JSFunction& callee, JSScript* script, Value* argv, uint32_t nactual,
MaybeConstruct constructing);

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

@ -71,7 +71,7 @@ struct PerformanceMonitoring {
return iteration_;
}
explicit PerformanceMonitoring(JSRuntime* runtime)
explicit PerformanceMonitoring()
: totalCPOWTime(0)
, stopwatchStartCallback(nullptr)
, stopwatchStartClosure(nullptr)

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

@ -1352,7 +1352,7 @@ JSStructuredCloneWriter::traverseMap(HandleObject obj)
RootedObject unwrapped(context(), CheckedUnwrap(obj));
MOZ_ASSERT(unwrapped);
JSAutoCompartment ac(context(), unwrapped);
if (!MapObject::getKeysAndValuesInterleaved(context(), unwrapped, &newEntries))
if (!MapObject::getKeysAndValuesInterleaved(unwrapped, &newEntries))
return false;
}
if (!context()->compartment()->wrap(context(), &newEntries))

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

@ -2155,9 +2155,8 @@ ParseFloatLiteral(WasmParseContext& c, WasmToken token)
buffer[i] = char(cur[i]);
buffer[end - cur] = '\0';
char* strtod_end;
int err;
result = (Float)js_strtod_harder(c.dtoaState, buffer, &strtod_end, &err);
if (err != 0 || strtod_end == buffer) {
result = (Float)js_strtod_harder(c.dtoaState, buffer, &strtod_end);
if (strtod_end == buffer) {
c.lifo.release(mark);
c.ts.generateError(token, c.error);
return nullptr;