[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] pnet ChangeLog engine/cvm_ptr.c engine/heap.c e...
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] pnet ChangeLog engine/cvm_ptr.c engine/heap.c e... |
Date: |
Sun, 07 Jan 2007 16:28:54 +0000 |
CVSROOT: /cvsroot/dotgnu-pnet
Module name: pnet
Changes by: Klaus Treichel <ktreichel> 07/01/07 16:28:54
Modified files:
. : ChangeLog
engine : cvm_ptr.c heap.c jitc_alloc.c
Log message:
2006-01-07 Klaus Treichel <address@hidden>
* engine/heap.c: Add _ILEngineAllocTyped to allocate memory for
objects
with type information if typed allocation is enabled and use
this function
for object allocation.
* engine/cvm_ptr.c: Allocate the memory for the class' static
area with
typed allocation if it is enabled.
* engine/jitc_alloc.c: Handle the case for thin locks correctly
where no
type descriptor is available if thin locks are used.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3400&r2=1.3401
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/cvm_ptr.c?cvsroot=dotgnu-pnet&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/heap.c?cvsroot=dotgnu-pnet&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/jitc_alloc.c?cvsroot=dotgnu-pnet&r1=1.7&r2=1.8
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3400
retrieving revision 1.3401
diff -u -b -r1.3400 -r1.3401
--- ChangeLog 1 Jan 2007 17:09:40 -0000 1.3400
+++ ChangeLog 7 Jan 2007 16:28:53 -0000 1.3401
@@ -1,3 +1,15 @@
+2006-01-07 Klaus Treichel <address@hidden>
+
+ * engine/heap.c: Add _ILEngineAllocTyped to allocate memory for objects
+ with type information if typed allocation is enabled and use this
function
+ for object allocation.
+
+ * engine/cvm_ptr.c: Allocate the memory for the class' static area with
+ typed allocation if it is enabled.
+
+ * engine/jitc_alloc.c: Handle the case for thin locks correctly where no
+ type descriptor is available if thin locks are used.
+
2006-01-01 Klaus Treichel <address@hidden>
* engine/engine.h: Add prototypes for the helper functions to create the
Index: engine/cvm_ptr.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_ptr.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- engine/cvm_ptr.c 17 Dec 2006 10:31:32 -0000 1.49
+++ engine/cvm_ptr.c 7 Jan 2007 16:28:53 -0000 1.50
@@ -2499,9 +2499,26 @@
COPY_STATE_TO_THREAD();
if(((ILClassPrivate *)(classInfo->userData))->managedStatic)
{
+ #ifdef IL_USE_TYPED_ALLOCATION
+ ILNativeInt staticTypeDescriptor =
+ ILGCBuildStaticTypeDescriptor(classInfo, 1);
+
+ if(staticTypeDescriptor)
+ {
+ ((ILClassPrivate *)(classInfo->userData))->staticData =
+ ILGCAllocExplicitlyTyped(((ILClassPrivate
*)(classInfo->userData))->staticSize,
+
staticTypeDescriptor);
+ }
+ else
+ {
+ ((ILClassPrivate *)(classInfo->userData))->staticData =
+ ILGCAlloc(((ILClassPrivate
*)(classInfo->userData))->staticSize);
+ }
+ #else /* !IL_USE_TYPED_ALLOCATION */
((ILClassPrivate *)(classInfo->userData))->staticData =
_ILEngineAlloc(thread, 0,
((ILClassPrivate
*)(classInfo->userData))->staticSize);
+ #endif /* !IL_USE_TYPED_ALLOCATION */
}
else
{
Index: engine/heap.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/heap.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- engine/heap.c 23 Aug 2005 10:45:52 -0000 1.27
+++ engine/heap.c 7 Jan 2007 16:28:53 -0000 1.28
@@ -283,8 +283,68 @@
}
}
+#ifdef IL_USE_TYPED_ALLOCATION
+ILObject *_ILEngineAllocTyped(ILExecThread *thread, ILClass *classInfo)
+{
+ void *ptr;
+ ILObject *obj;
+ ILClassPrivate *classPrivate;
+
+ classInfo = ILClassResolve(classInfo);
+
+ /* Make sure the class has been initialized before we start */
+ if(!InitializeClass(thread, classInfo))
+ {
+ return 0;
+ }
+
+ classPrivate = (ILClassPrivate *)(classInfo->userData);
+
+#ifdef IL_CONFIG_USE_THIN_LOCKS
+ /* Allocate memory from the heap */
+ if(classPrivate->gcTypeDescriptor)
+ {
+ ptr = ILGCAllocExplicitlyTyped(classPrivate->size +
IL_OBJECT_HEADER_SIZE,
+
classPrivate->gcTypeDescriptor);
+ }
+ else
+ {
+ /* In case we use thin locks we don't have a type descriptor
for */
+ /* classes not containing any managed fields. */
+ ptr = ILGCAllocAtomic(classPrivate->size +
IL_OBJECT_HEADER_SIZE);
+ }
+#else
+ ptr = ILGCAllocExplicitlyTyped(classPrivate->size +
IL_OBJECT_HEADER_SIZE,
+
classPrivate->gcTypeDescriptor);
+#endif
+ if(!ptr)
+ {
+ /* Throw an "OutOfMemoryException" */
+ thread->thrownException = thread->process->outOfMemoryObject;
+ return 0;
+ }
+
+ obj = GetObjectFromGcBase(ptr);
+
+ SetObjectClassPrivate(obj, classPrivate);
+
+ /* Attach a finalizer to the object if the class has
+ a non-trival finalizer method attached to it */
+ if(classPrivate->hasFinalizer)
+ {
+ ILGCRegisterFinalizer(ptr, _ILFinalizeObject,
thread->process->finalizationContext);
+ }
+
+ /* Return a pointer to the object */
+ return obj;
+}
+#endif /* IL_USE_TYPED_ALLOCATION */
+
ILObject *_ILEngineAllocObject(ILExecThread *thread, ILClass *classInfo)
{
+#ifdef IL_USE_TYPED_ALLOCATION
+ return _ILEngineAllocTyped(thread, classInfo);
+#else /* !IL_USE_TYPED_ALLOCATION */
classInfo = ILClassResolve(classInfo);
if(!InitializeClass(thread, classInfo))
@@ -304,6 +364,7 @@
(thread, classInfo,
((ILClassPrivate
*)(classInfo->userData))->size);
}
+#endif /* !IL_USE_TYPED_ALLOCATION */
}
#ifdef __cplusplus
Index: engine/jitc_alloc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/jitc_alloc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- engine/jitc_alloc.c 1 Jan 2007 17:09:40 -0000 1.7
+++ engine/jitc_alloc.c 7 Jan 2007 16:28:53 -0000 1.8
@@ -132,9 +132,23 @@
void *ptr;
ILObject *obj;
+#ifdef IL_CONFIG_USE_THIN_LOCKS
/* Allocate memory from the heap */
+ if(classPrivate->gcTypeDescriptor)
+ {
+ ptr = ILGCAllocExplicitlyTyped(classPrivate->size +
IL_OBJECT_HEADER_SIZE,
+
classPrivate->gcTypeDescriptor);
+ }
+ else
+ {
+ /* In case we use thin locks we don't have a type descriptor
for */
+ /* classes not containing any managed fields. */
+ ptr = ILGCAllocAtomic(classPrivate->size +
IL_OBJECT_HEADER_SIZE);
+ }
+#else /* !IL_CONFIG_USE_THIN_LOCKS */
ptr = ILGCAllocExplicitlyTyped(classPrivate->size +
IL_OBJECT_HEADER_SIZE,
classPrivate->gcTypeDescriptor);
+#endif /* !IL_CONFIG_USE_THIN_LOCKS */
if(!ptr)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] pnet ChangeLog engine/cvm_ptr.c engine/heap.c e...,
Klaus Treichel <=