harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r502544 - in /harmony/enhanced/drlvm/trunk/vm: include/open/ jitrino/config/ia32/ jitrino/src/codegenerator/ia32/ jitrino/src/optimizer/ jitrino/src/shared/ jitrino/src/translator/java/ jitrino/src/vm/drl/ vmcore/include/ vmcore/src/class_s...
Date Fri, 02 Feb 2007 09:05:51 GMT
Author: varlax
Date: Fri Feb  2 01:05:49 2007
New Revision: 502544

URL: http://svn.apache.org/viewvc?view=rev&rev=502544
Log:
Applied HARMONY-3087 [drlvm][ji] LdInterface, CheckCast and InstanceOf helpers inlining
Tested on SUSE10@x86, SUSE9@x86_64

Added:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.h   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/vm/include/open/vm.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/vtable.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.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?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/vm.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/vm.h Fri Feb  2 01:05:49 2007
@@ -265,6 +265,9 @@
  */
  VMEXPORT unsigned class_get_number_methods(Class_Handle ch);
 
+/// Check if fast_instanceof is applicable for the class
+VMEXPORT Boolean class_get_fast_instanceof_flag(Class_Handle cl);
+
 /**
  * Get handle for a method declared in class.
  */

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Fri Feb  2 01:05:49 2007
@@ -100,6 +100,20 @@
 -XDjit.SD2_OPT.arg.optimizer.inline_helpers.objMonExit_methodName=monitorExit
 -XDjit.SD2_OPT.arg.optimizer.inline_helpers.objMonExit_hotnessPercent=1
 
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.ldInterface=on
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.ldInterface_className=org/apache/harmony/drlvm/VMHelperFastPath
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.ldInterface_methodName=getInterfaceVTable3
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.ldInterface_hotnessPercent=1
+
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.checkCast=on
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.checkCast_className=org/apache/harmony/drlvm/VMHelperFastPath
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.checkCast_methodName=checkCast
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.checkCast_hotnessPercent=1
+
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.instanceOf=on
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.instanceOf_className=org/apache/harmony/drlvm/VMHelperFastPath
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.instanceOf_methodName=instanceOf
+-XDjit.SD2_OPT.arg.optimizer.inline_helpers.instanceOf_hotnessPercent=1
 
 -XDjit.SD2_OPT.arg.codegen.dce1.early=yes
 -XDjit.SD2_OPT.arg.codegen.regalloc.bp_regalloc1.regs=ALL_GP
@@ -120,3 +134,5 @@
 -Dvm.components.hythr.startupclass=org.apache.harmony.drlvm.thread.ThreadHelper
 -XDvm.component.classpath.hythr=hythr.jar
 
+#VM helpers
+-Dvm.components.vmcore.startupclass=org.apache.harmony.drlvm.VMHelperFastPath

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h Fri Feb  2 01:05:49 2007
@@ -832,7 +832,6 @@
     uint32                                      reservedFlags2:8;
 
     Encoder::OpcodeGroup                *   opcodeGroup;
-    BasicBlock *                                basicBlock;
 
     uint32                                      index;
     uint32                                      codeOffset;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp Fri Feb  2 01:05:49 2007
@@ -398,7 +398,7 @@
     if (dstType->isObject()) {
         appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, dstOpnd, srcOpnd));
     } else {
-        assert(dstType->isInteger());
+        assert(dstType->isInteger() || dstType->isVTablePtr());
         OpndSize srcSize=irManager.getTypeSize(srcType);
         OpndSize dstSize=irManager.getTypeSize(dstType);
         if (dstSize<=srcSize) {
@@ -2835,6 +2835,9 @@
     case CompilationInterface::Helper_ObjMonitorEnter:
     case CompilationInterface::Helper_ObjMonitorExit:
     case CompilationInterface::Helper_WriteBarrier:
+    case CompilationInterface::Helper_LdInterface:
+    case CompilationInterface::Helper_Cast:
+    case CompilationInterface::Helper_IsInstanceOf:
     {
         dstOpnd = retType==NULL ? NULL: irManager.newOpnd(retType);
         CallInst * callInst=irManager.newRuntimeHelperCallInst(callId, numArgs, (Opnd**)args, dstOpnd);

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?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp Fri Feb  2 01:05:49 2007
@@ -45,6 +45,9 @@
 DECLARE_STANDARD_HELPER_FLAGS(objMonEnter);
 DECLARE_STANDARD_HELPER_FLAGS(objMonExit);
 DECLARE_STANDARD_HELPER_FLAGS(wb);
+DECLARE_STANDARD_HELPER_FLAGS(ldInterface);
+DECLARE_STANDARD_HELPER_FLAGS(checkCast);
+DECLARE_STANDARD_HELPER_FLAGS(instanceOf);
     
 };
 
@@ -97,6 +100,14 @@
     READ_STANDARD_HELPER_FLAGS(wb);
     flags.wb_signature = "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)V";
 
+    READ_STANDARD_HELPER_FLAGS(ldInterface);
+    flags.ldInterface_signature = "(Ljava/lang/Object;I)Lorg/vmmagic/unboxed/Address;";
+    
+    READ_STANDARD_HELPER_FLAGS(checkCast);
+    flags.checkCast_signature = "(Ljava/lang/Object;IZZZI)Ljava/lang/Object;";
+    
+    READ_STANDARD_HELPER_FLAGS(instanceOf);
+    flags.instanceOf_signature = "(Ljava/lang/Object;IZZZI)Z";
 }
 
 
@@ -120,6 +131,7 @@
     MethodDesc* ensureClassIsResolvedAndInitialized(const char* className,  const char* methodName, const char* signature);
     virtual void doInline() = 0;
     void inlineVMHelper(MethodCallInst* call);
+    void finalizeCall(MethodCallInst* call);
 
     HelperInlinerFlags& flags;
     MemoryManager& localMM;
@@ -158,15 +170,16 @@
 DECLARE_HELPER_INLINER(ObjMonitorEnterHelperInliner, objMonEnter)
 DECLARE_HELPER_INLINER(ObjMonitorExitHelperInliner, objMonExit)
 DECLARE_HELPER_INLINER(WriteBarrierHelperInliner, wb)
+DECLARE_HELPER_INLINER(LdInterfaceHelperInliner, ldInterface)
+DECLARE_HELPER_INLINER(CheckCastHelperInliner, checkCast)
+DECLARE_HELPER_INLINER(InstanceOfHelperInliner, instanceOf)
 
 void HelperInlinerSession::_run(IRManager& irm) {
     CompilationContext* cc = getCompilationContext();
     MemoryManager tmpMM(1024, "Inline VM helpers");
     HelperInlinerAction* action = (HelperInlinerAction*)getAction();
     HelperInlinerFlags& flags = action->getFlags();
-    if (!flags.doInlining) {
-        return;
-    }
+
     //finding all helper calls
     ControlFlowGraph& fg = irm.getFlowGraph();
     double entryExecCount = fg.hasEdgeProfile() ? fg.getEntryNode()->getExecCount(): 1;
@@ -204,7 +217,21 @@
                             helperInliners.push_back(new (tmpMM) WriteBarrierHelperInliner(this, tmpMM, cc, inst));
                         }
                         break;
-
+                    case Op_TauLdIntfcVTableAddr:
+                        if (flags.ldInterface_doInlining && nodePercent >= flags.ldInterface_hotnessPercentToInline) {
+                            helperInliners.push_back(new (tmpMM) LdInterfaceHelperInliner(this, tmpMM, cc, inst));
+                        }
+                        break;
+                    case Op_TauCheckCast:
+                        if (flags.checkCast_doInlining && nodePercent >= flags.checkCast_hotnessPercentToInline) {
+                            helperInliners.push_back(new (tmpMM) CheckCastHelperInliner(this, tmpMM, cc, inst));
+                        }
+                        break;
+                    case Op_TauInstanceOf:
+                        if (flags.instanceOf_doInlining && nodePercent >= flags.instanceOf_hotnessPercentToInline) {
+                            helperInliners.push_back(new (tmpMM) InstanceOfHelperInliner(this, tmpMM, cc, inst));
+                        }
+                        break;
                     default: break;
                 }
             }
