// 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.
#include <java/lang/Class.h>
#include <java/lang/ClassLoader.h>
-#include <gnu/gcj/runtime/MethodInvocation.h>
extern "C" {
#include <ffi.h>
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)
class _Jv_InterpMethod;
class _Jv_InterpMethodInvocation;
-class _Jv_InterpException {
+class _Jv_InterpException
+{
int start_pc;
int end_pc;
int handler_pc;
friend class _Jv_ClassReader;
friend class _Jv_InterpMethod;
+ friend class _Jv_BytecodeVerifier;
};
// Base class for method representations. Subclasses are interpreted
// Size of raw arguments.
_Jv_ushort args_raw_size;
+
+public:
+ _Jv_Method *get_method ()
+ {
+ return self;
+ }
};
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);
};
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;
friend class _Jv_ClassReader;
friend void _Jv_PrepareClass(jclass);
+
+public:
+ // FIXME: this is ugly.
+ void set_function (void *f)
+ {
+ function = f;
+ }
};
#endif /* INTERPRETER */