[Webkit-unassigned] [Bug 20764] New: Proposed byte-code optimization framework
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Sep 10 07:09:04 PDT 2008
https://bugs.webkit.org/show_bug.cgi?id=20764
Summary: Proposed byte-code optimization framework
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: Linux
Status: UNCONFIRMED
Severity: Enhancement
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: zherczeg at inf.u-szeged.hu
CC: loki at inf.u-szeged.hu, oszi at inf.u-szeged.hu, jasy at inf.u-
szeged.hu
Hi All,
We would like to share our ideas about a byte-code optimization framework.
Here is a short description about it:
Purpose:
The code-block optimizer is a framework, which first parses a given code block,
builds its basic block structure, executes various optimizations, and finally,
recreates the code block again.
Invocation:
- always invoked by nodes.cpp from FunctionBodyNode::generateCode and
ProgramNode::generateCode
Shell extensions:
- the jsc command line tool has a new argument: -o opt[,opt[...]] (comma
separated keywords)
The optimizations are performed in the same order as they specified by this
argument
- The currently supported optimization keywords:
dce - dead code elimination
cfp - constant folding and propagation
Short description of the current optimizations:
- dead code elimination
Now working on extended basic block level. It creates a simple def-use
system to eliminate "no side effects" instructions.
- constant propagation
This implementation is a general iterative solution for constant
propagation. It determines the values of all constant expressions with the help
of constans folding. Folding tries to evaulate the values of possibly constant
expressions and after that the results are propagated.
Testing:
- The framework was tested by inserting dummy movs (mov tr0, tr0) after every
instructions. If this code passes the regression tests (jump targets are
correctly redirected) we can assume the byte code generation is OK.
- all optimization tests are tested individually
Major changes in the source code:
- new files added:
CodeBlockOptimizer.cpp and .h
OptConstansFoldingPropagation.cpp
- files changed:
CodeBlock.cpp - new structures added, which are basically replicas of the
original structures, except the instruction indices are changed to byte code
pointers.
Opcode.h - opcode flags are added to every opcode
Alternative invocation:
- when a certain treshold is reached for a given code-block. In the latter
case, an independent thread performs the optimization, and replaces the
original block after the process is done (however, it is not included in the
proposed patch).
Any feedbacks, questions are welcome. We hope it would be useful.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list