• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Tests invoke-polymorphic added in DEX version 38.
2# Disassembled from dexdump test files.
3# Repo: https://android.googlesource.com/platform/art/
4# File: test/dexdump/invoke-polymorphic.dex
5
6# Compile using smali: https://github.com/JesusFreke/smali
7# java -jar smali.jar assemble invoke-polymorphic.smali --api 28
8
9.class public LMain;
10.super Ljava/lang/Object;
11.source "Main.java"
12
13
14# direct methods
15.method public constructor <init>()V
16    .registers 1
17
18    .prologue
19    .line 9
20    invoke-direct {p0}, Ljava/lang/Object;-><init>()V
21
22    return-void
23.end method
24
25.method public static main([Ljava/lang/String;)V
26    .registers 10
27    .param p0, "args"    # [Ljava/lang/String;
28    .annotation system Ldalvik/annotation/Throws;
29        value = {
30            Ljava/lang/Throwable;
31        }
32    .end annotation
33
34    .prologue
35    const-wide v2, 0x400199999999999aL    # 2.2
36
37    const/4 v4, 0x1
38
39    .line 31
40    const/4 v0, 0x0
41
42    .line 32
43    .local v0, "handle":Ljava/lang/invoke/MethodHandle;
44    const/4 v5, 0x0
45
46    .line 33
47    .local v5, "o":Ljava/lang/Object;
48    const-string/jumbo v1, "a"
49
50    move v6, v4
51
52    invoke-polymorphic/range {v0 .. v6}, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (Ljava/lang/String;DILjava/lang/Object;I)Ljava/lang/String;
53
54    move-result-object v7
55
56    .line 34
57    .local v7, "s":Ljava/lang/String;
58    invoke-polymorphic {v0, v2, v3, v4}, Ljava/lang/invoke/MethodHandle;->invokeExact([Ljava/lang/Object;)Ljava/lang/Object;, (DI)I
59
60    move-result v8
61
62    .line 35
63    .local v8, "x":I
64    const-string/jumbo v1, "a"
65
66    invoke-polymorphic {v0, v1, v2, v3, v4}, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (Ljava/lang/String;DI)V
67
68    .line 56
69    return-void
70.end method
71