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

class.c File Reference


Detailed Description

Create and manage real machine Java class data structures.

Control

$URL: https://svn.apache.org/path/name/class.c $ $Id: class.c 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file class.c.

#include "arch.h"
#include <string.h>
#include "jvmcfg.h"
#include "cfmacros.h"
#include "classfile.h"
#include "classpath.h"
#include "exit.h"
#include "field.h"
#include "gc.h"
#include "jvm.h"
#include "jvmclass.h"
#include "linkage.h"
#include "method.h"
#include "nts.h"
#include "utf.h"
#include "util.h"

Go to the source code of this file.

DEFAULT SYSTEM CLASS LOADER:

perform the duties of java.lang.ClassLoader Using either null-terminated strings or UTF strings from CONSTANT_Utf8_info or CONSTANT_Class_info constant_pool entries, the following three functions function as the system default class loader that can be invoked three different ways. It searches CLASSPATH, reads in a class file, parses its contents, and loads it into the class table and object table, and performs static initialization.

Notice that the array formatting must already be included in clsname (if this is an array class), and that the arraylength array must contain the same number of integers as described in clsname. No checking is done for this in this function.

Attention:
This function performs the task of the method
     ClassLoader.defineClass(String name, byte[] b, int off, int len)
   

but combines the operands effectively into,

       ClassLoader.defineClass(String name)
   

where name is a null-terminated string passed as the only parm, and b is the byte array read in by classfile_readclassfile() or classfile_readjarfile(), and off is zero, and len being discovered by classfile_read_XXXfile().

