Ejemplo n.º 1
0
/**
 * Print heap memory usage statistics
 */
void
jmem_heap_stats_print (void)
{
  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);

  JERRY_DEBUG_MSG ("Heap stats:\n"
                   "  Heap size = %zu bytes\n"
                   "  Allocated = %zu bytes\n"
                   "  Waste = %zu bytes\n"
                   "  Peak allocated = %zu bytes\n"
                   "  Peak waste = %zu bytes\n"
                   "  Skip-ahead ratio = %zu.%04zu\n"
                   "  Average alloc iteration = %zu.%04zu\n"
                   "  Average free iteration = %zu.%04zu\n"
                   "\n",
                   heap_stats->size,
                   heap_stats->allocated_bytes,
                   heap_stats->waste_bytes,
                   heap_stats->peak_allocated_bytes,
                   heap_stats->peak_waste_bytes,
                   heap_stats->skip_count / heap_stats->nonskip_count,
                   heap_stats->skip_count % heap_stats->nonskip_count * 10000 / heap_stats->nonskip_count,
                   heap_stats->alloc_iter_count / heap_stats->alloc_count,
                   heap_stats->alloc_iter_count % heap_stats->alloc_count * 10000 / heap_stats->alloc_count,
                   heap_stats->free_iter_count / heap_stats->free_count,
                   heap_stats->free_iter_count % heap_stats->free_count * 10000 / heap_stats->free_count);
} /* jmem_heap_stats_print */
Ejemplo n.º 2
0
/**
 * Print pools memory usage statistics
 */
void
jmem_pools_stats_print (void)
{
  jmem_pools_stats_t *pools_stats = &JERRY_CONTEXT (jmem_pools_stats);

  JERRY_DEBUG_MSG ("Pools stats:\n"
                   "  Pool chunks: %zu\n"
                   "  Peak pool chunks: %zu\n"
                   "  Free chunks: %zu\n"
                   "  Pool reuse ratio: %zu.%04zu\n",
                   pools_stats->pools_count,
                   pools_stats->peak_pools_count,
                   pools_stats->free_chunks,
                   pools_stats->reused_count / pools_stats->new_alloc_count,
                   pools_stats->reused_count % pools_stats->new_alloc_count * 10000 / pools_stats->new_alloc_count);
} /* jmem_pools_stats_print */
Ejemplo n.º 3
0
/**
 * Receive message from the client.
 *
 * @return true - if message is processed successfully
 *         false - otherwise
 */
