mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Renaming opcode_idx_t to opcode_counter_t.
This commit is contained in:
parent
4ebf551525
commit
b50e091b08
@ -46,7 +46,7 @@ run_int (void)
|
|||||||
{
|
{
|
||||||
JERRY_ASSERT( __program != NULL );
|
JERRY_ASSERT( __program != NULL );
|
||||||
|
|
||||||
const op_idx_t start_pos = 0;
|
const opcode_counter_t start_pos = 0;
|
||||||
ecma_value_t this_binding_value = ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED);
|
ecma_value_t this_binding_value = ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||||
ecma_object_t *lex_env_p = ecma_create_lexical_environment (NULL,
|
ecma_object_t *lex_env_p = ecma_create_lexical_environment (NULL,
|
||||||
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
||||||
@ -88,7 +88,7 @@ run_int (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
run_int_from_pos (op_idx_t start_pos,
|
run_int_from_pos (opcode_counter_t start_pos,
|
||||||
ecma_value_t this_binding_value,
|
ecma_value_t this_binding_value,
|
||||||
ecma_object_t *lex_env_p,
|
ecma_object_t *lex_env_p,
|
||||||
bool is_strict)
|
bool is_strict)
|
||||||
@ -111,7 +111,7 @@ run_int_from_pos (op_idx_t start_pos,
|
|||||||
JERRY_ASSERT( ecma_is_value_empty( regs[0]) );
|
JERRY_ASSERT( ecma_is_value_empty( regs[0]) );
|
||||||
|
|
||||||
struct __int_data int_data;
|
struct __int_data int_data;
|
||||||
int_data.pos = (op_idx_t) (start_pos + 1);
|
int_data.pos = (opcode_counter_t) (start_pos + 1);
|
||||||
int_data.this_binding = this_binding_value;
|
int_data.this_binding = this_binding_value;
|
||||||
int_data.lex_env_p = lex_env_p;
|
int_data.lex_env_p = lex_env_p;
|
||||||
int_data.is_strict = is_strict;
|
int_data.is_strict = is_strict;
|
||||||
|
|||||||
@ -20,11 +20,11 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "opcodes.h"
|
#include "opcodes.h"
|
||||||
|
|
||||||
typedef uint16_t op_idx_t;
|
typedef uint16_t opcode_counter_t;
|
||||||
|
|
||||||
struct __int_data
|
struct __int_data
|
||||||
{
|
{
|
||||||
op_idx_t pos; /**< current opcode to execute */
|
opcode_counter_t pos; /**< current opcode to execute */
|
||||||
ecma_value_t this_binding; /**< this binding for current context */
|
ecma_value_t this_binding; /**< this binding for current context */
|
||||||
ecma_object_t *lex_env_p; /**< current lexical environment */
|
ecma_object_t *lex_env_p; /**< current lexical environment */
|
||||||
bool is_strict; /**< is current code execution mode strict? */
|
bool is_strict; /**< is current code execution mode strict? */
|
||||||
@ -35,7 +35,7 @@ struct __int_data
|
|||||||
|
|
||||||
void init_int (const OPCODE* program_p);
|
void init_int (const OPCODE* program_p);
|
||||||
bool run_int (void);
|
bool run_int (void);
|
||||||
ecma_completion_value_t run_int_from_pos (op_idx_t start_pos,
|
ecma_completion_value_t run_int_from_pos (opcode_counter_t start_pos,
|
||||||
ecma_value_t this_binding_value,
|
ecma_value_t this_binding_value,
|
||||||
ecma_object_t *lex_env_p,
|
ecma_object_t *lex_env_p,
|
||||||
bool is_strict);
|
bool is_strict);
|
||||||
|
|||||||
@ -565,7 +565,7 @@ opfunc_jmp_down (OPCODE opdata, /**< operation data */
|
|||||||
{
|
{
|
||||||
JERRY_ASSERT( int_data->pos <= int_data->pos + opdata.data.jmp_up.opcode_count );
|
JERRY_ASSERT( int_data->pos <= int_data->pos + opdata.data.jmp_up.opcode_count );
|
||||||
|
|
||||||
int_data->pos = (op_idx_t) ( int_data->pos + opdata.data.jmp_down.opcode_count );
|
int_data->pos = (opcode_counter_t) ( int_data->pos + opdata.data.jmp_down.opcode_count );
|
||||||
|
|
||||||
return ecma_make_empty_completion_value();
|
return ecma_make_empty_completion_value();
|
||||||
} /* opfunc_jmp_down */
|
} /* opfunc_jmp_down */
|
||||||
@ -582,7 +582,7 @@ opfunc_jmp_up (OPCODE opdata, /**< operation data */
|
|||||||
{
|
{
|
||||||
JERRY_ASSERT( int_data->pos >= opdata.data.jmp_up.opcode_count );
|
JERRY_ASSERT( int_data->pos >= opdata.data.jmp_up.opcode_count );
|
||||||
|
|
||||||
int_data->pos = (op_idx_t) ( int_data->pos - opdata.data.jmp_down.opcode_count );
|
int_data->pos = (opcode_counter_t) ( int_data->pos - opdata.data.jmp_down.opcode_count );
|
||||||
|
|
||||||
return ecma_make_empty_completion_value();
|
return ecma_make_empty_completion_value();
|
||||||
} /* opfunc_jmp_up */
|
} /* opfunc_jmp_up */
|
||||||
@ -1309,16 +1309,16 @@ opfunc_func_decl_0(OPCODE opdata, /**< operation data */
|
|||||||
|
|
||||||
const bool is_strict = int_data->is_strict;
|
const bool is_strict = int_data->is_strict;
|
||||||
|
|
||||||
const op_idx_t varg_first_opcode_idx = (op_idx_t) (int_data->pos + 1);
|
const opcode_counter_t varg_first_opcode_idx = (opcode_counter_t) (int_data->pos + 1);
|
||||||
int_data->pos = varg_first_opcode_idx;
|
int_data->pos = varg_first_opcode_idx;
|
||||||
|
|
||||||
TODO( Iterate vargs );
|
TODO( Iterate vargs );
|
||||||
|
|
||||||
const op_idx_t jmp_down_opcode_idx = (op_idx_t) (int_data->pos);
|
const opcode_counter_t jmp_down_opcode_idx = (opcode_counter_t) (int_data->pos);
|
||||||
|
|
||||||
TODO( ASSERT( Current opcode is jmp_down ) );
|
TODO( ASSERT( Current opcode is jmp_down ) );
|
||||||
|
|
||||||
const op_idx_t function_code_opcode_idx = (op_idx_t) (jmp_down_opcode_idx + 1);
|
const opcode_counter_t function_code_opcode_idx = (opcode_counter_t) (jmp_down_opcode_idx + 1);
|
||||||
|
|
||||||
// a.
|
// a.
|
||||||
const ecma_char_t *fn = function_name.str_p;
|
const ecma_char_t *fn = function_name.str_p;
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
static uint32_t
|
static uint32_t
|
||||||
ecma_pack_code_internal_property_value( bool is_strict, /**< is code strict? */
|
ecma_pack_code_internal_property_value( bool is_strict, /**< is code strict? */
|
||||||
op_idx_t opcode_idx) /**< index of first opcode */
|
opcode_counter_t opcode_idx) /**< index of first opcode */
|
||||||
{
|
{
|
||||||
uint32_t value = opcode_idx;
|
uint32_t value = opcode_idx;
|
||||||
const uint32_t is_strict_bit_offset = sizeof(value) * JERRY_BITSINBYTE - 1;
|
const uint32_t is_strict_bit_offset = sizeof(value) * JERRY_BITSINBYTE - 1;
|
||||||
@ -58,7 +58,7 @@ ecma_pack_code_internal_property_value( bool is_strict, /**< is code strict? */
|
|||||||
*
|
*
|
||||||
* @return opcode index
|
* @return opcode index
|
||||||
*/
|
*/
|
||||||
static op_idx_t
|
static opcode_counter_t
|
||||||
ecma_unpack_code_internal_property_value( uint32_t value, /**< packed value */
|
ecma_unpack_code_internal_property_value( uint32_t value, /**< packed value */
|
||||||
bool* out_is_strict_p) /**< out: is code strict? */
|
bool* out_is_strict_p) /**< out: is code strict? */
|
||||||
{
|
{
|
||||||
@ -69,7 +69,7 @@ ecma_unpack_code_internal_property_value( uint32_t value, /**< packed value */
|
|||||||
bool is_strict = ( ( value & ( 1u << is_strict_bit_offset ) ) != 0 );
|
bool is_strict = ( ( value & ( 1u << is_strict_bit_offset ) ) != 0 );
|
||||||
*out_is_strict_p = is_strict;
|
*out_is_strict_p = is_strict;
|
||||||
|
|
||||||
op_idx_t opcode_idx = (op_idx_t) ( value & ~( 1u << is_strict_bit_offset ) );
|
opcode_counter_t opcode_idx = (opcode_counter_t) ( value & ~( 1u << is_strict_bit_offset ) );
|
||||||
|
|
||||||
return opcode_idx;
|
return opcode_idx;
|
||||||
} /* ecma_unpack_code_internal_property_value */
|
} /* ecma_unpack_code_internal_property_value */
|
||||||
@ -111,7 +111,7 @@ ecma_op_create_function_object( const ecma_char_t* formal_parameter_list_p[], /*
|
|||||||
size_t formal_parameters_number, /**< formal parameters list's length */
|
size_t formal_parameters_number, /**< formal parameters list's length */
|
||||||
ecma_object_t *scope_p, /**< function's scope */
|
ecma_object_t *scope_p, /**< function's scope */
|
||||||
bool is_strict, /**< 'strict' flag */
|
bool is_strict, /**< 'strict' flag */
|
||||||
op_idx_t first_opcode_idx) /**< index of first opcode of function's body */
|
opcode_counter_t first_opcode_idx) /**< index of first opcode of function's body */
|
||||||
{
|
{
|
||||||
// 1., 4., 13.
|
// 1., 4., 13.
|
||||||
FIXME( Setup prototype of Function object to built-in Function prototype object (15.3.3.1) );
|
FIXME( Setup prototype of Function object to built-in Function prototype object (15.3.3.1) );
|
||||||
@ -262,7 +262,7 @@ ecma_op_function_call( ecma_object_t *func_obj_p, /**< Function object */
|
|||||||
|
|
||||||
bool is_strict;
|
bool is_strict;
|
||||||
// 8.
|
// 8.
|
||||||
op_idx_t code_first_opcode_idx = ecma_unpack_code_internal_property_value( code_prop_value, &is_strict);
|
opcode_counter_t code_first_opcode_idx = ecma_unpack_code_internal_property_value( code_prop_value, &is_strict);
|
||||||
|
|
||||||
ecma_value_t this_binding;
|
ecma_value_t this_binding;
|
||||||
// 1.
|
// 1.
|
||||||
|
|||||||
@ -33,7 +33,7 @@ ecma_op_create_function_object( const ecma_char_t* formal_parameter_list_p[],
|
|||||||
size_t formal_parameters_number,
|
size_t formal_parameters_number,
|
||||||
ecma_object_t *scope_p,
|
ecma_object_t *scope_p,
|
||||||
bool is_strict,
|
bool is_strict,
|
||||||
op_idx_t first_opcode_idx);
|
opcode_counter_t first_opcode_idx);
|
||||||
|
|
||||||
extern ecma_object_t* ecma_op_get_throw_type_error( void);
|
extern ecma_object_t* ecma_op_get_throw_type_error( void);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user