diff --git a/classpath/java-net.cpp b/classpath/java-net.cpp index de8090d26d..81f558d128 100644 --- a/classpath/java-net.cpp +++ b/classpath/java-net.cpp @@ -58,20 +58,20 @@ Java_java_net_Socket_closeInput(JNIEnv* e, jclass, SOCKET sock) { extern "C" JNIEXPORT void JNICALL Avian_java_net_Socket_send(vm::Thread* t, vm::object, uintptr_t* arguments) { /* SOCKET s, object buffer_obj, int start_pos, int count */ SOCKET& s = *(reinterpret_cast(&arguments[0])); - vm::object buffer_obj = reinterpret_cast(arguments[2]); + vm::GcByteArray* buffer_obj = vm::cast(t, reinterpret_cast(arguments[2])); int32_t& start_pos = *(reinterpret_cast(&arguments[3])); int32_t& count = *(reinterpret_cast(&arguments[4])); - char* buffer = reinterpret_cast(&vm::byteArrayBody(t, buffer_obj, start_pos)); + char* buffer = reinterpret_cast(&buffer_obj->body()[start_pos]); avian::classpath::sockets::send((JNIEnv*)t, s, buffer, count); } extern "C" JNIEXPORT int64_t JNICALL Avian_java_net_Socket_recv(vm::Thread* t, vm::object, uintptr_t* arguments) { /* SOCKET s, object buffer_obj, int start_pos, int count */ SOCKET& s = *(reinterpret_cast(&arguments[0])); - vm::object buffer_obj = reinterpret_cast(arguments[2]); + vm::GcByteArray* buffer_obj = vm::cast(t, reinterpret_cast(arguments[2])); int32_t& start_pos = *(reinterpret_cast(&arguments[3])); int32_t& count = *(reinterpret_cast(&arguments[4])); - char* buffer = reinterpret_cast(&vm::byteArrayBody(t, buffer_obj, start_pos)); + char* buffer = reinterpret_cast(&buffer_obj->body()[start_pos]); return avian::classpath::sockets::recv((JNIEnv*)t, s, buffer, count); } diff --git a/src/avian/classpath-common.h b/src/avian/classpath-common.h index 802c6526da..d63480567b 100644 --- a/src/avian/classpath-common.h +++ b/src/avian/classpath-common.h @@ -497,7 +497,7 @@ resolveExceptionJTypes(Thread* t, GcClassLoader* loader, GcMethodAddendum* adden o = reinterpret_cast(getJClass(t, cast(t, o))); - set(t, array, ArrayBody + (i * BytesPerWord), o); + set(t, reinterpret_cast(array), ArrayBody + (i * BytesPerWord), o); } return array; diff --git a/src/avian/machine.h b/src/avian/machine.h index 430a85c3da..d1e242e0e2 100644 --- a/src/avian/machine.h +++ b/src/avian/machine.h @@ -1356,7 +1356,6 @@ vmRun_returnAddress(); class GcThread; class GcThrowable; class GcString; -class GcField; class Thread { public: diff --git a/src/classpath-android.cpp b/src/classpath-android.cpp index 7f2d2a98a9..c4ec77fc4b 100644 --- a/src/classpath-android.cpp +++ b/src/classpath-android.cpp @@ -327,10 +327,10 @@ class MyClasspath : public Classpath { { return cast(t, objectClass(t, jmethod) == type(t, GcJmethod::Type) ? arrayBody - (t, jclassVmClass(t, jmethodDeclaringClass(t, jmethod))->methodTable(), + (t, jmethodDeclaringClass(t, jmethod)->vmClass()->methodTable(), jmethodSlot(t, jmethod)) : arrayBody - (t,jclassVmClass(t, jconstructorDeclaringClass(t, jmethod))->methodTable(), + (t, jconstructorDeclaringClass(t, jmethod)->vmClass()->methodTable(), jconstructorSlot(t, jmethod))); } @@ -350,7 +350,7 @@ class MyClasspath : public Classpath { getVMField(Thread* t, object jfield) { return cast(t, arrayBody - (t, jclassVmClass(t, jfieldDeclaringClass(t, jfield))->fieldTable(), + (t, jfieldDeclaringClass(t, jfield)->vmClass()->fieldTable(), jfieldSlot(t, jfield))); } @@ -1402,7 +1402,7 @@ Avian_sun_misc_Unsafe_objectFieldOffset object jfield = reinterpret_cast(arguments[1]); return fieldOffset (t, arrayBody - (t, jclassVmClass(t, jfieldDeclaringClass(t, jfield))->fieldTable(), + (t, jfieldDeclaringClass(t, jfield)->vmClass()->fieldTable(), jfieldSlot(t, jfield))); } @@ -1878,9 +1878,9 @@ Avian_java_lang_reflect_Method_isAnnotationPresent (t, jclassVmClass(t, reinterpret_cast(arguments[0]))->methodTable(), arguments[1]); - object addendum = methodAddendum(t, method); + GcMethodAddendum* addendum = methodAddendum(t, method); if (addendum) { - object table = addendumAnnotationTable(t, addendum); + object table = addendum->annotationTable(); if (table) { for (unsigned i = 0; i < objectArrayLength(t, table); ++i) { if (objectArrayBody(t, objectArrayBody(t, table, i), 1) @@ -1903,9 +1903,9 @@ Avian_java_lang_reflect_Method_getAnnotation (t, jclassVmClass(t, reinterpret_cast(arguments[0]))->methodTable(), arguments[1]); - object addendum = methodAddendum(t, method); + GcMethodAddendum* addendum = methodAddendum(t, method); if (addendum) { - object table = addendumAnnotationTable(t, addendum); + object table = addendum->annotationTable(); if (table) { for (unsigned i = 0; i < objectArrayLength(t, table); ++i) { if (objectArrayBody(t, objectArrayBody(t, table, i), 1) @@ -1921,7 +1921,7 @@ Avian_java_lang_reflect_Method_getAnnotation return reinterpret_cast (t->m->processor->invoke - (t, get, 0, classLoader(t, methodClass(t, method)), + (t, get, 0, methodClass(t, method)->loader(), objectArrayBody(t, table, i))); } } @@ -1939,9 +1939,9 @@ Avian_java_lang_reflect_Method_getDeclaredAnnotations (t, jclassVmClass(t, reinterpret_cast(arguments[0]))->methodTable(), arguments[1]); - object addendum = methodAddendum(t, method); + GcMethodAddendum* addendum = methodAddendum(t, method); if (addendum) { - object table = addendumAnnotationTable(t, addendum); + object table = addendum->annotationTable(); if (table) { PROTECT(t, method); PROTECT(t, table); @@ -1960,7 +1960,7 @@ Avian_java_lang_reflect_Method_getDeclaredAnnotations for (unsigned i = 0; i < objectArrayLength(t, table); ++i) { object a = t->m->processor->invoke - (t, get, 0, classLoader(t, methodClass(t, method)), + (t, get, 0, methodClass(t, method)->loader(), objectArrayBody(t, table, i)); set(t, array, ArrayBody + (i * BytesPerWord), a); @@ -1987,9 +1987,9 @@ extern "C" AVIAN_EXPORT int64_t JNICALL jclassVmClass(t, reinterpret_cast(arguments[0]))->fieldTable(), arguments[1])); - object addendum = reinterpret_cast(field->addendum()); + GcFieldAddendum* addendum = field->addendum(); if (addendum) { - object table = addendumAnnotationTable(t, addendum); + object table = addendum->annotationTable(); if (table) { PROTECT(t, field); PROTECT(t, table); @@ -2040,7 +2040,7 @@ Avian_java_lang_reflect_Method_getDefaultValue (t, jclassVmClass(t, reinterpret_cast(arguments[1]))->methodTable(), arguments[2]); - object addendum = methodAddendum(t, method); + GcMethodAddendum* addendum = methodAddendum(t, method); if (addendum) { GcMethod* get = resolveMethod (t, cast(t, root(t, Machine::BootLoader)), "avian/Classes", @@ -2050,7 +2050,7 @@ Avian_java_lang_reflect_Method_getDefaultValue return reinterpret_cast (t->m->processor->invoke - (t, get, 0, classLoader(t, methodClass(t, method)), addendum)); + (t, get, 0, methodClass(t, method)->loader(), addendum)); } return 0; @@ -2180,9 +2180,9 @@ Avian_java_lang_reflect_Field_getAnnotation (t, jclassVmClass(t, reinterpret_cast(arguments[0]))->fieldTable(), arguments[1])); - object addendum = reinterpret_cast(field->addendum()); + GcFieldAddendum* addendum = field->addendum(); if (addendum) { - object table = addendumAnnotationTable(t, addendum); + object table = addendum->annotationTable(); if (table) { for (unsigned i = 0; i < objectArrayLength(t, table); ++i) { if (objectArrayBody(t, objectArrayBody(t, table, i), 1) diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 38bd6d61f6..889c4e1827 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -351,7 +351,7 @@ object makeJconstructor(Thread* t, GcMethod* vmMethod, int index = -1); object -makeJfield(Thread* t, object vmField, int index = -1); +makeJfield(Thread* t, GcField* vmField, int index = -1); #ifdef AVIAN_OPENJDK_SRC void @@ -593,24 +593,24 @@ class MyClasspath : public Classpath { { return cast(t, objectClass(t, jmethod) == type(t, GcJmethod::Type) ? arrayBody - (t, jclassVmClass(t, jmethodClazz(t, jmethod))->methodTable(), + (t, jmethodClazz(t, jmethod)->vmClass()->methodTable(), jmethodSlot(t, jmethod)) : arrayBody - (t, jclassVmClass(t, jconstructorClazz(t, jmethod))->methodTable(), + (t, jconstructorClazz(t, jmethod)->vmClass()->methodTable(), jconstructorSlot(t, jmethod))); } virtual object makeJField(Thread* t, GcField* vmField) { - return reinterpret_cast(makeJfield(t, reinterpret_cast(vmField))); + return reinterpret_cast(makeJfield(t, vmField)); } virtual GcField* getVMField(Thread* t, object jfield) { return cast(t, arrayBody - (t, jclassVmClass(t, jfieldClazz(t, jfield))->fieldTable(), jfieldSlot(t, jfield))); + (t, jfieldClazz(t, jfield)->vmClass()->fieldTable(), jfieldSlot(t, jfield))); } virtual void @@ -2136,8 +2136,8 @@ countFields(Thread* t, GcClass* c, bool publicOnly) if (publicOnly) { unsigned count = 0; for (unsigned i = 0; i < arrayLength(t, table); ++i) { - object vmField = arrayBody(t, table, i); - if (fieldFlags(t, vmField) & ACC_PUBLIC) { + GcField* vmField = cast(t, arrayBody(t, table, i)); + if (vmField->flags() & ACC_PUBLIC) { ++ count; } } @@ -2387,30 +2387,29 @@ makeJconstructor(Thread* t, GcMethod* vmMethod, int index) } object -makeJfield(Thread* t, object vmField, int index) +makeJfield(Thread* t, GcField* vmField, int index) { PROTECT(t, vmField); object name = intern (t, reinterpret_cast(t->m->classpath->makeString - (t, fieldName(t, vmField), 0, byteArrayLength - (t, fieldName(t, vmField)) - 1))); + (t, reinterpret_cast(vmField->name()), 0, vmField->name()->length() - 1))); PROTECT(t, name); GcClass* type = resolveClassBySpec - (t, cast(t, classLoader(t, fieldClass(t, vmField))), + (t, vmField->class_()->loader(), reinterpret_cast - (&byteArrayBody(t, fieldSpec(t, vmField), 0)), - byteArrayLength(t, fieldSpec(t, vmField)) - 1); + (vmField->spec()->body().begin()), + vmField->spec()->length() - 1); PROTECT(t, type); GcJclass* jtype = getJClass(t, type); object signature; object annotationTable; - object addendum = fieldAddendum(t, vmField); + GcFieldAddendum* addendum = vmField->addendum(); if (addendum) { - signature = addendumSignature(t, addendum); + signature = addendum->signature(); if (signature) { PROTECT(t, addendum); @@ -2418,7 +2417,7 @@ makeJfield(Thread* t, object vmField, int index) (t, signature, 0, byteArrayLength(t, signature) - 1)); } - annotationTable = addendumAnnotationTable(t, addendum); + annotationTable = addendum->annotationTable(); } else { signature = 0; annotationTable = 0; @@ -2428,16 +2427,16 @@ makeJfield(Thread* t, object vmField, int index) PROTECT(t, annotationTable); if (annotationTable) { - GcClassRuntimeData* runtimeData = getClassRuntimeData(t, cast(t, fieldClass(t, vmField))); + GcClassRuntimeData* runtimeData = getClassRuntimeData(t, vmField->class_()); - set(t, reinterpret_cast(runtimeData), ClassRuntimeDataPool, - addendumPool(t, fieldAddendum(t, vmField))); + set(t, runtimeData, ClassRuntimeDataPool, + vmField->addendum()->pool()); } if (index == -1) { - object table = classFieldTable(t, fieldClass(t, vmField)); + object table = vmField->class_()->fieldTable(); for (unsigned i = 0; i < arrayLength(t, table); ++i) { - if (vmField == arrayBody(t, table, i)) { + if (reinterpret_cast(vmField) == arrayBody(t, table, i)) { index = i; break; } @@ -2446,11 +2445,10 @@ makeJfield(Thread* t, object vmField, int index) expect(t, index != -1); - GcJclass* jclass = getJClass(t, cast(t, fieldClass(t, vmField))); + GcJclass* jclass = getJClass(t, vmField->class_()); return reinterpret_cast(makeJfield - (t, true, 0, jclass, index, cast(t, name), jtype, fieldFlags - (t, vmField), cast(t, signature), 0, cast(t, annotationTable), 0, 0, 0, 0)); + (t, true, 0, jclass, index, cast(t, name), jtype, vmField->flags(), cast(t, signature), 0, cast(t, annotationTable), 0, 0, 0, 0)); } void @@ -2595,7 +2593,7 @@ Avian_sun_misc_Unsafe_staticFieldOffset object jfield = reinterpret_cast(arguments[1]); return fieldOffset (t, arrayBody - (t, jclassVmClass(t, jfieldClazz(t, jfield))->fieldTable(), jfieldSlot(t, jfield))); + (t, jfieldClazz(t, jfield)->vmClass()->fieldTable(), jfieldSlot(t, jfield))); } extern "C" AVIAN_EXPORT int64_t JNICALL @@ -2603,8 +2601,7 @@ Avian_sun_misc_Unsafe_staticFieldBase (Thread* t, object, uintptr_t* arguments) { return reinterpret_cast - (jclassVmClass - (t, jfieldClazz(t, reinterpret_cast(arguments[1])))->staticTable()); + (jfieldClazz(t, reinterpret_cast(arguments[1]))->vmClass()->staticTable()); } extern "C" AVIAN_EXPORT int64_t JNICALL @@ -2614,7 +2611,7 @@ Avian_sun_misc_Unsafe_objectFieldOffset object jfield = reinterpret_cast(arguments[1]); return fieldOffset (t, arrayBody - (t, jclassVmClass(t, jfieldClazz(t, jfield))->fieldTable(), jfieldSlot(t, jfield))); + (t, jfieldClazz(t, jfield)->vmClass()->fieldTable(), jfieldSlot(t, jfield))); } extern "C" AVIAN_EXPORT int64_t JNICALL @@ -3487,10 +3484,8 @@ jvmGetClassContext(Thread* t, uintptr_t*) for (unsigned i = 0; i < objectArrayLength(t, trace); ++i) { object c = reinterpret_cast(getJClass( t, - cast( - t, - methodClass(t, - traceElementMethod(t, objectArrayBody(t, trace, i)))))); + methodClass(t, + traceElementMethod(t, objectArrayBody(t, trace, i))))); set(t, context, ArrayBody + (i * BytesPerWord), c); } @@ -3902,7 +3897,7 @@ jvmFindClassFromClassLoader(Thread* t, uintptr_t* arguments) extern "C" AVIAN_EXPORT jclass JNICALL EXPORT(JVM_FindClassFromClassLoader)(Thread* t, const char* name, - jboolean init, jobject* loader, + jboolean init, jobject loader, jboolean throwError) { uintptr_t arguments[] = { reinterpret_cast(name), @@ -3944,7 +3939,7 @@ jvmFindLoadedClass(Thread* t, uintptr_t* arguments) } extern "C" AVIAN_EXPORT jclass JNICALL -EXPORT(JVM_FindLoadedClass)(Thread* t, jobject* loader, jstring name) +EXPORT(JVM_FindLoadedClass)(Thread* t, jobject loader, jstring name) { uintptr_t arguments[] = { reinterpret_cast(loader), reinterpret_cast(name) }; @@ -3965,7 +3960,7 @@ jvmDefineClass(Thread* t, uintptr_t* arguments) } extern "C" AVIAN_EXPORT jclass JNICALL -EXPORT(JVM_DefineClass)(Thread* t, const char*, jobject* loader, +EXPORT(JVM_DefineClass)(Thread* t, const char*, jobject loader, const uint8_t* data, jsize length, jobject) { uintptr_t arguments[] = { reinterpret_cast(loader), @@ -3976,7 +3971,7 @@ EXPORT(JVM_DefineClass)(Thread* t, const char*, jobject* loader, } extern "C" AVIAN_EXPORT jclass JNICALL -EXPORT(JVM_DefineClassWithSource)(Thread* t, const char*, jobject* loader, +EXPORT(JVM_DefineClassWithSource)(Thread* t, const char*, jobject loader, const uint8_t* data, jsize length, jobject, const char*) { @@ -3984,7 +3979,7 @@ EXPORT(JVM_DefineClassWithSource)(Thread* t, const char*, jobject* loader, } extern "C" AVIAN_EXPORT jclass JNICALL -EXPORT(JVM_DefineClassWithSourceCond)(Thread* t, const char*, jobject* loader, +EXPORT(JVM_DefineClassWithSourceCond)(Thread* t, const char*, jobject loader, const uint8_t* data, jsize length, jobject, const char*, jboolean) { @@ -4329,10 +4324,10 @@ jvmGetClassDeclaredFields(Thread* t, uintptr_t* arguments) unsigned ai = 0; for (unsigned i = 0; i < arrayLength(t, table); ++i) { - object vmField = arrayBody(t, table, i); + GcField* vmField = cast(t, arrayBody(t, table, i)); PROTECT(t, vmField); - if ((not publicOnly) or (fieldFlags(t, vmField) & ACC_PUBLIC)) { + if ((not publicOnly) or (vmField->flags() & ACC_PUBLIC)) { object field = makeJfield(t, vmField, i); assertT(t, ai < objectArrayLength(t, array)); @@ -4428,7 +4423,7 @@ jvmInvokeMethod(Thread* t, uintptr_t* arguments) jobjectArray args = reinterpret_cast(arguments[2]); GcMethod* vmMethod = cast(t, arrayBody - (t, jclassVmClass(t, jmethodClazz(t, *method))->methodTable(), + (t, jmethodClazz(t, *method)->vmClass()->methodTable(), jmethodSlot(t, *method))); if (vmMethod->flags() & ACC_STATIC) { @@ -4463,11 +4458,11 @@ jvmNewInstanceFromConstructor(Thread* t, uintptr_t* arguments) jobjectArray args = reinterpret_cast(arguments[1]); object instance = make - (t, jclassVmClass(t, jconstructorClazz(t, *constructor))); + (t, jconstructorClazz(t, *constructor)->vmClass()); PROTECT(t, instance); GcMethod* method = cast(t, arrayBody - (t, jclassVmClass(t, jconstructorClazz(t, *constructor))->methodTable(), + (t, jconstructorClazz(t, *constructor)->vmClass()->methodTable(), jconstructorSlot(t, *constructor))); invoke(t, method, reinterpret_cast(instance), args ? reinterpret_cast(*args) : 0); diff --git a/src/compile.cpp b/src/compile.cpp index 270a113491..8f918c6aa0 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -7519,7 +7519,7 @@ walkContinuationBody(MyThread* t, Heap::Walker* w, GcContinuation* c, int start) { const int BodyOffset = ContinuationBody / BytesPerWord; - GcMethod* method = cast(t, reinterpret_cast(t->m->heap->follow(c->method()))); + GcMethod* method = t->m->heap->follow(c->method()); int count = frameMapSizeInBits(t, method); if (count) { diff --git a/src/debug-util.cpp b/src/debug-util.cpp index c0275aae97..0cab3e58e8 100644 --- a/src/debug-util.cpp +++ b/src/debug-util.cpp @@ -122,13 +122,13 @@ int printInstruction(uint8_t* code, unsigned& ip, const char* prefix) return fprintf(stderr, "drem"); case dsub: return fprintf(stderr, "dsub"); - case dup: + case vm::dup: return fprintf(stderr, "dup"); case dup_x1: return fprintf(stderr, "dup_x1"); case dup_x2: return fprintf(stderr, "dup_x2"); - case dup2: + case vm::dup2: return fprintf(stderr, "dup2"); case dup2_x1: return fprintf(stderr, "dup2_x1"); diff --git a/src/finder.cpp b/src/finder.cpp index fba76f876f..0712187ecb 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include "avian/zlib-custom.h" @@ -285,7 +284,7 @@ class JarIndex { while (p < end) { if (signature(p) == EntrySignature) { - index = index->add(Entry(hash(avian::util::Slice(reinterpret_cast(fileName(p)), fileNameLength(p))), p)); + index = index->add(Entry(hash(Slice(fileName(p), fileNameLength(p))), p)); p = endOfEntry(p); } else { diff --git a/src/tools/type-generator/main.cpp b/src/tools/type-generator/main.cpp index f473573ce0..f90b763acb 100644 --- a/src/tools/type-generator/main.cpp +++ b/src/tools/type-generator/main.cpp @@ -843,56 +843,42 @@ writeOffset(Output* out, Class* cl) } } -void -writeAccessorName(Output* out, Class* cl, Field& field) -{ - out->write(cl->name); - out->write(capitalize(field.name)); +std::string cppClassName(Class* cl) { + if(cl->name == "jobject") { + return "object"; + } else { + return "Gc" + capitalize(cl->name) + "*"; + } } -void writeFieldType(Output* out, Module& module, Field& f) { +std::string cppFieldType(Module& module, Field& f) { if(f.javaSpec.size() != 0) { if(f.javaSpec[0] == 'L') { std::string className = f.javaSpec.substr(1, f.javaSpec.size() - 2); std::map::iterator it = module.javaClasses.find(className); if(it != module.javaClasses.end()) { - if(it->second->name == "jobject") { - // TEMPORARY HACK! - out->write("object"); - } else { - out->write("Gc"); - out->write(capitalize(it->second->name)); - out->write("*"); - } - return; + return cppClassName(it->second); } } else if(f.javaSpec[0] == '[') { std::map::iterator it = module.javaClasses.find(f.javaSpec); if(it != module.javaClasses.end()) { - out->write("Gc"); - out->write(capitalize(it->second->name)); - out->write("*"); - return; + return cppClassName(it->second); } } } std::map::iterator it = module.classes.find(f.typeName); assert(f.typeName.size() > 0); if(it != module.classes.end()) { - out->write("Gc"); - out->write(capitalize(it->second->name)); - out->write("*"); + return cppClassName(it->second); } else { - out->write(f.typeName); + return f.typeName; } } -void writeSimpleFieldType(Output* out, Module& module, Field& f) { - if(f.javaSpec.size() != 0 && (f.javaSpec[0] == 'L' || f.javaSpec[0] == '[')) { - out->write("object"); - } else { - writeFieldType(out, module, f); - } +void writeAccessorName(Output* out, Class* cl, Field& field) +{ + out->write(cl->name); + out->write(capitalize(field.name)); } void @@ -918,7 +904,7 @@ writeAccessor(Output* out, Module& module, Class* cl, Field& field, bool isArray // out->write(take(strlen(typeName) - 3, typeName)); // out->write("*"); // } else { - writeSimpleFieldType(out, module, field); + out->write(cppFieldType(module, field)); out->write("&"); // } @@ -950,7 +936,7 @@ writeAccessor(Output* out, Module& module, Class* cl, Field& field, bool isArray // out->write(take(strlen(typeName) - 3, typeName)); // out->write("*"); // } else { - writeSimpleFieldType(out, module, field); + out->write(cppFieldType(module, field)); out->write("*"); // } @@ -1026,7 +1012,7 @@ writeConstructorParameters(Output* out, Module& module, Class* cl) Field& f = **it; if(!f.polyfill) { out->write(", "); - writeFieldType(out, module, f); + out->write(cppFieldType(module, f)); out->write(" "); out->write(obfuscate(f.name)); } @@ -1082,7 +1068,7 @@ void writeClassAccessors(Output* out, Module& module, Class* cl) for(std::vector::iterator it = cl->fields.begin(); it != cl->fields.end(); ++it) { Field& f = **it; out->write(" "); - writeFieldType(out, module, f); + out->write(cppFieldType(module, f)); if(!f.polyfill) { out->write("&"); } @@ -1097,7 +1083,7 @@ void writeClassAccessors(Output* out, Module& module, Class* cl) out->write("); // polyfill, assumed to be implemented elsewhere\n"); } else { out->write(") { return field_at<"); - writeFieldType(out, module, f); + out->write(cppFieldType(module, f)); out->write(">("); out->write(capitalize(cl->name)); out->write(capitalize(f.name));