Closed Bug 495848 Opened 16 years ago Closed 7 years ago

ABC Interpreter should use computed-gotos when possible

Categories

(Tamarin Graveyard :: Interpreter, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: stejohns, Unassigned)

Details

Currently, the ABC-only interpreter always dispatches via a switch statement. Using computed-goto on compilers that support it is a measurable speed gain (up to 15% in TT IIRC) and should be simple to implement.
the abc interpreter can't (by definition) use direct-threaded code. It could however use indirect threaded code plus computed gotos.
(In reply to comment #1) > the abc interpreter can't (by definition) use direct-threaded code. It could > however use indirect threaded code plus computed gotos. Steven swears it helps. Probably compiler and CPU dependent (you get rid of at most a range check in the switch, plus a jump to the switch dispatch, plus you get marginally better branch prediction at the end of each instruction).
Target Milestone: --- → Future
Component: Virtual Machine → Interpreter
Flags: flashplayer-qrb+
agreed, seems like low hanging fruit on GCC or ARMCC even without direct threading.
I'm skeptical about the 15% given the current interpreter structure with our very-fat bytecodes (compare to TT's very skinny ones), and given the amount of branching and the presumably relatively simplistic branch prediction hardware on mobile CPUs I'm skeptical about those gains too. It may be low hanging fruit, but is it edible? :-)
I would be extatic if we got 15%, we probably won't. i think we should keep this open as an option but not work on it until there's evidence it will matter.
(In reply to comment #5) > I would be extatic if we got 15%, we probably won't. No, but I wouldn't be surprised if it was 2-3%, and it's a small amount of work...
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.