[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] pnet ChangeLog engine/cctormgr.c engine/cctormg...
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] pnet ChangeLog engine/cctormgr.c engine/cctormg... |
Date: |
Sat, 17 Feb 2007 14:44:22 +0000 |
CVSROOT: /cvsroot/dotgnu-pnet
Module name: pnet
Changes by: Klaus Treichel <ktreichel> 07/02/17 14:44:21
Modified files:
. : ChangeLog
engine : cctormgr.c cctormgr.h ilrun.c
Log message:
2007-02-17 Klaus Treichel <address@hidden>
* engine/cctormgr.c, engine/cctormgr.h: Handle running needed
class
initializers for methods compiled and locked by an other thread
which
has to be invoked by the current thread which holds the cctor
lock.
* engine/ilrun.c: Remove running the class initializer for the
class
containing main because this is handled by the engine now.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3420&r2=1.3421
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/cctormgr.c?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/cctormgr.h?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/ilrun.c?cvsroot=dotgnu-pnet&r1=1.56&r2=1.57
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3420
retrieving revision 1.3421
diff -u -b -r1.3420 -r1.3421
--- ChangeLog 15 Feb 2007 20:47:32 -0000 1.3420
+++ ChangeLog 17 Feb 2007 14:44:21 -0000 1.3421
@@ -1,4 +1,13 @@
-2007-02.15 Klaus Treichel <address@hidden>
+2007-02-17 Klaus Treichel <address@hidden>
+
+ * engine/cctormgr.c, engine/cctormgr.h: Handle running needed class
+ initializers for methods compiled and locked by an other thread which
+ has to be invoked by the current thread which holds the cctor lock.
+
+ * engine/ilrun.c: Remove running the class initializer for the class
+ containing main because this is handled by the engine now.
+
+2007-02-15 Klaus Treichel <address@hidden>
* engine/jitc_delegate.c: Fix a deadlock introduced with my last cctor
manager change. The functions to lookup the methods *MUST* not lock the
Index: engine/cctormgr.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cctormgr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- engine/cctormgr.c 11 Feb 2007 14:34:32 -0000 1.3
+++ engine/cctormgr.c 17 Feb 2007 14:44:21 -0000 1.4
@@ -42,6 +42,14 @@
} while (0)
/*
+ * Forward declaration.
+ */
+static int _ILCCtorMgr_RunCCtors(ILCCtorMgr *cctorMgr,
+ ILExecThread
*thread,
+ ILClass
*classes[],
+ ILInt32
numClasses);
+
+/*
* Free an ILMethodLockEntry.
*/
static void _ILMethodLockEntry_Destroy(ILMethodLockPool *lockPool,
@@ -111,7 +119,9 @@
*/
static int _ILMethodLockPool_LockMethod(ILMethodLockPool *lockPool,
ILMethod *method,
-
void *userData)
+
void *userData,
+
ILClass *classesToInitialize[],
+
ILInt32 numClassesToInitialize)
{
if(lockPool)
{
@@ -141,6 +151,8 @@
currentLockEntry->method = method;
currentLockEntry->numWaitingThreads = 0;
currentLockEntry->userData = userData;
+ currentLockEntry->classesToInitialize = classesToInitialize;
+ currentLockEntry->numClassesToInitialize =
numClassesToInitialize;
currentLockEntry->nextEntry = lockPool->lastLockedMethod;
lockPool->lastLockedMethod = currentLockEntry;
@@ -276,11 +288,15 @@
else if(cctorMgr->thread ==
thread->supportThread)
{
/* We have to run the cctors queued for
this method. */
- /* TODO */
-
/* Unlock the lock pool. */
ILMutexUnlock(lockPool->lock);
+ /* and execute the cctors queued for
this method. */
+ _ILCCtorMgr_RunCCtors(cctorMgr,
+
thread,
+
currentLockEntry->classesToInitialize,
+
currentLockEntry->numClassesToInitialize);
+
/* And return the userData entry. */
return currentLockEntry->userData;
}
@@ -859,7 +875,9 @@
/* Lock the method. */
if(!_ILMethodLockPool_LockMethod(&(cctorMgr->lockPool),
currentMethod,
-
userData))
+
userData,
+
classes,
+
numQueuedCCtors))
{
/* Unlock the metadata. */
METADATA_UNLOCK(_ILExecThreadProcess(thread));
Index: engine/cctormgr.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cctormgr.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- engine/cctormgr.h 11 Feb 2007 14:34:32 -0000 1.3
+++ engine/cctormgr.h 17 Feb 2007 14:44:21 -0000 1.4
@@ -63,6 +63,12 @@
/* Slot for private use data. */
void *userData;
+
+ /* The classes to initialize before this method can be executed. */
+ ILClass **classesToInitialize;
+
+ /* Number of classes to initialize. */
+ ILInt32 numClassesToInitialize;
};
/*
Index: engine/ilrun.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/ilrun.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- engine/ilrun.c 23 Jan 2007 19:49:02 -0000 1.56
+++ engine/ilrun.c 17 Feb 2007 14:44:21 -0000 1.57
@@ -155,18 +155,6 @@
static void usage(const char *progname);
static void version(void);
-static int CallStaticConstructor(ILExecThread *thread, ILMethod * method)
-{
- ILClass *classInfo=ILMethod_Owner(method);
- ILCoder *coder = _ILExecThreadProcess(thread)->coder;
-
- if(!ILCoderRunCCtor(coder, classInfo))
- {
- return 1;
- }
- return 0;
-}
-
int main(int argc, char *argv[])
{
char *progname = argv[0];
@@ -574,12 +562,9 @@
sawException = 0;
if(args != 0 && !ILExecThreadHasException(thread))
{
- retval = CallStaticConstructor(thread, method);
- sawException = retval;
execValue.ptrValue = args;
ILMemZero(&retValue, sizeof(retValue));
- if(!sawException && ILExecThreadCallV
- (thread, method, &retValue, &execValue))
+ if(ILExecThreadCallV(thread, method, &retValue, &execValue))
{
/* An exception was thrown while executing the program
*/
sawException = 1;