inline bool __attr_always_inline___
jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer to the received data */
                                uint32_t message_size, /**< message size */
                                bool *resume_exec_p, /**< pointer to the resume exec flag */
                                uint8_t *expected_message_type_p, /**< message type */
                                jerry_debugger_uint8_data_t **message_data_p) /**< custom message data */
{
  /* Process the received message. */

  if (recv_buffer_p[0] >= JERRY_DEBUGGER_CONTINUE
      && !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
  {
    JERRY_ERROR_MSG ("Message requires breakpoint mode\n");
    jerry_debugger_close_connection ();
    return false;
  }

  if (*expected_message_type_p != 0)
  {
    JERRY_ASSERT (*expected_message_type_p == JERRY_DEBUGGER_EVAL_PART
                  || *expected_message_type_p == JERRY_DEBUGGER_CLIENT_SOURCE_PART);

    jerry_debugger_uint8_data_t *uint8_data_p = (jerry_debugger_uint8_data_t *) *message_data_p;

    if (recv_buffer_p[0] != *expected_message_type_p)
    {
      jmem_heap_free_block (uint8_data_p, uint8_data_p->uint8_size + sizeof (jerry_debugger_uint8_data_t));
      JERRY_ERROR_MSG ("Unexpected message\n");
      jerry_debugger_close_connection ();
      return false;
    }

    JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_uint8_data_part_t, uint8_data_part_p);

    if (message_size < sizeof (jerry_debugger_receive_uint8_data_part_t) + 1)
    {
      jmem_heap_free_block (uint8_data_p, uint8_data_p->uint8_size + sizeof (jerry_debugger_uint8_data_t));
      JERRY_ERROR_MSG ("Invalid message size\n");
      jerry_debugger_close_connection ();
      return false;
    }

    uint32_t expected_data = uint8_data_p->uint8_size - uint8_data_p->uint8_offset;

    message_size -= (uint32_t) sizeof (jerry_debugger_receive_uint8_data_part_t);

    if (message_size > expected_data)
    {
      jmem_heap_free_block (uint8_data_p, uint8_data_p->uint8_size + sizeof (jerry_debugger_uint8_data_t));
      JERRY_ERROR_MSG ("Invalid message size\n");
      jerry_debugger_close_connection ();
      return false;
    }

    lit_utf8_byte_t *string_p = (lit_utf8_byte_t *) (uint8_data_p + 1);
    memcpy (string_p + uint8_data_p->uint8_offset,
            (lit_utf8_byte_t *) (uint8_data_part_p + 1),
            message_size);

    if (message_size < expected_data)
    {
      uint8_data_p->uint8_offset += message_size;
      return true;
    }

    bool result;

    if (*expected_message_type_p == JERRY_DEBUGGER_EVAL_PART)
    {
      if (jerry_debugger_send_eval (string_p, uint8_data_p->uint8_size))
      {
        *resume_exec_p = true;
      }
      result = (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED) != 0;
    }
    else
    {
      result = true;
      JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_CLIENT_SOURCE_MODE);
      *resume_exec_p = true;
    }

    *expected_message_type_p = 0;
    return result;
  }

  switch (recv_buffer_p[0])
  {
    case JERRY_DEBUGGER_FREE_BYTE_CODE_CP:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_byte_code_cp_t);

      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_byte_code_cp_t, byte_code_p);

      jmem_cpointer_t byte_code_free_cp;
      memcpy (&byte_code_free_cp, byte_code_p->byte_code_cp, sizeof (jmem_cpointer_t));

      if (byte_code_free_cp != JERRY_CONTEXT (debugger_byte_code_free_tail))
      {
        JERRY_ERROR_MSG ("Invalid byte code free order\n");
        jerry_debugger_close_connection ();
        return false;
      }

      jerry_debugger_byte_code_free_t *byte_code_free_p;
      byte_code_free_p = JMEM_CP_GET_NON_NULL_POINTER (jerry_debugger_byte_code_free_t,
                                                       byte_code_free_cp);

      if (byte_code_free_p->prev_cp != ECMA_NULL_POINTER)
      {
        JERRY_CONTEXT (debugger_byte_code_free_tail) = byte_code_free_p->prev_cp;
      }
      else
      {
        JERRY_CONTEXT (debugger_byte_code_free_head) = ECMA_NULL_POINTER;
        JERRY_CONTEXT (debugger_byte_code_free_tail) = ECMA_NULL_POINTER;
      }

