From 3e18738bd338e9f8363b26bc895f38c0ec682824 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 26 Jun 2015 09:59:52 +0000 Subject: Revert "ART: Implement try/catch blocks in Builder" Causes OutOfMemory issues, need to investigate. This reverts commit 0b5c7d1994b76090afcc825e737f2b8c546da2f8. Change-Id: I263e6cc4df5f9a56ad2ce44e18932ca51d7e349f --- test/510-checker-try-catch/smali/Builder.smali | 914 ------------------------- 1 file changed, 914 deletions(-) delete mode 100644 test/510-checker-try-catch/smali/Builder.smali (limited to 'test/510-checker-try-catch/smali') diff --git a/test/510-checker-try-catch/smali/Builder.smali b/test/510-checker-try-catch/smali/Builder.smali deleted file mode 100644 index a388aa1984..0000000000 --- a/test/510-checker-try-catch/smali/Builder.smali +++ /dev/null @@ -1,914 +0,0 @@ -# Copyright (C) 2015 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -.class public LBuilder; - -.super Ljava/lang/Object; - -# Basic test case with two try blocks and three catch handlers, one of which -# is shared by the two tries. - -## CHECK-START: int Builder.testMultipleTryCatch(int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" -## CHECK: <> IntConstant -1 -## CHECK: <> IntConstant -2 -## CHECK: <> IntConstant -3 - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: DivZeroCheck - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Add - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: DivZeroCheck - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" "<>" -## CHECK: Return - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testMultipleTryCatch(III)I - .registers 3 - - :try_start_1 - div-int/2addr p0, p1 - :try_end_1 - .catch Ljava/lang/ArithmeticException; {:try_start_1 .. :try_end_1} :catch_arith - .catchall {:try_start_1 .. :try_end_1} :catch_other - - add-int/2addr p0, p0 - - :try_start_2 - div-int/2addr p0, p2 - :try_end_2 - .catch Ljava/lang/OutOfMemoryError; {:try_start_2 .. :try_end_2} :catch_mem - .catchall {:try_start_2 .. :try_end_2} :catch_other - - :return - return p0 - - :catch_arith - const/4 p0, -0x1 - goto :return - - :catch_mem - const/4 p0, -0x2 - goto :return - - :catch_other - const/4 p0, -0x3 - goto :return -.end method - -# Test that multiple try-entry blocks are generated if there are multiple entry -# points into the try block. - -## CHECK-START: int Builder.testMultipleEntries(int, int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" -## CHECK: <> IntConstant -1 - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" "<>" -## CHECK: If - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: Return - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testMultipleEntries(IIII)I - .registers 4 - - if-eqz p2, :else - - div-int/2addr p0, p1 - - :try_start - div-int/2addr p0, p2 - - :else - div-int/2addr p0, p3 - :try_end - .catchall {:try_start .. :try_end} :catch_all - - :return - return p0 - - :catch_all - const/4 p0, -0x1 - goto :return - -.end method - -# Test that multiple try-exit blocks are generated if (normal) control flow can -# jump out of the try block at multiple points. - -## CHECK-START: int Builder.testMultipleExits(int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" -## CHECK: <> IntConstant -1 -## CHECK: <> IntConstant -2 - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" "<>" -## CHECK: Div -## CHECK: If - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: Return - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testMultipleExits(II)I - .registers 2 - - :try_start - div-int/2addr p0, p1 - if-eqz p0, :then - :try_end - .catchall {:try_start .. :try_end} :catch_all - - :return - return p0 - - :then - const/4 p0, -0x1 - goto :return - - :catch_all - const/4 p0, -0x2 - goto :return -.end method - -# Test that only one TryBoundary is inserted when an edge connects two different -# try ranges. - -## CHECK-START: int Builder.testSharedBoundary(int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" -## CHECK: <> IntConstant -1 -## CHECK: <> IntConstant -2 - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: Return - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testSharedBoundary(III)I - .registers 3 - - :try_start_1 - div-int/2addr p0, p1 - :try_end_1 - .catchall {:try_start_1 .. :try_end_1} :catch_all_1 - - :try_start_2 - div-int/2addr p0, p2 - :try_end_2 - .catchall {:try_start_2 .. :try_end_2} :catch_all_2 - - :return - return p0 - - :catch_all_1 - const/4 p0, -0x1 - goto :return - - :catch_all_2 - const/4 p0, -0x2 - goto :return -.end method - -# Same as previous test, only the blocks are processed in the opposite order. - -## CHECK-START: int Builder.testSharedBoundary_Reverse(int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" -## CHECK: <> IntConstant -1 -## CHECK: <> IntConstant -2 - -## CHECK: name "<>" -## CHECK: successors "<>" -## CHECK: Goto - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: Return - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -.method public static testSharedBoundary_Reverse(III)I - .registers 3 - - goto :try_start_2 - - :try_start_1 - div-int/2addr p0, p1 - goto :return - :try_end_1 - .catchall {:try_start_1 .. :try_end_1} :catch_all_1 - - :try_start_2 - div-int/2addr p0, p2 - goto :try_start_1 - :try_end_2 - .catchall {:try_start_2 .. :try_end_2} :catch_all_2 - - :return - return p0 - - :catch_all_1 - const/4 p0, -0x1 - goto :return - - :catch_all_2 - const/4 p0, -0x2 - goto :return -.end method - -# Test that nested tries are split into non-overlapping blocks and TryBoundary -# blocks are correctly created between them. - -## CHECK-START: int Builder.testNestedTry(int, int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: <> IntConstant -1 -## CHECK: <> IntConstant -2 - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testNestedTry(IIII)I - .registers 4 - - :try_start_1 - div-int/2addr p0, p1 - - :try_start_2 - div-int/2addr p0, p2 - :try_end_2 - .catch Ljava/lang/ArithmeticException; {:try_start_2 .. :try_end_2} :catch_arith - - div-int/2addr p0, p3 - :try_end_1 - .catchall {:try_start_1 .. :try_end_1} :catch_all - - :return - return p0 - - :catch_arith - const/4 p0, -0x1 - goto :return - - :catch_all - const/4 p0, -0x2 - goto :return -.end method - -# Test control flow that enters a try block, leaves it and returns again. - -## CHECK-START: int Builder.testIncontinuousTry(int, int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: <> IntConstant -1 - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testIncontinuousTry(IIII)I - .registers 4 - - :try_start - div-int/2addr p0, p1 - goto :outside - - :inside - div-int/2addr p0, p3 - :try_end - .catchall {:try_start .. :try_end} :catch_all - - :return - return p0 - - :outside - div-int/2addr p0, p2 - goto :inside - - :catch_all - const/4 p0, -0x1 - goto :return -.end method - -# Test that a TryBoundary is inserted between a Throw instruction and the exit -# block when covered by a try range. - -## CHECK-START: int Builder.testThrow(java.lang.Exception) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" -## CHECK: <> IntConstant -1 - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Throw - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: StoreLocal [v0,<>] - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" -## CHECK: Exit - -.method public static testThrow(Ljava/lang/Exception;)I - .registers 2 - - :try_start - throw p0 - :try_end - .catchall {:try_start .. :try_end} :catch_all - - :catch_all - const/4 v0, -0x1 - return v0 -.end method - -# Test graph with a throw/catch loop. - -## CHECK-START: int Builder.testCatchLoop(int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testCatchLoop(III)I - .registers 4 - - :try_start - :catch_all - div-int/2addr p0, p2 - :try_end - .catchall {:try_start .. :try_end} :catch_all - - :return - return p0 -.end method - -# Test that handler edges are not split. In this scenario, the catch block is -# only the handler of the try block. - -## CHECK-START: int Builder.testHandlerEdge1(int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testHandlerEdge1(III)I - .registers 4 - - :try_start - div-int/2addr p0, p1 - - :catch_all - div-int/2addr p0, p2 - :try_end - .catchall {:try_start .. :try_end} :catch_all - - return p0 -.end method - -# Test that handler edges are not split. In this scenario, the catch block is -# the handler and also the successor of the try block. - -## CHECK-START: int Builder.testHandlerEdge2(int, int, int) builder (after) - -## CHECK: name "B0" -## CHECK: successors "<>" - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" "<>" "<>" -## CHECK: successors "<>" -## CHECK: flags "catch_block" -## CHECK: Div - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: Return - -## CHECK: name "<>" -## CHECK: predecessors "B0" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:true is_exit:false - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" "<>" -## CHECK: TryBoundary is_entry:true is_exit:true - -## CHECK: name "<>" -## CHECK: predecessors "<>" -## CHECK: successors "<>" -## CHECK: xhandlers "<>" -## CHECK: TryBoundary is_entry:false is_exit:true - -.method public static testHandlerEdge2(III)I - .registers 4 - - :try_start_1 - :catch_all_1 - div-int/2addr p0, p1 - :try_end_1 - .catchall {:try_start_1 .. :try_end_1} :catch_all_2 - - :try_start_2 - :catch_all_2 - div-int/2addr p0, p2 - :try_end_2 - .catchall {:try_start_2 .. :try_end_2} :catch_all_1 - - return p0 -.end method - -# Test that a MOVE_RESULT instruction is placed into the same block as the -# INVOKE it follows, even if there is a try boundary between them. - -## CHECK-START: int Builder.testMoveResult_Invoke(int, int, int) builder (after) - -## CHECK: <> InvokeStaticOrDirect -## CHECK-NEXT: StoreLocal [v0,<>] - -.method public static testMoveResult_Invoke(III)I - .registers 3 - - :try_start - invoke-static {p0, p1, p2}, LBuilder;->testCatchLoop(III)I - :try_end - .catchall {:try_start .. :try_end} :catch_all - - move-result p0 - - :return - return p0 - - :catch_all - const/4 p0, -0x1 - goto :return -.end method - -# Test that a MOVE_RESULT instruction is placed into the same block as the -# FILLED_NEW_ARRAY it follows, even if there is a try boundary between them. - -## CHECK-START: int[] Builder.testMoveResult_FilledNewArray(int, int, int) builder (after) - -## CHECK: <> NewArray -## CHECK-NEXT: Temporary -## CHECK-NEXT: StoreLocal [v0,<>] -## CHECK: ArraySet [<>,{{i\d+}},{{i\d+}}] -## CHECK: ArraySet [<>,{{i\d+}},{{i\d+}}] -## CHECK: ArraySet [<>,{{i\d+}},{{i\d+}}] - -.method public static testMoveResult_FilledNewArray(III)[I - .registers 3 - - :try_start - filled-new-array {p0, p1, p2}, [I - :try_end - .catchall {:try_start .. :try_end} :catch_all - - move-result-object p0 - - :return - return-object p0 - - :catch_all - const/4 p0, 0x0 - goto :return -.end method - -# Test case for ReturnVoid inside a try block. Builder needs to move it outside -# the try block so as to not split the ReturnVoid-Exit edge. -# This invariant is enforced by GraphChecker. - -.method public static testReturnVoidInTry(II)V - .registers 2 - - :catch_all - :try_start - return-void - :try_end - .catchall {:try_start .. :try_end} :catch_all - -.end method - -# Test case for Return inside a try block. Builder needs to move it outside the -# try block so as to not split the Return-Exit edge. -# This invariant is enforced by GraphChecker. - -.method public static testReturnInTry(II)I - .registers 2 - - :try_start - div-int/2addr p0, p1 - return p0 - :try_end - .catchall {:try_start .. :try_end} :catch_all - - :catch_all - const/4 v0, 0x0 - return v0 -.end method - -# Test a (dead) try block which flows out of the method. The block will be -# removed by DCE but needs to pass post-builder GraphChecker. - -## CHECK-START: int Builder.testDeadEndTry(int) builder (after) -## CHECK-NOT: TryBoundary is_exit:true - -.method public static testDeadEndTry(I)I - .registers 1 - - return p0 - - :catch_all - nop - - :try_start - nop - :try_end - .catchall {:try_start .. :try_end} :catch_all -.end method -- cgit v1.2.3