Todo:
Spec section 5.3.4 Loading Constraints has not been considered in this implementation. It needs to be looked at.
Todo:
Convert this function from recursive (easy to write) into iterative (easier to run and maintain).
Parameters:
clsname This parameter may be one of three styles:
  • for class_load_from_cp_entry_utf() only: a CONSTANT_Utf8_info constant_pool entry string containing unqualified class name:

    Lsome/class/path/SomeClassname;

    with possible array specification:

    [[[Lsome/class/path/SomeClassname;

    This example has three array dimensions.

  • for class_load_from_prchar() only: a null-terminated string containing unqualified class name. See above for further comments.

  • for class_load_from_cp_entry_class() only: a CONSTANT_Class_info constant_pool entry containing constant_pool entry to unqualified class name. See above for further comments.

Parameters:
find_registerNatives When rtrue, will return the ordinal for JVMCFG_JLOBJECT_NMO_REGISTER and JVMCFG_JLOBJECT_NMO_UNREGISTER as well as the other ordinals. Once JVM initialization is complete, this should always be rfalse because all future classes should never have local ordinals.
arraylength Array of number of elements in each array dimension. If not needed, set to rnull. Notice that clsname will determine how many array dimensions are needed. In the above example of 3 dimensions, an array of 3 numbers must be passed here. If the declaration was, new SomeClassname[4][7][8], then the array {4, 7, 8} must be passed here.
Returns:
class table index to loaded class, ready for use, or jvm_class_index_null if could not load.
Exceptions:
JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR if no slots are available..
JVMCLASS_JAVA_LANG_INTERNALERROR with bad clsname constant_pool entry type. Meaninful only for class_load_from_cp_entry_utf()


jvm_class_index class_load_from_cp_entry_utf (cp_info_dup *clsname, rboolean find_registerNatives, jint *arraylength)
jvm_class_index class_load_from_prchar (rchar *clsname, rboolean find_registerNatives, jint *arraylength)

Functions

static jvm_class_index class_allocate_slot (rboolean tryagain)
 Locate and reserve an unused class table slot for a new class.
static void class_c_dummy (void)
jvm_class_index class_find_by_cp_entry (cp_info_dup *clsname)
 Scan class table using CP table entry for presence of a class of specific name and number of dimensions.
jvm_class_index class_find_by_prchar (rchar *clsname)
 Retrieve by (rchar *) name a class index to a class.
static rvoid class_get_constant_field_attribute (jvm_class_index clsidx, ClassFile *pcfs, jvm_field_index fldidx, jvalue *field_data, jvm_field_lookup_index fluidx, rboolean staticmark, jvm_object_hash objhash)
 Retrieve data from a CONSTANT_xxx_info structure and insert it into a slot in the field data table. Also implements table 4.6.
u2 class_get_num_object_instance_fields (ClassFile *pcfs)
 Report number of object instance fields are in a class file.
u2 class_get_num_static_fields (ClassFile *pcfs)
 Report number of class static fields are in a class file.
jvalueclass_get_object_instance_field_data (jvm_class_index clsidx, jvm_object_hash objhash, ClassFile *pcfs)
 Load the field data table for object instance fields in this class.
jvm_field_indexclass_get_object_instance_field_lookups (ClassFile *pcfs)
 Load the field lookup table for object instance fields in this class.
jvalueclass_get_static_field_data (jvm_class_index clsidx, ClassFile *pcfs)
 Load the field data table for class static fields in this class.
jvm_field_indexclass_get_static_field_lookups (ClassFile *pcfs)
 Load the field lookup table for class static fields in this class.
rvoid class_init ()
 Initialize the class area of the JVM model.
jvm_class_index class_load_primative (u1 basetype)
 Load primative classes for java.lang.Class.
jvm_class_index class_load_resolve_clinit (rchar *clsname, jvm_thread_index thridx, rboolean usesystemthread, rboolean find_registerNatives)
 All-purpose class loading, load, resolve, <clinit> , each step only run if needed.
jvm_class_index class_reload (jvm_class_index clsidxOLD)
 Reload a class in the class table after java.lang.String has become available.
rvoid class_shutdown_1 ()
 Shut down the class area of the JVM model after JVM execution in two stages.
rvoid class_shutdown_2 ()
jvm_class_index class_static_delete (jvm_class_index clsidx, rboolean rmref)
 Un-reserve a slot from the class table.
jvm_class_index class_static_new (rushort special_cls, ClassFile *pcfs, jvm_array_dim arraydims, jint *arraylength, jvm_class_index lower_dim_array)
 Load a class into ad class table slot and load up its associated class definition object.
rvoid class_static_setup (jvm_class_index clsidx)
 Set up an empty class in a given class table slot.

Variables

static char * class_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/class.c $ $Id: class.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable."


Function Documentation

static void class_c_dummy void   )  [static]
 

Definition at line 40 of file class.c.

rvoid class_static_setup jvm_class_index  clsidx  ) 
 

Set up an empty class in a given class table slot.

The clsidx of JVMCFG_NULL_CLASS has special properties in that it can ALWAYS be allocated and is NEVER garbage collected! Part of the purpose for this is the JVMCFG_NULL_CLASS is of value zero, which is widely used throughout the code as a special value. This this slot is not available for anything else.

Parameters:
clsidx Class table index of slot to set up.
Returns:
rvoid
< This slot contains a class

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

< Not stated in spec, but implied

Definition at line 80 of file class.c.

References CLASS, CLASS_STATUS_INUSE, CLASS_STATUS_NULL, jvm_class_index_null, jvm_object_hash_null, LOCAL_CONSTANT_NO_ARRAY_DIMS, and rnull.

rvoid class_init  ) 
 

Initialize the class area of the JVM model.

Parameters: rvoid

Returns:
rvoid

Definition at line 157 of file class.c.

static jvm_class_index class_allocate_slot rboolean  tryagain  )  [static]
 

Locate and reserve an unused class table slot for a new class.

Parameters:
tryagain If rtrue, run garbage collection once if no empty slots are available so as to try and free up something. Typically, invoke as rtrue, and let recursion call it with rfalse.
Returns:
Class table index of an empty slot. Throw error if no slots.
Exceptions:
JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR if no slots are available..
< This slot contains a class

< This slot contains a class

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

Definition at line 192 of file class.c.

References CLASS, rjvm::class_allocate_last, CLASS_STATUS_INUSE, CLASS_STATUS_NULL, EXIT_JVM_CLASS, exit_throw_exception(), GC_RUN, JVMCFG_FIRST_CLASS, JVMCFG_MAX_CLASSES, JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR, pjvm, rfalse, and rtrue.

jvm_class_index class_static_new rushort  special_cls,
ClassFile pcfs,
jvm_array_dim  arraydims,
jint arraylength,
jvm_class_index  lower_dim_array
 

Load a class into ad class table slot and load up its associated class definition object.

