Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

jlClass.c

Go to the documentation of this file.
00001 /*!
00002  * @file jlClass.c
00003  *
00004  * @brief Native implementation of @c @b java.lang.Class
00005  *
00006  *
00007  * @section Control
00008  *
00009  * \$URL: https://svn.apache.org/path/name/jlClass.c $ \$Id: jlClass.c 0 09/28/2005 dlydick $
00010  *
00011  * Copyright 2005 The Apache Software Foundation
00012  * or its licensors, as applicable.
00013  *
00014  * Licensed under the Apache License, Version 2.0 ("the License");
00015  * you may not use this file except in compliance with the License.
00016  * You may obtain a copy of the License at
00017  *
00018  *     http://www.apache.org/licenses/LICENSE-2.0
00019  *
00020  * Unless required by applicable law or agreed to in writing,
00021  * software distributed under the License is distributed on an
00022  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
00023  * either express or implied.
00024  *
00025  * See the License for the specific language governing permissions
00026  * and limitations under the License.
00027  *
00028  * @version \$LastChangedRevision: 0 $
00029  *
00030  * @date \$LastChangedDate: 09/28/2005 $
00031  *
00032  * @author \$LastChangedBy: dlydick $
00033  *         Original code contributed by Daniel Lydick on 09/28/2005.
00034  *
00035  * @section Reference
00036  *
00037  */
00038 
00039 #include "arch.h"
00040 ARCH_COPYRIGHT_APACHE(jlClass, c, "$URL: https://svn.apache.org/path/name/jlClass.c $ $Id: jlClass.c 0 09/28/2005 dlydick $");
00041 
00042 
00043 #include "jvmcfg.h"
00044 #include "classfile.h"
00045 #include "linkage.h"
00046 #include "jvm.h"
00047 
00048 
00049 /*!
00050  * @name Native implementation of class static functions.
00051  *
00052  * The class index of the current class is always passed
00053  * as the first parameter.
00054  *
00055  * @note These @c @b java.lang.Class methods are unusual in that
00056  * they does not require a @c @b jobject (in parlance of this
00057  * implementation, a @link #jvm_object_hash jvm_object_hash@endlink)
00058  * to run because they are declared as @c @b static methods.  As
00059  * implemented here, the usual @b objhashthis parameter is therefore
00060  * replaced by * @b clsidxthis.  The thread context is located in
00061  * @link #CURRENT_THREAD CURRENT_THREAD@endlink.
00062  *
00063  */
00064 
00065 /*@{ */ /* Begin grouped definitions */
00066 
00067 /*@} */ /* End of grouped definitions */
00068 
00069 
00070 /*!
00071  * @name Native implementation of object instance functions.
00072  *
00073  * The object hash of @c @b this object is always passed
00074  * as the first parameter.
00075  *
00076  */
00077 
00078 /*@{ */ /* Begin grouped definitions */
00079 
00080 /*!
00081  * @brief Native implementation
00082  * of @c @b java.lang.Class.isArray()
00083  *
00084  *
00085  * @param  objhashthis  Object table hash of @c @b this object.
00086  *
00087  *
00088  * @returns @link #jtrue jtrue@endlink if this class is an array,
00089  *          else @link #jfalse jfalse@endlink.
00090  *
00091  */
00092 
00093 jboolean jlClass_isArray(jvm_object_hash objhashthis)
00094 {
00095     jvm_class_index clsidx = OBJECT_CLASS_LINKAGE(objhashthis)->clsidx;
00096 
00097     if (jvm_class_index_null == clsidx)
00098     { 
00099         return(jfalse);
00100     }
00101 
00102     return((CLASS(clsidx).status & CLASS_STATUS_ARRAY)
00103            ? jtrue
00104            : jfalse);
00105 
00106 } /* END of jlClass_isArray() */
00107 
00108 
00109 /*!
00110  * @brief Native implementation
00111  * of @c @b java.lang.Class.isPrimative()
00112  *
00113  *
00114  * @param  objhashthis  Object table hash of @c @b this object.
00115  *
00116  *
00117  * @returns @link #jtrue jtrue@endlink if this class is a primative,
00118  *          else @link #jfalse jfalse@endlink.
00119  *
00120  */
00121 
00122 jboolean jlClass_isPrimative(jvm_object_hash objhashthis)
00123 {
00124     jvm_class_index clsidx = OBJECT_CLASS_LINKAGE(objhashthis)->clsidx;
00125 
00126     if (jvm_class_index_null == clsidx)
00127     { 
00128         return(jfalse);
00129     }
00130 
00131     return((CLASS(clsidx).status & CLASS_STATUS_PRIMATIVE)
00132            ? jtrue
00133            : jfalse);
00134 
00135 } /* END of jlClass_isPrimative() */
00136 
00137 /*@} */ /* End of grouped definitions */
00138 
00139 
00140 /* EOF */
00141 

Generated on Fri Sep 30 18:59:28 2005 by  doxygen 1.4.4