In gcc/java:
* class.c (make_class_data): Push initial value for "arrayclass". * decl.c (init_decl_processing): Add new class field "arrayclass". In libjava: * java/lang/Class.h (_Jv_InitClass): Use __builtin_expect. (_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. (_Jv_GetArrayClass): New inline function. (arrayclass): New field. * prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayClass. Don't use _Jv_GetArrayElementFromElementType. (_Jv_NewPrimArray): Ditto. (_Jv_PrimClass constructor): Initialize "depth", "ancestors", and "idt" for completeness. Initialze "arrayclass" using _Jv_NewArrayClass. Set Modifier::ABSTRACT. * java/lang/natClassLoader.cc (_Jv_NewClass): Initialize "arrayclass". (_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. Now void. Now synchronized. Array classes are now referenced from elementClass->arrayclass. Don't use _Jv_FindClassInCache. Set array classes' accessibility flags correctly. Optimize so that all array classes share the same IDT. * java/lang/reflect/natArray.cc (newInstance): Use _Jv_GetArrayClass. * java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature): Ditto. * java/lang/natClass.cc (_getFields): Increment offset. Prevent fields in superclasses from overwriting classes own fields. (_Jv_IsAssignableFrom): Check for NULL source idt instead of calling Modifier::isAbstract(). (null_idt): New static field. (_Jv_PrepareConstantTimeTables): Optimize case where class implements no interfaces. (_Jv_IndexOf): Made inline. * boehm.cc (_Jv_MarkObj): Mark "arrayclass" field. From-SVN: r38808
This commit is contained in:
parent
5bab9296f5
commit
5bb11b2e20
11 changed files with 174 additions and 94 deletions
|
@ -54,7 +54,7 @@ java::lang::reflect::Array::newInstance (jclass componentType, jintArray dimensi
|
|||
jclass arrayType = componentType;
|
||||
for (int i = 0; i < ndims; i++) // FIXME 2nd arg should
|
||||
// be "current" loader
|
||||
arrayType = _Jv_FindArrayClass (arrayType, 0);
|
||||
arrayType = _Jv_GetArrayClass (arrayType, 0);
|
||||
|
||||
return _Jv_NewMultiArray (arrayType, ndims, dims);
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ _Jv_GetTypesFromSignature (jmethodID method,
|
|||
|
||||
// FIXME: 2'nd argument should be "current loader"
|
||||
while (--num_arrays >= 0)
|
||||
type = _Jv_FindArrayClass (type, 0);
|
||||
type = _Jv_GetArrayClass (type, 0);
|
||||
// ARGPTR can be NULL if we are processing the return value of a
|
||||
// call from Constructor.
|
||||
if (argPtr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue