diff options
author | Vladimir Marko <vmarko@google.com> | 2014-01-02 16:40:37 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-03-18 16:16:16 +0000 |
commit | 9820b7c1dc70e75ad405b9e6e63578fa9fe94e94 (patch) | |
tree | 2fff53b061b16d758870a2a5299a383bdbe550b6 /compiler/dex/bb_optimizations.h | |
parent | 80f9d0c48d6f8561700630b8b08adb4398d61008 (diff) | |
download | art-9820b7c1dc70e75ad405b9e6e63578fa9fe94e94.zip art-9820b7c1dc70e75ad405b9e6e63578fa9fe94e94.tar.gz art-9820b7c1dc70e75ad405b9e6e63578fa9fe94e94.tar.bz2 |
Early inlining of simple methods.
Inlining "special" methods: empty methods, methods returning
constants or their arguments, simple getters and setters.
Bug: 8164439
Change-Id: I8c7fa9c14351fbb2470000b378a22974daaef236
Diffstat (limited to 'compiler/dex/bb_optimizations.h')
-rw-r--r-- | compiler/dex/bb_optimizations.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/compiler/dex/bb_optimizations.h b/compiler/dex/bb_optimizations.h index fb482bf..6d500a5 100644 --- a/compiler/dex/bb_optimizations.h +++ b/compiler/dex/bb_optimizations.h @@ -59,6 +59,34 @@ class CacheMethodLoweringInfo : public Pass { }; /** + * @class CallInlining + * @brief Perform method inlining pass. + */ +class CallInlining : public Pass { + public: + CallInlining() : Pass("CallInlining") { + } + + bool Gate(const CompilationUnit* cUnit) const { + return cUnit->mir_graph->InlineCallsGate(); + } + + void Start(CompilationUnit* cUnit) const { + cUnit->mir_graph->InlineCallsStart(); + } + + bool WalkBasicBlocks(CompilationUnit* cUnit, BasicBlock* bb) const { + cUnit->mir_graph->InlineCalls(bb); + // No need of repeating, so just return false. + return false; + } + + void End(CompilationUnit* cUnit) const { + cUnit->mir_graph->InlineCallsEnd(); + } +}; + +/** * @class CodeLayout * @brief Perform the code layout pass. */ |