X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fwtf%2FInstanceCounter.cpp;h=e37958227e50585eeb5efd81a3544600ccf07f9f;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=a34822eb3ac5eefcdc62d256977d704364ad470c;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/wtf/InstanceCounter.cpp b/src/third_party/WebKit/Source/wtf/InstanceCounter.cpp index a34822e..e379582 100644 --- a/src/third_party/WebKit/Source/wtf/InstanceCounter.cpp +++ b/src/third_party/WebKit/Source/wtf/InstanceCounter.cpp @@ -35,30 +35,33 @@ namespace WTF { -#if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING) +#if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) #if COMPILER(CLANG) const size_t extractNameFunctionPrefixLength = sizeof("const char *WTF::extractNameFunction() [T = ") - 1; -const size_t extractNameFunctionPostfixLength = 1; +const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; #elif COMPILER(GCC) const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractNameFunction() [with T = ") - 1; -const size_t extractNameFunctionPostfixLength = 1; +const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; +#elif COMPILER(MSVC) +const size_t extractNameFunctionPrefixLength = sizeof("const char *__cdecl WTF::extractNameFunction(void)") - 1; #else -#warning "Extracting typename in a compiler other than GCC isn't supported atm" +#warning "Extracting typename is supported only in compiler GCC, CLANG and MSVC at this moment" #endif // This function is used to stringify a typename T without using RTTI. // The result of extractNameFunction() is given as |funcName|. |extractTypeNameFromFunctionName| then extracts a typename string from |funcName|. String extractTypeNameFromFunctionName(const char* funcName) { -#if COMPILER(CLANG) || COMPILER(GCC) +#if COMPILER(CLANG) || COMPILER(GCC) || COMPILER(MSVC) size_t funcNameLength = strlen(funcName); - ASSERT(funcNameLength > extractNameFunctionPrefixLength + 1); + ASSERT(funcNameLength > extractNameFunctionPrefixLength + extractNameFunctionPostfixLength); const char* funcNameWithoutPrefix = funcName + extractNameFunctionPrefixLength; - return String(funcNameWithoutPrefix, funcNameLength - extractNameFunctionPrefixLength - extractNameFunctionPostfixLength /* last ] */); + return String(funcNameWithoutPrefix, funcNameLength - extractNameFunctionPrefixLength - extractNameFunctionPostfixLength); #else - return String(); + return String("unknown"); #endif } @@ -146,6 +149,6 @@ String dumpRefCountedInstanceCounts() return String("{}"); } -#endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING) +#endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) } // namespace WTF