|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xwt.js.JS org.xwt.js.JS.Obj org.xwt.js.Function
a JavaScript function, compiled into bytecode
Nested Class Summary | |
static class |
Function.CallMarker
|
static class |
Function.CatchMarker
|
static class |
Function.FinallyData
|
static class |
Function.LoopMarker
|
static class |
Function.TryMarker
|
Nested classes inherited from class org.xwt.js.JS |
JS.Array, JS.Callable, JS.Context, JS.Exn, JS.GlobalScope, JS.Graft, JS.Obj, JS.Scope, JS.TailCall |
Field Summary | |
static int |
ADD
|
static int |
AND
|
static byte |
ARRAY
push a new array onto the stack with length equal to the literal |
static int |
ASSERT
|
static int |
ASSIGN
|
static int |
ASSIGN_ADD
|
static int |
ASSIGN_BITAND
|
static int |
ASSIGN_BITNOT
|
static int |
ASSIGN_BITOR
|
static int |
ASSIGN_BITXOR
|
static int |
ASSIGN_DIV
|
static int |
ASSIGN_LSH
|
static int |
ASSIGN_MOD
|
static int |
ASSIGN_MUL
|
static int |
ASSIGN_RSH
|
static int |
ASSIGN_SUB
|
static int |
ASSIGN_URSH
|
static int |
BANG
|
static int |
BITAND
|
static int |
BITNOT
|
static int |
BITOR
|
static int |
BITXOR
|
static int |
BREAK
|
static java.lang.String[] |
bytecodeToString
|
static byte |
CALL
pop two elements; call stack[-n](stack[-n+1], stack[-n+2]...) where n is the number of args to the function |
static byte |
CALL_REVERSED
same as CALL, except that the function is on top of the arguments instead of beneath them |
static byte |
CALLMETHOD
pop three elements off the stack; method arguments, method name, and an object to call the method on, then calls the method Has a similar effect a a GET followed by a CALL |
static int |
CASE
|
static int |
CATCH
|
static java.lang.String[] |
codeToString
|
static int |
COLON
|
static int |
COMMA
|
static int |
CONTINUE
|
static int |
DEC
|
static byte |
DECLARE
if given a non-null argument declare its argument in the current scope and push it to the stack, else, declares the element on the top of the stack and leaves it there |
static int |
DEFAULT
|
static int |
DIV
|
static int |
DO
|
static int |
DOT
|
static byte |
DUP
push a copy of the top stack element |
static int |
ELSE
|
static int |
EQ
|
static int |
FALSE
|
static int |
FINALLY
|
static byte |
FINALLY_DONE
finish a finally block and carry out whatever instruction initiated the finally block |
static int |
FOR
|
static int |
FUNCTION
|
static int |
GE
|
static byte |
GET
if given a null literal pop two elements off the stack; push stack[-1].get(stack[top]) else pop one element off the stack, push stack[top].get(literal) |
static byte |
GET_PRESERVE
push stack[-1].get(stack[top]) |
static int |
GT
|
static int |
HOOK
|
static int |
IF
|
static int |
IN
|
static int |
INC
|
static byte |
JF
literal is a relative address; pop stacktop and jump if the value is false |
static byte |
JMP
literal is a relative address; jump to it |
static byte |
JT
literal is a relative address; pop stacktop and jump if the value is true |
static byte |
LABEL
a NOP; confers a label upon the following instruction |
static int |
LB
|
static int |
LC
|
static int |
LE
|
static byte |
LITERAL
push the literal onto the stack |
static byte |
LOOP
execute the ForthBlock pointed to by the literal until BREAK encountered; push TRUE onto the stack for the first iteration and FALSE for all subsequent iterations |
static int |
LP
|
static int |
LSH
|
static int |
LT
|
static int |
MAX_TOKEN
|
static int |
MOD
|
static int |
MUL
|
static int |
NAME
|
static int |
NE
|
static byte |
NEWFUNCTION
create a new instance; literal is a reference to the corresponding ForthBlock |
static byte |
NEWSCOPE
execute the ForthBlock pointed to by the literal in a fresh scope with parentScope==THIS |
static int |
NULL
|
static int |
NUMBER
|
static byte |
OBJECT
push an empty object onto the stack |
static byte |
OLDSCOPE
execute the ForthBlock pointed to by the literal in a fresh scope with parentScope==THIS |
static int |
OR
|
static byte |
POP
discard the top stack element |
static byte |
PUSHKEYS
pop an element; push a JS.JS.Array containing the keys of the popped element |
static byte |
PUT
pop two elements off the stack; stack[-2].put(stack[-1], stack[top]); push stack[top] |
static int |
RB
|
static int |
RC
|
static int |
RESERVED
|
static int |
RETURN
|
static int |
RP
|
static int |
RSH
|
static int |
SEMI
|
static int |
SHEQ
|
static int |
SHNE
|
static int |
STRING
|
static int |
SUB
|
static byte |
SWAP
swap the top two elements on the stack |
static int |
SWITCH
|
static int |
THIS
|
static int |
THROW
|
static byte |
TOPSCOPE
push a reference to the current scope onto the stack |
static int |
TRUE
|
static int |
TRY
|
static int |
TYPEOF
|
static int |
URSH
|
static int |
VAR
|
static int |
WHILE
|
static int |
WITH
|
Constructor Summary | |
protected |
Function(java.lang.String sourceName,
int firstLine,
java.io.Reader sourceCode,
JS.Scope parentScope)
|
Method Summary | |
java.lang.String |
dump()
|
int |
getNumFormalArgs()
|
java.lang.String |
toString()
|
Methods inherited from class org.xwt.js.JS.Obj |
get, get, keys, put, put2, setSeal |
Methods inherited from class org.xwt.js.JS |
callMethod, coerceToBoolean, coerceToNumber, coerceToString, parse, toBoolean, toDouble, toInt, toLong, toNumber, toString, typeName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte LITERAL
public static final byte ARRAY
public static final byte OBJECT
public static final byte NEWFUNCTION
public static final byte DECLARE
public static final byte TOPSCOPE
public static final byte GET
public static final byte GET_PRESERVE
public static final byte PUT
public static final byte JT
public static final byte JF
public static final byte JMP
public static final byte POP
public static final byte CALL
public static final byte PUSHKEYS
public static final byte SWAP
public static final byte NEWSCOPE
public static final byte OLDSCOPE
public static final byte DUP
public static final byte LABEL
public static final byte LOOP
public static final byte CALLMETHOD
public static final byte FINALLY_DONE
public static final byte CALL_REVERSED
public static final java.lang.String[] bytecodeToString
public static final int BITOR
public static final int ASSIGN_BITOR
public static final int BITXOR
public static final int ASSIGN_BITXOR
public static final int BITAND
public static final int ASSIGN_BITAND
public static final int LSH
public static final int ASSIGN_LSH
public static final int RSH
public static final int ASSIGN_RSH
public static final int URSH
public static final int ASSIGN_URSH
public static final int ADD
public static final int ASSIGN_ADD
public static final int SUB
public static final int ASSIGN_SUB
public static final int MUL
public static final int ASSIGN_MUL
public static final int DIV
public static final int ASSIGN_DIV
public static final int MOD
public static final int ASSIGN_MOD
public static final int BITNOT
public static final int ASSIGN_BITNOT
public static final int OR
public static final int AND
public static final int BANG
public static final int EQ
public static final int NE
public static final int LT
public static final int LE
public static final int GT
public static final int GE
public static final int SHEQ
public static final int SHNE
public static final int RETURN
public static final int TYPEOF
public static final int BREAK
public static final int CONTINUE
public static final int TRY
public static final int THROW
public static final int ASSERT
public static final int NAME
public static final int NUMBER
public static final int STRING
public static final int NULL
public static final int THIS
public static final int FALSE
public static final int TRUE
public static final int IN
public static final int SEMI
public static final int LB
public static final int RB
public static final int LC
public static final int RC
public static final int LP
public static final int RP
public static final int COMMA
public static final int ASSIGN
public static final int HOOK
public static final int COLON
public static final int INC
public static final int DEC
public static final int DOT
public static final int FUNCTION
public static final int IF
public static final int ELSE
public static final int SWITCH
public static final int CASE
public static final int DEFAULT
public static final int WHILE
public static final int DO
public static final int FOR
public static final int VAR
public static final int WITH
public static final int CATCH
public static final int FINALLY
public static final int RESERVED
public static final int MAX_TOKEN
public static final java.lang.String[] codeToString
Constructor Detail |
protected Function(java.lang.String sourceName, int firstLine, java.io.Reader sourceCode, JS.Scope parentScope) throws java.io.IOException
Method Detail |
public int getNumFormalArgs()
public java.lang.String toString()
public java.lang.String dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |