Example #1
0
static const char *
var_to_str (vm_instr_t instr, lit_cpointer_t lit_ids[], vm_instr_counter_t oc, uint8_t current_arg)
{
  JERRY_ASSERT (current_arg >= 1 && current_arg <= 3);

  if (instr.data.raw_args[current_arg - 1] == VM_IDX_REWRITE_LITERAL_UID)
  {
    JERRY_ASSERT (lit_ids != NULL);
    JERRY_ASSERT (lit_ids[current_arg - 1].packed_value != MEM_CP_NULL);

    return lit_cp_to_str (lit_ids[current_arg - 1]);
  }
  else if (instr.data.raw_args[current_arg - 1] >= 128)
  {
    return tmp_id_to_str (instr.data.raw_args[current_arg - 1]);
  }
  else
  {
    return lit_cp_to_str (serializer_get_literal_cp_by_uid (instr.data.raw_args[current_arg - 1], NULL, oc));
  }
}
Example #2
0
static const char *
var_to_str (vm_instr_t instr, lit_cpointer_t lit_ids[], vm_instr_counter_t oc, uint8_t current_arg)
{
  raw_instr raw = *(raw_instr*) &instr;
  if (raw.uids[current_arg] == LITERAL_TO_REWRITE)
  {
    if (lit_ids == NULL)
    {
      return "hz";
    }
    JERRY_ASSERT (lit_ids[current_arg - 1].packed_value != MEM_CP_NULL);
    return lit_cp_to_str (lit_ids[current_arg - 1]);
  }
  else if (raw.uids[current_arg] >= 128)
  {
    return tmp_id_to_str (raw.uids[current_arg]);
  }
  else
  {
    return lit_cp_to_str (serializer_get_literal_cp_by_uid (raw.uids[current_arg], NULL, oc));
  }
}