harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r600879 - in /harmony/enhanced/drlvm/trunk/vm: include/open/ jitrino/src/optimizer/ jitrino/src/vm/ vmcore/src/class_support/ vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/
Date Tue, 04 Dec 2007 11:15:39 GMT
Author: varlax
Date: Tue Dec  4 03:15:28 2007
New Revision: 600879

URL: http://svn.apache.org/viewvc?rev=600879&view=rev
Log:
Applied HARMONY-5197 [drlvm][jit] stress tests org.apache.harmony.test.stress.stress.gc.frag.FragmentationFinalizer
crashes

Modified:
    harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/vm.h?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Tue Dec  4 03:15:28 2007
@@ -85,13 +85,12 @@
 VMEXPORT Class_Handle get_system_string_class();
 
 /** 
- * Loads a class of a given name. 
+ * Find already loaded class of a given name. 
  *
- * @return <code>NULL</code> if a class cannot be loaded.
+ * @return <code>NULL</code> if a class is not loaded.
  */
-
 VMEXPORT Class_Handle
-class_load_class_by_name_using_bootstrap_class_loader(const char *name);
+class_lookup_class_by_name_using_bootstrap_class_loader(const char *name);
 
 /** 
  * The following three functions will be eventually renamed to

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp Tue Dec  4 03:15:28
2007
@@ -143,7 +143,8 @@
     HelperInlinerFlags& flags = action->getFlags();
 
     if (flags.pragmaInlineType== NULL) {
-        flags.pragmaInlineType= cc->getVMCompilationInterface()->resolveClassUsingBootstrapClassloader(PRAGMA_INLINE_TYPE_NAME);
+        // Avoid class resolution during compilation. VMMagic package should be loaded &
resolved at start up.
+        flags.pragmaInlineType= cc->getVMCompilationInterface()->findClassUsingBootstrapClassloader(PRAGMA_INLINE_TYPE_NAME);
         if (flags.pragmaInlineType == NULL) {
             Log::out()<<"Helpers inline pass failed! class not found: "<<PRAGMA_INLINE_TYPE_NAME<<std::endl;
             return;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp Tue Dec  4 03:15:28
2007
@@ -155,7 +155,8 @@
 
     _usesOptimisticBalancedSync = argSource->getBoolArg("sync_optimistic", false) ? argSource->getBoolArg("sync_optcatch",
true) : false;
     
-    inlinePragma = irm.getCompilationInterface().resolveClassUsingBootstrapClassloader(PRAGMA_INLINE_TYPE_NAME);
+    // Avoid class resolution during compilation. VMMagic package should be loaded &
resolved at start up.  
+    inlinePragma = irm.getCompilationInterface().findClassUsingBootstrapClassloader(PRAGMA_INLINE_TYPE_NAME);
 }
 
 int32 
@@ -911,7 +912,7 @@
         call = ((Inst*)callNode->getLastInst())->asMethodCallInst();
         assert(call != NULL);
         methodDesc = call->getMethodDesc();
-        bool isPragmaInline = methodDesc->hasAnnotation(inlinePragma);;
+        bool isPragmaInline = inlinePragma != NULL && methodDesc->hasAnnotation(inlinePragma);;
 
         // If candidate would cause top level method to exceed size threshold, throw away.
         
@@ -955,7 +956,7 @@
     MethodDesc *methodDesc = call->getMethodDesc();
     IRManager* inlinedIRM = new (_tmpMM) IRManager(_tmpMM, _toplevelIRM, *methodDesc, NULL);
     // Augment inline tree
-    bool forceInline = methodDesc->hasAnnotation(inlinePragma);
+    bool forceInline = inlinePragma != NULL && methodDesc->hasAnnotation(inlinePragma);
     InlineNode *inlineNode = new (_tmpMM) InlineNode(*inlinedIRM, call, call->getNode(),
forceInline);
     
     inlineCC.setHIRManager(inlinedIRM);
@@ -993,7 +994,7 @@
             MethodDesc* methodDesc = call->getMethodDesc();
 
             Log::out() << "Considering inlining instruction I" << (int)call->getId()
<< ::std::endl;
-            if (methodDesc->hasAnnotation(inlinePragma)) {
+            if (inlinePragma != NULL && methodDesc->hasAnnotation(inlinePragma))
{
                 assert(!methodDesc->isSynchronized()); //not tested!
                 if (Log::isEnabled()) {
                     Log::out()<<"Found Inline pragma, adding to the queue:";call->print(Log::out());Log::out()<<std::endl;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp Tue Dec  4 03:15:28 2007
@@ -629,8 +629,8 @@
     return vm_heap_ceiling_address();
 }
 
-ObjectType * CompilationInterface::resolveClassUsingBootstrapClassloader( const char * klassName
) {
-    Class_Handle cls = class_load_class_by_name_using_bootstrap_class_loader(klassName);
+ObjectType * CompilationInterface::findClassUsingBootstrapClassloader( const char * klassName
) {
+    Class_Handle cls = class_lookup_class_by_name_using_bootstrap_class_loader(klassName);
     if( NULL == cls ) {
         return NULL;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h Tue Dec  4 03:15:28 2007
@@ -332,12 +332,13 @@
     MethodDesc* getMethodByName(Class_Handle enclClass, const char* name);
     
 
-    // resolve-by-name methods
     /**
-     * Resolve a system class by its name. 
-     * Returns NULL if no such class found.
+     * Returns a system class by its name or NULL if no such class found.
      */
-    ObjectType * resolveClassUsingBootstrapClassloader( const char * klassName );
+    ObjectType * findClassUsingBootstrapClassloader( const char * klassName );
+
+    // resolve-by-name methods
+    
     /**
      * Recursively looks up for a given method with a given signature in the given class.
      * Returns NULL if no such method found.

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp Tue Dec  4 03:15:28
2007
@@ -991,11 +991,11 @@
 
 
 Class_Handle
-class_load_class_by_name_using_bootstrap_class_loader(const char *name)
+class_lookup_class_by_name_using_bootstrap_class_loader(const char *name)
 {
     Global_Env *env = VM_Global_State::loader_env;
     String *n = env->string_pool.lookup(name);
-    Class *clss = env->bootstrap_class_loader->LoadVerifyAndPrepareClass(env, n);
+    Class *clss = env->bootstrap_class_loader->LookupClass(n);
     return (Class_Handle)clss;
 } 
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java?rev=600879&r1=600878&r2=600879&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java
Tue Dec  4 03:15:28 2007
@@ -54,6 +54,12 @@
     public static final int OBJ_INFO_OFFSET = 4;
 
 
+    // Force loading of magic classes.
+    static {
+        try {
+            Class.forName(Inline.class.getName(), true, null);
+        } catch (ClassNotFoundException e) {}
+    }
 
 
 



Mime
View raw message