diff options
author | Andreas Gampe <agampe@google.com> | 2014-12-04 09:09:57 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-12-04 15:58:34 -0800 |
commit | e4d4d323aa42506351b03e842818e9ec09ea6c37 (patch) | |
tree | 5df6c117bc518a8c4db6777b89b5dfd23a53ed88 /compiler/optimizing/builder.h | |
parent | 7c8ce29e97fb7873160ab8895d847e9643a1f8f6 (diff) | |
download | art-e4d4d323aa42506351b03e842818e9ec09ea6c37.tar.gz art-e4d4d323aa42506351b03e842818e9ec09ea6c37.tar.bz2 art-e4d4d323aa42506351b03e842818e9ec09ea6c37.zip |
ART: Add SparseSwitch support to the optimizing compiler
Add simple sparse-switch support through chained IFs. Refactor a
bit to better reuse code between switch types.
Now enables compiled versions of 015-switch and 095-switch-MAX_INT.
Bug: 18410979
Change-Id: Ib617e4b877f0b7fbc3bb289800f612f013480713
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r-- | compiler/optimizing/builder.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index e4e370582..73c2f5095 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -29,6 +29,7 @@ namespace art { class Instruction; +class SwitchTable; class HGraphBuilder : public ValueObject { public: @@ -203,10 +204,17 @@ class HGraphBuilder : public ValueObject { uint16_t type_index, uint32_t dex_pc); - // Builds an instruction sequence for a packed switch statement. This will punt to the interpreter - // for a switch with a full 64k set of cases. + // Builds an instruction sequence for a packed switch statement. bool BuildPackedSwitch(const Instruction& instruction, uint32_t dex_pc); + // Builds an instruction sequence for a sparse switch statement. + bool BuildSparseSwitch(const Instruction& instruction, uint32_t dex_pc); + + void BuildSwitchCaseHelper(const Instruction& instruction, size_t index, + bool is_last_case, const SwitchTable& table, + HInstruction* value, int32_t case_value_int, + int32_t target_offset, uint32_t dex_pc); + ArenaAllocator* const arena_; // A list of the size of the dex code holding block information for |