void
serializer_print_opcodes (void)
{
#ifdef JERRY_ENABLE_PRETTY_PRINTER
  opcode_counter_t loc;

  if (!print_opcodes)
  {
    return;
  }

  printf ("AFTER OPTIMIZER:\n");

  for (loc = 0; loc < bytecode_data.opcodes_count; loc++)
  {
    op_meta opm;

    opm.op = bytecode_data.opcodes[loc];
    for (int i = 0; i < 3; i++)
    {
      opm.lit_id[i] = NOT_A_LITERAL;
    }

    pp_op_meta (loc, opm, false);
  }
#endif
}
void
serializer_rewrite_op_meta (const opcode_counter_t loc, op_meta op)
{
  scopes_tree_set_op_meta (current_scope, loc, op);

#ifdef JERRY_ENABLE_PRETTY_PRINTER
  if (print_opcodes)
  {
    pp_op_meta (loc, op, true);
  }
#endif
}
void
serializer_dump_op_meta (op_meta op)
{
  JERRY_ASSERT (scopes_tree_opcodes_num (current_scope) < MAX_OPCODES);

  scopes_tree_add_op_meta (current_scope, op);

#ifdef JERRY_ENABLE_PRETTY_PRINTER
  if (print_opcodes)
  {
    pp_op_meta ((opcode_counter_t) (scopes_tree_opcodes_num (current_scope) - 1), op, false);
  }
#endif
}
Beispiel #4
0
static void
serializer_print_instrs (const bytecode_data_header_t *bytecode_data_p)
{
#ifdef JERRY_ENABLE_PRETTY_PRINTER
  for (vm_instr_counter_t loc = 0; loc < bytecode_data_p->instrs_count; loc++)
  {
    op_meta opm;

    opm.op = bytecode_data_p->instrs_p[loc];
    for (int i = 0; i < 3; i++)
    {
      opm.lit_id[i] = NOT_A_LITERAL;
    }

    pp_op_meta (bytecode_data_p, loc, opm, false);
  }
#else
  (void) bytecode_data_p;
#endif
}
Beispiel #5
0
static void
serializer_print_instrs (const vm_instr_t *instrs_p,
                         size_t instrs_count)
{
#ifdef JERRY_ENABLE_PRETTY_PRINTER
  for (vm_instr_counter_t loc = 0; loc < instrs_count; loc++)
  {
    op_meta opm;

    opm.op = instrs_p[loc];
    for (int i = 0; i < 3; i++)
    {
      opm.lit_id[i] = NOT_A_LITERAL;
    }

    pp_op_meta (instrs_p, loc, opm, false);
  }
#else
  (void) instrs_p;
  (void) instrs_count;
#endif
}