[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CPS Update
From: |
William ML Leslie |
Subject: |
Re: CPS Update |
Date: |
Mon, 25 Feb 2013 15:54:57 +1100 |
On 23 February 2013 18:49, Mark H Weaver <address@hidden> wrote:
> William ML Leslie <address@hidden> writes:
>> Recompiling every procedure that uses + when somebody binds it means
>> compiling a lot of code that probably isn't going to be used. More
>> likely, if + has been inlined here, the compiler will have to emit a
>> guard that checks inlining assumptions as the start of the let body.
>
> I'm afraid this isn't good enough. Even if one ignores the possibility
> of multiple threads, checks would have to be added not just at the start
> of each let body, but also upon return from every procedure that might
> rebind '+' or capture its continuation. This includes all procedures
> accessed through toplevel/module bindings.
Not each let body, the let body in the example code. Specifically, a
guard needs to be placed whenever code with undetermined effect
happens-before a 'call' to an inlined function. That we are talking
about happens-before means the possibility of runtime invalidation of
code is limited not only by calls to functions of unknown effect, but
also by usages of the variable.
> Therefore, I repeat my initial assertion that this is a can of worms.
Except that most dynamic compilers for imperative languages already do
this (because it's a pretty common thing to need to do).
--
William Leslie
- CPS Update, Noah Lavine, 2013/02/15
- Re: CPS Update, Stefan Israelsson Tampe, 2013/02/16
- Re: CPS Update, Noah Lavine, 2013/02/16
- Re: CPS Update, Mark H Weaver, 2013/02/16
- Re: CPS Update, Noah Lavine, 2013/02/16
- Re: CPS Update, Mark H Weaver, 2013/02/16
- Re: CPS Update, Noah Lavine, 2013/02/19
- Re: CPS Update, Mark H Weaver, 2013/02/19
- Re: CPS Update, William ML Leslie, 2013/02/22
- Re: CPS Update, Mark H Weaver, 2013/02/23
- Re: CPS Update,
William ML Leslie <=
- Re: CPS Update, Mark H Weaver, 2013/02/26
- Re: CPS Update, Stefan Israelsson Tampe, 2013/02/19