harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r525110 [2/4] - in /harmony/enhanced/drlvm/trunk/vm: include/ include/open/ jitrino/src/codegenerator/ jitrino/src/codegenerator/ia32/ jitrino/src/codegenerator/ipf/ jitrino/src/codegenerator/ipf/include/ jitrino/src/dynopt/ jitrino/src/jet...
Date Tue, 03 Apr 2007 09:30:36 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp Tue Apr  3 02:30:33 2007
@@ -569,6 +569,30 @@
     }
 }
 
+// synchronization inlining
+struct ObjectSynchronizationInfo {
+    uint32 threadIdReg;      // the register number that holds id of the current thread
+    uint32 syncHeaderOffset; // offset in bytes of the sync header from the start of the object   
+    uint32 syncHeaderWidth;  // width in bytes of the sync header
+    uint32 lockOwnerOffset;  // offset in bytes of the lock owner field from the start of the object
+    uint32 lockOwnerWidth;   // width in bytes of the lock owner field in the sync header
+    bool   jitClearsCcv;     // whether the JIT needs to clear ar.ccv
+};
+
+// should flush to zero be allowed for floating-point operations ?
+//bool         isFlushToZeroAllowed() {
+//  return flushToZeroAllowed;
+//}
+//
+//  Returns true if jit may inline VM functionality for monitorenter and monitorexit
+//  If true is returned 'syncInfo' is filled in with the synchronization parameters.
+//
+bool         mayInlineObjectSynchronization(ObjectSynchronizationInfo & syncInfo) {
+    assert(0);
+    return false;
+}
+
+
 void SyncOpt::runPass()
 {
     if (Log::isEnabled()) {
@@ -630,13 +654,12 @@
 
     uint32 lockWidth = 2;
     
-    CompilationInterface &compIntfc = irManager.getCompilationInterface();
-    CompilationInterface::ObjectSynchronizationInfo syncInfo;
-    if (compIntfc.mayInlineObjectSynchronization(syncInfo)) 
+    ObjectSynchronizationInfo syncInfo;
+    if (mayInlineObjectSynchronization(syncInfo)) 
         lockWidth = syncInfo.lockOwnerWidth;
 
-    CompilationInterface::ObjectSynchronizationInfo syncInfoFromVM;
-    bool mayInlineSync = irManager.getCompilationInterface().mayInlineObjectSynchronization(syncInfoFromVM);
+    ObjectSynchronizationInfo syncInfoFromVM;
+    bool mayInlineSync = mayInlineObjectSynchronization(syncInfoFromVM);
     if (flags.balance && mayInlineSync)
     {
         TypeManager &typeManager = irManager.getTypeManager();

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Exceptions.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Exceptions.h?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Exceptions.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Exceptions.h Tue Apr  3 02:30:33 2007
@@ -1,43 +0,0 @@
-/*
- *  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 Intel, Mikhail Y. Fursov
- * @version $Revision: 1.6.24.4 $
- *
- */
-
-#ifndef _EXCEPTIONS_H_
-#define _EXCEPTIONS_H_
-
-#include "assert.h"
-
-class IndexOutOfBoundsException {
-public:
-    IndexOutOfBoundsException() : msg("") { assert(0); }
-    IndexOutOfBoundsException(const char* message) : msg(message) { assert(0); }
-    const char* getMessage() {return msg;}
-private:
-    const char* msg;
-};
-
-class TranslationException {
-public:
-    TranslationException() { assert(0); }
-};
-
-#endif // _EXCEPTIONS_H_

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PlatformDependant.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PlatformDependant.h?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PlatformDependant.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PlatformDependant.h Tue Apr  3 02:30:33 2007
@@ -36,6 +36,10 @@
     #define strdup _strdup
     #define strcmpi _strcmpi
     #define stricmp _stricmp
+
+    #define isnan _isnan
+    #define finite _finite
+
 #endif //_MSC_VER
 
 #undef stdcall__

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.cpp?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.cpp Tue Apr  3 02:30:33 2007
@@ -15,24 +15,13 @@
  *  limitations under the License.
  */
 
-/**
- * @author Intel, Mikhail Y. Fursov
- * @version $Revision: 1.16.16.4 $
- *
- */
+#include <iostream>
+#include <streambuf>
 
-//
-// interface to print dot files, you should subclass this class and
-// implement the printBody() method
-//
 #include "PrintDotFile.h"
 #include "Inst.h"
 #include "optimizer.h"
 #include "Log.h"
-#include <stdlib.h>
-#include <fstream>
-#include <iostream>
-#include <streambuf>
 
 
 namespace Jitrino {
@@ -49,6 +38,9 @@
 public:
     dotbuf(::std::streambuf* sb) :
       inquotes(false), bracedepth(0), m_sb(sb) {}
+private:
+    // copy ctor to make msvc compiler happy
+    dotbuf(dotbuf& sb){}
 
 protected:
     int_type overflow(int_type c) {
@@ -91,6 +83,9 @@
       ::std::ostream(&m_buf), m_buf(out.rdbuf()) {}
 
 private:
+    // copy ctor to make msvc compiler happy
+    dotstream(dotstream& sb) : ::std::ostream(NULL), m_buf(NULL) {}
+
     dotbuf m_buf;
 };
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.h?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/PrintDotFile.h Tue Apr  3 02:30:33 2007
@@ -15,16 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Intel, Mikhail Y. Fursov
- * @version $Revision: 1.10.24.4 $
- *
- */
-
-//
-// interface to print dot files, you should subclass this class and
-// override the method printDotBody()
-//
 #ifndef _PRINTDOTFILE_
 #define _PRINTDOTFILE_
 //
@@ -32,7 +22,7 @@
 // implement the printBody() method
 //
 
-#include <fstream>
+#include <ostream>
 
 namespace Jitrino {
 

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=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp Tue Apr  3 02:30:33 2007
@@ -25,6 +25,7 @@
 #include "Opnd.h"
 #include "Type.h"
 #include "VMInterface.h"
+#include "PlatformDependant.h"
 
 namespace Jitrino {
 
@@ -341,6 +342,7 @@
     tauType=voidType=booleanType=charType=intPtrType=int8Type=int16Type=NULL;
     int32Type=int64Type=uintPtrType=uint8Type=uint16Type=NULL;
        uint32Type=uint64Type=singleType=doubleType=floatType=NULL;
+       systemObjectVMTypeHandle = systemClassVMTypeHandle = systemStringVMTypeHandle = NULL;
 }
 
 NamedType* 
@@ -354,17 +356,11 @@
 }
 
 void
-TypeManager::init(CompilationInterface &compInt) {
-    init();
-    areReferencesCompressed = compInt.areReferencesCompressed();
-}
-
-void
 TypeManager::init() {
-    areReferencesCompressed = false;
-    void* systemStringVMTypeHandle = getSystemStringVMTypeHandle();
-    void* systemObjectVMTypeHandle = getSystemObjectVMTypeHandle();
-    void* systemClassVMTypeHandle  = getSystemClassVMTypeHandle();
+    areReferencesCompressed = VMInterface::areReferencesCompressed();
+    void* systemStringVMTypeHandle = VMInterface::getSystemStringVMTypeHandle();
+    void* systemObjectVMTypeHandle = VMInterface::getSystemObjectVMTypeHandle();
+    void* systemClassVMTypeHandle  = VMInterface::getSystemClassVMTypeHandle();
     theSystemStringType = new (memManager) 
         ObjectType(Type::SystemString,systemStringVMTypeHandle,*this);
     theSystemObjectType = new (memManager) 
@@ -423,7 +419,7 @@
                 isUnboxed = false;
             }
             if (arrayVMTypeHandle == NULL) {
-                arrayVMTypeHandle = getArrayVMTypeHandle(elemNamedType->getVMTypeHandle(),isUnboxed);
+                arrayVMTypeHandle = VMInterface::getArrayVMTypeHandle(elemNamedType->getVMTypeHandle(),isUnboxed);
             }
             type = new (memManager) 
                 ArrayType(elemNamedType,arrayVMTypeHandle,*this, isCompressed);
@@ -439,11 +435,11 @@
 
 ObjectType*    
 TypeManager::getObjectType(void* vmTypeHandle, bool isCompressed) {
-    if (isArrayType(vmTypeHandle)) {
-        void* elemClassHandle = getArrayElemVMTypeHandle(vmTypeHandle);
+    if (VMInterface::isArrayType(vmTypeHandle)) {
+        void* elemClassHandle = VMInterface::getArrayElemVMTypeHandle(vmTypeHandle);
         assert(elemClassHandle != NULL); 
         NamedType* elemType;
-        if (isArrayOfPrimitiveElements(vmTypeHandle)) {
+        if (VMInterface::isArrayOfPrimitiveElements(vmTypeHandle)) {
             elemType = getValueType(elemClassHandle);
         } else {
             elemType = getObjectType(elemClassHandle, areReferencesCompressed);
@@ -465,12 +461,8 @@
 TypeManager::getValueType(void* vmTypeHandle) {
     NamedType* type = userValueTypes.lookup(vmTypeHandle);
     if (type == NULL) {
-        if (isEnumType(vmTypeHandle)) {
-            Type* underlyingType = getUnderlyingType(vmTypeHandle);
-            type = new (memManager) EnumType(vmTypeHandle,*this,underlyingType);
-        } else {
-            type = new (memManager) UserValueType(vmTypeHandle,*this);
-        }
+        assert(0);
+        type = new (memManager) UserValueType(vmTypeHandle,*this);
         userValueTypes.insert(vmTypeHandle,type);
     }
     return type;
@@ -478,52 +470,47 @@
 
 bool    
 ObjectType::_isFinalClass()    {
-    return typeManager.isFinalType(vmTypeHandle);
+    return VMInterface::isFinalType(vmTypeHandle);
 }
 
 bool    
 ObjectType::isInterface() {
-    return typeManager.isInterfaceType(vmTypeHandle);
+    return VMInterface::isInterfaceType(vmTypeHandle);
 }
 
 bool    
 ObjectType::isAbstract() {
-    return typeManager.isAbstractType(vmTypeHandle);
+    return VMInterface::isAbstractType(vmTypeHandle);
 }
 
 bool    
 NamedType::needsInitialization(){
-    return typeManager.needsInitialization(vmTypeHandle);
+    return VMInterface::needsInitialization(vmTypeHandle);
 }
 
 bool    
 NamedType::isFinalizable(){
-    return typeManager.isFinalizable(vmTypeHandle);
+    return VMInterface::isFinalizable(vmTypeHandle);
 }
 
 bool    
 NamedType::isBeforeFieldInit() {
-    return typeManager.isBeforeFieldInit(vmTypeHandle);
+    return VMInterface::isBeforeFieldInit(vmTypeHandle);
 }
 
 bool    
 NamedType::isLikelyExceptionType() {
-    return typeManager.isLikelyExceptionType(vmTypeHandle);
-}
-
-bool    
-NamedType::isVariableSizeType() {
-    return typeManager.isVariableSizeType(vmTypeHandle);
+    return VMInterface::isLikelyExceptionType(vmTypeHandle);
 }
 
 void*
 NamedType::getRuntimeIdentifier() {
-    return typeManager.getRuntimeClassHandle(vmTypeHandle);
+    return vmTypeHandle;
 }
 
 ObjectType*
 ObjectType::getSuperType() {
-    void* superTypeVMTypeHandle = typeManager.getSuperTypeVMTypeHandle(vmTypeHandle);
+    void* superTypeVMTypeHandle = VMInterface::getSuperTypeVMTypeHandle(vmTypeHandle);
     if (superTypeVMTypeHandle)
         return typeManager.getObjectType(superTypeVMTypeHandle,
                                          isCompressedReference());
@@ -537,7 +524,7 @@
 //
 void*    
 ObjectType::getVTable() {
-    return typeManager.getVTable(vmTypeHandle);
+    return VMInterface::getVTable(vmTypeHandle);
 }
 
 //
@@ -545,14 +532,14 @@
 //
 void*    
 ObjectType::getAllocationHandle() {
-    return typeManager.getAllocationHandle(vmTypeHandle);
+    return VMInterface::getAllocationHandle(vmTypeHandle);
 }
 //
 // returns true if this type is a subclass of otherType
 //
 bool
 ObjectType::isSubClassOf(NamedType *other) {
-    return typeManager.isSubClassOf(vmTypeHandle,other->getRuntimeIdentifier());
+    return VMInterface::isSubClassOf(vmTypeHandle,other->getRuntimeIdentifier());
 }
 
 //
@@ -622,35 +609,27 @@
 //
 uint32
 ObjectType::getObjectSize() {
-    return typeManager.getBoxedSize(vmTypeHandle);
-}
-
-//
-// for boxed value types, returns byte offset of the un-boxed value
-//
-uint32
-ObjectType::getUnboxedOffset() {
-    return typeManager.getUnboxedOffset(vmTypeHandle);
+    return VMInterface::getObjectSize(vmTypeHandle);
 }
 
 const char* 
 ObjectType::getName() {
-    return typeManager.getTypeName(vmTypeHandle);
+    return VMInterface::getTypeName(vmTypeHandle);
 }
 
 const char* 
 ObjectType::getNameQualifier() {
-    return typeManager.getTypeNameQualifier(vmTypeHandle);
+    return VMInterface::getTypeNameQualifier(vmTypeHandle);
 }
 
 bool 
 ObjectType::getFastInstanceOfFlag() {
-    return typeManager.getClassFastInstanceOfFlag(vmTypeHandle);
+    return VMInterface::getClassFastInstanceOfFlag(vmTypeHandle);
 }
 
 int 
 ObjectType::getClassDepth() {
-    return typeManager.getClassDepth(vmTypeHandle);
+    return VMInterface::getClassDepth(vmTypeHandle);
 }
 
 //
@@ -659,7 +638,7 @@
 uint32    
 ArrayType::getArrayElemOffset()    {
     bool isUnboxed = elemType->isValueType();
-    return typeManager.getArrayElemOffset(elemType->getVMTypeHandle(),isUnboxed);
+    return VMInterface::getArrayElemOffset(elemType->getVMTypeHandle(),isUnboxed);
 }
 
 //
@@ -667,7 +646,7 @@
 //
 uint32    
 ArrayType::getArrayLengthOffset() {
-    return typeManager.getArrayLengthOffset();
+    return VMInterface::getArrayLengthOffset();
 }
 
 // predefined value types
@@ -700,38 +679,12 @@
 
 const char* 
 UserValueType::getName() {
-    return typeManager.getTypeName(vmTypeHandle);
+    return VMInterface::getTypeName(vmTypeHandle);
 }
 
 const char* 
 UserValueType::getNameQualifier() {
-    return typeManager.getTypeNameQualifier(vmTypeHandle);
-}
-
-uint32
-UserValueType::getUnboxedSize() {
-    return typeManager.getUnboxedSize(vmTypeHandle);
-}
-
-uint32
-UserValueType::getUnboxedAlignment() {
-    return typeManager.getUnboxedAlignment(vmTypeHandle);
-}
-
-//
-// returns the number of fields in the value type
-//
-uint32
-UserValueType::getUnboxedNumFields() {
-    return typeManager.getUnboxedNumFields(vmTypeHandle);
-}
-
-//
-// returns the field with the given index 
-//
-FieldDesc*
-UserValueType::getUnboxedFieldDesc(uint32 index) {
-    return typeManager.getUnboxedFieldDesc(vmTypeHandle,index);
+    return VMInterface::getTypeNameQualifier(vmTypeHandle);
 }
 
 //-----------------------------------------------------------------------------
@@ -828,7 +781,7 @@
 
 Type* MethodPtrType::getParamType(uint32 i)
 {
-    return (i==0 && object ? typeManager.getSingletonType(object) : methodSig->getParamType(i));
+    return (i==0 && object ? typeManager.getSingletonType(object) : methodDesc->getParamType(i));
 }
 
 void    MethodPtrType::print(::std::ostream& os) {
@@ -837,7 +790,7 @@
     } else {
         os << "method:";
     }
-    os << massageStr(typeManager.getMethodName(methodDesc));
+    os << massageStr(methodDesc->getName());
 }
 
 void    VTablePtrType::print(::std::ostream& os) {

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=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h Tue Apr  3 02:30:33 2007
@@ -32,14 +32,6 @@
 
 namespace Jitrino {
 
-#ifdef PLATFORM_POSIX
-#ifndef __cdecl
-#define __cdecl
-#endif
-#endif
-
-class MethodDesc;
-class FieldDesc;
 class SsaOpnd;
 //
 // forward declarations
@@ -262,7 +254,7 @@
         return (SystemObject <= tag && tag <= ITablePtrObj);
     }
     static bool isCompressedReference(Tag tag, CompilationInterface &compInt) {
-        if (compInt.areReferencesCompressed()) {
+        if (VMInterface::areReferencesCompressed()) {
             // Note: When a reference is converted to a managed pointer, it is converted from a 
             // compressed pointer in the heap to a raw pointer in the heap
             return ((SystemObject <= tag && tag <= BoxedValue)
@@ -407,20 +399,19 @@
 class MethodPtrType : public FunctionPtrType {
 public:
     MethodPtrType(MethodDesc* md, TypeManager& tm, bool isCompressed=false, ValueName obj=NULL) 
-        : FunctionPtrType(isCompressed), methodDesc(md), methodSig(md->getMethodSig()), typeManager(tm), object(obj) {}
+        : FunctionPtrType(isCompressed), methodDesc(md), typeManager(tm), object(obj) {}
     virtual ~MethodPtrType() {}
 
     MethodPtrType* asMethodPtrType() { return this; }
-    uint32 getNumParams() { return methodSig->getNumParams(); }
+    uint32 getNumParams() { return methodDesc->getNumParams(); }
     Type* getParamType(uint32 i);
-    Type* getReturnType() { return methodSig->getReturnType(); }
+    Type* getReturnType() { return methodDesc->getReturnType(); }
     bool isInstance() { return methodDesc->isInstance(); }
     MethodDesc*     getMethodDesc()         {return methodDesc;}
     void print(::std::ostream& os);
     ValueName getThisValueName() { return object; }
 private:
     MethodDesc* methodDesc;
-    MethodSignatureDesc* methodSig;
     TypeManager& typeManager;
     ValueName object;
 };
@@ -455,7 +446,6 @@
     bool isFinalizable();
     bool isBeforeFieldInit();
     bool isLikelyExceptionType();
-    bool isVariableSizeType();
     bool isNamedType() {return true;}
     //
     // Returns the runtime identifier for this type; 
@@ -486,16 +476,8 @@
     //
     // returns size & alignment of the un-boxed value
     //
-    virtual uint32        getUnboxedSize();
-    virtual uint32        getUnboxedAlignment();
-    //
-    // returns the number of fields in the value type
-    //
-    virtual uint32        getUnboxedNumFields();
-    //
-    // returns the field with the given index 
-    //
-    virtual FieldDesc*    getUnboxedFieldDesc(uint32 index);
+    virtual uint32        getUnboxedSize(){assert(0); return 0;}
+    //virtual uint32        getUnboxedAlignment();
     void        print(::std::ostream& os);
 protected:
     UserValueType(Tag t,void* td,TypeManager& tm) : NamedType(t,td,tm) {}
@@ -655,9 +637,8 @@
     TypeManager(MemoryManager& mm);
     virtual ~TypeManager() {}
 
-    void    init(CompilationInterface &compInt);
     void    init();
-    MemoryManager&  getMemManager()        {return memManager;}
+    //MemoryManager&  getMemManager()        {return memManager;}
 
     Type* getPrimitiveType(Type::Tag);
     // Convert type to the type which variable will have
@@ -722,10 +703,6 @@
         }
         return type;
     }
-    Type*    getFunPtrType(Type* retType,uint32 numParams,Type** paramTypes) {
-        assert(0);
-        return NULL;
-    }
     MethodPtrType*    getMethodPtrType(MethodDesc* methodDesc) {
         MethodPtrType* type = methodPtrTypes.lookup(methodDesc);
         if (type == NULL) {
@@ -827,7 +804,7 @@
     {
         if (vmAllocationHandle==NULL)
             return NULL;
-        void * vmTypeHandle = getTypeHandleFromAllocationHandle(vmAllocationHandle);
+        void * vmTypeHandle = VMInterface::getTypeHandleFromAllocationHandle(vmAllocationHandle);
         if ( vmTypeHandle==NULL 
                 || vmTypeHandle>(void*)-100
                 || ((POINTER_SIZE_INT)vmTypeHandle&0x3)!=0 ) {
@@ -895,56 +872,11 @@
     bool areReferencesCompressed;
 
     NamedType* initBuiltinType(Type::Tag tag);
-public:
-    //
-    // VM specific methods for types
-    // Move to VM interface class and delegate
-    //
-    virtual void*       getBuiltinValueTypeVMTypeHandle(Type::Tag) = 0;
-    virtual void*       getSystemObjectVMTypeHandle() = 0;
-    virtual void*       getSystemClassVMTypeHandle() = 0;
-    virtual void*       getSystemStringVMTypeHandle() = 0;
-    virtual void*       getArrayVMTypeHandle(void* elemVMTypeHandle,bool isUnboxed) = 0;
-    virtual const char* getTypeName(void* vmTypeHandle) = 0;
-    virtual const char* getTypeNameQualifier(void* vmTypeHandle) = 0;
-    virtual void*       getSuperTypeVMTypeHandle(void* vmTypeHandle) = 0;
-    virtual const char* getMethodName(MethodDesc*) = 0;
-    virtual void*       getArrayElemVMTypeHandle(void* vmTypeHandle) = 0;
-    virtual bool        isArrayType(void* vmTypeHandle) = 0;
-    virtual bool        isArrayOfPrimitiveElements(void* vmTypeHandle) = 0;
-    virtual bool        isEnumType(void* vmTypeHandle) = 0;
-    virtual bool        isValueType(void* vmTypeHandle) = 0;
-    virtual bool        isFinalType(void* vmTypeHandle) = 0;
-    virtual bool        isLikelyExceptionType(void* vmTypeHandle) = 0;
-    virtual bool        isInterfaceType(void* vmTypeHandle) = 0;
-    virtual bool        isAbstractType(void* vmTypeHandle) = 0;
-    virtual bool        isSystemStringType(void* vmTypeHandle) = 0;
-    virtual bool        isSystemObjectType(void* vmTypeHandle) = 0;
-    virtual bool        isSystemClassType(void* vmTypeHandle) = 0;
-    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;
-    virtual void*       getRuntimeClassHandle(void* vmTypeHandle) = 0;
-    virtual void*       getAllocationHandle(void* vmTypeHandle) = 0;
-    virtual bool        isSubClassOf(void* vmTypeHandle1,void* vmTypeHandle2) = 0;
-    virtual uint32      getUnboxedOffset(void* vmTypeHandle) = 0;
-    virtual uint32      getArrayElemOffset(void* vmElemTypeHandle,bool isUnboxed) = 0;
-    virtual uint32      getBoxedSize(void * vmTypeHandle) = 0;
-    virtual uint32      getUnboxedSize(void* vmTypeHandle) = 0;
-    virtual uint32      getUnboxedAlignment(void* vmTypeHandle) = 0;
-    virtual uint32      getUnboxedNumFields(void* vmTypeHandle) = 0;
-    virtual FieldDesc*  getUnboxedFieldDesc(void* vmTypeHandle,uint32 index) = 0;
-    virtual uint32      getArrayLengthOffset() = 0;
-    virtual Type*       getUnderlyingType(void* enumVMTypeHandle) = 0;
+    void*       getBuiltinValueTypeVMTypeHandle(Type::Tag);
 
-    virtual uint32      getVTableOffset() = 0;
-    virtual void*       getTypeHandleFromAllocationHandle(void* vmAllocationHandle) = 0;
-    
+    void*        systemObjectVMTypeHandle;
+    void*        systemClassVMTypeHandle;
+    void*        systemStringVMTypeHandle;
 };
 
 } //namespace Jitrino 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/methodtable.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/methodtable.cpp?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/methodtable.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/methodtable.cpp Tue Apr  3 02:30:33 2007
@@ -56,7 +56,6 @@
 // FOO=(Ljava/lang/Object;)
 // FOO=(L;)  (jit only methods with a single class ptr in signature)
 
-//#include "defines.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp Tue Apr  3 02:30:33 2007
@@ -51,18 +51,14 @@
     IRManager* irm = cc->getHIRManager();
     assert(irm);
     MethodDesc& methodDesc = irm->getMethodDesc();
-    if (methodDesc.isJavaByteCodes()) {
-        //create IRBuilder
-        MemoryManager& mm = cc->getCompilationLevelMemoryManager();
-        TranslatorAction* myAction = (TranslatorAction*)getAction();
-        IRBuilder* irb = (IRBuilder*)myAction->getIRBuilderAction()->createSession(mm);
-        irb->setCompilationContext(cc);
-        MemoryManager tmpMM(1024, "IRBuilder::tmpMM");
-        irb->init(irm, &flags, tmpMM);
-        JavaTranslator::translateMethod(*cc->getVMCompilationInterface(), methodDesc, *irb);
-    } else {
-        assert(false);
-    }
+    //create IRBuilder
+    MemoryManager& mm = cc->getCompilationLevelMemoryManager();
+    TranslatorAction* myAction = (TranslatorAction*)getAction();
+    IRBuilder* irb = (IRBuilder*)myAction->getIRBuilderAction()->createSession(mm);
+    irb->setCompilationContext(cc);
+    MemoryManager tmpMM(1024, "IRBuilder::tmpMM");
+    irb->init(irm, &flags, tmpMM);
+    JavaTranslator::translateMethod(*cc->getVMCompilationInterface(), methodDesc, *irb);
 }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp Tue Apr  3 02:30:33 2007
@@ -22,7 +22,6 @@
  */
 
 #include <stdio.h>
-#include "assert.h"
 #include "JavaByteCodeParser.h"
 
 namespace Jitrino {

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=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp Tue Apr  3 02:30:33 2007
@@ -446,14 +446,13 @@
 
 void 
 JavaByteCodeTranslator::initArgs() {
-    MethodSignatureDesc* methodSignatureDesc = methodToCompile.getMethodSig();
     // incoming argument and return value information
-    numArgs = methodSignatureDesc->getNumParams();
-    retType = methodSignatureDesc->getReturnType();
+    numArgs = methodToCompile.getNumParams();
+    retType = methodToCompile.getReturnType();
     argTypes = new (memManager) Type*[numArgs];
     args = new (memManager) Opnd*[numArgs];
     for (uint16 i=0; i<numArgs; i++) {
-        Type* argType = methodSignatureDesc->getParamType(i);
+        Type* argType = methodToCompile.getParamType(i);
         // argType == NULL if it fails to be resolved. Respective exception
         // will be thrown at the point of usage
         argTypes[i] = argType != NULL ? argType : typeManager.getNullObjectType();
@@ -602,14 +601,14 @@
 
 const char*
 JavaByteCodeTranslator::methodSignatureString(uint32 cpIndex) {
-    return compilationInterface.methodSignatureString(&methodToCompile,cpIndex);
+    return compilationInterface.getSignatureString(&methodToCompile,cpIndex);
 }
 
 uint32 
 JavaByteCodeTranslator::labelId(uint32 offset) {
     uint32 labelId = prepass.getLabelId(offset);
     if (labelId == (uint32) -1)
-        jitrino_assert(compilationInterface, 0);
+        jitrino_assert(0);
     return labelId;
 }
 
@@ -620,13 +619,13 @@
 // called when invalid byte code is encountered
 void 
 JavaByteCodeTranslator::invalid() {
-    jitrino_assert(compilationInterface,0);
+    jitrino_assert(0);
 }
 
 // called when an error occurs during the byte code parsing
 void 
 JavaByteCodeTranslator::parseError() {
-    jitrino_assert(compilationInterface,0);
+    jitrino_assert(0);
 }
 
 void 
@@ -727,7 +726,7 @@
                 Log::out() << "LABEL "; labelInst->print(Log::out()); Log::out() << labelInst->getState();
                 Log::out() << "CATCH "; handler->getLabelInst()->print(Log::out()); Log::out() << ::std::endl;
             }
-        } else {jitrino_assert(compilationInterface,0);}    // only catch blocks should occur in Java
+        } else {jitrino_assert(0);}    // only catch blocks should occur in Java
     }
     // generate the label instruction
     if(translationFlags.newCatchHandling && !catchLabels.empty()) {
@@ -1011,7 +1010,7 @@
             opnd = irBuilder.genLdConstant((float)value);
         } else {
             // Invalid type!
-            jitrino_assert(compilationInterface,0);
+            jitrino_assert(0);
         }
     }
     pushOpnd(opnd);
@@ -1034,7 +1033,7 @@
         opnd = irBuilder.genLdConstant((double)value);
     } else {
         // Invalid type!
-        jitrino_assert(compilationInterface,0);
+        jitrino_assert(0);
     }
     pushOpnd(opnd);
 }
@@ -1736,7 +1735,7 @@
 //-----------------------------------------------------------------------------
 void 
 JavaByteCodeTranslator::linkingException(uint32 constPoolIndex, uint32 operation) {
-    Class_Handle enclosingDrlVMClass = compilationInterface.methodGetClass(&methodToCompile);
+    Class_Handle enclosingDrlVMClass = methodToCompile.getParentHandle();
     irBuilder.genThrowLinkingException(enclosingDrlVMClass, constPoolIndex, operation);
 }
 //-----------------------------------------------------------------------------
@@ -1764,8 +1763,7 @@
 // method invocation byte codes
 //-----------------------------------------------------------------------------
 Opnd** 
-JavaByteCodeTranslator::popArgs(MethodSignatureDesc* methodSignatureDesc) {
-    uint32 numArgs = methodSignatureDesc->getNumParams();
+JavaByteCodeTranslator::popArgs(uint32 numArgs) {
     // pop source operands
     Opnd** srcOpnds = new (memManager) Opnd*[numArgs];
     for (int i=numArgs-1; i>=0; i--) 
@@ -1783,12 +1781,10 @@
         pseudoInvoke(methodSig_string);
         return;
     }
-    jitrino_assert(compilationInterface,methodDesc);
-    MethodSignatureDesc* methodSig = methodDesc->getMethodSig();
-    jitrino_assert(compilationInterface,methodSig);
-    Opnd** srcOpnds = popArgs(methodSig);
-    uint32 numArgs = methodSig->getNumParams();
-    Type* returnType = methodSig->getReturnType();
+    jitrino_assert(methodDesc);
+    uint32 numArgs = methodDesc->getNumParams();
+    Opnd** srcOpnds = popArgs(numArgs);
+    Type* returnType = methodDesc->getReturnType();
 
     if (isMagicClass(methodDesc->getParentType())) {
         genMagic(methodDesc, numArgs, srcOpnds, returnType);
@@ -1928,12 +1924,10 @@
         pseudoInvoke(methodSig_string);
         return;
     }
-    jitrino_assert(compilationInterface,methodDesc);
-    MethodSignatureDesc* methodSig = methodDesc->getMethodSig();
-    jitrino_assert(compilationInterface,methodSig);
-    uint32 numArgs = methodSig->getNumParams();
-    Opnd** srcOpnds = popArgs(methodSig);
-    Type* returnType = methodSig->getReturnType();
+    jitrino_assert(methodDesc);
+    uint32 numArgs = methodDesc->getNumParams();
+    Opnd** srcOpnds = popArgs(numArgs);
+    Type* returnType = methodDesc->getReturnType();
     // invokespecial can throw a null pointer exception
     Opnd *tauNullChecked = irBuilder.genTauCheckNull(srcOpnds[0]);
     Opnd* dst;
@@ -1990,12 +1984,10 @@
         pseudoInvoke(methodSig_string);
         return;
     }
-    jitrino_assert(compilationInterface,methodDesc);
-    MethodSignatureDesc* methodSig = methodDesc->getMethodSig();
-    jitrino_assert(compilationInterface,methodSig);
-    uint32 numArgs = methodSig->getNumParams();
-    Opnd** srcOpnds = popArgs(methodSig);
-    Type *returnType = methodSig->getReturnType();
+    jitrino_assert(methodDesc);
+    uint32 numArgs = methodDesc->getNumParams();
+    Opnd** srcOpnds = popArgs(numArgs);
+    Type *returnType = methodDesc->getReturnType();
     if (returnType == NULL) {
         // This means that it was not resolved successfully but it can be resolved later
         // inside the callee (with some "magic" custom class loader for example)
@@ -2033,12 +2025,10 @@
         pseudoInvoke(methodSig_string);
         return;
     }
-    jitrino_assert(compilationInterface,methodDesc);
-    MethodSignatureDesc* methodSig = methodDesc->getMethodSig();
-    jitrino_assert(compilationInterface,methodSig);
-    Type* returnType = methodSig->getReturnType();
-    uint32 numArgs = methodSig->getNumParams();
-    Opnd** srcOpnds = popArgs(methodSig);
+    jitrino_assert(methodDesc);
+    uint32 numArgs = methodDesc->getNumParams();
+    Opnd** srcOpnds = popArgs(numArgs);
+    Type* returnType = methodDesc->getReturnType();
     // callintf can throw a null pointer exception
     Opnd *tauNullChecked = irBuilder.genTauCheckNull(srcOpnds[0]);
     Opnd* thisOpnd = srcOpnds[0];
@@ -2105,7 +2095,7 @@
         pushOpnd(irBuilder.genLdNull());
         return;
     }
-    jitrino_assert(compilationInterface,type);
+    jitrino_assert(type);
     pushOpnd(irBuilder.genNewObj(type));
 }
 void 
@@ -2128,7 +2118,7 @@
         type = typeManager.getInt32Type(); break;
     case 11: // long
         type = typeManager.getInt64Type(); break;
-    default: jitrino_assert(compilationInterface,0);
+    default: jitrino_assert(0);
     }
     Opnd* arrayOpnd = irBuilder.genNewArray(type,popOpnd());
     pushOpnd(arrayOpnd);
@@ -2150,7 +2140,7 @@
         pushOpnd(irBuilder.genLdNull());
         return;
     }
-    jitrino_assert(compilationInterface,type);
+    jitrino_assert(type);
     pushOpnd(irBuilder.genNewArray(type,popOpnd()));
 }
 
@@ -2166,8 +2156,8 @@
         pushOpnd(irBuilder.genLdNull());
         return;
     }
-    jitrino_assert(compilationInterface,arraytype);
-    jitrino_assert(compilationInterface,dimensions > 0);
+    jitrino_assert(arraytype);
+    jitrino_assert(dimensions > 0);
     Opnd** countOpnds = new (memManager) Opnd*[dimensions];
     // pop the sizes
     for (int i=dimensions-1; i>=0; i--) {
@@ -2200,7 +2190,7 @@
         linkingException(constPoolIndex, OPCODE_CHECKCAST);
         return; // can be left as is
     }
-    jitrino_assert(compilationInterface,type);
+    jitrino_assert(type);
     pushOpnd(irBuilder.genCast(popOpnd(),type));
 }
 
@@ -2213,7 +2203,7 @@
         pushOpnd(irBuilder.genLdConstant((int32)0));
         return 3;
     }
-    jitrino_assert(compilationInterface,type);
+    jitrino_assert(type);
 
     Opnd* src = popOpnd();
     Type* srcType = src->getType();
@@ -2789,8 +2779,8 @@
     bool dstIsArray = dstType->isArray();
     ArrayType* srcAsArrayType = srcType->asArrayType();
     ArrayType* dstAsArrayType = dstType->asArrayType();
-    bool srcIsArrOfPrimitive = srcIsArray && typeManager.isArrayOfPrimitiveElements(srcAsArrayType->getVMTypeHandle());
-    bool dstIsArrOfPrimitive = dstIsArray && typeManager.isArrayOfPrimitiveElements(dstAsArrayType->getVMTypeHandle());
+    bool srcIsArrOfPrimitive = srcIsArray && VMInterface::isArrayOfPrimitiveElements(srcAsArrayType->getVMTypeHandle());
+    bool dstIsArrOfPrimitive = dstIsArray && VMInterface::isArrayOfPrimitiveElements(dstAsArrayType->getVMTypeHandle());
     if ( !(srcIsArray && dstIsArray) ) {
          throwsASE = true;
     } else if ( srcIsArrOfPrimitive ) {
@@ -2804,7 +2794,7 @@
         // To avoid this we just reject the inlining of System::arraycopy call in this case.
         NamedType* srcElemType = srcAsArrayType->getElementType();
         NamedType* dstElemType = dstAsArrayType->getElementType();
-        throwsASE = ! typeManager.isSubClassOf(srcElemType->getVMTypeHandle(),dstElemType->getVMTypeHandle());
+        throwsASE = ! VMInterface::isSubClassOf(srcElemType->getVMTypeHandle(),dstElemType->getVMTypeHandle());
     }
     if ( throwsASE )
         return false;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h Tue Apr  3 02:30:33 2007
@@ -268,7 +268,7 @@
     //
     // helper methods for generating code
     //
-    Opnd**  popArgs(MethodSignatureDesc*);
+    Opnd**  popArgs(uint32 numArgs);
     // for invoke emulation if resolution fails
     void    pseudoInvoke(const char* mdesc);
     void    invalid();    // called when invalid IR is encountered

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp Tue Apr  3 02:30:33 2007
@@ -284,7 +284,7 @@
     }
 }
 
