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

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

[dotgnu-pnet-commits] libjit ChangeLog jit/jit-cache.c jit/jit-insn.c


From: Aleksey Demakov
Subject: [dotgnu-pnet-commits] libjit ChangeLog jit/jit-cache.c jit/jit-insn.c
Date: Sat, 17 Nov 2007 02:12:36 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    libjit
Changes by:     Aleksey Demakov <avd>   07/11/17 02:12:36

Modified files:
        .              : ChangeLog 
        jit            : jit-cache.c jit-insn.c 

Log message:
        do not start new basic block on the bytecode mark
        fix offset for the last mark

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.322&r2=1.323
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-cache.c?cvsroot=dotgnu-pnet&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-insn.c?cvsroot=dotgnu-pnet&r1=1.55&r2=1.56

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.322
retrieving revision 1.323
diff -u -b -r1.322 -r1.323
--- ChangeLog   13 Nov 2007 09:19:23 -0000      1.322
+++ ChangeLog   17 Nov 2007 02:12:36 -0000      1.323
@@ -1,3 +1,12 @@
+2007-11-17  Aleksey Demakov  <address@hidden>
+
+       * jit/jit-insn.c (jit_insn_mark_offset): do not start new block
+       on the bytecode mark. If a mark goes just after another mark then
+       replace the old mark rather than add the new.
+
+       * jit/jit-cache.c (_jit_cache_get_bytecode)
+       (_jit_cache_get_native): fix offset for the last bytecode mark.
+
 2007-11-13  Aleksey Demakov  <address@hidden>
 
        * tools/Makefile.am (noinst_HEADERS): add gen-apply-macosx.h

Index: jit/jit-cache.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-cache.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- jit/jit-cache.c     24 Dec 2005 06:55:13 -0000      1.4
+++ jit/jit-cache.c     17 Nov 2007 02:12:36 -0000      1.5
@@ -1323,7 +1323,8 @@
                }
                prevNativeOfs = nativeOfs;
        }
-       return JIT_CACHE_NO_OFFSET;
+
+       return exact ? JIT_CACHE_NO_OFFSET : prevNativeOfs;
 }
 
 unsigned long _jit_cache_get_bytecode(jit_cache_t cache, void *start,
@@ -1350,7 +1351,8 @@
                }
                prevOfs = ofs;
        }
-       return JIT_CACHE_NO_OFFSET;
+
+       return exact ? JIT_CACHE_NO_OFFSET : prevOfs;
 }
 
 unsigned long _jit_cache_get_size(jit_cache_t cache)

Index: jit/jit-insn.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-insn.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- jit/jit-insn.c      7 Oct 2007 14:20:34 -0000       1.55
+++ jit/jit-insn.c      17 Nov 2007 02:12:36 -0000      1.56
@@ -8013,15 +8013,35 @@
 @*/
 int jit_insn_mark_offset(jit_function_t func, jit_int offset)
 {
-#if 1
-       if(!jit_insn_new_block(func))
+       jit_block_t block;
+       jit_insn_t last;
+       jit_value_t value;
+
+       /* Ensure that we have a builder for this function */
+       if(!_jit_function_ensure_builder(func))
        {
                return 0;
        }
-#endif
-       return create_unary_note(func, JIT_OP_MARK_OFFSET,
-                                                    
jit_value_create_nint_constant
-                                                               (func, 
jit_type_int, offset));
+
+       value = jit_value_create_nint_constant(func, jit_type_int, offset);
+       if (!value)
+       {
+               return 0;
+       }
+
+       /* If the previous instruction is mark offset too
+          then just replace the offset value in place --
+          we are not interested in bytecodes that produce
+          no real code. */
+       block = func->builder->current_block;
+       last = _jit_block_get_last(block);
+       if (last && last->opcode == JIT_OP_MARK_OFFSET)
+       {
+               last->value1 = value;
+               return 1;
+       }
+
+       return create_unary_note(func, JIT_OP_MARK_OFFSET, value);
 }
 
 /* Documentation is in jit-debugger.c */




reply via email to

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