[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] scanning toplevel assignments for "safe" g
Re: [Chicken-hackers] [PATCH] scanning toplevel assignments for "safe" globals largely ineffective
Tue, 05 Jun 2012 12:36:14 +0200 (CEST)
From: Peter Bex <address@hidden>
Subject: Re: [Chicken-hackers] [PATCH] scanning toplevel assignments for "safe"
globals largely ineffective
Date: Tue, 5 Jun 2012 12:27:57 +0200
> On Sat, Jun 02, 2012 at 01:36:29PM +0200, Felix wrote:
>> 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.
> I'm not 100% sure (I don't fully grok this code), but as I understand it
> a user pass could modify code and possibly insert things before the
> callunit expressions. However, the unit names are strings, not
> variables, so AFAIK it wouldn't make a difference either way.
That's correct. A user-pass that inserted code before the callunit's
would be very special, since at that point there is no library
available. So I don't see a problem there (is anybody using user-passes
> In short, I've signed off and pushed this.