| 5899 | } |
| 5900 | |
| 5901 | void populateMultiArray(Thread* t, |
| 5902 | object array, |
| 5903 | int32_t* counts, |
| 5904 | unsigned index, |
| 5905 | unsigned dimensions) |
| 5906 | { |
| 5907 | if (index + 1 == dimensions or counts[index] == 0) { |
| 5908 | return; |
| 5909 | } |
| 5910 | |
| 5911 | PROTECT(t, array); |
| 5912 | |
| 5913 | GcByteArray* spec = objectClass(t, array)->name(); |
| 5914 | PROTECT(t, spec); |
| 5915 | |
| 5916 | GcByteArray* elementSpec = makeByteArray(t, spec->length() - 1); |
| 5917 | memcpy(elementSpec->body().begin(), &spec->body()[1], spec->length() - 1); |
| 5918 | |
| 5919 | GcClass* class_ |
| 5920 | = resolveClass(t, objectClass(t, array)->loader(), elementSpec); |
| 5921 | PROTECT(t, class_); |
| 5922 | |
| 5923 | for (int32_t i = 0; i < counts[index]; ++i) { |
| 5924 | GcArray* a = makeArray( |
| 5925 | t, |
| 5926 | ceilingDivide(counts[index + 1] * class_->arrayElementSize(), |
| 5927 | BytesPerWord)); |
| 5928 | a->length() = counts[index + 1]; |
| 5929 | setObjectClass(t, a, class_); |
| 5930 | setField(t, array, ArrayBody + (i * BytesPerWord), a); |
| 5931 | |
| 5932 | populateMultiArray(t, a, counts, index + 1, dimensions); |
| 5933 | } |
| 5934 | } |
| 5935 | |
| 5936 | object interruptLock(Thread* t, GcThread* thread) |
| 5937 | { |
no test coverage detected