-class JavaExceptionParser: public ExceptionCallback {
+class JavaExceptionParser {
 public:
     JavaExceptionParser(MemoryManager& mm,JavaLabelPrepass& p,
                     CompilationInterface& ci,MethodDesc* method) 
@@ -292,11 +292,28 @@
           compilationInterface(ci), enclosingMethod(method),
           prevCatch(NULL), nextRegionId(0) {}
 
+    uint32 parseHandlers() {
+        uint32 numHandlers = enclosingMethod->getNumHandlers();
+        for (uint32 i=0; i<numHandlers; i++) {
+            unsigned beginOffset,endOffset,handlerOffset,handlerClassIndex;
+            enclosingMethod->getHandlerInfo(i,&beginOffset,&endOffset,
+                &handlerOffset,&handlerClassIndex);
+            if (!catchBlock(beginOffset,endOffset-beginOffset,
+                handlerOffset,0,handlerClassIndex))
+            {
+                // handlerClass failed to be resolved. LinkingException throwing helper
+                // will be generated instead of method's body
+                return handlerClassIndex;
+            }
+        }
+        return MAX_UINT32; // all catchBlocks were processed successfully
+    }
+
     void addHandlerForCatchBlock(CatchBlock* block, 
                                       uint32 handlerOffset,
                                       uint32 handlerLength,
                                       Type*  exceptionType) {
-        jitrino_assert(compilationInterface, exceptionType);
+        jitrino_assert( exceptionType);
         Log::out() << "Catch Exception Type = " << exceptionType->getName() << ::std::endl;
 
         CatchHandler* handler = new (memManager) 
@@ -342,7 +359,7 @@
         return newBlock;
     }
 
-    virtual bool catchBlock(uint32 tryOffset,
+    bool catchBlock(uint32 tryOffset,
                             uint32 tryLength,
                             uint32 handlerOffset,
                             uint32 handlerLength,
@@ -419,19 +436,6 @@
         }
         return 1; // all exceptionTypes are OK
     }
-    virtual void finallyBlock(uint32 tryOffset,
-                            uint32 tryLength,
-                            uint32 handlerOffset,
-                            uint32 handlerLength)    {jitrino_assert(compilationInterface, 0);}
-    virtual void filterBlock(uint32 tryOffset,
-                            uint32 tryLength,
-                            uint32 handlerOffset,
-                            uint32 handlerLength,
-                            uint32 expressionStart)    {jitrino_assert(compilationInterface, 0);}
-    virtual void faultBlock(uint32 tryOffset,
-                            uint32 tryLength,
-                            uint32 handlerOffset,
-                            uint32 handlerLength)    {jitrino_assert(compilationInterface, 0);}
 
     uint32 numCatch;
     MemoryManager&            memManager;
@@ -490,7 +494,7 @@
     // parse and create exception info
     JavaExceptionParser exceptionTypes(irManager,*this,compilationInterface,&methodDesc);
     // fix exception handlers
-    unsigned problemToken = methodDesc.parseJavaHandlers(exceptionTypes);
+    unsigned problemToken = exceptionTypes.parseHandlers();
     if(problemToken != MAX_UINT32)
     {
         problemTypeToken = problemToken;
@@ -504,8 +508,7 @@
     isFallThruLabel = true;
     numVars = methodDesc.getNumVars();
     methodDesc.getMaxStack();
-    MethodSignatureDesc* methodSig = methodDesc.getMethodSig();
-    uint32 numArgs = methodSig->getNumParams();
+    uint32 numArgs = methodDesc.getNumParams();
     for (uint32 i=0, j=0; i<numArgs; i++,j++) {
         Type *type;
         struct StateInfo::SlotInfo *slot = &stateInfo.stack[j];
@@ -515,7 +518,7 @@
             type = actual->getType();
             if(Log::isEnabled()) {
                 Log::out() << "PARAM " << (int)i << " sig: ";
-                methodSig->getParamType(i)->print(Log::out());
+                methodDesc.getParamType(i)->print(Log::out());
                 Log::out() << " actual: ";
                 type->print(Log::out()); Log::out() << ::std::endl;
             }
@@ -524,7 +527,7 @@
             if (Simplifier::isNonNullParameter(actual))   StateInfo::setNonNull(slot);
             if (Simplifier::isExactType(actual))       StateInfo::setExactType(slot);
         } else {
-            type = methodSig->getParamType(i);
+            type = methodDesc.getParamType(i);
             if (!type) {
                 // linkage error will happen at the usage point of this parameter
                 // here we just keep it as NullObj
@@ -1152,7 +1155,7 @@
         slot.type = typeManager.getNullObjectType();
     }
     slot.vars = NULL;
-    jitrino_assert(compilationInterface, slot.type);
+    jitrino_assert( slot.type);
     pushType(slot);
 }
 
@@ -1168,7 +1171,7 @@
     case 9:  elemType = typeManager.getInt16Type();   break;
     case 10: elemType = typeManager.getInt32Type();   break;
     case 11: elemType = typeManager.getInt64Type();   break;
-    default: jitrino_assert(compilationInterface, 0);
+    default: jitrino_assert( 0);
     }
     StateInfo::SlotInfo slot;
     StateInfo::setNonNull(&slot);
@@ -1191,7 +1194,7 @@
         slot.type = typeManager.getNullObjectType();
     }
     slot.vars = NULL;
-    jitrino_assert(compilationInterface, slot.type);
+    jitrino_assert( slot.type);
     pushType(slot);
 }
 
