http://codereview.chromium.org/62146/diff/4001/4015
File src/rewriter.cc (left):

http://codereview.chromium.org/62146/diff/4001/4015#oldcode798
Line 798: if (!scope->is_global_scope()) {
On 2009/04/14 00:18:30, Mikhail Naganov wrote:
> On 2009/04/13 23:50:11, Søren Gjesse wrote:
> > Any idea why the global scope used to be skipped here?

> Kevin said that "The AstOptimizer was originally intended as an
analysis pass
> that would allow us to make inlining decisions in generated code.
Since we
> didn't intend to do any inlining at the global scope anyway, there was
no need."

> I suggest that it makes no harm running it for the global scope,
except for some
> performance penalty in parsing. As I said, I'm avoiding adding another
pass, and
> no other AstVisitor suits better for doing name inference. Let's wait
for Kasper
> before submitting.

Since I put the AstOptimizer in initially here was the reasoning:
Originally the AstOptimizer was only tracking likely types through the
code and did advise the backend for which operations to emit inline Smi
checks. At the time this optimization was deemed unneeded for global
code that runs only once. We have since added additional functionality
to the AstOptimizer and already seen bugs because it was not run on
global code. I strongly suggest that my initial decision was a premature
optimization and that we should always run the AstOptimizer. When you
do, please file a reminder bug for Kevin to remove his special handling
of global code in the backend. In any case you should verify that
compilation speed of global code is not impacted severely, but on the
other hand we are already running this optimization step on all other
code (which is the majority of the source in well-written code anyway.)

I don't think there is a need to wait for Kasper's input for this
particular question as he is still on holiday.

http://codereview.chromium.org/62146

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to