summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbuzbee <buzbee@google.com>2014-11-25 20:09:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-25 20:09:03 +0000
commitf0c001465371279355eeb7633b67ffcc6f6738e5 (patch)
tree078cd0518627673566727494b003fa671c027dc8
parent79d43fd465a302252062b1d6dbd32c8a7d79f266 (diff)
parent6489d22a44ea7d135c142ee94925570d0333d5e7 (diff)
downloadart-f0c001465371279355eeb7633b67ffcc6f6738e5.zip
art-f0c001465371279355eeb7633b67ffcc6f6738e5.tar.gz
art-f0c001465371279355eeb7633b67ffcc6f6738e5.tar.bz2
Merge "Quick compiler: handle embedded switch data"
-rw-r--r--compiler/dex/mir_graph.cc3
-rw-r--r--test/800-smali/expected.txt1
-rw-r--r--test/800-smali/smali/PackedSwitch.smali26
-rw-r--r--test/800-smali/src/Main.java2
4 files changed, 31 insertions, 1 deletions
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index fdf01eb..023abca 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -765,8 +765,9 @@ void MIRGraph::InlineMethod(const DexFile::CodeItem* code_item, uint32_t access_
} else {
DCHECK(cur_block->fall_through == NullBasicBlockId);
DCHECK(cur_block->taken == NullBasicBlockId);
- // Unreachable instruction, mark for no continuation.
+ // Unreachable instruction, mark for no continuation and end basic block.
flags &= ~Instruction::kContinue;
+ FindBlock(current_offset_ + width, /* create */ true, /* immed_pred_block_p */ nullptr);
}
} else {
cur_block->AppendMIR(insn);
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt
index 7674a8a..7ec3168 100644
--- a/test/800-smali/expected.txt
+++ b/test/800-smali/expected.txt
@@ -1,3 +1,4 @@
+PackedSwitch
b/17790197
b/17978759
FloatBadArgReg
diff --git a/test/800-smali/smali/PackedSwitch.smali b/test/800-smali/smali/PackedSwitch.smali
new file mode 100644
index 0000000..6a3e5f0
--- /dev/null
+++ b/test/800-smali/smali/PackedSwitch.smali
@@ -0,0 +1,26 @@
+.class public LPackedSwitch;
+
+.super Ljava/lang/Object;
+
+.method public static packedSwitch(I)I
+ .registers 2
+
+ const/4 v0, 0
+ packed-switch v0, :switch_data
+ goto :default
+
+ :switch_data
+ .packed-switch 0x0
+ :case
+ .end packed-switch
+
+ :return
+ return v1
+
+ :default
+ goto :return
+
+ :case
+ goto :return
+
+.end method
diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java
index 8d318c3..abb53de 100644
--- a/test/800-smali/src/Main.java
+++ b/test/800-smali/src/Main.java
@@ -49,6 +49,8 @@ public class Main {
public Main() {
// Create the test cases.
testCases = new LinkedList<TestCase>();
+ testCases.add(new TestCase("PackedSwitch", "PackedSwitch", "packedSwitch",
+ new Object[]{123}, null, 123));
testCases.add(new TestCase("b/17790197", "B17790197", "getInt", null, null, 100));
testCases.add(new TestCase("b/17978759", "B17978759", "test", null, new VerifyError(), null));