summaryrefslogtreecommitdiffstats
path: root/vm/analysis/DexOptimize.h
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:15 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:15 -0800
commit72e93344b4d1ffc71e9c832ec23de0657e5b04a5 (patch)
tree1a08d1e43d54200ea737234d865c4668c5d3535b /vm/analysis/DexOptimize.h
parentdfd0afbcb08b871e224a28ecb4ed427a7693545c (diff)
downloadandroid_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.tar.gz
android_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.tar.bz2
android_dalvik-72e93344b4d1ffc71e9c832ec23de0657e5b04a5.zip
eclair snapshot
Diffstat (limited to 'vm/analysis/DexOptimize.h')
-rw-r--r--vm/analysis/DexOptimize.h46
1 files changed, 42 insertions, 4 deletions
diff --git a/vm/analysis/DexOptimize.h b/vm/analysis/DexOptimize.h
index 01aa8288a..afcb3cba2 100644
--- a/vm/analysis/DexOptimize.h
+++ b/vm/analysis/DexOptimize.h
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
/*
* DEX optimization declarations.
*/
@@ -36,6 +37,40 @@ enum DexoptFlags {
};
/*
+ * An enumeration of problems that can turn up during verification.
+ */
+typedef enum VerifyError {
+ VERIFY_ERROR_NONE = 0, /* no error; must be zero */
+ VERIFY_ERROR_GENERIC, /* VerifyError */
+
+ VERIFY_ERROR_NO_CLASS, /* NoClassDefFoundError */
+ VERIFY_ERROR_NO_FIELD, /* NoSuchFieldError */
+ VERIFY_ERROR_NO_METHOD, /* NoSuchMethodError */
+ VERIFY_ERROR_ACCESS_CLASS, /* IllegalAccessError */
+ VERIFY_ERROR_ACCESS_FIELD, /* IllegalAccessError */
+ VERIFY_ERROR_ACCESS_METHOD, /* IllegalAccessError */
+ VERIFY_ERROR_CLASS_CHANGE, /* IncompatibleClassChangeError */
+ VERIFY_ERROR_INSTANTIATION, /* InstantiationError */
+} VerifyError;
+
+/*
+ * Identifies the type of reference in the instruction that generated the
+ * verify error (e.g. VERIFY_ERROR_ACCESS_CLASS could come from a method,
+ * field, or class reference).
+ *
+ * This must fit in two bits.
+ */
+typedef enum VerifyErrorRefType {
+ VERIFY_ERROR_REF_CLASS = 0,
+ VERIFY_ERROR_REF_FIELD = 1,
+ VERIFY_ERROR_REF_METHOD = 2,
+} VerifyErrorRefType;
+
+#define kVerifyErrorRefTypeShift 6
+
+#define VERIFY_OK(_failure) ((_failure) == VERIFY_ERROR_NONE)
+
+/*
* Given the full path to a DEX or Jar file, and (if appropriate) the name
* within the Jar, open the optimized version from the cache.
*
@@ -81,11 +116,14 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Abbreviated resolution functions, for use by optimization and verification
* code.
*/
-ClassObject* dvmOptResolveClass(ClassObject* referrer, u4 classIdx);
+ClassObject* dvmOptResolveClass(ClassObject* referrer, u4 classIdx,
+ VerifyError* pFailure);
Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
- MethodType methodType);
+ MethodType methodType, VerifyError* pFailure);
Method* dvmOptResolveInterfaceMethod(ClassObject* referrer, u4 methodIdx);
-InstField* dvmOptResolveInstField(ClassObject* referrer, u4 ifieldIdx);
-StaticField* dvmOptResolveStaticField(ClassObject* referrer, u4 sfieldIdx);
+InstField* dvmOptResolveInstField(ClassObject* referrer, u4 ifieldIdx,
+ VerifyError* pFailure);
+StaticField* dvmOptResolveStaticField(ClassObject* referrer, u4 sfieldIdx,
+ VerifyError* pFailure);
#endif /*_DALVIK_DEXOPTIMIZE*/