Exemplo n.º 1
0
  private IrOp loadDefine(IrOp op) {
    IrField field = op.argToField();

    // in the end a Log definition becomes a
    // normal static field
    if (field.type.isLog()) {
      op.opcode = SCode.LoadConstStatic;
      return op;
    }

    // array literals use an internal bytecode which actually
    // gets written as LoadBuf (to maintain compatibility with
    // older SVMs); we stash the literal instance on the op itself
    if (field.type.isArray()) {
      op.opcode = SCode.LoadArrayLiteral;
      op.resolvedArg = field.define();
      return op;
    }

    return CodeAsm.loadLiteral(field.define);
  }
Exemplo n.º 2
0
 private void predefine(String qname, int value) {
   IrField f = (IrField) ns.resolveSlot(qname);
   f.define =
       new Expr.Literal(new Location("synthetic"), ns, Expr.INT_LITERAL, new Integer(value));
 }