harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r415026 - in /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src: class_support/classloader.cpp init/vm_init.cpp
Date Sat, 17 Jun 2006 16:36:46 GMT
Author: geirm
Date: Sat Jun 17 09:36:45 2006
New Revision: 415026

URL: http://svn.apache.org/viewvc?rev=415026&view=rev
Log:
patches from HARMONY-612 to help support the
Java 5 additions to j.l.Class


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?rev=415026&r1=415025&r2=415026&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Sat
Jun 17 09:36:45 2006
@@ -1099,10 +1099,18 @@
     const String* name = clss->name;
     assert(name);
 
-    if(env->InBootstrap()) {
+    if (env->InBootstrap()) {
+    	
+    	/*
+    	 *  AnnotatedElement, GenericDeclaration, Type are there becuase in 
+    	 *  Java 5, Class implements them in addition to Serializable
+    	 */
         assert((clss->name == env->JavaLangObject_String)
              || (strcmp(clss->name->bytes, "java/io/Serializable") == 0)
-             || (clss->name == env->JavaLangClass_String));
+             || (clss->name == env->JavaLangClass_String)
+             || (strcmp(clss->name->bytes, "java/lang/reflect/AnnotatedElement") ==
0)
+             || (strcmp(clss->name->bytes, "java/lang/reflect/GenericDeclaration")
== 0)
+             || (strcmp(clss->name->bytes, "java/lang/reflect/Type") == 0));
         clss->class_handle = NULL;
     } else {
         Class* root_class = env->JavaLangClass_Class;

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp?rev=415026&r1=415025&r2=415026&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp Sat Jun 17 09:36:45
2006
@@ -129,11 +129,18 @@
 {
     assert(tmn_is_suspend_enabled());
     TRACE2("init", "bootstrapping initial java classes");
-    // Bootstrap java.lang.Class class. This requires also loading the two classes 
-    // it inherits/implements: java.io.Serializable and java.lang.Object.
+    
+    /*
+     *  Bootstrap java.lang.Class class. This requires also loading the other classes 
+     *  it inherits/implements: java.io.Serializable and java.lang.Object, and 
+     * j.l.reflect.AnnotatedElement, GenericDeclaration and Type as per Java 5
+     */
     env->StartVMBootstrap();
     Class *class_java_lang_Object   = preload_class(env, env->JavaLangObject_String);
     env->java_io_Serializable_Class = preload_class(env, env->Serializable_String);
+    Class *AnnotatedElement_Class   = preload_class(env, "java/lang/reflect/AnnotatedElement");
+    Class *GenericDeclaration_Class = preload_class(env, "java/lang/reflect/GenericDeclaration");
+    Class *Type_Class               = preload_class(env, "java/lang/reflect/Type");
     env->JavaLangClass_Class        = preload_class(env, env->JavaLangClass_String);
     env->JavaLangObject_Class       = class_java_lang_Object;
     env->FinishVMBootstrap();
@@ -141,6 +148,9 @@
     // Now create the java_lang_Class instances for these three classes.
     create_instance_for_class(env, env->JavaLangClass_Class);
     create_instance_for_class(env, env->java_io_Serializable_Class);
+    create_instance_for_class(env, AnnotatedElement_Class);
+    create_instance_for_class(env, GenericDeclaration_Class);
+    create_instance_for_class(env, Type_Class);
     create_instance_for_class(env, env->JavaLangObject_Class);
 
     // during bootstrapping suspend status never matters,
@@ -149,13 +159,19 @@
     jvmti_send_class_prepare_event(env->JavaLangObject_Class);
     jvmti_send_class_load_event(env, env->java_io_Serializable_Class);
     jvmti_send_class_prepare_event(env->java_io_Serializable_Class);
+    jvmti_send_class_load_event(env, AnnotatedElement_Class);
+    jvmti_send_class_prepare_event(AnnotatedElement_Class);
+    jvmti_send_class_load_event(env, GenericDeclaration_Class);
+    jvmti_send_class_prepare_event(GenericDeclaration_Class);
+    jvmti_send_class_load_event(env, Type_Class);
+    jvmti_send_class_prepare_event(Type_Class);
     jvmti_send_class_load_event(env, env->JavaLangClass_Class);
     jvmti_send_class_prepare_event(env->JavaLangClass_Class);
 
 #ifdef VM_STATS
     // Account for the 3 classes loaded before env->JavaLangObject_Class is set.
-    env->JavaLangObject_Class->num_allocations += 3;
-    env->JavaLangObject_Class->num_bytes_allocated += (3 * env->JavaLangClass_Class->instance_data_size);
+    env->JavaLangObject_Class->num_allocations += 6;
+    env->JavaLangObject_Class->num_bytes_allocated += (6 * env->JavaLangClass_Class->instance_data_size);
 #endif //VM_STATS
     TRACE2("init", "bootstrapping initial java classes complete");
 } // bootstrap_initial_java_classes



Mime
View raw message