Create a Java class itself (and NOT a new instance of a class!). The following three mutially exclusive variations are available using the special_cls modifier:

  • (1) CLASS_STATUS_EMPTY: Normal class, no special treatment.

  • (2) CLASS_STATUS_ARRAY: Treat class instance creation as a dimension of an array instead of as a normal class load. The recursion will eventually load its base class and superclasses. When allocating an array class, DO NOT EVER INVOKE THIS FUNCTION FOR A PRIMATIVE ARRAY!

  • (3) CLASS_STATUS_PRIMATIVE: Treat class instance creation as loading a primative pseudo-class for use by java.lang.Class. A related Classfile structure will be generated for this pseudo-class.

No verification of special_cls is performed, only these values are assumed.

Use a simple circular slot allocation mechanism to report where most recent class was allocated. The search for the next slot will begin from here and go all the way around the array to this same slot. If not successful, throw error, but do not return.

Parameters:
special_cls Bit-mapped request for various special considerations for class construction. If not needed, use CLASS_STATUS_EMPTY. If used, the values are:
  • CLASS_STATUS_ARRAY create new array class instead of class instance

  • CLASS_STATUS_PRIMATIVE create special class instance of a Java primative for use by java.lang.Class

Parameters:
pcfs Pointer to ClassFile area which contains this class, rnull for CLASS_STATUS_PRIMATIVE requests.
arraydims Number of array dimensions for this class, or zero if not an array class.
arraylength Array of length arraydims containing the length of array in each of those dimensions. E.g., arraydims is 4 for new X[7][3][9][2] so this parameter will be a 4-element array containing the numbers {7, 3, 9, 2}
lower_dim_array Class index of this array class' next lower dimension, e.g. if this is a 3-dim array [[[L then need index it as [[L .
Returns:
Class index value of allocation. Throw error if no slots.
Exceptions:
JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR if no slots are available..
< Primative for java.lang.Class < This slot is available for use

< Primative for java.lang.Class < Class loaded, initialized, and ready to allocate instances

< Class is an array type where arraydims contains number of dimensions

< This object is a class definition instead of an object instance

< Class is an array type where arraydims contains number of dimensions

Todo:
Where is this mkref's GC_CLASS_RMREF() ???
< This slot is available for use

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

Definition at line 353 of file class.c.

References jvm_class_index_null.

jvm_class_index class_reload jvm_class_index  clsidxOLD  ) 
 

Reload a class in the class table after java.lang.String has become available.

This process does not re-read the class file, only redoes class initialization. The class_objhash does not get deleted.

Parameters:
clsidxOLD Class table index of slot to tear down.
Returns:
New class index of rebuilt class slot. Throw error if no slots.
Exceptions:
JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR if no slots are available..
Todo:
This function needs more testing. Also, is it really needed in the implementation?
< This slot contains a class

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

< This slot is available for use

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

Definition at line 553 of file class.c.

jvm_class_index class_static_delete jvm_class_index  clsidx,
rboolean  rmref
 

Un-reserve a slot from the class table.

This is the reverse of the process of class_static_new() above. Only tear down the heap allocations and mark the slot as empty. Leave the rest of the data in place for post-mortem. When the slot gets allocated again, any zeroing out of values will just get overwritten again, so don't bother.

Todo:
Make sure all objects of this class type have been destroyed before destroying this class itself!
Todo:
This function may be used to declutter the class table when a class has not been used for some period of time (including any static methods and fields, watch out for static final constants), so as to free up its slot for other purposes.
Parameters:
clsidx Class index value of allocation.
rmref rtrue if class references should be removed, which is NOT SO during JVM shutdown. Regardless of this value, object references are always removed.
Returns:
Same class index as input if slot was freed, else jvm_class_index_null if slot was already free.
< This slot contains a class

Todo:
Determine what to do, if anything, when rfalse is returned from linkage_unresolve_class(). Is the class slot unusable? Should class_static_delete() proceed?

Todo:
Is there anything equivalent to calling java.lang.Object.finalize() for an object that must be invoked before unloading a class?
< This slot contains a class

Definition at line 732 of file class.c.

References CLASS, GC_CLASS_FIELD_RMREF, and HEAP_FREE_DATA.

jvm_class_index class_find_by_cp_entry cp_info_dup clsname  ) 
 

Scan class table using CP table entry for presence of a class of specific name and number of dimensions.

