Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 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 | |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 17 | #include <limits.h> |
| 18 | |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 19 | #include "class_linker.h" |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 20 | #include "common_throws.h" |
Elliott Hughes | f6a1e1e | 2011-10-25 16:28:04 -0700 | [diff] [blame] | 21 | #include "debugger.h" |
Ian Rogers | 4f6ad8a | 2013-03-18 15:27:28 -0700 | [diff] [blame] | 22 | #include "dex_file-inl.h" |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 23 | #include "gc/allocator/dlmalloc.h" |
Mathieu Chartier | 8235331 | 2013-07-18 10:47:51 -0700 | [diff] [blame] | 24 | #include "gc/heap.h" |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 25 | #include "gc/space/dlmalloc_space.h" |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 26 | #include "jni_internal.h" |
Ian Rogers | 4f6ad8a | 2013-03-18 15:27:28 -0700 | [diff] [blame] | 27 | #include "mirror/class-inl.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 28 | #include "mirror/object.h" |
| 29 | #include "mirror/object-inl.h" |
Ian Rogers | 6d4d9fc | 2011-11-30 16:24:48 -0800 | [diff] [blame] | 30 | #include "object_utils.h" |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 31 | #include "scoped_thread_state_change.h" |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 32 | #include "thread.h" |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 33 | #include "thread_list.h" |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 34 | #include "toStringArray.h" |
| 35 | |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 36 | namespace art { |
| 37 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 38 | static jfloat VMRuntime_getTargetHeapUtilization(JNIEnv*, jobject) { |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 39 | return Runtime::Current()->GetHeap()->GetTargetHeapUtilization(); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 40 | } |
| 41 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 42 | static void VMRuntime_nativeSetTargetHeapUtilization(JNIEnv*, jobject, jfloat target) { |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 43 | Runtime::Current()->GetHeap()->SetTargetHeapUtilization(target); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 44 | } |
| 45 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 46 | static void VMRuntime_startJitCompilation(JNIEnv*, jobject) { |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 47 | } |
| 48 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 49 | static void VMRuntime_disableJitCompilation(JNIEnv*, jobject) { |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 52 | static jobject VMRuntime_newNonMovableArray(JNIEnv* env, jobject, jclass javaElementClass, jint length) { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 53 | ScopedObjectAccess soa(env); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 54 | #ifdef MOVING_GARBAGE_COLLECTOR |
| 55 | // TODO: right now, we don't have a copying collector, so there's no need |
| 56 | // to do anything special here, but we ought to pass the non-movability |
| 57 | // through to the allocator. |
| 58 | UNIMPLEMENTED(FATAL); |
| 59 | #endif |
| 60 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 61 | mirror::Class* element_class = soa.Decode<mirror::Class*>(javaElementClass); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 62 | if (element_class == NULL) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 63 | ThrowNullPointerException(NULL, "element class == null"); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 64 | return NULL; |
| 65 | } |
| 66 | if (length < 0) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 67 | ThrowNegativeArraySizeException(length); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 68 | return NULL; |
| 69 | } |
| 70 | |
| 71 | ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); |
| 72 | std::string descriptor; |
| 73 | descriptor += "["; |
Ian Rogers | 6d4d9fc | 2011-11-30 16:24:48 -0800 | [diff] [blame] | 74 | descriptor += ClassHelper(element_class).GetDescriptor(); |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 75 | mirror::Class* array_class = class_linker->FindClass(descriptor.c_str(), NULL); |
| 76 | mirror::Array* result = mirror::Array::Alloc(soa.Self(), array_class, length); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 77 | if (result == NULL) { |
| 78 | return NULL; |
| 79 | } |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 80 | return soa.AddLocalReference<jobject>(result); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 81 | } |
| 82 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 83 | static jlong VMRuntime_addressOf(JNIEnv* env, jobject, jobject javaArray) { |
Ian Rogers | a15e67d | 2012-02-28 13:51:55 -0800 | [diff] [blame] | 84 | if (javaArray == NULL) { // Most likely allocation failed |
| 85 | return 0; |
| 86 | } |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 87 | ScopedObjectAccess soa(env); |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 88 | mirror::Array* array = soa.Decode<mirror::Array*>(javaArray); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 89 | if (!array->IsArrayInstance()) { |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 90 | ThrowIllegalArgumentException(NULL, "not an array"); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 91 | return 0; |
| 92 | } |
| 93 | // TODO: we should also check that this is a non-movable array. |
Ian Rogers | a15e67d | 2012-02-28 13:51:55 -0800 | [diff] [blame] | 94 | return reinterpret_cast<uintptr_t>(array->GetRawData(array->GetClass()->GetComponentSize())); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 97 | static void VMRuntime_clearGrowthLimit(JNIEnv*, jobject) { |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 98 | Runtime::Current()->GetHeap()->ClearGrowthLimit(); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 99 | } |
| 100 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 101 | static jboolean VMRuntime_isDebuggerActive(JNIEnv*, jobject) { |
Elliott Hughes | c0f0933 | 2012-03-26 13:27:06 -0700 | [diff] [blame] | 102 | return Dbg::IsDebuggerActive(); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 103 | } |
| 104 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 105 | static jobjectArray VMRuntime_properties(JNIEnv* env, jobject) { |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 106 | return toStringArray(env, Runtime::Current()->GetProperties()); |
| 107 | } |
| 108 | |
Brian Carlstrom | 7d5ffb5 | 2012-02-01 14:27:54 -0800 | [diff] [blame] | 109 | // This is for backward compatibility with dalvik which returned the |
| 110 | // meaningless "." when no boot classpath or classpath was |
| 111 | // specified. Unfortunately, some tests were using java.class.path to |
| 112 | // lookup relative file locations, so they are counting on this to be |
| 113 | // ".", presumably some applications or libraries could have as well. |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 114 | static const char* DefaultToDot(const std::string& class_path) { |
Brian Carlstrom | 7d5ffb5 | 2012-02-01 14:27:54 -0800 | [diff] [blame] | 115 | return class_path.empty() ? "." : class_path.c_str(); |
| 116 | } |
| 117 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 118 | static jstring VMRuntime_bootClassPath(JNIEnv* env, jobject) { |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 119 | return env->NewStringUTF(DefaultToDot(Runtime::Current()->GetBootClassPathString())); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 122 | static jstring VMRuntime_classPath(JNIEnv* env, jobject) { |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 123 | return env->NewStringUTF(DefaultToDot(Runtime::Current()->GetClassPathString())); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 124 | } |
| 125 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 126 | static jstring VMRuntime_vmVersion(JNIEnv* env, jobject) { |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 127 | return env->NewStringUTF(Runtime::Current()->GetVersion()); |
| 128 | } |
| 129 | |
Brian Carlstrom | cef450c | 2013-06-28 14:38:26 -0700 | [diff] [blame] | 130 | static jstring VMRuntime_vmLibrary(JNIEnv* env, jobject) { |
| 131 | return env->NewStringUTF(kIsDebugBuild ? "libartd.so" : "libart.so"); |
| 132 | } |
| 133 | |
Ian Rogers | c928de9 | 2013-02-27 14:30:44 -0800 | [diff] [blame] | 134 | #if !defined(ART_USE_PORTABLE_COMPILER) |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 135 | static void DisableCheckJniCallback(Thread* t, void*) { |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 136 | t->GetJniEnv()->SetCheckJniEnabled(false); |
| 137 | } |
Shih-wei Liao | fbe5b75 | 2012-04-19 00:26:00 -0700 | [diff] [blame] | 138 | #endif |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 139 | |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 140 | static void VMRuntime_setTargetSdkVersion(JNIEnv* env, jobject, jint targetSdkVersion) { |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 141 | // This is the target SDK version of the app we're about to run. |
Elliott Hughes | c2dc62d | 2012-01-17 20:06:12 -0800 | [diff] [blame] | 142 | // Note that targetSdkVersion may be CUR_DEVELOPMENT (10000). |
| 143 | // Note that targetSdkVersion may be 0, meaning "current". |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 144 | if (targetSdkVersion > 0 && targetSdkVersion <= 13 /* honeycomb-mr2 */) { |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 145 | Runtime* runtime = Runtime::Current(); |
| 146 | JavaVMExt* vm = runtime->GetJavaVM(); |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 147 | if (vm->check_jni) { |
| 148 | LOG(WARNING) << "Turning off CheckJNI so we can turn on JNI app bug workarounds..."; |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 149 | Thread* self = static_cast<JNIEnvExt*>(env)->self; |
| 150 | MutexLock mu(self, *Locks::thread_list_lock_); |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 151 | vm->SetCheckJniEnabled(false); |
| 152 | runtime->GetThreadList()->ForEach(DisableCheckJniCallback, NULL); |
Ian Rogers | 475a644 | 2012-02-21 15:39:39 -0800 | [diff] [blame] | 153 | } |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 154 | |
| 155 | LOG(INFO) << "Turning on JNI app bug workarounds for target SDK version " |
| 156 | << targetSdkVersion << "..."; |
TDYa127 | 2646757 | 2012-04-17 20:51:22 -0700 | [diff] [blame] | 157 | |
Elliott Hughes | 88c5c35 | 2012-03-15 18:49:48 -0700 | [diff] [blame] | 158 | vm->work_around_app_jni_bugs = true; |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 159 | } |
| 160 | } |
| 161 | |
Mathieu Chartier | 987ccff | 2013-07-08 11:05:21 -0700 | [diff] [blame] | 162 | static void VMRuntime_registerNativeAllocation(JNIEnv* env, jobject, jint bytes) { |
| 163 | ScopedObjectAccess soa(env); |
| 164 | if (bytes < 0) { |
| 165 | ThrowRuntimeException("allocation size negative %d", bytes); |
| 166 | return; |
| 167 | } |
| 168 | Runtime::Current()->GetHeap()->RegisterNativeAllocation(bytes); |
| 169 | } |
| 170 | |
| 171 | static void VMRuntime_registerNativeFree(JNIEnv* env, jobject, jint bytes) { |
| 172 | ScopedObjectAccess soa(env); |
| 173 | if (bytes < 0) { |
| 174 | ThrowRuntimeException("allocation size negative %d", bytes); |
| 175 | return; |
| 176 | } |
| 177 | Runtime::Current()->GetHeap()->RegisterNativeFree(bytes); |
| 178 | } |
| 179 | |
Mathieu Chartier | 3056d0c | 2012-10-19 10:49:56 -0700 | [diff] [blame] | 180 | static void VMRuntime_trimHeap(JNIEnv*, jobject) { |
Ian Rogers | 4893188 | 2013-01-22 14:35:16 -0800 | [diff] [blame] | 181 | uint64_t start_ns = NanoTime(); |
| 182 | |
Elliott Hughes | 9eebd3b | 2012-06-08 13:56:31 -0700 | [diff] [blame] | 183 | // Trim the managed heap. |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 184 | gc::Heap* heap = Runtime::Current()->GetHeap(); |
| 185 | gc::space::DlMallocSpace* alloc_space = heap->GetAllocSpace(); |
Mathieu Chartier | fd678be | 2012-08-30 14:50:54 -0700 | [diff] [blame] | 186 | size_t alloc_space_size = alloc_space->Size(); |
Ian Rogers | 4893188 | 2013-01-22 14:35:16 -0800 | [diff] [blame] | 187 | float managed_utilization = |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 188 | static_cast<float>(alloc_space->GetBytesAllocated()) / alloc_space_size; |
Ian Rogers | 4893188 | 2013-01-22 14:35:16 -0800 | [diff] [blame] | 189 | size_t managed_reclaimed = heap->Trim(); |
| 190 | |
| 191 | uint64_t gc_heap_end_ns = NanoTime(); |
| 192 | |
Mathieu Chartier | fd678be | 2012-08-30 14:50:54 -0700 | [diff] [blame] | 193 | // Trim the native heap. |
| 194 | dlmalloc_trim(0); |
Ian Rogers | 4893188 | 2013-01-22 14:35:16 -0800 | [diff] [blame] | 195 | size_t native_reclaimed = 0; |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 196 | dlmalloc_inspect_all(DlmallocMadviseCallback, &native_reclaimed); |
Ian Rogers | 4893188 | 2013-01-22 14:35:16 -0800 | [diff] [blame] | 197 | |
| 198 | uint64_t end_ns = NanoTime(); |
| 199 | |
| 200 | LOG(INFO) << "Heap trim of managed (duration=" << PrettyDuration(gc_heap_end_ns - start_ns) |
| 201 | << ", advised=" << PrettySize(managed_reclaimed) << ") and native (duration=" |
| 202 | << PrettyDuration(end_ns - gc_heap_end_ns) << ", advised=" << PrettySize(native_reclaimed) |
| 203 | << ") heaps. Managed heap utilization of " << static_cast<int>(100 * managed_utilization) |
| 204 | << "%."; |
Elliott Hughes | 8cf5bc0 | 2012-02-02 16:32:16 -0800 | [diff] [blame] | 205 | } |
| 206 | |
Ian Rogers | 81d425b | 2012-09-27 16:03:43 -0700 | [diff] [blame] | 207 | static void VMRuntime_concurrentGC(JNIEnv* env, jobject) { |
| 208 | Thread* self = static_cast<JNIEnvExt*>(env)->self; |
| 209 | Runtime::Current()->GetHeap()->ConcurrentGC(self); |
Mathieu Chartier | 7664f5c | 2012-06-08 18:15:32 -0700 | [diff] [blame] | 210 | } |
| 211 | |
Mathieu Chartier | 8235331 | 2013-07-18 10:47:51 -0700 | [diff] [blame] | 212 | static void VMRuntime_updateProcessState(JNIEnv* env, jobject, jint processState) { |
| 213 | Runtime::Current()->GetHeap()->UpdateProcessState(static_cast<gc::ProcessState>(processState)); |
| 214 | } |
| 215 | |
Elliott Hughes | 0512f02 | 2012-03-15 22:10:52 -0700 | [diff] [blame] | 216 | static JNINativeMethod gMethods[] = { |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 217 | NATIVE_METHOD(VMRuntime, addressOf, "(Ljava/lang/Object;)J"), |
| 218 | NATIVE_METHOD(VMRuntime, bootClassPath, "()Ljava/lang/String;"), |
| 219 | NATIVE_METHOD(VMRuntime, classPath, "()Ljava/lang/String;"), |
| 220 | NATIVE_METHOD(VMRuntime, clearGrowthLimit, "()V"), |
Mathieu Chartier | 7664f5c | 2012-06-08 18:15:32 -0700 | [diff] [blame] | 221 | NATIVE_METHOD(VMRuntime, concurrentGC, "()V"), |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 222 | NATIVE_METHOD(VMRuntime, disableJitCompilation, "()V"), |
| 223 | NATIVE_METHOD(VMRuntime, getTargetHeapUtilization, "()F"), |
| 224 | NATIVE_METHOD(VMRuntime, isDebuggerActive, "()Z"), |
| 225 | NATIVE_METHOD(VMRuntime, nativeSetTargetHeapUtilization, "(F)V"), |
| 226 | NATIVE_METHOD(VMRuntime, newNonMovableArray, "(Ljava/lang/Class;I)Ljava/lang/Object;"), |
| 227 | NATIVE_METHOD(VMRuntime, properties, "()[Ljava/lang/String;"), |
| 228 | NATIVE_METHOD(VMRuntime, setTargetSdkVersion, "(I)V"), |
Mathieu Chartier | 987ccff | 2013-07-08 11:05:21 -0700 | [diff] [blame] | 229 | NATIVE_METHOD(VMRuntime, registerNativeAllocation, "(I)V"), |
| 230 | NATIVE_METHOD(VMRuntime, registerNativeFree, "(I)V"), |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 231 | NATIVE_METHOD(VMRuntime, startJitCompilation, "()V"), |
Elliott Hughes | 8cf5bc0 | 2012-02-02 16:32:16 -0800 | [diff] [blame] | 232 | NATIVE_METHOD(VMRuntime, trimHeap, "()V"), |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 233 | NATIVE_METHOD(VMRuntime, vmVersion, "()Ljava/lang/String;"), |
Brian Carlstrom | cef450c | 2013-06-28 14:38:26 -0700 | [diff] [blame] | 234 | NATIVE_METHOD(VMRuntime, vmLibrary, "()Ljava/lang/String;"), |
Mathieu Chartier | 8235331 | 2013-07-18 10:47:51 -0700 | [diff] [blame] | 235 | NATIVE_METHOD(VMRuntime, updateProcessState, "(I)V"), |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 236 | }; |
| 237 | |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 238 | void register_dalvik_system_VMRuntime(JNIEnv* env) { |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 239 | REGISTER_NATIVE_METHODS("dalvik/system/VMRuntime"); |
Elliott Hughes | 7ede61e | 2011-09-14 18:18:06 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | } // namespace art |