OSDN Git Service

* dbxout.c (dbxout_type): Fix printf format.
[pf3gnuchains/gcc-fork.git] / libjava / defineclass.cc
index 2e8b4d9..0648ad9 100644 (file)
@@ -96,7 +96,10 @@ struct _Jv_ClassReader {
   unsigned int      *offsets;
 
   // the class to define (see java-interp.h)
-  _Jv_InterpClass   *def;
+  jclass          def;
+  
+  // the classes associated interpreter data.
+  _Jv_InterpClass  *def_interp;
 
   /* check that the given number of input bytes are available */
   inline void check (int num)
@@ -221,7 +224,8 @@ struct _Jv_ClassReader {
     bytes  = (unsigned char*) (elements (data)+offset);
     len    = length;
     pos    = 0;
-    def    = (_Jv_InterpClass*) klass;
+    def    = klass;
+    def_interp = (_Jv_InterpClass *) def->aux_info;
   }
 
   /** and here goes the parser members defined out-of-line */
@@ -332,6 +336,8 @@ _Jv_ClassReader::parse ()
 
   // tell everyone we're done.
   def->state = JV_STATE_LOADED;
+  if (gcj::verbose_class_flag)
+    fprintf (stderr, "[Loaded (bytecode) %s]\n", (const char*)(def->name->data));
   def->notifyAll ();
 
 }
@@ -772,9 +778,9 @@ _Jv_ClassReader::prepare_pool_entry (int index, unsigned char this_tag)
                           name_index, type_index);
 
          if (this_tag == JV_CONSTANT_Fieldref)
-           _Jv_VerifyFieldSignature (pool_data[type_index].utf8);
+           verify_field_signature (pool_data[type_index].utf8);
          else
-           _Jv_VerifyMethodSignature (pool_data[type_index].utf8);
+           verify_method_signature (pool_data[type_index].utf8);
 
          _Jv_Utf8Const* name = pool_data[name_index].utf8;
 
@@ -1047,10 +1053,10 @@ void _Jv_ClassReader::handleFieldsBegin (int count)
   def->fields = (_Jv_Field*) 
     _Jv_AllocBytes (count * sizeof (_Jv_Field));
   def->field_count = count;
-  def->field_initializers = (_Jv_ushort*)
+  def_interp->field_initializers = (_Jv_ushort*)
     _Jv_AllocBytes (count * sizeof (_Jv_ushort));
   for (int i = 0; i < count; i++)
-    def->field_initializers[i] = (_Jv_ushort) 0;
+    def_interp->field_initializers[i] = (_Jv_ushort) 0;
 }
 
 void _Jv_ClassReader::handleField (int field_no,
@@ -1103,7 +1109,7 @@ void _Jv_ClassReader::handleField (int field_no,
     }
 
   if (verify)
-    _Jv_VerifyFieldSignature (sig);
+    verify_field_signature (sig);
 
   // field->type is really a jclass, but while it is still
   // unresolved we keep an _Jv_Utf8Const* instead.
@@ -1133,7 +1139,7 @@ void _Jv_ClassReader::handleConstantValueAttribute (int field_index,
     throw_class_format_error ("field has multiple ConstantValue attributes");
 
   field->flags |= _Jv_FIELD_CONSTANT_VALUE;
-  def->field_initializers[field_index] = value;
+  def_interp->field_initializers[field_index] = value;
 
   /* type check the initializer */
   
@@ -1153,7 +1159,7 @@ void _Jv_ClassReader::handleFieldsEnd ()
   int low            = 0;
   int high           = def->field_count-1;
   _Jv_Field  *fields = def->fields;
-  _Jv_ushort *inits  = def->field_initializers;
+  _Jv_ushort *inits  = def_interp->field_initializers;
 
   // this is kind of a raw version of quicksort.
   while (low < high)
@@ -1195,13 +1201,13 @@ _Jv_ClassReader::handleMethodsBegin (int count)
 {
   def->methods = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method) * count);
 
-  def->interpreted_methods
+  def_interp->interpreted_methods
     = (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *)
                                          * count);
 
   for (int i = 0; i < count; i++)
     {
-      def->interpreted_methods[i] = 0;
+      def_interp->interpreted_methods[i] = 0;
       def->methods[i].index = (_Jv_ushort) -1;
     }
 
@@ -1240,7 +1246,7 @@ void _Jv_ClassReader::handleMethod
       else
        verify_identifier (method->name);
 
-      _Jv_VerifyMethodSignature (method->signature);
+      verify_method_signature (method->signature);
 
       for (int i = 0; i < mth_index; ++i)
        {
@@ -1284,7 +1290,7 @@ void _Jv_ClassReader::handleCodeAttribute
          (void*) (bytes+code_start),
          code_length);
 
-  def->interpreted_methods[method_index] = method;
+  def_interp->interpreted_methods[method_index] = method;
 
   if ((method->self->accflags & java::lang::reflect::Modifier::STATIC))
     {
@@ -1301,7 +1307,7 @@ void _Jv_ClassReader::handleExceptionTableEntry
    int start_pc, int end_pc, int handler_pc, int catch_type)
 {
   _Jv_InterpMethod *method = reinterpret_cast<_Jv_InterpMethod *>
-    (def->interpreted_methods[method_index]);
+    (def_interp->interpreted_methods[method_index]);
   _Jv_InterpException *exc = method->exceptions ();
 
   exc[exc_index].start_pc.i     = start_pc;
@@ -1319,7 +1325,7 @@ void _Jv_ClassReader::handleMethodsEnd ()
       _Jv_Method *method = &def->methods[i];
       if ((method->accflags & Modifier::NATIVE) != 0)
        {
-         if (def->interpreted_methods[i] != 0)
+         if (def_interp->interpreted_methods[i] != 0)
            throw_class_format_error ("code provided for native method");
          else
            {
@@ -1328,7 +1334,7 @@ void _Jv_ClassReader::handleMethodsEnd ()
              m->defining_class = def;
              m->self = method;
              m->function = NULL;
-             def->interpreted_methods[i] = m;
+             def_interp->interpreted_methods[i] = m;
              m->deferred = NULL;
 
              if ((method->accflags & Modifier::STATIC))
@@ -1344,12 +1350,12 @@ void _Jv_ClassReader::handleMethodsEnd ()
        }
       else if ((method->accflags & Modifier::ABSTRACT) != 0)
        {
-         if (def->interpreted_methods[i] != 0)
+         if (def_interp->interpreted_methods[i] != 0)
            throw_class_format_error ("code provided for abstract method");
        }
       else
        {
-         if (def->interpreted_methods[i] == 0)
+         if (def_interp->interpreted_methods[i] == 0)
            throw_class_format_error ("method with no code");
        }
     }