[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-internal.h jit/jit-c...
From: |
Aleksey Demakov |
Subject: |
[dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-internal.h jit/jit-c... |
Date: |
Sat, 24 Dec 2005 06:55:13 +0000 |
CVSROOT: /sources/dotgnu-pnet
Module name: libjit
Branch:
Changes by: Aleksey Demakov <address@hidden> 05/12/24 06:55:13
Modified files:
. : ChangeLog
jit : jit-internal.h jit-cache.h jit-cache.c
jit-except.c
Log message:
add jit_cache_get_start_method() and remove jit_function.start_address
field
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/ChangeLog.diff?tr1=1.184&tr2=1.185&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/jit/jit-internal.h.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/jit/jit-cache.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/jit/jit-cache.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/jit/jit-except.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
Patches:
Index: libjit/ChangeLog
diff -u libjit/ChangeLog:1.184 libjit/ChangeLog:1.185
--- libjit/ChangeLog:1.184 Fri Dec 23 21:26:50 2005
+++ libjit/ChangeLog Sat Dec 24 06:55:13 2005
@@ -11,6 +11,14 @@
* dpas/dpas-parser.y (throw_builtin_exception): add static function
that makes jit_exception_builtin call.
+ * jit/jit-cache.c (_jit_cache_get_start_method): add function that
+ for an address in cache returns the start address of the block that
+ contains it.
+ * jit/jit-except.c (jit_stack_trace_get_offset): use
+ _jit_cache_get_start_method function instead of cache_start field.
+ * jit/jit-internal.h, jit/jit-function.c (jit_function_compile):
+ remove cache_start field to the jit_function struct.
+
2005-12-22 Aleksey Demakov <address@hidden>
* jit/jit-rules-x86.sel: implement JIT_OP_MEMSET and JIT_OP_MEMCPY
Index: libjit/jit/jit-cache.c
diff -u libjit/jit/jit-cache.c:1.3 libjit/jit/jit-cache.c:1.4
--- libjit/jit/jit-cache.c:1.3 Tue Jun 1 06:46:40 2004
+++ libjit/jit/jit-cache.c Sat Dec 24 06:55:13 2005
@@ -1014,6 +1014,28 @@
return 1;
}
+void *_jit_cache_get_start_method(jit_cache_t cache, void *pc)
+{
+ /* TODO: This function is not currently aware of multiple regions. */
+ jit_cache_method_t node = cache->head.right;
+ while(node != &(cache->nil))
+ {
+ if(((unsigned char *)pc) < node->start)
+ {
+ node = GetLeft(node);
+ }
+ else if(((unsigned char *)pc) >= node->end)
+ {
+ node = GetRight(node);
+ }
+ else
+ {
+ return node->start;
+ }
+ }
+ return 0;
+}
+
void *_jit_cache_get_end_method(jit_cache_t cache, void *pc)
{
jit_cache_method_t parent_buf[16];
Index: libjit/jit/jit-cache.h
diff -u libjit/jit/jit-cache.h:1.2 libjit/jit/jit-cache.h:1.3
--- libjit/jit/jit-cache.h:1.2 Sat May 8 00:42:20 2004
+++ libjit/jit/jit-cache.h Sat Dec 24 06:55:13 2005
@@ -130,6 +130,16 @@
void *_jit_cache_get_method(jit_cache_t cache, void *pc, void **cookie);
/*
+ * Get the start of a method with a particular starting PC.
+ * Returns NULL if the PC could not be located.
+ * NOTE: This function is not currently aware of the
+ * possibility of multiple regions per function. To ensure
+ * correct results the ``pc'' argument has to be in the
+ * first region.
+ */
+void *_jit_cache_get_start_method(jit_cache_t cache, void *pc);
+
+/*
* Get the end of a method with a particular starting PC.
* Returns NULL if the PC could not be located.
*/
Index: libjit/jit/jit-except.c
diff -u libjit/jit/jit-except.c:1.5 libjit/jit/jit-except.c:1.6
--- libjit/jit/jit-except.c:1.5 Fri Dec 23 21:26:50 2005
+++ libjit/jit/jit-except.c Sat Dec 24 06:55:13 2005
@@ -426,14 +426,13 @@
if (func)
{
#ifdef JIT_PROLOG_SIZE
- unsigned long offset = trace->items[posn] -
func->cache_start;
- return _jit_cache_get_bytecode
- (cache, func->cache_start, offset, 0);
+ void *start = _jit_cache_get_start_method
+ (cache, func->entry_point);
#else
- unsigned long offset = trace->items[posn] -
func->entry_point;
- return _jit_cache_get_bytecode
- (cache, func->entry_point, offset, 0);
+ void *start = func->entry_point;
#endif
+ unsigned long offset = trace->items[posn] -
start;
+ return _jit_cache_get_bytecode(cache, start,
offset, 0);
}
}
}
Index: libjit/jit/jit-internal.h
diff -u libjit/jit/jit-internal.h:1.18 libjit/jit/jit-internal.h:1.19
--- libjit/jit/jit-internal.h:1.18 Sun Dec 18 17:44:54 2005
+++ libjit/jit/jit-internal.h Sat Dec 24 06:55:13 2005
@@ -387,12 +387,6 @@
/* The function to call to perform on-demand compilation */
jit_on_demand_func on_demand;
- /* TODO: This field is used only if JIT_PROLOG_SIZE is defined.
- However the header that defines it is included after this one
- so "#ifdef JIT_PROLOG_SIZE" does not work here. */
- /* The start of the code cache. */
- void * cache_start;
-
#ifdef jit_redirector_size
/* Buffer that contains the redirector for this function.
Redirectors are used to support on-demand compilation */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-internal.h jit/jit-c...,
Aleksey Demakov <=