gcc/libjava/java/lang/Object.h

73 lines
1.8 KiB
C
Raw Normal View History

1999-04-07 22:42:40 +08:00
// Object.h - Header file for java.lang.Object. -*- c++ -*-
/* 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
#include <gcj/javaprims.h>
1999-04-07 22:42:40 +08:00
// This class is mainly here as a kludge to get G++ to allocate two
// extra entries in each vtable.
1999-04-07 22:42:40 +08:00
struct _JvObjectPrefix
{
protected:
// New ABI Compatibility Dummy, #1 and 2.
virtual void nacd_1 (void) {}; // This slot really contains the Class pointer.
virtual void nacd_2 (void) {}; // Actually the GC bitmap marking descriptor.
1999-04-07 22:42:40 +08:00
};
class java::lang::Object : public _JvObjectPrefix
{
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);
friend jint _Jv_MonitorEnter (jobject obj);
friend jint _Jv_MonitorExit (jobject obj);
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).
jobject sync_info;
// Initialize the sync_info field.
void sync_init (void);
};
#endif /* __JAVA_LANG_OBJECT_H__ */