Example #1
0
void invoke_setter(methodmap_method_t *method, int save)
{
  if (!method->setter) {
    error(152, method->name);
    return;
  }

  if (save)
    pushreg(sPRI);
  pushreg(sPRI);
  pushreg(sALT);
  ffcall(method->setter, NULL, 2);
  if (save)
    popreg(sPRI);

  if (sc_status != statSKIP)
    markusage(method->setter, uREAD);
}
Value* allocate(Value v) {
    Value *loc;

    pushreg(&v);
    loc = allocloc();
    popreg(&v);
    assert(loc != NULL);
    *loc = v;
    return loc;
}
Example #3
0
void invoke_getter(methodmap_method_t *method)
{
  if (!method->getter) {
    error(149, method->name);
    return;
  }

  // sysreq.n N 1
  // stack 8
  pushreg(sPRI);
  ffcall(method->getter, NULL, 1);

  if (sc_status != statSKIP)
    markusage(method->getter, uREAD);
}
Example #4
0
// Load the hidden array argument into ALT.
void load_hidden_arg()
{
  pushreg(sPRI);

  // Compute an address to the first argument, then add the argument count
  // to find the address after the final argument:
  //    addr.alt   0xc   ; Compute &first_arg
  //    load.s.alt 0x8   ; Load arg count
  //    idxaddr          ; Compute (&first_arg) + argcount
  //    load.i           ; Load *(&first_arg + argcount)
  //    move.alt         ; Move result into ALT.
  addr_reg(0xc, sALT);
  load_argcount(sPRI);
  idxaddr();
  load_i();
  move_alt();

  popreg(sPRI);
}