Changeset 106197 in webkit
- Timestamp:
- Jan 28, 2012 7:47:13 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 7 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r106078 r106197 15 15 "${JAVASCRIPTCORE_DIR}/profiler" 16 16 "${JAVASCRIPTCORE_DIR}/runtime" 17 "${JAVASCRIPTCORE_DIR}/tools" 17 18 "${JAVASCRIPTCORE_DIR}/yarr" 18 19 "${JAVASCRIPTCORE_DIR}/wtf" … … 201 202 runtime/UString.cpp 202 203 204 tools/CodeProfile.cpp 205 tools/CodeProfiling.cpp 206 203 207 yarr/YarrPattern.cpp 204 208 yarr/YarrInterpreter.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r106189 r106197 1 2012-01-27 Gavin Barraclough <barraclough@apple.com> 2 3 Implement a JIT-code aware sampling profiler for JSC 4 https://bugs.webkit.org/show_bug.cgi?id=76855 5 6 Reviewed by Oliver Hunt. 7 8 To enable the profiler, set the JSC_CODE_PROFILING environment variable to 9 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively 10 trace all samples). 11 12 The profiler requires -fomit-frame-pointer to be removed from the build flags. 13 14 * JavaScriptCore.exp: 15 - Removed an export. 16 * JavaScriptCore.xcodeproj/project.pbxproj: 17 - Added new files 18 * bytecode/CodeBlock.cpp: 19 - For baseline codeblocks, cache the result of canCompileWithDFG. 20 * bytecode/CodeBlock.h: 21 - For baseline codeblocks, cache the result of canCompileWithDFG. 22 * jit/ExecutableAllocator.cpp: 23 (JSC::ExecutableAllocator::initializeAllocator): 24 - Notify the profiler when the allocator is created. 25 (JSC::ExecutableAllocator::allocate): 26 - Inform the allocated of the ownerUID. 27 * jit/ExecutableAllocatorFixedVMPool.cpp: 28 (JSC::ExecutableAllocator::initializeAllocator): 29 - Notify the profiler when the allocator is created. 30 (JSC::ExecutableAllocator::allocate): 31 - Inform the allocated of the ownerUID. 32 * jit/JITStubs.cpp: 33 - If profiling, don't mask the return address in JIT code. 34 (We do so to provide nicer backtraces in debug builds). 35 * runtime/Completion.cpp: 36 (JSC::evaluate): 37 - Notify the profiler of script evaluations. 38 * tools: Added. 39 * tools/CodeProfile.cpp: Added. 40 (JSC::symbolName): 41 - Helper function to get the name of a symbol in the framework. 42 (JSC::truncateTrace): 43 - Helper to truncate traces into methods know to have uninformatively deep stacks. 44 (JSC::CodeProfile::sample): 45 - Record a stack trace classifying samples. 46 (JSC::CodeProfile::report): 47 - {Print profiler output. 48 * tools/CodeProfile.h: Added. 49 - new class, captures a set of samples associated with an evaluated script, 50 and nested to record samples from subscripts. 51 * tools/CodeProfiling.cpp: Added. 52 (JSC::CodeProfiling::profilingTimer): 53 - callback fired then a timer event occurs. 54 (JSC::CodeProfiling::notifyAllocator): 55 - called when the executable allocator is constructed. 56 (JSC::CodeProfiling::getOwnerUIDForPC): 57 - helper to lookup the codeblock from an address in JIT code 58 (JSC::CodeProfiling::begin): 59 - enter a profiling scope. 60 (JSC::CodeProfiling::end): 61 - exit a profiling scope. 62 * tools/CodeProfiling.h: Added. 63 - new class, instantialed from Completion to define a profiling scope. 64 * tools/ProfileTreeNode.h: Added. 65 - new class, used to construct a tree of samples. 66 * tools/TieredMMapArray.h: Added. 67 - new class, a malloc-free vector (can be used while the main thread is suspended, 68 possibly holding the malloc heap lock). 69 * wtf/MetaAllocator.cpp: 70 (WTF::MetaAllocatorHandle::MetaAllocatorHandle): 71 (WTF::MetaAllocator::allocate): 72 - Allow allocation handles to track information about their owner. 73 * wtf/MetaAllocator.h: 74 (MetaAllocator): 75 - Allow allocation handles to track information about their owner. 76 * wtf/MetaAllocatorHandle.h: 77 (MetaAllocatorHandle): 78 (WTF::MetaAllocatorHandle::ownerUID): 79 - Allow allocation handles to track information about their owner. 80 * wtf/OSAllocator.h: 81 (WTF::OSAllocator::reallocateCommitted): 82 - reallocate an existing, committed memory allocation. 83 1 84 2012-01-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 85 -
trunk/Source/JavaScriptCore/GNUmakefile.am
r104289 r106197 61 61 -I$(srcdir)/Source/JavaScriptCore/profiler \ 62 62 -I$(srcdir)/Source/JavaScriptCore/runtime \ 63 -I$(srcdir)/Source/JavaScriptCore/tools \ 63 64 -I$(srcdir)/Source/JavaScriptCore/wtf \ 64 65 -I$(srcdir)/Source/JavaScriptCore/wtf \ -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r106078 r106197 526 526 Source/JavaScriptCore/runtime/WeakRandom.h \ 527 527 Source/JavaScriptCore/runtime/WriteBarrier.h \ 528 Source/JavaScriptCore/tools/CodeProfile.cpp \ 529 Source/JavaScriptCore/tools/CodeProfile.h \ 530 Source/JavaScriptCore/tools/CodeProfiling.cpp \ 531 Source/JavaScriptCore/tools/CodeProfiling.h \ 532 Source/JavaScriptCore/tools/ProfileTreeNode.h \ 533 Source/JavaScriptCore/tools/TieredMMapArray.h \ 528 534 Source/JavaScriptCore/wtf/Alignment.h \ 529 535 Source/JavaScriptCore/wtf/AlwaysInline.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r106101 r106197 416 416 __ZN3WTF13MetaAllocator17freeFreeSpaceNodeEPNS0_13FreeSpaceNodeE 417 417 __ZN3WTF13MetaAllocator18debugFreeSpaceSizeEv 418 __ZN3WTF13MetaAllocator8allocateEm419 418 __ZN3WTF13MetaAllocatorC2Em 420 419 __ZN3WTF13StringBuilder11shrinkToFitEv -
trunk/Source/JavaScriptCore/JavaScriptCore.pri
r105995 r106197 24 24 $$SOURCE_DIR/profiler \ 25 25 $$SOURCE_DIR/runtime \ 26 $$SOURCE_DIR/tools \ 26 27 $$SOURCE_DIR/yarr \ 27 28 $$SOURCE_DIR/API \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r106078 r106197 1448 1448 </Filter> 1449 1449 <Filter 1450 Name="tools" 1451 > 1452 <File 1453 RelativePath="..\..\tools\CodeProfile.cpp" 1454 > 1455 </File> 1456 <File 1457 RelativePath="..\..\tools\CodeProfile.h" 1458 > 1459 </File> 1460 <File 1461 RelativePath="..\..\tools\CodeProfiling.cpp" 1462 > 1463 </File> 1464 <File 1465 RelativePath="..\..\tools\CodeProfiling.h" 1466 > 1467 </File> 1468 <File 1469 RelativePath="..\..\tools\ProfileTreeNode.h" 1470 > 1471 </File> 1472 <File 1473 RelativePath="..\..\tools\TieredMMapArray.h" 1474 > 1475 </File> 1476 </Filter> 1477 <Filter 1450 1478 Name="bytecode" 1451 1479 > -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops
r94559 r106197 7 7 <Tool 8 8 Name="VCCLCompilerTool" 9 AdditionalIncludeDirectories=""$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\";../../;../../API/;../../parser/;../../bytecompiler/;../../dfg/;../../jit/;../../runtime/;../../ bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;../../heap/;"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\private";"$(ConfigurationBuildDir)\include";"$(ConfigurationBuildDir)\include\JavaScriptCore";"$(ConfigurationBuildDir)\include\private";"$(WebKitLibrariesDir)\include\pthreads""9 AdditionalIncludeDirectories=""$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\";../../;../../API/;../../parser/;../../bytecompiler/;../../dfg/;../../jit/;../../runtime/;../../tools/;../../bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;../../heap/;"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\private";"$(ConfigurationBuildDir)\include";"$(ConfigurationBuildDir)\include\JavaScriptCore";"$(ConfigurationBuildDir)\include\private";"$(WebKitLibrariesDir)\include\pthreads"" 10 10 PreprocessorDefinitions="__STD_C" 11 11 ForcedIncludeFiles="ICUVersion.h" -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r106078 r106197 383 383 86AE6C4D136A11E400963012 /* DFGFPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE6C4B136A11E400963012 /* DFGFPRInfo.h */; }; 384 384 86AE6C4E136A11E400963012 /* DFGGPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE6C4C136A11E400963012 /* DFGGPRInfo.h */; }; 385 86B5826714D2796C00A9C306 /* CodeProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */; }; 386 86B5826914D2797000A9C306 /* CodeProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */; }; 385 387 86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE1117E578100DF5A90 /* StringBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 386 388 86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BB09BE138E381B0056702F /* DFGRepatch.cpp */; }; … … 1043 1045 1AA9E5501498093500001A8A /* Functional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Functional.h; sourceTree = "<group>"; }; 1044 1046 1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; 1045 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = JavaScriptCore.xcconfig; path = ../Configurations/JavaScriptCore.xcconfig; sourceTree = "<group>"; };1047 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = JavaScriptCore.xcconfig; sourceTree = "<group>"; }; 1046 1048 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; 1047 1049 1C9051450BA9E8A70081E9D0 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; … … 1139 1141 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86_64.h; sourceTree = "<group>"; }; 1140 1142 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86Common.h; sourceTree = "<group>"; }; 1143 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeProfiling.cpp; sourceTree = "<group>"; }; 1144 8603CEF314C7546400AE59E3 /* CodeProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeProfiling.h; sourceTree = "<group>"; }; 1141 1145 8604F4F2143A6C4400B295F5 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; }; 1142 1146 8604F503143CE1C100B295F5 /* JSGlobalThis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalThis.h; sourceTree = "<group>"; }; … … 1186 1190 86AE6C4B136A11E400963012 /* DFGFPRInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGFPRInfo.h; path = dfg/DFGFPRInfo.h; sourceTree = "<group>"; }; 1187 1191 86AE6C4C136A11E400963012 /* DFGGPRInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGGPRInfo.h; path = dfg/DFGGPRInfo.h; sourceTree = "<group>"; }; 1192 86B5822C14D22F5F00A9C306 /* ProfileTreeNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProfileTreeNode.h; sourceTree = "<group>"; }; 1193 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeProfile.cpp; sourceTree = "<group>"; }; 1194 86B5822F14D2373B00A9C306 /* CodeProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeProfile.h; sourceTree = "<group>"; }; 1195 86B5826A14D35D5100A9C306 /* TieredMMapArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TieredMMapArray.h; sourceTree = "<group>"; }; 1188 1196 86B99AE1117E578100DF5A90 /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = text/StringBuffer.h; sourceTree = "<group>"; }; 1189 1197 86BB09BE138E381B0056702F /* DFGRepatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGRepatch.cpp; path = dfg/DFGRepatch.cpp; sourceTree = "<group>"; }; … … 1681 1689 7EF6E0BB0EB7A1EC0079AFAF /* runtime */, 1682 1690 141211000A48772600480255 /* tests */, 1691 8603CEF014C753EF00AE59E3 /* tools */, 1683 1692 65162EF108E6A21C007556CD /* wtf */, 1684 1693 86EAC48C0F93E8B9008EC948 /* yarr */, … … 1827 1836 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */, 1828 1837 1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */, 1829 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */,1830 1838 BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */, 1831 1839 BC0894D60FAFBA2D00001865 /* JSAPIValueWrapper.h */, … … 1917 1925 449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */, 1918 1926 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */, 1927 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */, 1919 1928 BC021BF2136900C300FC5467 /* TestAPI.xcconfig */, 1920 1929 5DAFD6CC146B68B900FBEFB4 /* TestRegExp.xcconfig */, … … 2364 2373 ); 2365 2374 path = runtime; 2375 sourceTree = "<group>"; 2376 }; 2377 8603CEF014C753EF00AE59E3 /* tools */ = { 2378 isa = PBXGroup; 2379 children = ( 2380 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */, 2381 86B5822F14D2373B00A9C306 /* CodeProfile.h */, 2382 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */, 2383 8603CEF314C7546400AE59E3 /* CodeProfiling.h */, 2384 86B5822C14D22F5F00A9C306 /* ProfileTreeNode.h */, 2385 86B5826A14D35D5100A9C306 /* TieredMMapArray.h */, 2386 ); 2387 path = tools; 2366 2388 sourceTree = "<group>"; 2367 2389 }; … … 3641 3663 0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */, 3642 3664 0F55F0F414D1063900AC7649 /* AbstractPC.cpp in Sources */, 3665 86B5826714D2796C00A9C306 /* CodeProfile.cpp in Sources */, 3666 86B5826914D2797000A9C306 /* CodeProfiling.cpp in Sources */, 3643 3667 ); 3644 3668 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/Target.pri
r106078 r106197 210 210 runtime/TimeoutChecker.cpp \ 211 211 runtime/UString.cpp \ 212 tools/CodeProfile.cpp \ 213 tools/CodeProfiling.cpp \ 212 214 yarr/YarrJIT.cpp \ 213 215 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r105698 r106197 1457 1457 , m_optimizationDelayCounter(0) 1458 1458 , m_reoptimizationRetryCounter(0) 1459 , m_canCompileWithDFGState(CompileWithDFGUnset) 1459 1460 { 1460 1461 setNumParameters(other.numParameters()); … … 2165 2166 } 2166 2167 2167 bool ProgramCodeBlock::canCompileWithDFG ()2168 bool ProgramCodeBlock::canCompileWithDFGInternal() 2168 2169 { 2169 2170 return DFG::canCompileProgram(this); 2170 2171 } 2171 2172 2172 bool EvalCodeBlock::canCompileWithDFG ()2173 bool EvalCodeBlock::canCompileWithDFGInternal() 2173 2174 { 2174 2175 return DFG::canCompileEval(this); 2175 2176 } 2176 2177 2177 bool FunctionCodeBlock::canCompileWithDFG ()2178 bool FunctionCodeBlock::canCompileWithDFGInternal() 2178 2179 { 2179 2180 if (m_isConstructor) -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r106067 r106197 389 389 virtual void jettison() = 0; 390 390 virtual CodeBlock* replacement() = 0; 391 virtual bool canCompileWithDFG() = 0; 391 392 enum CompileWithDFGState { 393 CompileWithDFGFalse, 394 CompileWithDFGTrue, 395 CompileWithDFGUnset 396 }; 397 398 virtual bool canCompileWithDFGInternal() = 0; 399 bool canCompileWithDFG() 400 { 401 bool result = canCompileWithDFGInternal(); 402 m_canCompileWithDFGState = result ? CompileWithDFGTrue : CompileWithDFGFalse; 403 return result; 404 } 405 CompileWithDFGState canCompileWithDFGState() { return m_canCompileWithDFGState; } 406 392 407 bool hasOptimizedReplacement() 393 408 { … … 1188 1203 #endif 1189 1204 OwnPtr<RareData> m_rareData; 1205 CompileWithDFGState m_canCompileWithDFGState; 1190 1206 }; 1191 1207 … … 1227 1243 virtual void jettison(); 1228 1244 virtual CodeBlock* replacement(); 1229 virtual bool canCompileWithDFG ();1245 virtual bool canCompileWithDFGInternal(); 1230 1246 #endif 1231 1247 }; … … 1261 1277 virtual void jettison(); 1262 1278 virtual CodeBlock* replacement(); 1263 virtual bool canCompileWithDFG ();1279 virtual bool canCompileWithDFGInternal(); 1264 1280 #endif 1265 1281 … … 1298 1314 virtual void jettison(); 1299 1315 virtual CodeBlock* replacement(); 1300 virtual bool canCompileWithDFG ();1316 virtual bool canCompileWithDFGInternal(); 1301 1317 #endif 1302 1318 }; -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp
r105636 r106197 29 29 30 30 #if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) 31 #include "CodeProfiling.h" 31 32 #include <wtf/MetaAllocator.h> 32 33 #include <wtf/PageReservation.h> … … 94 95 ASSERT(!allocator); 95 96 allocator = new DemandExecutableAllocator(); 97 CodeProfiling::notifyAllocator(allocator); 96 98 } 97 99 … … 113 115 PassRefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(JSGlobalData&, size_t sizeInBytes, void* ownerUID) 114 116 { 115 UNUSED_PARAM(ownerUID); 116 117 RefPtr<ExecutableMemoryHandle> result = allocator->allocate(sizeInBytes); 117 RefPtr<ExecutableMemoryHandle> result = allocator->allocate(sizeInBytes, ownerUID); 118 118 if (!result) 119 119 CRASH(); -
trunk/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
r105636 r106197 30 30 #if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) 31 31 32 #include "CodeProfiling.h" 32 33 #include <errno.h> 33 34 34 #include <sys/mman.h> 35 35 #include <unistd.h> … … 97 97 ASSERT(!allocator); 98 98 allocator = new FixedVMPoolExecutableAllocator(); 99 CodeProfiling::notifyAllocator(allocator); 99 100 } 100 101 … … 117 118 PassRefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(JSGlobalData& globalData, size_t sizeInBytes, void* ownerUID) 118 119 { 119 UNUSED_PARAM(ownerUID); 120 121 RefPtr<ExecutableMemoryHandle> result = allocator->allocate(sizeInBytes); 120 RefPtr<ExecutableMemoryHandle> result = allocator->allocate(sizeInBytes, ownerUID); 122 121 if (!result) { 123 122 releaseExecutableMemory(globalData); 124 result = allocator->allocate(sizeInBytes );123 result = allocator->allocate(sizeInBytes, ownerUID); 125 124 if (!result) 126 125 CRASH(); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r106185 r106197 38 38 #include "CallFrame.h" 39 39 #include "CodeBlock.h" 40 #include "CodeProfiling.h" 40 41 #include "DFGOSREntry.h" 41 42 #include "Debugger.h" … … 969 970 } 970 971 971 #if !defined(NDEBUG) && !ENABLE(CODE_PROFILING)972 #if !defined(NDEBUG) 972 973 973 974 extern "C" { … … 987 988 , savedReturnAddress(*stackFrame.returnAddressSlot()) 988 989 { 989 *stackFrame.returnAddressSlot() = ReturnAddressPtr(FunctionPtr(jscGeneratedNativeCode)); 990 if (!CodeProfiling::enabled()) 991 *stackFrame.returnAddressSlot() = ReturnAddressPtr(FunctionPtr(jscGeneratedNativeCode)); 990 992 } 991 993 -
trunk/Source/JavaScriptCore/runtime/Completion.cpp
r94811 r106197 25 25 26 26 #include "CallFrame.h" 27 #include "CodeProfiling.h" 27 28 #include "JSGlobalObject.h" 28 29 #include "JSLock.h" … … 56 57 ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable()); 57 58 59 CodeProfiling profile(source); 60 58 61 ProgramExecutable* program = ProgramExecutable::create(exec, source); 59 62 if (!program) { -
trunk/Source/JavaScriptCore/wtf/MetaAllocator.cpp
r105841 r106197 56 56 } 57 57 58 MetaAllocatorHandle::MetaAllocatorHandle(MetaAllocator* allocator, void* start, size_t sizeInBytes )58 MetaAllocatorHandle::MetaAllocatorHandle(MetaAllocator* allocator, void* start, size_t sizeInBytes, void* ownerUID) 59 59 : m_allocator(allocator) 60 60 , m_start(start) 61 61 , m_sizeInBytes(sizeInBytes) 62 , m_ownerUID(ownerUID) 62 63 { 63 64 ASSERT(allocator); … … 130 131 } 131 132 132 PassRefPtr<MetaAllocatorHandle> MetaAllocator::allocate(size_t sizeInBytes )133 PassRefPtr<MetaAllocatorHandle> MetaAllocator::allocate(size_t sizeInBytes, void* ownerUID) 133 134 { 134 135 SpinLockHolder locker(&m_lock); … … 168 169 #endif 169 170 170 MetaAllocatorHandle* handle = new MetaAllocatorHandle(this, start, sizeInBytes );171 MetaAllocatorHandle* handle = new MetaAllocatorHandle(this, start, sizeInBytes, ownerUID); 171 172 // FIXME: Implement a verifier scheme that groks MetaAllocatorHandles 172 173 handle->deprecatedTurnOffVerifier(); -
trunk/Source/JavaScriptCore/wtf/MetaAllocator.h
r105841 r106197 68 68 virtual ~MetaAllocator(); 69 69 70 WTF_EXPORT_PRIVATE PassRefPtr<MetaAllocatorHandle> allocate(size_t sizeInBytes );70 WTF_EXPORT_PRIVATE PassRefPtr<MetaAllocatorHandle> allocate(size_t sizeInBytes, void* ownerUID); 71 71 72 72 void trackAllocations(MetaAllocatorTracker* tracker) -
trunk/Source/JavaScriptCore/wtf/MetaAllocatorHandle.h
r105841 r106197 41 41 class MetaAllocatorHandle : public RefCounted<MetaAllocatorHandle>, public RedBlackTree<MetaAllocatorHandle, void*>::Node { 42 42 private: 43 MetaAllocatorHandle(MetaAllocator*, void* start, size_t sizeInBytes );43 MetaAllocatorHandle(MetaAllocator*, void* start, size_t sizeInBytes, void* ownerUID); 44 44 45 45 public: … … 73 73 return m_allocator; 74 74 } 75 75 76 void* ownerUID() 77 { 78 return m_ownerUID; 79 } 80 76 81 void* key() 77 82 { … … 85 90 void* m_start; 86 91 size_t m_sizeInBytes; 92 void* m_ownerUID; 87 93 }; 88 94 -
trunk/Source/JavaScriptCore/wtf/OSAllocator.h
r104900 r106197 27 27 #define OSAllocator_h 28 28 29 #include <algorithm> 29 30 #include <wtf/UnusedParam.h> 30 31 #include <wtf/VMTags.h> … … 66 67 static void* reserveAndCommit(size_t reserveSize, size_t commitSize, Usage = UnknownUsage, bool writable = true, bool executable = false); 67 68 static void decommitAndRelease(void* releaseBase, size_t releaseSize, void* decommitBase, size_t decommitSize); 69 70 // Reallocate an existing, committed allocation. 71 // The prior allocation must be fully comitted, and the new size will also be fully committed. 72 // This interface is provided since it may be possible to optimize this operation on some platforms. 73 template<typename T> 74 static T* reallocateCommitted(T*, size_t oldSize, size_t newSize, Usage = UnknownUsage, bool writable = true, bool executable = false); 68 75 }; 69 76 … … 94 101 } 95 102 103 template<typename T> 104 inline T* OSAllocator::reallocateCommitted(T* oldBase, size_t oldSize, size_t newSize, Usage usage, bool writable, bool executable) 105 { 106 void* newBase = reserveAndCommit(newSize, usage, writable, executable); 107 memcpy(newBase, oldBase, std::min(oldSize, newSize)); 108 decommitAndRelease(oldBase, oldSize); 109 return static_cast<T*>(newBase); 110 } 111 96 112 } // namespace WTF 97 113
Note: See TracChangeset
for help on using the changeset viewer.