harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r584049 [2/2] - in /harmony/enhanced/drlvm/trunk: build/custom/msvc_2003/jitrino/ build/custom/msvc_2003/vmcore/ vm/include/ vm/jitrino/src/codegenerator/ vm/jitrino/src/codegenerator/ia32/ vm/jitrino/src/codegenerator/ipf/ vm/jitrino/src/c...
Date Fri, 12 Oct 2007 05:27:35 GMT
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?rev=584049&r1=584048&r2=584049&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp Thu Oct 11 22:27:33
2007
@@ -492,119 +492,43 @@
     return type;
 }
 
-VM_RT_SUPPORT CompilationInterface::translateHelperId(RuntimeHelperId runtimeHelperId) {
-    VM_RT_SUPPORT vmHelperId = (VM_RT_SUPPORT)-1;
-    switch (runtimeHelperId) {
-    case Helper_NewObj_UsingVtable:    vmHelperId = VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE;
break; 
-    case Helper_NewVector_UsingVtable: vmHelperId = VM_RT_NEW_VECTOR_USING_VTABLE; break;
-    case Helper_NewMultiArray:         vmHelperId = VM_RT_MULTIANEWARRAY_RESOLVED; break;
-    case Helper_LdInterface:           vmHelperId = VM_RT_GET_INTERFACE_VTABLE_VER0; break;
-    case Helper_LdRef:                 vmHelperId = VM_RT_LDC_STRING; break;
-    case Helper_ObjMonitorEnter:       vmHelperId = VM_RT_MONITOR_ENTER_NON_NULL; break;
-    case Helper_ObjMonitorExit:        vmHelperId = VM_RT_MONITOR_EXIT_NON_NULL; break;
-    case Helper_TypeMonitorEnter:      vmHelperId = VM_RT_MONITOR_ENTER_STATIC; break;
-    case Helper_TypeMonitorExit:       vmHelperId = VM_RT_MONITOR_EXIT_STATIC; break;
-    case Helper_Cast:                  vmHelperId = VM_RT_CHECKCAST; break;
-    case Helper_IsInstanceOf:          vmHelperId = VM_RT_INSTANCEOF; break;
-    case Helper_InitType:              vmHelperId = VM_RT_INITIALIZE_CLASS; break;
-    case Helper_IsValidElemType:       vmHelperId = VM_RT_AASTORE_TEST; break;
-    case Helper_Throw_KeepStackTrace:  vmHelperId = VM_RT_THROW; break;
-    case Helper_Throw_SetStackTrace:   vmHelperId = VM_RT_THROW_SET_STACK_TRACE; break;
-    case Helper_Throw_Lazy:            vmHelperId = VM_RT_THROW_LAZY; break;
-    case Helper_NullPtrException:      vmHelperId = VM_RT_NULL_PTR_EXCEPTION; break;
-    case Helper_ArrayBoundsException:  vmHelperId = VM_RT_IDX_OUT_OF_BOUNDS; break;
-    case Helper_ElemTypeException:     vmHelperId = VM_RT_ARRAY_STORE_EXCEPTION; break;
-    case Helper_DivideByZeroException: vmHelperId = VM_RT_DIVIDE_BY_ZERO_EXCEPTION; break;
-    case Helper_Throw_LinkingException: vmHelperId = VM_RT_THROW_LINKING_EXCEPTION; break;
-    case Helper_EnableThreadSuspension: vmHelperId = VM_RT_GC_SAFE_POINT; break;
-    case Helper_GetTLSBase:            vmHelperId = VM_RT_GC_GET_TLS_BASE; break;
-    case Helper_CharArrayCopy:         vmHelperId = VM_RT_CHAR_ARRAYCOPY_NO_EXC; break;
-    case Helper_DivI32:                vmHelperId = VM_RT_IDIV; break;
-    case Helper_DivU32:                assert(0); break;
-    case Helper_DivI64:                vmHelperId = VM_RT_LDIV; break;
-    case Helper_DivU64:                vmHelperId = VM_RT_ULDIV; break;
-    case Helper_DivSingle:             vmHelperId = VM_RT_FDIV; break;
-    case Helper_DivDouble:             vmHelperId = VM_RT_DDIV; break;
-    case Helper_RemI32:                vmHelperId = VM_RT_IREM; break;
-    case Helper_RemU32:                assert(0); break;
-    case Helper_RemI64:                vmHelperId = VM_RT_LREM; break;
-    case Helper_RemU64:                assert(0); break;
-    case Helper_RemSingle:             vmHelperId = VM_RT_FREM; break;
-    case Helper_RemDouble:             vmHelperId = VM_RT_DREM; break;
-    case Helper_MulI64:                vmHelperId = VM_RT_LMUL; break;
-    case Helper_ShlI64:                vmHelperId = VM_RT_LSHL; break;
-    case Helper_ShrI64:                vmHelperId = VM_RT_LSHR; break;
-    case Helper_ShruI64:               vmHelperId = VM_RT_LUSHR; break;
-    case Helper_ConvStoI32:            vmHelperId = VM_RT_F2I; break;
-    case Helper_ConvStoI64:            vmHelperId = VM_RT_F2L; break;
-    case Helper_ConvDtoI32:            vmHelperId = VM_RT_D2I; break;
-    case Helper_ConvDtoI64:            vmHelperId = VM_RT_D2L; break;
-    case Helper_MethodEntry:           vmHelperId = VM_RT_JVMTI_METHOD_ENTER_CALLBACK; break;
-    case Helper_MethodExit:            vmHelperId = VM_RT_JVMTI_METHOD_EXIT_CALLBACK; break;
-    case Helper_WriteBarrier:          vmHelperId = VM_RT_GC_HEAP_WRITE_REF; break;
-    case Helper_NewObjWithResolve:                  vmHelperId=VM_RT_NEWOBJ_WITHRESOLVE;
break;
-    case Helper_NewArrayWithResolve:                vmHelperId=VM_RT_NEWARRAY_WITHRESOLVE;
break;
-    case Helper_GetNonStaticFieldOffsetWithResolve: vmHelperId=VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE;
break;
-    case Helper_GetStaticFieldAddrWithResolve:      vmHelperId=VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE;
break;
-    case Helper_CheckCastWithResolve:               vmHelperId=VM_RT_CHECKCAST_WITHRESOLVE;
break;
-    case Helper_InstanceOfWithResolve:              vmHelperId=VM_RT_INSTANCEOF_WITHRESOLVE;
break;
-    case Helper_GetInvokeStaticAddrWithResolve:     vmHelperId=VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE;
break;
-    case Helper_GetInvokeInterfaceAddrWithResolve:  vmHelperId=VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE;
break;
-    case Helper_GetInvokeVirtualAddrWithResolve:    vmHelperId=VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE;
break;
-    case Helper_GetInvokeSpecialAddrWithResolve:    vmHelperId=VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE;
break;
-    case Helper_InitializeClassWithResolve:         vmHelperId=VM_RT_INITIALIZE_CLASS_WITHRESOLVE;
break;
-
-
-    default:
-        assert(0);
-    }
-    return vmHelperId;
+const char*
+CompilationInterface::getRuntimeHelperName(VM_RT_SUPPORT id){
+    return vm_helper_get_name(id);
+}
+
+VM_RT_SUPPORT CompilationInterface::str2rid( const char * helperName ) {
+    return vm_helper_get_by_name(helperName);
 }
 
 void*        
-CompilationInterface::getRuntimeHelperAddress(RuntimeHelperId runtimeHelperId) {
-    VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId);
-    return vm_get_rt_support_addr(drlHelperId);
+CompilationInterface::getRuntimeHelperAddress(VM_RT_SUPPORT id) {
+    return vm_get_rt_support_addr(id);
 }
 
 void*        
-CompilationInterface::getRuntimeHelperAddressForType(RuntimeHelperId runtimeHelperId, Type*
type) {
-    VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId);
+CompilationInterface::getRuntimeHelperAddressForType(VM_RT_SUPPORT id, Type* type) {
     Class_Handle handle = NULL;
     if (type != NULL && type->isNamedType())
         handle = (Class_Handle) ((NamedType *)type)->getVMTypeHandle();
-    void* addr = vm_get_rt_support_addr_optimized(drlHelperId, handle);
+    void* addr = vm_get_rt_support_addr_optimized(id, handle);
     assert(addr != NULL);
     return addr;
 }
 
-CompilationInterface::VmCallingConvention 
-CompilationInterface::getRuntimeHelperCallingConvention(RuntimeHelperId id) {
-    switch(id) {
-    case Helper_NewMultiArray:
-    case Helper_WriteBarrier:
-        return CallingConvention_Cdecl;
-    case Helper_ShlI64:                
-    case Helper_ShrI64:                
-    case Helper_ShruI64:
-    case Helper_Throw_Lazy:
-    case Helper_Throw_LinkingException:
-        return CallingConvention_Drl;
-    default:
-        return CallingConvention_Stdcall;
-    }
+HELPER_CALLING_CONVENTION 
+CompilationInterface::getRuntimeHelperCallingConvention(VM_RT_SUPPORT id) {
+    return vm_helper_get_calling_convention(id);
 }
 
 bool
-CompilationInterface::isInterruptible(RuntimeHelperId runtimeHelperId)  {
-    VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId);
-    return INTERRUPTIBLE_ALWAYS == vm_helper_get_interruptibility_kind(drlHelperId);
+CompilationInterface::isInterruptible(VM_RT_SUPPORT id)  {
+    return INTERRUPTIBLE_ALWAYS == vm_helper_get_interruptibility_kind(id);
 }
 
 bool
-CompilationInterface::mayBeInterruptible(RuntimeHelperId runtimeHelperId)  {
-    VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId);
-    return INTERRUPTIBLE_NEVER != vm_helper_get_interruptibility_kind(drlHelperId);
+CompilationInterface::mayBeInterruptible(VM_RT_SUPPORT id)  {
+    return INTERRUPTIBLE_NEVER != vm_helper_get_interruptibility_kind(id);
 }
 
 bool

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_stats.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_stats.h?rev=584049&r1=584048&r2=584049&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_stats.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_stats.h Thu Oct 11 22:27:33 2007
@@ -241,7 +241,6 @@
     uint64 total_hot_statics_bytes;
     uint64 total_hot_vtable_bytes;
 
-    SimpleHashtable rt_function_map;
     SimpleHashtable rt_function_requests;
     SimpleHashtable rt_function_calls;
 

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?rev=584049&r1=584048&r2=584049&view=diff
==============================================================================
--- 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 Thu Oct 11 22:27:33
2007
@@ -2486,145 +2486,6 @@
 //**********************************************************************//
 
 
-/**
- *  Checks if helper is a suspension point
- */
-
-VMEXPORT HELPER_INTERRUPTIBILITY_KIND vm_helper_get_interruptibility_kind(VM_RT_SUPPORT f)
-{
-switch(f) {
-    case VM_RT_MULTIANEWARRAY_RESOLVED:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_LDC_STRING:
-        return INTERRUPTIBLE_ALWAYS;
-    // Exceptions
-    case VM_RT_THROW:
-    case VM_RT_THROW_SET_STACK_TRACE:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_THROW_LAZY:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_IDX_OUT_OF_BOUNDS:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_NULL_PTR_EXCEPTION:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_DIVIDE_BY_ZERO_EXCEPTION:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_ARRAY_STORE_EXCEPTION:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_THROW_LINKING_EXCEPTION:
-        return INTERRUPTIBLE_ALWAYS;
-    // Type tests
-    case VM_RT_CHECKCAST:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_INSTANCEOF:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_AASTORE:
-        return INTERRUPTIBLE_ALWAYS;    
-    case VM_RT_AASTORE_TEST:
-        return INTERRUPTIBLE_ALWAYS;
-    // Misc
-    case VM_RT_GET_INTERFACE_VTABLE_VER0:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_INITIALIZE_CLASS:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_GC_SAFE_POINT:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_GC_GET_TLS_BASE:
-        return INTERRUPTIBLE_NEVER;
-    // JVMTI
-    case VM_RT_JVMTI_METHOD_ENTER_CALLBACK:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_JVMTI_METHOD_EXIT_CALLBACK:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_JVMTI_FIELD_ACCESS_CALLBACK:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_JVMTI_FIELD_MODIFICATION_CALLBACK:
-        return INTERRUPTIBLE_ALWAYS;
-    // Non-VM
-    case VM_RT_F2I:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_F2L:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_D2I:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_D2L:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_LSHL:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_LSHR:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_LUSHR:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_LMUL:
-#ifdef VM_LONG_OPT
-    case VM_RT_LMUL_CONST_MULTIPLIER:  
-#endif
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_LREM:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_LDIV:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_ULDIV:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_CONST_LDIV:             
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_CONST_LREM:             
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_IMUL:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_IREM:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_IDIV:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_FREM:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_FDIV:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_DREM:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_DDIV:
-        return INTERRUPTIBLE_NEVER;
-    case VM_RT_NEWOBJ_WITHRESOLVE:
-    case VM_RT_NEWARRAY_WITHRESOLVE:
-    case VM_RT_INITIALIZE_CLASS_WITHRESOLVE:
-    case VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE:
-    case VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE:
-    case VM_RT_CHECKCAST_WITHRESOLVE:
-    case VM_RT_INSTANCEOF_WITHRESOLVE:
-    case VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE:
-    case VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE:
-    case VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE:
-    case VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE:
-        return INTERRUPTIBLE_ALWAYS; 
-    case VM_RT_NEW_VECTOR_USING_VTABLE:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_WRITE_BARRIER_FASTCALL:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_MONITOR_ENTER:
-    case VM_RT_MONITOR_ENTER_NON_NULL:
-        return INTERRUPTIBLE_SOMETIMES;
-
-    case VM_RT_MONITOR_ENTER_STATIC:
-        return INTERRUPTIBLE_SOMETIMES;
-    case VM_RT_MONITOR_EXIT:
-    case VM_RT_MONITOR_EXIT_NON_NULL:
-        return INTERRUPTIBLE_SOMETIMES;
-
-    case VM_RT_MONITOR_EXIT_STATIC:
-        return INTERRUPTIBLE_SOMETIMES;
-    case VM_RT_CHAR_ARRAYCOPY_NO_EXC:
-        return INTERRUPTIBLE_ALWAYS;
-    case VM_RT_GC_HEAP_WRITE_REF:
-        return INTERRUPTIBLE_NEVER;
-    default:
-        ASSERT(false, "Unexpected helper id" << f);
-        return INTERRUPTIBLE_SOMETIMES;
-    }
-}
-
-
 /////////////////////////////////////////////////////////////
 
 // begin Java object allocation

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp?rev=584049&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp Thu Oct 11 22:27:33
2007
@@ -0,0 +1,246 @@
+/*
+*  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.
+*/
+
+#define LOG_DOMAIN "vm.helpers"
+#include "cxxlog.h"
+#include "jit_runtime_support.h"
+#include <map>
+
+#ifndef _WIN32
+    #define strcmpi strcasecmp
+#endif
+
+struct JIT_RT_Function_Entry {
+    VM_RT_SUPPORT  function;
+    const char    *name;
+    HELPER_INTERRUPTIBILITY_KIND i_kind;
+    HELPER_CALLING_CONVENTION cc_kind;
+    int            number_of_args;
+};
+
+typedef std::map<VM_RT_SUPPORT, JIT_RT_Function_Entry*> HelperInfoMap;
+
+static JIT_RT_Function_Entry _jit_rt_function_entries_base[] = {
+    {VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE, "VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_NEW_VECTOR_USING_VTABLE,            "VM_RT_NEW_VECTOR_USING_VTABLE",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_MULTIANEWARRAY_RESOLVED,            "VM_RT_MULTIANEWARRAY_RESOLVED",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_CDECL,                8},
+    {VM_RT_LDC_STRING,                         "VM_RT_LDC_STRING",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+
+    {VM_RT_THROW,                              "VM_RT_THROW",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_THROW_LAZY,                         "VM_RT_THROW_LAZY",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_DRL,                  8},
+    {VM_RT_IDX_OUT_OF_BOUNDS,                  "VM_RT_IDX_OUT_OF_BOUNDS",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              0},
+    {VM_RT_NULL_PTR_EXCEPTION,                 "VM_RT_NULL_PTR_EXCEPTION",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              0},
+    {VM_RT_DIVIDE_BY_ZERO_EXCEPTION,           "VM_RT_DIVIDE_BY_ZERO_EXCEPTION",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              0},
+    {VM_RT_ARRAY_STORE_EXCEPTION,              "VM_RT_ARRAY_STORE_EXCEPTION",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              0},
+    {VM_RT_THROW_LINKING_EXCEPTION,            "VM_RT_THROW_LINKING_EXCEPTION",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_DRL,                  0},
+    {VM_RT_THROW_SET_STACK_TRACE,              "VM_RT_THROW_SET_STACK_TRACE",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              1},
+
+    {VM_RT_MONITOR_ENTER,                      "VM_RT_MONITOR_ENTER",
+            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_MONITOR_ENTER_NON_NULL,             "VM_RT_MONITOR_ENTER_NON_NULL",
+            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_MONITOR_EXIT,                       "VM_RT_MONITOR_EXIT",
+            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_MONITOR_EXIT_NON_NULL,              "VM_RT_MONITOR_EXIT_NON_NULL",
+            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_MONITOR_ENTER_STATIC,               "VM_RT_MONITOR_ENTER_STATIC",
+            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_MONITOR_EXIT_STATIC,                "VM_RT_MONITOR_EXIT_STATIC",
+            INTERRUPTIBLE_SOMETIMES,           CALLING_CONVENTION_STDCALL,              1},
+
+    {VM_RT_CHECKCAST,                          "VM_RT_CHECKCAST",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_INSTANCEOF,                         "VM_RT_INSTANCEOF",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_AASTORE,                            "VM_RT_AASTORE",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              3},
+    {VM_RT_AASTORE_TEST,                       "VM_RT_AASTORE_TEST",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_GET_INTERFACE_VTABLE_VER0,          "VM_RT_GET_INTERFACE_VTABLE_VER0",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+
+    {VM_RT_INITIALIZE_CLASS,                   "VM_RT_INITIALIZE_CLASS",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              1},
+
+    {VM_RT_GC_HEAP_WRITE_REF,                  "VM_RT_GC_HEAP_WRITE_REF",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_CDECL,                3},
+    {VM_RT_GC_SAFE_POINT,                      "VM_RT_GC_SAFE_POINT",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              0},
+    {VM_RT_GC_GET_TLS_BASE,                    "VM_RT_GET_TLS_BASE",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              0},
+
+    {VM_RT_JVMTI_METHOD_ENTER_CALLBACK,        "VM_RT_JVMTI_METHOD_ENTER_CALLBACK",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_JVMTI_METHOD_EXIT_CALLBACK,         "VM_RT_JVMTI_METHOD_EXIT_CALLBACK",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_JVMTI_FIELD_ACCESS_CALLBACK,        "VM_RT_JVMTI_FIELD_ACCESS__CALLBACK",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              4},
+    {VM_RT_JVMTI_FIELD_MODIFICATION_CALLBACK,  "VM_RT_JVMTI_FIELD_MODIFICATION_CALLBACK",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              5},
+
+    {VM_RT_NEWOBJ_WITHRESOLVE,                      "VM_RT_NEWOBJ_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         2},
+    {VM_RT_NEWARRAY_WITHRESOLVE,                    "VM_RT_NEWARRAY_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         3},
+    {VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE,  "VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         2},
+    {VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE,       "VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         2},
+    {VM_RT_CHECKCAST_WITHRESOLVE,                   "VM_RT_CHECKCAST_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         3},
+    {VM_RT_INSTANCEOF_WITHRESOLVE,                  "VM_RT_INSTANCEOF_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         3},
+    {VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE,       "VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         2},
+    {VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE,    "VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         3},
+    {VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE,      "VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         3},
+    {VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE,     "VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         2},
+    {VM_RT_INITIALIZE_CLASS_WITHRESOLVE,           "VM_RT_INITIALIZE_CLASS_WITHRESOLVE",
+            INTERRUPTIBLE_ALWAYS,                   CALLING_CONVENTION_STDCALL,         2},
+
+
+    {VM_RT_F2I,                                "VM_RT_F2I",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_F2L,                                "VM_RT_F2L",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_D2I,                                "VM_RT_D2I",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_D2L,                                "VM_RT_D2L",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              1},
+    {VM_RT_LSHL,                               "VM_RT_LSHL",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_DRL,                  2},
+    {VM_RT_LSHR,                               "VM_RT_LSHR",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_DRL,                  2},
+    {VM_RT_LUSHR,                              "VM_RT_LUSHR",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_DRL,                  2},
+    {VM_RT_LMUL,                               "VM_RT_LMUL",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+#ifdef VM_LONG_OPT
+    {VM_RT_LMUL_CONST_MULTIPLIER,              "VM_RT_LMUL_CONST_MULTIPLIER",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+#endif // VM_LONG_OPT
+    {VM_RT_LREM,                               "VM_RT_LREM",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_LDIV,                               "VM_RT_LDIV",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_ULDIV,                              "VM_RT_ULDIV",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_CONST_LDIV,                         "VM_RT_CONST_LDIV",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_CONST_LREM,                         "VM_RT_CONST_LREM",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_IMUL,                               "VM_RT_IMUL",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_IREM,                               "VM_RT_IREM",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_IDIV,                               "VM_RT_IDIV",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_FREM,                               "VM_RT_FREM",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_FDIV,                               "VM_RT_FDIV",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_DREM,                               "VM_RT_DREM",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+    {VM_RT_DDIV,                               "VM_RT_DDIV",
+            INTERRUPTIBLE_NEVER,               CALLING_CONVENTION_STDCALL,              2},
+
+    {VM_RT_CHAR_ARRAYCOPY_NO_EXC,              "VM_RT_CHAR_ARRAYCOPY_NO_EXC",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              5},
+
+    {VM_RT_WRITE_BARRIER_FASTCALL,             "VM_RT_WRITE_BARRIER_FASTCALL",
+            INTERRUPTIBLE_ALWAYS,              CALLING_CONVENTION_STDCALL,              2},
+};
+
+static JIT_RT_Function_Entry *jit_rt_function_entries = &(_jit_rt_function_entries_base[0]);
+static int num_jit_rt_function_entries = sizeof(_jit_rt_function_entries_base) / sizeof(_jit_rt_function_entries_base[0]);
+
+static HelperInfoMap* init_helper_map() {
+    // TODO: Use proper MM
+    HelperInfoMap *map = new HelperInfoMap();
+    for (int i = 0;  i < num_jit_rt_function_entries;  i++) {
+        VM_RT_SUPPORT hid = jit_rt_function_entries[i].function;
+        assert(map->find(hid) == map->end());
+        map->insert(HelperInfoMap::value_type(hid, jit_rt_function_entries + i));
+    }
+    assert(map->size() == num_jit_rt_function_entries);
+    return map;
+}
+
+static HelperInfoMap *helper_map = init_helper_map();
+
+VMEXPORT 
+const char* vm_helper_get_name(VM_RT_SUPPORT id) {
+    HelperInfoMap::const_iterator it = helper_map->find(id);
+    if (helper_map->end() != it) {
+        assert(it->second);
+        return it->second->name;
+    } else {
+        ASSERT(VM_RT_UNKNOWN == id, "Unexpected helper id " << id);
+        return "unknown";
+    }
+}
+
+VMEXPORT 
+VM_RT_SUPPORT vm_helper_get_by_name(const char* name) {
+    for (int i = 0;  i < num_jit_rt_function_entries;  i++) {
+        if( !strcmpi(name, jit_rt_function_entries[i].name)) {
+            return jit_rt_function_entries[i].function;
+        }
+    }
+    return VM_RT_UNKNOWN;
+}
+
+VMEXPORT 
+HELPER_INTERRUPTIBILITY_KIND vm_helper_get_interruptibility_kind(VM_RT_SUPPORT id)
+{
+    HelperInfoMap::const_iterator it = helper_map->find(id);
+    if (helper_map->end() != it) {
+        assert(it->second);
+        return it->second->i_kind;
+    } else {
+        ASSERT(false, "Unexpected helper id " << id);
+        return INTERRUPTIBLE_SOMETIMES;
+    }
+}
+
+VMEXPORT 
+HELPER_CALLING_CONVENTION vm_helper_get_calling_convention(VM_RT_SUPPORT id) 
+{
+    HelperInfoMap::const_iterator it = helper_map->find(id);
+    if (helper_map->end() != it) {
+        assert(it->second);
+        return it->second->cc_kind;
+    } else {
+        ASSERT(false, "Unexpected helper id " << id);
+        return CALLING_CONVENTION_STDCALL;
+    }
+}

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

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_stats.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_stats.cpp?rev=584049&r1=584048&r2=584049&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_stats.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_stats.cpp Thu Oct 11 22:27:33 2007
@@ -38,101 +38,8 @@
 bool vm_print_total_stats = false;
 int vm_print_total_stats_level = 0;
 
-// 20030425 The list of JIT support functions below must be kept in synch with the enum VM_RT_SUPPORT
in jit_runtime_support.h.
-typedef struct JIT_RT_Function_Entry {
-    VM_RT_SUPPORT  function;
-    char           *function_name;
-    int             number_of_args;
-} JIT_RT_Function_Entry;
-
-static JIT_RT_Function_Entry _jit_rt_function_entries_base[] = {
-    {VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE, "VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE",
2},
-    {VM_RT_NEW_VECTOR_USING_VTABLE,            "VM_RT_NEW_VECTOR_USING_VTABLE",         
  2},
-    {VM_RT_MULTIANEWARRAY_RESOLVED,            "VM_RT_MULTIANEWARRAY_RESOLVED",         
  8},
-    {VM_RT_LDC_STRING,                         "VM_RT_LDC_STRING",                      
  2},
-
-    {VM_RT_THROW,                              "VM_RT_THROW",                           
  1},
-    {VM_RT_THROW_LAZY,                         "VM_RT_THROW_LAZY",                      
  8},
-    {VM_RT_IDX_OUT_OF_BOUNDS,                  "VM_RT_IDX_OUT_OF_BOUNDS",               
  0},
-    {VM_RT_NULL_PTR_EXCEPTION,                 "VM_RT_NULL_PTR_EXCEPTION",              
  0},
-    {VM_RT_DIVIDE_BY_ZERO_EXCEPTION,           "VM_RT_DIVIDE_BY_ZERO_EXCEPTION",        
  0},
-    {VM_RT_ARRAY_STORE_EXCEPTION,              "VM_RT_ARRAY_STORE_EXCEPTION",           
  0},
-    {VM_RT_THROW_LINKING_EXCEPTION,            "VM_RT_THROW_LINKING_EXCEPTION",         
  0},
-    {VM_RT_THROW_SET_STACK_TRACE,              "VM_RT_THROW_SET_STACK_TRACE",           
  1},
-
-    {VM_RT_MONITOR_ENTER,                      "VM_RT_MONITOR_ENTER",                   
  1},
-    {VM_RT_MONITOR_ENTER_NON_NULL,             "VM_RT_MONITOR_ENTER_NON_NULL",          
  1},
-    {VM_RT_MONITOR_EXIT,                       "VM_RT_MONITOR_EXIT",                    
  1},
-    {VM_RT_MONITOR_EXIT_NON_NULL,              "VM_RT_MONITOR_EXIT_NON_NULL",           
  1},
-    {VM_RT_MONITOR_ENTER_STATIC,               "VM_RT_MONITOR_ENTER_STATIC",            
  1},
-    {VM_RT_MONITOR_EXIT_STATIC,                "VM_RT_MONITOR_EXIT_STATIC",             
  1},
-
-    {VM_RT_CHECKCAST,                          "VM_RT_CHECKCAST",                       
  2},
-    {VM_RT_INSTANCEOF,                         "VM_RT_INSTANCEOF",                      
  2},
-    {VM_RT_AASTORE,                            "VM_RT_AASTORE",                         
  3},
-    {VM_RT_AASTORE_TEST,                       "VM_RT_AASTORE_TEST",                    
  2},
-    {VM_RT_GET_INTERFACE_VTABLE_VER0,          "VM_RT_GET_INTERFACE_VTABLE_VER0",       
  2},
-
-    {VM_RT_INITIALIZE_CLASS,                   "VM_RT_INITIALIZE_CLASS",                
  1},
-
-    {VM_RT_GC_HEAP_WRITE_REF,                  "VM_RT_GC_HEAP_WRITE_REF",               
  3},
-    {VM_RT_GC_SAFE_POINT,                      "VM_RT_GC_SAFE_POINT",                   
  0},
-    {VM_RT_GC_GET_TLS_BASE,                    "VM_RT_GET_TLS_BASE",                    
  0},
-
-    {VM_RT_JVMTI_METHOD_ENTER_CALLBACK,        "VM_RT_JVMTI_METHOD_ENTER_CALLBACK",     
  1},
-    {VM_RT_JVMTI_METHOD_EXIT_CALLBACK,         "VM_RT_JVMTI_METHOD_EXIT_CALLBACK",      
  2},
-    {VM_RT_JVMTI_FIELD_ACCESS_CALLBACK,        "VM_RT_JVMTI_FIELD_ACCESS__CALLBACK",    
  4},
-    {VM_RT_JVMTI_FIELD_MODIFICATION_CALLBACK,  "VM_RT_JVMTI_FIELD_MODIFICATION_CALLBACK",
 5},
-
-    {VM_RT_NEWOBJ_WITHRESOLVE,                      "VM_RT_NEWOBJ_WITHRESOLVE",         
           2},
-    {VM_RT_NEWARRAY_WITHRESOLVE,                    "VM_RT_NEWARRAY_WITHRESOLVE",       
           3},
-    {VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE,  "VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE",
2},
-    {VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE,       "VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE",
     2},
-    {VM_RT_CHECKCAST_WITHRESOLVE,                   "VM_RT_CHECKCAST_WITHRESOLVE",      
           3},
-    {VM_RT_INSTANCEOF_WITHRESOLVE,                  "VM_RT_INSTANCEOF_WITHRESOLVE",     
           3},
-    {VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE,       "VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE",
     2},
-    {VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE,    "VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE",
  3},
-    {VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE,      "VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE",
    3},
-    {VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE,     "VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE",
   2},
-    {VM_RT_INITIALIZE_CLASS_WITHRESOLVE,           "VM_RT_INITIALIZE_CLASS_WITHRESOLVE",
         2},
-
-
-    {VM_RT_F2I,                                "VM_RT_F2I",                             
  1},
-    {VM_RT_F2L,                                "VM_RT_F2L",                             
  1},
-    {VM_RT_D2I,                                "VM_RT_D2I",                             
  1},
-    {VM_RT_D2L,                                "VM_RT_D2L",                             
  1},
-    {VM_RT_LSHL,                               "VM_RT_LSHL",                            
  2},
-    {VM_RT_LSHR,                               "VM_RT_LSHR",                            
  2},
-    {VM_RT_LUSHR,                              "VM_RT_LUSHR",                           
  2},
-    {VM_RT_LMUL,                               "VM_RT_LMUL",                            
  2},
-#ifdef VM_LONG_OPT
-    {VM_RT_LMUL_CONST_MULTIPLIER,              "VM_RT_LMUL_CONST_MULTIPLIER",           
  2},
-#endif // VM_LONG_OPT
-    {VM_RT_LREM,                               "VM_RT_LREM",                            
  2},
-    {VM_RT_LDIV,                               "VM_RT_LDIV",                            
  2},
-    {VM_RT_ULDIV,                              "VM_RT_ULDIV",                           
  2},
-    {VM_RT_CONST_LDIV,                         "VM_RT_CONST_LDIV",                      
  2},
-    {VM_RT_CONST_LREM,                         "VM_RT_CONST_LREM",                      
  2},
-    {VM_RT_IMUL,                               "VM_RT_IMUL",                            
  2},
-    {VM_RT_IREM,                               "VM_RT_IREM",                            
  2},
-    {VM_RT_IDIV,                               "VM_RT_IDIV",                            
  2},
-    {VM_RT_FREM,                               "VM_RT_FREM",                            
  2},
-    {VM_RT_FDIV,                               "VM_RT_FDIV",                            
  2},
-    {VM_RT_DREM,                               "VM_RT_DREM",                            
  2},
-    {VM_RT_DDIV,                               "VM_RT_DDIV",                            
  2},
-
-    {VM_RT_CHAR_ARRAYCOPY_NO_EXC,              "VM_RT_CHAR_ARRAYCOPY_NO_EXC",           
  5},
-
-    {VM_RT_WRITE_BARRIER_FASTCALL,             "VM_RT_WRITE_BARRIER_FASTCALL",          
  2},
-};
-
-static JIT_RT_Function_Entry *jit_rt_function_entries = &(_jit_rt_function_entries_base[0]);
-static int sizeof_jit_rt_function_entries = sizeof(_jit_rt_function_entries_base) / sizeof(_jit_rt_function_entries_base[0]);
-
-
 VM_Statistics::VM_Statistics()
-    : rt_function_map(56),
-      rt_function_requests(56),
+    : rt_function_requests(56),
       rt_function_calls(56)
 {
     num_exceptions                          = 0;
@@ -325,17 +232,6 @@
     total_hot_statics_bytes = 0;
     total_hot_vtable_bytes = 0;
 
-    // Enter the JIT RT support functions into a <function number> -> <function
name, argument number> map.
-    for (int i = 0;  i < sizeof_jit_rt_function_entries;  i++) {
-        char *fn_name;
-        int   num_args;
-        VM_RT_SUPPORT  fn_number = jit_rt_function_entries[i].function;
-        assert( !rt_function_map.lookup((void *)fn_number, &num_args, (void **)&fn_name)
);
-        fn_name   = jit_rt_function_entries[i].function_name;
-        num_args  = jit_rt_function_entries[i].number_of_args;
-        rt_function_map.add((void *)fn_number, num_args, fn_name);
-    }
-
     apr_pool_create(&vm_stats_pool, 0);    
 } //VM_Statistics::VM_Statistics
 
@@ -604,10 +500,7 @@
         quick_sort(pair_array, 0, num_entries-1);
         for (i = 0;  i < num_entries;  i++) {
             VM_RT_SUPPORT fn_number = (VM_RT_SUPPORT)((POINTER_SIZE_INT)(pair_array[i]->key));
      
-            int   num_args = 0;
-            char *fn_name = NULL;
-            bool UNUSED found = rt_function_map.lookup((void *)fn_number, &num_args,
(void **)&fn_name);
-            assert(found);  // else changes were made to the enum VM_RT_SUPPORT in jit_runtime_support.h.
+            const char *fn_name = vm_helper_get_name(fn_number);
             printf("%11d :::: %s\n", pair_array[i]->value, fn_name);
         }
         STD_FREE(pair_array);
@@ -623,10 +516,7 @@
         quick_sort(pair_array, 0, num_entries-1);
         for (i = 0;  i < num_entries;  i++) {
             VM_RT_SUPPORT fn_number = (VM_RT_SUPPORT)((POINTER_SIZE_INT)(pair_array[i]->key));
      
-            int   num_args = 0;
-            char *fn_name = NULL;
-            bool found = rt_function_map.lookup((void *)fn_number, &num_args, (void **)&fn_name);
-            assert(found);  // else changes were made to the enum VM_RT_SUPPORT in jit_runtime_support.h.
+            const char *fn_name = vm_helper_get_name(fn_number);
             printf("%11d :::: %s\n", pair_array[i]->value, fn_name);
         }
         printf("\n");



Mime
View raw message