harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r632286 - in /harmony/enhanced/drlvm/trunk/vm: jitrino/src/codegenerator/ia32/ jitrino/src/codegenerator/ipf/ jitrino/src/main/ jitrino/src/optimizer/ jitrino/src/shared/ jitrino/src/translator/java/ jitrino/src/vm/ thread/src/
Date Fri, 29 Feb 2008 10:33:04 GMT
Author: varlax
Date: Fri Feb 29 02:32:59 2008
New Revision: 632286

URL: http://svn.apache.org/viewvc?rev=632286&view=rev
Log:
Get rid of direct calls from Jitrino to VM bypassing internal VMInterface

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstrumentator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/PMF.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/JITInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
    harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.def

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp Fri Feb 29
02:32:59 2008
@@ -108,7 +108,7 @@
         return false;
     }
     field = (FieldDesc*)info->getValue(0);
-    return field_is_magic(field->getFieldHandle());
+    return field->isMagic();
 }
 
 static void checkManaged2UnmanagedConv(IRManager& irm, Opnd* opnd) {
@@ -519,13 +519,6 @@
                                    const JitFrameContext* context, bool isFirst)
 {  
     AutoTimer tm(enumerateTimer);
-
-/*    Class_Handle parentClassHandle = method_get_class(((DrlVMMethodDesc*)methodDesc)->getDrlVMMethod());
-    const char* methodName = methodDesc->getName();
-    const char* className = class_get_name(parentClassHandle);
-    const char* methodSignature = methodDesc->getSignatureString();
-    printf("enumerate: %s::%s %s ip=%d\n", className, methodName, methodSignature, *context->p_eip);
-*/
 
     // Compute stack information
     uint32 stackInfoSize = (uint32)StackInfo::getByteSize(methodDesc);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp Fri Feb 29
02:32:59 2008
@@ -25,7 +25,7 @@
 
 
 #include "Ia32Tls.h"
-#include <open/hythread_ext.h>
+#include "VMInterface.h"
 
 namespace Jitrino {
 namespace Ia32 {
@@ -78,7 +78,7 @@
 
 Opnd* createTlsBaseLoadWin(IRManager& irManager, Node* ctrlNode, Type* tlsBaseType)
 {
-    if (!hythread_uses_fast_tls()) {
+    if (!VMInterface::useFastTLSAccess()) {
         return createTlsBaseLoadGeneric(irManager, ctrlNode, tlsBaseType);
     }
     // HYTHR's structure is stored in TIB's free offset aka [fs:0x14]
@@ -90,7 +90,7 @@
 
 Opnd* createTlsBaseLoadLin(IRManager& irManager, Node* ctrlNode, Type* tlsBaseType)
 {
-    if (!hythread_uses_fast_tls()) {
+    if (!VMInterface::useFastTLSAccess()) {
         return createTlsBaseLoadGeneric(irManager, ctrlNode, tlsBaseType);
     }
 
@@ -102,7 +102,7 @@
         tlsBase = hythread_t
     */
 
-    int threadOffset = hythread_get_hythread_offset_in_tls();
+    int threadOffset = VMInterface::getTLSBaseOffset();
     Opnd* pTib;
 #if defined(_EM64T_)
     pTib = irManager.newMemOpnd(tlsBaseType, MemOpndKind_Any, NULL, 0, RegName_FS);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstrumentator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstrumentator.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstrumentator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstrumentator.cpp Fri
Feb 29 02:32:59 2008
@@ -23,7 +23,7 @@
 
 #include "IpfInstrumentator.h"
 #include "IpfIrPrinter.h"
-#include "open/vm.h"
+#include "VMInterface.h"
 #include <fstream>
 
 namespace Jitrino {
@@ -141,29 +141,20 @@
 //----------------------------------------------------------------------------------------//
 
 void Instrumentator::methodStart(Method_Handle methodHandle) {
-
     ofstream rtLog;
     rtLog.open("rt.log", ios::out | ios::app);
 
-    rtLog << "Start ";
-    rtLog << class_get_name(method_get_class(methodHandle));
-    rtLog << "." << method_get_name(methodHandle);
-    rtLog << method_get_descriptor(methodHandle) << endl;
+    rtLog << "Start " << methodHandle << endl;
     rtLog.close();
 }
 
 //----------------------------------------------------------------------------------------//
 
 void Instrumentator::methodEnd(Method_Handle methodHandle) {
-
     ofstream rtLog;
     rtLog.open("rt.log", ios::out | ios::app);
     
-    rtLog << "End   ";
-    rtLog << class_get_name(method_get_class(methodHandle));
-    rtLog << "." << method_get_name(methodHandle);
-    rtLog << method_get_descriptor(methodHandle) << endl;
-    rtLog.close();
+    rtLog << "End   " << methodHandle << endl;
 }
 
 } // IPF

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/PMF.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/PMF.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/PMF.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/main/PMF.cpp Fri Feb 29 02:32:59 2008
@@ -19,7 +19,7 @@
  * @version $Revision$
  */
 
-
+#include "VMInterface.h"
 #include "PMF.h"
 #include "PMFAction.h"
 #include "FixFileName.h"
@@ -1357,18 +1357,11 @@
 
 void PMF::processVMProperties ()
 {
-    char** keys = get_properties_keys(VM_PROPERTIES);
-    int i = 0;
-    while (keys[i] != NULL) {
-        if (strncmp("jit.", keys[i], 4) == 0)
-        {
-            char* value = get_property(keys[i], VM_PROPERTIES);
-            processCmd(keys[i] + 4, value);
-            destroy_property_value(value);
-        }
-        i++;
+    VMPropertyIterator it(mm, "jit.");
+    while(!it.isOver()) {
+        it.next();
+        processCmd(it.getKey() + 4, it.getValue());
     }
-    destroy_properties_keys(keys);
 }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/helper_inliner.cpp Fri Feb 29 02:32:59
2008
@@ -79,7 +79,7 @@
     assert(flags.opcodeToHelperMapping.find(opcode)==flags.opcodeToHelperMapping.end());

     flags.opcodeToHelperMapping[opcode] = helperId; 
     if (flags.helperConfigs.find(helperId)== flags.helperConfigs.end()) {
-        std::string helperName = vm_helper_get_name(helperId);
+        std::string helperName = CompilationInterface::getRuntimeHelperName(helperId);
         HelperConfig* h = new (globalMM) HelperConfig(helperId);
         h->doInlining = getBoolArg(helperName.c_str(), false);
         h->hotnessPercentToInline = getIntArg((helperName + "_hotnessPercent").c_str(),
0);
@@ -319,17 +319,18 @@
 
 MethodDesc* HelperInliner::findHelperMethod(CompilationInterface* ci, VM_RT_SUPPORT helperId)

 {
-    Method_Handle mh = vm_helper_get_magic_helper(helperId);
-    if (mh == NULL) {
-        if (Log::isEnabled()) Log::out()<<"WARN: helper's method is not resolved:"<<vm_helper_get_name(helperId)<<std::endl;
+    MethodDesc* md = ci->getMagicHelper(helperId);
+    if (md == NULL) {
+        if (Log::isEnabled()) Log::out()<<"WARN: helper's method is not resolved:"<<CompilationInterface::getRuntimeHelperName(helperId)<<std::endl;
         return NULL;
     }
-    Class_Handle ch = method_get_class(mh);
-    if (!class_is_initialized(ch)) {
-        if (Log::isEnabled()) Log::out()<<"WARN: class is not initialized:"<<class_get_name(ch)<<std::endl;
+    
+    Class_Handle ch = md->getParentHandle();
+    if (!VMInterface::isInitialized(ch)) {
+        if (Log::isEnabled()) Log::out()<<"WARN: class is not initialized:"<<VMInterface::getTypeName(ch)<<std::endl;
         return NULL;
     }
-    MethodDesc* md = ci->getMethodDesc(mh);
+    
     return md;
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp Fri Feb 29 02:32:59
2008
@@ -4487,14 +4487,14 @@
         case ClassIsArray:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
-                res = genLdConstant((int32)class_is_array(ch));
+                res = genLdConstant((int32)VMInterface::isArrayType(ch));
             }
             break;
         case ClassGetAllocationHandle:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
                 ConstInst::ConstValue v;
-                v.i8 = (POINTER_SIZE_SINT)class_get_allocation_handle(ch);
+                v.i8 = (POINTER_SIZE_SINT)VMInterface::getAllocationHandle(ch);
                 res = genLdConstant(tm.getInt32Type(), v);
                 assert((sizeof(void*) == 4) && "TODO fix allocation helper on 64
bit");
             }
@@ -4502,47 +4502,47 @@
         case ClassGetTypeSize:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
-                res = genLdConstant((int32)class_get_boxed_data_size(ch));
+                res = genLdConstant((int32)VMInterface::getObjectSize(ch));
             }
             break;
         case ClassGetArrayElemSize:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
-                res = genLdConstant((int32)class_get_array_element_size(ch));
+                res = genLdConstant((int32)VMInterface::getArrayElemSize(ch));
             }
             break;
         case ClassIsInterface:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
-                res = genLdConstant((int32)class_property_is_interface2(ch));
+                res = genLdConstant((int32)VMInterface::isInterfaceType(ch));
             }
             break;
         case ClassIsFinal:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
-                res = genLdConstant((int32)class_property_is_final(ch));
+                res = genLdConstant((int32)VMInterface::isFinalType(ch));
             }
             break;
         case ClassGetArrayClass:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
                 ConstInst::ConstValue v;
-                v.i8 = (POINTER_SIZE_SINT)class_get_array_of_class(ch);
+                v.i8 = (POINTER_SIZE_SINT)VMInterface::getArrayVMTypeHandle(ch, false);
                 res = genLdConstant(tm.getUnmanagedPtrType(tm.getInt8Type()), v);
             }
             break;
         case ClassIsFinalizable:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
-                res = genLdConstant((int32)class_is_finalizable(ch));
+                res = genLdConstant((int32)VMInterface::isFinalizable(ch));
             }
             break;
         case ClassGetFastCheckDepth:
             ch = getClassHandle(inst->getSrc(0));
             if (ch) {
                 int depth = 0;
-                if (class_get_fast_instanceof_flag(ch)) {
-                    depth = (int32)class_get_depth(ch);
+                if (VMInterface::getClassFastInstanceOfFlag(ch)) {
+                    depth = (int32)VMInterface::getClassDepth(ch);
                 }
                 res = genLdConstant(depth);
             }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp Fri Feb 29 02:32:59
2008
@@ -247,6 +247,14 @@
     return (void*)mem;
 }
 
+char* 
+MemoryManager::copy(const char* str) {
+    if (!str) return NULL;
+    size_t len = strlen(str);
+    char* cp = (char*)alloc(len + 1);
+    return strcpy(cp, str);
+}
+
 } //namespace Jitrino 
 
 #ifdef DEBUG_MEMORY_MANAGER

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.h?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.h Fri Feb 29 02:32:59
2008
@@ -38,6 +38,7 @@
     virtual ~MemoryManager();
     void *alloc(size_t size);
     size_t bytes_allocated() { return _bytes_allocated; }
+    char* copy(const char* str);
 protected:
     MemoryManager(const MemoryManager&) {assert(0);}
     MemoryManager& operator=(const MemoryManager&) {assert(0); return *this;}

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?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- 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 29 02:32:59 2008
@@ -757,11 +757,12 @@
             pushOpnd(irBuilder.genLdStatic(fieldType, field));
         }
     } else {
+        //field is not resolved or not static
         if (!typeManager.isLazyResolutionMode()) {
             // generate helper call for throwing respective exception
             linkingException(constPoolIndex, OPCODE_GETSTATIC);
         }
-        const char* fieldTypeName = const_pool_get_field_descriptor(methodToCompile.getParentHandle(),
constPoolIndex);
+        const char* fieldTypeName = CompilationInterface::getFieldSignature(methodToCompile.getParentHandle(),
constPoolIndex);
         bool fieldIsMagic = VMMagicUtils::isVMMagicClass(fieldTypeName);
         Type* fieldType = fieldIsMagic ? convertVMMagicType2HIR(typeManager, fieldTypeName)

                                        : compilationInterface.getFieldType(methodToCompile.getParentHandle(),
constPoolIndex);
@@ -782,11 +783,12 @@
         }
         irBuilder.genStStatic(fieldType,field,popOpnd());
     } else {
+        //field is not resolved or not static
         if (!typeManager.isLazyResolutionMode()) {
             // generate helper call for throwing respective exception
             linkingException(constPoolIndex, OPCODE_PUTSTATIC);
         }
-        const char* fieldTypeName = const_pool_get_field_descriptor(methodToCompile.getParentHandle(),
constPoolIndex);
+        const char* fieldTypeName = CompilationInterface::getFieldSignature(methodToCompile.getParentHandle(),
constPoolIndex);
         bool fieldIsMagic = VMMagicUtils::isVMMagicClass(fieldTypeName);
         Type* fieldType = fieldIsMagic ? convertVMMagicType2HIR(typeManager, fieldTypeName)

                                        : compilationInterface.getFieldType(methodToCompile.getParentHandle(),
constPoolIndex);
@@ -1493,8 +1495,8 @@
     
 
     if (bc != OPCODE_INVOKEINTERFACE) {
-        const char* kname = const_pool_get_method_class_name(methodToCompile.getParentHandle(),
cpIndex);
-        const char* mname = const_pool_get_method_name(methodToCompile.getParentHandle(),
cpIndex);
+        const char* kname = CompilationInterface::getMethodClassName(methodToCompile.getParentHandle(),
cpIndex);
+        const char* mname = CompilationInterface::getMethodName(methodToCompile.getParentHandle(),
cpIndex);
         if (VMMagicUtils::isVMMagicClass(kname)) {
             assert(bc == OPCODE_INVOKESTATIC || bc == OPCODE_INVOKEVIRTUAL);
             UNUSED bool res = genVMMagic(mname, numArgs, args, returnType);    

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/JITInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/JITInterface.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/JITInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/JITInterface.cpp Fri Feb 29 02:32:59 2008
@@ -78,8 +78,7 @@
 JITEXPORT void
 JIT_init(JIT_Handle jit, const char* name)
 {
-    std::string initMessage = std::string("Initializing Jitrino.") + name +
-                              " -> ";
+    std::string initMessage = std::string("Initializing Jitrino.") + name + " -> ";
     std::string mode = "OPT";
 #ifdef USE_FAST_PATH
     if (JITInstanceContext::isNameReservedForJet(name)) mode = "JET";
@@ -88,19 +87,6 @@
     INFO(initMessage.c_str());
     Jitrino::Init(jit, name);
 
-#if defined (PLATFORM_NT) && defined (_DEBUG)
-    if (!get_boolean_property("vm.assert_dialog", TRUE, VM_PROPERTIES))
-    {
-        _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
-        _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
-        _CrtSetReportMode(_CRT_ERROR,  _CRTDBG_MODE_FILE);
-        _CrtSetReportFile(_CRT_ERROR,  _CRTDBG_FILE_STDOUT);
-        _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
-        _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
-        _set_error_mode(_OUT_TO_STDERR);
-    }
-#endif
-
 #ifdef USE_FAST_PATH
     Jet::setup(jit, name);
 #endif
@@ -211,8 +197,7 @@
                                OpenMethodExecutionParams compilation_params)
 {
     MemoryManager memManager("JIT_compile_method.memManager");
-    JIT_Handle jitHandle = method_get_JIT_id(compilation);
-    JITInstanceContext* jitContext = Jitrino::getJITInstanceContext(jitHandle);
+    JITInstanceContext* jitContext = Jitrino::getJITInstanceContext(jit);
     assert(jitContext!= NULL);
 
     TypeManager typeManager(memManager); typeManager.init();
@@ -241,7 +226,7 @@
              << jitContext->getJITName() << "." << pipename
              << "\tstart "
              << methodTypeName << "." << methodName << methodSig
-             << "\tbyte code size=" <<  method_get_byte_code_size(method_handle)
+             << "\tbyte code size=" <<  md->getByteCodeSize()
              << std::endl;
     }
 #ifdef _DEBUG
@@ -252,7 +237,7 @@
  
 #ifdef USE_FAST_PATH
     if (isJET(jit))
-        result = Jet::compile_with_params(jitHandle, compilation, method_handle,
+        result = Jet::compile_with_params(jit, compilation, method_handle,
                                         compilation_params);
     else 
 #endif  // USE_FAST_PATH
@@ -270,8 +255,8 @@
              //<< methodTypeName << "." << methodName << methodSig;
 
         if (result == JIT_SUCCESS) {
-            unsigned size = method_get_code_block_size_jit(method_handle, jit);
-            Byte *  start = size ? method_get_code_block_addr_jit(method_handle, jit) : 0;
+            unsigned size = md->getCodeBlockSize(0);
+            Byte *  start = size ? md->getCodeBlockAddress(0) : 0;
             info << "\tnative code size=" << size
                  << " code range=[" << (void*)start << "," << (void*)(start+size)
<< "]";
         }
@@ -323,9 +308,7 @@
 {
 #ifdef _DEBUG
     if(Log::cat_rt()->isEnabled())
-        Log::cat_rt()->out() << "UNWIND_STACK_FRAME(" <<
-        class_get_name(method_get_class(method)) << "." <<
-        method_get_name(method) << ")" << ::std::endl;
+        Log::cat_rt()->out() << "UNWIND_STACK_FRAME(" << method << ")"
<< ::std::endl;
 #endif
 
 #ifdef USE_FAST_PATH
@@ -346,9 +329,7 @@
 {
 #ifdef _DEBUG
     if(Log::cat_rt()->isEnabled())
-        Log::cat_rt()->out() << "GET_ROOT_SET_FROM_STACK_FRAME(" <<
-        class_get_name(method_get_class(method)) << "." <<
-        method_get_name(method) << ")" << ::std::endl;
+        Log::cat_rt()->out() << "GET_ROOT_SET_FROM_STACK_FRAME(" << method
<< ")" << ::std::endl;
 #endif
 
 #ifdef USE_FAST_PATH
@@ -410,9 +391,7 @@
 {
 #ifdef _DEBUG
     if(Log::cat_rt()->isEnabled())
-        Log::cat_rt()->out() << "FIX_HANDLER_CONTEXT(" <<
-        class_get_name(method_get_class(method)) << "."
-        << method_get_name(method) << ")" << ::std::endl;
+        Log::cat_rt()->out() << "FIX_HANDLER_CONTEXT(" << method <<
")" << ::std::endl;
 #endif
 
 #ifdef USE_FAST_PATH
@@ -462,16 +441,11 @@
 JITEXPORT Boolean
 JIT_supports_compressed_references(JIT_Handle jit)
 {
-#ifdef USE_FAST_PATH
-    if (isJET(jit)) {
 #ifdef _EM64T_
         return true;
 #else
         return false;
 #endif
-    }
-#endif
-    return (vm_references_are_compressed() != 0);
 }
 
 extern "C"
@@ -481,9 +455,7 @@
                                  ::JitFrameContext *context)
 {
     if(Log::cat_rt()->isEnabled()) {
-        Log::cat_rt()->out() << "GET_ROOT_SET_FROM_STACK_FRAME(" << 
-        class_get_name(method_get_class(method)) << "." << 
-        method_get_name(method) << ")" << ::std::endl;
+        Log::cat_rt()->out() << "GET_ROOT_SET_FROM_STACK_FRAME(" << method
<< ")" << ::std::endl;
     }
     MethodDesc methodDesc(method, jit);
     ThreadDumpEnumerator gcInterface;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.cpp Fri Feb 29 02:32:59 2008
@@ -86,6 +86,16 @@
     return (uint32)offset;
 }
 
+int32
+VMInterface::getTLSBaseOffset() {
+    return (int32) hythread_get_hythread_offset_in_tls();
+}
+
+bool
+VMInterface::useFastTLSAccess() {
+    return 0 != hythread_uses_fast_tls();
+}
+
 //////////////////////////////////////////////////////////////////////////////
 ///////////////////////// VMTypeManager /////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
@@ -215,6 +225,11 @@
 }    
 
 uint32
+VMInterface::getArrayElemSize(void * vmTypeHandle) {
+    return class_get_array_element_size((Class_Handle) vmTypeHandle);
+}
+
+uint32
 VMInterface::getObjectSize(void * vmTypeHandle) {
     return class_get_boxed_data_size((Class_Handle) vmTypeHandle);
 }
@@ -492,6 +507,12 @@
     return type;
 }
 
+MethodDesc*
+CompilationInterface::getMagicHelper(VM_RT_SUPPORT id){
+    Method_Handle mh = vm_helper_get_magic_helper(id);
+    return mh ? getMethodDesc(mh) : NULL;
+}
+
 const char*
 CompilationInterface::getRuntimeHelperName(VM_RT_SUPPORT id){
     return vm_helper_get_name(id);
@@ -916,5 +937,49 @@
     return NULL;
 }
 
+const char* 
+CompilationInterface::getMethodName(Class_Handle enclClass, uint32 cpIndex) {
+    return const_pool_get_method_name(enclClass, cpIndex);
+}
+
+const char* 
+CompilationInterface::getMethodClassName(Class_Handle enclClass, uint32 cpIndex) {
+    return const_pool_get_method_class_name(enclClass, cpIndex);
+}
+
+const char* 
+CompilationInterface::getFieldSignature(Class_Handle enclClass, uint32 cpIndex) {
+    return const_pool_get_field_descriptor(enclClass, cpIndex);
+}
+
+::std::ostream& operator<<(::std::ostream& os, Method_Handle method) { 
+    os << class_get_name(method_get_class(method)) << "." 
+        << method_get_name(method) << method_get_descriptor(method);
+    return os;
+}
+
+VMPropertyIterator::VMPropertyIterator(
+    MemoryManager& mm, const char* prefix): mm(mm), key(NULL), value(NULL), iterator(0)
+{
+    keys = get_properties_keys_staring_with(prefix, VM_PROPERTIES);
+}
+
+VMPropertyIterator::~VMPropertyIterator() {
+    destroy_properties_keys(keys);
+}
+
+bool 
+VMPropertyIterator::isOver() const {
+    return keys[iterator] ? false : true;
+}
+
+void 
+VMPropertyIterator::next() {
+    assert(!isOver());
+    key = mm.copy(keys[iterator]);
+    char* nval = get_property(keys[iterator++], VM_PROPERTIES);
+    value = mm.copy(nval);
+    destroy_property_value(nval);
+}
 
 } //namespace Jitrino

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/VMInterface.h Fri Feb 29 02:32:59 2008
@@ -70,6 +70,7 @@
     static void*       getAllocationHandle(void* vmTypeHandle);
     static bool        isSubClassOf(void* vmTypeHandle1,void* vmTypeHandle2);
     static uint32      getArrayElemOffset(void* vmElemTypeHandle,bool isUnboxed);
+    static uint32      getArrayElemSize(void * vmTypeHandle);
     static uint32      getObjectSize(void * vmTypeHandle);
     static uint32      getArrayLengthOffset();
 
@@ -78,6 +79,8 @@
 
     static uint32      flagTLSSuspendRequestOffset();
     static uint32      flagTLSThreadStateOffset();
+    static int32       getTLSBaseOffset();
+    static bool        useFastTLSAccess();
 
 
     // returns true if vtable pointers are compressed
@@ -156,6 +159,7 @@
         bool          isInitOnly() const     {return field_is_final(drlField)?true:false;}
   
         // accesses to field cannot be reordered or CSEed
         bool          isVolatile() const    {return field_is_volatile(drlField)?true:false;}
+        bool          isMagic() const    {return field_is_magic(drlField)?true:false;}
         Type*         getFieldType();
         uint32        getOffset() const; // for non-static fields
         void*         getAddress() const    {return field_get_address(drlField);} // for
static fields
@@ -308,7 +312,7 @@
     bool        mayBeInterruptible(VM_RT_SUPPORT id);
     void*       getRuntimeHelperAddress(VM_RT_SUPPORT);
     void*       getRuntimeHelperAddressForType(VM_RT_SUPPORT, Type*);
-
+    MethodDesc* getMagicHelper(VM_RT_SUPPORT);
 
     Type*      getFieldType(Class_Handle enclClass, uint32 cpIndex);
 
@@ -319,6 +323,9 @@
     NamedType* resolveNamedType(Class_Handle enclClass, uint32 cpIndex);
 
 
+    static const char* getMethodName(Class_Handle enclClass, uint32 cpIndex);
+    static const char* getMethodClassName(Class_Handle enclClass, uint32 cpIndex);
+    static const char* getFieldSignature(Class_Handle enclClass, uint32 cpIndex);
 
     MethodDesc* getStaticMethod(Class_Handle enclClass, uint32 cpIndex);
     MethodDesc* getVirtualMethod(Class_Handle enclClass, uint32 cpIndex);
@@ -537,6 +544,24 @@
         << (unsigned int) pid.getLocalInstructionId(); 
     return os;
 }
+
+::std::ostream& operator<<(::std::ostream& os, Method_Handle mh);
+
+class VMPropertyIterator {
+public:
+    VMPropertyIterator(MemoryManager& m, const char* prefix);
+    ~VMPropertyIterator();
+    bool isOver() const;
+    void next();
+    char* getKey() const { return key; }
+    char* getValue() const { return value; }
+private:
+    MemoryManager& mm;
+    char* key;
+    char* value;
+    char** keys;
+    size_t iterator;
+};
 
 } //namespace Jitrino 
 

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.def
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.def?rev=632286&r1=632285&r2=632286&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.def (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.def Fri Feb 29 02:32:59 2008
@@ -43,6 +43,7 @@
 hythread_tls_get
 hythread_tls_get_request_offset
 hythread_tls_get_offset
+hythread_get_hythread_offset_in_tls
 hythread_get_struct_size
 hythread_global_lock
 hythread_global_unlock



Mime
View raw message