2010-12-02 02:13:59 +00:00
|
|
|
/*
|
2018-02-16 21:38:53 +00:00
|
|
|
* Copyright (C) 2010 Apple Inc. All rights reserved.
|
2010-12-02 02:13:59 +00:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
|
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2018-10-15 14:24:49 +00:00
|
|
|
#pragma once
|
2010-12-02 02:13:59 +00:00
|
|
|
|
Implement a JIT-code aware sampling profiler for JSC
https://bugs.webkit.org/show_bug.cgi?id=76855
Reviewed by Oliver Hunt.
To enable the profiler, set the JSC_CODE_PROFILING environment variable to
1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively
trace all samples).
The profiler requires -fomit-frame-pointer to be removed from the build flags.
* JavaScriptCore.exp:
- Removed an export.
* JavaScriptCore.xcodeproj/project.pbxproj:
- Added new files
* bytecode/CodeBlock.cpp:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* bytecode/CodeBlock.h:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/JITStubs.cpp:
- If profiling, don't mask the return address in JIT code.
(We do so to provide nicer backtraces in debug builds).
* runtime/Completion.cpp:
(JSC::evaluate):
- Notify the profiler of script evaluations.
* tools: Added.
* tools/CodeProfile.cpp: Added.
(JSC::symbolName):
- Helper function to get the name of a symbol in the framework.
(JSC::truncateTrace):
- Helper to truncate traces into methods know to have uninformatively deep stacks.
(JSC::CodeProfile::sample):
- Record a stack trace classifying samples.
(JSC::CodeProfile::report):
- {Print profiler output.
* tools/CodeProfile.h: Added.
- new class, captures a set of samples associated with an evaluated script,
and nested to record samples from subscripts.
* tools/CodeProfiling.cpp: Added.
(JSC::CodeProfiling::profilingTimer):
- callback fired then a timer event occurs.
(JSC::CodeProfiling::notifyAllocator):
- called when the executable allocator is constructed.
(JSC::CodeProfiling::getOwnerUIDForPC):
- helper to lookup the codeblock from an address in JIT code
(JSC::CodeProfiling::begin):
- enter a profiling scope.
(JSC::CodeProfiling::end):
- exit a profiling scope.
* tools/CodeProfiling.h: Added.
- new class, instantialed from Completion to define a profiling scope.
* tools/ProfileTreeNode.h: Added.
- new class, used to construct a tree of samples.
* tools/TieredMMapArray.h: Added.
- new class, a malloc-free vector (can be used while the main thread is suspended,
possibly holding the malloc heap lock).
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocator::allocate):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocator.h:
(MetaAllocator):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocatorHandle.h:
(MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::ownerUID):
- Allow allocation handles to track information about their owner.
* wtf/OSAllocator.h:
(WTF::OSAllocator::reallocateCommitted):
- reallocate an existing, committed memory allocation.
Canonical link: https://commits.webkit.org/94168@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
|
|
|
#include <algorithm>
|
2010-12-22 00:04:31 +00:00
|
|
|
#include <wtf/VMTags.h>
|
2010-12-09 01:30:18 +00:00
|
|
|
|
2010-12-02 02:13:59 +00:00
|
|
|
namespace WTF {
|
|
|
|
|
|
|
|
class OSAllocator {
|
2019-08-12 20:57:15 +00:00
|
|
|
WTF_MAKE_FAST_ALLOCATED;
|
2010-12-02 02:13:59 +00:00
|
|
|
public:
|
2010-12-09 01:30:18 +00:00
|
|
|
enum Usage {
|
|
|
|
UnknownUsage = -1,
|
|
|
|
FastMallocPages = VM_TAG_FOR_TCMALLOC_MEMORY,
|
|
|
|
JSJITCodePages = VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY,
|
|
|
|
};
|
|
|
|
|
2010-12-21 23:53:25 +00:00
|
|
|
// These methods are symmetric; reserveUncommitted allocates VM in an uncommitted state,
|
|
|
|
// releaseDecommitted should be called on a region of VM allocated by a single reservation,
|
2018-02-01 05:36:40 +00:00
|
|
|
// the memory must all currently be in a decommitted state. reserveUncommitted returns to
|
|
|
|
// you memory that is zeroed.
|
2020-11-04 02:31:56 +00:00
|
|
|
WTF_EXPORT_PRIVATE static void* reserveUncommitted(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false, bool includesGuardPages = false);
|
2012-01-13 07:23:44 +00:00
|
|
|
WTF_EXPORT_PRIVATE static void releaseDecommitted(void*, size_t);
|
2010-12-09 01:30:18 +00:00
|
|
|
|
2010-12-21 23:56:22 +00:00
|
|
|
// These methods are symmetric; they commit or decommit a region of VM (uncommitted VM should
|
2010-12-21 23:53:25 +00:00
|
|
|
// never be accessed, since the OS may not have attached physical memory for these regions).
|
|
|
|
// Clients should only call commit on uncommitted regions and decommit on committed regions.
|
2013-05-31 00:38:15 +00:00
|
|
|
WTF_EXPORT_PRIVATE static void commit(void*, size_t, bool writable, bool executable);
|
|
|
|
WTF_EXPORT_PRIVATE static void decommit(void*, size_t);
|
2010-12-02 02:13:59 +00:00
|
|
|
|
2010-12-21 23:53:25 +00:00
|
|
|
// These methods are symmetric; reserveAndCommit allocates VM in an committed state,
|
|
|
|
// decommitAndRelease should be called on a region of VM allocated by a single reservation,
|
|
|
|
// the memory must all currently be in a committed state.
|
2020-11-04 02:31:56 +00:00
|
|
|
WTF_EXPORT_PRIVATE static void* reserveAndCommit(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false, bool includesGuardPages = false);
|
2013-05-31 01:07:10 +00:00
|
|
|
static void decommitAndRelease(void* base, size_t size);
|
2010-12-21 23:53:25 +00:00
|
|
|
|
|
|
|
// These methods are akin to reserveAndCommit/decommitAndRelease, above - however rather than
|
|
|
|
// committing/decommitting the entire region additional parameters allow a subregion to be
|
|
|
|
// specified.
|
2020-11-04 02:31:56 +00:00
|
|
|
WTF_EXPORT_PRIVATE static void* reserveAndCommit(size_t reserveSize, size_t commitSize, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false);
|
Implement a JIT-code aware sampling profiler for JSC
https://bugs.webkit.org/show_bug.cgi?id=76855
Reviewed by Oliver Hunt.
To enable the profiler, set the JSC_CODE_PROFILING environment variable to
1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively
trace all samples).
The profiler requires -fomit-frame-pointer to be removed from the build flags.
* JavaScriptCore.exp:
- Removed an export.
* JavaScriptCore.xcodeproj/project.pbxproj:
- Added new files
* bytecode/CodeBlock.cpp:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* bytecode/CodeBlock.h:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/JITStubs.cpp:
- If profiling, don't mask the return address in JIT code.
(We do so to provide nicer backtraces in debug builds).
* runtime/Completion.cpp:
(JSC::evaluate):
- Notify the profiler of script evaluations.
* tools: Added.
* tools/CodeProfile.cpp: Added.
(JSC::symbolName):
- Helper function to get the name of a symbol in the framework.
(JSC::truncateTrace):
- Helper to truncate traces into methods know to have uninformatively deep stacks.
(JSC::CodeProfile::sample):
- Record a stack trace classifying samples.
(JSC::CodeProfile::report):
- {Print profiler output.
* tools/CodeProfile.h: Added.
- new class, captures a set of samples associated with an evaluated script,
and nested to record samples from subscripts.
* tools/CodeProfiling.cpp: Added.
(JSC::CodeProfiling::profilingTimer):
- callback fired then a timer event occurs.
(JSC::CodeProfiling::notifyAllocator):
- called when the executable allocator is constructed.
(JSC::CodeProfiling::getOwnerUIDForPC):
- helper to lookup the codeblock from an address in JIT code
(JSC::CodeProfiling::begin):
- enter a profiling scope.
(JSC::CodeProfiling::end):
- exit a profiling scope.
* tools/CodeProfiling.h: Added.
- new class, instantialed from Completion to define a profiling scope.
* tools/ProfileTreeNode.h: Added.
- new class, used to construct a tree of samples.
* tools/TieredMMapArray.h: Added.
- new class, a malloc-free vector (can be used while the main thread is suspended,
possibly holding the malloc heap lock).
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocator::allocate):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocator.h:
(MetaAllocator):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocatorHandle.h:
(MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::ownerUID):
- Allow allocation handles to track information about their owner.
* wtf/OSAllocator.h:
(WTF::OSAllocator::reallocateCommitted):
- reallocate an existing, committed memory allocation.
Canonical link: https://commits.webkit.org/94168@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
|
|
|
|
|
|
|
// Reallocate an existing, committed allocation.
|
|
|
|
// The prior allocation must be fully comitted, and the new size will also be fully committed.
|
|
|
|
// This interface is provided since it may be possible to optimize this operation on some platforms.
|
|
|
|
template<typename T>
|
2020-11-04 02:31:56 +00:00
|
|
|
static T* reallocateCommitted(T*, size_t oldSize, size_t newSize, Usage = UnknownUsage, bool writable = true, bool executable = false, bool jitCageEnabled = false);
|
2015-12-17 02:55:02 +00:00
|
|
|
|
|
|
|
// Hint to the OS that an address range is not expected to be accessed anytime soon.
|
|
|
|
WTF_EXPORT_PRIVATE static void hintMemoryNotNeededSoon(void*, size_t);
|
2010-12-02 02:13:59 +00:00
|
|
|
};
|
|
|
|
|
2020-11-04 02:31:56 +00:00
|
|
|
inline void* OSAllocator::reserveAndCommit(size_t reserveSize, size_t commitSize, Usage usage, bool writable, bool executable, bool jitCageEnabled)
|
2010-12-21 23:53:25 +00:00
|
|
|
{
|
2020-11-04 02:31:56 +00:00
|
|
|
void* base = reserveUncommitted(reserveSize, usage, writable, executable, jitCageEnabled);
|
2010-12-21 23:53:25 +00:00
|
|
|
commit(base, commitSize, writable, executable);
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
|
2014-09-25 10:14:57 +00:00
|
|
|
inline void OSAllocator::decommitAndRelease(void* releaseBase, size_t releaseSize)
|
2010-12-21 23:53:25 +00:00
|
|
|
{
|
|
|
|
releaseDecommitted(releaseBase, releaseSize);
|
|
|
|
}
|
|
|
|
|
Implement a JIT-code aware sampling profiler for JSC
https://bugs.webkit.org/show_bug.cgi?id=76855
Reviewed by Oliver Hunt.
To enable the profiler, set the JSC_CODE_PROFILING environment variable to
1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively
trace all samples).
The profiler requires -fomit-frame-pointer to be removed from the build flags.
* JavaScriptCore.exp:
- Removed an export.
* JavaScriptCore.xcodeproj/project.pbxproj:
- Added new files
* bytecode/CodeBlock.cpp:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* bytecode/CodeBlock.h:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/JITStubs.cpp:
- If profiling, don't mask the return address in JIT code.
(We do so to provide nicer backtraces in debug builds).
* runtime/Completion.cpp:
(JSC::evaluate):
- Notify the profiler of script evaluations.
* tools: Added.
* tools/CodeProfile.cpp: Added.
(JSC::symbolName):
- Helper function to get the name of a symbol in the framework.
(JSC::truncateTrace):
- Helper to truncate traces into methods know to have uninformatively deep stacks.
(JSC::CodeProfile::sample):
- Record a stack trace classifying samples.
(JSC::CodeProfile::report):
- {Print profiler output.
* tools/CodeProfile.h: Added.
- new class, captures a set of samples associated with an evaluated script,
and nested to record samples from subscripts.
* tools/CodeProfiling.cpp: Added.
(JSC::CodeProfiling::profilingTimer):
- callback fired then a timer event occurs.
(JSC::CodeProfiling::notifyAllocator):
- called when the executable allocator is constructed.
(JSC::CodeProfiling::getOwnerUIDForPC):
- helper to lookup the codeblock from an address in JIT code
(JSC::CodeProfiling::begin):
- enter a profiling scope.
(JSC::CodeProfiling::end):
- exit a profiling scope.
* tools/CodeProfiling.h: Added.
- new class, instantialed from Completion to define a profiling scope.
* tools/ProfileTreeNode.h: Added.
- new class, used to construct a tree of samples.
* tools/TieredMMapArray.h: Added.
- new class, a malloc-free vector (can be used while the main thread is suspended,
possibly holding the malloc heap lock).
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocator::allocate):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocator.h:
(MetaAllocator):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocatorHandle.h:
(MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::ownerUID):
- Allow allocation handles to track information about their owner.
* wtf/OSAllocator.h:
(WTF::OSAllocator::reallocateCommitted):
- reallocate an existing, committed memory allocation.
Canonical link: https://commits.webkit.org/94168@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
|
|
|
template<typename T>
|
2020-11-04 02:31:56 +00:00
|
|
|
inline T* OSAllocator::reallocateCommitted(T* oldBase, size_t oldSize, size_t newSize, Usage usage, bool writable, bool executable, bool jitCageEnabled)
|
Implement a JIT-code aware sampling profiler for JSC
https://bugs.webkit.org/show_bug.cgi?id=76855
Reviewed by Oliver Hunt.
To enable the profiler, set the JSC_CODE_PROFILING environment variable to
1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively
trace all samples).
The profiler requires -fomit-frame-pointer to be removed from the build flags.
* JavaScriptCore.exp:
- Removed an export.
* JavaScriptCore.xcodeproj/project.pbxproj:
- Added new files
* bytecode/CodeBlock.cpp:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* bytecode/CodeBlock.h:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/JITStubs.cpp:
- If profiling, don't mask the return address in JIT code.
(We do so to provide nicer backtraces in debug builds).
* runtime/Completion.cpp:
(JSC::evaluate):
- Notify the profiler of script evaluations.
* tools: Added.
* tools/CodeProfile.cpp: Added.
(JSC::symbolName):
- Helper function to get the name of a symbol in the framework.
(JSC::truncateTrace):
- Helper to truncate traces into methods know to have uninformatively deep stacks.
(JSC::CodeProfile::sample):
- Record a stack trace classifying samples.
(JSC::CodeProfile::report):
- {Print profiler output.
* tools/CodeProfile.h: Added.
- new class, captures a set of samples associated with an evaluated script,
and nested to record samples from subscripts.
* tools/CodeProfiling.cpp: Added.
(JSC::CodeProfiling::profilingTimer):
- callback fired then a timer event occurs.
(JSC::CodeProfiling::notifyAllocator):
- called when the executable allocator is constructed.
(JSC::CodeProfiling::getOwnerUIDForPC):
- helper to lookup the codeblock from an address in JIT code
(JSC::CodeProfiling::begin):
- enter a profiling scope.
(JSC::CodeProfiling::end):
- exit a profiling scope.
* tools/CodeProfiling.h: Added.
- new class, instantialed from Completion to define a profiling scope.
* tools/ProfileTreeNode.h: Added.
- new class, used to construct a tree of samples.
* tools/TieredMMapArray.h: Added.
- new class, a malloc-free vector (can be used while the main thread is suspended,
possibly holding the malloc heap lock).
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocator::allocate):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocator.h:
(MetaAllocator):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocatorHandle.h:
(MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::ownerUID):
- Allow allocation handles to track information about their owner.
* wtf/OSAllocator.h:
(WTF::OSAllocator::reallocateCommitted):
- reallocate an existing, committed memory allocation.
Canonical link: https://commits.webkit.org/94168@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
|
|
|
{
|
2020-11-04 02:31:56 +00:00
|
|
|
void* newBase = reserveAndCommit(newSize, usage, writable, executable, jitCageEnabled);
|
2018-02-16 21:38:53 +00:00
|
|
|
memcpy(newBase, oldBase, std::min(oldSize, newSize));
|
Implement a JIT-code aware sampling profiler for JSC
https://bugs.webkit.org/show_bug.cgi?id=76855
Reviewed by Oliver Hunt.
To enable the profiler, set the JSC_CODE_PROFILING environment variable to
1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively
trace all samples).
The profiler requires -fomit-frame-pointer to be removed from the build flags.
* JavaScriptCore.exp:
- Removed an export.
* JavaScriptCore.xcodeproj/project.pbxproj:
- Added new files
* bytecode/CodeBlock.cpp:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* bytecode/CodeBlock.h:
- For baseline codeblocks, cache the result of canCompileWithDFG.
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
- Notify the profiler when the allocator is created.
(JSC::ExecutableAllocator::allocate):
- Inform the allocated of the ownerUID.
* jit/JITStubs.cpp:
- If profiling, don't mask the return address in JIT code.
(We do so to provide nicer backtraces in debug builds).
* runtime/Completion.cpp:
(JSC::evaluate):
- Notify the profiler of script evaluations.
* tools: Added.
* tools/CodeProfile.cpp: Added.
(JSC::symbolName):
- Helper function to get the name of a symbol in the framework.
(JSC::truncateTrace):
- Helper to truncate traces into methods know to have uninformatively deep stacks.
(JSC::CodeProfile::sample):
- Record a stack trace classifying samples.
(JSC::CodeProfile::report):
- {Print profiler output.
* tools/CodeProfile.h: Added.
- new class, captures a set of samples associated with an evaluated script,
and nested to record samples from subscripts.
* tools/CodeProfiling.cpp: Added.
(JSC::CodeProfiling::profilingTimer):
- callback fired then a timer event occurs.
(JSC::CodeProfiling::notifyAllocator):
- called when the executable allocator is constructed.
(JSC::CodeProfiling::getOwnerUIDForPC):
- helper to lookup the codeblock from an address in JIT code
(JSC::CodeProfiling::begin):
- enter a profiling scope.
(JSC::CodeProfiling::end):
- exit a profiling scope.
* tools/CodeProfiling.h: Added.
- new class, instantialed from Completion to define a profiling scope.
* tools/ProfileTreeNode.h: Added.
- new class, used to construct a tree of samples.
* tools/TieredMMapArray.h: Added.
- new class, a malloc-free vector (can be used while the main thread is suspended,
possibly holding the malloc heap lock).
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocator::allocate):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocator.h:
(MetaAllocator):
- Allow allocation handles to track information about their owner.
* wtf/MetaAllocatorHandle.h:
(MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::ownerUID):
- Allow allocation handles to track information about their owner.
* wtf/OSAllocator.h:
(WTF::OSAllocator::reallocateCommitted):
- reallocate an existing, committed memory allocation.
Canonical link: https://commits.webkit.org/94168@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-29 03:47:13 +00:00
|
|
|
decommitAndRelease(oldBase, oldSize);
|
|
|
|
return static_cast<T*>(newBase);
|
|
|
|
}
|
|
|
|
|
2010-12-02 02:13:59 +00:00
|
|
|
} // namespace WTF
|
|
|
|
|
|
|
|
using WTF::OSAllocator;
|