PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/kilim/Constants.java

http://github.com/kilim/kilim
Java | 77 lines | 58 code | 12 blank | 7 comment | 0 complexity | 58ff91b6ec347d8c5bf22aaee71c2d19 MD5 | raw file
 1/* Copyright (c) 2006, Sriram Srinivasan
 2 *
 3 * You may distribute this software under the terms of the license 
 4 * specified in the file "License"
 5 */
 6package kilim;
 7
 8import org.objectweb.asm.Opcodes;
 9
10public interface Constants extends Opcodes {
11    
12    String KILIM_VERSION    = "1.0";
13    int    KILIM_ASM        = ASM7;
14    
15    // Type descriptors
16    String D_BOOLEAN        = "Z";
17    String D_BYTE           = "B";
18    String D_CHAR           = "C";
19    String D_DOUBLE         = "D";
20    String D_FLOAT          = "F";
21    String D_INT            = "I";
22    String D_LONG           = "J";
23    String D_SHORT          = "S";
24    String D_VOID           = "V";
25
26    String D_ARRAY_BOOLEAN  = "[Z";
27    String D_ARRAY_BYTE     = "[B";
28    String D_ARRAY_CHAR     = "[C";
29    String D_ARRAY_DOUBLE   = "[D";
30    String D_ARRAY_FLOAT    = "[F";
31    String D_ARRAY_SHORT    = "[S";
32    String D_ARRAY_INT      = "[I";
33    String D_ARRAY_LONG     = "[J";
34
35    String D_NULL           = "NULL";
36    String D_RETURN_ADDRESS = "A";
37    String D_OBJECT         = "Ljava/lang/Object;";
38    String D_STRING         = "Ljava/lang/String;";
39    String D_THROWABLE      = "Ljava/lang/Throwable;";
40    String D_UNDEFINED      = "UNDEFINED";
41
42    String D_FIBER          = "Lkilim/Fiber;";
43    String D_STATE          = "Lkilim/State;";
44    String D_TASK           = "Lkilim/Task;";
45    String D_PAUSABLE       = "Lkilim/Pausable;";
46    String D_FIBER_LAST_ARG   = D_FIBER + ')'; // Last argument in a method descriptor
47
48    String THROWABLE_CLASS  = "java/lang/Throwable";
49    String FIBER_CLASS      = "kilim/Fiber";
50    String STATE_CLASS      = "kilim/State";
51    String TASK_CLASS       = "kilim/Task";
52    String PAUSABLE_CLASS   = "kilim/Pausable";
53    String NOT_PAUSABLE_CLASS   = "kilim/NotPausable";
54    
55    String  WOVEN_FIELD     = "$isWoven";
56
57    // Constant opcodes missing from asm's opcodes (as of asm 3.0)
58    int    ILOAD_0          = 26;
59    int    LLOAD_0          = 30;
60    int    FLOAD_0          = 34;
61    int    DLOAD_0          = 38;
62    int    ALOAD_0          = 42;
63    int    ISTORE_0         = 59;
64    int    LSTORE_0         = 63;
65    int    FSTORE_0         = 67;
66    int    DSTORE_0         = 71;
67    int    ASTORE_0         = 75;
68    int    LDC2_W           = 20;
69
70    String SAM_SHIM_PREFIX = "$shim$";
71
72    public static class Util {
73        public static boolean isSamShim(String name) {
74            return name.startsWith(SAM_SHIM_PREFIX);
75        }
76    }
77}