aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Expression/Materializer.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2013-04-27 02:19:33 +0000
committerSean Callanan <scallanan@apple.com>2013-04-27 02:19:33 +0000
commitdf56540a58271deae8b0da7ccd11141f73bd0e84 (patch)
tree005507236d499afe698cbf5eb2b36e4312f89fa9 /lldb/source/Expression/Materializer.cpp
parent956dca92888ebb3f770307d16f563c0e47cc0a39 (diff)
downloadllvm-df56540a58271deae8b0da7ccd11141f73bd0e84.zip
llvm-df56540a58271deae8b0da7ccd11141f73bd0e84.tar.gz
llvm-df56540a58271deae8b0da7ccd11141f73bd0e84.tar.bz2
Performance optimizations to ClangUserExpression,
mostly related to management of the stack frame for the interpreter. - First, if the expression can be interpreted, allocate the stack frame in the target process (to make sure pointers are valid) but only read/write to the copy in the host's memory. - Second, keep the memory allocations for the stack frame and the materialized struct as member variables of ClangUserExpression. This avoids memory allocations and deallocations each time the expression runs. <rdar://problem/13043685> llvm-svn: 180664
Diffstat (limited to 'lldb/source/Expression/Materializer.cpp')
-rw-r--r--lldb/source/Expression/Materializer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp
index af941d8..20ccc1f 100644
--- a/lldb/source/Expression/Materializer.cpp
+++ b/lldb/source/Expression/Materializer.cpp
@@ -822,7 +822,7 @@ public:
lldb::ProcessSP process_sp = map.GetBestExecutionContextScope()->CalculateProcess();
- bool can_persist = (process_sp && process_sp->CanJIT());
+ bool can_persist = (m_is_program_reference && process_sp && process_sp->CanJIT() && !(address >= frame_bottom && address < frame_top));
if (can_persist && m_keep_in_memory)
{
@@ -1316,7 +1316,7 @@ Materializer::Materialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map, lldb:
}
void
-Materializer::Dematerializer::Dematerialize (Error &error, lldb::ClangExpressionVariableSP &result_sp, lldb::addr_t frame_top, lldb::addr_t frame_bottom)
+Materializer::Dematerializer::Dematerialize (Error &error, lldb::ClangExpressionVariableSP &result_sp, lldb::addr_t frame_bottom, lldb::addr_t frame_top)
{
lldb::StackFrameSP frame_sp = m_frame_wp.lock();