@@ -226,7 +253,6 @@
     ObjectType* clazz = ci->resolveClassUsingBootstrapClassloader(className);
     if (!clazz) {
         if (Log::isEnabled()) Log::out()<<"Error: class not found:"<<className<<std::endl;
-        flags.doInlining=false;
         return NULL;
     }
     //helper class is resolved here -> check if initialized
@@ -305,6 +331,30 @@
     }
 }
 
+void HelperInliner::finalizeCall(MethodCallInst* callInst) {
+    //if call is not last inst -> make it last inst
+    if (callInst != callInst->getNode()->getLastInst()) {
+        cfg->splitNodeAtInstruction(callInst, true, true, instFactory->makeLabel());
+    }
+
+    //every call must have exception edge -> add it
+    if (callInst->getNode()->getExceptionEdge() == NULL) {
+        Node* node = callInst->getNode();
+        Node* dispatchNode = node->getUnconditionalEdgeTarget()->getExceptionEdgeTarget();
+        if (dispatchNode == NULL) {
+            dispatchNode = cfg->getUnwindNode();
+            if (dispatchNode==NULL) {
+                dispatchNode = cfg->createDispatchNode(instFactory->makeLabel());
+                cfg->setUnwindNode(dispatchNode);
+                cfg->addEdge(dispatchNode, cfg->getExitNode());
+            }
+        }
+        cfg->addEdge(node, dispatchNode);
+    }
+}
+
+
+
 void NewObjHelperInliner::doInline() {
 #if defined  (_EM64T_) || defined (_IPF_)
     return;
@@ -337,8 +387,11 @@
     MethodCallInst* call = instFactory->makeDirectCall(callResOpnd, tauSafeOpnd, tauSafeOpnd, 2, args, method)->asMethodCallInst();
     call->insertBefore(inst);
     inst->unlink();
+
     assert(call == call->getNode()->getLastInst());
 
+    //todo: use finalizeCall here!
+
     //convert address type to managed object type
     Edge* fallEdge= call->getNode()->getUnconditionalEdge();
     assert(fallEdge && fallEdge->getTargetNode()->isBlockNode());
@@ -348,7 +401,7 @@
         fallNode = irm->getFlowGraph().spliceBlockOnEdge(fallEdge, instFactory->makeLabel());
     }
     fallNode->prependInst(instFactory->makeConv(mod, type->tag, dstOpnd, callResOpnd));
-    
+
     inlineVMHelper(call);
 #endif
 }
@@ -502,6 +555,141 @@
 #endif
 }
 
