Lines Matching +full:add +full:- +full:on
31 * Opcodes are accumulated with specific methods. A control-flow stack
60 cfPtr = -1; in WordBuilder()
69 * Build the word. The control-flow stack must be empty. A 'ret'
74 if (cfPtr != -1) { in Build()
75 throw new Exception("control-flow stack is not empty"); in Build()
77 if (jumpToLast || code[code.Count - 1].MayFallThrough) { in Build()
86 void Add(Opcode op) in Add() method in WordBuilder
88 Add(op, null); in Add()
91 void Add(Opcode op, string refName) in Add() method in WordBuilder
93 code.Add(op); in Add()
94 toResolve.Add(refName); in Add()
99 * Rotate the control-flow stack at depth 'depth'.
103 int x = cfStack[cfPtr - depth]; in CSRoll()
104 Array.Copy(cfStack, cfPtr - (depth - 1), in CSRoll()
105 cfStack, cfPtr - depth, depth); in CSRoll()
110 * Make a copy of the control-flow element at depth 'depth', and
111 * push it on top of the control-flow stack.
115 int x = cfStack[cfPtr - depth]; in CSPick()
132 return cfStack[cfPtr --]; in CSPop()
136 * Push an origin on the control-flow stack, corresponding to the
137 * next opcode to add.
145 * Push a destination on the control-flow stack, corresponding to
146 * the next opcode to add.
150 CSPush(-code.Count - 1); in CSPushDest()
154 * Pop an origin from the control-flow stack. An exception is
167 * Pop a destination from the control-flow stack. An exception is
176 return -x - 1; in CSPopDest()
180 * Add a "push literal" opcode.
184 Add(new OpcodeConst(v)); in Literal()
191 * - If the target is '>' followed by a local variable name, then
194 * - Otherwise, if the target is a local variable name, then a
197 * - Otherwise, a call to the named word is added. The target name
198 * will be resolved later on (typically, when the word containing
215 Add(new OpcodePutLocal(lnum)); in Call()
217 Add(new OpcodeGetLocal(lnum)); in Call()
220 Add(new OpcodeCall(), target); in Call()
225 * Add a "call" opcode to the designated word.
229 Add(new OpcodeCall(wtarget), null); in CallExt()
233 * Add a "call" opcode to a word which is not currently resolved.
238 Add(new OpcodeCall(), target); in CallExt()
242 * Add a "get local" opcode; the provided local name must already
249 Add(new OpcodeGetLocal(lnum)); in GetLocal()
256 * Add a "put local" opcode; the provided local name must already
263 Add(new OpcodePutLocal(lnum)); in PutLocal()
282 * Add a "call" opcode whose target is an XT value (which may be
288 Add(new OpcodeCall(), xt.Name); in Call()
290 Add(new OpcodeCall(xt.Target)); in Call()
295 * Add a "ret" opcode.
299 Add(new OpcodeRet()); in Ret()
303 * Add a forward unconditional jump. The new opcode address is
304 * pushed on the control-flow stack as an origin.
309 Add(new OpcodeJumpUncond()); in Ahead()
313 * Add a forward conditional jump, which will be taken at runtime
314 * if the top-of-stack value is 'true'. The new opcode address is
315 * pushed on the control-flow stack as an origin.
320 Add(new OpcodeJumpIf()); in AheadIf()
324 * Add a forward conditional jump, which will be taken at runtime
325 * if the top-of-stack value is 'false'. The new opcode address is
326 * pushed on the control-flow stack as an origin.
331 Add(new OpcodeJumpIfNot()); in AheadIfNot()
336 * The top of control-flow stack is popped and must be an origin.
341 code[x].ResolveJump(code.Count - x - 1); in Then()
346 * Push the current code address on the control-flow stack as a
355 * Add a backward unconditional jump. The jump target is popped
356 * from the control-flow stack as a destination.
361 Add(new OpcodeJumpUncond(x - code.Count - 1)); in Again()
365 * Add a backward conditional jump, which will be taken at runtime
366 * if the top-of-stack value is 'true'. The jump target is popped
367 * from the control-flow stack as a destination.
372 Add(new OpcodeJumpIf(x - code.Count - 1)); in AgainIf()
376 * Add a backward conditional jump, which will be taken at runtime
377 * if the top-of-stack value is 'false'. The jump target is popped
378 * from the control-flow stack as a destination.
383 Add(new OpcodeJumpIfNot(x - code.Count - 1)); in AgainIfNot()