diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index 8822b26a1f9..ee9b40da04c 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -63,6 +63,26 @@ nsSystemInfo::~nsSystemInfo() { } +// CPU-specific information. +static const struct { + const char *name; + bool (*propfun)(void); +} cpuPropItems[] = { + // x86-specific bits. + { "hasMMX", mozilla::supports_mmx }, + { "hasSSE", mozilla::supports_sse }, + { "hasSSE2", mozilla::supports_sse2 }, + { "hasSSE3", mozilla::supports_sse3 }, + { "hasSSSE3", mozilla::supports_ssse3 }, + { "hasSSE4A", mozilla::supports_sse4a }, + { "hasSSE4_1", mozilla::supports_sse4_1 }, + { "hasSSE4_2", mozilla::supports_sse4_2 }, + // ARM-specific bits. + { "hasEDSP", mozilla::supports_edsp }, + { "hasARMv6", mozilla::supports_armv6 }, + { "hasNEON", mozilla::supports_neon } +}; + nsresult nsSystemInfo::Init() { @@ -98,26 +118,6 @@ nsSystemInfo::Init() SetInt32Property(NS_LITERAL_STRING("cpucount"), PR_GetNumberOfProcessors()); SetUint64Property(NS_LITERAL_STRING("memsize"), PR_GetPhysicalMemorySize()); - // CPU-specific information. - static const struct { - const char *name; - bool (*propfun)(void); - } cpuPropItems[] = { - // x86-specific bits. - { "hasMMX", mozilla::supports_mmx }, - { "hasSSE", mozilla::supports_sse }, - { "hasSSE2", mozilla::supports_sse2 }, - { "hasSSE3", mozilla::supports_sse3 }, - { "hasSSSE3", mozilla::supports_ssse3 }, - { "hasSSE4A", mozilla::supports_sse4a }, - { "hasSSE4_1", mozilla::supports_sse4_1 }, - { "hasSSE4_2", mozilla::supports_sse4_2 }, - // ARM-specific bits. - { "hasEDSP", mozilla::supports_edsp }, - { "hasARMv6", mozilla::supports_armv6 }, - { "hasNEON", mozilla::supports_neon } - }; - for (PRUint32 i = 0; i < ArrayLength(cpuPropItems); i++) { rv = SetPropertyAsBool(NS_ConvertASCIItoUTF16(cpuPropItems[i].name), cpuPropItems[i].propfun());