apply classpath-common.h changes

This commit is contained in:
Joshua Warner 2014-07-11 08:38:56 -06:00
parent 00e2307c39
commit 9c93c5989c
6 changed files with 119 additions and 114 deletions

View File

@ -54,19 +54,21 @@ getTrace(Thread* t, unsigned skipCount)
t->m->processor->walkStack(t, &v); t->m->processor->walkStack(t, &v);
if (v.trace == 0) v.trace = makeObjectArray(t, 0); if (v.trace == 0) v.trace = reinterpret_cast<object>(makeObjectArray(t, 0));
return v.trace; return v.trace;
} }
bool bool
compatibleArrayTypes(Thread* t, object a, object b) compatibleArrayTypes(Thread* t, object ao, object bo)
{ {
return classArrayElementSize(t, a) GcClass* a = cast<GcClass>(t, ao);
and classArrayElementSize(t, b) GcClass* b = cast<GcClass>(t, bo);
return a->arrayElementSize()
and b->arrayElementSize()
and (a == b and (a == b
or (not ((classVmFlags(t, a) & PrimitiveFlag) or (not ((a->vmFlags() & PrimitiveFlag)
or (classVmFlags(t, b) & PrimitiveFlag)))); or (b->vmFlags() & PrimitiveFlag))));
} }
void void
@ -266,10 +268,10 @@ clone(Thread* t, object o)
reinterpret_cast<void**>(o) + 1, reinterpret_cast<void**>(o) + 1,
size - BytesPerWord); size - BytesPerWord);
} else { } else {
object classNameSlash = reinterpret_cast<object>(objectClass(t, o)->name()); GcByteArray* classNameSlash = objectClass(t, o)->name();
THREAD_RUNTIME_ARRAY(t, char, classNameDot, byteArrayLength(t, classNameSlash)); THREAD_RUNTIME_ARRAY(t, char, classNameDot, classNameSlash->length());
replace('/', '.', RUNTIME_ARRAY_BODY(classNameDot), replace('/', '.', RUNTIME_ARRAY_BODY(classNameDot),
reinterpret_cast<char*>(&byteArrayBody(t, classNameSlash, 0))); reinterpret_cast<char*>(classNameSlash->body().begin()));
throwNew(t, GcCloneNotSupportedException::Type, "%s", throwNew(t, GcCloneNotSupportedException::Type, "%s",
RUNTIME_ARRAY_BODY(classNameDot)); RUNTIME_ARRAY_BODY(classNameDot));
} }
@ -277,36 +279,38 @@ clone(Thread* t, object o)
return clone; return clone;
} }
object GcStackTraceElement*
makeStackTraceElement(Thread* t, object e) makeStackTraceElement(Thread* t, GcTraceElement* e)
{ {
PROTECT(t, e); PROTECT(t, e);
GcMethod* method = cast<GcMethod>(t, traceElementMethod(t, e)); GcMethod* method = cast<GcMethod>(t, e->method());
PROTECT(t, method); PROTECT(t, method);
object class_name = reinterpret_cast<object>(method->class_()->name()); GcByteArray* class_name = method->class_()->name();
PROTECT(t, class_name); PROTECT(t, class_name);
THREAD_RUNTIME_ARRAY(t, char, s, byteArrayLength(t, class_name)); THREAD_RUNTIME_ARRAY(t, char, s, class_name->length());
replace('/', '.', RUNTIME_ARRAY_BODY(s), replace('/', '.', RUNTIME_ARRAY_BODY(s),
reinterpret_cast<char*>(&byteArrayBody(t, class_name, 0))); reinterpret_cast<char*>(class_name->body().begin()));
class_name = reinterpret_cast<object>(makeString(t, "%s", RUNTIME_ARRAY_BODY(s))); GcString* class_name_string = makeString(t, "%s", RUNTIME_ARRAY_BODY(s));
PROTECT(t, class_name_string);
object method_name = reinterpret_cast<object>(method->name()); GcByteArray* method_name = method->name();
PROTECT(t, method_name); PROTECT(t, method_name);
method_name = reinterpret_cast<object>(t->m->classpath->makeString GcString* method_name_string = t->m->classpath->makeString
(t, method_name, 0, byteArrayLength(t, method_name) - 1)); (t, reinterpret_cast<object>(method_name), 0, method_name->length() - 1);
PROTECT(t, method_name_string);
unsigned line = t->m->processor->lineNumber unsigned line = t->m->processor->lineNumber
(t, method, traceElementIp(t, e)); (t, method, e->ip());
object file = reinterpret_cast<object>(method->class_()->sourceFile()); GcByteArray* file = method->class_()->sourceFile();
file = file ? reinterpret_cast<object>(t->m->classpath->makeString GcString* file_string = file ? t->m->classpath->makeString
(t, file, 0, byteArrayLength(t, file) - 1)) : 0; (t, reinterpret_cast<object>(file), 0, file->length() - 1) : 0;
return reinterpret_cast<object>(makeStackTraceElement(t, cast<GcString>(t, class_name), cast<GcString>(t, method_name), cast<GcString>(t, file), line)); return makeStackTraceElement(t, class_name_string, method_name_string, file_string, line);
} }
object object
@ -314,19 +318,19 @@ translateInvokeResult(Thread* t, unsigned returnCode, object o)
{ {
switch (returnCode) { switch (returnCode) {
case ByteField: case ByteField:
return reinterpret_cast<object>(makeByte(t, intValue(t, o))); return reinterpret_cast<object>(makeByte(t, cast<GcInt>(t, o)->value()));
case BooleanField: case BooleanField:
return reinterpret_cast<object>(makeBoolean(t, intValue(t, o) != 0)); return reinterpret_cast<object>(makeBoolean(t, cast<GcInt>(t, o)->value() != 0));
case CharField: case CharField:
return reinterpret_cast<object>(makeChar(t, intValue(t, o))); return reinterpret_cast<object>(makeChar(t, cast<GcInt>(t, o)->value()));
case ShortField: case ShortField:
return reinterpret_cast<object>(makeShort(t, intValue(t, o))); return reinterpret_cast<object>(makeShort(t, cast<GcInt>(t, o)->value()));
case FloatField: case FloatField:
return reinterpret_cast<object>(makeFloat(t, intValue(t, o))); return reinterpret_cast<object>(makeFloat(t, cast<GcInt>(t, o)->value()));
case IntField: case IntField:
case LongField: case LongField:
@ -335,7 +339,7 @@ translateInvokeResult(Thread* t, unsigned returnCode, object o)
return o; return o;
case DoubleField: case DoubleField:
return reinterpret_cast<object>(makeDouble(t, longValue(t, o))); return reinterpret_cast<object>(makeDouble(t, cast<GcLong>(t, o)->value()));
default: default:
abort(t); abort(t);
@ -372,14 +376,14 @@ resolveJType(Thread* t, GcClassLoader* loader, const char* spec, unsigned specLe
return getJClass(t, resolveClassBySpec(t, loader, spec, specLength)); return getJClass(t, resolveClassBySpec(t, loader, spec, specLength));
} }
object GcPair*
resolveParameterTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec, resolveParameterTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
unsigned* parameterCount, unsigned* returnTypeSpec) unsigned* parameterCount, unsigned* returnTypeSpec)
{ {
PROTECT(t, loader); PROTECT(t, loader);
PROTECT(t, spec); PROTECT(t, spec);
object list = 0; GcPair* list = 0;
PROTECT(t, list); PROTECT(t, list);
unsigned offset = 1; unsigned offset = 1;
@ -396,7 +400,7 @@ resolveParameterTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
(t, loader, reinterpret_cast<char*>(&spec->body()[start]), (t, loader, reinterpret_cast<char*>(&spec->body()[start]),
offset - start); offset - start);
list = reinterpret_cast<object>(makePair(t, reinterpret_cast<object>(type), list)); list = makePair(t, reinterpret_cast<object>(type), reinterpret_cast<object>(list));
++ count; ++ count;
} break; } break;
@ -420,13 +424,13 @@ resolveParameterTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
(t, loader, reinterpret_cast<char*>(&spec->body()[start]), (t, loader, reinterpret_cast<char*>(&spec->body()[start]),
offset - start); offset - start);
list = reinterpret_cast<object>(makePair(t, reinterpret_cast<object>(type), list)); list = makePair(t, reinterpret_cast<object>(type), reinterpret_cast<object>(list));
++ count; ++ count;
} break; } break;
default: default:
list = reinterpret_cast<object>(makePair list = makePair
(t, reinterpret_cast<object>(primitiveClass(t, spec->body()[offset])), list)); (t, reinterpret_cast<object>(primitiveClass(t, spec->body()[offset])), reinterpret_cast<object>(list));
++ offset; ++ offset;
++ count; ++ count;
break; break;
@ -442,7 +446,7 @@ object
resolveParameterJTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec, resolveParameterJTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
unsigned* parameterCount, unsigned* returnTypeSpec) unsigned* parameterCount, unsigned* returnTypeSpec)
{ {
object list = resolveParameterTypes GcPair* list = resolveParameterTypes
(t, loader, spec, parameterCount, returnTypeSpec); (t, loader, spec, parameterCount, returnTypeSpec);
PROTECT(t, list); PROTECT(t, list);
@ -452,9 +456,9 @@ resolveParameterJTypes(Thread* t, GcClassLoader* loader, GcByteArray* spec,
PROTECT(t, array); PROTECT(t, array);
for (int i = *parameterCount - 1; i >= 0; --i) { for (int i = *parameterCount - 1; i >= 0; --i) {
object c = reinterpret_cast<object>(getJClass(t, cast<GcClass>(t, pairFirst(t, list)))); object c = reinterpret_cast<object>(getJClass(t, cast<GcClass>(t, list->first())));
set(t, array, ArrayBody + (i * BytesPerWord), c); set(t, array, ArrayBody + (i * BytesPerWord), c);
list = pairSecond(t, list); list = cast<GcPair>(t, list->second());
} }
return array; return array;
@ -470,21 +474,22 @@ resolveExceptionJTypes(Thread* t, GcClassLoader* loader, GcMethodAddendum* adden
PROTECT(t, loader); PROTECT(t, loader);
PROTECT(t, addendum); PROTECT(t, addendum);
GcShortArray* exceptionTable = cast<GcShortArray>(t, addendum->exceptionTable());
PROTECT(t, exceptionTable);
object array = makeObjectArray object array = makeObjectArray
(t, type(t, GcJclass::Type), (t, type(t, GcJclass::Type),
shortArrayLength(t, addendum->exceptionTable())); exceptionTable->length());
PROTECT(t, array); PROTECT(t, array);
for (unsigned i = 0; i < shortArrayLength for (unsigned i = 0; i < exceptionTable->length(); ++i)
(t, addendum->exceptionTable()); ++i)
{ {
uint16_t index = shortArrayBody uint16_t index = exceptionTable->body()[i] - 1;
(t, addendum->exceptionTable(), i) - 1;
object o = singletonObject(t, addendum->pool(), index); object o = singletonObject(t, addendum->pool()->as<GcSingleton>(t), index);
if (objectClass(t, o) == type(t, GcReference::Type)) { if (objectClass(t, o) == type(t, GcReference::Type)) {
o = reinterpret_cast<object>(resolveClass(t, loader, cast<GcByteArray>(t, referenceName(t, o)))); o = reinterpret_cast<object>(resolveClass(t, loader, cast<GcByteArray>(t, cast<GcReference>(t, o)->name())));
set(t, reinterpret_cast<object>(addendum->pool()), SingletonBody + (index * BytesPerWord), set(t, reinterpret_cast<object>(addendum->pool()), SingletonBody + (index * BytesPerWord),
o); o);
@ -612,11 +617,11 @@ intercept(Thread* t, GcClass* c, const char* name, const char* spec,
// through the vtable. // through the vtable.
clone->flags() |= ACC_PRIVATE; clone->flags() |= ACC_PRIVATE;
object native = reinterpret_cast<object>(makeNativeIntercept(t, function, true, reinterpret_cast<object>(clone))); GcNativeIntercept* native = makeNativeIntercept(t, function, true, reinterpret_cast<object>(clone));
PROTECT(t, native); PROTECT(t, native);
object runtimeData = reinterpret_cast<object>(getMethodRuntimeData(t, m)); GcMethodRuntimeData* runtimeData = getMethodRuntimeData(t, m);
set(t, runtimeData, MethodRuntimeDataNative, native); set(t, runtimeData, MethodRuntimeDataNative, native);
} }
@ -626,7 +631,7 @@ intercept(Thread* t, GcClass* c, const char* name, const char* spec,
// be uncommented for debugging purposes. // be uncommented for debugging purposes.
// fprintf(stderr, "unable to find %s%s in %s\n", // fprintf(stderr, "unable to find %s%s in %s\n",
// name, spec, &byteArrayBody(t, className(t, c), 0)); // name, spec, &byteArrayBody(t, c->name(), 0));
// abort(t); // abort(t);
} }
@ -637,23 +642,23 @@ getFinder(Thread* t, const char* name, unsigned nameLength)
{ {
ACQUIRE(t, t->m->referenceLock); ACQUIRE(t, t->m->referenceLock);
for (object p = root(t, Machine::VirtualFileFinders); for (GcFinder* p = cast<GcFinder>(t, root(t, Machine::VirtualFileFinders));
p; p = finderNext(t, p)) p; p = p->next())
{ {
if (byteArrayLength(t, finderName(t, p)) == nameLength if (p->name()->length() == nameLength
and strncmp(reinterpret_cast<const char*> and strncmp(reinterpret_cast<const char*>
(&byteArrayBody(t, finderName(t, p), 0)), (p->name()->body().begin()),
name, nameLength)) name, nameLength))
{ {
return static_cast<Finder*>(finderFinder(t, p)); return static_cast<Finder*>(p->finder());
} }
} }
object n = reinterpret_cast<object>(makeByteArray(t, nameLength + 1)); GcByteArray* n = makeByteArray(t, nameLength + 1);
memcpy(&byteArrayBody(t, n, 0), name, nameLength); memcpy(n->body().begin(), name, nameLength);
void* p = t->m->libraries->resolve void* p = t->m->libraries->resolve
(reinterpret_cast<const char*>(&byteArrayBody(t, n, 0))); (reinterpret_cast<const char*>(n->body().begin()));
if (p) { if (p) {
uint8_t* (*function)(unsigned*); uint8_t* (*function)(unsigned*);
@ -663,10 +668,10 @@ getFinder(Thread* t, const char* name, unsigned nameLength)
uint8_t* data = function(&size); uint8_t* data = function(&size);
if (data) { if (data) {
Finder* f = makeFinder(t->m->system, t->m->heap, data, size); Finder* f = makeFinder(t->m->system, t->m->heap, data, size);
object finder = reinterpret_cast<object>(makeFinder GcFinder* finder = makeFinder
(t, f, n, root(t, Machine::VirtualFileFinders))); (t, f, n, cast<GcFinder>(t, root(t, Machine::VirtualFileFinders)));
setRoot(t, Machine::VirtualFileFinders, finder); setRoot(t, Machine::VirtualFileFinders, reinterpret_cast<object>(finder));
return f; return f;
} }
@ -676,21 +681,21 @@ getFinder(Thread* t, const char* name, unsigned nameLength)
} }
object object
getDeclaredClasses(Thread* t, object c, bool publicOnly) getDeclaredClasses(Thread* t, GcClass* c, bool publicOnly)
{ {
object addendum = classAddendum(t, c); GcClassAddendum* addendum = c->addendum();
if (addendum) { if (addendum) {
object table = classAddendumInnerClassTable(t, addendum); GcArray* table = cast<GcArray>(t, addendum->innerClassTable());
if (table) { if (table) {
PROTECT(t, table); PROTECT(t, table);
unsigned count = 0; unsigned count = 0;
for (unsigned i = 0; i < arrayLength(t, table); ++i) { for (unsigned i = 0; i < table->length(); ++i) {
object reference = arrayBody(t, table, i); GcInnerClassReference* reference = cast<GcInnerClassReference>(t, table->body()[i]);
object outer = innerClassReferenceOuter(t, reference); GcByteArray* outer = reference->outer();
if (outer and byteArrayEqual(t, outer, className(t, c)) if (outer and byteArrayEqual(t, reinterpret_cast<object>(outer), reinterpret_cast<object>(c->name()))
and ((not publicOnly) and ((not publicOnly)
or (innerClassReferenceFlags(t, reference) & ACC_PUBLIC))) or (reference->flags() & ACC_PUBLIC)))
{ {
++ count; ++ count;
} }
@ -699,19 +704,19 @@ getDeclaredClasses(Thread* t, object c, bool publicOnly)
object result = makeObjectArray(t, type(t, GcJclass::Type), count); object result = makeObjectArray(t, type(t, GcJclass::Type), count);
PROTECT(t, result); PROTECT(t, result);
for (unsigned i = 0; i < arrayLength(t, table); ++i) { for (unsigned i = 0; i < table->length(); ++i) {
object reference = arrayBody(t, table, i); GcInnerClassReference* reference = cast<GcInnerClassReference>(t, table->body()[i]);
object outer = innerClassReferenceOuter(t, reference); GcByteArray* outer = reference->outer();
if (outer and byteArrayEqual(t, outer, className(t, c)) if (outer and byteArrayEqual(t, reinterpret_cast<object>(outer), reinterpret_cast<object>(c->name()))
and ((not publicOnly) and ((not publicOnly)
or (innerClassReferenceFlags(t, reference) & ACC_PUBLIC))) or (reference->flags() & ACC_PUBLIC)))
{ {
object inner = reinterpret_cast<object>(getJClass( object inner = reinterpret_cast<object>(getJClass(
t, t,
resolveClass( resolveClass(
t, t,
cast<GcClassLoader>(t, classLoader(t, c)), c->loader(),
cast<GcByteArray>(t, innerClassReferenceInner(t, arrayBody(t, table, i)))))); reference->inner())));
-- count; -- count;
set(t, result, ArrayBody + (count * BytesPerWord), inner); set(t, result, ArrayBody + (count * BytesPerWord), inner);
@ -726,23 +731,23 @@ getDeclaredClasses(Thread* t, object c, bool publicOnly)
} }
GcJclass* GcJclass*
getDeclaringClass(Thread* t, object c) getDeclaringClass(Thread* t, GcClass* c)
{ {
object addendum = classAddendum(t, c); GcClassAddendum* addendum = c->addendum();
if (addendum) { if (addendum) {
object table = classAddendumInnerClassTable(t, addendum); GcArray* table = cast<GcArray>(t, addendum->innerClassTable());
if (table) { if (table) {
for (unsigned i = 0; i < arrayLength(t, table); ++i) { for (unsigned i = 0; i < table->length(); ++i) {
object reference = arrayBody(t, table, i); GcInnerClassReference* reference = cast<GcInnerClassReference>(t, table->body()[i]);
if (innerClassReferenceOuter(t, reference) and strcmp if (reference->outer() and strcmp
(&byteArrayBody(t, innerClassReferenceInner(t, reference), 0), (reference->inner()->body().begin(),
&byteArrayBody(t, className(t, c), 0)) == 0) c->name()->body().begin()) == 0)
{ {
return getJClass( return getJClass(
t, t,
resolveClass(t, resolveClass(t,
cast<GcClassLoader>(t, classLoader(t, c)), c->loader(),
cast<GcByteArray>(t, innerClassReferenceOuter(t, reference)))); reference->outer()));
} }
} }
} }
@ -752,25 +757,25 @@ getDeclaringClass(Thread* t, object c)
} }
unsigned unsigned
classModifiers(Thread* t, object c) classModifiers(Thread* t, GcClass* c)
{ {
object addendum = classAddendum(t, c); GcClassAddendum* addendum = c->addendum();
if (addendum) { if (addendum) {
object table = classAddendumInnerClassTable(t, addendum); GcArray* table = cast<GcArray>(t, addendum->innerClassTable());
if (table) { if (table) {
for (unsigned i = 0; i < arrayLength(t, table); ++i) { for (unsigned i = 0; i < table->length(); ++i) {
object reference = arrayBody(t, table, i); GcInnerClassReference* reference = cast<GcInnerClassReference>(t, table->body()[i]);
if (0 == strcmp if (0 == strcmp
(&byteArrayBody(t, className(t, c), 0), (c->name()->body().begin(),
&byteArrayBody(t, innerClassReferenceInner(t, reference), 0))) reference->inner()->body().begin()))
{ {
return innerClassReferenceFlags(t, reference); return reference->flags();
} }
} }
} }
} }
return classFlags(t, c); return c->flags();
} }
} // namespace vm } // namespace vm

View File

@ -219,9 +219,9 @@ translateStackTrace(Thread* t, object raw)
PROTECT(t, array); PROTECT(t, array);
for (unsigned i = 0; i < objectArrayLength(t, array); ++i) { for (unsigned i = 0; i < objectArrayLength(t, array); ++i) {
object e = makeStackTraceElement(t, objectArrayBody(t, raw, i)); GcStackTraceElement* e = makeStackTraceElement(t, cast<GcTraceElement>(t, objectArrayBody(t, raw, i)));
set(t, array, ArrayBody + (i * BytesPerWord), e); set(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(e));
} }
return array; return array;
@ -1116,7 +1116,7 @@ Avian_java_lang_Class_getDeclaredClasses
{ {
return reinterpret_cast<intptr_t> return reinterpret_cast<intptr_t>
(getDeclaredClasses (getDeclaredClasses
(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0])), (t, cast<GcClass>(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0]))),
arguments[1])); arguments[1]));
} }
@ -1126,7 +1126,7 @@ Avian_java_lang_Class_getDeclaringClass
{ {
return reinterpret_cast<intptr_t> return reinterpret_cast<intptr_t>
(getDeclaringClass (getDeclaringClass
(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0])))); (t, cast<GcClass>(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0])))));
} }
extern "C" AVIAN_EXPORT int64_t JNICALL extern "C" AVIAN_EXPORT int64_t JNICALL
@ -1711,7 +1711,7 @@ Avian_java_lang_Class_getModifiers
(Thread* t, object, uintptr_t* arguments) (Thread* t, object, uintptr_t* arguments)
{ {
return classModifiers return classModifiers
(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0]))); (t, cast<GcClass>(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0]))));
} }
extern "C" AVIAN_EXPORT int64_t JNICALL extern "C" AVIAN_EXPORT int64_t JNICALL

View File

@ -642,8 +642,8 @@ Avian_java_lang_Throwable_resolveTrace
PROTECT(t, array); PROTECT(t, array);
for (unsigned i = 0; i < length; ++i) { for (unsigned i = 0; i < length; ++i) {
object ste = makeStackTraceElement(t, objectArrayBody(t, trace, i)); GcStackTraceElement* ste = makeStackTraceElement(t, cast<GcTraceElement>(t, objectArrayBody(t, trace, i)));
set(t, array, ArrayBody + (i * BytesPerWord), ste); set(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(ste));
} }
return reinterpret_cast<int64_t>(array); return reinterpret_cast<int64_t>(array);

View File

@ -3232,8 +3232,8 @@ jvmGetStackTraceElement(Thread* t, uintptr_t* arguments)
return reinterpret_cast<uint64_t> return reinterpret_cast<uint64_t>
(makeLocalReference (makeLocalReference
(t, makeStackTraceElement (t, reinterpret_cast<object>(makeStackTraceElement
(t, objectArrayBody(t, throwableTrace(t, *throwable), index)))); (t, cast<GcTraceElement>(t, objectArrayBody(t, throwableTrace(t, *throwable), index))))));
} }
extern "C" AVIAN_EXPORT jobject JNICALL extern "C" AVIAN_EXPORT jobject JNICALL
@ -3448,8 +3448,8 @@ jvmDumpThreads(Thread* t, uintptr_t* arguments)
PROTECT(t, array); PROTECT(t, array);
for (unsigned traceIndex = 0; traceIndex < traceLength; ++ traceIndex) { for (unsigned traceIndex = 0; traceIndex < traceLength; ++ traceIndex) {
object ste = makeStackTraceElement object ste = reinterpret_cast<object>(makeStackTraceElement
(t, objectArrayBody(t, trace, traceIndex)); (t, cast<GcTraceElement>(t, objectArrayBody(t, trace, traceIndex))));
set(t, array, ArrayBody + (traceIndex * BytesPerWord), ste); set(t, array, ArrayBody + (traceIndex * BytesPerWord), ste);
} }
@ -4188,7 +4188,7 @@ uint64_t
jvmGetClassModifiers(Thread* t, uintptr_t* arguments) jvmGetClassModifiers(Thread* t, uintptr_t* arguments)
{ {
return classModifiers return classModifiers
(t, jclassVmClass(t, *reinterpret_cast<jobject>(arguments[0]))); (t, cast<GcClass>(t, jclassVmClass(t, *reinterpret_cast<jobject>(arguments[0]))));
} }
extern "C" AVIAN_EXPORT jint JNICALL extern "C" AVIAN_EXPORT jint JNICALL
@ -4205,7 +4205,7 @@ jvmGetDeclaredClasses(Thread* t, uintptr_t* arguments)
return reinterpret_cast<uintptr_t> return reinterpret_cast<uintptr_t>
(makeLocalReference (makeLocalReference
(t, getDeclaredClasses (t, getDeclaredClasses
(t, jclassVmClass(t, *reinterpret_cast<jobject>(arguments[0])), false))); (t, cast<GcClass>(t, jclassVmClass(t, *reinterpret_cast<jobject>(arguments[0]))), false)));
} }
extern "C" AVIAN_EXPORT jobjectArray JNICALL extern "C" AVIAN_EXPORT jobjectArray JNICALL
@ -4222,7 +4222,7 @@ jvmGetDeclaringClass(Thread* t, uintptr_t* arguments)
return reinterpret_cast<uintptr_t> return reinterpret_cast<uintptr_t>
(makeLocalReference (makeLocalReference
(t, reinterpret_cast<object>(getDeclaringClass (t, reinterpret_cast<object>(getDeclaringClass
(t, jclassVmClass(t, *reinterpret_cast<jobject>(arguments[0])))))); (t, cast<GcClass>(t, jclassVmClass(t, *reinterpret_cast<jobject>(arguments[0])))))));
} }
extern "C" AVIAN_EXPORT jclass JNICALL extern "C" AVIAN_EXPORT jclass JNICALL

View File

@ -227,7 +227,7 @@ turnOffTheLights(Thread* t)
} }
for (object p = root(t, Machine::VirtualFileFinders); for (object p = root(t, Machine::VirtualFileFinders);
p; p = finderNext(t, p)) p; p = reinterpret_cast<object>(cast<GcFinder>(t, p)->next()))
{ {
static_cast<Finder*>(finderFinder(t, p))->dispose(); static_cast<Finder*>(finderFinder(t, p))->dispose();
} }

View File

@ -63,11 +63,6 @@
(extends native) (extends native)
(object original)) (object original))
(type finder
(void* finder)
(object name)
(object next))
(type region (type region
(void* region) (void* region)
(uint32_t position)) (uint32_t position))
@ -312,6 +307,11 @@
(extends jobject) (extends jobject)
(array int8_t body)) (array int8_t body))
(type finder
(void* finder)
(byteArray name)
(finder next))
(type booleanArray [Z (type booleanArray [Z
(extends jobject) (extends jobject)
(array uint8_t body)) (array uint8_t body))