[Top][All Lists]
[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. 6a6da65262a98df19eb1cd269348c89a296ee964 |
Date: |
Sat, 12 Dec 2009 17:03:11 +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 6a6da65262a98df19eb1cd269348c89a296ee964 (commit)
from 9c33568c36a12545007dc0a6046f7cbd14dbaa71 (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=6a6da65262a98df19eb1cd269348c89a296ee964
commit 6a6da65262a98df19eb1cd269348c89a296ee964
Author: Klaus Treichel <address@hidden>
Date: Sat Dec 12 18:02:40 2009 +0100
Emit exception handling code for regions in the verifier only if there are
exception or finally/fault handlers present .
Remove the creation of the label for the 0 offset in the jit coder.
diff --git a/ChangeLog b/ChangeLog
index 8a61b88..b34243e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-12 Klaus Treichel <address@hidden,de>
+
+ * engine/jitc_branch.c (JITCoder_Label): Revert the change from the
+ previous commit.
+
+ * engine/jitc_setup.c (JITCoder_Setup): Don't add the label for the
+ 0 offset anymore.
+
+ * engine/verify.c: Some reformatting.
+
+ * engine/verify_except.c (OutputExceptionTable): Invoke the coder
+ TryHandlerStart, Throw and TryHandlerEnd functions only if there is at
+ least one handler or a finally or fault clause for the region present.
+
2009-12-09 Klaus Treichel <address@hidden,de>
* engine/jitc_branch.c (JITCoder_Label): Don't add the label for offset
diff --git a/engine/jitc_branch.c b/engine/jitc_branch.c
index 3cdd9c4..466f0bb 100755
--- a/engine/jitc_branch.c
+++ b/engine/jitc_branch.c
@@ -58,13 +58,7 @@ static void JITCoder_Label(ILCoder *coder, ILUInt32 offset)
}
#endif
_ILJitLabelRestoreStack(jitCoder, label);
- /*
- * The label for the 0 offset is already inserted
during setup.
- */
- if(offset != 0)
- {
- jit_insn_label(jitCoder->jitFunction,
&(label->label));
- }
+ jit_insn_label(jitCoder->jitFunction, &(label->label));
}
}
}
diff --git a/engine/jitc_setup.c b/engine/jitc_setup.c
index ae8801b..97dcbe0 100755
--- a/engine/jitc_setup.c
+++ b/engine/jitc_setup.c
@@ -27,7 +27,6 @@ static int JITCoder_Setup(ILCoder *_coder, unsigned char
**start,
ILMethod *method,
ILMethodCode *code)
{
ILJITCoder *coder = ((ILJITCoder *)_coder);
- ILJITLabel *label0;
#ifdef IL_DEBUGGER
ILDebugger *debugger;
#endif
@@ -117,10 +116,6 @@ static int JITCoder_Setup(ILCoder *_coder, unsigned char
**start,
/* Reset the isInCatcher flag. */
coder->isInCatcher = 0;
- /* Set the label for the start of the function. */
- label0 = _ILJitLabelGet(coder, 0, _IL_JIT_LABEL_NORMAL);
- jit_insn_label(coder->jitFunction, &(label0->label));
-
return 1;
}
diff --git a/engine/verify.c b/engine/verify.c
index 9041901..7ad68fb 100644
--- a/engine/verify.c
+++ b/engine/verify.c
@@ -974,7 +974,7 @@ restart:
/* Mark the start and end of the try region */
if(exception->tryOffset >= code->codeLen ||
(exception->tryOffset + exception->tryLength) <
- exception->tryOffset || /* Wrap-around check */
+ exception->tryOffset || /* Wrap-around check */
(exception->tryOffset + exception->tryLength) >
code->codeLen)
{
VERIFY_BRANCH_ERROR();
diff --git a/engine/verify_except.c b/engine/verify_except.c
index d0e1643..75166f1 100644
--- a/engine/verify_except.c
+++ b/engine/verify_except.c
@@ -43,6 +43,10 @@ static void OutputExceptionTable(ILCoder *coder, ILMethod
*method,
offset = 0;
for(;;)
{
+ int handlerStarted;
+
+ handlerStarted = 0;
+
/* Find the end of the region that starts at "offset" */
end = IL_MAX_UINT32;
exception = exceptions;
@@ -72,9 +76,6 @@ static void OutputExceptionTable(ILCoder *coder, ILMethod
*method,
break;
}
- /* Output the region information to the table */
- ILCoderTryHandlerStart(coder, offset, end);
-
/* Output exception matching code for this region */
exception = exceptions;
while(exception != 0)
@@ -86,10 +87,22 @@ static void OutputExceptionTable(ILCoder *coder, ILMethod
*method,
IL_META_EXCEPTION_FAULT)) != 0)
{
/* Call a "finally" or "fault" clause */
+ if(!handlerStarted)
+ {
+ /* Output the region
information to the table */
+ ILCoderTryHandlerStart(coder,
offset, end);
+ handlerStarted = 1;
+ }
ILCoderFinally(coder, exception,
exception->handlerOffset);
}
else if((exception->flags &
IL_META_EXCEPTION_FILTER) == 0)
{
+ if(!handlerStarted)
+ {
+ /* Output the region
information to the table */
+ ILCoderTryHandlerStart(coder,
offset, end);
+ handlerStarted = 1;
+ }
/* Match against a "catch" clause */
classInfo = ILProgramItemToClass
((ILProgramItem
*)ILImageTokenInfo
@@ -105,12 +118,15 @@ static void OutputExceptionTable(ILCoder *coder, ILMethod
*method,
exception = exception->next;
}
- /* If execution falls off the end of the matching code,
- then throw the exception to the calling method */
- ILCoderThrow(coder, 0);
+ if(handlerStarted)
+ {
+ /* If execution falls off the end of the matching code,
+ then throw the exception to the calling method */
+ ILCoderThrow(coder, 0);
- /* Mark the end of the handler */
- ILCoderTryHandlerEnd(coder);
+ /* Mark the end of the handler */
+ ILCoderTryHandlerEnd(coder);
+ }
/* Advance to the next region within the code */
offset = end;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 14 ++++++++++++++
engine/jitc_branch.c | 8 +-------
engine/jitc_setup.c | 5 -----
engine/verify.c | 2 +-
engine/verify_except.c | 32 ++++++++++++++++++++++++--------
5 files changed, 40 insertions(+), 21 deletions(-)
hooks/post-receive
--
DotGNU Portable.NET engine, compilers and tools (pnet)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. 6a6da65262a98df19eb1cd269348c89a296ee964,
Klaus Treichel <=