108 lines
4.2 KiB
HTML
108 lines
4.2 KiB
HTML
<!-- ***** BEGIN LICENSE BLOCK *****
|
|
- Version: MPL 1.1/GPL 2.0
|
|
-
|
|
- The contents of this file are subject to the Mozilla Public License Version
|
|
- 1.1 (the "License"); you may not use this file except in compliance with
|
|
- the License. You may obtain a copy of the License at
|
|
- http://www.mozilla.org/MPL/
|
|
-
|
|
- Software distributed under the License is distributed on an "AS IS" basis,
|
|
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
- for the specific language governing rights and limitations under the
|
|
- License.
|
|
-
|
|
- The Original Code is Rhino code, released May 6, 1999.
|
|
-
|
|
- The Initial Developer of the Original Code is
|
|
- Netscape Communications Corporation.
|
|
- Portions created by the Initial Developer are Copyright (C) 1997-1999
|
|
- the Initial Developer. All Rights Reserved.
|
|
-
|
|
- Contributor(s):
|
|
-
|
|
- Alternatively, the contents of this file may be used under the terms of
|
|
- the GNU General Public License Version 2 or later (the "GPL"), in which
|
|
- case the provisions of the GPL are applicable instead of those above. If
|
|
- you wish to allow use of your version of this file only under the terms of
|
|
- the GPL and not to allow others to use your version of this file under the
|
|
- MPL, indicate your decision by deleting the provisions above and replacing
|
|
- them with the notice and other provisions required by the GPL. If you do
|
|
- not delete the provisions above, a recipient may use your version of this
|
|
- file under either the MPL or the GPL.
|
|
-
|
|
- ***** END LICENSE BLOCK ***** -->
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<meta http-equiv="Content-Language" content="en">
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
|
|
<meta name="Author" content="Norris Boyd">
|
|
|
|
<title>Optimization</title>
|
|
|
|
<link rel="up" href="./" title="Rhino project page">
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<p class="crumbs"><em>You are here:</em> <a href="./">Rhino project page</a> > <strong>Optimization</strong></p>
|
|
|
|
<h1 style="text-align: center;">Optimization</h1>
|
|
|
|
<h2>Optimization settings</h2>
|
|
|
|
<p>The currently supported optimization settings are:</p>
|
|
|
|
<p><b>-1</b></p>
|
|
|
|
<p>Interpretive mode is always used. The compilation time is minimized at the
|
|
expense of runtime performance. No class files are generated, which may improve
|
|
memory usage depending on your system. Another benefit of the interpreted mode
|
|
is that the interpreter performs tail-call elimination of recursive functions.
|
|
Also, you must use this optimization level if your code uses Continuation
|
|
objects.
|
|
<p>
|
|
<p>If the optimization package is not available, then optimization
|
|
acts as if it is always -1.</p>
|
|
|
|
<p><b>0</b></p>
|
|
|
|
<p>No optimizations are performed. The bytecode compiler runs fastest
|
|
in this mode, but the generated byte code is less efficient.</p>
|
|
|
|
<p><b>1-9</b></p>
|
|
|
|
<p>All optimizations are performed. Simple data & type
|
|
flow analysis is performed to determine which JavaScript variables can
|
|
be allocated to Java VM registers, and which variables are used only as
|
|
Numbers. Local common sub-expressions are collapsed (currently this only
|
|
happens for property lookup, but in the future more expressions may be
|
|
optimized). All local variables and parameters are allocated to Java VM
|
|
registers. Function call targets are speculatively pre-cached (based on
|
|
the name used in the source) so that dispatching can be direct, pending
|
|
runtime confirmation of the actual target. Arguments are passed as
|
|
Object/Number pairs to reduce conversion overhead.</p>
|
|
|
|
<p>Note:</p>
|
|
|
|
<ol>
|
|
<li>Some language features (indirect calls to eval, use
|
|
of the arguments property of function objects) were previously not supported
|
|
in higher optimization levels. These features have been removed from the
|
|
language in ECMA, so higher optimization levels are now conformant.</li>
|
|
|
|
<li>Future versions may allocate more aggressive
|
|
optimizations to higher optimization levels. For compatibility with future
|
|
versions, use level 1. For maximal optimization, use level 9, but retest
|
|
your application when upgrading to new versions.</li>
|
|
</ol>
|
|
|
|
</body>
|
|
</html>
|