OSDN Git Service

* gcc_release: Add /usr/local/bin to path when local.
[pf3gnuchains/gcc-fork.git] / libjava / include / java-interp.h
index a0ca347..8eeb094 100644 (file)
@@ -1,6 +1,6 @@
 // java-interp.h - Header file for the bytecode interpreter.  -*- c++ -*-
 
-/* Copyright (C) 1999, 2000  Red Hat, Inc.
+/* Copyright (C) 1999, 2000, 2001  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -20,7 +20,6 @@ details.  */
 
 #include <java/lang/Class.h>
 #include <java/lang/ClassLoader.h>
-#include <gnu/gcj/runtime/MethodInvocation.h>
 
 extern "C" {
 #include <ffi.h>
@@ -34,17 +33,19 @@ _Jv_IsInterpretedClass (jclass c)
 
 struct _Jv_ResolvedMethod;
 
-void _Jv_VerifyFieldSignature (_Jv_Utf8Const*sig);
-void _Jv_VerifyMethodSignature (_Jv_Utf8Const*sig);
-void _Jv_VerifyClassName (unsigned char* ptr, _Jv_ushort length);
-void _Jv_VerifyClassName (_Jv_Utf8Const *name);
-void _Jv_VerifyIdentifier (_Jv_Utf8Const *);
+bool _Jv_VerifyFieldSignature (_Jv_Utf8Const*sig);
+bool _Jv_VerifyMethodSignature (_Jv_Utf8Const*sig);
+bool _Jv_VerifyClassName (unsigned char* ptr, _Jv_ushort length);
+bool _Jv_VerifyClassName (_Jv_Utf8Const *name);
+bool _Jv_VerifyIdentifier (_Jv_Utf8Const *);
 bool _Jv_ClassNameSamePackage (_Jv_Utf8Const *name1, _Jv_Utf8Const *name2);
 void _Jv_DefineClass (jclass, jbyteArray, jint, jint);
-void _Jv_ResolveField (_Jv_Field *, java::lang::ClassLoader*);
 
 void _Jv_InitField (jobject, jclass, int);
 void * _Jv_AllocMethodInvocation (jsize size);
+int  _Jv_count_arguments (_Jv_Utf8Const *signature,
+                         jboolean staticp = true);
+void _Jv_VerifyMethod (_Jv_InterpMethod *method);
 
 /* FIXME: this should really be defined in some more generic place */
 #define ROUND(V, A) (((((unsigned) (V))-1) | ((A)-1))+1)
@@ -56,7 +57,8 @@ class _Jv_InterpClass;
 class _Jv_InterpMethod;
 class _Jv_InterpMethodInvocation;
 
-class _Jv_InterpException {
+class _Jv_InterpException
+{
   int  start_pc;
   int  end_pc;
   int  handler_pc;
@@ -64,6 +66,7 @@ class _Jv_InterpException {
 
   friend class _Jv_ClassReader;
   friend class _Jv_InterpMethod;
+  friend class _Jv_BytecodeVerifier;
 };
 
 // Base class for method representations.  Subclasses are interpreted
@@ -79,6 +82,12 @@ protected:
 
   // Size of raw arguments.
   _Jv_ushort args_raw_size;
+
+public:
+  _Jv_Method *get_method ()
+  {
+    return self;
+  }
 };
 
 class _Jv_InterpMethod : public _Jv_MethodBase
@@ -129,7 +138,7 @@ class _Jv_InterpMethod : public _Jv_MethodBase
 
   friend class _Jv_ClassReader;
   friend class _Jv_InterpMethodInvocation;
-  friend class gnu::gcj::runtime::MethodInvocation;
+  friend class _Jv_BytecodeVerifier;
 
   friend void _Jv_PrepareClass(jclass);
 };
@@ -155,9 +164,19 @@ class _Jv_InterpClass : public java::lang::Class
   friend class _Jv_InterpMethod;
   friend void  _Jv_PrepareClass(jclass);
   friend void  _Jv_InitField (jobject, jclass, int);
-  friend void* _Jv_MarkObj (void *, void *, void *, void *);
+#ifdef JV_MARKOBJ_DECL
+  friend JV_MARKOBJ_DECL;
+#endif
+
+  friend _Jv_MethodBase ** _Jv_GetFirstMethod (_Jv_InterpClass *klass);
 };
 
+extern inline _Jv_MethodBase **
+_Jv_GetFirstMethod (_Jv_InterpClass *klass)
+{
+  return klass->interpreted_methods;
+}
+
 struct _Jv_ResolvedMethod {
   jint            stack_item_count;    
   jint            vtable_index;        
@@ -190,6 +209,13 @@ class _Jv_JNIMethod : public _Jv_MethodBase
 
   friend class _Jv_ClassReader;
   friend void _Jv_PrepareClass(jclass);
+
+public:
+  // FIXME: this is ugly.
+  void set_function (void *f)
+  {
+    function = f;
+  }
 };
 
 #endif /* INTERPRETER */