The function did not handle properly the case when we are splitting
and interval which has child intervals that need reloading from it.
We should change the spill parent of those child intervals to the
new interval, so that they are reloaded correctly.

This bug caused execution of invalid methods due to register
corruption, which prevented java.awt.image.Raster.createWritableRaster()
from correct working.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 jit/linear-scan.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/jit/linear-scan.c b/jit/linear-scan.c
index 05ff33d..9940c80 100644
--- a/jit/linear-scan.c
+++ b/jit/linear-scan.c
@@ -126,6 +126,20 @@ static void spill_interval(struct live_interval *it, 
unsigned long pos,
                        new = split_interval_at(new, next_pos);
 
                /*
+                * If any child interval of @it must be reloaded from
+                * @it then we have to update its spill parent to @new.
+                */
+               struct live_interval *child = new->next_child;
+               while (child) {
+                       if (child->need_reload && child->spill_parent == it)
+                               child->spill_parent = new;
+
+                       child = child->next_child;
+               }
+
+               new->need_spill = it->need_spill;
+
+               /*
                 * When next use position is a write then we must not
                 * reload the new interval. One reason for this is
                 * that it's unnecessary. Another one is that we won't
-- 
1.6.0.4


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to