Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: Source/wtf/InstanceCounter.cpp

Issue 304033004: InstanceCounter/Oilpan GC tracing: Add clang support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: objectGraphMutex Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 19 matching lines...) Expand all
30 #include "wtf/StdLibExtras.h" 30 #include "wtf/StdLibExtras.h"
31 #include "wtf/ThreadingPrimitives.h" 31 #include "wtf/ThreadingPrimitives.h"
32 #include "wtf/text/StringBuilder.h" 32 #include "wtf/text/StringBuilder.h"
33 #include "wtf/text/StringHash.h" 33 #include "wtf/text/StringHash.h"
34 #include "wtf/text/WTFString.h" 34 #include "wtf/text/WTFString.h"
35 35
36 namespace WTF { 36 namespace WTF {
37 37
38 #if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING) 38 #if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING)
39 39
40 #if COMPILER(GCC) 40 #if COMPILER(CLANG)
41 const size_t extractNameFunctionPrefixLength = sizeof("const char *WTF::extractN ameFunction() [T = ") - 1;
42 const size_t extractNameFunctionPostfixLength = 1;
43 #elif COMPILER(GCC)
41 const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractN ameFunction() [with T = ") - 1; 44 const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractN ameFunction() [with T = ") - 1;
42 const size_t extractNameFunctionPostfixLength = 1; 45 const size_t extractNameFunctionPostfixLength = 1;
43 #else 46 #else
44 #warning "Extracting typename in a compiler other than GCC isn't supported atm" 47 #warning "Extracting typename in a compiler other than GCC isn't supported atm"
45 #endif 48 #endif
46 49
47 // This function is used to stringify a typename T without using RTTI. 50 // This function is used to stringify a typename T without using RTTI.
48 // The result of extractNameFunction<T>() is given as |funcName|. |extractTypeNa meFromFunctionName| then extracts a typename string from |funcName|. 51 // The result of extractNameFunction<T>() is given as |funcName|. |extractTypeNa meFromFunctionName| then extracts a typename string from |funcName|.
49 String extractTypeNameFromFunctionName(const char* funcName) 52 String extractTypeNameFromFunctionName(const char* funcName)
50 { 53 {
51 #if COMPILER(GCC) 54 #if COMPILER(CLANG) || COMPILER(GCC)
52 size_t funcNameLength = strlen(funcName); 55 size_t funcNameLength = strlen(funcName);
53 ASSERT(funcNameLength > extractNameFunctionPrefixLength + 1); 56 ASSERT(funcNameLength > extractNameFunctionPrefixLength + 1);
54 57
55 const char* funcNameWithoutPrefix = funcName + extractNameFunctionPrefixLeng th; 58 const char* funcNameWithoutPrefix = funcName + extractNameFunctionPrefixLeng th;
56 return String(funcNameWithoutPrefix, funcNameLength - extractNameFunctionPre fixLength - extractNameFunctionPostfixLength /* last ] */); 59 return String(funcNameWithoutPrefix, funcNameLength - extractNameFunctionPre fixLength - extractNameFunctionPostfixLength /* last ] */);
57 #else 60 #else
58 return String(); 61 return String();
59 #endif 62 #endif
60 } 63 }
61 64
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 #else 142 #else
140 143
141 String dumpRefCountedInstanceCounts() 144 String dumpRefCountedInstanceCounts()
142 { 145 {
143 return String("{}"); 146 return String("{}");
144 } 147 }
145 148
146 #endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING) 149 #endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING)
147 150
148 } // namespace WTF 151 } // namespace WTF
OLDNEW
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698