summaryrefslogtreecommitdiffstats
path: root/runtime/jni_env_ext.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-04-08 10:26:16 -0700
committerAndreas Gampe <agampe@google.com>2015-04-09 09:09:11 -0700
commit3f5881fda3606b27e30bf903052c73b03910f90b (patch)
tree0c60e00a3923d47658e2d224997ab2742c113877 /runtime/jni_env_ext.h
parent1576be32be4a99a1cffdaaf209a3cd67e8b2f88a (diff)
downloadart-3f5881fda3606b27e30bf903052c73b03910f90b.tar.gz
art-3f5881fda3606b27e30bf903052c73b03910f90b.tar.bz2
art-3f5881fda3606b27e30bf903052c73b03910f90b.zip
ART: IRT refactor
IRT creation might fail. Add a path that allows to bypass the aborts and instead signal validity. Hide this path with a private constructor, rewrite users to use a static Create method. Bug: 20110201 Change-Id: I440499c3372cd7557eb970b70ce2c4543da520e4
Diffstat (limited to 'runtime/jni_env_ext.h')
-rw-r--r--runtime/jni_env_ext.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/jni_env_ext.h b/runtime/jni_env_ext.h
index af87cb4226..29d912cb01 100644
--- a/runtime/jni_env_ext.h
+++ b/runtime/jni_env_ext.h
@@ -34,7 +34,8 @@ class JavaVMExt;
static constexpr size_t kLocalsMax = 512;
struct JNIEnvExt : public JNIEnv {
- JNIEnvExt(Thread* self, JavaVMExt* vm);
+ static JNIEnvExt* Create(Thread* self, JavaVMExt* vm);
+
~JNIEnvExt();
void DumpReferenceTables(std::ostream& os)
@@ -87,6 +88,11 @@ struct JNIEnvExt : public JNIEnv {
// Used by -Xcheck:jni.
const JNINativeInterface* unchecked_functions;
+
+ private:
+ // The constructor should not be called directly. It may leave the object in an erronuous state,
+ // and the result needs to be checked.
+ JNIEnvExt(Thread* self, JavaVMExt* vm);
};
// Used to save and restore the JNIEnvExt state when not going through code created by the JNI