diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-24 18:10:46 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-25 12:23:40 +0100 |
commit | 3c04974a90b0e03f4b509010bff49f0b2a3da57f (patch) | |
tree | 52649104e3e80272c3774793350f4d9f260ae732 /compiler/optimizing/builder.cc | |
parent | c0d36abb12cdbb9469039c1dc153a586bd984015 (diff) | |
download | art-3c04974a90b0e03f4b509010bff49f0b2a3da57f.tar.gz art-3c04974a90b0e03f4b509010bff49f0b2a3da57f.tar.bz2 art-3c04974a90b0e03f4b509010bff49f0b2a3da57f.zip |
Optimize suspend checks in optimizing compiler.
- Remove the ones added during graph build (they were added
for the baseline code generator).
- Emit them at loop back edges after phi moves, so that the test
can directly jump to the loop header.
- Fix x86 and x86_64 suspend check by using cmpw instead of cmpl.
Change-Id: I6fad5795a55705d86c9e1cb85bf5d63dadfafa2a
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 33b00d2ac9..5015bd06d9 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -183,9 +183,9 @@ HGraph* HGraphBuilder::BuildGraph(const DexFile::CodeItem& code_item) { // Setup the graph with the entry block and exit block. graph_ = new (arena_) HGraph(arena_); - entry_block_ = new (arena_) HBasicBlock(graph_); + entry_block_ = new (arena_) HBasicBlock(graph_, 0); graph_->AddBlock(entry_block_); - exit_block_ = new (arena_) HBasicBlock(graph_); + exit_block_ = new (arena_) HBasicBlock(graph_, kNoDexPc); graph_->SetEntryBlock(entry_block_); graph_->SetExitBlock(exit_block_); @@ -241,7 +241,7 @@ void HGraphBuilder::ComputeBranchTargets(const uint16_t* code_ptr, const uint16_ branch_targets_.SetSize(code_end - code_ptr); // Create the first block for the dex instructions, single successor of the entry block. - HBasicBlock* block = new (arena_) HBasicBlock(graph_); + HBasicBlock* block = new (arena_) HBasicBlock(graph_, 0); branch_targets_.Put(0, block); entry_block_->AddSuccessor(block); @@ -254,13 +254,13 @@ void HGraphBuilder::ComputeBranchTargets(const uint16_t* code_ptr, const uint16_ int32_t target = instruction.GetTargetOffset() + dex_offset; // Create a block for the target instruction. if (FindBlockStartingAt(target) == nullptr) { - block = new (arena_) HBasicBlock(graph_); + block = new (arena_) HBasicBlock(graph_, target); branch_targets_.Put(target, block); } dex_offset += instruction.SizeInCodeUnits(); code_ptr += instruction.SizeInCodeUnits(); if ((code_ptr < code_end) && (FindBlockStartingAt(dex_offset) == nullptr)) { - block = new (arena_) HBasicBlock(graph_); + block = new (arena_) HBasicBlock(graph_, dex_offset); branch_targets_.Put(dex_offset, block); } } else { |