MCPcopy Create free account
hub / github.com/ReadyTalk/avian / jvmNewMultiArray

Function jvmNewMultiArray

src/classpath-openjdk.cpp:4143–4168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4141}
4142
4143uint64_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
4170extern "C" AVIAN_EXPORT jobject JNICALL
4171 EXPORT(JVM_NewMultiArray)(Thread* t,

Callers

nothing calls this directly

Calls 7

makeNewArrayFunction · 0.85
populateMultiArrayFunction · 0.85
makeLocalReferenceFunction · 0.85
bodyMethod · 0.80
vmClassMethod · 0.80
throwNewFunction · 0.70
lengthMethod · 0.65

Tested by

no test coverage detected