Package me.topchetoeu.j2s.common
Class Instruction
java.lang.Object
me.topchetoeu.j2s.common.Instruction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Instruction
call
(int argn, boolean hasSelf) static Instruction
callNew
(int argn) static Instruction
debug()
A special NOP instruction telling any debugger to pausestatic Instruction
delete()
Performs a JS object property deletion.static Instruction
discard()
static Instruction
dup()
static Instruction
dup
(int count, int offset) <T> T
get
(int i) static Instruction
static Instruction
static Instruction
static Instruction
jmp
(int offset) static IntFunction<Instruction>
jmp
(IntSupplier pos) static Instruction
jmpIf
(int offset) static IntFunction<Instruction>
jmpIf
(IntSupplier pos) static Instruction
jmpIfNot
(int offset) static IntFunction<Instruction>
jmpIfNot
(IntSupplier pos) static Instruction
loadArg
(int i) Loads the given argumentstatic Instruction
loadArgs()
Pushes the arguments object to the stackstatic Instruction
Pushes the amount of arguments to the stackstatic Instruction
loadArr
(int count) static Instruction
Loads a reference to the function being calledstatic Instruction
static Instruction
static Instruction
loadGlob()
static Instruction
loadIntrinsics
(String key) static Instruction
static Instruction
loadMember
(int member) static Instruction
loadMember
(String member) static Instruction
loadObj()
static Instruction
loadThis()
static Instruction
loadVar
(int i) static Instruction
Does nothing.static Instruction
static Instruction
pushNull()
static Instruction
static Instruction
pushValue
(boolean val) static Instruction
pushValue
(double val) static Instruction
static Instruction
ret()
Returns the top stack valuestatic Instruction
static Instruction
storeMember
(boolean keep) static Instruction
storeMember
(int key) static Instruction
storeMember
(int key, boolean keep) static Instruction
storeMember
(String key) static Instruction
storeMember
(String key, boolean keep) static Instruction
storeVar
(int i, boolean keep) static Instruction
Throws the top stack valuestatic Instruction
throwSyntax
(String err) Converts the given exception to a runtime syntax error and throws itstatic Instruction
throwSyntax
(Location loc, String err) Converts the given exception to a runtime syntax error and throws itstatic Instruction
Converts the given exception to a runtime syntax error and throws ittoString()
static Instruction
tryEnd()
Signifies that the current protected section (try, catch or finally) has endedstatic Instruction
tryStart
(int catchStart, int finallyStart, int end) Signals the start of a protected context
-
Field Details
-
type
-
params
-
-
Method Details
-
get
public <T> T get(int i) -
tryStart
Signals the start of a protected context- Parameters:
catchStart
- The point to witch to jump if an error has been caughtfinallyStart
- The point to witch to jump after either the try or catch bodies have exitedend
- The point to which to jump after exiting the whole protected context
-
tryEnd
Signifies that the current protected section (try, catch or finally) has ended -
throwInstr
Throws the top stack value -
throwSyntax
Converts the given exception to a runtime syntax error and throws it -
throwSyntax
Converts the given exception to a runtime syntax error and throws it -
throwSyntax
Converts the given exception to a runtime syntax error and throws it -
delete
Performs a JS object property deletion. Operands: 1. Object to manipulate 2. Key to delete -
ret
Returns the top stack value -
debug
A special NOP instruction telling any debugger to pause -
nop
Does nothing. May be used for metadata or implementation-specific instructions that don't alter the behavior -
call
-
callNew
-
jmp
-
jmpIf
-
jmpIfNot
-
jmp
-
jmpIf
-
jmpIfNot
-
pushUndefined
-
pushNull
-
pushValue
-
pushValue
-
pushValue
-
globDef
-
globGet
-
globSet
-
loadVar
-
loadThis
-
loadArg
Loads the given argument- Parameters:
i
- The index of the argument to load. If -1, will get the index from the stack instead
-
loadArgsN
Pushes the amount of arguments to the stack -
loadArgs
Pushes the arguments object to the stack -
loadCalled
Loads a reference to the function being called -
loadGlob
-
loadIntrinsics
-
loadError
-
loadMember
-
loadMember
-
loadMember
-
loadFunc
-
loadObj
-
loadArr
-
dup
-
dup
-
storeVar
-
storeMember
-
storeMember
-
storeMember
-
storeMember
-
storeMember
-
storeMember
-
discard
-
operation
-
toString
-