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

Function makeArrayClass

src/machine.cpp:2903–2949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2901}
2902
2903GcClass* makeArrayClass(Thread* t,
2904 GcClassLoader* loader,
2905 unsigned dimensions,
2906 GcByteArray* spec,
2907 GcClass* elementClass)
2908{
2909 if (type(t, GcJobject::Type)->vmFlags() & BootstrapFlag) {
2910 PROTECT(t, loader);
2911 PROTECT(t, spec);
2912 PROTECT(t, elementClass);
2913
2914 // Load java.lang.Object if present so we can use its vtable, but
2915 // don't throw an exception if we can't find it. This way, we
2916 // avoid infinite recursion due to trying to create an array to
2917 // make a stack trace for a ClassNotFoundException.
2918 resolveSystemClass(
2919 t, roots(t)->bootLoader(), type(t, GcJobject::Type)->name(), false);
2920 }
2921
2922 GcArray* vtable = cast<GcArray>(t, type(t, GcJobject::Type)->virtualTable());
2923
2924 GcClass* c = t->m->processor->makeClass(t,
2925 0,
2926 0,
2927 2 * BytesPerWord,
2928 BytesPerWord,
2929 dimensions,
2930 elementClass,
2931 type(t, GcArray::Type)->objectMask(),
2932 spec,
2933 0,
2934 type(t, GcJobject::Type),
2935 roots(t)->arrayInterfaceTable(),
2936 vtable,
2937 0,
2938 0,
2939 0,
2940 0,
2941 loader,
2942 vtable->length());
2943
2944 PROTECT(t, c);
2945
2946 t->m->processor->initVtable(t, c);
2947
2948 return c;
2949}
2950
2951void saveLoadedClass(Thread* t, GcClassLoader* loader, GcClass* c)
2952{

Callers 1

resolveArrayClassFunction · 0.85

Calls 15

typeFunction · 0.85
rootsFunction · 0.85
makeByteArrayFunction · 0.85
hashMapFindFunction · 0.85
findLoadedClassFunction · 0.85
saveLoadedClassFunction · 0.85
bodyMethod · 0.80
resolveSystemClassFunction · 0.70
resolveClassFunction · 0.70
lengthMethod · 0.65
abortFunction · 0.50
nameMethod · 0.45

Tested by

no test coverage detected