diff options
| author | 2016-10-20 11:45:05 +0000 | |
|---|---|---|
| committer | 2016-10-20 11:45:06 +0000 | |
| commit | 3bbfcb794f5f81f4aa76ac0fb4c811d260e69d3b (patch) | |
| tree | 79be0f3361730ea7796f370a38b2c039108322eb /runtime/java_vm_ext.h | |
| parent | d985a5a81a45595f5cb4d12da81eec760801c92c (diff) | |
| parent | da0a69edb24122d3d35ce1483c5ab94de919d714 (diff) | |
Merge "Return error message if IndirectReferenceTable construction fails."
Diffstat (limited to 'runtime/java_vm_ext.h')
| -rw-r--r-- | runtime/java_vm_ext.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/runtime/java_vm_ext.h b/runtime/java_vm_ext.h index 05717f41e7..9e37f1178c 100644 --- a/runtime/java_vm_ext.h +++ b/runtime/java_vm_ext.h @@ -43,7 +43,14 @@ using GetEnvHook = jint (*)(JavaVMExt* vm, /*out*/void** new_env, jint version); class JavaVMExt : public JavaVM { public: - JavaVMExt(Runtime* runtime, const RuntimeArgumentMap& runtime_options); + // Creates a new JavaVMExt object. + // Returns nullptr on error, in which case error_msg is set to a message + // describing the error. + static std::unique_ptr<JavaVMExt> Create(Runtime* runtime, + const RuntimeArgumentMap& runtime_options, + std::string* error_msg); + + ~JavaVMExt(); bool ForceCopy() const { @@ -192,6 +199,10 @@ class JavaVMExt : public JavaVM { static bool IsBadJniVersion(int version); private: + // The constructor should not be called directly. It may leave the object in + // an erroneous state, and the result needs to be checked. + JavaVMExt(Runtime* runtime, const RuntimeArgumentMap& runtime_options, std::string* error_msg); + // Return true if self can currently access weak globals. bool MayAccessWeakGlobalsUnlocked(Thread* self) const REQUIRES_SHARED(Locks::mutator_lock_); bool MayAccessWeakGlobals(Thread* self) const |