Closed
Bug 530900
Opened 15 years ago
Closed 15 years ago
TM: recursion broken with STOP, inner loop
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: duncan.loveday, Assigned: dvander)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(2 files)
1.02 KB,
application/x-javascript
|
Details | |
8.30 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 2.0.50727)
Build Identifier: Local m-c build
Does tracemonkey trace recursive functions ? I see little or no speedup for a simple quicksort type algorithm
$ ./js a.js
Quick sort 1000000 elements time=10579
Bubble sort 10000 elements time=31237
$ ./js -j a.js
Quick sort 1000000 elements time=9751
Bubble sort 10000 elements time=10017
$
Reproducible: Always
Steps to Reproduce:
Run the attached in the shell - times are a bit variable but JIT definitely does more for the bubble sort than the recursive sort.
Expected Results:
It'd be "nice" if it could stay on trace for recursive functions. Can it ?
Reporter | ||
Comment 1•15 years ago
|
||
Assignee | ||
Comment 2•15 years ago
|
||
We do trace some recursive functions (see bug 459301), and your control flow looks like something we should be tracing. But we're aborting somewhere. I'll take a look.
Assignee | ||
Comment 3•15 years ago
|
||
There's two problems here. The first is that if a recursion function runs off the end (i.e. hits JSOP_STOP instead of JSOP_RETURN), it won't compile. The second problem is that we can get abnormal loop exits.
AttemptToStabilizeTree() starts a generic recording once it sees a RECURSIVE_UNLINKED_EXIT. In theory these could get tied together, but that's invalid. We have to separate traces from "loop" or "recursive" traces. This way it will start a recursive trace, then call the loop trace, and continue on.
Assignee | ||
Updated•15 years ago
|
Assignee: general → dvander
Summary: TM: JIT recursive functions → TM: recursion broken with STOP, inner loop
Reporter | ||
Comment 4•15 years ago
|
||
With a return statement at the end of each sort function
$ ./js a.js
Quick sort 1000000 elements time=11327
Bubble sort 10000 elements time=22340
$ ./js -j a.js
Quick sort 1000000 elements time=5734
Bubble sort 10000 elements time=6936
$
Assignee | ||
Comment 5•15 years ago
|
||
keima:src dvander$ ./Opt/js ~/rec.js
Quick sort 1000000 elements time=5261
keima:src dvander$ ./Opt/js -j ~/rec.js
Quick sort 1000000 elements time=2239
Looks better with this patch, but the other issue remains.
Assignee | ||
Comment 6•15 years ago
|
||
Comment on attachment 414413 [details] [diff] [review]
fixes JSOP_STOP issue
Will use a separate bug for that, actually.
Attachment #414413 -
Flags: review?(gal)
Updated•15 years ago
|
Attachment #414413 -
Flags: review?(gal) → review+
Updated•15 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee | ||
Comment 7•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Comment 8•15 years ago
|
||
Backed out to see if sudden orange goes away. http://hg.mozilla.org/tracemonkey/rev/2d4418c5ac72
Whiteboard: fixed-in-tracemonkey
Comment 9•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•15 years ago
|
||
this had been backed out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 11•15 years ago
|
||
Rebased, re-tested, so pushing again. http://hg.mozilla.org/tracemonkey/rev/12827fc411c1
Assignee | ||
Updated•15 years ago
|
Whiteboard: fixed-in-tracemonkey
Comment 12•15 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•