OSDN Git Service

Cleanup.
[android-x86/dalvik.git] / vm / Init.h
1 /*
2  * Copyright (C) 2008 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * VM initialization and shutdown.
19  */
20 #ifndef _DALVIK_INIT
21 #define _DALVIK_INIT
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /*
28  * Standard VM initialization, usually invoked through JNI.
29  */
30 int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
31     JNIEnv* pEnv);
32 void dvmShutdown(void);
33 bool dvmInitAfterZygote(void);
34
35 /*
36  * Enable Java programming language assert statements after the Zygote fork.
37  */
38 void dvmLateEnableAssertions(void);
39
40 /*
41  * Partial VM initialization; only used as part of "dexopt", which may be
42  * asked to optimize a DEX file holding fundamental classes.
43  */
44 int dvmPrepForDexOpt(const char* bootClassPath, DexOptimizerMode dexOptMode,
45     DexClassVerifyMode verifyMode, int dexoptFlags);
46
47 /*
48  * Look up the set of classes and members used directly by the VM,
49  * storing references to them into the globals instance. See
50  * Globals.h. This function is exposed so that dex optimization may
51  * call it (while avoiding doing other unnecessary VM initialization).
52  *
53  * The function returns a success flag (true == success).
54  */
55 bool dvmFindRequiredClassesAndMembers(void);
56
57 /*
58  * Look up required members of the class Reference, and set the global
59  * reference to Reference itself too. This needs to be done separately
60  * from dvmFindRequiredClassesAndMembers(), during the course of
61  * linking the class Reference (which is done specially).
62  */
63 bool dvmFindReferenceMembers(ClassObject* classReference);
64
65 /*
66  * Replacement for fprintf() when we want to send a message to the console.
67  * This defaults to fprintf(), but will use the JNI fprintf callback if
68  * one was provided.
69  */
70 int dvmFprintf(FILE* fp, const char* format, ...)
71 #if defined(__GNUC__)
72     __attribute__ ((format(printf, 2, 3)))
73 #endif
74     ;
75
76 #ifdef __cplusplus
77 }
78 #endif
79
80 #endif /*_DALVIK_INIT*/