Index: vm/include/open/vm.h =================================================================== --- vm/include/open/vm.h (revision 600489) +++ vm/include/open/vm.h (working copy) @@ -91,7 +91,7 @@ */ 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 Index: vm/jitrino/src/optimizer/helper_inliner.cpp =================================================================== --- vm/jitrino/src/optimizer/helper_inliner.cpp (revision 600489) +++ vm/jitrino/src/optimizer/helper_inliner.cpp (working copy) @@ -141,7 +141,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: "<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()<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; } Index: vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java =================================================================== --- vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java (revision 600489) +++ vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelper.java (working copy) @@ -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) {} + }