Parameters:
clsname UTF8 string pointer to a class name, possibly with array dimensions: [[Lsome/class/path/SomeClassname; has two array dimensions. Can also accept classes that are null-terminated strings without class formatting. Such strings may start with L but will not end with ; .
Returns:
its index in pjvm->class if present, else jvm_class_index_null.
< This slot contains a class

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

Definition at line 839 of file class.c.

References class_find_by_cp_entry(), HEAP_FREE_DATA, and nts_prchar2utf().

Referenced by class_find_by_cp_entry(), class_load_primative(), and linkage_resolve_class().

jvm_class_index class_find_by_prchar rchar clsname  ) 
 

Retrieve by (rchar *) name a class index to a class.

Parameters:
clsname Null-terminated string of name of class.
Returns:
class index of located class, otherwise jvm_class_index_null.

Definition at line 898 of file class.c.

Referenced by opcode_run(), and thread_new().

jvm_class_index class_load_primative u1  basetype  ) 
 

Load primative classes for java.lang.Class.

Load primative classes as opposed to a real class LSome/Package/Name/SomeClassName; . These will be known by their primative types: I for "integer", S for "short", etc.

Classes loaded with this method will typically never have any references to them except from their class object created within class_static_new(), yet are completely valid and are used intensively by class type processing. Because they never have references removed, they will never be marked for garbage collection, either. In this way, they are permanently available to the JVM for class type processing.

Parameters:
basetype One of the primative base types BASETYPE_CHAR_x
Returns:
class table index to loaded primative [pseudo-]class, ready for use. Throw error if could not load.
Exceptions:
JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR if no slots are available..
< Primative for java.lang.Class < Not stated in spec, but implied

Definition at line 940 of file class.c.

References class_find_by_cp_entry(), class_load_from_prchar(), CONSTANT_Utf8, EXIT_JVM_INTERNAL, exit_throw_exception(), jvm_class_index_null, JVMCLASS_JAVA_LANG_INTERNALERROR, LOCAL_CONSTANT_NO_ARRAY_DIMS, PTR_THIS_CP_Utf8, rnull, utf_get_utf_arraydims(), and utf_utf2prchar().

jvm_class_index class_load_from_cp_entry_utf cp_info_dup clsname,
rboolean  find_registerNatives,
jint arraylength
 

< Not stated in spec, but implied

< Not stated in spec, but implied

< Not stated in spec, but implied

< This slot is available for use

< Class is an array type where arraydims contains number of dimensions

< Convenient alias for DML5

< Convenient alias for DML5

Todo:
Throw UnsupportedClassVersionError
< This slot is available for use

< Not stated in spec, but implied

< Convenient alias for DML5

For internal use only.

Load superclass

Todo:
(The <clinit> procedure is run when the JVM virtual machine execution engine moves a new class from the START state into the RUNNABLE state.)