#ifdef JMEM_STATS
      jmem_stats_free_byte_code_bytes (((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
#endif /* JMEM_STATS */

      jmem_heap_free_block (byte_code_free_p,
                            ((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
      return true;
    }

    case JERRY_DEBUGGER_UPDATE_BREAKPOINT:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_update_breakpoint_t);

      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_update_breakpoint_t, update_breakpoint_p);

      jmem_cpointer_t byte_code_cp;
      memcpy (&byte_code_cp, update_breakpoint_p->byte_code_cp, sizeof (jmem_cpointer_t));
      uint8_t *byte_code_p = JMEM_CP_GET_NON_NULL_POINTER (uint8_t, byte_code_cp);

      uint32_t offset;
      memcpy (&offset, update_breakpoint_p->offset, sizeof (uint32_t));
      byte_code_p += offset;

      JERRY_ASSERT (*byte_code_p == CBC_BREAKPOINT_ENABLED || *byte_code_p == CBC_BREAKPOINT_DISABLED);

      *byte_code_p = update_breakpoint_p->is_set_breakpoint ? CBC_BREAKPOINT_ENABLED : CBC_BREAKPOINT_DISABLED;
      return true;
    }

    case JERRY_DEBUGGER_MEMSTATS:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      jerry_debugger_send_memstats ();
      return true;
    }

    case JERRY_DEBUGGER_STOP:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_STOP);
      JERRY_CONTEXT (debugger_stop_context) = NULL;
      *resume_exec_p = false;
      return true;
    }

    case JERRY_DEBUGGER_CONTINUE:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_VM_STOP);
      JERRY_CONTEXT (debugger_stop_context) = NULL;
      *resume_exec_p = true;
      return true;
    }

    case JERRY_DEBUGGER_STEP:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_STOP);
      JERRY_CONTEXT (debugger_stop_context) = NULL;
      *resume_exec_p = true;
      return true;
    }

    case JERRY_DEBUGGER_NEXT:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_STOP);
      JERRY_CONTEXT (debugger_stop_context) = JERRY_CONTEXT (vm_top_context_p);
      *resume_exec_p = true;
      return true;
    }

    case JERRY_DEBUGGER_FINISH:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_STOP);

      /* This will point to the current context's parent (where the function was called)
       * and in case of NULL the result will the same as in case of STEP. */
      JERRY_CONTEXT (debugger_stop_context) = JERRY_CONTEXT (vm_top_context_p->prev_context_p);
      *resume_exec_p = true;
      return true;
    }

    case JERRY_DEBUGGER_GET_BACKTRACE:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_get_backtrace_t);

      jerry_debugger_send_backtrace (recv_buffer_p);
      return true;
    }

    case JERRY_DEBUGGER_EXCEPTION_CONFIG:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_exception_config_t);
      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_exception_config_t, exception_config_p);

      if (exception_config_p->enable == 0)
      {
        JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_IGNORE_EXCEPTION);
        JERRY_DEBUG_MSG ("Stop at exception disabled\n");
      }
      else
      {
        JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_VM_IGNORE_EXCEPTION);
        JERRY_DEBUG_MSG ("Stop at exception enabled\n");
      }

      return true;
    }

    case JERRY_DEBUGGER_PARSER_CONFIG:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_parser_config_t);
      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_parser_config_t, parser_config_p);

      if (parser_config_p->enable_wait != 0)
      {
        JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_PARSER_WAIT);
        JERRY_DEBUG_MSG ("Waiting after parsing enabled\n");
      }
      else
      {
        JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_PARSER_WAIT);
        JERRY_DEBUG_MSG ("Waiting after parsing disabled\n");
      }

      return true;
    }

    case JERRY_DEBUGGER_PARSER_RESUME:
    {
      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_PARSER_WAIT_MODE))
      {
        JERRY_ERROR_MSG ("Not in parser wait mode\n");
        jerry_debugger_close_connection ();
        return false;
      }

      JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_PARSER_WAIT_MODE);
      return true;
    }

    case JERRY_DEBUGGER_EVAL:
    {
      if (message_size < sizeof (jerry_debugger_receive_eval_first_t) + 1)
      {
        JERRY_ERROR_MSG ("Invalid message size\n");
        jerry_debugger_close_connection ();
        return false;
      }

      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_eval_first_t, eval_first_p);

      uint32_t eval_size;
      memcpy (&eval_size, eval_first_p->eval_size, sizeof (uint32_t));

      if (eval_size <= JERRY_CONTEXT (debugger_max_receive_size) - sizeof (jerry_debugger_receive_eval_first_t))
      {
        if (eval_size != message_size - sizeof (jerry_debugger_receive_eval_first_t))
        {
          JERRY_ERROR_MSG ("Invalid message size\n");
          jerry_debugger_close_connection ();
          return false;
        }

        if (jerry_debugger_send_eval ((lit_utf8_byte_t *) (eval_first_p + 1), eval_size))
        {
          *resume_exec_p = true;
        }

        return (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED) != 0;
      }

      jerry_debugger_uint8_data_t *eval_uint8_data_p;
      size_t eval_data_size = sizeof (jerry_debugger_uint8_data_t) + eval_size;

      eval_uint8_data_p = (jerry_debugger_uint8_data_t *) jmem_heap_alloc_block (eval_data_size);

      eval_uint8_data_p->uint8_size = eval_size;
      eval_uint8_data_p->uint8_offset = (uint32_t) (message_size - sizeof (jerry_debugger_receive_eval_first_t));

      lit_utf8_byte_t *eval_string_p = (lit_utf8_byte_t *) (eval_uint8_data_p + 1);
      memcpy (eval_string_p,
              (lit_utf8_byte_t *) (eval_first_p + 1),
              message_size - sizeof (jerry_debugger_receive_eval_first_t));

      *message_data_p = eval_uint8_data_p;
      *expected_message_type_p = JERRY_DEBUGGER_EVAL_PART;

      return true;
    }

    case JERRY_DEBUGGER_CLIENT_SOURCE:
    {
      if (message_size <= sizeof (jerry_debugger_receive_client_source_first_t))
      {
        JERRY_ERROR_MSG ("Invalid message size\n");
        jerry_debugger_close_connection ();
        return false;
      }

      if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CLIENT_SOURCE_MODE))
      {
        JERRY_ERROR_MSG ("Not in client source mode\n");
        jerry_debugger_close_connection ();
        return false;
      }

      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_client_source_first_t, client_source_first_p);

      uint32_t client_source_size;
      memcpy (&client_source_size, client_source_first_p->code_size, sizeof (uint32_t));

      uint32_t header_size = sizeof (jerry_debugger_receive_client_source_first_t);

      if (client_source_size <= JERRY_CONTEXT (debugger_max_receive_size) - header_size
          && client_source_size != message_size - header_size)
      {
        JERRY_ERROR_MSG ("Invalid message size\n");
        jerry_debugger_close_connection ();
        return false;
      }

      jerry_debugger_uint8_data_t *client_source_data_p;
      size_t client_source_data_size = sizeof (jerry_debugger_uint8_data_t) + client_source_size;

      client_source_data_p = (jerry_debugger_uint8_data_t *) jmem_heap_alloc_block (client_source_data_size);

      client_source_data_p->uint8_size = client_source_size;
      client_source_data_p->uint8_offset = (uint32_t) (message_size
                                            - sizeof (jerry_debugger_receive_client_source_first_t));

      lit_utf8_byte_t *client_source_string_p = (lit_utf8_byte_t *) (client_source_data_p + 1);
      memcpy (client_source_string_p,
              (lit_utf8_byte_t *) (client_source_first_p + 1),
              message_size - sizeof (jerry_debugger_receive_client_source_first_t));

      *message_data_p = client_source_data_p;

      if (client_source_data_p->uint8_size != client_source_data_p->uint8_offset)
      {
        *expected_message_type_p = JERRY_DEBUGGER_CLIENT_SOURCE_PART;
      }
      else
      {
        JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_CLIENT_SOURCE_MODE);
        *resume_exec_p = true;
      }
      return true;
    }

    case JERRY_DEBUGGER_NO_MORE_SOURCES:
    {
      if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CLIENT_SOURCE_MODE))
      {
        JERRY_ERROR_MSG ("Not in client source mode\n");
        jerry_debugger_close_connection ();
        return false;
      }

      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_UPDATE_FLAGS (JERRY_DEBUGGER_CLIENT_NO_SOURCE, JERRY_DEBUGGER_CLIENT_SOURCE_MODE);

      *resume_exec_p = true;

      return true;
    }

    case JERRY_DEBUGGER_CONTEXT_RESET:
    {
      if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CLIENT_SOURCE_MODE))
      {
        JERRY_ERROR_MSG ("Not in client source mode\n");
        jerry_debugger_close_connection ();
        return false;
      }

      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);

      JERRY_DEBUGGER_UPDATE_FLAGS (JERRY_DEBUGGER_CONTEXT_RESET_MODE, JERRY_DEBUGGER_CLIENT_SOURCE_MODE);

      *resume_exec_p = true;

      return true;
    }

    default:
    {
      JERRY_ERROR_MSG ("Unexpected message.");
      jerry_debugger_close_connection ();
      return false;
    }
  }
} /* jerry_debugger_process_message */
Ejemplo n.º 4
0
/**
 * RegExp bytecode dumper
 */
