File: Blort.java

package info (click to toggle)
android-platform-dalvik 10.0.0%2Br36-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 26,132 kB
  • sloc: java: 270,758; cpp: 8,766; sh: 2,004; javascript: 976; ansic: 534; awk: 368; makefile: 26
file content (69 lines) | stat: -rw-r--r-- 1,948 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

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;
        }
    }
}