WATCH OUT! RECURSIVE CALL! This will recurse until super_class is a java.lang.Object, where ClassFile.super_class is 0 (per JVM spec. Throw error if could not load superclass. Don't care about its class index, as that is also available in other places.

Todo:
Make sure that this superclass and all of its superclasses are not only loaded, but also linked and have <clinit> run also.
< Class loaded, needs <clinit>

Definition at line 1071 of file class.c.

jvm_class_index class_load_from_prchar rchar clsname,
rboolean  find_registerNatives,
jint arraylength
 

Definition at line 1318 of file class.c.

References CLASS, class_load_from_prchar(), CLASS_OBJECT_LINKAGE, CLASS_STATUS_CLINIT, method_info::LOCAL_method_binding::codeatridxJVM, jvm_attribute_index_bad, jvm_method_index_bad, jvm_thread_index_null, linkage_resolve_class(), LOCAL_CONSTANT_UTF8_CLASS_CONSTRUCTOR, LOCAL_CONSTANT_UTF8_CLASS_CONSTRUCTOR_PARMS, method_info::LOCAL_method_binding, method_find_by_prchar(), ClassFile::methods, and rnull.

Referenced by class_load_from_prchar(), class_load_primative(), and thread_new().

jvm_class_index class_load_resolve_clinit rchar clsname,
jvm_thread_index  thridx,
rboolean  usesystemthread,
rboolean  find_registerNatives
 

All-purpose class loading, load, resolve, <clinit> , each step only run if needed.

Load a class into the JVM, resolve its linkages, and run its <clinit> method, if any, typically on the system thread. All three steps are optional and will be invoked only if needed. Therefore it is possible that none of the steps will be run. However, if any step needs to performed, that step will be run.

Parameters:
clsname Null-terminated string of unformatted class name.(Formatting is okay, but don't pass an array class)
thridx If a non-null thread index is passed in, use the current state of that thread to load the class and run its <clinit> . If null thread index is passed in, use the usesystemthread parameter to further clarify which thread to load up with class <clinit> .
usesystemthread Load onto system thread when rtrue, use an available thread otherwise.
find_registerNatives When rtrue, will return the ordinal for JVMCFG_JLOBJECT_NMO_REGISTER and JVMCFG_JLOBJECT_NMO_UNREGISTER as well as the other ordinals. Once JVM initialization is complete, this should always be rfalse because all future classes should never have local ordinals.
Returns:
class index of loaded class, whether or not a <clinit> method was available. Throw error if not slots available.
Exceptions:
JVMCLASS_JAVA_LANG_OUTOFMEMORYERROR if no slots are available..
JVMCLASS_JAVA_LANG_INTERNALERROR if invalid clsidx
JVMCLASS_JAVA_LANG_NOSUCHFIELDERROR if invalid field linked by class
JVMCLASS_JAVA_LANG_NOSUCHMETHODERROR if invalid method linked by class
Todo:
Any JAR file passed in here that has a [ in its first one or more characters may be interpreted as an array class. I have not tested this, and it is an oddball, but somebody needs to make sure that either, (a) such a name is never passed in, which is preferred due to standard industry file naming practices, and/or (b) that no array processing happens in the lower levels.
< Class loaded, initialized, and ready to allocate instances

For internal use only.

see similar logic for loading a new stack frame and PC in thread_new_common()

Todo:
Currently, return valid class index even if no <clinit> was available. Is this correct? Or should it throw a VerifyError since a method was declared, yet had no code area? Take the easy way out for now, evaluate and maybe fix later.
alias

< Start PC location

< Class loaded, needs <clinit> < Class loaded, initialized, and ready to allocate instances

Definition at line 1445 of file class.c.

Referenced by opcode_load_run_throwable(), and opcode_run().

static rvoid class_get_constant_field_attribute jvm_class_index  clsidx,
ClassFile pcfs,
jvm_field_index  fldidx,
jvalue field_data,
jvm_field_lookup_index  fluidx,
rboolean  staticmark,
jvm_object_hash  objhash
[static]
 

Retrieve data from a CONSTANT_xxx_info structure and insert it into a slot in the field data table. Also implements table 4.6.

Parameters:
clsidx Class table index of slot having class loaded
pcfs Pointer to ClassFile area
fldidx Class file field info table index
field_data Field data tbl in class tbl entry(on the heap)
fluidx Field lookup index into field_data table
staticmark If rtrue, this invocation is for a class static field lookup table, so call GC_CLASS_FIELD_MKREF(clsidx, fluidx) for reference types (namely CONSTANT_String types). When rfalse, call instead GC_OBJECT_FIELD_MKREF(objhash, fluidx) for reference types. It is for this specific purpose that objhash is supplied below:
objhash If staticmark is rfalse, this is the object hash of the field lookup table whose reference types should be GC marked, otherwise ignored. See staticmark above for details.
Returns:
rvoid
Todo:
Need to recognize signatures
Todo:
Above logic works, 64-bit logic below needs testing:
Todo:
Above logic works, 64-bit logic below needs testing:

Todo:
Load up this string into a java.lang.String using the source from
pcfs->constant_pool [PTR_CP_ENTRY_TYPE( CONSTANT_String_info, pcfs, constantvalue_index) ->string_index]

But do not store directly into,

val._jstring = ...

Instead, store the resulting object hash from the algorithm shown in jvm_init() where the main() parameter argv[] array is loaded into the Java edition of the same. The pseudocode for this operation is shown there.

DO NOT do this until the class initialization is complete for java.lang.String or the results may be arbitrary or even fatal. A well-formed class library will not attempt such an operation.

Definition at line 1641 of file class.c.

Referenced by class_get_static_field_lookups().

u2 class_get_num_static_fields ClassFile pcfs  ) 
 

Report number of class static fields are in a class file.

Parameters:
pcfs Pointer to ClassFile area
Returns:
number of fields marked ACC_STATIC.
< Declared static .

Definition at line 1887 of file class.c.

References class_get_num_static_fields(), HEAP_GET_DATA, and rtrue.

Referenced by class_get_num_static_fields().

jvm_field_index* class_get_static_field_lookups ClassFile pcfs  ) 
 

Load the field lookup table for class static fields in this class.

Parameters:
pcfs Pointer to ClassFile area
Returns:
array of field indices in ClassFile fields table for all static fields in this class or rnull if no values to initialize or heap allocation error. The size of the array is determined by the result of class_get_num_static_fields().
< Declared static .

Definition at line 1921 of file class.c.

References ACC_STATIC, field_info::access_flags, class_get_constant_field_attribute(), ClassFile::fields, jvm_object_hash_null, and rtrue.

jvalue* class_get_static_field_data jvm_class_index  clsidx,
ClassFile pcfs
 

Load the field data table for class static fields in this class.

Parameters:
clsidx Class table index of slot having class loaded
pcfs Pointer to ClassFile area
Returns:
array of data values corresponding to each field index as returned from class_get_static_field_lookups() or rnull if no values to initialize or heap allocation error. The size of the array is determined by the result of class_get_num_static_fields().
< Declared static .

Definition at line 1968 of file class.c.

References ACC_STATIC, field_info::access_flags, class_get_num_object_instance_fields(), ClassFile::fields, HEAP_GET_DATA, and rfalse.

u2 class_get_num_object_instance_fields ClassFile pcfs  ) 
 

