[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine monitor.c,NONE,1.1 int_proto.h,1
From: |
Gopal.V <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine monitor.c,NONE,1.1 int_proto.h,1.64,1.65 int_table.c,1.66,1.67 cvm_inline.c,1.12,1.13 engine.h,1.73,1.74 heap.c,1.15,1.16 ilrun.c,1.33,1.34 lib_defs.h,1.21,1.22 lib_gc.c,1.5,1.6 lib_thread.c,1.10,1.11 process.c,1.46,1.47 thread.c,1.15,1.16 |
Date: |
Wed, 25 Jun 2003 23:39:27 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv17201/engine
Modified Files:
int_proto.h int_table.c cvm_inline.c engine.h heap.c ilrun.c
lib_defs.h lib_gc.c lib_thread.c process.c thread.c
Added Files:
monitor.c
Log Message:
Threading support, Patch #1657
--- NEW FILE ---
/*
* lib_object.c - Internalcall methods for "System.Object".
*
* Copyright (C) 2003 Southern Storm Software, Pty Ltd.
*
* Authors: Thong Nguyen (address@hidden)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "engine.h"
#include "lib_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
ILExecMonitor *ILExecMonitorCreate()
{
ILExecMonitor *monitor;
/* Allocate memory for the ILExecMonitor */
if((monitor = (ILExecMonitor *)ILMalloc(sizeof(ILExecMonitor))) == 0)
{
return 0;
}
/* Allocate memory for the wait monitor */
if((monitor->supportMonitor = ILWaitMonitorCreate()) == 0)
{
return 0;
}
monitor->waiters = 0;
monitor->next = 0;
return monitor;
}
void ILExecMonitorDestroy(ILExecMonitor *monitor)
{
ILWaitHandleClose(monitor->supportMonitor);
ILFree(monitor);
}
#ifdef USE_HASHING_MONITORS
#define DEFAULT_HASHTABLE_SIZE (523)
/*
* An entry in the monitor Hashtable.
*/
typedef struct _tagILMonitorEntry ILMonitorEntry;
struct _tagILMonitorEntry
{
ILObject *obj;
ILLockWord lockWord;
ILMonitorEntry *next;
};
/*
* Gets a pointer to the WaitHandle object used by the object.
*/
static ILLockWord *GetObjectLockWordPtr(ILExecThread *thread, ILObject *obj)
{
ILInt32 x;
ILMonitorEntry **table, *entry, *ghost;
ILMutexLock(thread->process->monitorSystemLock);
table = thread->process->monitorHash;
if (table == 0)
{
/* Create the monitor hashtable */
table = (ILMonitorEntry **)ILGCAlloc(sizeof(ILMonitorEntry *)
* DEFAULT_HASHTABLE_SIZE);
if (table == 0)
{
ILExecThreadThrowOutOfMemory(thread);
ILMutexUnlock(thread->process->monitorSystemLock);
return 0;
}
thread->process->monitorHash = table;
}
/* Get the hashtable index */
x = (ILInt32)obj;
x = ((x >> 16) ^ (x & 0xffff)) % DEFAULT_HASHTABLE_SIZE;
entry = table[x];
if (entry == 0)
{
/* The bucket is empty */
/* Start a new bucket by creating a new hashtable entry */
if ((entry = (ILMonitorEntry
*)ILGCAlloc(sizeof(ILMonitorEntry))) == 0)
{
ILExecThreadThrowOutOfMemory(thread);
ILMutexUnlock(thread->process->monitorSystemLock);
return 0;
}
entry->lockWord = 0;
entry->obj = obj;
entry->next = 0;
table[x] = entry;
ILGCRegisterGeneralWeak(&entry->obj, obj);
ILMutexUnlock(thread->process->monitorSystemLock);
return &entry->lockWord;
}
else
{
/* The bucket isn't empty. Search for the right entry. */
ghost = 0;
for (;;)
{
if (entry->obj == obj)
{
/* Entry was found. Return it */
ILMutexUnlock(thread->process->monitorSystemLock);
return &entry->lockWord;
}
else if (entry->obj == 0)
{
/* Found an entry pointing to a dead object */
if (ghost == 0)
{
/* The ghost will be GCed so no need to
free it if we don't
end up using it */
ghost = entry;
ghost->obj = obj;
ghost->next = 0;
}
}
entry = entry->next;
if (entry == 0)
{
/* No entry was found */
if (ghost == 0)
{
/* No ghost found. Create a whole new
entry. */
if ((entry = (ILMonitorEntry
*)ILGCAlloc(sizeof(ILMonitorEntry))) == 0)
{
ILExecThreadThrowOutOfMemory(thread);
ILMutexUnlock(thread->process->monitorSystemLock);
return 0;
}
entry->lockWord = 0;
}
else
{
/* We found a ghost! Use the ghost */
entry = ghost;
}
/* Setup the new entry */
entry->obj = obj;
entry->next = table[x];
table[x] = entry;
/* Make the entry's obj pointer weak and let it
be set to 0
if the object
is collected */
ILGCRegisterGeneralWeak(&entry->obj, obj);
ILMutexUnlock(thread->process->monitorSystemLock);
return &entry->lockWord;
}
}
}
ILMutexUnlock(thread->process->monitorSystemLock);
return 0;
}
/*
* Implementation of GetObjectLockWord using hashtables.
*/
ILLockWord GetObjectLockWord(ILExecThread *thread, ILObject *obj)
{
return *GetObjectLockWordPtr(thread, obj);
}
/*
* Implementation of CompareAndExchangeObjectLockWord using hashtables.
*/
ILLockWord CompareAndExchangeObjectLockWord(ILExecThread *thread,
ILObject *obj,
ILLockWord value, ILLockWord comparand)
{
ILLockWord oldValue;
ILLockWord *lockWordPtr;
/* Lockdown the monitor hashtable */
ILMutexLock(thread->process->monitorSystemLock);
lockWordPtr = GetObjectLockWordPtr(thread, obj);
/* Do the compare & exchange */
if ((oldValue = *lockWordPtr ) == comparand)
{
*lockWordPtr = value;
}
/* Unlock the monitor hashtable */
ILMutexUnlock(thread->process->monitorSystemLock);
return oldValue;
}
#endif
#ifdef __cplusplus
};
#endif
Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** int_proto.h 21 Jun 2003 02:57:05 -0000 1.64
--- int_proto.h 26 Jun 2003 03:39:25 -0000 1.65
***************
*** 42,45 ****
--- 42,53 ----
extern ILObject * _IL_Delegate_CreateBlankDelegate(ILExecThread * _thread,
ILObject * _p1, ILObject * _p2);
+ extern ILBool _IL_BitConverter_GetLittleEndian(ILExecThread * _thread);
+ extern ILInt64 _IL_BitConverter_DoubleToInt64Bits(ILExecThread * _thread,
ILDouble _p1);
+ extern ILDouble _IL_BitConverter_Int64BitsToDouble(ILExecThread * _thread,
ILInt64 _p1);
+ extern ILInt32 _IL_BitConverter_FloatToInt32Bits(ILExecThread * _thread,
ILFloat _p1);
+ extern ILFloat _IL_BitConverter_Int32BitsToFloat(ILExecThread * _thread,
ILInt32 _p1);
+ extern System_Array * _IL_BitConverter_GetLittleEndianBytes_f(ILExecThread *
_thread, ILFloat _p1);
+ extern System_Array * _IL_BitConverter_GetLittleEndianBytes_d(ILExecThread *
_thread, ILDouble _p1);
+
extern ILInt32 _IL_Buffer_GetLength(ILExecThread * _thread, ILObject * _p1);
extern void _IL_Buffer_Copy(ILExecThread * _thread, ILObject * _p1, ILInt32
_p2, ILObject * _p3, ILInt32 _p4, ILInt32 _p5);
***************
*** 62,65 ****
--- 70,111 ----
extern void _IL_Decimal_Subtract(ILExecThread * _thread, ILDecimal * _result,
ILDecimal * _p1, ILDecimal * _p2);
+ extern ILBool _IL_Double_IsNaN(ILExecThread * _thread, ILDouble _p1);
+ extern ILInt32 _IL_Double_TestInfinity(ILExecThread * _thread, ILDouble _p1);
+
+ extern void _IL_GC_KeepAlive(ILExecThread * _thread, ILObject * _p1);
+ extern void _IL_GC_ReRegisterForFinalize(ILExecThread * _thread, ILObject *
_p1);
+ extern void _IL_GC_SuppressFinalize(ILExecThread * _thread, ILObject * _p1);
+ extern void _IL_GC_WaitForPendingFinalizers(ILExecThread * _thread);
+ extern void _IL_GC_Collect(ILExecThread * _thread);
+ extern ILInt64 _IL_GC_GetTotalMemory(ILExecThread * _thread, ILBool _p1);
+
+ extern void _IL_Guid_NewGuid(ILExecThread * _thread, void * _result);
+
+ extern ILDouble _IL_Math_Log(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_RoundDouble(ILExecThread * _thread, ILDouble _p1,
ILInt32 _p2);
+ extern ILDouble _IL_Math_Acos(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Asin(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Atan(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Atan2(ILExecThread * _thread, ILDouble _p1, ILDouble
_p2);
+ extern ILDouble _IL_Math_Ceiling(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Cos(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Cosh(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Exp(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Floor(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_IEEERemainder(ILExecThread * _thread, ILDouble _p1,
ILDouble _p2);
+ extern ILDouble _IL_Math_Log10(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Pow(ILExecThread * _thread, ILDouble _p1, ILDouble
_p2);
+ extern ILDouble _IL_Math_Round(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Sin(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Sinh(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Sqrt(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Tan(ILExecThread * _thread, ILDouble _p1);
+ extern ILDouble _IL_Math_Tanh(ILExecThread * _thread, ILDouble _p1);
+
+ extern ILNativeInt _IL_RuntimeMethodHandle_GetFunctionPointer(ILExecThread *
_thread, void * _this);
+
+ extern ILBool _IL_Single_IsNaN(ILExecThread * _thread, ILFloat _p1);
+ extern ILInt32 _IL_Single_TestInfinity(ILExecThread * _thread, ILFloat _p1);
+
extern System_String * _IL_String_Concat_StringString(ILExecThread * _thread,
System_String * _p1, System_String * _p2);
extern System_String * _IL_String_ctor_acii(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILInt32 _p3);
***************
*** 99,146 ****
extern void _IL_String_SetChar(ILExecThread * _thread, System_String * _this,
ILInt32 _p1, ILUInt16 _p2);
- extern ILBool _IL_Double_IsNaN(ILExecThread * _thread, ILDouble _p1);
- extern ILInt32 _IL_Double_TestInfinity(ILExecThread * _thread, ILDouble _p1);
-
- extern void _IL_GC_KeepAlive(ILExecThread * _thread, ILObject * _p1);
- extern void _IL_GC_ReRegisterForFinalize(ILExecThread * _thread, ILObject *
_p1);
- extern void _IL_GC_SuppressFinalize(ILExecThread * _thread, ILObject * _p1);
- extern void _IL_GC_WaitForPendingFinalizers(ILExecThread * _thread);
- extern void _IL_GC_Collect(ILExecThread * _thread);
- extern ILInt64 _IL_GC_GetTotalMemory(ILExecThread * _thread, ILBool _p1);
-
- extern void _IL_Guid_NewGuid(ILExecThread * _thread, void * _result);
-
- extern ILBool _IL_BitConverter_GetLittleEndian(ILExecThread * _thread);
- extern ILInt64 _IL_BitConverter_DoubleToInt64Bits(ILExecThread * _thread,
ILDouble _p1);
- extern ILDouble _IL_BitConverter_Int64BitsToDouble(ILExecThread * _thread,
ILInt64 _p1);
- extern ILInt32 _IL_BitConverter_FloatToInt32Bits(ILExecThread * _thread,
ILFloat _p1);
- extern ILFloat _IL_BitConverter_Int32BitsToFloat(ILExecThread * _thread,
ILInt32 _p1);
- extern System_Array * _IL_BitConverter_GetLittleEndianBytes_f(ILExecThread *
_thread, ILFloat _p1);
- extern System_Array * _IL_BitConverter_GetLittleEndianBytes_d(ILExecThread *
_thread, ILDouble _p1);
-
- extern ILDouble _IL_Math_Log(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_RoundDouble(ILExecThread * _thread, ILDouble _p1,
ILInt32 _p2);
- extern ILDouble _IL_Math_Acos(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Asin(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Atan(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Atan2(ILExecThread * _thread, ILDouble _p1, ILDouble
_p2);
- extern ILDouble _IL_Math_Ceiling(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Cos(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Cosh(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Exp(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Floor(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_IEEERemainder(ILExecThread * _thread, ILDouble _p1,
ILDouble _p2);
- extern ILDouble _IL_Math_Log10(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Pow(ILExecThread * _thread, ILDouble _p1, ILDouble
_p2);
- extern ILDouble _IL_Math_Round(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Sin(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Sinh(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Sqrt(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Tan(ILExecThread * _thread, ILDouble _p1);
- extern ILDouble _IL_Math_Tanh(ILExecThread * _thread, ILDouble _p1);
-
- extern ILBool _IL_Single_IsNaN(ILExecThread * _thread, ILFloat _p1);
- extern ILInt32 _IL_Single_TestInfinity(ILExecThread * _thread, ILFloat _p1);
-
extern ILObject * _IL_Type_GetTypeFromHandle(ILExecThread * _thread, void *
_p1);
extern void _IL_Type_GetTypeHandle(ILExecThread * _thread, void * _result,
ILObject * _p1);
--- 145,148 ----
***************
*** 151,155 ****
extern ILBool _IL_TypedReference_ClrSetTypedReference(ILExecThread * _thread,
ILTypedRef _p1, ILObject * _p2);
! extern ILNativeInt _IL_RuntimeMethodHandle_GetFunctionPointer(ILExecThread *
_thread, void * _this);
extern ILInt32 _IL_Interlocked_CompareExchange_Riii(ILExecThread * _thread,
ILInt32 * _p1, ILInt32 _p2, ILInt32 _p3);
--- 153,160 ----
extern ILBool _IL_TypedReference_ClrSetTypedReference(ILExecThread * _thread,
ILTypedRef _p1, ILObject * _p2);
! extern void _IL_WaitHandle_InternalClose(ILExecThread * _thread, ILNativeInt
_p1);
! extern ILBool _IL_WaitHandle_InternalWaitAll(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILBool _p3);
! extern ILInt32 _IL_WaitHandle_InternalWaitAny(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILBool _p3);
! extern ILBool _IL_WaitHandle_InternalWaitOne(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
extern ILInt32 _IL_Interlocked_CompareExchange_Riii(ILExecThread * _thread,
ILInt32 * _p1, ILInt32 _p2, ILInt32 _p3);
***************
*** 171,183 ****
extern void _IL_Monitor_PulseAll(ILExecThread * _thread, ILObject * _p1);
- extern void _IL_WaitHandle_InternalClose(ILExecThread * _thread, ILNativeInt
_p1);
- extern ILBool _IL_WaitHandle_InternalWaitAll(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILBool _p3);
- extern ILInt32 _IL_WaitHandle_InternalWaitAny(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILBool _p3);
- extern ILBool _IL_WaitHandle_InternalWaitOne(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
-
extern ILNativeInt _IL_Mutex_InternalCreateMutex(ILExecThread * _thread,
ILBool _p1, ILString * _p2, ILBool * gotOwnership);
extern void _IL_Mutex_InternalReleaseMutex(ILExecThread * _thread,
ILNativeInt _p1);
extern ILInt32 _IL_Thread_InternalGetThreadId(ILExecThread * _thread);
extern void _IL_Thread_FinalizeThread(ILExecThread * _thread, ILObject *
_this);
extern void _IL_Thread_Abort(ILExecThread * _thread, ILObject * _this);
--- 176,184 ----
extern void _IL_Monitor_PulseAll(ILExecThread * _thread, ILObject * _p1);
extern ILNativeInt _IL_Mutex_InternalCreateMutex(ILExecThread * _thread,
ILBool _p1, ILString * _p2, ILBool * gotOwnership);
extern void _IL_Mutex_InternalReleaseMutex(ILExecThread * _thread,
ILNativeInt _p1);
extern ILInt32 _IL_Thread_InternalGetThreadId(ILExecThread * _thread);
+ extern void _IL_Thread_InitializeThread(ILExecThread * _thread, ILObject *
_this);
extern void _IL_Thread_FinalizeThread(ILExecThread * _thread, ILObject *
_this);
extern void _IL_Thread_Abort(ILExecThread * _thread, ILObject * _this);
***************
*** 305,316 ****
extern ILObject * _IL_MethodBase_GetCurrentMethod(ILExecThread * _thread);
extern ILObject * _IL_FieldInfo_GetFieldFromHandle(ILExecThread * _thread,
void * _p1);
! extern ILObject * _IL_Module_GetAssembly(ILExecThread * _thread, ILObject *
_this);
! extern ILObject * _IL_Module_GetModuleType(ILExecThread * _thread, ILObject *
_this);
! extern ILString * _IL_Module_GetFullName(ILExecThread * _thread, ILObject *
_this);
! extern ILObject * _IL_Module_GetType(ILExecThread * _thread, ILObject *
_this, ILString * _p1, ILBool _p2, ILBool _p3);
! extern System_Array * _IL_Module_GetTypes(ILExecThread * _thread, ILObject *
_this);
! extern ILBool _IL_Module_IsResource(ILExecThread * _thread, ILObject * _this);
extern ILInt32 _IL_ClrType_GetClrArrayRank(ILExecThread * _thread, ILObject *
_this);
--- 306,335 ----
extern ILObject * _IL_MethodBase_GetCurrentMethod(ILExecThread * _thread);
+ extern ILObject * _IL_ClrConstructor_Invoke(ILExecThread * _thread, ILObject
* _this, ILInt32 _p1, ILObject * _p2, System_Array * _p3, ILObject * _p4);
+
extern ILObject * _IL_FieldInfo_GetFieldFromHandle(ILExecThread * _thread,
void * _p1);
! extern ILObject * _IL_ClrField_GetFieldType(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILObject * _IL_ClrField_GetValue(ILExecThread * _thread, ILObject *
_this, ILObject * _p1);
! extern void _IL_ClrField_SetValue(ILExecThread * _thread, ILObject * _this,
ILObject * _p1, ILObject * _p2, ILInt32 _p3, ILObject * _p4, ILObject * _p5);
! extern ILObject * _IL_ClrField_GetValueDirect(ILExecThread * _thread,
ILObject * _this, ILTypedRef _p1);
! extern void _IL_ClrField_SetValueDirect(ILExecThread * _thread, ILObject *
_this, ILTypedRef _p1, ILObject * _p2);
!
! extern ILBool _IL_ClrHelpers_CanAccess(ILExecThread * _thread, ILNativeInt
_p1);
! extern ILString * _IL_ClrHelpers_GetName(ILExecThread * _thread, ILNativeInt
_p1);
! extern ILInt32 _IL_ClrHelpers_GetNumParameters(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILInt32 _IL_ClrHelpers_GetMemberAttrs(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILInt32 _IL_ClrHelpers_GetCallConv(ILExecThread * _thread, ILNativeInt
_p1);
! extern ILInt32 _IL_ClrHelpers_GetImplAttrs(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILObject * _IL_ClrHelpers_GetSemantics(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILBool _p3);
! extern System_Array * _IL_ClrHelpers_GetCustomAttributes(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2, ILBool _p3);
! extern ILBool _IL_ClrHelpers_IsDefined(ILExecThread * _thread, ILNativeInt
_p1, ILNativeInt _p2, ILBool _p3);
! extern ILNativeInt _IL_ClrHelpers_GetDeclaringType(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILNativeInt _IL_ClrHelpers_GetParameter(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
! extern ILObject * _IL_ClrHelpers_GetParameterType(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
! extern ILBool _IL_ClrHelpers_HasSemantics(ILExecThread * _thread, ILNativeInt
_p1, ILInt32 _p2, ILBool _p3);
!
! extern ILObject * _IL_ClrMethod_Invoke(ILExecThread * _thread, ILObject *
_this, ILObject * _p1, ILInt32 _p2, ILObject * _p3, System_Array * _p4,
ILObject * _p5);
! extern ILObject * _IL_ClrMethod_GetBaseDefinition(ILExecThread * _thread,
ILObject * _this);
extern ILInt32 _IL_ClrType_GetClrArrayRank(ILExecThread * _thread, ILObject *
_this);
***************
*** 338,390 ****
extern ILObject * _IL_ClrType_GetGenericType(ILExecThread * _thread, ILObject
* _this);
- extern ILObject * _IL_ClrConstructor_Invoke(ILExecThread * _thread, ILObject
* _this, ILInt32 _p1, ILObject * _p2, System_Array * _p3, ILObject * _p4);
-
- extern ILObject * _IL_ClrField_GetFieldType(ILExecThread * _thread,
ILNativeInt _p1);
- extern ILObject * _IL_ClrField_GetValue(ILExecThread * _thread, ILObject *
_this, ILObject * _p1);
- extern void _IL_ClrField_SetValue(ILExecThread * _thread, ILObject * _this,
ILObject * _p1, ILObject * _p2, ILInt32 _p3, ILObject * _p4, ILObject * _p5);
- extern ILObject * _IL_ClrField_GetValueDirect(ILExecThread * _thread,
ILObject * _this, ILTypedRef _p1);
- extern void _IL_ClrField_SetValueDirect(ILExecThread * _thread, ILObject *
_this, ILTypedRef _p1, ILObject * _p2);
-
- extern ILBool _IL_ClrHelpers_CanAccess(ILExecThread * _thread, ILNativeInt
_p1);
- extern ILInt32 _IL_ClrHelpers_GetMemberAttrs(ILExecThread * _thread,
ILNativeInt _p1);
- extern ILObject * _IL_ClrHelpers_GetSemantics(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILBool _p3);
- extern ILString * _IL_ClrHelpers_GetName(ILExecThread * _thread, ILNativeInt
_p1);
- extern ILInt32 _IL_ClrHelpers_GetNumParameters(ILExecThread * _thread,
ILNativeInt _p1);
- extern ILInt32 _IL_ClrHelpers_GetCallConv(ILExecThread * _thread, ILNativeInt
_p1);
- extern ILInt32 _IL_ClrHelpers_GetImplAttrs(ILExecThread * _thread,
ILNativeInt _p1);
- extern System_Array * _IL_ClrHelpers_GetCustomAttributes(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2, ILBool _p3);
- extern ILBool _IL_ClrHelpers_IsDefined(ILExecThread * _thread, ILNativeInt
_p1, ILNativeInt _p2, ILBool _p3);
- extern ILNativeInt _IL_ClrHelpers_GetDeclaringType(ILExecThread * _thread,
ILNativeInt _p1);
- extern ILNativeInt _IL_ClrHelpers_GetParameter(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
- extern ILObject * _IL_ClrHelpers_GetParameterType(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
- extern ILBool _IL_ClrHelpers_HasSemantics(ILExecThread * _thread, ILNativeInt
_p1, ILInt32 _p2, ILBool _p3);
-
- extern ILObject * _IL_ClrMethod_Invoke(ILExecThread * _thread, ILObject *
_this, ILObject * _p1, ILInt32 _p2, ILObject * _p3, System_Array * _p4,
ILObject * _p5);
- extern ILObject * _IL_ClrMethod_GetBaseDefinition(ILExecThread * _thread,
ILObject * _this);
-
- extern ILObject * _IL_ClrProperty_GetPropertyType(ILExecThread * _thread,
ILNativeInt _p1);
-
extern ILInt32 _IL_ClrParameter_GetParamAttrs(ILExecThread * _thread,
ILNativeInt _p1);
extern ILString * _IL_ClrParameter_GetParamName(ILExecThread * _thread,
ILNativeInt _p1);
extern ILObject * _IL_ClrParameter_GetDefault(ILExecThread * _thread,
ILNativeInt _p1);
extern ILInt32 _IL_ClrResourceStream_ResourceRead(ILExecThread * _thread,
ILNativeInt _p1, ILInt64 _p2, System_Array * _p3, ILInt32 _p4, ILInt32 _p5);
extern ILInt32 _IL_ClrResourceStream_ResourceReadByte(ILExecThread * _thread,
ILNativeInt _p1, ILInt64 _p2);
extern ILUInt8 * _IL_ClrResourceStream_ResourceGetAddress(ILExecThread *
_thread, ILNativeInt _p1, ILInt64 _p2);
! extern ILNativeInt _IL_TypeBuilder_ClrTypeCreate(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2, ILString * _p3, ILString * _p4, ILInt32 _p5,
void * _p6);
! extern void _IL_TypeBuilder_ClrTypeSetPackingSize(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
! extern void _IL_TypeBuilder_ClrTypeSetClassSize(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
! extern void _IL_TypeBuilder_ClrTypeAddInterface(ILExecThread * _thread,
ILNativeInt _p1, void * _p2);
! extern ILInt32 _IL_TypeBuilder_ClrTypeGetPackingSize(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILInt32 _IL_TypeBuilder_ClrTypeGetClassSize(ILExecThread * _thread,
ILNativeInt _p1);
! extern void _IL_TypeBuilder_ClrTypeAddOverride(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3);
! extern void _IL_TypeBuilder_ClrTypeSetParent(ILExecThread * _thread,
ILNativeInt _p1, void * _p2);
! extern ILInt32 _IL_TypeBuilder_ClrTypeImport(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
! extern ILInt32 _IL_TypeBuilder_ClrTypeImportMember(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
- extern ILInt32 _IL_AssemblyBuilder_ClrGetItemToken(ILExecThread * _thread,
ILNativeInt _p1);
extern ILNativeInt _IL_AssemblyBuilder_ClrAssemblyCreate(ILExecThread *
_thread, ILString * _p1, ILInt32 _p2, ILInt32 _p3, ILInt32 _p4, ILInt32 _p5,
ILInt32 _p6, ILNativeInt * writer);
extern void _IL_AssemblyBuilder_ClrSetEntryPoint(ILExecThread * _thread,
ILObject * _this, ILNativeInt _p1, ILInt32 _p2);
extern ILNativeInt _IL_AssemblyBuilder_ClrGetItemFromToken(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2);
--- 357,380 ----
extern ILObject * _IL_ClrType_GetGenericType(ILExecThread * _thread, ILObject
* _this);
extern ILInt32 _IL_ClrParameter_GetParamAttrs(ILExecThread * _thread,
ILNativeInt _p1);
extern ILString * _IL_ClrParameter_GetParamName(ILExecThread * _thread,
ILNativeInt _p1);
extern ILObject * _IL_ClrParameter_GetDefault(ILExecThread * _thread,
ILNativeInt _p1);
+ extern ILObject * _IL_ClrProperty_GetPropertyType(ILExecThread * _thread,
ILNativeInt _p1);
+
extern ILInt32 _IL_ClrResourceStream_ResourceRead(ILExecThread * _thread,
ILNativeInt _p1, ILInt64 _p2, System_Array * _p3, ILInt32 _p4, ILInt32 _p5);
extern ILInt32 _IL_ClrResourceStream_ResourceReadByte(ILExecThread * _thread,
ILNativeInt _p1, ILInt64 _p2);
extern ILUInt8 * _IL_ClrResourceStream_ResourceGetAddress(ILExecThread *
_thread, ILNativeInt _p1, ILInt64 _p2);
! extern ILObject * _IL_Module_GetAssembly(ILExecThread * _thread, ILObject *
_this);
! extern ILObject * _IL_Module_GetModuleType(ILExecThread * _thread, ILObject *
_this);
! extern ILString * _IL_Module_GetFullName(ILExecThread * _thread, ILObject *
_this);
! extern ILObject * _IL_Module_GetType(ILExecThread * _thread, ILObject *
_this, ILString * _p1, ILBool _p2, ILBool _p3);
! extern System_Array * _IL_Module_GetTypes(ILExecThread * _thread, ILObject *
_this);
! extern ILBool _IL_Module_IsResource(ILExecThread * _thread, ILObject * _this);
extern ILNativeInt _IL_AssemblyBuilder_ClrAssemblyCreate(ILExecThread *
_thread, ILString * _p1, ILInt32 _p2, ILInt32 _p3, ILInt32 _p4, ILInt32 _p5,
ILInt32 _p6, ILNativeInt * writer);
extern void _IL_AssemblyBuilder_ClrSetEntryPoint(ILExecThread * _thread,
ILObject * _this, ILNativeInt _p1, ILInt32 _p2);
+ extern ILInt32 _IL_AssemblyBuilder_ClrGetItemToken(ILExecThread * _thread,
ILNativeInt _p1);
extern ILNativeInt _IL_AssemblyBuilder_ClrGetItemFromToken(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2);
***************
*** 392,406 ****
extern void _IL_EventBuilder_ClrEventAddSemantics(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, void * _p3);
- extern ILNativeInt _IL_FieldBuilder_ClrFieldCreate(ILExecThread * _thread,
ILNativeInt _p1, ILString * _p2, ILNativeInt _p3, ILInt32 _p4);
- extern void _IL_FieldBuilder_ClrFieldSetRVA(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
extern void _IL_FieldBuilder_ClrFieldSetConstant(ILExecThread * _thread,
ILNativeInt _p1, ILObject * _p2);
extern void _IL_FieldBuilder_ClrFieldSetMarshal(ILExecThread * _thread,
ILNativeInt _p1, System_Array * _p2);
extern void _IL_FieldBuilder_ClrFieldSetOffset(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
- extern void _IL_MethodBuilder_ClrMethodAddPInvoke(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILString * _p3, ILString * _p4);
- extern void _IL_MethodBuilder_ClrMethodSetRVA(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
extern ILNativeInt _IL_MethodBuilder_ClrMethodCreate(ILExecThread * _thread,
ILNativeInt _p1, ILString * _p2, ILInt32 _p3, ILNativeInt _p4);
extern void _IL_MethodBuilder_ClrMethodSetImplAttrs(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
extern ILInt32 _IL_MethodBuilder_ClrMethodCreateVarArgRef(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2, ILNativeInt _p3);
extern ILInt32 _IL_ModuleBuilder_ClrModuleWriteData(ILExecThread * _thread,
ILNativeInt _p1, System_Array * _p2);
--- 382,396 ----
extern void _IL_EventBuilder_ClrEventAddSemantics(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, void * _p3);
extern void _IL_FieldBuilder_ClrFieldSetConstant(ILExecThread * _thread,
ILNativeInt _p1, ILObject * _p2);
+ extern ILNativeInt _IL_FieldBuilder_ClrFieldCreate(ILExecThread * _thread,
ILNativeInt _p1, ILString * _p2, ILNativeInt _p3, ILInt32 _p4);
extern void _IL_FieldBuilder_ClrFieldSetMarshal(ILExecThread * _thread,
ILNativeInt _p1, System_Array * _p2);
extern void _IL_FieldBuilder_ClrFieldSetOffset(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
+ extern void _IL_FieldBuilder_ClrFieldSetRVA(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
extern ILNativeInt _IL_MethodBuilder_ClrMethodCreate(ILExecThread * _thread,
ILNativeInt _p1, ILString * _p2, ILInt32 _p3, ILNativeInt _p4);
extern void _IL_MethodBuilder_ClrMethodSetImplAttrs(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
+ extern void _IL_MethodBuilder_ClrMethodSetRVA(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
extern ILInt32 _IL_MethodBuilder_ClrMethodCreateVarArgRef(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2, ILNativeInt _p3);
+ extern void _IL_MethodBuilder_ClrMethodAddPInvoke(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILString * _p3, ILString * _p4);
extern ILInt32 _IL_ModuleBuilder_ClrModuleWriteData(ILExecThread * _thread,
ILNativeInt _p1, System_Array * _p2);
***************
*** 409,416 ****
--- 399,415 ----
extern ILInt32 _IL_ModuleBuilder_ClrModuleCreateString(ILExecThread *
_thread, ILNativeInt _p1, ILString * _p2);
+ extern ILNativeInt _IL_ParameterBuilder_ClrParameterCreate(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3, ILString * _p4);
+ extern ILInt32 _IL_ParameterBuilder_ClrParameterGetPosition(ILExecThread *
_thread, ILNativeInt _p1);
+ extern ILInt32 _IL_ParameterBuilder_ClrParameterGetAttrs(ILExecThread *
_thread, ILNativeInt _p1);
+ extern ILString * _IL_ParameterBuilder_ClrParameterGetName(ILExecThread *
_thread, ILNativeInt _p1);
+
extern ILNativeInt _IL_PropertyBuilder_ClrPropertyCreate(ILExecThread *
_thread, ILNativeInt _p1, ILString * _p2, ILInt32 _p3, ILNativeInt _p4);
extern void _IL_PropertyBuilder_ClrPropertyAddSemantics(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2, void * _p3);
extern ILNativeInt _IL_SignatureHelper_ClrSigCreateMethod(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2, ILNativeInt _p3);
+ extern ILNativeInt _IL_SignatureHelper_ClrSigCreateLocal(ILExecThread *
_thread, ILNativeInt _p1);
+ extern ILBool _IL_SignatureHelper_ClrSigAddArgument(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2, ILNativeInt _p3);
+ extern ILNativeInt _IL_SignatureHelper_ClrSigCreateMethodCopy(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2, ILInt32 _p3);
+ extern ILBool _IL_SignatureHelper_ClrSigAddSentinel(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
extern ILNativeInt _IL_SignatureHelper_ClrSigCreateProperty(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2);
extern ILNativeInt _IL_SignatureHelper_ClrSigModuleToContext(ILExecThread *
_thread, ILNativeInt _p1);
***************
*** 422,437 ****
extern ILNativeInt _IL_SignatureHelper_ClrSigCreateClass(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2);
extern ILNativeInt _IL_SignatureHelper_ClrSigCreateField(ILExecThread *
_thread, ILNativeInt _p1);
- extern ILNativeInt _IL_SignatureHelper_ClrSigCreateLocal(ILExecThread *
_thread, ILNativeInt _p1);
- extern ILBool _IL_SignatureHelper_ClrSigAddArgument(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2, ILNativeInt _p3);
- extern ILNativeInt _IL_SignatureHelper_ClrSigCreateMethodCopy(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2, ILInt32 _p3);
- extern ILBool _IL_SignatureHelper_ClrSigAddSentinel(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
extern ILBool _IL_SignatureHelper_ClrSigIdentical(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
extern ILInt32 _IL_SignatureHelper_ClrSigGetHashCode(ILExecThread * _thread,
ILNativeInt _p1);
extern System_Array * _IL_SignatureHelper_ClrSigGetBytes(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2);
! extern ILNativeInt _IL_ParameterBuilder_ClrParameterCreate(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3, ILString * _p4);
! extern ILInt32 _IL_ParameterBuilder_ClrParameterGetPosition(ILExecThread *
_thread, ILNativeInt _p1);
! extern ILInt32 _IL_ParameterBuilder_ClrParameterGetAttrs(ILExecThread *
_thread, ILNativeInt _p1);
! extern ILString * _IL_ParameterBuilder_ClrParameterGetName(ILExecThread *
_thread, ILNativeInt _p1);
extern ILInt32 _IL_CultureInfo_InternalCultureID(ILExecThread * _thread);
--- 421,438 ----
extern ILNativeInt _IL_SignatureHelper_ClrSigCreateClass(ILExecThread *
_thread, ILNativeInt _p1, ILInt32 _p2);
extern ILNativeInt _IL_SignatureHelper_ClrSigCreateField(ILExecThread *
_thread, ILNativeInt _p1);
extern ILBool _IL_SignatureHelper_ClrSigIdentical(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
extern ILInt32 _IL_SignatureHelper_ClrSigGetHashCode(ILExecThread * _thread,
ILNativeInt _p1);
extern System_Array * _IL_SignatureHelper_ClrSigGetBytes(ILExecThread *
_thread, ILNativeInt _p1, ILNativeInt _p2);
! extern ILInt32 _IL_TypeBuilder_ClrTypeImportMember(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
! extern ILInt32 _IL_TypeBuilder_ClrTypeImport(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2);
! extern ILNativeInt _IL_TypeBuilder_ClrTypeCreate(ILExecThread * _thread,
ILNativeInt _p1, ILNativeInt _p2, ILString * _p3, ILString * _p4, ILInt32 _p5,
void * _p6);
! extern void _IL_TypeBuilder_ClrTypeSetPackingSize(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
! extern void _IL_TypeBuilder_ClrTypeSetClassSize(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
! extern void _IL_TypeBuilder_ClrTypeAddInterface(ILExecThread * _thread,
ILNativeInt _p1, void * _p2);
! extern ILInt32 _IL_TypeBuilder_ClrTypeGetPackingSize(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILInt32 _IL_TypeBuilder_ClrTypeGetClassSize(ILExecThread * _thread,
ILNativeInt _p1);
! extern void _IL_TypeBuilder_ClrTypeAddOverride(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3);
! extern void _IL_TypeBuilder_ClrTypeSetParent(ILExecThread * _thread,
ILNativeInt _p1, void * _p2);
extern ILInt32 _IL_CultureInfo_InternalCultureID(ILExecThread * _thread);
***************
*** 451,501 ****
extern ILInt32 _IL_StackFrame_InternalGetTotalFrames(ILExecThread * _thread);
extern ILString * _IL_DirMethods_GetSystemDirectory(ILExecThread * _thread);
extern System_Array * _IL_DirMethods_GetLogicalDrives(ILExecThread * _thread);
extern ILString * _IL_DirMethods_GetCurrentDirectory(ILExecThread * _thread);
! extern void _IL_DirMethods_GetPathInfo(ILExecThread * _thread, void *
_result);
extern ILInt32 _IL_DirMethods_Delete(ILExecThread * _thread, ILString * _p1);
extern ILInt32 _IL_DirMethods_GetCreationTime(ILExecThread * _thread,
ILString * _p1, ILInt64 * create_time);
extern ILInt32 _IL_DirMethods_GetLastAccess(ILExecThread * _thread, ILString
* _p1, ILInt64 * lastac);
extern ILInt32 _IL_DirMethods_GetLastModification(ILExecThread * _thread,
ILString * _p1, ILInt64 * last_mod);
- extern ILInt32 _IL_DirMethods_ChangeDirectory(ILExecThread * _thread,
ILString * _p1);
extern ILInt32 _IL_DirMethods_Rename(ILExecThread * _thread, ILString * _p1,
ILString * _p2);
extern ILInt32 _IL_DirMethods_CreateDirectory(ILExecThread * _thread,
ILString * _p1);
! extern ILInt32 _IL_DirMethods_GetFilesInDirectory(ILExecThread * _thread,
ILString * _p1, System_Array * * files);
extern ILInt32 _IL_DirMethods_Copy(ILExecThread * _thread, ILString * _p1,
ILString * _p2);
- extern void _IL_Stdio_StdClose(ILExecThread * _thread, ILInt32 _p1);
- extern ILInt32 _IL_Stdio_StdPeek(ILExecThread * _thread, ILInt32 _p1);
- extern ILInt32 _IL_Stdio_StdRead_i(ILExecThread * _thread, ILInt32 _p1);
- extern ILInt32 _IL_Stdio_StdRead_iacii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
- extern void _IL_Stdio_StdFlush(ILExecThread * _thread, ILInt32 _p1);
- extern ILInt32 _IL_Stdio_StdRead_iaBii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
- extern void _IL_Stdio_StdWrite_iaBii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
- extern void _IL_Stdio_StdWrite_ic(ILExecThread * _thread, ILInt32 _p1,
ILUInt16 _p2);
- extern void _IL_Stdio_StdWrite_iacii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
- extern void _IL_Stdio_StdWrite_iString(ILExecThread * _thread, ILInt32 _p1,
ILString * _p2);
-
- extern ILDouble _IL_SysCharInfo_GetNumericValue(ILExecThread * _thread,
ILUInt16 _p1);
- extern ILInt32 _IL_SysCharInfo_GetUnicodeCategory(ILExecThread * _thread,
ILUInt16 _p1);
- extern ILString * _IL_SysCharInfo_GetNewLine(ILExecThread * _thread);
-
- extern void _IL_TaskMethods_Exit(ILExecThread * _thread, ILInt32 _p1);
- extern void _IL_TaskMethods_SetExitCode(ILExecThread * _thread, ILInt32 _p1);
- extern System_Array * _IL_TaskMethods_GetCommandLineArgs(ILExecThread *
_thread);
- extern ILString * _IL_TaskMethods_GetEnvironmentVariable(ILExecThread *
_thread, ILString * _p1);
- extern ILInt32 _IL_TaskMethods_GetEnvironmentCount(ILExecThread * _thread);
- extern ILString * _IL_TaskMethods_GetEnvironmentKey(ILExecThread * _thread,
ILInt32 _p1);
- extern ILString * _IL_TaskMethods_GetEnvironmentValue(ILExecThread * _thread,
ILInt32 _p1);
-
- extern ILInt32 _IL_TimeMethods_GetTimeZoneAdjust(ILExecThread * _thread,
ILInt64 _p1);
- extern ILInt64 _IL_TimeMethods_GetCurrentTime(ILExecThread * _thread);
- extern ILInt64 _IL_TimeMethods_GetCurrentUtcTime(ILExecThread * _thread);
- extern ILInt32 _IL_TimeMethods_GetUpTime(ILExecThread * _thread);
- extern ILString * _IL_TimeMethods_GetDaylightName(ILExecThread * _thread);
- extern ILString * _IL_TimeMethods_GetStandardName(ILExecThread * _thread);
- extern ILBool _IL_TimeMethods_GetDaylightRules(ILExecThread * _thread,
ILInt32 _p1, ILInt64 * start, ILInt64 * end, ILInt64 * delta);
-
- extern ILString * _IL_FileMethods_GetErrnoMessage(ILExecThread * _thread,
ILInt32 _p1);
extern ILBool _IL_FileMethods_ValidatePathname(ILExecThread * _thread,
ILString * _p1);
extern ILBool _IL_FileMethods_Open(ILExecThread * _thread, ILString * _p1,
ILInt32 _p2, ILInt32 _p3, ILInt32 _p4, ILNativeInt * handle);
extern ILInt32 _IL_FileMethods_GetErrno(ILExecThread * _thread);
--- 452,504 ----
extern ILInt32 _IL_StackFrame_InternalGetTotalFrames(ILExecThread * _thread);
+ extern void _IL_CryptoMethods_Decrypt(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2, ILInt32 _p3, System_Array * _p4, ILInt32 _p5);
+ extern void _IL_CryptoMethods_Encrypt(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2, ILInt32 _p3, System_Array * _p4, ILInt32 _p5);
+ extern ILNativeInt _IL_CryptoMethods_EncryptCreate(ILExecThread * _thread,
ILInt32 _p1, System_Array * _p2);
+ extern ILNativeInt _IL_CryptoMethods_DecryptCreate(ILExecThread * _thread,
ILInt32 _p1, System_Array * _p2);
+ extern void _IL_CryptoMethods_SymmetricFree(ILExecThread * _thread,
ILNativeInt _p1);
+ extern ILBool _IL_CryptoMethods_IsSemiWeakKey(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2);
+ extern ILBool _IL_CryptoMethods_IsWeakKey(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2);
+ extern ILBool _IL_CryptoMethods_AlgorithmSupported(ILExecThread * _thread,
ILInt32 _p1);
+ extern void _IL_CryptoMethods_GenerateRandom(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILInt32 _p3);
+ extern System_Array * _IL_CryptoMethods_GetKey(ILExecThread * _thread,
ILInt32 _p1, ILString * _p2, ILInt32 _p3, ILInt32 * result);
+ extern System_Array * _IL_CryptoMethods_NumPow(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
+ extern System_Array * _IL_CryptoMethods_NumMod(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2);
+ extern System_Array * _IL_CryptoMethods_NumInv(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2);
+ extern System_Array * _IL_CryptoMethods_NumMul(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
+ extern System_Array * _IL_CryptoMethods_NumAdd(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
+ extern ILBool _IL_CryptoMethods_NumZero(ILExecThread * _thread, System_Array
* _p1);
+ extern ILBool _IL_CryptoMethods_NumEq(ILExecThread * _thread, System_Array *
_p1, System_Array * _p2);
+ extern ILNativeInt _IL_CryptoMethods_HashNew(ILExecThread * _thread, ILInt32
_p1);
+ extern void _IL_CryptoMethods_HashReset(ILExecThread * _thread, ILNativeInt
_p1);
+ extern void _IL_CryptoMethods_HashFree(ILExecThread * _thread, ILNativeInt
_p1);
+ extern void _IL_CryptoMethods_HashUpdate(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
+ extern void _IL_CryptoMethods_HashFinal(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2);
+ extern System_Array * _IL_CryptoMethods_NumSub(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
+ extern ILBool _IL_CryptoMethods_SameKey(ILExecThread * _thread, System_Array
* _p1, ILInt32 _p2, System_Array * _p3, ILInt32 _p4);
+ extern void _IL_CryptoMethods_StoreKey(ILExecThread * _thread, ILInt32 _p1,
ILString * _p2, System_Array * _p3);
+
extern ILString * _IL_DirMethods_GetSystemDirectory(ILExecThread * _thread);
extern System_Array * _IL_DirMethods_GetLogicalDrives(ILExecThread * _thread);
extern ILString * _IL_DirMethods_GetCurrentDirectory(ILExecThread * _thread);
! extern ILInt32 _IL_DirMethods_ChangeDirectory(ILExecThread * _thread,
ILString * _p1);
! extern ILInt32 _IL_DirMethods_GetFilesInDirectory(ILExecThread * _thread,
ILString * _p1, System_Array * * files);
extern ILInt32 _IL_DirMethods_Delete(ILExecThread * _thread, ILString * _p1);
extern ILInt32 _IL_DirMethods_GetCreationTime(ILExecThread * _thread,
ILString * _p1, ILInt64 * create_time);
extern ILInt32 _IL_DirMethods_GetLastAccess(ILExecThread * _thread, ILString
* _p1, ILInt64 * lastac);
extern ILInt32 _IL_DirMethods_GetLastModification(ILExecThread * _thread,
ILString * _p1, ILInt64 * last_mod);
extern ILInt32 _IL_DirMethods_Rename(ILExecThread * _thread, ILString * _p1,
ILString * _p2);
extern ILInt32 _IL_DirMethods_CreateDirectory(ILExecThread * _thread,
ILString * _p1);
! extern void _IL_DirMethods_GetPathInfo(ILExecThread * _thread, void *
_result);
extern ILInt32 _IL_DirMethods_Copy(ILExecThread * _thread, ILString * _p1,
ILString * _p2);
extern ILBool _IL_FileMethods_ValidatePathname(ILExecThread * _thread,
ILString * _p1);
+ extern ILInt32 _IL_FileMethods_GetFileType(ILExecThread * _thread, ILString *
_p1);
+ extern ILInt32 _IL_FileMethods_SetCreationTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
+ extern ILInt32 _IL_FileMethods_SetLastAccessTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
+ extern ILInt32 _IL_FileMethods_SetLastWriteTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
+ extern ILString * _IL_FileMethods_GetErrnoMessage(ILExecThread * _thread,
ILInt32 _p1);
+ extern ILInt32 _IL_FileMethods_GetAttributes(ILExecThread * _thread, ILString
* _p1, ILInt32 * attrs);
+ extern ILInt32 _IL_FileMethods_SetAttributes(ILExecThread * _thread, ILString
* _p1, ILInt32 _p2);
+ extern ILInt32 _IL_FileMethods_GetLength(ILExecThread * _thread, ILString *
_p1, ILInt64 * length);
extern ILBool _IL_FileMethods_Open(ILExecThread * _thread, ILString * _p1,
ILInt32 _p2, ILInt32 _p3, ILInt32 _p4, ILNativeInt * handle);
extern ILInt32 _IL_FileMethods_GetErrno(ILExecThread * _thread);
***************
*** 509,528 ****
extern ILBool _IL_FileMethods_SetLength(ILExecThread * _thread, ILNativeInt
_p1, ILInt64 _p2);
extern ILNativeInt _IL_FileMethods_GetInvalidHandle(ILExecThread * _thread);
- extern ILInt32 _IL_FileMethods_GetFileType(ILExecThread * _thread, ILString *
_p1);
- extern ILInt32 _IL_FileMethods_SetCreationTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
- extern ILInt32 _IL_FileMethods_SetLastAccessTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
- extern ILInt32 _IL_FileMethods_SetLastWriteTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
- extern ILInt32 _IL_FileMethods_GetAttributes(ILExecThread * _thread, ILString
* _p1, ILInt32 * attrs);
- extern ILInt32 _IL_FileMethods_SetAttributes(ILExecThread * _thread, ILString
* _p1, ILInt32 _p2);
- extern ILInt32 _IL_FileMethods_GetLength(ILExecThread * _thread, ILString *
_p1, ILInt64 * length);
extern ILBool _IL_FileMethods_HasAsync(ILExecThread * _thread);
extern ILInt32 _IL_FileMethods_Copy(ILExecThread * _thread, ILString * _p1,
ILString * _p2);
- extern ILBool _IL_RuntimeSecurityManager_CanUseFileHandle(ILExecThread *
_thread, ILObject * _this, ILNativeInt _p1);
- extern ILBool _IL_RuntimeSecurityManager_CanOpenFile(ILExecThread * _thread,
ILObject * _this, ILString * _p1, ILInt32 _p2, ILInt32 _p3, ILInt32 _p4);
-
- extern ILObject * _IL_Security_GetSecurityManager(ILExecThread * _thread);
- extern void _IL_Security_SetSecurityManager(ILExecThread * _thread, ILObject
* _p1);
-
extern ILString * _IL_InfoMethods_GetRuntimeVersion(ILExecThread * _thread);
extern ILString * _IL_InfoMethods_GetNetBIOSMachineName(ILExecThread *
_thread);
--- 512,518 ----
***************
*** 540,581 ****
extern ILNativeInt _IL_RegexpMethods_CompileInternal(ILExecThread * _thread,
ILString * _p1, ILInt32 _p2);
! extern ILBool _IL_CryptoMethods_IsSemiWeakKey(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2);
! extern ILBool _IL_CryptoMethods_IsWeakKey(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2);
! extern ILNativeInt _IL_CryptoMethods_EncryptCreate(ILExecThread * _thread,
ILInt32 _p1, System_Array * _p2);
! extern ILNativeInt _IL_CryptoMethods_DecryptCreate(ILExecThread * _thread,
ILInt32 _p1, System_Array * _p2);
! extern void _IL_CryptoMethods_SymmetricFree(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILNativeInt _IL_CryptoMethods_HashNew(ILExecThread * _thread, ILInt32
_p1);
! extern void _IL_CryptoMethods_HashReset(ILExecThread * _thread, ILNativeInt
_p1);
! extern void _IL_CryptoMethods_HashFree(ILExecThread * _thread, ILNativeInt
_p1);
! extern void _IL_CryptoMethods_HashUpdate(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
! extern void _IL_CryptoMethods_HashFinal(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2);
! extern ILBool _IL_CryptoMethods_AlgorithmSupported(ILExecThread * _thread,
ILInt32 _p1);
! extern void _IL_CryptoMethods_GenerateRandom(ILExecThread * _thread,
System_Array * _p1, ILInt32 _p2, ILInt32 _p3);
! extern ILBool _IL_CryptoMethods_SameKey(ILExecThread * _thread, System_Array
* _p1, ILInt32 _p2, System_Array * _p3, ILInt32 _p4);
! extern System_Array * _IL_CryptoMethods_GetKey(ILExecThread * _thread,
ILInt32 _p1, ILString * _p2, ILInt32 _p3, ILInt32 * result);
! extern System_Array * _IL_CryptoMethods_NumPow(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
! extern System_Array * _IL_CryptoMethods_NumMod(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2);
! extern System_Array * _IL_CryptoMethods_NumInv(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2);
! extern System_Array * _IL_CryptoMethods_NumMul(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
! extern System_Array * _IL_CryptoMethods_NumAdd(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
! extern ILBool _IL_CryptoMethods_NumZero(ILExecThread * _thread, System_Array
* _p1);
! extern ILBool _IL_CryptoMethods_NumEq(ILExecThread * _thread, System_Array *
_p1, System_Array * _p2);
! extern System_Array * _IL_CryptoMethods_NumSub(ILExecThread * _thread,
System_Array * _p1, System_Array * _p2, System_Array * _p3);
! extern void _IL_CryptoMethods_Decrypt(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2, ILInt32 _p3, System_Array * _p4, ILInt32 _p5);
! extern void _IL_CryptoMethods_Encrypt(ILExecThread * _thread, ILNativeInt
_p1, System_Array * _p2, ILInt32 _p3, System_Array * _p4, ILInt32 _p5);
! extern void _IL_CryptoMethods_StoreKey(ILExecThread * _thread, ILInt32 _p1,
ILString * _p2, System_Array * _p3);
! extern ILInt32 _IL_Process_GetHandleCount(ILExecThread * _thread, ILNativeInt
_p1);
! extern ILNativeInt _IL_Process_GetMainWindowHandle(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILString * _IL_Process_GetMainWindowTitle(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILInt32 _IL_Process_GetProcessorAffinity(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILBool _IL_Process_MainWindowIsResponding(ILExecThread * _thread,
ILNativeInt _p1);
! extern void _IL_Process_CloseProcess(ILExecThread * _thread, ILNativeInt _p1,
ILInt32 _p2);
! extern ILBool _IL_Process_CloseMainWindow(ILExecThread * _thread, ILNativeInt
_p1);
! extern void _IL_Process_GetCurrentProcessInfo(ILExecThread * _thread, ILInt32
* processID, ILNativeInt * handle);
! extern void _IL_Process_KillProcess(ILExecThread * _thread, ILNativeInt _p1,
ILInt32 _p2);
! extern ILBool _IL_Process_StartProcess(ILExecThread * _thread, ILString *
_p1, ILString * _p2, System_Array * _p3, ILInt32 _p4, ILInt32 _p5, System_Array
* _p6, ILString * _p7, ILNativeInt _p8, ILNativeInt * processHandle, ILInt32 *
processID, ILNativeInt * stdinHandle, ILNativeInt * stdoutHandle, ILNativeInt *
stderrHandle);
! extern ILBool _IL_Process_WaitForExit(ILExecThread * _thread, ILNativeInt
_p1, ILInt32 _p2, ILInt32 _p3, ILInt32 * exitCode);
! extern ILBool _IL_Process_WaitForInputIdle(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3);
extern ILNativeInt _IL_SocketMethods_GetInvalidHandle(ILExecThread * _thread);
--- 530,569 ----
extern ILNativeInt _IL_RegexpMethods_CompileInternal(ILExecThread * _thread,
ILString * _p1, ILInt32 _p2);
! extern ILBool _IL_RuntimeSecurityManager_CanUseFileHandle(ILExecThread *
_thread, ILObject * _this, ILNativeInt _p1);
! extern ILBool _IL_RuntimeSecurityManager_CanOpenFile(ILExecThread * _thread,
ILObject * _this, ILString * _p1, ILInt32 _p2, ILInt32 _p3, ILInt32 _p4);
! extern ILObject * _IL_Security_GetSecurityManager(ILExecThread * _thread);
! extern void _IL_Security_SetSecurityManager(ILExecThread * _thread, ILObject
* _p1);
!
! extern void _IL_Stdio_StdClose(ILExecThread * _thread, ILInt32 _p1);
! extern ILInt32 _IL_Stdio_StdPeek(ILExecThread * _thread, ILInt32 _p1);
! extern ILInt32 _IL_Stdio_StdRead_i(ILExecThread * _thread, ILInt32 _p1);
! extern ILInt32 _IL_Stdio_StdRead_iacii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
! extern void _IL_Stdio_StdFlush(ILExecThread * _thread, ILInt32 _p1);
! extern ILInt32 _IL_Stdio_StdRead_iaBii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
! extern void _IL_Stdio_StdWrite_iaBii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
! extern void _IL_Stdio_StdWrite_ic(ILExecThread * _thread, ILInt32 _p1,
ILUInt16 _p2);
! extern void _IL_Stdio_StdWrite_iacii(ILExecThread * _thread, ILInt32 _p1,
System_Array * _p2, ILInt32 _p3, ILInt32 _p4);
! extern void _IL_Stdio_StdWrite_iString(ILExecThread * _thread, ILInt32 _p1,
ILString * _p2);
!
! extern ILDouble _IL_SysCharInfo_GetNumericValue(ILExecThread * _thread,
ILUInt16 _p1);
! extern ILInt32 _IL_SysCharInfo_GetUnicodeCategory(ILExecThread * _thread,
ILUInt16 _p1);
! extern ILString * _IL_SysCharInfo_GetNewLine(ILExecThread * _thread);
!
! extern void _IL_TaskMethods_Exit(ILExecThread * _thread, ILInt32 _p1);
! extern void _IL_TaskMethods_SetExitCode(ILExecThread * _thread, ILInt32 _p1);
! extern System_Array * _IL_TaskMethods_GetCommandLineArgs(ILExecThread *
_thread);
! extern ILString * _IL_TaskMethods_GetEnvironmentVariable(ILExecThread *
_thread, ILString * _p1);
! extern ILInt32 _IL_TaskMethods_GetEnvironmentCount(ILExecThread * _thread);
! extern ILString * _IL_TaskMethods_GetEnvironmentKey(ILExecThread * _thread,
ILInt32 _p1);
! extern ILString * _IL_TaskMethods_GetEnvironmentValue(ILExecThread * _thread,
ILInt32 _p1);
!
! extern ILInt32 _IL_TimeMethods_GetTimeZoneAdjust(ILExecThread * _thread,
ILInt64 _p1);
! extern ILInt64 _IL_TimeMethods_GetCurrentTime(ILExecThread * _thread);
! extern ILInt64 _IL_TimeMethods_GetCurrentUtcTime(ILExecThread * _thread);
! extern ILInt32 _IL_TimeMethods_GetUpTime(ILExecThread * _thread);
! extern ILString * _IL_TimeMethods_GetDaylightName(ILExecThread * _thread);
! extern ILString * _IL_TimeMethods_GetStandardName(ILExecThread * _thread);
! extern ILBool _IL_TimeMethods_GetDaylightRules(ILExecThread * _thread,
ILInt32 _p1, ILInt64 * start, ILInt64 * end, ILInt64 * delta);
extern ILNativeInt _IL_SocketMethods_GetInvalidHandle(ILExecThread * _thread);
***************
*** 610,613 ****
--- 598,604 ----
extern void _IL_SocketMethods_WaitHandleSet(ILExecThread * _thread, ILObject
* _p1);
+ extern ILBool _IL_Dns_InternalGetHostByName(ILExecThread * _thread, ILString
* _p1, ILString * * h_name, System_Array * * h_aliases, System_Array * *
h_addr_list);
+ extern ILBool _IL_Dns_InternalGetHostByAddr(ILExecThread * _thread, ILInt64
_p1, ILString * * h_name, System_Array * * h_aliases, System_Array * *
h_addr_list);
+
extern ILInt32 _IL_IPAddress_HostToNetworkOrder_i(ILExecThread * _thread,
ILInt32 _p1);
extern ILInt32 _IL_IPAddress_NetworkToHostOrder_i(ILExecThread * _thread,
ILInt32 _p1);
***************
*** 617,621 ****
extern ILInt16 _IL_IPAddress_NetworkToHostOrder_s(ILExecThread * _thread,
ILInt16 _p1);
! extern ILBool _IL_Dns_InternalGetHostByName(ILExecThread * _thread, ILString
* _p1, ILString * * h_name, System_Array * * h_aliases, System_Array * *
h_addr_list);
! extern ILBool _IL_Dns_InternalGetHostByAddr(ILExecThread * _thread, ILInt64
_p1, ILString * * h_name, System_Array * * h_aliases, System_Array * *
h_addr_list);
--- 608,622 ----
extern ILInt16 _IL_IPAddress_NetworkToHostOrder_s(ILExecThread * _thread,
ILInt16 _p1);
! extern ILInt32 _IL_Process_GetHandleCount(ILExecThread * _thread, ILNativeInt
_p1);
! extern ILNativeInt _IL_Process_GetMainWindowHandle(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILString * _IL_Process_GetMainWindowTitle(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILInt32 _IL_Process_GetProcessorAffinity(ILExecThread * _thread,
ILNativeInt _p1);
! extern ILBool _IL_Process_MainWindowIsResponding(ILExecThread * _thread,
ILNativeInt _p1);
! extern void _IL_Process_CloseProcess(ILExecThread * _thread, ILNativeInt _p1,
ILInt32 _p2);
! extern ILBool _IL_Process_CloseMainWindow(ILExecThread * _thread, ILNativeInt
_p1);
! extern void _IL_Process_GetCurrentProcessInfo(ILExecThread * _thread, ILInt32
* processID, ILNativeInt * handle);
! extern void _IL_Process_KillProcess(ILExecThread * _thread, ILNativeInt _p1,
ILInt32 _p2);
! extern ILBool _IL_Process_StartProcess(ILExecThread * _thread, ILString *
_p1, ILString * _p2, System_Array * _p3, ILInt32 _p4, ILInt32 _p5, System_Array
* _p6, ILString * _p7, ILNativeInt _p8, ILNativeInt * processHandle, ILInt32 *
processID, ILNativeInt * stdinHandle, ILNativeInt * stdoutHandle, ILNativeInt *
stderrHandle);
! extern ILBool _IL_Process_WaitForExit(ILExecThread * _thread, ILNativeInt
_p1, ILInt32 _p2, ILInt32 _p3, ILInt32 * exitCode);
! extern ILBool _IL_Process_WaitForInputIdle(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3);
Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -r1.66 -r1.67
*** int_table.c 21 Jun 2003 02:57:05 -0000 1.66
--- int_table.c 26 Jun 2003 03:39:25 -0000 1.67
***************
*** 254,257 ****
--- 254,334 ----
#if !defined(HAVE_LIBFFI)
+ static void marshal_bp(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *))fn)(*((void *
*)(avalue[0])));
+ }
+
+ #endif
+
[...2112 lines suppressed...]
#endif
! #ifndef _IL_Process_suppressed
! IL_METHOD_BEGIN(Process_Methods)
! IL_METHOD("GetHandleCount", "(j)i", _IL_Process_GetHandleCount,
marshal_ipj)
! IL_METHOD("GetMainWindowHandle", "(j)j",
_IL_Process_GetMainWindowHandle, marshal_jpj)
! IL_METHOD("GetMainWindowTitle", "(j)oSystem.String;",
_IL_Process_GetMainWindowTitle, marshal_ppj)
! IL_METHOD("GetProcessorAffinity", "(j)i",
_IL_Process_GetProcessorAffinity, marshal_ipj)
! IL_METHOD("MainWindowIsResponding", "(j)Z",
_IL_Process_MainWindowIsResponding, marshal_bpj)
! IL_METHOD("CloseProcess", "(ji)V", _IL_Process_CloseProcess,
marshal_vpji)
! IL_METHOD("CloseMainWindow", "(j)Z", _IL_Process_CloseMainWindow,
marshal_bpj)
! IL_METHOD("GetCurrentProcessInfo", "(&i&j)V",
_IL_Process_GetCurrentProcessInfo, marshal_vppp)
! IL_METHOD("KillProcess", "(ji)V", _IL_Process_KillProcess, marshal_vpji)
! IL_METHOD("StartProcess",
"(oSystem.String;oSystem.String;[oSystem.String;ii[oSystem.String;oSystem.String;j&j&i&j&j&j)Z",
_IL_Process_StartProcess, marshal_bppppiippjppppp)
! IL_METHOD("WaitForExit", "(jii&i)Z", _IL_Process_WaitForExit,
marshal_bpjiip)
! IL_METHOD("WaitForInputIdle", "(jii)Z", _IL_Process_WaitForInputIdle,
marshal_bpjii)
IL_METHOD_END
Index: cvm_inline.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_inline.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** cvm_inline.c 24 Feb 2003 00:45:59 -0000 1.12
--- cvm_inline.c 26 Jun 2003 03:39:25 -0000 1.13
***************
*** 350,354 ****
{
/* Enter a monitor on an object */
! /* TODO: waiting for thread support to be completed */
MODIFY_PC_AND_STACK(CVMP_LEN_NONE, -1);
}
--- 350,357 ----
{
/* Enter a monitor on an object */
! /* TODO: Actually make it fully inline :) */
!
! _IL_Monitor_Enter(thread, (ILObject *)stacktop[-1].ptrValue);
!
MODIFY_PC_AND_STACK(CVMP_LEN_NONE, -1);
}
***************
*** 379,383 ****
{
/* Exit a monitor on an object */
! /* TODO: waiting for thread support to be completed */
MODIFY_PC_AND_STACK(CVMP_LEN_NONE, -1);
}
--- 382,389 ----
{
/* Exit a monitor on an object */
! /* TODO: Actually make it fully inline :) */
!
! _IL_Monitor_Exit(thread, (ILObject *)stacktop[-1].ptrValue);
!
MODIFY_PC_AND_STACK(CVMP_LEN_NONE, -1);
}
Index: engine.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/engine.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -r1.73 -r1.74
*** engine.h 2 Jun 2003 06:55:16 -0000 1.73
--- engine.h 26 Jun 2003 03:39:25 -0000 1.74
***************
*** 21,25 ****
#ifndef _ENGINE_ENGINE_H
#define _ENGINE_ENGINE_H
-
#include "il_thread.h"
#include "il_engine.h"
--- 21,24 ----
***************
*** 126,129 ****
--- 125,139 ----
void *internHash;
+ #ifdef USE_HASHING_MONITORS
+ /* Hash table that contains all monitors */
+ void *monitorHash;
+ ILMutex *monitorSystemLock;
+ #endif
+
+ int userThreadCount;
+
+ /* WaitEvent that gets set when the last non-main thread is destroyed */
+ ILWaitHandle *noMoreUserThreads;
+
/* Hash table that maps program items to reflection objects */
void *reflectionHash;
***************
*** 205,209 ****
CVMWord *stackTop; /* Current stack top */
ILMethod *method; /* Current method being
executed */
!
/* Last exception that was thrown */
ILObject *thrownException;
--- 215,219 ----
CVMWord *stackTop; /* Current stack top */
ILMethod *method; /* Current method being
executed */
!
/* Last exception that was thrown */
ILObject *thrownException;
***************
*** 212,215 ****
--- 222,231 ----
ILObject *securityManager;
+ /* System.Threading.Thread object */
+ ILObject *clrThread;
+
+ /* Free monitors list */
+ ILExecMonitor *freeMonitor;
+
/* Stack of call frames in use */
ILCallFrame *frameStack;
***************
*** 217,220 ****
--- 233,240 ----
ILUInt32 maxFrames;
+ /* 1 if the thread is a user (non runtime) thread. User threads keep
the
+ process from exiting until they finish */
+ ILUInt32 isUserThread;
+
/* Thread-static values for this thread */
void **threadStaticSlots;
***************
*** 257,260 ****
--- 277,304 ----
};
+ typedef void * ILLockWord;
+
+ struct _tagILExecMonitor
+ {
+ ILWaitHandle *supportMonitor;
+ volatile ILInt32 waiters;
+ ILExecMonitor *next;
+ };
+
+ /*
+ * Header of an object.
+ */
+ typedef struct _tagObjectHeader ILObjectHeader;
+
+ struct _tagObjectHeader
+ {
+ ILClassPrivate *classPrivate;
+ #ifdef USE_HASHING_MONITORS
+ /* NOTHING */
+ #else
+ ILLockWord lockWord;
+ #endif
+ };
+
/*
* Class information for the CVM coder.
***************
*** 320,324 ****
* responsible for creating the OS-level thread.
*/
! ILExecThread *_ILExecThreadCreate(ILExecProcess *process);
/*
--- 364,368 ----
* responsible for creating the OS-level thread.
*/
! ILExecThread *_ILExecThreadCreate(ILExecProcess *process, int userThread);
/*
***************
*** 570,573 ****
--- 614,632 ----
const char *customName,
int customNameLen,
const char
*customCookie, int customCookieLen);
+
+ /*
+ * Gets the current managed thread object from an engine thread.
+ */
+ ILObject *_ILGetCurrentClrThread(ILExecThread *thread);
+
+ /*
+ * Creates a monitor used by the execution engine.
+ */
+ ILExecMonitor *ILExecMonitorCreate();
+
+ /*
+ * Destroys a monitor used by the execution engine.
+ */
+ void ILExecMonitorDestory(ILExecMonitor *monitor);
#ifdef __cplusplus
Index: heap.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/heap.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** heap.c 2 Jun 2003 06:55:16 -0000 1.15
--- heap.c 26 Jun 2003 03:39:25 -0000 1.16
***************
*** 20,23 ****
--- 20,24 ----
#include "engine_private.h"
+ #include "lib_defs.h"
#ifdef __cplusplus
***************
*** 67,76 ****
ILMethod *method;
ILType *signature;
!
/* Skip the object header within the block */
! object = (ILObject *)(((unsigned char *)block) + IL_BEST_ALIGNMENT);
/* Get the object's class and locate the "Finalize" method */
! classInfo = (*((ILClassPrivate **)block))->classInfo;
while(classInfo != 0)
{
--- 68,91 ----
ILMethod *method;
ILType *signature;
!
/* Skip the object header within the block */
! object = GetObjectFromGcBase(block);
/* Get the object's class and locate the "Finalize" method */
! classInfo = GetObjectClass(object);
!
! if (ILExecThreadCurrent() == 0)
! {
! /* The thread the finalizer is running on can't execute managed
code */
!
! fprintf
! (
! stderr, "GC: Finalizer thread [0x%x] can't
execute managed code.\n",
! (int)ILThreadSelf()
! );
!
! return;
! }
!
while(classInfo != 0)
{
***************
*** 102,105 ****
--- 117,121 ----
{
void *ptr;
+ ILObject *obj;
/* Make sure the class has been initialized before we start */
***************
*** 110,114 ****
/* Allocate memory from the heap */
! ptr = ILGCAlloc(size + IL_BEST_ALIGNMENT);
if(!ptr)
{
--- 126,130 ----
/* Allocate memory from the heap */
! ptr = ILGCAlloc(size + IL_OBJECT_HEADER_SIZE);
if(!ptr)
{
***************
*** 118,129 ****
}
/* Set the class into the block */
if(classInfo)
{
! *((ILClassPrivate **)ptr) = (ILClassPrivate
*)(classInfo->userData);
}
else
{
! *((ILClassPrivate **)ptr) = 0;
}
--- 134,147 ----
}
+ obj = GetObjectFromGcBase(ptr);
+
/* Set the class into the block */
if(classInfo)
{
! SetObjectClassPrivate(obj, (ILClassPrivate
*)(classInfo->userData));
}
else
{
! SetObjectClassPrivate(obj, 0);
}
***************
*** 136,141 ****
}
! /* Return a pointer to the data just after the class information */
! return (void *)(((unsigned char *)ptr) + IL_BEST_ALIGNMENT);
}
--- 154,159 ----
}
! /* Return a pointer to the object */
! return obj;
}
***************
*** 144,147 ****
--- 162,166 ----
{
void *ptr;
+ ILObject *obj;
/* Make sure the class has been initialized before we start */
***************
*** 152,156 ****
/* Allocate memory from the heap */
! ptr = ILGCAllocAtomic(size + IL_BEST_ALIGNMENT);
if(!ptr)
{
--- 171,175 ----
/* Allocate memory from the heap */
! ptr = ILGCAllocAtomic(size + IL_OBJECT_HEADER_SIZE);
if(!ptr)
{
***************
*** 159,175 ****
return 0;
}
/* Set the class into the block */
if(classInfo)
{
! *((ILClassPrivate **)ptr) = (ILClassPrivate
*)(classInfo->userData);
}
else
{
! *((ILClassPrivate **)ptr) = 0;
}
! /* Return a pointer to the data just after the class information */
! return (void *)(((unsigned char *)ptr) + IL_BEST_ALIGNMENT);
}
--- 178,196 ----
return 0;
}
+
+ obj = GetObjectFromGcBase(ptr);
/* Set the class into the block */
if(classInfo)
{
! SetObjectClassPrivate(obj, (ILClassPrivate
*)(classInfo->userData));
}
else
{
! SetObjectClassPrivate(obj, 0);
}
! /* Return a pointer to the object */
! return obj;
}
Index: ilrun.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/ilrun.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** ilrun.c 22 Jun 2003 17:43:57 -0000 1.33
--- ilrun.c 26 Jun 2003 03:39:25 -0000 1.34
***************
*** 433,436 ****
--- 433,439 ----
}
+ /* Wait for all other threads to finish */
+ ILExecProcessWaitForUserThreads(process);
+
#if !defined(IL_CONFIG_REDUCE_CODE) && !defined(IL_WITHOUT_TOOLS)
/* Print profile information if requested */
Index: lib_defs.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_defs.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** lib_defs.h 2 Jun 2003 06:55:16 -0000 1.21
--- lib_defs.h 26 Jun 2003 03:39:25 -0000 1.22
***************
*** 23,26 ****
--- 23,27 ----
#include "il_decimal.h"
+ #include "engine.h"
#ifdef __cplusplus
***************
*** 29,42 ****
/*
! * Get the ILClassPrivate information that is associated with
! * a non-null object.
*/
! #define GetObjectClassPrivate(obj) \
! (*((ILClassPrivate **)(((unsigned char *)(obj)) - IL_BEST_ALIGNMENT)))
/*
! * Get the class that is associated with a non-null object.
*/
#define GetObjectClass(obj)
((GetObjectClassPrivate((obj)))->classInfo)
/*
--- 30,141 ----
/*
! * Comment from Thong Nguyen (address@hidden)
! *
! * New object layout is like this:
! *
! * [Object Header][Managed Object Data]
! * ^ ^
! * | |
! * | |____ILObject
! * |
! * |_____GcBase & Start of ObjectHeader
! *
! *
! * Use GetMemPtr or GetObjectHeader to get the GcBase/ObjectHeader
! * from an (ILObject *).
! *
! * Use GetObjectFromGcBase from get an (ILObject *) from a (void *).
! */
!
! /*
! * The size of the object header in bytes.
! */
! #define IL_OBJECT_HEADER_SIZE \
! ((sizeof(ILObjectHeader) + IL_BEST_ALIGNMENT - 1) & ~(IL_BEST_ALIGNMENT
- 1))
!
! /*
! * Gets a pointer to the object header from an object pointer.
! */
! #define GetObjectHeader(obj) \
! (((ILObjectHeader *)(((unsigned char *)(obj)) - IL_OBJECT_HEADER_SIZE)))
!
! /*
! * Gets a pointer to the start of an object's memory.
! * (Same as GetObjectHeader since the header is the first thing in memory)
! */
! #define GetObjectGcBase(obj) \
! ((void *)GetObjectHeader(obj))
!
! /*
! * Gets an object pointer from a pointer to the object's first byte of
memory.
*/
! #define GetObjectFromGcBase(ptr) \
! ((ILObject *)(((unsigned char *)ptr) + IL_OBJECT_HEADER_SIZE))
/*
! * Gets a pointer to the ILClassPrivate information that is associated with
! * a non-null object.
*/
+ #define GetObjectClassPrivate(obj) \
+ (GetObjectHeader(obj)->classPrivate)
+
+ #define SetObjectClassPrivate(obj, value) \
+ (GetObjectHeader(obj)->classPrivate) = value;
+
+ /*
+ * Get the class that is associated with a non-null object.
+ */
#define GetObjectClass(obj)
((GetObjectClassPrivate((obj)))->classInfo)
+
+ /* The GC guarantees that blocks are allocated on 4 byteboundaries
+ These MARK macros can be used to attach & query flags on each
+ monitor pointer. */
+
+ #define IL_LW_MARKED(raw) \
+ (((unsigned int)raw & 1) == 1)
+
+ #define IL_LW_MARK(raw) \
+ ((ILLockWord)(((int)raw | 1)))
+
+ #define IL_LW_UNMARK(raw) \
+ ((ILLockWord)(((int)raw & ~1)))
+
+ #define GetObjectMonitor(thread, obj) \
+ ((ILExecMonitor *)(IL_LW_UNMARK(GetObjectLockWord(thread, obj))))
+
+ #ifdef USE_HASHING_MONITORS
+
+ /*
+ * Gets a pointer to the WaitHandle object used by the object.
+ */
+ ILLockWord CompareAndExchangeObjectLockWord
+ (ILExecThread *thread, ILObject *obj, ILLockWord value,
ILLockWord comparand);
+
+ /*
+ * Gets the LockWord for the object.
+ */
+ ILLockWord GetObjectLockWord(ILExecThread *thread, ILObject *obj);
+
+ #else
+ /*
+ * Classic monitor tags are stored in the object header.
+ */
+
+ #define GetObjectLockWord(thread, obj) \
+ (GetObjectHeader(obj)->lockWord)
+
+ #define SetObjectLockWord(thread, ob, value) \
+ GetObjectHeader(obj)->lockWord = value;
+
+ #define GetObjectLockWordPtr(thread, obj) \
+ (&(GetObjectLockWord(thread, obj)))
+
+ #define CompareAndExchangeObjectLockWord(thread, obj, value, comparand)
\
+
(ILLockWord)((_IL_Interlocked_CompareExchange_RObjectObjectObject \
+ (thread, (ILObject **)GetObjectLockWordPtr(thread,
obj), (ILObject *)value, (ILObject *)comparand)))
+
+ #endif
+
+ ILObject *_ILGetCurrentClrThread(ILExecThread *thread);
/*
Index: lib_gc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_gc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** lib_gc.c 6 Nov 2002 22:48:56 -0000 1.5
--- lib_gc.c 26 Jun 2003 03:39:25 -0000 1.6
***************
*** 49,53 ****
{
ILGCRegisterFinalizer
! ((void *)(((unsigned char *)obj) -
IL_BEST_ALIGNMENT),
_ILFinalizeObject, (void *)0);
}
--- 49,53 ----
{
ILGCRegisterFinalizer
! (GetObjectGcBase(obj),
_ILFinalizeObject, (void *)0);
}
***************
*** 67,72 ****
{
ILGCRegisterFinalizer
! ((void *)(((unsigned char *)obj) - IL_BEST_ALIGNMENT),
! (ILGCFinalizer)0, (void *)0);
}
else
--- 67,71 ----
{
ILGCRegisterFinalizer
! (GetObjectGcBase(obj), (ILGCFinalizer)0, (void *)0);
}
else
***************
*** 80,84 ****
*/
void _IL_GC_WaitForPendingFinalizers(ILExecThread *_thread)
! {
ILGCInvokeFinalizers();
}
--- 79,83 ----
*/
void _IL_GC_WaitForPendingFinalizers(ILExecThread *_thread)
! {
ILGCInvokeFinalizers();
}
***************
*** 173,178 ****
else
{
! object = (ILObject *)(((unsigned char *)ptr) +
!
IL_BEST_ALIGNMENT);
}
}
--- 172,176 ----
else
{
! object = GetObjectFromGcBase(ptr);
}
}
***************
*** 199,203 ****
if(value)
{
! ptr = (void *)(((unsigned char *)value) - IL_BEST_ALIGNMENT);
}
else
--- 197,201 ----
if(value)
{
! ptr = GetObjectGcBase(value);
}
else
***************
*** 398,402 ****
else
{
! object = (ILObject *)(((unsigned char *)ptr) +
IL_BEST_ALIGNMENT);
}
}
--- 396,400 ----
else
{
! object = GetObjectFromGcBase(ptr);
}
}
***************
*** 417,421 ****
if(value)
{
! ptr = (void *)(((unsigned char *)value) - IL_BEST_ALIGNMENT);
}
else
--- 415,419 ----
if(value)
{
! ptr = GetObjectGcBase(value);
}
else
Index: lib_thread.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_thread.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** lib_thread.c 24 Apr 2003 06:00:43 -0000 1.10
--- lib_thread.c 26 Jun 2003 03:39:25 -0000 1.11
***************
*** 4,7 ****
--- 4,9 ----
* Copyright (C) 2001, 2002 Southern Storm Software, Pty Ltd.
*
+ * Contributions from Thong Nguyen <address@hidden>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
***************
*** 26,45 ****
#endif
[...975 lines suppressed...]
- */
- #define IL_MAX_WAIT_HANDLES 64
/*
--- 1375,1389 ----
/* Allocate an instance of
"ThreadAbortException" and throw */
/* TODO */
+
+ ILExecThreadThrowSystem
+ (
+ thread,
+
"System.Threading.ThreadAbortException",
+ (const char *)0
+ );
}
}
}
}
/*
Index: process.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/process.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** process.c 22 Jun 2003 17:16:44 -0000 1.46
--- process.c 26 Jun 2003 03:39:25 -0000 1.47
***************
*** 27,35 ****
void ILExecInit(unsigned long maxSize)
{
! /* Initialize the global garbage collector */
! ILGCInit(maxSize);
! /* Initialize the thread routines */
ILThreadInit();
}
--- 27,43 ----
void ILExecInit(unsigned long maxSize)
{
! /* Tum changed init order because the GC needs threading support */
! /* Initialize the thread routines */
ILThreadInit();
+
+ /* Initialize the global garbage collector */
+ ILGCInit(maxSize);
+ }
+
+ void ILExecProcessWaitForUserThreads(ILExecProcess *process)
+ {
+ /* Wait for all user threads to finish */
+ ILWaitOne(process->noMoreUserThreads, -1);
}
***************
*** 44,52 ****
return 0;
}
-
/* Initialize the fields */
process->lock = 0;
process->firstThread = 0;
process->mainThread = 0;
process->stackSize = ((stackSize < IL_CONFIG_STACK_SIZE)
? IL_CONFIG_STACK_SIZE
: stackSize);
--- 52,63 ----
return 0;
}
/* Initialize the fields */
process->lock = 0;
process->firstThread = 0;
process->mainThread = 0;
+ process->userThreadCount = 0;
+ #ifdef USE_HASHING_MONITORS
+ process->monitorHash = 0;
+ #endif
process->stackSize = ((stackSize < IL_CONFIG_STACK_SIZE)
? IL_CONFIG_STACK_SIZE
: stackSize);
***************
*** 80,83 ****
--- 91,102 ----
process->numThreadStaticSlots = 0;
+ /* Create a new event that indicates when there are more no user
threads */
+ /* The event is initially set */
+ if ((process->noMoreUserThreads = ILWaitEventCreate(1, 1)) == 0)
+ {
+ ILExecProcessDestroy(process);
+ return 0;
+ }
+
/* Initialize the image loading context */
if((process->context = ILContextCreate()) == 0)
***************
*** 103,106 ****
--- 122,135 ----
}
+ #ifdef USE_HASHING_MONITORS
+ /* Initialize the monitor system lock */
+ process->monitorSystemLock = ILMutexCreate();
+ if(!(process->monitorSystemLock))
+ {
+ ILExecProcessDestroy(process);
+ return 0;
+ }
+ #endif
+
/* Initialize the metadata lock */
process->metadataLock = ILRWLockCreate();
***************
*** 111,116 ****
}
! /* Create the "main" thread */
! process->mainThread = _ILExecThreadCreate(process);
if(!(process->mainThread))
{
--- 140,146 ----
}
! /* Register the main thread for managed execution */
! process->mainThread = ILThreadRegisterForManagedExecution(process,
ILThreadSelf(), 0);
!
if(!(process->mainThread))
{
***************
*** 118,124 ****
return 0;
}
! process->mainThread->osThread = ILThreadSelf();
! ILThreadSetObject(process->mainThread->osThread, process->mainThread);
!
/* Initialize the random seed pool lock */
process->randomLock = ILMutexCreate();
--- 148,152 ----
return 0;
}
!
/* Initialize the random seed pool lock */
process->randomLock = ILMutexCreate();
***************
*** 139,142 ****
--- 167,173 ----
ILGCInvokeFinalizers();
+ /* Tell the GC we're history */
+ ILGCDeinit();
+
/* Destroy the threads associated with the process */
while(process->firstThread != 0)
***************
*** 148,151 ****
--- 179,185 ----
ILCoderDestroy(process->coder);
+ /* Destroy the NoMoreUserThreads wait event */
+ ILWaitHandleClose(process->noMoreUserThreads);
+
/* Destroy the metadata lock */
if(process->metadataLock)
***************
*** 213,216 ****
--- 247,255 ----
ILMutexDestroy(process->randomLock);
ILMemZero(process->randomPool, sizeof(process->randomPool));
+
+ #ifdef USE_HASHING_MONITORS
+ /* Destroy the monitor system lock */
+ ILMutexDestroy(process->monitorSystemLock);
+ #endif
/* Destroy the object lock */
Index: thread.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/thread.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** thread.c 18 Apr 2003 09:15:52 -0000 1.15
--- thread.c 26 Jun 2003 03:39:25 -0000 1.16
***************
*** 4,7 ****
--- 4,9 ----
* Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
+ * Contributions from Thong Nguyen <address@hidden>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
***************
*** 30,34 ****
}
! ILExecThread *_ILExecThreadCreate(ILExecProcess *process)
{
ILExecThread *thread;
--- 32,92 ----
}
! /*
! * Gets the current CLR thread.
! */
! ILObject *_ILGetCurrentClrThread(ILExecThread *thread)
! {
! ILClass *classInfo;
! ILObject *clrThread;
!
! if (thread->clrThread == NULL)
! {
! /*
! * Main thread or another thread created from inside the engine.
! */
!
! /* Get the CLR thread class */
!
! classInfo = ILExecThreadLookupClass(thread,
"System.Threading.Thread");
!
! /* Allocate the CLR thread object */
!
! clrThread = _ILEngineAllocObject(thread, classInfo);
!
! /* Assocaite the CLR thread object with the OS thread */
!
! *((ILThread **)clrThread) = ILThreadSelf();
!
! /* Associate the executing thread with the CLR thread */
! thread->clrThread = clrThread;
!
! return clrThread;
! }
! else
! {
! return thread->clrThread;
! }
! }
!
! /*
! * Registers a thread for managed execution
! */
! ILExecThread *ILThreadRegisterForManagedExecution(ILExecProcess *process,
ILThread *thread, int isUserThread)
! {
! ILExecThread *execThread;
!
! /* Create a new engine-level thread */
! execThread = _ILExecThreadCreate(process, isUserThread);
!
! /* Associate the new engine-level thread with the OS-level thread */
! ILThreadSetObject(thread, execThread);
!
! /* Associate the OS-level thread with the new engine-level thread */
! execThread->osThread = thread;
!
! return execThread;
! }
!
! ILExecThread *_ILExecThreadCreate(ILExecProcess *process, int isUserThread)
{
ILExecThread *thread;
***************
*** 64,67 ****
--- 122,128 ----
/* Initialize the thread state */
thread->osThread = 0;
+ thread->clrThread = 0;
+ thread->freeMonitor = 0;
+ thread->isUserThread = isUserThread;
thread->pc = 0;
thread->frame = thread->stackBase;
***************
*** 83,86 ****
--- 144,159 ----
}
process->firstThread = thread;
+
+ if (isUserThread)
+ {
+ process->userThreadCount++;
+ }
+
+ if (process->userThreadCount > 0)
+ {
+ /* Prevent the process from exiting */
+ ILWaitEventReset(process->noMoreUserThreads);
+ }
+
ILMutexUnlock(process->lock);
***************
*** 89,101 ****
}
- ILExecThread *ILExecThreadCreate(ILExecProcess *process)
- {
- ILExecThread *thread = _ILExecThreadCreate(process);
- /* TODO: initialize underlying the OS thread */
- return thread;
- }
-
void ILExecThreadDestroy(ILExecThread *thread)
{
ILExecProcess *process = thread->process;
--- 162,168 ----
}
void ILExecThreadDestroy(ILExecThread *thread)
{
+ ILExecMonitor *monitor, *next;
ILExecProcess *process = thread->process;
***************
*** 107,110 ****
--- 174,200 ----
{
process->mainThread = 0;
+ }
+
+ /* Decrement the use thread count */
+ if (thread->isUserThread)
+ {
+ process->userThreadCount--;
+ }
+
+ /* Let the main process exit */
+ if (process->userThreadCount == 0)
+ {
+ ILWaitEventSet(process->noMoreUserThreads);
+ }
+
+ /* Delete the free monitors list */
+
+ monitor = thread->freeMonitor;
+
+ while (monitor)
+ {
+ next = monitor->next;
+ ILExecMonitorDestroy(monitor);
+ monitor = next;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine monitor.c,NONE,1.1 int_proto.h,1.64,1.65 int_table.c,1.66,1.67 cvm_inline.c,1.12,1.13 engine.h,1.73,1.74 heap.c,1.15,1.16 ilrun.c,1.33,1.34 lib_defs.h,1.21,1.22 lib_gc.c,1.5,1.6 lib_thread.c,1.10,1.11 process.c,1.46,1.47 thread.c,1.15,1.16,
Gopal.V <address@hidden> <=