| 4141 | } |
| 4142 | |
| 4143 | uint64_t jvmNewMultiArray(Thread* t, uintptr_t* arguments) |
| 4144 | { |
| 4145 | jclass elementClass = reinterpret_cast<jclass>(arguments[0]); |
| 4146 | jintArray dimensions = reinterpret_cast<jintArray>(arguments[1]); |
| 4147 | |
| 4148 | THREAD_RUNTIME_ARRAY(t, int32_t, counts, (*dimensions)->length()); |
| 4149 | for (int i = (*dimensions)->length() - 1; i >= 0; --i) { |
| 4150 | RUNTIME_ARRAY_BODY(counts)[i] = (*dimensions)->body()[i]; |
| 4151 | if (UNLIKELY(RUNTIME_ARRAY_BODY(counts)[i] < 0)) { |
| 4152 | throwNew(t, |
| 4153 | GcNegativeArraySizeException::Type, |
| 4154 | "%d", |
| 4155 | RUNTIME_ARRAY_BODY(counts)[i]); |
| 4156 | return 0; |
| 4157 | } |
| 4158 | } |
| 4159 | |
| 4160 | object array = makeNewArray( |
| 4161 | t, (*elementClass)->vmClass(), RUNTIME_ARRAY_BODY(counts)[0]); |
| 4162 | PROTECT(t, array); |
| 4163 | |
| 4164 | populateMultiArray( |
| 4165 | t, array, RUNTIME_ARRAY_BODY(counts), 0, (*dimensions)->length()); |
| 4166 | |
| 4167 | return reinterpret_cast<uint64_t>(makeLocalReference(t, array)); |
| 4168 | } |
| 4169 | |
| 4170 | extern "C" AVIAN_EXPORT jobject JNICALL |
| 4171 | EXPORT(JVM_NewMultiArray)(Thread* t, |
nothing calls this directly
no test coverage detected