Bug 96891 - Array profiling has convergence issues
Summary: Array profiling has convergence issues
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on: 96968
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-16 17:19 PDT by Filip Pizlo
Modified: 2012-09-17 16:11 PDT (History)
9 users (show)

See Also:


Attachments
the patch (20.17 KB, patch)
2012-09-16 17:28 PDT, Filip Pizlo
buildbot: commit-queue-
Details | Formatted Diff | Diff
the patch (20.62 KB, patch)
2012-09-16 18:06 PDT, Filip Pizlo
barraclough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2012-09-16 17:19:45 PDT
Consider the following code:

function foo() {
    var o = {};
    o.length = 5;
    for (var i = 0; i < o.length; ++i)
        o[i] = i;
}

Currently, array profiling will always say that 'o' is NonArrayWithArrayStorage, even though on the first iteration it's a NonArray (as in it has no array storage).

We could catch this corner case in one of two ways: (1) OSR exit profiling or (2) more precise baseline profiling.  I prefer (2) because we usually only like to rely on (1) in pathological cases.  The above does not feel like a pathological case - it seems rather sensible to write a program that has a loop, where the first iteration of that loop does special things.

Of course, we could also kill off this pathology, at least in most cases, by relying on loop peeling.  But for now, I think having a more precise array profiler just feels like a nicer solution
Comment 1 Filip Pizlo 2012-09-16 17:28:57 PDT
Created attachment 164328 [details]
the patch
Comment 2 Build Bot 2012-09-16 17:56:50 PDT
Comment on attachment 164328 [details]
the patch

Attachment 164328 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/13873232
Comment 3 Filip Pizlo 2012-09-16 18:06:46 PDT
Created attachment 164330 [details]
the patch

Fix non-DFG builds.
Comment 4 Filip Pizlo 2012-09-17 12:07:38 PDT
Landed in http://trac.webkit.org/changeset/128790
Comment 5 Csaba Osztrogonác 2012-09-17 16:10:33 PDT
(In reply to comment #4)
> Landed in http://trac.webkit.org/changeset/128790

It broke the Qt ARM build - https://bugs.webkit.org/show_bug.cgi?id=96968

Could you check it, please?
Comment 6 Filip Pizlo 2012-09-17 16:11:17 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > Landed in http://trac.webkit.org/changeset/128790
> 
> It broke the Qt ARM build - https://bugs.webkit.org/show_bug.cgi?id=96968
> 
> Could you check it, please?

It broke your build because I introduced new assembler functionality.

It's up to you guys to implement assembler functionality on your platforms.