Files
rk35xx-android14/dalvik/dx/tests/093-ssa-invoke-range/Blort.java
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

70 lines
1.9 KiB
Java

class Blort {
static void methodThatNeedsInvokeRange
(int a, int b, int c, int d, int e, int f) {
}
void testNoLocals() {
methodThatNeedsInvokeRange(5, 0, 5, 0, 5, 0);
}
void testMixedLocals() {
int src = 6;
int dest = 7;
methodThatNeedsInvokeRange(src, 0, dest, 1, 5, 0);
methodThatNeedsInvokeRange(src, 0, dest, 1, 5, 0);
}
// here the current algorithm partial-overlapping will stumble a bit
// The register containing "zero" will be marked as "reserved for locals"
// Then the subsequent arraycopy will need a whole new set of 5 registers
void testMixedWorseCase() {
int src = 6;
int dest = 7;
int zero = 0;
methodThatNeedsInvokeRange(src, zero, dest, 1, 5, 0);
methodThatNeedsInvokeRange(src, 0, dest, 1, 5, 0);
}
void testAllParams(int a, int b, int c, int d, int e, int f) {
methodThatNeedsInvokeRange(a, b, c, d, e, f);
}
// this could try to make use of param positions, but doesn't
static void testTailParams(int destPos, int length) {
int src = 6;
int dest = 7;
methodThatNeedsInvokeRange(src, 0, dest, 0, destPos, length);
}
// This presently requires a whole N new registers
void testFlip() {
int src = 6;
int dest = 7;
methodThatNeedsInvokeRange(src, 0, dest, 1, 5, 0);
methodThatNeedsInvokeRange(dest, 0, src, 1, 5, 0);
}
// ensure that an attempt to combine registers for a local
// with a differing category doesn't mess us up.
long testMixedCategory(boolean foo) {
if (foo) {
int offset = 1;
int src = 6;
int dest = 7;
methodThatNeedsInvokeRange(src, 0, dest, offset, 5, 0);
return offset;
} else {
long offset = System.currentTimeMillis();;
return offset;
}
}
}