Support passing arguments to invoke-static* instructions.
- Stop using the frame pointer for accessing locals.
- Stop emulating a stack when doing code generation. Instead,
rely on dex register model, where instructions only reference
registers.
Change-Id: Id51bd7d33ac430cb87a53c9f4b0c864eeb1006f9
diff --git a/test/401-optimizing-compiler/expected.txt b/test/401-optimizing-compiler/expected.txt
index 7b3a018..268da55 100644
--- a/test/401-optimizing-compiler/expected.txt
+++ b/test/401-optimizing-compiler/expected.txt
@@ -1,3 +1,6 @@
In static method
+In static method with 2 args 1 2
+In static method with 5 args 1 2 3 4 5
+In static method with 7 args 1 2 3 4 5 6 7
Forced GC
java.lang.Error: Error
diff --git a/test/401-optimizing-compiler/src/Main.java b/test/401-optimizing-compiler/src/Main.java
index 2609e0f..4031ff1 100644
--- a/test/401-optimizing-compiler/src/Main.java
+++ b/test/401-optimizing-compiler/src/Main.java
@@ -30,6 +30,9 @@
public static void $opt$TestInvokeStatic() {
printStaticMethod();
+ printStaticMethodWith2Args(1, 2);
+ printStaticMethodWith5Args(1, 2, 3, 4, 5);
+ printStaticMethodWith7Args(1, 2, 3, 4, 5, 6, 7);
forceGCStaticMethod();
throwStaticMethod();
}
@@ -38,6 +41,20 @@
System.out.println("In static method");
}
+ public static void printStaticMethodWith2Args(int a, int b) {
+ System.out.println("In static method with 2 args " + a + " " + b);
+ }
+
+ public static void printStaticMethodWith5Args(int a, int b, int c, int d, int e) {
+ System.out.println("In static method with 5 args "
+ + a + " " + b + " " + c + " " + d + " " + e);
+ }
+
+ public static void printStaticMethodWith7Args(int a, int b, int c, int d, int e, int f, int g) {
+ System.out.println("In static method with 7 args "
+ + a + " " + b + " " + c + " " + d + " " + e + " " + f + " " + g);
+ }
+
public static void forceGCStaticMethod() {
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();