Parser optimizations.

- parser is now non-recursive (i.e. parse function is not called recursively in any case);
 - byte-code is now more compact:
    - constants are now not immediately dumped upon occurence, but later - where necessary;
    - assignments are combined with unary / binary operations;
    - binary operations are encoded more compactly in many cases;
 - byte-code arrays are now allocated separately for each scope (so, GC of the scopes now becomes possible);
 - byte-code is dumped directly into corresponding byte-code arrays:
   - linked lists of op_meta are not now used for main code of a scope.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-11-03 19:14:19 +03:00
committed by Ruben Ayrapetyan
parent b1de93abd6
commit 50d124bfc3
51 changed files with 9044 additions and 7401 deletions
+333 -184
View File
@@ -17,10 +17,11 @@
#define OPCODES_DUMPER_H
#include "ecma-globals.h"
#include "jsp-internal.h"
#include "lexer.h"
#include "lit-literal.h"
#include "opcodes.h"
#include "scopes-tree.h"
#include "serializer.h"
/**
* Operand (descriptor of value or reference in context of parser)
@@ -31,7 +32,13 @@ public:
enum type_t : uint8_t
{
EMPTY, /**< empty operand */
LITERAL, /**< operand contains literal value */
STRING_LITERAL, /**< operand contains string literal value */
NUMBER_LITERAL, /**< operand contains number literal value */
REGEXP_LITERAL, /**< operand contains regexp literal value */
SIMPLE_VALUE, /**< operand contains a simple ecma value */
SMALLINT, /**< operand contains small integer value (less than 256) */
IDENTIFIER, /**< Identifier reference */
THIS_BINDING, /**< ThisBinding operand */
TMP, /**< operand contains byte-code register index */
IDX_CONST, /**< operand contains an integer constant that fits vm_idx_t */
UNKNOWN, /**< operand, representing unknown value that would be rewritten later */
@@ -67,6 +74,21 @@ public:
return ret;
} /* make_empty_operand */
/**
* Construct ThisBinding operand
*
* @return constructed operand
*/
static jsp_operand_t
make_this_operand (void)
{
jsp_operand_t ret;
ret._type = jsp_operand_t::THIS_BINDING;
return ret;
} /* make_this_operand */
/**
* Construct unknown operand
*
@@ -99,22 +121,130 @@ public:
} /* make_idx_const_operand */
/**
* Construct literal operand
* Construct small integer operand
*
* @return constructed operand
*/
static jsp_operand_t
make_lit_operand (lit_cpointer_t lit_id) /**< literal identifier */
make_smallint_operand (uint8_t integer_value) /**< small integer value */
{
jsp_operand_t ret;
ret._type = jsp_operand_t::SMALLINT;
ret._data.smallint_value = integer_value;
return ret;
} /* make_smallint_operand */
/**
* Construct simple ecma value operand
*
* @return constructed operand
*/
static jsp_operand_t
make_simple_value_operand (ecma_simple_value_t simple_value) /**< simple ecma value */
{
jsp_operand_t ret;
ret._type = jsp_operand_t::SIMPLE_VALUE;
ret._data.simple_value = simple_value;
return ret;
} /* make_simple_value_operand */
/**
* Construct string literal operand
*
* @return constructed operand
*/
static jsp_operand_t
make_string_lit_operand (lit_cpointer_t lit_id) /**< literal identifier */
{
JERRY_ASSERT (lit_id.packed_value != NOT_A_LITERAL.packed_value);
#ifndef JERRY_NDEBUG
literal_t lit = lit_get_literal_by_cp (lit_id);
JERRY_ASSERT (lit->get_type () == LIT_STR_T
|| lit->get_type () == LIT_MAGIC_STR_T
|| lit->get_type () == LIT_MAGIC_STR_EX_T);
#endif /* !JERRY_NDEBUG */
jsp_operand_t ret;
ret._type = jsp_operand_t::STRING_LITERAL;
ret._data.lit_id = lit_id;
return ret;
} /* make_string_lit_operand */
/**
* Construct RegExp literal operand
*
* @return constructed operand
*/
static jsp_operand_t
make_regexp_lit_operand (lit_cpointer_t lit_id) /**< literal identifier */
{
JERRY_ASSERT (lit_id.packed_value != NOT_A_LITERAL.packed_value);
#ifndef JERRY_NDEBUG
literal_t lit = lit_get_literal_by_cp (lit_id);
JERRY_ASSERT (lit->get_type () == LIT_STR_T
|| lit->get_type () == LIT_MAGIC_STR_T
|| lit->get_type () == LIT_MAGIC_STR_EX_T);
#endif /* !JERRY_NDEBUG */
jsp_operand_t ret;
ret._type = jsp_operand_t::REGEXP_LITERAL;
ret._data.lit_id = lit_id;
return ret;
} /* make_regexp_lit_operand */
/**
* Construct number literal operand
*
* @return constructed operand
*/
static jsp_operand_t
make_number_lit_operand (lit_cpointer_t lit_id) /**< literal identifier */
{
JERRY_ASSERT (lit_id.packed_value != NOT_A_LITERAL.packed_value);
#ifndef JERRY_NDEBUG
literal_t lit = lit_get_literal_by_cp (lit_id);
JERRY_ASSERT (lit->get_type () == LIT_NUMBER_T);
#endif /* !JERRY_NDEBUG */
jsp_operand_t ret;
ret._type = jsp_operand_t::NUMBER_LITERAL;
ret._data.lit_id = lit_id;
return ret;
} /* make_number_lit_operand */
/**
* Construct identifier reference operand
*
* @return constructed operand
*/
static jsp_operand_t
make_identifier_operand (lit_cpointer_t lit_id) /**< literal identifier */
{
JERRY_ASSERT (lit_id.packed_value != NOT_A_LITERAL.packed_value);
jsp_operand_t ret;
ret._type = jsp_operand_t::LITERAL;
ret._data.lit_id = lit_id;
ret._type = jsp_operand_t::IDENTIFIER;
ret._data.identifier = lit_id;
return ret;
} /* make_lit_operand */
} /* make_identifier_operand */
/**
* Construct register operand
@@ -157,6 +287,19 @@ public:
return (_type == jsp_operand_t::EMPTY);
} /* is_empty_operand */
/**
* Is it ThisBinding operand?
*
* @return true / false
*/
bool
is_this_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::THIS_BINDING);
} /* is_this_operand */
/**
* Is it unknown operand?
*
@@ -197,17 +340,93 @@ public:
} /* is_register_operand */
/**
* Is it literal operand?
* Is it simple ecma value operand?
*
* @return true / false
*/
bool
is_literal_operand (void) const
is_simple_value_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::LITERAL);
} /* is_literal_operand */
return (_type == jsp_operand_t::SIMPLE_VALUE);
} /* is_simple_value_operand */
/**
* Is it small integer operand?
*
* @return true / false
*/
bool
is_smallint_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::SMALLINT);
} /* is_smallint_operand */
/**
* Is it number literal operand?
*
* @return true / false
*/
bool
is_number_lit_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::NUMBER_LITERAL);
} /* is_number_lit_operand */
/**
* Is it string literal operand?
*
* @return true / false
*/
bool
is_string_lit_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::STRING_LITERAL);
} /* is_string_lit_operand */
/**
* Is it RegExp literal operand?
*
* @return true / false
*/
bool
is_regexp_lit_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::REGEXP_LITERAL);
} /* is_regexp_lit_operand */
/**
* Is it identifier reference operand?
*
* @return true / false
*/
bool is_identifier_operand (void) const
{
JERRY_ASSERT (_type != jsp_operand_t::UNINITIALIZED);
return (_type == jsp_operand_t::IDENTIFIER);
} /* is_identifier_operand */
/**
* Get string literal - name of Identifier reference
*
* @return literal identifier
*/
lit_cpointer_t get_identifier_name (void) const
{
JERRY_ASSERT (is_identifier_operand ());
return (_data.identifier);
} /* get_identifier_name */
/**
* Get idx for operand
@@ -224,10 +443,15 @@ public:
{
return _data.uid;
}
else if (_type == jsp_operand_t::LITERAL)
else if (_type == jsp_operand_t::STRING_LITERAL
|| _type == jsp_operand_t::NUMBER_LITERAL)
{
return VM_IDX_REWRITE_LITERAL_UID;
}
else if (_type == jsp_operand_t::THIS_BINDING)
{
return VM_REG_SPECIAL_THIS_BINDING;
}
else
{
JERRY_ASSERT (_type == jsp_operand_t::EMPTY);
@@ -251,7 +475,9 @@ public:
{
return NOT_A_LITERAL;
}
else if (_type == jsp_operand_t::LITERAL)
else if (_type == jsp_operand_t::STRING_LITERAL
|| _type == jsp_operand_t::NUMBER_LITERAL
|| _type == jsp_operand_t::REGEXP_LITERAL)
{
return _data.lit_id;
}
@@ -275,17 +501,48 @@ public:
return _data.idx_const;
} /* get_idx_const */
/**
* Get small integer constant from operand
*
* @return an integer
*/
uint8_t
get_smallint_value (void) const
{
JERRY_ASSERT (is_smallint_operand ());
return _data.smallint_value;
} /* get_smallint_value */
/**
* Get simple value from operand
*
* @return a simple ecma value
*/
ecma_simple_value_t
get_simple_value (void) const
{
JERRY_ASSERT (is_simple_value_operand ());
return (ecma_simple_value_t) _data.simple_value;
} /* get_simple_value */
private:
union
{
vm_idx_t idx_const; /**< idx constant value (for jsp_operand_t::IDX_CONST) */
vm_idx_t uid; /**< byte-code register index (for jsp_operand_t::TMP) */
vm_idx_t uid; /**< register index (for jsp_operand_t::TMP) */
lit_cpointer_t lit_id; /**< literal (for jsp_operand_t::LITERAL) */
lit_cpointer_t identifier; /**< Identifier reference (is_value_based_ref flag not set) */
uint8_t smallint_value; /**< small integer value */
uint8_t simple_value; /**< simple ecma value */
} _data;
type_t _type; /**< type of operand */
};
static_assert (sizeof (jsp_operand_t) == 4, "");
typedef enum __attr_packed___
{
VARG_FUNC_DECL,
@@ -297,196 +554,88 @@ typedef enum __attr_packed___
} varg_list_type;
jsp_operand_t empty_operand (void);
jsp_operand_t literal_operand (lit_cpointer_t);
jsp_operand_t eval_ret_operand (void);
jsp_operand_t jsp_create_operand_for_in_special_reg (void);
jsp_operand_t tmp_operand (void);
bool operand_is_empty (jsp_operand_t);
void dumper_init (void);
void dumper_free (void);
void dumper_init (jsp_ctx_t *, bool);
void dumper_start_move_of_vars_to_regs ();
bool dumper_start_move_of_args_to_regs (uint32_t args_num);
bool dumper_try_replace_identifier_name_with_reg (scopes_tree, op_meta *);
void dumper_alloc_reg_for_unused_arg (void);
vm_instr_counter_t dumper_get_current_instr_counter (jsp_ctx_t *);
void dumper_new_statement (void);
void dumper_new_scope (void);
void dumper_finish_scope (void);
void dumper_start_varg_code_sequence (void);
void dumper_finish_varg_code_sequence (void);
void dumper_start_move_of_vars_to_regs (jsp_ctx_t *);
bool dumper_start_move_of_args_to_regs (jsp_ctx_t *, uint32_t args_num);
bool dumper_try_replace_identifier_name_with_reg (jsp_ctx_t *, bytecode_data_header_t *, op_meta *);
void dumper_alloc_reg_for_unused_arg (jsp_ctx_t *);
void dumper_new_statement (jsp_ctx_t *);
void dumper_save_reg_alloc_ctx (jsp_ctx_t *, vm_idx_t *, vm_idx_t *);
void dumper_restore_reg_alloc_ctx (jsp_ctx_t *, vm_idx_t, vm_idx_t, bool);
vm_idx_t dumper_save_reg_alloc_counter (jsp_ctx_t *);
void dumper_restore_reg_alloc_counter (jsp_ctx_t *, vm_idx_t);
extern bool dumper_is_eval_literal (jsp_operand_t);
jsp_operand_t dump_array_hole_assignment_res (void);
void dump_boolean_assignment (jsp_operand_t, bool);
jsp_operand_t dump_boolean_assignment_res (bool);
void dump_string_assignment (jsp_operand_t, lit_cpointer_t);
jsp_operand_t dump_string_assignment_res (lit_cpointer_t);
void dump_number_assignment (jsp_operand_t, lit_cpointer_t);
jsp_operand_t dump_number_assignment_res (lit_cpointer_t);
void dump_regexp_assignment (jsp_operand_t, lit_cpointer_t);
jsp_operand_t dump_regexp_assignment_res (lit_cpointer_t);
void dump_smallint_assignment (jsp_operand_t, vm_idx_t);
jsp_operand_t dump_smallint_assignment_res (vm_idx_t);
void dump_undefined_assignment (jsp_operand_t);
jsp_operand_t dump_undefined_assignment_res (void);
void dump_null_assignment (jsp_operand_t);
jsp_operand_t dump_null_assignment_res (void);
void dump_variable_assignment (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_variable_assignment_res (jsp_operand_t);
void dump_variable_assignment (jsp_ctx_t *, jsp_operand_t, jsp_operand_t);
void dump_varg_header_for_rewrite (varg_list_type, jsp_operand_t);
jsp_operand_t rewrite_varg_header_set_args_count (size_t);
void dump_call_additional_info (opcode_call_flags_t, jsp_operand_t);
void dump_varg (jsp_operand_t);
vm_instr_counter_t dump_varg_header_for_rewrite (jsp_ctx_t *, varg_list_type, jsp_operand_t, jsp_operand_t);
void rewrite_varg_header_set_args_count (jsp_ctx_t *, size_t, vm_instr_counter_t);
void dump_call_additional_info (jsp_ctx_t *, opcode_call_flags_t, jsp_operand_t);
void dump_varg (jsp_ctx_t *, jsp_operand_t);
void dump_prop_name_and_value (jsp_operand_t, jsp_operand_t);
void dump_prop_getter_decl (jsp_operand_t, jsp_operand_t);
void dump_prop_setter_decl (jsp_operand_t, jsp_operand_t);
void dump_prop_getter (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_getter_res (jsp_operand_t, jsp_operand_t);
void dump_prop_setter (jsp_operand_t, jsp_operand_t, jsp_operand_t);
void dump_prop_name_and_value (jsp_ctx_t *, jsp_operand_t, jsp_operand_t);
void dump_prop_getter_decl (jsp_ctx_t *, jsp_operand_t, jsp_operand_t);
void dump_prop_setter_decl (jsp_ctx_t *, jsp_operand_t, jsp_operand_t);
void dump_prop_getter (jsp_ctx_t *, jsp_operand_t, jsp_operand_t, jsp_operand_t);
void dump_prop_setter (jsp_ctx_t *, jsp_operand_t, jsp_operand_t, jsp_operand_t);
void dump_function_end_for_rewrite (void);
void rewrite_function_end ();
void dumper_decrement_function_end_pos (void);
vm_instr_counter_t dump_conditional_check_for_rewrite (jsp_ctx_t *, jsp_operand_t);
void rewrite_conditional_check (jsp_ctx_t *, vm_instr_counter_t);
vm_instr_counter_t dump_jump_to_end_for_rewrite (jsp_ctx_t *);
void rewrite_jump_to_end (jsp_ctx_t *, vm_instr_counter_t);
jsp_operand_t dump_this_res (void);
vm_instr_counter_t dumper_set_next_iteration_target (jsp_ctx_t *);
vm_instr_counter_t dump_simple_or_nested_jump_for_rewrite (jsp_ctx_t *,
bool,
bool,
bool,
jsp_operand_t,
vm_instr_counter_t);
vm_instr_counter_t rewrite_simple_or_nested_jump_and_get_next (jsp_ctx_t *, vm_instr_counter_t, vm_instr_counter_t);
void dump_continue_iterations_check (jsp_ctx_t *, vm_instr_counter_t, jsp_operand_t);
void dump_post_increment (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_post_increment_res (jsp_operand_t);
void dump_post_decrement (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_post_decrement_res (jsp_operand_t);
void dump_pre_increment (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_pre_increment_res (jsp_operand_t);
void dump_pre_decrement (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_pre_decrement_res (jsp_operand_t);
void dump_unary_plus (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_unary_plus_res (jsp_operand_t);
void dump_unary_minus (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_unary_minus_res (jsp_operand_t);
void dump_bitwise_not (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_bitwise_not_res (jsp_operand_t);
void dump_logical_not (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_logical_not_res (jsp_operand_t);
void dump_delete (jsp_ctx_t *, jsp_operand_t, jsp_operand_t);
void dump_delete_prop (jsp_ctx_t *, jsp_operand_t, jsp_operand_t, jsp_operand_t);
void dump_multiplication (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_multiplication_res (jsp_operand_t, jsp_operand_t);
void dump_division (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_division_res (jsp_operand_t, jsp_operand_t);
void dump_remainder (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_remainder_res (jsp_operand_t, jsp_operand_t);
void dump_addition (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_addition_res (jsp_operand_t, jsp_operand_t);
void dump_substraction (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_substraction_res (jsp_operand_t, jsp_operand_t);
void dump_left_shift (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_left_shift_res (jsp_operand_t, jsp_operand_t);
void dump_right_shift (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_right_shift_res (jsp_operand_t, jsp_operand_t);
void dump_right_shift_ex (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_right_shift_ex_res (jsp_operand_t, jsp_operand_t);
void dump_less_than (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_less_than_res (jsp_operand_t, jsp_operand_t);
void dump_greater_than (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_greater_than_res (jsp_operand_t, jsp_operand_t);
void dump_less_or_equal_than (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_less_or_equal_than_res (jsp_operand_t, jsp_operand_t);
void dump_greater_or_equal_than (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_greater_or_equal_than_res (jsp_operand_t, jsp_operand_t);
void dump_instanceof (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_instanceof_res (jsp_operand_t, jsp_operand_t);
void dump_in (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_in_res (jsp_operand_t, jsp_operand_t);
void dump_equal_value (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_equal_value_res (jsp_operand_t, jsp_operand_t);
void dump_not_equal_value (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_not_equal_value_res (jsp_operand_t, jsp_operand_t);
void dump_equal_value_type (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_equal_value_type_res (jsp_operand_t, jsp_operand_t);
void dump_not_equal_value_type (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_not_equal_value_type_res (jsp_operand_t, jsp_operand_t);
void dump_bitwise_and (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_bitwise_and_res (jsp_operand_t, jsp_operand_t);
void dump_bitwise_xor (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_bitwise_xor_res (jsp_operand_t, jsp_operand_t);
void dump_bitwise_or (jsp_operand_t, jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_bitwise_or_res (jsp_operand_t, jsp_operand_t);
void dump_typeof (jsp_ctx_t *, jsp_operand_t, jsp_operand_t);
void start_dumping_logical_and_checks (void);
void dump_logical_and_check_for_rewrite (jsp_operand_t);
void rewrite_logical_and_checks (void);
void start_dumping_logical_or_checks (void);
void dump_logical_or_check_for_rewrite (jsp_operand_t);
void rewrite_logical_or_checks (void);
void dump_conditional_check_for_rewrite (jsp_operand_t);
void rewrite_conditional_check (void);
void dump_jump_to_end_for_rewrite (void);
void rewrite_jump_to_end (void);
void dump_unary_op (jsp_ctx_t *, vm_op_t, jsp_operand_t, jsp_operand_t);
void dump_binary_op (jsp_ctx_t *, vm_op_t, jsp_operand_t, jsp_operand_t, jsp_operand_t);
void start_dumping_assignment_expression (jsp_operand_t, locus);
jsp_operand_t dump_prop_setter_or_variable_assignment_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_addition_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_multiplication_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_division_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_remainder_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_substraction_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_left_shift_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_right_shift_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_right_shift_ex_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_bitwise_and_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_bitwise_xor_res (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_prop_setter_or_bitwise_or_res (jsp_operand_t, jsp_operand_t);
vm_instr_counter_t dump_with_for_rewrite (jsp_ctx_t *, jsp_operand_t);
void rewrite_with (jsp_ctx_t *, vm_instr_counter_t);
void dump_with_end (jsp_ctx_t *);
void dumper_set_break_target (void);
void dumper_set_continue_target (void);
void dumper_set_next_interation_target (void);
vm_instr_counter_t
dump_simple_or_nested_jump_for_rewrite (bool, vm_instr_counter_t);
vm_instr_counter_t
rewrite_simple_or_nested_jump_and_get_next (vm_instr_counter_t, vm_instr_counter_t);
void dump_continue_iterations_check (jsp_operand_t);
vm_instr_counter_t dump_for_in_for_rewrite (jsp_ctx_t *, jsp_operand_t);
void rewrite_for_in (jsp_ctx_t *, vm_instr_counter_t);
void dump_for_in_end (jsp_ctx_t *);
void start_dumping_case_clauses (void);
void dump_case_clause_check_for_rewrite (jsp_operand_t, jsp_operand_t);
void dump_default_clause_check_for_rewrite (void);
void rewrite_case_clause (void);
void rewrite_default_clause (void);
void finish_dumping_case_clauses (void);
vm_instr_counter_t dump_try_for_rewrite (jsp_ctx_t *);
vm_instr_counter_t dump_catch_for_rewrite (jsp_ctx_t *, jsp_operand_t);
vm_instr_counter_t dump_finally_for_rewrite (jsp_ctx_t *);
void rewrite_try (jsp_ctx_t *, vm_instr_counter_t);
void rewrite_catch (jsp_ctx_t *, vm_instr_counter_t);
void rewrite_finally (jsp_ctx_t *, vm_instr_counter_t);
void dump_end_try_catch_finally (jsp_ctx_t *);
void dump_throw (jsp_ctx_t *, jsp_operand_t);
void dump_delete (jsp_operand_t, jsp_operand_t, bool, locus);
jsp_operand_t dump_delete_res (jsp_operand_t, bool, locus);
void dump_variable_declaration (jsp_ctx_t *, lit_cpointer_t);
void dump_typeof (jsp_operand_t, jsp_operand_t);
jsp_operand_t dump_typeof_res (jsp_operand_t);
vm_instr_counter_t dump_reg_var_decl_for_rewrite (jsp_ctx_t *);
void rewrite_reg_var_decl (jsp_ctx_t *, vm_instr_counter_t);
vm_instr_counter_t dump_with_for_rewrite (jsp_operand_t);
void rewrite_with (vm_instr_counter_t);
void dump_with_end (void);
void dump_ret (jsp_ctx_t *);
void dump_retval (jsp_ctx_t *, jsp_operand_t);
vm_instr_counter_t dump_for_in_for_rewrite (jsp_operand_t);
void rewrite_for_in (vm_instr_counter_t);
void dump_for_in_end (void);
void dump_try_for_rewrite (void);
void rewrite_try (void);
void dump_catch_for_rewrite (jsp_operand_t);
void rewrite_catch (void);
void dump_finally_for_rewrite (void);
void rewrite_finally (void);
void dump_end_try_catch_finally (void);
void dump_throw (jsp_operand_t);
void dump_variable_declaration (lit_cpointer_t);
vm_instr_counter_t dump_scope_code_flags_for_rewrite (void);
void rewrite_scope_code_flags (vm_instr_counter_t, opcode_scope_code_flags_t);
vm_instr_counter_t dump_reg_var_decl_for_rewrite (void);
void rewrite_reg_var_decl (vm_instr_counter_t);
void dump_ret (void);
void dump_retval (jsp_operand_t);
op_meta dumper_get_op_meta (jsp_ctx_t *, vm_instr_counter_t);
void dumper_rewrite_op_meta (jsp_ctx_t *, vm_instr_counter_t, op_meta);
#endif /* OPCODES_DUMPER_H */