logo

const final enum

compiler::FOpArg

sys::Obj
  sys::Enum
    compiler::FOpArg
//
// Copyright (c) 2006, Brian Frank and Andy Frank
// Licensed under the Academic Free License version 3.0
//
// History:
//   11 Sep 07  Auto-generated by /adm/genfcode.rb
//

**
** FOp provides all the fcode constants
**
enum FOp
{
  Nop                (),                  //   0  no operation
  LoadNull           (),                  //   1  load null literal onto stack
  LoadFalse          (),                  //   2  load false literal onto stack
  LoadTrue           (),                  //   3  load true literal onto stack
  LoadInt            (FOpArg.Int),        //   4  load Int const by index onto stack
  LoadFloat          (FOpArg.Float),      //   5  load Float const by index onto stack
  LoadStr            (FOpArg.Str),        //   6  load Str const by index onto stack
  LoadDuration       (FOpArg.Duration),   //   7  load Duration const by index onto stack
  LoadType           (FOpArg.TypeRef),    //   8  load Type instance by index onto stack
  LoadUri            (FOpArg.Uri),        //   9  load Uri const by index onto stack
  LoadVar            (FOpArg.Register),   //  10  local var register index (0 is this)
  StoreVar           (FOpArg.Register),   //  11  local var register index (0 is this)
  LoadInstance       (FOpArg.FieldRef),   //  12  load field from storage
  StoreInstance      (FOpArg.FieldRef),   //  13  store field to storage
  LoadStatic         (FOpArg.FieldRef),   //  14  load static field from storage
  StoreStatic        (FOpArg.FieldRef),   //  15  store static field to storage
  Unused1            (),                  //  16  unsed opcode
  Unused2            (),                  //  17  unsed opcode
  LoadMixinStatic    (FOpArg.FieldRef),   //  18  load static on mixin field from storage
  StoreMixinStatic   (FOpArg.FieldRef),   //  19  store static on mixin field to storage
  CallNew            (FOpArg.MethodRef),  //  20  alloc new object and call constructor
  CallCtor           (FOpArg.MethodRef),  //  21  call constructor (used for constructor chaining)
  CallStatic         (FOpArg.MethodRef),  //  22  call static method
  CallVirtual        (FOpArg.MethodRef),  //  23  call virtual instance method
  CallNonVirtual     (FOpArg.MethodRef),  //  24  call instance method non-virtually (private or super only b/c of Java invokespecial)
  CallMixinStatic    (FOpArg.MethodRef),  //  25  call static mixin method
  CallMixinVirtual   (FOpArg.MethodRef),  //  26  call virtual mixin method
  CallMixinNonVirtual (FOpArg.MethodRef),  //  27  call instance mixin method non-virtually (named super)
  Jump               (FOpArg.Jump),       //  28  unconditional jump
  JumpTrue           (FOpArg.Jump),       //  29  jump if bool true
  JumpFalse          (FOpArg.Jump),       //  30  jump if bool false
  CmpEQ              (),                  //  31  a.equals(b)
  CmpNE              (),                  //  32  !a.equals(b)
  Cmp                (),                  //  33  a.compare(b)
  CmpLE              (),                  //  34  a.compare(b) <= 0
  CmpLT              (),                  //  35  a.compare(b) < 0
  CmpGT              (),                  //  36  a.compare(b) > 0
  CmpGE              (),                  //  37  a.compare(b) >= 0
  CmpSame            (),                  //  38  a === b
  CmpNotSame         (),                  //  39  a !== b
  CmpNull            (),                  //  40  a == null
  CmpNotNull         (),                  //  41  a != null
  ReturnVoid         (),                  //  42  return nothing
  ReturnObj          (),                  //  43  return object
  Pop                (),                  //  44  pop top object off stack
  Dup                (),                  //  45  duplicate object ref on top of stack
  DupDown            (),                  //  46  TODO - remove when we axe Java compiler
  Is                 (FOpArg.TypeRef),    //  47  is operator
  As                 (FOpArg.TypeRef),    //  48  as operator
  Cast               (FOpArg.TypeRef),    //  49  type cast
  Switch             (),                  //  50  switch jump table 2 count + 2*count
  Throw              (),                  //  51  throw Err on top of stack
  Leave              (FOpArg.Jump),       //  52  jump out of a try or catch block
  JumpFinally        (FOpArg.Jump),       //  53  jump to a finally block
  CatchAllStart      (),                  //  54  start catch all block - do not leave Err on stack
  CatchErrStart      (FOpArg.TypeRef),    //  55  start catch block - leave typed Err on stack
  CatchEnd           (),                  //  56  start catch block - leave typed Err on stack
  FinallyStart       (),                  //  57  starting instruction of a finally block
  FinallyEnd         ()                   //  58  ending instruction of a finally block

  private new make(FOpArg arg := FOpArg.None) { this.arg = arg }

  const FOpArg arg
}

**************************************************************************
** FOpArg
**************************************************************************

enum FOpArg
{
  None,
  Int,
  Float,
  Str,
  Duration,
  Uri,
  Register,
  TypeRef,
  FieldRef,
  MethodRef,
  Jump
}