+void LdInterfaceHelperInliner::doInline() {
+#if defined  (_EM64T_) || defined (_IPF_)
+    return;
+#else
+    assert(inst->getOpcode() == Op_TauLdIntfcVTableAddr);
 
-}//namespace
+    Opnd* baseOpnd = inst->getSrc(0);
+    assert(baseOpnd->getType()->isObject());
+    Type* type = inst->asTypeInst()->getTypeInfo();
+    int typeId = (int)type->asNamedType()->getRuntimeIdentifier(); //TODO: EM64T or IPF incompatible convertion
+    Opnd* typeOpnd  = opndManager->createSsaTmpOpnd(typeManager->getInt32Type());
+    instFactory->makeLdConst(typeOpnd, typeId)->insertBefore(inst);
+    Opnd* resOpnd = inst->getDst();
+    Opnd* tauSafeOpnd = opndManager->createSsaTmpOpnd(typeManager->getTauType());
+    instFactory->makeTauSafe(tauSafeOpnd)->insertBefore(inst);
+    Opnd* args[2] = {baseOpnd, typeOpnd};
+    MethodCallInst* call = instFactory->makeDirectCall(resOpnd, tauSafeOpnd, tauSafeOpnd, 2, args, method)->asMethodCallInst();
+    call->insertBefore(inst);
+    inst->unlink();
+
+    finalizeCall(call);
+    
+    inlineVMHelper(call);
+#endif
+}
+
+
+
+void CheckCastHelperInliner::doInline() {
+#if defined  (_EM64T_) || defined (_IPF_)
+    return;
+#else
+    //TODO: this is 99% clone of instanceof but result of the slow call's result is handled differently. 
+    //to merge these 2 helpers into the one we need to change IA32CG codegen tau_checkcast handling:
+    //call VM helper for static_cast opcode but not for tau!
 
+    assert(inst->getOpcode() == Op_TauCheckCast);
+
+    Opnd* objOpnd = inst->getSrc(0);
+    assert(objOpnd->getType()->isObject());
+    Type* type = inst->asTypeInst()->getTypeInfo();
+    assert(type->isObject());
+    ObjectType* castType = type->asObjectType();
+
+    int  typeId = (int)castType->getRuntimeIdentifier();
+    bool isArrayType = castType->isArrayType();
+    bool isInterfaceType = castType->isInterface();
+    bool isFastInstanceOf = castType->getFastInstanceOfFlag();
+    bool isFinalTypeCast = castType->isFinalClass();
+    int  fastCheckDepth = isFastInstanceOf ? castType->getClassDepth() : 0;
+    
+    Opnd* typeIdOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type()); //TODO: em64t & ipf!
+    instFactory->makeLdConst(typeIdOpnd, typeId)->insertBefore(inst);
+
+    Opnd* isArrayOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
+    instFactory->makeLdConst(isArrayOpnd, isArrayType)->insertBefore(inst);
+
+    Opnd* isInterfaceOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
+    instFactory->makeLdConst(isInterfaceOpnd, isInterfaceType)->insertBefore(inst);
+
+    Opnd* isFinalOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
+    instFactory->makeLdConst(isFinalOpnd, isFinalTypeCast)->insertBefore(inst);
+
+    Opnd* fastCheckDepthOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type());
+    instFactory->makeLdConst(fastCheckDepthOpnd, fastCheckDepth)->insertBefore(inst);
+
+    Opnd* tauSafeOpnd = opndManager->createSsaTmpOpnd(typeManager->getTauType());
+    instFactory->makeTauSafe(tauSafeOpnd)->insertBefore(inst);
+
+    Opnd* args[6] = {objOpnd, typeIdOpnd, isArrayOpnd, isInterfaceOpnd, isFinalOpnd, fastCheckDepthOpnd};
+    MethodCallInst* call = instFactory->makeDirectCall(opndManager->getNullOpnd(), tauSafeOpnd, tauSafeOpnd, 6, args, method)->asMethodCallInst();
+    
+    call->insertBefore(inst);
+
+    // after the call the cast is safe
+    Opnd* tauSafeOpnd2 = opndManager->createSsaTmpOpnd(typeManager->getTauType());
+    instFactory->makeTauSafe(tauSafeOpnd2)->insertBefore(inst);
+    instFactory->makeCopy(inst->getDst(), tauSafeOpnd2)->insertBefore(inst);
+
+    inst->unlink();
+
+    finalizeCall(call);
+
+    inlineVMHelper(call);
+#endif
+}
+
+
+void InstanceOfHelperInliner::doInline() {
+#if defined  (_EM64T_) || defined (_IPF_)
+    return;
+#else
+    assert(inst->getOpcode() == Op_TauInstanceOf);
+
+    Opnd* objOpnd = inst->getSrc(0);
+    assert(objOpnd->getType()->isObject());
+    Type* type = inst->asTypeInst()->getTypeInfo();
+    assert(type->isObject());
+    ObjectType* castType = type->asObjectType();
+
+    int  typeId = (int)castType->getRuntimeIdentifier();
+    bool isArrayType = castType->isArrayType();
+    bool isInterfaceType = castType->isInterface();
+    bool isFastInstanceOf = castType->getFastInstanceOfFlag();
+    bool isFinalTypeCast = castType->isFinalClass();
+    int  fastCheckDepth = isFastInstanceOf ? castType->getClassDepth() : 0;
+
+    Opnd* typeIdOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type()); //TODO: em64t & ipf!
+    instFactory->makeLdConst(typeIdOpnd, typeId)->insertBefore(inst);
+
+    Opnd* isArrayOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
+    instFactory->makeLdConst(isArrayOpnd, isArrayType)->insertBefore(inst);
+
+    Opnd* isInterfaceOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
+    instFactory->makeLdConst(isInterfaceOpnd, isInterfaceType)->insertBefore(inst);
+
+    Opnd* isFinalOpnd = opndManager->createSsaTmpOpnd(typeManager->getBooleanType());
+    instFactory->makeLdConst(isFinalOpnd, isFinalTypeCast)->insertBefore(inst);
+
+    Opnd* fastCheckDepthOpnd = opndManager->createSsaTmpOpnd(typeManager->getInt32Type());
+    instFactory->makeLdConst(fastCheckDepthOpnd, fastCheckDepth)->insertBefore(inst);
+
+    Opnd* tauSafeOpnd = opndManager->createSsaTmpOpnd(typeManager->getTauType());
+    instFactory->makeTauSafe(tauSafeOpnd)->insertBefore(inst);
+
+    Opnd* args[6] = {objOpnd, typeIdOpnd, isArrayOpnd, isInterfaceOpnd, isFinalOpnd, fastCheckDepthOpnd};
+    MethodCallInst* call = instFactory->makeDirectCall(inst->getDst(), tauSafeOpnd, tauSafeOpnd, 6, args, method)->asMethodCallInst();
+
+    call->insertBefore(inst);
+    inst->unlink();
+
+    finalizeCall(call);
+
+    inlineVMHelper(call);
+#endif
+}
+
+}//namespace

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp Fri Feb  2 01:05:49 2007
@@ -643,6 +643,16 @@
     return typeManager.getTypeNameQualifier(vmTypeHandle);
 }
 
+bool 
+ObjectType::getFastInstanceOfFlag() {
+    return typeManager.getClassFastInstanceOfFlag(vmTypeHandle);
+}
+
+int 
+ObjectType::getClassDepth() {
+    return typeManager.getClassDepth(vmTypeHandle);
+}
+
 //
 // for array types, returns byte offset of the first element of the array
 //

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h Fri Feb  2 01:05:49 2007
@@ -529,6 +529,9 @@
     ObjectType*     getSuperType();
     const    char*    getName();
     const    char*    getNameQualifier();
+    bool getFastInstanceOfFlag();
+    int getClassDepth();
+
     //
     // returns the vtable address of this boxed type
     // returns NULL if the type has not yet been prepared by the VM kernel
@@ -921,6 +924,8 @@
     virtual bool        needsInitialization(void* vmTypeHandle) = 0;
     virtual bool        isFinalizable(void* vmTypeHandle) = 0;
     virtual bool        isBeforeFieldInit(void* vmTypeHandle) = 0;
+    virtual bool        getClassFastInstanceOfFlag(void* vmTypeHandle) = 0;
+    virtual int         getClassDepth(void* vmTypeHandle) = 0;
     virtual bool        isInitialized(void* vmTypeHandle) = 0;
     virtual bool        isVariableSizeType(void* vmTypeHandle) = 0;
     virtual void*       getVTable(void* vmTypeHandle) = 0;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp Fri Feb  2 01:05:49 2007
@@ -97,10 +97,9 @@
     return false;//natives are not tested on EM64T.
 #else
     static const char vmhelperPackage[] = "org/apache/harmony/drlvm/VMHelper";
-    static const unsigned vmhelperPackageLen = sizeof(vmhelperPackage)-1;
-
+    
     const char* name = type->getName();
-    bool res =  !strncmp(name, vmhelperPackage, vmhelperPackageLen);
+    bool res =  !strcmp(name, vmhelperPackage);
     return res;
 #endif
 }
@@ -4035,6 +4034,27 @@
     if (!strcmp(mname,"writeBarrier")) {
         assert(numArgs == 3);
         irBuilder.genVMHelperCall(CompilationInterface::Helper_WriteBarrier, resType, numArgs, srcOpnds);
+        return;
+    }
+
+    if (!strcmp(mname,"getInterfaceVTable")) {
+        assert(numArgs == 2);
+        Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_LdInterface, resType, numArgs, srcOpnds);
+        pushOpnd(res);
+        return;
+    }
+
+    if (!strcmp(mname,"checkCast")) {
+        assert(numArgs == 2);
+        Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_Cast, resType, numArgs, srcOpnds);
+        pushOpnd(res);
+        return;
+    }
+
+    if (!strcmp(mname,"instanceOf")) {
+        assert(numArgs == 2);
+        Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_IsInstanceOf, resType, numArgs, srcOpnds);
+        pushOpnd(res);
         return;
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp Fri Feb  2 01:05:49 2007
@@ -240,6 +240,16 @@
     return class_is_before_field_init((Class_Handle) vmTypeHandle)?true:false;
 }
 
