1 /*
 2  * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
 3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 4  *
 5  * This code is free software; you can redistribute it and/or modify it
 6  * under the terms of the GNU General Public License version 2 only, as
 7  * published by the Free Software Foundation.
 8  *
 9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 package org.openjdk.asmtools.jasm;
24 
25 import java.util.HashMap;
26 import java.util.Map;
27 
28 /**
29  *
30  */
31 public interface RuntimeConstants {
32     /* Access Flags */
33 
34     int ACC_NONE          = 0x0000; // <<everywhere>>
35     int ACC_PUBLIC        = 0x0001; // class, inner, field, method
36     int ACC_PRIVATE       = 0x0002; //        inner, field, method
37     int ACC_PROTECTED     = 0x0004; //        inner, field, method
38     int ACC_STATIC        = 0x0008; //        inner, field, method
39     int ACC_FINAL         = 0x0010; // class, inner, field, method
40     int ACC_TRANSITIVE    = 0x0010; //                                      requires(module)
41     int ACC_SUPER         = 0x0020; // class
42     int ACC_STATIC_PHASE  = 0x0020; //                                      requires(module)
43     int ACC_SYNCHRONIZED  = 0x0020; //                      method
44     int ACC_OPEN          = 0x0020; //                              module
45     int ACC_VALUE         = 0x0040; // class, inner
46     int ACC_VOLATILE      = 0x0040; //               field
47     int ACC_BRIDGE        = 0x0040; //                      method
48     int ACC_TRANSIENT     = 0x0080; //               field
49     int ACC_VARARGS       = 0x0080; //                      method
50     int ACC_NATIVE        = 0x0100; //                      method
51     int ACC_INTERFACE     = 0x0200; // class, inner
52     int ACC_ABSTRACT      = 0x0400; // class, inner,        method
53     int ACC_PRIMITIVE     = 0x0800; // class, inner
54     int ACC_STRICT        = 0x0800; //                      method
55     int ACC_SYNTHETIC     = 0x1000; // class, inner, field, method, module  requires(module) exports(module)
56     int ACC_ANNOTATION    = 0x2000; // class, inner
57     int ACC_ENUM          = 0x4000; // class, inner, field
58     int ACC_MODULE        = 0x8000; // class
59     int ACC_MANDATED      = 0x8000; //                      method  module  requires(module) exports(module)
60 
61    /* Attribute codes */
62    int SYNTHETIC_ATTRIBUTE          = 0x00010000; // actually, this is an attribute
63    int DEPRECATED_ATTRIBUTE         = 0x00020000; // actually, this is an attribute
64 
65    Map<Integer,String> ACC_NAMES = new HashMap() {{
66                         put(ACC_PUBLIC       ,"public");
67                         put(ACC_PRIVATE      ,"private");
68                         put(ACC_PROTECTED    ,"protected");
69                         put(ACC_STATIC       ,"static");
70                         put(ACC_FINAL        ,"final");
71                         put(ACC_SUPER        ,"super");
72                         put(ACC_SYNCHRONIZED ,"synchronized");
73                         put(ACC_VOLATILE     ,"volatile");
74                         put(ACC_BRIDGE       ,"bridge");
75                         put(ACC_TRANSIENT    ,"transient");
76                         put(ACC_VARARGS      ,"varargs");
77                         put(ACC_VALUE        ,"value");
78                         put(ACC_NATIVE       ,"native");
79                         put(ACC_INTERFACE    ,"interface");
80                         put(ACC_ABSTRACT     ,"abstract");
81                         put(ACC_PRIMITIVE    ,"primitive");
82                         put(ACC_STRICT       ,"strict");
83                         put(ACC_SYNTHETIC    ,"synthetic");
84                         put(ACC_ANNOTATION   ,"annotation");
85                         put(ACC_ENUM         ,"enum");
86                         put(ACC_MODULE       ,"module");
87                         put(ACC_MANDATED     ,"mandated");
88                         put(SYNTHETIC_ATTRIBUTE     ,"synthetic");
89   }};
90 
91     /* The version of a class file since which the compact format of stack map is necessary */
92     int SPLIT_VERIFIER_CFV = 50;
93 
94 }