1999-04-07 22:42:40 +08:00
|
|
|
// Object.h - Header file for java.lang.Object. -*- c++ -*-
|
|
|
|
|
2001-01-15 16:11:40 +08:00
|
|
|
/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
|
1999-04-07 22:42:40 +08:00
|
|
|
|
|
|
|
This file is part of libgcj.
|
|
|
|
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef __JAVA_LANG_OBJECT_H__
|
|
|
|
#define __JAVA_LANG_OBJECT_H__
|
|
|
|
|
|
|
|
#pragma interface
|
|
|
|
|
1999-09-11 06:03:10 +08:00
|
|
|
#include <gcj/javaprims.h>
|
1999-04-07 22:42:40 +08:00
|
|
|
|
2001-01-15 16:11:40 +08:00
|
|
|
// This class is mainly here as a kludge to get G++ to allocate two
|
2001-01-17 18:22:33 +08:00
|
|
|
// extra entries in each vtable.
|
1999-04-07 22:42:40 +08:00
|
|
|
struct _JvObjectPrefix
|
|
|
|
{
|
|
|
|
protected:
|
2001-01-15 16:11:40 +08:00
|
|
|
// New ABI Compatibility Dummy, #1 and 2.
|
2001-12-15 02:43:55 +08:00
|
|
|
virtual void nacd_1 (void) {}; // This slot really contains the Class pointer.
|
|
|
|
// For IA64, the GC descriptor goes into the second word of the nacd1 descr.
|
|
|
|
# ifndef __ia64__
|
|
|
|
virtual void nacd_2 (void) {}; // Actually the GC bitmap marking descriptor.
|
|
|
|
# endif
|
1999-04-07 22:42:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class java::lang::Object : public _JvObjectPrefix
|
|
|
|
{
|
2001-01-15 16:11:40 +08:00
|
|
|
protected:
|
|
|
|
virtual void finalize (void);
|
1999-04-07 22:42:40 +08:00
|
|
|
public:
|
|
|
|
// Order must match order in Object.java.
|
|
|
|
jclass getClass (void);
|
|
|
|
virtual jint hashCode (void);
|
|
|
|
void notify (void);
|
|
|
|
void notifyAll (void);
|
|
|
|
void wait (jlong timeout, jint nanos);
|
|
|
|
virtual jboolean equals (jobject obj);
|
|
|
|
Object (void);
|
|
|
|
virtual jstring toString (void);
|
|
|
|
void wait (void);
|
|
|
|
void wait (jlong timeout);
|
|
|
|
|
2001-05-24 13:40:37 +08:00
|
|
|
friend void _Jv_MonitorEnter (jobject obj);
|
|
|
|
friend void _Jv_MonitorExit (jobject obj);
|
1999-04-07 22:42:40 +08:00
|
|
|
friend void _Jv_InitializeSyncMutex (void);
|
|
|
|
friend void _Jv_FinalizeObject (jobject obj);
|
|
|
|
|
|
|
|
#ifdef JV_MARKOBJ_DECL
|
|
|
|
friend JV_MARKOBJ_DECL;
|
|
|
|
#endif
|
|
|
|
#ifdef JV_MARKARRAY_DECL
|
|
|
|
friend JV_MARKARRAY_DECL;
|
|
|
|
#endif
|
|
|
|
|
natField.cc (BooleanClass): Don't define.
* java/lang/reflect/natField.cc (BooleanClass): Don't define.
* java/lang/reflect/natArray.cc (BooleanClass): Don't define.
* java/lang/Class.h (Object): Added `class$' field.
* java/lang/Object.h (Object): Added `class$' field.
* defineclass.cc (ClassClass): Use `class$' form.
(ClassObject): Likewise.
* resolve.cc (ClassObject): Use `class$' form.
(ObjectClass): Likewise.
* interpret.cc (ClassError): Removed.
* java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Use
`class$' form.
(IntegerClass): Likewise.
* java/net/natPlainSocketImpl.cc (BooleanClass): Use `class$'
form.
* java/lang/natClassLoader.cc (CloneableClass): Use `class$' form.
(ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass,
SerializableClass): Likewise.
Include Serializable.h, Cloneable.h.
* java/lang/natSystem.cc (SystemClass): Removed.
(init_properties): Use `class$' form.
* java/lang/natObject.cc (CloneableClass): Removed.
(clone): Use `class$' form.
* java/lang/natClass.cc (CloneableClass): Use `class$' form.
(ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass,
ConstructorClass): Likewise.
* java/lang/reflect/natMethod.cc (ObjectClass): Use `class$' form.
(ClassClass, VoidClass, ByteClass, ShortClass, CharacterClass,
IntegerClass, LongClass, FloatClass, DoubleClass): Likewise.
* java/io/natObjectInputStream.cc (ObjectClass): Use `class$'
form.
(ClassClass): Likewise.
* include/jvm.h (StringClass): Use `class$' form.
* prims.cc (ObjectClass): Removed.
(_Jv_RunMain): Use `class$' form.
(_Jv_AllocObject): Likewise.
* jni.cc (ClassClass): Use `class$' form.
(ThrowableClass): Likewise.
(ObjectClass): Likewise.
(MethodClass): Likewise.
(ThreadGroupClass): Likewise.
(NativeThreadClass): Likewise.
* boehm.cc (ObjectClass): Removed.
(ClassClass): Removed.
(_Jv_MarkObj): Use `class$' form.
* gcj/field.h (JvFieldIsRef): Use `class$' form.
Include RawData.h.
From-SVN: r36740
2000-10-06 09:49:32 +08:00
|
|
|
static java::lang::Class class$;
|
|
|
|
|
1999-04-07 22:42:40 +08:00
|
|
|
protected:
|
|
|
|
virtual jobject clone (void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// This does not actually refer to a Java object. Instead it is a
|
|
|
|
// placeholder for a piece of internal data (the synchronization
|
|
|
|
// information).
|
2001-05-24 13:40:37 +08:00
|
|
|
# ifndef JV_HASH_SYNCHRONIZATION
|
|
|
|
jobject sync_info;
|
|
|
|
# endif
|
1999-04-07 22:42:40 +08:00
|
|
|
|
2001-05-24 13:40:37 +08:00
|
|
|
// Initialize the sync_info field. Not called with JV_HASH_SYNCHRONIZATION.
|
|
|
|
void sync_init (void);
|
1999-04-07 22:42:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __JAVA_LANG_OBJECT_H__ */
|