Bug 1054334 - SpiderMonkey: Constify some static variables r=nbp

This commit is contained in:
Dan Gohman 2014-08-18 12:20:42 -07:00
parent fc4fb65096
commit 51500b337a
5 changed files with 10 additions and 10 deletions

View File

@ -6129,9 +6129,9 @@ GenerateFFIInterpExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &e
JS_ASSERT(masm.framePushed() == 0);
// Argument types for InvokeFromAsmJS_*:
MIRType typeArray[] = { MIRType_Pointer, // exitDatum
MIRType_Int32, // argc
MIRType_Pointer }; // argv
static const MIRType typeArray[] = { MIRType_Pointer, // exitDatum
MIRType_Int32, // argc
MIRType_Pointer }; // argv
MIRTypeVector invokeArgTypes(m.cx());
invokeArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray));

View File

@ -348,7 +348,7 @@ const JSFunctionSpec js::ReferenceTypeDescr::typeObjectMethods[] = {
JS_FS_END
};
static int32_t ReferenceSizes[] = {
static const int32_t ReferenceSizes[] = {
#define REFERENCE_SIZE(_kind, _type, _name) \
sizeof(_type),
JS_FOR_EACH_REFERENCE_TYPE_REPR(REFERENCE_SIZE) 0
@ -427,7 +427,7 @@ js::ReferenceTypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
* Note: these are partially defined in SIMD.cpp
*/
static int32_t X4Sizes[] = {
static const int32_t X4Sizes[] = {
#define X4_SIZE(_kind, _type, _name) \
sizeof(_type) * 4,
JS_FOR_EACH_X4_TYPE_REPR(X4_SIZE) 0

View File

@ -1638,7 +1638,7 @@ ComparatorNumericRightMinusLeft(const NumericElement &a, const NumericElement &b
typedef bool (*ComparatorNumeric)(const NumericElement &a, const NumericElement &b,
bool *lessOrEqualp);
ComparatorNumeric SortComparatorNumerics[] = {
static const ComparatorNumeric SortComparatorNumerics[] = {
nullptr,
nullptr,
ComparatorNumericLeftMinusRight,
@ -1661,7 +1661,7 @@ ComparatorInt32RightMinusLeft(const Value &a, const Value &b, bool *lessOrEqualp
typedef bool (*ComparatorInt32)(const Value &a, const Value &b, bool *lessOrEqualp);
ComparatorInt32 SortComparatorInt32s[] = {
static const ComparatorInt32 SortComparatorInt32s[] = {
nullptr,
nullptr,
ComparatorInt32LeftMinusRight,

View File

@ -796,7 +796,7 @@ class ScriptedIndirectProxyHandler : public BaseProxyHandler
* eventually moving towards eliminating one of those slots, and so we don't
* want to add a dependency here.
*/
static Class CallConstructHolder = {
static const Class CallConstructHolder = {
"CallConstructHolder",
JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS
};

View File

@ -5096,7 +5096,7 @@ static const JSClass env_class = {
* setter and method with attached JitInfo. This object can be used to test
* IonMonkey DOM optimizations in the shell.
*/
static uint32_t DOM_OBJECT_SLOT = 0;
static const uint32_t DOM_OBJECT_SLOT = 0;
static bool
dom_genericGetter(JSContext* cx, unsigned argc, JS::Value *vp);
@ -5554,7 +5554,7 @@ ShellBuildId(JS::BuildIdCharVector *buildId)
return buildId->append(buildid, sizeof(buildid));
}
static JS::AsmJSCacheOps asmJSCacheOps = {
static const JS::AsmJSCacheOps asmJSCacheOps = {
ShellOpenAsmJSCacheEntryForRead,
ShellCloseAsmJSCacheEntryForRead,
ShellOpenAsmJSCacheEntryForWrite,