public class Bytecode extends Object
Bytecode
is created in Leola by defining either a LeoNamespace
, LeoClass
or a LeoFunction
.Modifier and Type | Field and Description |
---|---|
LeoObject[] |
constants |
DebugSymbols |
debugSymbols |
static int |
FL_BLOCKS |
static int |
FL_DEBUG |
static int |
FL_PARAMS_IDX |
static int |
FL_VARARGS |
int |
flags |
Bytecode[] |
inner |
int[] |
instr |
int |
len |
static int |
MAGIC_NUMBER |
int |
maxstacksize |
int |
numArgs |
int |
numConstants |
int |
numInners |
int |
numLocals |
int |
numOuters |
LeoString[] |
paramNames |
int |
pc |
static int |
VERSION |
Constructor and Description |
---|
Bytecode(int[] instructions) |
Bytecode(int[] instr,
int pc,
int len) |
Modifier and Type | Method and Description |
---|---|
Bytecode |
clone()
Clones this
Bytecode |
String |
dump()
|
File |
getSourceFile() |
String |
getSourceFileName() |
int |
getVarargIndex() |
boolean |
hasBlocks() |
boolean |
hasDebug() |
boolean |
hasParamIndexes() |
boolean |
hasVarargs() |
static Bytecode |
read(LeoObject env,
DataInput in)
|
void |
setBlocks()
denotes that this byte code contains exception blocks
|
void |
setDebug()
denotes that this byte code contains debug information
|
void |
setParamIndexes()
denotes that the bytecode uses parameter indexing for
named parameters
|
void |
setSourceFile(File filename)
Sets the filename in which generated this
Bytecode . |
void |
setVarargs()
denotes that this byte code contains variable arguments
|
String |
toString() |
void |
write(DataOutput out)
Writes the
Bytecode out to a stream. |
public static final int MAGIC_NUMBER
public static final int VERSION
public static final int FL_DEBUG
public static final int FL_BLOCKS
public static final int FL_VARARGS
public static final int FL_PARAMS_IDX
public int flags
public final int[] instr
public int pc
public final int len
public LeoObject[] constants
public int numConstants
public DebugSymbols debugSymbols
public int numLocals
public int numOuters
public LeoString[] paramNames
public int numArgs
public int numInners
public int maxstacksize
public Bytecode[] inner
public Bytecode(int[] instructions)
instructions
- public Bytecode(int[] instr, int pc, int len)
instr
- pc
- len
- public void setVarargs()
public void setDebug()
public void setBlocks()
public void setParamIndexes()
public boolean hasVarargs()
public boolean hasDebug()
public boolean hasBlocks()
public boolean hasParamIndexes()
public int getVarargIndex()
public void setSourceFile(File filename)
Bytecode
. Only
stores this information in DEBUG mode.filename
- public String getSourceFileName()
Bytecode
public void write(DataOutput out) throws IOException
Bytecode
out to a stream.out
- IOException
public static Bytecode read(LeoObject env, DataInput in) throws IOException
in
- Bytecode
IOException
Copyright © 2010–2015. All rights reserved.