void
re_dump_bytecode (re_bytecode_ctx_t *bc_ctx_p) /**< RegExp bytecode context */
{
    re_compiled_code_t *compiled_code_p = (re_compiled_code_t *) bc_ctx_p->block_start_p;
    JERRY_DEBUG_MSG ("%d ", compiled_code_p->header.status_flags);
    JERRY_DEBUG_MSG ("%d ", compiled_code_p->num_of_captures);
    JERRY_DEBUG_MSG ("%d | ", compiled_code_p->num_of_non_captures);

    uint8_t *bytecode_p = (uint8_t *) (compiled_code_p + 1);

    re_opcode_t op;
    while ((op = re_get_opcode (&bytecode_p)))
    {
        switch (op)
        {
        case RE_OP_MATCH:
        {
            JERRY_DEBUG_MSG ("MATCH, ");
            break;
        }
        case RE_OP_CHAR:
        {
            JERRY_DEBUG_MSG ("CHAR ");
            JERRY_DEBUG_MSG ("%c, ", (char) re_get_char (&bytecode_p));
            break;
        }
        case RE_OP_CAPTURE_NON_GREEDY_ZERO_GROUP_START:
        {
            JERRY_DEBUG_MSG ("N");
            /* FALLTHRU */
        }
        case RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START:
        {
            JERRY_DEBUG_MSG ("GZ_START ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_CAPTURE_GROUP_START:
        {
            JERRY_DEBUG_MSG ("START ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_CAPTURE_NON_GREEDY_GROUP_END:
        {
            JERRY_DEBUG_MSG ("N");
            /* FALLTHRU */
        }
        case RE_OP_CAPTURE_GREEDY_GROUP_END:
        {
            JERRY_DEBUG_MSG ("G_END ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_NON_CAPTURE_NON_GREEDY_ZERO_GROUP_START:
        {
            JERRY_DEBUG_MSG ("N");
            /* FALLTHRU */
        }
        case RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START:
        {
            JERRY_DEBUG_MSG ("GZ_NC_START ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_NON_CAPTURE_GROUP_START:
        {
            JERRY_DEBUG_MSG ("NC_START ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_NON_CAPTURE_NON_GREEDY_GROUP_END:
        {
            JERRY_DEBUG_MSG ("N");
            /* FALLTHRU */
        }
        case RE_OP_NON_CAPTURE_GREEDY_GROUP_END:
        {
            JERRY_DEBUG_MSG ("G_NC_END ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_SAVE_AT_START:
        {
            JERRY_DEBUG_MSG ("RE_START ");
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_SAVE_AND_MATCH:
        {
            JERRY_DEBUG_MSG ("RE_END, ");
            break;
        }
        case RE_OP_GREEDY_ITERATOR:
        {
            JERRY_DEBUG_MSG ("GREEDY_ITERATOR ");
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_NON_GREEDY_ITERATOR:
        {
            JERRY_DEBUG_MSG ("NON_GREEDY_ITERATOR ");
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_PERIOD:
        {
            JERRY_DEBUG_MSG ("PERIOD ");
            break;
        }
        case RE_OP_ALTERNATIVE:
        {
            JERRY_DEBUG_MSG ("ALTERNATIVE ");
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_ASSERT_START:
        {
            JERRY_DEBUG_MSG ("ASSERT_START ");
            break;
        }
        case RE_OP_ASSERT_END:
        {
            JERRY_DEBUG_MSG ("ASSERT_END ");
            break;
        }
        case RE_OP_ASSERT_WORD_BOUNDARY:
        {
            JERRY_DEBUG_MSG ("ASSERT_WORD_BOUNDARY ");
            break;
        }
        case RE_OP_ASSERT_NOT_WORD_BOUNDARY:
        {
            JERRY_DEBUG_MSG ("ASSERT_NOT_WORD_BOUNDARY ");
            break;
        }
        case RE_OP_LOOKAHEAD_POS:
        {
            JERRY_DEBUG_MSG ("LOOKAHEAD_POS ");
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_LOOKAHEAD_NEG:
        {
            JERRY_DEBUG_MSG ("LOOKAHEAD_NEG ");
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_BACKREFERENCE:
        {
            JERRY_DEBUG_MSG ("BACKREFERENCE ");
            JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
            break;
        }
        case RE_OP_INV_CHAR_CLASS:
        {
            JERRY_DEBUG_MSG ("INV_");
            /* FALLTHRU */
        }
        case RE_OP_CHAR_CLASS:
        {
            JERRY_DEBUG_MSG ("CHAR_CLASS ");
            uint32_t num_of_class = re_get_value (&bytecode_p);
            JERRY_DEBUG_MSG ("%d", num_of_class);
            while (num_of_class)
            {
                JERRY_DEBUG_MSG (" %d", re_get_char (&bytecode_p));
                JERRY_DEBUG_MSG ("-%d", re_get_char (&bytecode_p));
                num_of_class--;
            }
            JERRY_DEBUG_MSG (", ");
            break;
        }
        default:
        {
            JERRY_DEBUG_MSG ("UNKNOWN(%d), ", (uint32_t) op);
            break;
        }
        }
    }
    JERRY_DEBUG_MSG ("EOF\n");
} /* re_dump_bytecode */