chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] scanning toplevel assignments for "safe" globa


From: Felix
Subject: [Chicken-hackers] [PATCH] scanning toplevel assignments for "safe" globals largely ineffective
Date: Sat, 02 Jun 2012 13:36:29 +0200 (CEST)

The attached patch fixes a problem with the compiler pass that scans
toplevel assignments. That pass walks toplevel expressions and marks
global variable definitions that appear before any code that could
escape and possibly refer to those variables (Variables assigned
before code executes that may use them can be referenced without a
bounds-check). The scanning treated "##core#callunit" nodes similar to
"##core#call" (and thus escaping) but unit-invocations are only
generated by the compiler and always inserted at the start of the
program, before user code. So we can just treat them as no-ops, for
this particular analysis. Using units (or compiling stand-alone
programs which use the default library units) was making this
optimization mostly ineffective.


cheers,
felix
>From eda2526ff745bf9acb6a8cf9a04dcae0c1c44fa4 Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Sat, 2 Jun 2012 13:24:32 +0200
Subject: [PATCH] skip ##core#callunit when scanning toplevel assignments

---
 optimizer.scm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/optimizer.scm b/optimizer.scm
index 1ba1ee7..2ce577d 100644
--- a/optimizer.scm
+++ b/optimizer.scm
@@ -84,7 +84,7 @@
 
          [(lambda ##core#lambda) #f]
 
-         [(##core#call ##core#callunit) (touch)]
+         [(##core#call) (touch)]
 
          [(set!)
           (let ((var (first params))
-- 
1.6.0.4


reply via email to

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