summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-12-12 21:41:29 -0800
committerAndreas Gampe <agampe@google.com>2014-12-15 10:27:32 -0800
commit8683038c1f59bea790d8c7691e40eed7f6250e4a (patch)
tree63f168876ecb6b8416082cbc141da1d478a66988
parent29045735a55726235e5c2c5156809cdcac61d4d7 (diff)
downloadart-8683038c1f59bea790d8c7691e40eed7f6250e4a.zip
art-8683038c1f59bea790d8c7691e40eed7f6250e4a.tar.gz
art-8683038c1f59bea790d8c7691e40eed7f6250e4a.tar.bz2
ART: Do not inline elf writer debug symbols
Using Clang, this pushes the frame size of the caller across our limit. Thus forbid inlining. The function is only called once per compile, impact is insignificant. Bug: 18738594 Change-Id: I19c3f1168a5104ab508a8dbf9f2a8c035cb97e3c
-rw-r--r--compiler/elf_writer_quick.cc2
-rw-r--r--disassembler/disassembler_x86.cc4
-rw-r--r--runtime/base/macros.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/compiler/elf_writer_quick.cc b/compiler/elf_writer_quick.cc
index 25cf086..d651c0f 100644
--- a/compiler/elf_writer_quick.cc
+++ b/compiler/elf_writer_quick.cc
@@ -669,6 +669,8 @@ static void FillInCFIInformation(OatWriter* oat_writer,
template <typename Elf_Word, typename Elf_Sword, typename Elf_Addr,
typename Elf_Dyn, typename Elf_Sym, typename Elf_Ehdr,
typename Elf_Phdr, typename Elf_Shdr>
+// Do not inline to avoid Clang stack frame problems. b/18738594
+NO_INLINE
static void WriteDebugSymbols(const CompilerDriver* compiler_driver,
ElfBuilder<Elf_Word, Elf_Sword, Elf_Addr, Elf_Dyn,
Elf_Sym, Elf_Ehdr, Elf_Phdr, Elf_Shdr>* builder,
diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc
index ba72707..b58f5fa 100644
--- a/disassembler/disassembler_x86.cc
+++ b/disassembler/disassembler_x86.cc
@@ -154,8 +154,8 @@ static void DumpSegmentOverride(std::ostream& os, uint8_t segment_prefix) {
}
// Do not inline to avoid Clang stack frame problems. b/18733806
-static std::string __attribute__((noinline)) DumpCodeHex(const uint8_t* begin,
- const uint8_t* end) {
+NO_INLINE
+static std::string DumpCodeHex(const uint8_t* begin, const uint8_t* end) {
std::stringstream hex;
for (size_t i = 0; begin + i < end; ++i) {
hex << StringPrintf("%02X", begin[i]);
diff --git a/runtime/base/macros.h b/runtime/base/macros.h
index 66d6fab..f705469 100644
--- a/runtime/base/macros.h
+++ b/runtime/base/macros.h
@@ -158,6 +158,8 @@ char (&ArraySizeHelper(T (&array)[N]))[N];
#define ALWAYS_INLINE_LAMBDA ALWAYS_INLINE
#endif
+#define NO_INLINE __attribute__ ((noinline))
+
#if defined (__APPLE__)
#define HOT_ATTR
#define COLD_ATTR