1 /* src/native/vm/java_lang_Object.c - java/lang/Object functions
3 Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 $Id: java_lang_VMObject.c 6213 2006-12-18 17:36:06Z twisti $
36 #include "native/jni.h"
38 #if defined(ENABLE_JAVAME_CLDC1_1)
39 # include "native/include/java_lang_String.h"/* required by java_lang_Class.h */
42 #include "native/include/java_lang_Class.h"
44 #if defined(ENABLE_JAVASE)
45 # include "native/include/java_lang_Cloneable.h"
48 #include "native/include/java_lang_Object.h"
50 #include "threads/lock-common.h"
52 #include "vm/builtin.h"
54 #include "vmcore/options.h"
56 #if defined(ENABLE_JVMTI)
57 #include "native/jvmti/cacaodbg.h"
62 * Class: java/lang/Object
64 * Signature: (Ljava/lang/Object;)Ljava/lang/Class;
66 java_lang_Class *_Jv_java_lang_Object_getClass(java_lang_Object *obj)
73 c = ((java_objectheader *) obj)->vftbl->class;
75 return (java_lang_Class *) c;
80 * Class: java/lang/Object
84 void _Jv_java_lang_Object_notify(java_lang_Object *this)
86 #if defined(ENABLE_THREADS)
87 lock_notify_object(&this->header);
93 * Class: java/lang/Object
97 void _Jv_java_lang_Object_notifyAll(java_lang_Object *this)
99 #if defined(ENABLE_THREADS)
100 lock_notify_all_object(&this->header);
106 * Class: java/lang/Object
108 * Signature: (Ljava/lang/Object;JI)V
110 void _Jv_java_lang_Object_wait(java_lang_Object *o, s8 ms, s4 ns)
112 #if defined(ENABLE_JVMTI)
114 if (jvmti) jvmti_MonitorWaiting(true, o, ms);
117 #if defined(ENABLE_THREADS)
118 lock_wait_for_object(&o->header, ms, ns);
121 #if defined(ENABLE_JVMTI)
123 /* XXX: How do you know if wait timed out ?*/
124 if (jvmti) jvmti_MonitorWaiting(false, o, 0);
129 #if defined(ENABLE_JAVASE)
132 * Class: java/lang/Object
134 * Signature: (Ljava/lang/Cloneable;)Ljava/lang/Object;
136 java_lang_Object *_Jv_java_lang_Object_clone(java_lang_Cloneable *this)
138 java_objectheader *o;
139 java_objectheader *co;
141 o = (java_objectheader *) this;
143 co = builtin_clone(NULL, o);
145 return (java_lang_Object *) co;
148 #endif /* ENABLE_JAVASE */
152 * These are local overrides for various environment variables in Emacs.
153 * Please do not remove this and leave it at the end of the file, where
154 * Emacs will automagically detect them.
155 * ---------------------------------------------------------------------
158 * indent-tabs-mode: t