@@ -1212,7 +1215,7 @@
         return;
     }
     popAndCheck(A);
-    jitrino_assert(compilationInterface, type);
+    jitrino_assert( type);
     pushType(type);
 }
 int JavaLabelPrepass::instanceof(const uint8* bcp, uint32 constPoolIndex, uint32 off)   {
@@ -1287,7 +1290,7 @@
     } else if (constantType->isSingle()) {
         pushType(singleType);
     } else {
-        jitrino_assert(compilationInterface, 0);
+        jitrino_assert( 0);
     }
 }
 void JavaLabelPrepass::ldc2(uint32 constPoolIndex)         {
@@ -1299,7 +1302,7 @@
     } else if (constantType->isDouble()) {
         pushType(doubleType);
     } else {
-        jitrino_assert(compilationInterface, 0);
+        jitrino_assert( 0);
     }
 }
 
@@ -1409,7 +1412,7 @@
     if ( !type ) {
         type = typeManager.getNullObjectType();
     }
-    jitrino_assert(compilationInterface, type);
+    jitrino_assert( type);
     pushType(type);
 }
 
@@ -1540,11 +1543,10 @@
 }
 
 void JavaLabelPrepass::invoke(MethodDesc* methodDesc) {
-    MethodSignatureDesc* methodSig = methodDesc->getMethodSig();
     // pop source operands
-    for (int i=methodSig->getNumParams()-1; i>=0; i--)
+    for (int i = methodDesc->getNumParams()-1; i>=0; i--)
         popType();
-    Type* type = methodSig->getReturnType();
+    Type* type = methodDesc->getReturnType();
     // push the return type
     if (type) {
         if ( type->tag != Type::Void ) {
@@ -1847,7 +1849,7 @@
 }
 
 const char*     JavaLabelPrepass::methodSignatureString(uint32 cpIndex) {
-    return compilationInterface.methodSignatureString(&methodDesc,cpIndex);
+    return compilationInterface.getSignatureString(&methodDesc,cpIndex);
 }
 
 void StateTable::copySlotInfo(StateInfo::SlotInfo& to, StateInfo::SlotInfo& from) {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/EMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/EMInterface.h?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/EMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/EMInterface.h Tue Apr  3 02:30:33 2007
@@ -1,29 +1,24 @@
 /*
-*  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.
-*/
-/* COPYRIGHT_NOTICE */
-
-/**
-* @author Mikhail Y. Fursov
-* @version $Revision$
-*/
+ *  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.
+ */
 
 #ifndef _EMINTERFACE_H_
 #define _EMINTERFACE_H_
 
+#include "open/em_profile_access.h"
 #include "VMInterface.h"
 
 namespace Jitrino {
@@ -40,102 +35,126 @@
     JITProfilingRole_USE = 2
 };
 
-//M1 implementation of profiling interfaces
-class MethodProfile;
-class MemoryManager;
-class EntryBackedgeMethodProfile;
-class EdgeMethodProfile;
-class ValueMethodProfile;
+class MethodProfile {
+public:
+    MethodProfile(Method_Profile_Handle _handle, ProfileType _type, MethodDesc& _md)
+        : handle(_handle), type(_type), md(_md){}
+        virtual ~MethodProfile(){};
+        Method_Profile_Handle getHandle() const { return handle;} 
+        MethodDesc& getMethod() const {return md;}
+        ProfileType getProfileType() const {return type;}
+private:
+    Method_Profile_Handle handle;
+    ProfileType type;
+    MethodDesc& md;
+};
+
+class EntryBackedgeMethodProfile : public MethodProfile {
+public:
+    EntryBackedgeMethodProfile(Method_Profile_Handle mph, MethodDesc& md, uint32* _entryCounter, uint32 *_backedgeCounter)
+        : MethodProfile(mph, ProfileType_EntryBackedge, md),  entryCounter(_entryCounter), backedgeCounter(_backedgeCounter){}
+
+        uint32 getEntryExecCount() const {return *entryCounter;}
+        uint32 getBackedgeExecCount() const {return *backedgeCounter;}
+        uint32* getEntryCounter() const {return entryCounter;}
+        uint32* getBackedgeCounter() const {return backedgeCounter;}
+
+private:
+    uint32* entryCounter;
+    uint32* backedgeCounter;
+};
+
+class EdgeMethodProfile : public MethodProfile {
+public:
+    EdgeMethodProfile (Method_Profile_Handle handle, MethodDesc& md,  EM_ProfileAccessInterface* _profileAccessInterface)
+        : MethodProfile(handle, ProfileType_Edge, md), profileAccessInterface(_profileAccessInterface){}
+
+        uint32  getNumCounters() const;
+        uint32  getCheckSum() const;
+        uint32* getEntryCounter() const;
+        uint32* getCounter(uint32 key) const;
+
+private:
+    EM_ProfileAccessInterface* profileAccessInterface;
+};
+
+class ValueMethodProfile: public MethodProfile {
+public:
+    ValueMethodProfile (Method_Profile_Handle handle, MethodDesc& md,  EM_ProfileAccessInterface* _profileAccessInterface)
+        : MethodProfile(handle, ProfileType_Value, md), profileAccessInterface(_profileAccessInterface){}
+
+        POINTER_SIZE_INT getTopValue(uint32 instructionKey) const;
+        void dumpValues(std::ostream& os) const;
+
+private:
+    EM_ProfileAccessInterface* profileAccessInterface;
+};
 
-typedef void PC_Callback_Fn(Method_Profile_Handle);
 
 class ProfilingInterface {
 public:
-    virtual ~ProfilingInterface(){};
 
-    virtual MethodProfile* getMethodProfile(MemoryManager& mm, ProfileType type, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const = 0;
+    PC_Handle getPCHandle(ProfileType type) const;
+    EM_ProfileAccessInterface* getEMProfileAccessInterface() const { return profileAccessInterface; }
+
+    MethodProfile* getMethodProfile(MemoryManager& mm, ProfileType type, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const;
     // Returns EM method profile handle. This method is needed when we need to update method profile
     // at run-time i.e. when there is no any memory managers available.
-    virtual Method_Profile_Handle getMethodProfileHandle(ProfileType type, MethodDesc& md) const = 0;
-    virtual EM_ProfileAccessInterface* getEMProfileAccessInterface() const = 0;
+    Method_Profile_Handle getMethodProfileHandle(ProfileType type, MethodDesc& md) const;
 
-    virtual bool hasMethodProfile(ProfileType type, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const = 0;
-    virtual bool enableProfiling(PC_Handle pc, JITProfilingRole role) = 0;
-    virtual bool isProfilingEnabled(ProfileType pcType, JITProfilingRole jitRole) const = 0;
+    bool hasMethodProfile(ProfileType type, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const;
+    bool enableProfiling(PC_Handle pc, JITProfilingRole role);
+    bool isProfilingEnabled(ProfileType pcType, JITProfilingRole jitRole) const;
 
 
-    virtual uint32 getProfileMethodCount(MethodDesc& md, JITProfilingRole role = JITProfilingRole_USE) const = 0;
+    uint32 getProfileMethodCount(MethodDesc& md, JITProfilingRole role = JITProfilingRole_USE) const;
 
-    virtual EntryBackedgeMethodProfile* createEBMethodProfile(MemoryManager& mm, MethodDesc& md) =0;
-    virtual bool isEBProfilerInSyncMode() const = 0;
-    virtual PC_Callback_Fn* getEBProfilerSyncModeCallback() const = 0;
+    EntryBackedgeMethodProfile* createEBMethodProfile(MemoryManager& mm, MethodDesc& md);
+    bool isEBProfilerInSyncMode() const;
 
+    typedef void PC_Callback_Fn(Method_Profile_Handle);
+    PC_Callback_Fn* getEBProfilerSyncModeCallback() const;
 
-    virtual EdgeMethodProfile* createEdgeMethodProfile(MemoryManager& mm, MethodDesc& md, uint32 numEdgeCounters, uint32* counterKeys, uint32 checkSum) =0;
 
+    EdgeMethodProfile* createEdgeMethodProfile(MemoryManager& mm, MethodDesc& md, uint32 numEdgeCounters, uint32* counterKeys, uint32 checkSum);
 
-    virtual uint32 getMethodEntryThreshold() const = 0;
-    virtual uint32 getBackedgeThreshold() const = 0;
 
-    virtual EntryBackedgeMethodProfile* getEBMethodProfile(MemoryManager& mm, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const {
+    uint32 getMethodEntryThreshold() const;
+    uint32 getBackedgeThreshold() const;
+
+    EntryBackedgeMethodProfile* getEBMethodProfile(MemoryManager& mm, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const {
         return (EntryBackedgeMethodProfile*)getMethodProfile(mm, ProfileType_EntryBackedge, md, role);
     }
 
-    virtual EdgeMethodProfile* getEdgeMethodProfile(MemoryManager& mm, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const {
+    EdgeMethodProfile* getEdgeMethodProfile(MemoryManager& mm, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const {
         return (EdgeMethodProfile*)getMethodProfile(mm, ProfileType_Edge, md, role);    
     }
     
     
     // value profiler
-    virtual ValueMethodProfile* createValueMethodProfile (MemoryManager& mm, MethodDesc& md, uint32 numKeys, uint32* Keys) = 0;
+    ValueMethodProfile* createValueMethodProfile (MemoryManager& mm, MethodDesc& md, uint32 numKeys, uint32* Keys);
     
-    virtual ValueMethodProfile* getValueMethodProfile(MemoryManager& mm, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const {
+    ValueMethodProfile* getValueMethodProfile(MemoryManager& mm, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const {
         return (ValueMethodProfile*)getMethodProfile(mm, ProfileType_Value, md, role);    
     }
-};
-
-class MethodProfile {
-public:
-    MethodProfile(Method_Profile_Handle _handle, ProfileType _type, MethodDesc& _md)
-        : handle(_handle), type(_type), md(_md){}
-        virtual ~MethodProfile(){};
-        Method_Profile_Handle getHandle() const { return handle;} 
-        MethodDesc& getMethod() const {return md;}
-        ProfileType getProfileType() const {return type;}
-private:
-    Method_Profile_Handle handle;
-    ProfileType type;
-    MethodDesc& md;
-};
-
-class EntryBackedgeMethodProfile : public MethodProfile {
-public:
-    EntryBackedgeMethodProfile (Method_Profile_Handle handle, MethodDesc& md): MethodProfile(handle, ProfileType_EntryBackedge, md){}
-
-    virtual uint32 getEntryExecCount() const = 0;
-    virtual uint32 getBackedgeExecCount() const = 0;
-    virtual uint32* getEntryCounter() const = 0;
-    virtual uint32* getBackedgeCounter() const = 0;
-};
-
-class EdgeMethodProfile : public MethodProfile {
-public:
-    EdgeMethodProfile (Method_Profile_Handle handle, MethodDesc& md): MethodProfile(handle, ProfileType_Edge, md){}
-
-    virtual uint32  getNumCounters() const = 0;
-    virtual uint32  getCheckSum() const = 0;
-    virtual uint32* getEntryCounter() const = 0;
-    virtual uint32* getCounter(uint32 key) const = 0;
-};
 
-class ValueMethodProfile: public MethodProfile {
-public:
-    ValueMethodProfile (Method_Profile_Handle handle, MethodDesc& md) : MethodProfile(handle, ProfileType_Value, md){}
+    ProfilingInterface(EM_Handle _em, JIT_Handle _jit, EM_ProfileAccessInterface* emProfileAccess)
+        : emHandle(_em), ebPCHandle(NULL), edgePCHandle(NULL), valuePCHandle(NULL), jitHandle(_jit), profileAccessInterface(emProfileAccess), 
+        jitRole(JITProfilingRole_USE), profilingEnabled(false){}
 
-    virtual POINTER_SIZE_INT getTopValue(uint32 instructionKey) const = 0;
-    virtual void dumpValues(std::ostream& os) const = 0;
+private:
+    EM_Handle emHandle;
+    // Various types of the profile collectors
+    PC_Handle ebPCHandle, edgePCHandle, valuePCHandle;
+    // ProfileType pcType;
+    JIT_Handle jitHandle;
+    EM_ProfileAccessInterface* profileAccessInterface;
+    // Only one role supported at one time
+    JITProfilingRole jitRole;
+    // There is only one flag so edge and value profile may work only simultaneously
+    // TODO: Better solution is needed when we want to have independent profiles
+    bool profilingEnabled;
 };
-
 
 };//namespace
 

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?view=diff&rev=525110&r1=525109&r2=525110
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp Tue Apr  3 02:30:33 2007
@@ -15,21 +15,11 @@
  *  limitations under the License.
  */
 
-/**
- * @author Intel, Mikhail Y. Fursov
- * @version $Revision: 1.15.12.2.4.4 $
- *
- */
-
 #include <assert.h>
 #include "VMInterface.h"
+#include "PlatformDependant.h"
 
 namespace Jitrino {
-
-//
-//  This file contains definitions of the interface properties that 
-//  do not depend on the interface implementation.
-//
 
 /*
 The following struct and array contains a mapping between RuntimeHelperId 



Mime
View raw message