Bug 915855 - SpiderMonkey: Clean up "const static" to "static const". r=terrence

This commit is contained in:
Dan Gohman 2013-09-12 16:38:40 -07:00
parent 602e976657
commit d8c1b10be8
12 changed files with 45 additions and 45 deletions

View File

@ -26,7 +26,7 @@ class RelocationOverlay
friend class MinorCollectionTracer;
/* The low bit is set so this should never equal a normal pointer. */
const static uintptr_t Relocated = uintptr_t(0xbad0bad1);
static const uintptr_t Relocated = uintptr_t(0xbad0bad1);
/* Set to Relocated when moved. */
uintptr_t magic_;

View File

@ -44,10 +44,10 @@ class BaselineCompiler;
class Nursery
{
public:
const static int NumNurseryChunks = 16;
const static int LastNurseryChunk = NumNurseryChunks - 1;
const static size_t Alignment = gc::ChunkSize;
const static size_t NurserySize = gc::ChunkSize * NumNurseryChunks;
static const int NumNurseryChunks = 16;
static const int LastNurseryChunk = NumNurseryChunks - 1;
static const size_t Alignment = gc::ChunkSize;
static const size_t NurserySize = gc::ChunkSize * NumNurseryChunks;
explicit Nursery(JSRuntime *rt)
: runtime_(rt),
@ -138,8 +138,8 @@ class Nursery
HugeSlotsSet hugeSlots;
/* The marking bitmap for the fallback marker. */
const static size_t ThingAlignment = sizeof(JS::Value);
const static size_t FallbackBitmapBits = NurserySize / ThingAlignment;
static const size_t ThingAlignment = sizeof(JS::Value);
static const size_t FallbackBitmapBits = NurserySize / ThingAlignment;
BitArray<FallbackBitmapBits> fallbackBitmap;
#ifdef DEBUG
@ -147,16 +147,16 @@ class Nursery
* In DEBUG builds, these bytes indicate the state of an unused segment of
* nursery-allocated memory.
*/
const static uint8_t FreshNursery = 0x2a;
const static uint8_t SweptNursery = 0x2b;
const static uint8_t AllocatedThing = 0x2c;
static const uint8_t FreshNursery = 0x2a;
static const uint8_t SweptNursery = 0x2b;
static const uint8_t AllocatedThing = 0x2c;
#endif
/* The maximum number of slots allowed to reside inline in the nursery. */
const static size_t MaxNurserySlots = 100;
static const size_t MaxNurserySlots = 100;
/* The amount of space in the mapped nursery available to allocations. */
const static size_t NurseryChunkUsableSize = gc::ChunkSize - sizeof(JSRuntime *);
static const size_t NurseryChunkUsableSize = gc::ChunkSize - sizeof(JSRuntime *);
struct NurseryChunkLayout {
char data[NurseryChunkUsableSize];

View File

@ -36,7 +36,7 @@ class gcstats::StatisticsSerializer
bool needComma_;
bool oom_;
const static int MaxFieldValueLength = 128;
static const int MaxFieldValueLength = 128;
public:
enum Mode {

View File

@ -72,10 +72,10 @@ typedef HashSet<void *, PointerHasher<void *, 3>, SystemAllocPolicy> EdgeSet;
class StoreBuffer
{
/* The size of a single block of store buffer storage space. */
const static size_t ChunkSize = 1 << 16; /* 64KiB */
static const size_t ChunkSize = 1 << 16; /* 64KiB */
/* The size at which a block is about to overflow. */
const static size_t MinAvailableSize = (size_t)(ChunkSize * 1.0 / 8.0);
static const size_t MinAvailableSize = (size_t)(ChunkSize * 1.0 / 8.0);
/*
* This buffer holds only a single type of edge. Using this buffer is more

View File

@ -528,7 +528,7 @@ IsMarkedOrAllocated(Cell *cell)
return cell->isMarked() || cell->arenaHeader()->allocatedDuringIncremental;
}
const static uint32_t MAX_VERIFIER_EDGES = 1000;
static const uint32_t MAX_VERIFIER_EDGES = 1000;
/*
* This function is called by EndVerifyBarriers for every heap edge. If the edge

View File

@ -5358,7 +5358,7 @@ class ICCall_ScriptedApplyArray : public ICMonitoredStub
// The maximum length of an inlineable funcall array.
// Keep this small to avoid controllable stack overflows by attackers passing large
// arrays to fun.apply.
const static uint32_t MAX_ARGS_ARRAY_LENGTH = 16;
static const uint32_t MAX_ARGS_ARRAY_LENGTH = 16;
protected:
uint32_t pcOffset_;

View File

@ -93,7 +93,7 @@ class ICStubSpace
// OptimizedICStubSpace.
struct OptimizedICStubSpace : public ICStubSpace
{
const static size_t STUB_DEFAULT_CHUNK_SIZE = 4 * 1024;
static const size_t STUB_DEFAULT_CHUNK_SIZE = 4 * 1024;
public:
OptimizedICStubSpace()
@ -109,7 +109,7 @@ struct OptimizedICStubSpace : public ICStubSpace
// FallbackICStubSpace.
struct FallbackICStubSpace : public ICStubSpace
{
const static size_t STUB_DEFAULT_CHUNK_SIZE = 256;
static const size_t STUB_DEFAULT_CHUNK_SIZE = 256;
public:
FallbackICStubSpace()

View File

@ -10,8 +10,8 @@
namespace js {
namespace crash {
const static int crash_cookie_len = 16;
const static char crash_cookie[crash_cookie_len] = "*J*S*CRASHDATA*";
static const int crash_cookie_len = 16;
static const char crash_cookie[crash_cookie_len] = "*J*S*CRASHDATA*";
/* These values are used for CrashHeader::id. */
enum {
@ -41,7 +41,7 @@ struct CrashRegisters
uint64_t ip, sp, bp;
};
const static int crash_buffer_size = 32 * 1024;
static const int crash_buffer_size = 32 * 1024;
struct CrashStack
{

View File

@ -15,7 +15,7 @@
using namespace js;
using namespace js::crash;
const static int stack_snapshot_max_size = 32768;
static const int stack_snapshot_max_size = 32768;
#if defined(XP_WIN)

View File

@ -126,26 +126,26 @@ MapAllocToTraceKind(AllocKind kind)
}
template <typename T> struct MapTypeToTraceKind {};
template <> struct MapTypeToTraceKind<JSObject> { const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<JSFunction> { const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ArgumentsObject> { const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ArrayBufferObject>{ const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ArrayBufferViewObject>{ const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<DebugScopeObject> { const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<GlobalObject> { const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ScopeObject> { const static JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<JSScript> { const static JSGCTraceKind kind = JSTRACE_SCRIPT; };
template <> struct MapTypeToTraceKind<LazyScript> { const static JSGCTraceKind kind = JSTRACE_LAZY_SCRIPT; };
template <> struct MapTypeToTraceKind<Shape> { const static JSGCTraceKind kind = JSTRACE_SHAPE; };
template <> struct MapTypeToTraceKind<BaseShape> { const static JSGCTraceKind kind = JSTRACE_BASE_SHAPE; };
template <> struct MapTypeToTraceKind<UnownedBaseShape> { const static JSGCTraceKind kind = JSTRACE_BASE_SHAPE; };
template <> struct MapTypeToTraceKind<types::TypeObject>{ const static JSGCTraceKind kind = JSTRACE_TYPE_OBJECT; };
template <> struct MapTypeToTraceKind<JSAtom> { const static JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<JSString> { const static JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<JSFlatString> { const static JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<JSLinearString> { const static JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<PropertyName> { const static JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<jit::IonCode> { const static JSGCTraceKind kind = JSTRACE_IONCODE; };
template <> struct MapTypeToTraceKind<JSObject> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<JSFunction> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ArgumentsObject> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ArrayBufferObject>{ static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ArrayBufferViewObject>{ static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<DebugScopeObject> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<GlobalObject> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ScopeObject> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<JSScript> { static const JSGCTraceKind kind = JSTRACE_SCRIPT; };
template <> struct MapTypeToTraceKind<LazyScript> { static const JSGCTraceKind kind = JSTRACE_LAZY_SCRIPT; };
template <> struct MapTypeToTraceKind<Shape> { static const JSGCTraceKind kind = JSTRACE_SHAPE; };
template <> struct MapTypeToTraceKind<BaseShape> { static const JSGCTraceKind kind = JSTRACE_BASE_SHAPE; };
template <> struct MapTypeToTraceKind<UnownedBaseShape> { static const JSGCTraceKind kind = JSTRACE_BASE_SHAPE; };
template <> struct MapTypeToTraceKind<types::TypeObject>{ static const JSGCTraceKind kind = JSTRACE_TYPE_OBJECT; };
template <> struct MapTypeToTraceKind<JSAtom> { static const JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<JSString> { static const JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<JSFlatString> { static const JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<JSLinearString> { static const JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<PropertyName> { static const JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<jit::IonCode> { static const JSGCTraceKind kind = JSTRACE_IONCODE; };
#if defined(JSGC_GENERATIONAL) || defined(DEBUG)
static inline bool

View File

@ -211,7 +211,7 @@ class ParallelDo
{
public:
// For tests, make sure to keep this in sync with minItemsTestingThreshold.
const static uint32_t MAX_BAILOUTS = 3;
static const uint32_t MAX_BAILOUTS = 3;
uint32_t bailouts;
// Information about the bailout:

View File

@ -1058,7 +1058,7 @@ class InterpreterStack
friend class FrameGuard;
friend class InterpreterActivation;
const static size_t DEFAULT_CHUNK_SIZE = 4 * 1024;
static const size_t DEFAULT_CHUNK_SIZE = 4 * 1024;
LifoAlloc allocator_;
// Number of interpreter frames on the stack, for over-recursion checks.