dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. a918a85ac6f0a32c6485752b13150ed6170fd1c0
Date: Fri, 07 Jan 2011 16:00:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".

The branch, master has been updated
       via  a918a85ac6f0a32c6485752b13150ed6170fd1c0 (commit)
      from  b71672f3244561f517ee616f41247a432c8f4b62 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=a918a85ac6f0a32c6485752b13150ed6170fd1c0

commit a918a85ac6f0a32c6485752b13150ed6170fd1c0
Author: Klaus Treichel <address@hidden>
Date:   Fri Jan 7 16:58:53 2011 +0100

    Fix interpreter on arm and some other optimizations.

diff --git a/ChangeLog b/ChangeLog
index 340dc20..ce9221c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,21 @@
 
        * engine/cvm.c, engine/cvm_interrupts.c: Do some reformatting.
 
-       * engine/cvm_call.c, engine/cvm_except.c: Pop the current jump buffer
-       if interrupt based exceptions are used on exit from the interpreter.
+       * engine/cvm_call.c: Pop the current jump buffer if interrupt based
+       exceptions are used on exit from the interpreter.
+       Jump to the new label in cvm_except in the case of a thrown exception
+       in RESTORE_STATE_FROM_THREAD now.
+
+       * engine/cvm_except.c: Pop the current jump buffer if interrupt based
+       exceptions are used on exit from the interpreter.
+       Add a jump label for the case theh the exception is allready in
+       thread->thrownException.
+       Refine some comments.
+
+       * engine/cvm_config.h: Remove the memory clobber in the
+       CVM_BREAK_BARRIER for x86_64.
+       Add a missing clobber of ARM_WORK (r12) to the CVM_BREAK_BARRIER for
+       arm.
 
 2011-01-06  Klaus Treichel  <address@hidden>
 
diff --git a/engine/cvm_call.c b/engine/cvm_call.c
index 77d536c..d4d828f 100644
--- a/engine/cvm_call.c
+++ b/engine/cvm_call.c
@@ -158,7 +158,7 @@ ILCallFrame *_ILAllocCallFrame(ILExecThread *thread)
 #define        ALLOC_CALL_FRAME()      \
                        do { \
                                REPORT_METHOD_CALL(); \
-                               if(thread->numFrames < thread->maxFrames) \
+                               if(IL_EXPECT(thread->numFrames < 
thread->maxFrames, 1)) \
                                { \
                                        callFrame = 
&(thread->frameStack[(thread->numFrames)++]); \
                                } \
@@ -167,7 +167,7 @@ ILCallFrame *_ILAllocCallFrame(ILExecThread *thread)
                                        BEGIN_NATIVE_CALL(); \
                                        callFrame = _ILAllocCallFrame(thread); \
                                        END_NATIVE_CALL(); \
-                                       if(!callFrame) \
+                                       if(IL_EXPECT(!callFrame, 0)) \
                                        { \
                                                STACK_OVERFLOW_EXCEPTION(); \
                                        } \
@@ -177,6 +177,7 @@ ILCallFrame *_ILAllocCallFrame(ILExecThread *thread)
 /*
  * Restore state information from the thread, except the pc.
  */
+#ifdef IL_DUMP_CVM
 #define        RESTORE_STATE_FROM_THREAD()     \
                        do { \
                                stacktop = thread->stackTop; \
@@ -185,11 +186,22 @@ ILCallFrame *_ILAllocCallFrame(ILExecThread *thread)
                                if(IL_EXPECT(thread->thrownException != 0, 0)) \
                                { \
                                        /* An exception occurred, which we now 
must handle */ \
-                                       tempptr = thread->thrownException; \
-                                       thread->thrownException = 0; \
-                                       goto throwException; \
+                                       goto throwCurrentException; \
                                } \
                        } while (0)
+#else
+#define        RESTORE_STATE_FROM_THREAD()     \
+                       do { \
+                               if(IL_EXPECT(thread->thrownException != 0, 0)) \
+                               { \
+                                       /* An exception occurred, which we now 
must handle */ \
+                                       goto throwCurrentException; \
+                               } \
+                               stacktop = thread->stackTop; \
+                               frame = thread->frame; \
+                               stackmax = thread->stackLimit; \
+                       } while (0)
+#endif
 
 /*
  * Determine the number of stack words that are occupied
diff --git a/engine/cvm_config.h b/engine/cvm_config.h
index bb88fcb..61fea4a 100644
--- a/engine/cvm_config.h
+++ b/engine/cvm_config.h
@@ -303,7 +303,7 @@ extern int _ILCVMInsnCount[];
        #define CVM_REGISTER_ASM_FRAME(x)               register x asm("r15") 
 #if defined(IL_CVM_DIRECT_UNROLLED)
        #define CVM_VMBREAK_BARRIER()   \
-               __asm__ __volatile__ ("" : : : "rax", "rbx", "rcx", "rdx", 
"rsi", "rdi", "memory")
+               __asm__ __volatile__ ("" : : : "rax", "rbx", "rcx", "rdx", 
"rsi", "rdi")
 #endif
 #elif defined(CVM_ARM) && defined(__GNUC__) && !defined(IL_NO_ASM)
 
@@ -313,8 +313,12 @@ extern int _ILCVMInsnCount[];
     #define CVM_REGISTER_ASM_STACK(x)          register x asm ("r5")
     #define CVM_REGISTER_ASM_FRAME(x)          register x asm ("r6")
 #if defined(IL_CVM_DIRECT_UNROLLED)
+       /*
+        * NOTE: The "memory" clobber is only gor optimization purposes with 
gcc 4.4.
+        * It may be removed again if performance is bad with other gcc 
versions.
+        */
        #define CVM_VMBREAK_BARRIER()   \
-               __asm__ __volatile__ ("" : : : "r0", "r1", "r2", "r3", "memory")
+               __asm__ __volatile__ ("" : : : "r0", "r1", "r2", "r3", "r12", 
"memory")
 #endif
 #elif defined(CVM_PPC) && defined(__GNUC__) && !defined(IL_NO_ASM)
 
diff --git a/engine/cvm_except.c b/engine/cvm_except.c
index d179f84..b294a04 100644
--- a/engine/cvm_except.c
+++ b/engine/cvm_except.c
@@ -172,6 +172,7 @@ VMBREAK(COP_RET_JSR);
  */
 VMCASE(COP_PREFIX_THROW):
 {
+       /* Pop the exception object from the stack. */
        --stacktop;
        tempptr = stacktop[0].ptrValue;
        COPY_STATE_TO_THREAD();
@@ -180,8 +181,13 @@ VMCASE(COP_PREFIX_THROW):
         * The exception thrown is expected to be in tempptr.
         */
 throwException:
-       /* Pop the exception object from the stack and store it to the thread. 
*/
+       /* Store the exception to the thread. */
        thread->thrownException = tempptr;
+       /*
+        * Label that we jump to when the exception thrown is allready
+        * stored in the thread's thrownException slot.
+        */
+throwCurrentException:
 #ifdef IL_DUMP_CVM
        fputs("Throw ", IL_DUMP_CVM_STREAM);
        DUMP_STACK();

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   17 +++++++++++++++--
 engine/cvm_call.c   |   22 +++++++++++++++++-----
 engine/cvm_config.h |    8 ++++++--
 engine/cvm_except.c |    8 +++++++-
 4 files changed, 45 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]