Package org.mozilla.javascript
Class InterpreterData
- java.lang.Object
-
- org.mozilla.javascript.InterpreterData
-
- All Implemented Interfaces:
java.io.Serializable
,DebuggableScript
final class InterpreterData extends java.lang.Object implements java.io.Serializable, DebuggableScript
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
argCount
(package private) boolean[]
argIsConst
(package private) java.lang.String[]
argNames
(package private) boolean
declaredAsFunctionExpression
true if the function has been declared like "!function() {}".(package private) boolean
declaredAsVar
true if the function has been declared like "var foo = function() {...}"(package private) java.lang.String
encodedSource
(package private) int
encodedSourceEnd
(package private) int
encodedSourceStart
(package private) boolean
evalScriptFlag
(package private) int
firstLinePC
private int
icodeHashCode
(package private) static int
INITIAL_MAX_ICODE_LENGTH
(package private) static int
INITIAL_NUMBERTABLE_SIZE
(package private) static int
INITIAL_STRINGTABLE_SIZE
(package private) boolean
isES6Generator
(package private) boolean
isStrict
(package private) double[]
itsDoubleTable
(package private) int[]
itsExceptionTable
(package private) int
itsFunctionType
(package private) byte[]
itsICode
(package private) int
itsMaxCalleeArgs
(package private) int
itsMaxFrameArray
(package private) int
itsMaxLocals
(package private) int
itsMaxStack
(package private) int
itsMaxVars
(package private) java.lang.String
itsName
(package private) boolean
itsNeedsActivation
(package private) InterpreterData[]
itsNestedFunctions
(package private) java.lang.Object[]
itsRegExpLiterals
(package private) java.lang.String
itsSourceFile
(package private) java.lang.String[]
itsStringTable
(package private) int
languageVersion
(package private) java.lang.Object[]
literalIds
(package private) UintMap
longJumps
(package private) InterpreterData
parentData
private static long
serialVersionUID
(package private) boolean
topLevel
-
Constructor Summary
Constructors Constructor Description InterpreterData(int languageVersion, java.lang.String sourceFile, java.lang.String encodedSource, boolean isStrict)
InterpreterData(InterpreterData parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DebuggableScript
getFunction(int index)
int
getFunctionCount()
java.lang.String
getFunctionName()
Get name of the function described by this script.int[]
getLineNumbers()
Get array containing the line numbers that that can be passed toDebugFrame.onLineChange()
.int
getParamAndVarCount()
Get number of declared parameters and local variables.int
getParamCount()
Get number of declared parameters in the function.boolean
getParamOrVarConst(int index)
java.lang.String
getParamOrVarName(int index)
Get name of a declared parameter or local variable.DebuggableScript
getParent()
java.lang.String
getSourceName()
Get the name of the source (usually filename or URL) of the script.int
icodeHashCode()
private void
init()
boolean
isFunction()
Returns true if this is a function, false if it is a script.boolean
isGeneratedScript()
Returns true if this script or function were runtime-generated from JavaScript usingeval
function orFunction
orScript
constructors.boolean
isTopLevel()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
INITIAL_MAX_ICODE_LENGTH
static final int INITIAL_MAX_ICODE_LENGTH
- See Also:
- Constant Field Values
-
INITIAL_STRINGTABLE_SIZE
static final int INITIAL_STRINGTABLE_SIZE
- See Also:
- Constant Field Values
-
INITIAL_NUMBERTABLE_SIZE
static final int INITIAL_NUMBERTABLE_SIZE
- See Also:
- Constant Field Values
-
itsName
java.lang.String itsName
-
itsSourceFile
java.lang.String itsSourceFile
-
itsNeedsActivation
boolean itsNeedsActivation
-
itsFunctionType
int itsFunctionType
-
itsStringTable
java.lang.String[] itsStringTable
-
itsDoubleTable
double[] itsDoubleTable
-
itsNestedFunctions
InterpreterData[] itsNestedFunctions
-
itsRegExpLiterals
java.lang.Object[] itsRegExpLiterals
-
itsICode
byte[] itsICode
-
itsExceptionTable
int[] itsExceptionTable
-
itsMaxVars
int itsMaxVars
-
itsMaxLocals
int itsMaxLocals
-
itsMaxStack
int itsMaxStack
-
itsMaxFrameArray
int itsMaxFrameArray
-
argNames
java.lang.String[] argNames
-
argIsConst
boolean[] argIsConst
-
argCount
int argCount
-
itsMaxCalleeArgs
int itsMaxCalleeArgs
-
encodedSource
java.lang.String encodedSource
-
encodedSourceStart
int encodedSourceStart
-
encodedSourceEnd
int encodedSourceEnd
-
languageVersion
int languageVersion
-
isStrict
boolean isStrict
-
topLevel
boolean topLevel
-
isES6Generator
boolean isES6Generator
-
literalIds
java.lang.Object[] literalIds
-
longJumps
UintMap longJumps
-
firstLinePC
int firstLinePC
-
parentData
InterpreterData parentData
-
evalScriptFlag
boolean evalScriptFlag
-
icodeHashCode
private int icodeHashCode
-
declaredAsVar
boolean declaredAsVar
true if the function has been declared like "var foo = function() {...}"
-
declaredAsFunctionExpression
boolean declaredAsFunctionExpression
true if the function has been declared like "!function() {}".
-
-
Constructor Detail
-
InterpreterData
InterpreterData(int languageVersion, java.lang.String sourceFile, java.lang.String encodedSource, boolean isStrict)
-
InterpreterData
InterpreterData(InterpreterData parent)
-
-
Method Detail
-
init
private void init()
-
isTopLevel
public boolean isTopLevel()
- Specified by:
isTopLevel
in interfaceDebuggableScript
-
isFunction
public boolean isFunction()
Description copied from interface:DebuggableScript
Returns true if this is a function, false if it is a script.- Specified by:
isFunction
in interfaceDebuggableScript
-
getFunctionName
public java.lang.String getFunctionName()
Description copied from interface:DebuggableScript
Get name of the function described by this script. Return null or an empty string if this script is not a function.- Specified by:
getFunctionName
in interfaceDebuggableScript
-
getParamCount
public int getParamCount()
Description copied from interface:DebuggableScript
Get number of declared parameters in the function. Return 0 if this script is not a function.- Specified by:
getParamCount
in interfaceDebuggableScript
- See Also:
DebuggableScript.getParamAndVarCount()
,DebuggableScript.getParamOrVarName(int index)
-
getParamAndVarCount
public int getParamAndVarCount()
Description copied from interface:DebuggableScript
Get number of declared parameters and local variables. Return number of declared global variables if this script is not a function.- Specified by:
getParamAndVarCount
in interfaceDebuggableScript
- See Also:
DebuggableScript.getParamCount()
,DebuggableScript.getParamOrVarName(int index)
-
getParamOrVarName
public java.lang.String getParamOrVarName(int index)
Description copied from interface:DebuggableScript
Get name of a declared parameter or local variable.index
should be less thenDebuggableScript.getParamAndVarCount()
. Ifindex <
, return the name of the corresponding parameter, otherwise return the name of variable. If this script is not function, return the name of the declared global variable.DebuggableScript.getParamCount()
- Specified by:
getParamOrVarName
in interfaceDebuggableScript
-
getParamOrVarConst
public boolean getParamOrVarConst(int index)
-
getSourceName
public java.lang.String getSourceName()
Description copied from interface:DebuggableScript
Get the name of the source (usually filename or URL) of the script.- Specified by:
getSourceName
in interfaceDebuggableScript
-
isGeneratedScript
public boolean isGeneratedScript()
Description copied from interface:DebuggableScript
Returns true if this script or function were runtime-generated from JavaScript usingeval
function orFunction
orScript
constructors.- Specified by:
isGeneratedScript
in interfaceDebuggableScript
-
getLineNumbers
public int[] getLineNumbers()
Description copied from interface:DebuggableScript
Get array containing the line numbers that that can be passed toDebugFrame.onLineChange()
. Note that line order in the resulting array is arbitrary- Specified by:
getLineNumbers
in interfaceDebuggableScript
-
getFunctionCount
public int getFunctionCount()
- Specified by:
getFunctionCount
in interfaceDebuggableScript
-
getFunction
public DebuggableScript getFunction(int index)
- Specified by:
getFunction
in interfaceDebuggableScript
-
getParent
public DebuggableScript getParent()
- Specified by:
getParent
in interfaceDebuggableScript
-
icodeHashCode
public int icodeHashCode()
-
-