Home | History | Annotate | Download | only in smali
      1 # Copyright (C) 2016 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 .class public LSmaliTests;
     16 .super Ljava/lang/Object;
     17 
     18 ## CHECK-START: void SmaliTests.testInstanceOf_EQ0_NotInlined(java.lang.Object) builder (after)
     19 ## CHECK-DAG:     <<Cst0:i\d+>> IntConstant 0
     20 ## CHECK-DAG:     <<IOf:z\d+>>  InstanceOf
     21 ## CHECK-DAG:                   Equal [<<IOf>>,<<Cst0>>]
     22 
     23 ## CHECK-START: void SmaliTests.testInstanceOf_EQ0_NotInlined(java.lang.Object) instruction_simplifier (before)
     24 ## CHECK:         CheckCast
     25 
     26 ## CHECK-START: void SmaliTests.testInstanceOf_EQ0_NotInlined(java.lang.Object) instruction_simplifier (after)
     27 ## CHECK-NOT:     CheckCast
     28 
     29 .method public static testInstanceOf_EQ0_NotInlined(Ljava/lang/Object;)V
     30   .registers 3
     31 
     32   const v0, 0x0
     33   instance-of v1, p0, LSubclassC;
     34   if-eq v1, v0, :return
     35 
     36   check-cast p0, LSubclassC;
     37   invoke-virtual {p0}, LSubclassC;->$noinline$g()V
     38 
     39   :return
     40   return-void
     41 
     42 .end method
     43 
     44 ## CHECK-START: void SmaliTests.testInstanceOf_EQ1_NotInlined(java.lang.Object) builder (after)
     45 ## CHECK-DAG:     <<Cst1:i\d+>> IntConstant 1
     46 ## CHECK-DAG:     <<IOf:z\d+>>  InstanceOf
     47 ## CHECK-DAG:                   Equal [<<IOf>>,<<Cst1>>]
     48 
     49 ## CHECK-START: void SmaliTests.testInstanceOf_EQ1_NotInlined(java.lang.Object) instruction_simplifier (before)
     50 ## CHECK:         CheckCast
     51 
     52 ## CHECK-START: void SmaliTests.testInstanceOf_EQ1_NotInlined(java.lang.Object) instruction_simplifier (after)
     53 ## CHECK-NOT:     CheckCast
     54 
     55 .method public static testInstanceOf_EQ1_NotInlined(Ljava/lang/Object;)V
     56   .registers 3
     57 
     58   const v0, 0x1
     59   instance-of v1, p0, LSubclassC;
     60   if-eq v1, v0, :invoke
     61   return-void
     62 
     63   :invoke
     64   check-cast p0, LSubclassC;
     65   invoke-virtual {p0}, LSubclassC;->$noinline$g()V
     66   return-void
     67 
     68 .end method
     69 
     70 ## CHECK-START: void SmaliTests.testInstanceOf_NE0_NotInlined(java.lang.Object) builder (after)
     71 ## CHECK-DAG:     <<Cst0:i\d+>> IntConstant 0
     72 ## CHECK-DAG:     <<IOf:z\d+>>  InstanceOf
     73 ## CHECK-DAG:                   NotEqual [<<IOf>>,<<Cst0>>]
     74 
     75 ## CHECK-START: void SmaliTests.testInstanceOf_NE0_NotInlined(java.lang.Object) instruction_simplifier (before)
     76 ## CHECK:         CheckCast
     77 
     78 ## CHECK-START: void SmaliTests.testInstanceOf_NE0_NotInlined(java.lang.Object) instruction_simplifier (after)
     79 ## CHECK-NOT:     CheckCast
     80 
     81 .method public static testInstanceOf_NE0_NotInlined(Ljava/lang/Object;)V
     82   .registers 3
     83 
     84   const v0, 0x0
     85   instance-of v1, p0, LSubclassC;
     86   if-ne v1, v0, :invoke
     87   return-void
     88 
     89   :invoke
     90   check-cast p0, LSubclassC;
     91   invoke-virtual {p0}, LSubclassC;->$noinline$g()V
     92   return-void
     93 
     94 .end method
     95 
     96 ## CHECK-START: void SmaliTests.testInstanceOf_NE1_NotInlined(java.lang.Object) builder (after)
     97 ## CHECK-DAG:     <<Cst1:i\d+>> IntConstant 1
     98 ## CHECK-DAG:     <<IOf:z\d+>>  InstanceOf
     99 ## CHECK-DAG:                   NotEqual [<<IOf>>,<<Cst1>>]
    100 
    101 ## CHECK-START: void SmaliTests.testInstanceOf_NE1_NotInlined(java.lang.Object) instruction_simplifier (before)
    102 ## CHECK:         CheckCast
    103 
    104 ## CHECK-START: void SmaliTests.testInstanceOf_NE1_NotInlined(java.lang.Object) instruction_simplifier (after)
    105 ## CHECK-NOT:     CheckCast
    106 
    107 .method public static testInstanceOf_NE1_NotInlined(Ljava/lang/Object;)V
    108   .registers 3
    109 
    110   const v0, 0x1
    111   instance-of v1, p0, LSubclassC;
    112   if-ne v1, v0, :return
    113 
    114   check-cast p0, LSubclassC;
    115   invoke-virtual {p0}, LSubclassC;->$noinline$g()V
    116 
    117   :return
    118   return-void
    119 
    120 .end method
    121