Prune useless entries from dex to pc map
Step one of the change. Limit entries in the table to native
code safepoint locations (which generally are the return PC
addresses of any call that might trigger a stack walk and the
start addresses of all catch blocks).
Previously, the mapping_table described ranges. No longer. Any
native PC located within compiled Dex code that is found in a
stack walk should have an exact match in the table.
In future CLs we'll add data compression (probably uLeb128) and
may add inflation on first use to a faster access map (instead of
the current linear search).
Note that this CL introduces somewhat of a regression in the
capabilities of oat-dump. Because the mapping table no longer
associates each native intruction with its Dex counter-part, the
native code disassembly no longer includes interspersed Dex
disassembly.
Note also that as of this CL, the compiler is adopting the 100-char
line length limit used in the rest of Art. The 80-char limit
should still be used in any code that we expect to upstream to
llvm.
Change-Id: I1beca4d57c41e8161bf746bc62abbce08d5bcb4d
diff --git a/src/exception_test.cc b/src/exception_test.cc
index 37788df..bd792f7 100644
--- a/src/exception_test.cc
+++ b/src/exception_test.cc
@@ -136,8 +136,7 @@
fake_stack.push_back(reinterpret_cast<uintptr_t>(method_g_));
fake_stack.push_back(0);
fake_stack.push_back(0);
- // We add 2 to the native pc since the stack walker always subtracts two from a return pc.
- fake_stack.push_back(method_f_->ToNativePC(dex_pc) + 2); // return pc
+ fake_stack.push_back(method_f_->ToNativePC(dex_pc)); // return pc
// Create/push fake 16byte stack frame for method f
fake_stack.push_back(reinterpret_cast<uintptr_t>(method_f_));
@@ -154,7 +153,7 @@
fake_stack.push_back(0);
// Set up thread to appear as if we called out of method_g_ at pc dex 3
- thread->SetTopOfStack(&fake_stack[0], method_g_->ToNativePC(dex_pc) + 2); // return pc
+ thread->SetTopOfStack(&fake_stack[0], method_g_->ToNativePC(dex_pc)); // return pc
#else
// Create/push fake 20-byte shadow frame for method g
fake_stack.push_back(0);