summaryrefslogtreecommitdiff
path: root/runtime/jni/java_vm_ext.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-11-18 15:14:47 +0100
committer VladimĂ­r Marko <vmarko@google.com> 2022-11-21 08:07:49 +0000
commit1ca951c17652fd89c36798cd7cc9b5a4c254f86e (patch)
treee57c034e89cea43f399d2d55dd369b8d98e410a4 /runtime/jni/java_vm_ext.h
parent17983ac8243d4cc6c5097d452580468176fd1a96 (diff)
Clean up `IndirectReferenceTable` construction.
Split the parts that can fail to a separate function. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 172332525 Change-Id: I95200a31cc757e4593d9cc7f956dd4d5ef624f92
Diffstat (limited to 'runtime/jni/java_vm_ext.h')
-rw-r--r--runtime/jni/java_vm_ext.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/jni/java_vm_ext.h b/runtime/jni/java_vm_ext.h
index 08de18b2ac..b97088aaf7 100644
--- a/runtime/jni/java_vm_ext.h
+++ b/runtime/jni/java_vm_ext.h
@@ -218,9 +218,12 @@ class JavaVMExt : public JavaVM {
static jstring GetLibrarySearchPath(JNIEnv* env, jobject class_loader);
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);
+ // The constructor should not be called directly. Use `Create()` that initializes
+ // the new `JavaVMExt` object by calling `Initialize()`.
+ JavaVMExt(Runtime* runtime, const RuntimeArgumentMap& runtime_options);
+
+ // Initialize the `JavaVMExt` object.
+ bool Initialize(std::string* error_msg);
// Return true if self can currently access weak globals.
bool MayAccessWeakGlobals(Thread* self) const REQUIRES_SHARED(Locks::mutator_lock_);