TM: trace tree-walking recursion

RESOLVED WORKSFORME

Status

()

Core
JavaScript Engine
RESOLVED WORKSFORME
8 years ago
6 years ago

People

(Reporter: dvander, Assigned: dvander)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

8 years ago
This is kind of tricky because the traces have a cyclic dependency. I think we can do something though.

I've attached a basic example of what we don't trace.
(Assignee)

Comment 1

8 years ago
Created attachment 418320 [details] [diff] [review]
WIP v1

v8/earley-boyer.js is still not tracing with this patch, but it makes the attached test case 9-10X faster. So maybe there is hope.
Assignee: general → dvander
Status: NEW → ASSIGNED
(Assignee)

Comment 2

8 years ago
Created attachment 418321 [details]
test case
(Assignee)

Comment 3

8 years ago
earley-boyer's recursion is very complex. It looks something like this:

function loop1() {
  while () {
    function loop2() {
      while () {
        function loop3() {
          if ()
            return loop3();
          else
            return loop2();
        }
      }
      return loop1();
    }
    return loop2();
  }
}

This is too complex for this patch to handle, as it's the two cases we don't support rolled into one thing.

As-is, the patch is just a POC that the cyclic dependency is something we should be able to deal with.
Current JS shell results for attached testcase:
Interp: 153.121 ms
-j:     152.233 ms
-m:     10.591 ms
-m -n:  10.235 ms

Looks like JM handles this pretty nicely!
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
Blocks: 467263
You need to log in before you can comment on or make changes to this bug.