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/object.h b/src/object.h
index e746f73..03aadda 100644
--- a/src/object.h
+++ b/src/object.h
@@ -682,7 +682,12 @@
if (code == 0) {
return pc == 0;
}
- return (code <= pc && pc < code + GetCodeSize());
+ /*
+ * During a stack walk, a return PC may point to the end of the code + 1
+ * (in the case that the last instruction is a call that isn't expected to
+ * return. Thus, we check <= code + GetCodeSize().
+ */
+ return (code <= pc && pc <= code + GetCodeSize());
}
void AssertPcIsWithinCode(uintptr_t pc) const