Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Rhino JavaScript Java Library Source Code
Rhino JavaScript Java Library is an open-source implementation of JavaScript
written entirely in Java.
Rhino JavaScript Java Library Source Code files are provided in binary package (rhino-1.7.14.zip).
You can also browse the source code below:
✍: FYIcenter.com
⏎ org/mozilla/javascript/optimizer/OptFunctionNode.java
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.javascript.optimizer;
import org.mozilla.javascript.Kit;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.FunctionNode;
import org.mozilla.javascript.ast.ScriptNode;
public final class OptFunctionNode
{
OptFunctionNode(FunctionNode fnode)
{
this.fnode = fnode;
fnode.setCompilerData(this);
}
public static OptFunctionNode get(ScriptNode scriptOrFn, int i)
{
FunctionNode fnode = scriptOrFn.getFunctionNode(i);
return (OptFunctionNode)fnode.getCompilerData();
}
public static OptFunctionNode get(ScriptNode scriptOrFn)
{
return (OptFunctionNode)scriptOrFn.getCompilerData();
}
public boolean isTargetOfDirectCall()
{
return directTargetIndex >= 0;
}
public int getDirectTargetIndex()
{
return directTargetIndex;
}
void setDirectTargetIndex(int directTargetIndex)
{
// One time action
if (directTargetIndex < 0 || this.directTargetIndex >= 0)
Kit.codeBug();
this.directTargetIndex = directTargetIndex;
}
void setParameterNumberContext(boolean b)
{
itsParameterNumberContext = b;
}
public boolean getParameterNumberContext()
{
return itsParameterNumberContext;
}
public int getVarCount()
{
return fnode.getParamAndVarCount();
}
public boolean isParameter(int varIndex)
{
return varIndex < fnode.getParamCount();
}
public boolean isNumberVar(int varIndex)
{
varIndex -= fnode.getParamCount();
if (varIndex >= 0 && numberVarFlags != null) {
return numberVarFlags[varIndex];
}
return false;
}
void setIsNumberVar(int varIndex)
{
varIndex -= fnode.getParamCount();
// Can only be used with non-parameters
if (varIndex < 0) Kit.codeBug();
if (numberVarFlags == null) {
int size = fnode.getParamAndVarCount() - fnode.getParamCount();
numberVarFlags = new boolean[size];
}
numberVarFlags[varIndex] = true;
}
public int getVarIndex(Node n)
{
int index = n.getIntProp(Node.VARIABLE_PROP, -1);
if (index == -1) {
Node node;
int type = n.getType();
if (type == Token.GETVAR) {
node = n;
} else if (type == Token.SETVAR ||
type == Token.SETCONSTVAR) {
node = n.getFirstChild();
} else {
throw Kit.codeBug();
}
index = fnode.getIndexForNameNode(node);
if (index < 0) throw Kit.codeBug();
n.putIntProp(Node.VARIABLE_PROP, index);
}
return index;
}
public final FunctionNode fnode;
private boolean[] numberVarFlags;
private int directTargetIndex = -1;
private boolean itsParameterNumberContext;
boolean itsContainsCalls0;
boolean itsContainsCalls1;
}
⏎ org/mozilla/javascript/optimizer/OptFunctionNode.java
Or download all of them as a single archive file:
File name: rhino-1.7.14-sources.jar File size: 1029165 bytes Release date: 2022-01-06 Download
⇒ Example code to Test rhino-runtime-1.7.14.jar
⇐ Download Rhino JavaScript Binary Package
2022-05-03, ≈208🔥, 1💬
Popular Posts:
JDK 17 jdk.compiler.jmod is the JMOD file for JDK 17 Compiler tool, which can be invoked by the "jav...
JDK 11 jdk.xml.dom.jmod is the JMOD file for JDK 11 XML DOM module. JDK 11 XML DOM module compiled c...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
JEuclid Source Code Files are provided the JEuclid GitHub Website . You can browse JEuclid Source Co...
JAX-RPC is an API for building Web services and clients that used remote procedure calls (RPC) and X...