Report number of object instance fields are in a class file.

Parameters:
pcfs Pointer to ClassFile area
Returns:
number of fields not marked ACC_STATIC.
< Declared static .

Definition at line 2020 of file class.c.

References class_get_num_object_instance_fields().

Referenced by class_get_num_object_instance_fields(), and class_get_static_field_data().

jvm_field_index* class_get_object_instance_field_lookups ClassFile pcfs  ) 
 

Load the field lookup table for object instance fields in this class.

Parameters:
pcfs Pointer to ClassFile area
Returns:
array of field indices in ClassFile fields table for all object instance fields in this class or rnull if no values to initialize or heap allocation error. The size of the array is determined by the result of class_get_num_object_instance_fields().
< Declared static .

Definition at line 2055 of file class.c.

jvalue* class_get_object_instance_field_data jvm_class_index  clsidx,
jvm_object_hash  objhash,
ClassFile pcfs
 

Load the field data table for object instance fields in this class.

This initialization is the same for all objects of this class, so this function is still naturally a part of class processing instead of object processing.

Parameters:
clsidx Class table index of slot having class loaded
objhash Object hash of object slot being loaded. This is supplied expressly to mark reference types (that is, CONSTANT_String) during field loading from the class file, otherwise not needed.
pcfs Pointer to ClassFile area
Returns:
array of data values corresponding to each field index as returned from class_get_static_field_lookups() or rnull if no values to initialize or heap allocation error. The size of the array is determined by the result of class_get_num_object_instance_fields().
< Declared static .

Definition at line 2111 of file class.c.

References CLASS, CLASS_STATUS_NULL, GC_CLASS_RMREF_FROM_CLASS, GC_OBJECT_RMREF_FROM_CLASS, and jvm_class_index_null.

rvoid class_shutdown_1  ) 
 

Shut down the class area of the JVM model after JVM execution in two stages.

In between these two stages will be object_shutdown() which performs related reference cleanup from the object side:

Stage 1-- remove class object references and class array references.

object_shutdown()-- remove class references from objects here.

Stage 2-- all remaining cleanup. Notice that references are removed here also except during this shutdown process.

Parameters: rvoid

Returns:
rvoid
< This slot contains a class

< NULL class slot. Exactly on exists in normal use, any else besides the JVMCFG_NULL_CLASS is a class slot now being initialized.

Definition at line 2178 of file class.c.

rvoid class_shutdown_2  ) 
 

< This slot contains a class

Definition at line 2226 of file class.c.


Variable Documentation

char* class_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/class.c $ $Id: class.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." [static]
 

Definition at line 40 of file class.c.


Generated on Fri Sep 30 18:49:32 2005 by  doxygen 1.4.4