+bool        
+DrlVMTypeManager::getClassFastInstanceOfFlag(void* vmTypeHandle) {
+    return class_get_fast_instanceof_flag((Class_Handle) vmTypeHandle)?true:false;
+}
+
+int 
+DrlVMTypeManager::getClassDepth(void* vmTypeHandle) {
+    return class_get_depth((Class_Handle) vmTypeHandle);
+}
+
 uint32
 DrlVMTypeManager::getArrayLengthOffset() {
     return vector_length_offset();

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.h Fri Feb  2 01:05:49 2007
@@ -90,6 +90,8 @@
     bool        isSystemObjectType(void* vmTypeHandle);
     bool        isSystemClassType(void* vmTypeHandle);
     bool        isBeforeFieldInit(void* vmTypeHandle);
+    bool        getClassFastInstanceOfFlag(void* vmTypeHandle);
+    int         getClassDepth(void* vmTypeHandle);
     bool        needsInitialization(void* vmTypeHandle) {
         return class_needs_initialization((Class_Handle)vmTypeHandle)?true:false;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/Class.h Fri Feb  2 01:05:49 2007
@@ -33,6 +33,8 @@
 #include "vtable.h"
 #include "jit_intf.h"
 
+#include <vector>
+
 // forward declarations
 struct Class;
 
@@ -906,18 +908,10 @@
     // number of interface methods in vtable
     unsigned m_num_intfc_method_entries;
 
-    // number intfc tables in intfc_table
-    // same as vtable->intfc_table->n_entries
-    unsigned m_num_intfc_table_entries;
-
     // An array of pointers to Method descriptors, one descriptor
     // for each corresponding entry in m_vtable.methods[].
     Method** m_vtable_descriptors;
 
-    // An array of pointers to Class descriptors, one descriptor
-    // for each corresponding entry in m_intf_table.entry[].
-    Class** m_intfc_table_descriptors;
-
     // number of dimensions in array; current VM limitation is 255
     // Note, that you can derive the base component type of the array
     // by looking at m_name->bytes[m_num_dimensions].
@@ -1172,38 +1166,43 @@
     /** Gets offset of m_depth field in struct Class.
      * @param dummy - dummy variable used to calculate field offset
      * @note Instanceof helpers use returned offset.*/
-    static size_t get_offset_of_depth(Class* dummy) {
-        return (size_t)((char*)(&dummy->m_depth) - (char*)dummy);
+    static size_t get_offset_of_depth() {
+        Class* dummy=NULL;
+        return (size_t)((char*)(&dummy->m_depth));
     }
 
     /** Gets offset of m_is_suitable_for_fast_instanceof field in struct Class.
      * @param dummy - dummy variable used to calculate field offset
      * @note Instanceof helper uses returned offset.*/
-    static size_t get_offset_of_fast_instanceof_flag(Class* dummy) {
-        return (size_t)((char*)(&dummy->m_is_suitable_for_fast_instanceof) - (char*)dummy);
+    static size_t get_offset_of_fast_instanceof_flag() {
+        Class* dummy=NULL;
+        return (size_t)((char*)(&dummy->m_is_suitable_for_fast_instanceof));
     }
-
+    
     /** Gets an offset of <code>m_is_fast_allocation_possible</code> in
      * the class.
      * @note Allocation helpers use returned offset.*/
     size_t get_offset_of_fast_allocation_flag() {
         // else one byte ld in helpers will fail
         assert(sizeof(m_is_fast_allocation_possible) == 1);
-        return (size_t)((char*)(&m_is_fast_allocation_possible) - (char*)this);
+        Class* dummy=NULL;
+        return (size_t)((char*)(&dummy->m_is_fast_allocation_possible));
     }
 
     /** Gets an offset of <code>m_allocation_handle</code> in the class.
      * @note Allocation helpers use returned offset.*/
     size_t get_offset_of_allocation_handle() {
         assert(sizeof(m_allocation_handle)  == sizeof(void*));
-        return (size_t)((char*)(&m_allocation_handle) - (char*)this);
+        Class* dummy=NULL;
+        return (size_t)((char*)(&dummy->m_allocation_handle));
     }
 
     /** Gets an offset of <code>m_instance_data_size</code> in the class.
      * @note Allocation helpers use returned offset.*/
     size_t get_offset_of_instance_data_size() {
         assert(sizeof(m_instance_data_size) == 4);
-        return (size_t)((char*)(&m_instance_data_size) - (char*)this);
+        Class* dummy=NULL;
+        return (size_t)((char*)(&dummy->m_instance_data_size));
     }
 
     /** Gets an offset of <code>m_num_class_init_checks</code> in the class.
@@ -1711,7 +1710,7 @@
      * @param[in] iid - an interface class to retrieve vtable for
      * @return An interface vtable from object; <code>NULL</code>, if no 
      *         such interface exists for the object.*/
-    void* helper_get_interface_vtable(ManagedObject* obj, Class* iid);
+    static void* helper_get_interface_vtable(ManagedObject* obj, Class* iid);
 
     /** Registers a callback that is called to notify the given JIT
      * whenever the given class is extended. The <code>callback_data</code> 
@@ -1888,17 +1887,17 @@
      * @param[in] n_vtable_entries - a number of entries for the vtable*/
     void create_vtable(unsigned n_vtable_entries);
 
-    /** Populates the vtable descriptors table with methods overriding as neccessary.*/
-    void populate_vtable_descriptors_table_and_override_methods();
+    /** Populates the vtable descriptors table with methods overriding as necessary.
+     * @param[in] intfc_table_entries - must contain all interfaces of the given class
+     */
+    void populate_vtable_descriptors_table_and_override_methods(const std::vector<Class*>& intfc_table_entries);
 
     /** Creates and populates an interface table for a class.
+     *  @param[in] intfc_table_entries - must contain all interfaces of the given class
      * @return The created interface table.*/
-    Intfc_Table* create_and_populate_interface_table();
-
-    /** Constructs an interface table descriptors table.*/
-    void build_interface_table_descriptors();
+    Intfc_Table* create_and_populate_interface_table(const std::vector<Class*>& intfc_table_entries);
 
-    /** Sets vtable entries to methods addresses.*/
+     /** Sets vtable entries to methods addresses.*/
     void point_vtable_entries_to_stubs();
 
     /** Adds any required "fake" methods to a class. These are interface methods

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/vtable.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/vtable.h?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/vtable.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/vtable.h Fri Feb  2 01:05:49 2007
@@ -20,11 +20,13 @@
  * @file
  * virtual method table of a class
  */
-extern "C" {
+#include <open/types.h>
+struct Class;
 
+extern "C" {
 typedef struct {
     unsigned char** table;  // pointer into methods array of Intfc_Table below
-    unsigned intfc_id;      // id of interface
+    Class* intfc_class;      // id of interface
 } Intfc_Table_Entry;
 
 typedef struct Intfc_Table {
@@ -66,6 +68,15 @@
 
     unsigned short array_element_size;
     unsigned short array_element_shift;
+    
+    // cached values, used for helper inlining to avoid extra memory access
+    unsigned char** intfc_table_0;
+    Class*          intfc_class_0;
+    unsigned char** intfc_table_1;
+    Class*          intfc_class_1;
+    unsigned char** intfc_table_2;
+    Class*          intfc_class_2;
+
     Intfc_Table* intfc_table;   // interface table; NULL if no intfc table
     Class *superclasses[MAX_FAST_INSTOF_DEPTH];
     unsigned char* methods[1];  // code for methods

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?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- 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 Fri Feb  2 01:05:49 2007
@@ -551,6 +551,12 @@
     return cl->get_depth();
 } //class_get_depth
 
+Boolean class_get_fast_instanceof_flag(Class_Handle cl)
+{
+    assert(cl);
+    return cl->get_fast_instanceof_flag();
+} //class_get_depth
+
 
 Class_Handle vtable_get_class(VTable_Handle vh) {
     return vh->clss;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class.cpp Fri Feb  2 01:05:49 2007
@@ -110,8 +110,7 @@
 
     m_num_instance_refs = 0;
 
-    m_num_virtual_method_entries = m_num_intfc_method_entries =
-        m_num_intfc_table_entries = 0;
+    m_num_virtual_method_entries = m_num_intfc_method_entries = 0;
 
     m_finalize_method = m_static_initializer = m_default_constructor = NULL;
 
@@ -123,7 +122,6 @@
     m_allocation_handle = 0;
 
     m_vtable_descriptors = NULL;
-    m_intfc_table_descriptors = NULL;
 
     m_initializing_thread = NULL;
 
@@ -490,7 +488,9 @@
 
 void* Class::helper_get_interface_vtable(ManagedObject* obj, Class* iid)
 {
-    unsigned num_intfc = m_num_intfc_table_entries;
+    VTable* vt = obj->vt();
+    Intfc_Table* intfTable  = vt->intfc_table;
+    unsigned num_intfc = intfTable->n_entries;
 #ifdef VM_STATS
     VM_Statistics::get_vm_stats().num_invokeinterface_calls++;
     switch(num_intfc) {
@@ -502,7 +502,8 @@
         VM_Statistics::get_vm_stats().invokeinterface_calls_size_max = num_intfc;
 #endif
     for(unsigned i = 0; i < num_intfc; i++) {
-        Class* intfc = m_intfc_table_descriptors[i];
+        const Intfc_Table_Entry& intfEntry = intfTable->entry[i];
+        Class* intfc = intfEntry.intfc_class;
         if(intfc == iid) {
 #ifdef VM_STATS
             switch(i) {
@@ -513,7 +514,7 @@
             if(i > VM_Statistics::get_vm_stats().invokeinterface_calls_searched_max)
                 VM_Statistics::get_vm_stats().invokeinterface_calls_searched_max = i;
 #endif
-            unsigned char** table = m_vtable->intfc_table->entry[i].table;
+            unsigned char** table = intfEntry.table;
             return (void*)table;
         }
     }
@@ -1179,7 +1180,6 @@
     size += m_static_data_size;
     if(!is_interface())
         size += sizeof(VTable);
-    size += m_num_intfc_table_entries*sizeof(Class*);
     for(Class_Extended_Notification_Record* mcnr = m_notify_extended_records;
         mcnr != NULL; mcnr = mcnr->next)
     {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp Fri Feb  2 01:05:49 2007
@@ -41,6 +41,8 @@
 #include "lil_code_generator.h"
 #include "vm_stats.h"
 
+#include <algorithm>
+
 #ifdef _DEBUG
 #include "jni.h"
 #include "jvmti_direct.h"
@@ -492,6 +494,16 @@
 } //assign_values_to_class_static_final_fields
 
 
+class class_comparator{
+public:
+    bool operator() (Class* c1, Class* c2) { 
+        if (c1==c2) return false;
+        int c1Weight = (c1->get_number_of_methods() << 16) + c1->get_id();
+        int c2Weight = (c2->get_number_of_methods() << 16) + c2->get_id();
+        return !(c1Weight < c2Weight); //descending compare
+    }
+};
+
 //
 // create_intfc_table
 //
@@ -500,91 +512,36 @@
     unsigned size = INTFC_TABLE_OVERHEAD + (n_entries * sizeof(Intfc_Table_Entry));
     Intfc_Table *table = (Intfc_Table*) clss->get_class_loader()->Alloc(size);
     memset(table,0,size);
+    table->n_entries = n_entries;
     return table;
 }
 
 
-void Class::build_interface_table_descriptors()
+static void build_interface_table_descriptors(Class* cls, std::vector<Class*>& result, int depth)
 {
-    // Compute the number of methods that are in the interface part of
-    // the vtable. Also, create the array of interfaces (intfc_table_descriptors[])
-    // this class directly or indirectly implements. Note that
-    // m_num_intfc_table_entries was initialized earlier. This is an upperbound
-    // because we eliminate duplicate entries in the table below.
-    unsigned i, k;
-    for (i = 0;  i < m_num_superinterfaces;  i++) {
-        Class* intfc = get_superinterface(i);
-        m_num_intfc_table_entries += intfc->m_num_intfc_table_entries;
-    }
-    // allocate the class's intfc_table_descriptors[] array
-    if(m_num_intfc_table_entries != 0) {
-        m_intfc_table_descriptors = (Class**)m_class_loader
-            ->Alloc(m_num_intfc_table_entries * sizeof(Class*));
-    }
-    for(k = 0; k < m_num_intfc_table_entries; k++) {
-        m_intfc_table_descriptors[k] = NULL;
-    }
     // fill in intfc_table_descriptors with the descriptors from the superclass and the superinterfaces
-    unsigned intfc_table_entry = 0;
-    if(has_super_class()) {
-        for(unsigned i = 0; i < get_super_class()->m_num_intfc_table_entries; i++) {
-            m_intfc_table_descriptors[intfc_table_entry] =
-                get_super_class()->m_intfc_table_descriptors[i];
-            intfc_table_entry++;
+    if(depth == 0 && cls->has_super_class()) {
+        Intfc_Table* superIntfcTable = cls->get_super_class()->get_vtable()->intfc_table;
+        for(unsigned i = 0; i < superIntfcTable->n_entries; i++) {
+            result.push_back(superIntfcTable->entry[i].intfc_class);
         }
     }
-    for(k = 0; k < m_num_superinterfaces; k++) {
-        Class* intfc = get_superinterface(k);
-        for(i = 0; i < intfc->m_num_intfc_table_entries; i++) {
-            m_intfc_table_descriptors[intfc_table_entry] =
-                intfc->m_intfc_table_descriptors[i];
-            intfc_table_entry++;
-        }
+    uint16 num_superinterfaces = cls->get_number_of_superinterfaces();
+    for(unsigned k = 0; k < num_superinterfaces; k++) {
+        Class* intfc = cls->get_superinterface(k);
+        build_interface_table_descriptors(intfc, result, depth+1);
     }
     // if this class is an interface, add it to the interface table
-    if(is_interface()) {
-        m_intfc_table_descriptors[intfc_table_entry] = this;
-        intfc_table_entry++;
+    if(cls->is_interface()) {
+        result.push_back(cls);
     }
-    // sort the interfaces in intfc_table_descriptors, eliminating duplicate entries
-    unsigned last_min_id = 0;
-    for (i = 0;  i < m_num_intfc_table_entries;  i++) {
-        //
-        // select the next interface C with smallest id and insert 
-        // into i'th position; delete entry of C if C is the same
-        // as i-1'th entry
-        //
-        Class* intfc = m_intfc_table_descriptors[i];
-        unsigned min_index = i;            // index of intfc with min id
-        unsigned min_id = intfc->get_id(); // id of intfc with min id
-        for(unsigned k = i + 1; k < m_num_intfc_table_entries; k++) {
-            unsigned id = m_intfc_table_descriptors[k]->get_id();
-            if (id < min_id) {
-                // new min
-                min_index = k;
-                min_id = id;
-                continue;
-            }
-        }
-        // if the id of the min is the same as the i-1'th entry's id,
-        // then we have a duplicate
-        if(min_id == last_min_id) {
-            // duplicate found - insert the last entry in place of the duplicate's entry
-            m_intfc_table_descriptors[min_index] =
-                m_intfc_table_descriptors[m_num_intfc_table_entries-1];
-            m_num_intfc_table_entries--;
-            continue;
-        }
-        last_min_id = min_id;
-        if(min_index == i) {
-            continue;
-        }
-        // swap i'th entry with min entry
-        Class* min_intfc = m_intfc_table_descriptors[min_index];
-        m_intfc_table_descriptors[min_index] = m_intfc_table_descriptors[i];
-        m_intfc_table_descriptors[i] = min_intfc;
+    if (depth==0) {
+        // sort the interfaces eliminating duplicate entries
+        std::sort(result.begin(), result.end(), class_comparator());
+        std::vector<Class*>::iterator newEnd = std::unique(result.begin(), result.end());
+        result.erase(newEnd, result.end());
     }
-} // Class::build_interface_table_descriptors
+}
 
 
 // Returns the method matching the Signature "sig" that is implemented directly or indirectly by "clss", or NULL if not found.
@@ -945,7 +902,7 @@
 } // Class::create_vtable
 
 
-void Class::populate_vtable_descriptors_table_and_override_methods()
+void Class::populate_vtable_descriptors_table_and_override_methods(const std::vector<Class*>& intfc_table_entries)
 {
     // Populate _vtable_descriptors first with _n_virtual_method_entries
     // from super class
@@ -972,8 +929,8 @@
     }
     // finally, the interface methods
     unsigned index = m_num_virtual_method_entries;
-    for(i = 0; i < m_num_intfc_table_entries;  i++) {
-        Class* intfc = m_intfc_table_descriptors[i];
+    for(i = 0; i < intfc_table_entries.size();  i++) {
+        Class* intfc = intfc_table_entries[i];
         for(unsigned k = 0; k < intfc->get_number_of_methods(); k++) {
             if(intfc->get_method(k)->is_clinit()) {
                 continue;
@@ -1105,17 +1062,15 @@
     return addr;
 }
 
-Intfc_Table* Class::create_and_populate_interface_table()
+Intfc_Table* Class::create_and_populate_interface_table(const std::vector<Class*>& intfc_table_entries)
 {
-    Intfc_Table* intfc_table;
-    if(m_num_intfc_table_entries != 0) {
+    // shouldn't it be called vtable_index?
+    Intfc_Table* intfc_table = create_intfc_table(this, intfc_table_entries.size());
+    if(intfc_table_entries.size() != 0) {
         unsigned vtable_offset = m_num_virtual_method_entries;
-        // shouldn't it be called vtable_index?
-        intfc_table = create_intfc_table(this, m_num_intfc_table_entries);
-        unsigned i;
-        for (i = 0; i < m_num_intfc_table_entries; i++) {
-            Class* intfc = m_intfc_table_descriptors[i];
-            intfc_table->entry[i].intfc_id = intfc->get_id();
+        for (unsigned i = 0; i < intfc_table_entries.size(); i++) {
+            Class* intfc = intfc_table_entries[i];
+            intfc_table->entry[i].intfc_class = intfc;
             intfc_table->entry[i].table = &m_vtable->methods[vtable_offset];
             vtable_offset += intfc->get_number_of_methods();
             if(intfc->m_static_initializer) {
@@ -1125,8 +1080,8 @@
         }
         // Set the vtable entries to point to the code address.
         unsigned meth_idx = m_num_virtual_method_entries;
-        for (i = 0; i < m_num_intfc_table_entries; i++) {
-            Class* intfc = m_intfc_table_descriptors[i];
+        for (unsigned i = 0; i < intfc_table_entries.size(); i++) {
+            Class* intfc = intfc_table_entries[i];
             for(unsigned k = 0; k < intfc->get_number_of_methods(); k++) {
                 if (intfc->get_method(k)->is_clinit()) {
                     continue;
@@ -1153,8 +1108,6 @@
                 meth_idx++;
             }
         }
-    } else {
-        intfc_table = NULL;
     }
     return intfc_table;
 } // Class::create_and_populate_interface_table
@@ -1235,17 +1188,13 @@
             // and interface methods of super class
             m_num_virtual_method_entries =
                 get_super_class()->m_num_virtual_method_entries;
-            m_num_intfc_table_entries = get_super_class()->m_num_intfc_table_entries;
         } else {
             // this is java/lang/Object
             // FIXME: primitive classes also get here, but this assignment
             // has no effect on them really
             m_unpadded_instance_data_size = (unsigned)ManagedObject::get_size();
         }
-    } else {
-         // this is interface
-         m_num_intfc_table_entries = 1;    // need table entry for this interface
-     }
+    }
 
     //
     // STEP 5 ::: ASSIGN OFFSETS to the class and instance data FIELDS.
@@ -1257,7 +1206,8 @@
     //
     // STEP 6 ::: Calculate # of INTERFACES METHODS and build interface table DESCRIPTORS for C
     //
-    build_interface_table_descriptors();
+    std::vector<Class*> intfc_table_entries;
+    build_interface_table_descriptors(this, intfc_table_entries, 0);
 
     //
     // STEP 7 ::: ASSIGN OFFSETS to the class and virtual METHODS
@@ -1308,8 +1258,8 @@
     //
     // STEP 10 ::: COMPUTE number of interface method entries.
     //
-    for(i = 0; i < m_num_intfc_table_entries; i++) {
-        Class* intfc = m_intfc_table_descriptors[i];
+    for(i = 0; i < intfc_table_entries.size(); i++) {
+        Class* intfc = intfc_table_entries[i];
         m_num_intfc_method_entries += intfc->get_number_of_methods();
         if(intfc->m_static_initializer) {
             // Don't count static initializers of interfaces.
@@ -1331,7 +1281,7 @@
     // STEP 12 ::: POPULATE with interface descriptors and virtual method descriptors
     //             Also, OVERRIDE superclass' methods with those of this one's
     //
-    populate_vtable_descriptors_table_and_override_methods();
+    populate_vtable_descriptors_table_and_override_methods(intfc_table_entries);
 
     //
     // STEP 13 ::: CREATE VTABLE and set the Vtable entries to point to the
@@ -1361,7 +1311,21 @@
     //
     // STEP 14 ::: CREATE and POPULATE the CLASS INTERFACE TABLE
     //
-    m_vtable->intfc_table = create_and_populate_interface_table();
+    m_vtable->intfc_table = create_and_populate_interface_table(intfc_table_entries);
+    
+    //cache first values
+    if (m_vtable->intfc_table->n_entries >= 1 ) {
+        m_vtable->intfc_class_0 = m_vtable->intfc_table->entry[0].intfc_class;
+        m_vtable->intfc_table_0 = m_vtable->intfc_table->entry[0].table;
+    }
+    if (m_vtable->intfc_table->n_entries >= 2 ) {
+        m_vtable->intfc_class_1 = m_vtable->intfc_table->entry[1].intfc_class;
+        m_vtable->intfc_table_1 = m_vtable->intfc_table->entry[1].table;
+    }
+    if (m_vtable->intfc_table->n_entries >= 3 ) {
+        m_vtable->intfc_class_2 = m_vtable->intfc_table->entry[2].intfc_class;
+        m_vtable->intfc_table_2 = m_vtable->intfc_table->entry[2].table;
+    }
 
     //
     // STEP 15 ::: HANDLE JAVA CLASS CLASS separately

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Fri Feb  2 01:05:49 2007
@@ -265,9 +265,8 @@
     }
 
     // Fast sequence
-    Class* dummy = NULL;
-    const size_t is_fast_off = Class::get_offset_of_fast_instanceof_flag(dummy);
-    const size_t depth_off = Class::get_offset_of_depth(dummy);
+    const size_t is_fast_off = Class::get_offset_of_fast_instanceof_flag();
+    const size_t depth_off = Class::get_offset_of_depth();
     const POINTER_SIZE_INT supertable_off = (POINTER_SIZE_INT)&((VTable*)NULL)->superclasses;
     bool do_slow = true;
     if (type) {
@@ -647,7 +646,7 @@
 static void* rth_get_interface_vtable(ManagedObject* obj, Class* iid)
 {
     assert(obj && obj->vt() && obj->vt()->clss);
-    return obj->vt()->clss->helper_get_interface_vtable(obj, iid);
+    return Class::helper_get_interface_vtable(obj, iid);
 }
 
 // Get interface vtable helper
@@ -2352,13 +2351,12 @@
             object_get_vtable_offset());
     }
 
-    Class* dummy = NULL;
     cs2 = lil_parse_onto_end
         (cs2,
          "ld l1, [i1 + %0i: g4],zx;"
          "ld l2, [l0 + %1i*l1 + %2i: pint];"
          "jc i1 != l2, failed;",
-         Class::get_offset_of_depth(dummy),
+         Class::get_offset_of_depth(),
          sizeof(Class*),
          OFFSET(VTable, superclasses) - sizeof(Class*) + (vm_vtable_pointers_are_compressed() ? vm_get_vtable_base() : 0)
          );
@@ -2422,7 +2420,6 @@
          VM_Global_State::loader_env->managed_null);
     }
 
-    Class* dummy = NULL;
     // check whether the fast or the slow path is appropriate
     cs = lil_parse_onto_end
         (cs,
@@ -2431,7 +2428,7 @@
          // check if super->is_suitable_for_fast_instanceof
          "ld l0, [i1 + %0i: g4];"
          "jc l0!=0:g4, fast;",
-         Class::get_offset_of_fast_instanceof_flag(dummy));
+         Class::get_offset_of_fast_instanceof_flag());
 
     // append the slow path right here
     cs = gen_lil_typecheck_slowpath(cs, is_checkcast);

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?view=diff&rev=502544&r1=502543&r2=502544
==============================================================================
--- 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 Fri Feb  2 01:05:49 2007
@@ -40,6 +40,12 @@
 
     public static void writeBarrier(Address objBase, Address objSlot, Address source) {fail();}
 
+    public static Address getInterfaceVTable(Object obj, int intfTypeId) {fail(); return null;}
+ 
+    public static Object checkCast(Object obj, int castType) {fail(); return null;}
+ 
+    public static boolean instanceOf(Object obj, int castType) {fail(); return false;}
+
 
     protected static void fail() {throw new RuntimeException("Not supported!");}
 

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java?view=auto&rev=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/drlvm/VMHelperFastPath.java Fri Feb  2 01:05:49 2007
@@ -0,0 +1,176 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+/**
+ * @author Mikhail Y. Fursov
+ */ 
+
+package org.apache.harmony.drlvm;
+
+import org.apache.harmony.drlvm.VMHelper;
+import org.vmmagic.unboxed.Address;
+import org.vmmagic.unboxed.ObjectReference;
+import org.vmmagic.unboxed.Offset;
+import org.vmmagic.pragma.InlinePragma;
+
+public class VMHelperFastPath {
+
+    private static final int OBJ_VTABLE_OFFSET   = getObjectVtableOffset();
+    private static final int VTABLE_CLASS_OFFSET = getVtableClassOffset();
+    private static final int VTABLE_SUPERCLASSES_OFFSET = getVtableSuperclassesOffset();
+    private static final int CLASS_INF_TYPE_0_OFFSET  = getVtableIntfTypeOffset(0);
+    private static final int CLASS_INF_TABLE_0_OFFSET = getVtableIntfTableOffset(0);
+    private static final int CLASS_INF_TYPE_1_OFFSET  = getVtableIntfTypeOffset(1);
+    private static final int CLASS_INF_TABLE_1_OFFSET = getVtableIntfTableOffset(1);
+    private static final int CLASS_INF_TYPE_2_OFFSET  = getVtableIntfTypeOffset(2);
+    private static final int CLASS_INF_TABLE_2_OFFSET = getVtableIntfTableOffset(2);
+    private static final int CLASS_DEPTH_OFFSET = getClassDepthOffset();
+
+    private static final int POINTER_SIZE=4;//todo: em64 & ipf incompatible!
+
+    private VMHelperFastPath() {}
+
+
+//TODO: leave only one version 
+//TODO: refactor code to use getVtableIntfTableOffset method (+ avoid extra comparisons while refactoring)
+
+    public static Address getInterfaceVTable3(Object obj, int intfType)  {
+
+        Address objAddr = ObjectReference.fromObject(obj).toAddress();
+        Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+
+        int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
+        if (inf0Type == intfType) {
+            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_0_OFFSET));               
+        }
+    
+        int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
+        if (inf1Type == intfType) {
+            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_1_OFFSET));               
+        }
+
+        int inf2Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_2_OFFSET));
+        if (inf2Type == intfType) {
+            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_2_OFFSET));               
+        }
+        //slow path version
+        return VMHelper.getInterfaceVTable(obj, intfType);
+    }
+
+    public static Address getInterfaceVTable2(Object obj, int intfType)  {
+        Address objAddr = ObjectReference.fromObject(obj).toAddress();
+        Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+
+        int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
+        if (inf0Type == intfType) {
+            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_0_OFFSET));               
+        }
+    
+        int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
+        if (inf1Type == intfType) {
+            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_1_OFFSET));               
+        }
+
+        //slow path version
+        return VMHelper.getInterfaceVTable(obj, intfType);
+    }
+
+    public static Address getInterfaceVTable1(Object obj, int intfType)  {
+        Address objAddr = ObjectReference.fromObject(obj).toAddress();
+        Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+
+        int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
+        if (inf0Type == intfType) {
+            return vtableAddr.loadAddress(Offset.fromInt(CLASS_INF_TABLE_0_OFFSET));               
+        }
+    
+        //slow path version
+        return VMHelper.getInterfaceVTable(obj, intfType);
+    }
+
+    public static boolean instanceOf(Object obj, int castType, boolean isArray, boolean isInterface, boolean isFinalTypeCast, int fastCheckDepth) throws InlinePragma {
+        if (obj == null) {
+            return false;
+        }
+        if (isInterface) {
+            Address objAddr = ObjectReference.fromObject(obj).toAddress();
+            Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+
+
+            int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
+            if (inf0Type == castType) {
+                return true;
+            }
+    
+            int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
+            if (inf1Type == castType) {
+                return true;
+            }
+        } else if (!isArray && fastCheckDepth!=0) {
+            return fastClassInstanceOf(obj, castType, isFinalTypeCast, fastCheckDepth);
+        } 
+        return VMHelper.instanceOf(obj, castType);
+        
+    }
+
+    public static Object checkCast(Object obj, int castType, boolean isArray, boolean isInterface, boolean isFinalTypeCast, int fastCheckDepth) throws InlinePragma {
+        if (obj == null) {
+            return obj;
+        }
+        if (isInterface) {
+            Address objAddr = ObjectReference.fromObject(obj).toAddress();
+            Address vtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+
+
+            int inf0Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_0_OFFSET));
+            if (inf0Type == castType) {
+                return obj;
+            }
+    
+            int inf1Type = vtableAddr.loadInt(Offset.fromInt(CLASS_INF_TYPE_1_OFFSET));
+            if (inf1Type == castType) {
+                return obj;
+            }
+        } else if (!isArray && fastCheckDepth!=0 && fastClassInstanceOf(obj, castType, isFinalTypeCast, fastCheckDepth)) {
+            return obj;
+        } 
+        return VMHelper.checkCast(obj, castType);
+    }
+
+    public static boolean fastClassInstanceOf(Object obj, int castType, boolean isFinalTypeCast, int fastCheckDepth) throws InlinePragma {
+        Address objAddr = ObjectReference.fromObject(obj).toAddress();
+        Address objVtableAddr = objAddr.loadAddress(Offset.fromInt(OBJ_VTABLE_OFFSET));
+        int objClassType  = objVtableAddr.loadInt(Offset.fromInt(VTABLE_CLASS_OFFSET));//todo em64t & ipf incompat
+
+        if (objClassType == castType) {
+            return true;
+        }
+        if (isFinalTypeCast) {
+            return false;
+        }
+       
+        int depthSubType = objVtableAddr.loadInt(Offset.fromInt(VTABLE_SUPERCLASSES_OFFSET + POINTER_SIZE*(fastCheckDepth-1)));
+        return depthSubType == castType;
+    }
+
+
+    private static native int getObjectVtableOffset();
+    private static native int getVtableIntfTypeOffset(int n);
+    private static native int getVtableIntfTableOffset(int n);
+    private static native int getVtableClassOffset();
+    private static native int getVtableSuperclassesOffset();
+    private static native int getClassDepthOffset();
+}

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp?view=auto&rev=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp Fri Feb  2 01:05:49 2007
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+
+
+#include "org_apache_harmony_drlvm_VMHelperFastPath.h"
+
+#include "Class.h"
+#include "vtable.h"
+#include "open/vm.h"
+#include <assert.h>
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getObjectVtableOffset(JNIEnv *e, jclass c)
+{
+    return object_get_vtable_offset();
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableIntfTypeOffset(JNIEnv *e, jclass c, jint i)
+{
+#if defined  (_EM64T_) || defined (_IPF_)
+    assert(0);
+    return 0;
+#else
+    assert(i>=0 && i<=2);
+    if (i==0) return (jint)&((VTable*)0)->intfc_class_0;
+    if (i==1) return (jint)&((VTable*)0)->intfc_class_1;
+    return (jint)&((VTable*)0)->intfc_class_2;
+#endif
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableIntfTableOffset(JNIEnv *e, jclass c, jint i)
+{
+#if defined  (_EM64T_) || defined (_IPF_)
+    assert(0);
+    return 0;
+#else
+
+    assert(i>=0 && i<=2);
+    if (i==0) return (jint)&((VTable*)0)->intfc_table_0;
+    if (i==1) return (jint)&((VTable*)0)->intfc_table_1;
+    return (jint)&((VTable*)0)->intfc_table_2;
+    return 0;
+#endif
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableClassOffset(JNIEnv *e, jclass c)
+{
+    return (jint)&((VTable*)0)->clss;
+}
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableSuperclassesOffset(JNIEnv *e, jclass c)
+{
+    return (jint)&((VTable*)0)->superclasses;
+}
+
+
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getClassDepthOffset(JNIEnv *, jclass)
+{
+    return Class::get_offset_of_depth();
+}

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.h?view=auto&rev=502544
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.h Fri Feb  2 01:05:49 2007
@@ -0,0 +1,84 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+
+#include <jni.h>
+
+
+/* Header for class org.apache.harmony.drlvm.VMHelperFastPath */
+
+#ifndef _ORG_APACHE_HARMONY_DRLVM_VMHELPERFASTPATH_H
+#define _ORG_APACHE_HARMONY_DRLVM_VMHELPERFASTPATH_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ * Class:     org_apache_harmony_drlvm_VMHelperFastPath
+ * Method:    getObjectVtableOffset
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getObjectVtableOffset
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_harmony_drlvm_VMHelperFastPath
+ * Method:    getClassIntfTypeOffset
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableIntfTypeOffset
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_apache_harmony_drlvm_VMHelperFastPath
+ * Method:    getClassIntfTableOffset
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableIntfTableOffset
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_apache_harmony_drlvm_VMHelperFastPath
+ * Method:    getVtableClassOffset
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableClassOffset
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_harmony_drlvm_VMHelperFastPath
+ * Method:    getVtableSuperclassesOffset
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getVtableSuperclassesOffset
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_harmony_drlvm_VMHelperFastPath
+ * Method:    getClassDepthOffset
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getClassDepthOffset
+  (JNIEnv *, jclass);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ORG_APACHE_HARMONY_DRLVM_VMHELPERFASTPATH_H */

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message