Closed Bug 420368 Opened 16 years ago Closed 14 years ago

Array.push needs optimization for the single-arg case.

Categories

(Tamarin Graveyard :: Virtual Machine, enhancement, P4)

enhancement

Tracking

(Not tracked)

VERIFIED WONTFIX
Q3 11 - Serrano

People

(Reporter: stejohns, Unassigned)

References

Details

(Keywords: perf, Whiteboard: PACMAN)

Array.push() is almost always called with just one arg.  I dont know if
there's a good way to optimize for that case if the args have already been
turned into an array of rest args, but something to bug-ize, for future
enhancement, maybe.    

when the tracer is allowed to follow at least one backedge, then this push loop
will iterate one time, so we'll inline exactly 1 iteration of the loop if there
is 1 arg to push().  the value will still have been laundered through the args
array, but we can think about array load/store optimizations in the future. 
(ie if you start with an arg, put it in an array, get it back out, and the
array dies on the same trace, we shouldn't even need to allocate the array.
thinking out loud... perhaps the right approach here would be
(1) allow native methods to take argc/argv style arguments with having to encode them into an array
(2) implement push() as a native method

(1) has been requested by people who anticiate array-ification of varargs to be too slow, anyway...

variation 1 - use forth instead of C
issue - what about Array.prototype.push(), its always bothered me that anonymous closures can't be native.  wondering if there's a way to pull this off, or to have a method closure become a true function (no bound 'this') somehow, then have Array.prototype.push = magic_unbind_this(_push);  .. or something
can't anonymous closures be native? seems like we just have to make a native static function of the right signature and use it.
static methods aren't function closures -- you can extract them but they are MethodClosures with "this" bound to the class object.  what would the name of the native method be if it's anonymous?
doh. sorry. late friday afternoon. :-)
Severity: normal → enhancement
Keywords: perf
Flags: in-testsuite?
Flags: flashplayer-triage+
Flags: flashplayer-qrb?
Component: Tracing Virtual Machine → Virtual Machine
Flags: flashplayer-qrb? → flashplayer-qrb+
Priority: -- → P4
Target Milestone: --- → Future
QA Contact: tracing-vm → vm
Target Milestone: Future → flash10.1
Target Milestone: flash10.1 → flash10.2
Whiteboard: PACMAN
rest arg optimizations underway, anything left to do here after that lands?
Depends on: 569321
Rendered moot by rest arg optimization, which just landed.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
bulk verifying resolved !fixed issues
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.