Renaming ecma_get_pointer, ecma_set_pointer, ecma_set_pointer_non_null macroses to uppercase names.
This commit is contained in:
+15
-15
@@ -142,8 +142,8 @@ do_strict_eval_arguments_check( ecma_reference_t ref) /**< ECMA-reference */
|
||||
&& ( __strcmp( (char*)ref.referenced_name_p, (char*)ecma_get_magic_string( ECMA_MAGIC_STRING_EVAL)) == 0
|
||||
|| __strcmp( (char*)ref.referenced_name_p, (char*)ecma_get_magic_string( ECMA_MAGIC_STRING_ARGUMENTS)) == 0 )
|
||||
&& ( ref.base.value_type == ECMA_TYPE_OBJECT )
|
||||
&& ( ecma_get_pointer( ref.base.value) != NULL )
|
||||
&& ( ( (ecma_object_t*) ecma_get_pointer( ref.base.value) )->is_lexical_environment ) );
|
||||
&& ( ECMA_GET_POINTER( ref.base.value) != NULL )
|
||||
&& ( ( (ecma_object_t*) ECMA_GET_POINTER( ref.base.value) )->is_lexical_environment ) );
|
||||
} /* do_strict_eval_arguments_check */
|
||||
|
||||
/**
|
||||
@@ -287,8 +287,8 @@ do_number_arithmetic(struct __int_data *int_data, /**< interpreter context */
|
||||
ECMA_TRY_CATCH(num_right_value, ecma_op_to_number( right_value), ret_value);
|
||||
|
||||
ecma_number_t *left_p, *right_p, *res_p;
|
||||
left_p = (ecma_number_t*)ecma_get_pointer( num_left_value.value.value);
|
||||
right_p = (ecma_number_t*)ecma_get_pointer( num_right_value.value.value);
|
||||
left_p = (ecma_number_t*)ECMA_GET_POINTER( num_left_value.value.value);
|
||||
right_p = (ecma_number_t*)ECMA_GET_POINTER( num_right_value.value.value);
|
||||
|
||||
res_p = ecma_alloc_number();
|
||||
|
||||
@@ -419,7 +419,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
ECMA_TRY_CATCH (cond_value, get_variable_value (int_data, opdata.data.call_1.arg1_lit_idx, false), ret_value);
|
||||
JERRY_ASSERT(cond_value.value.value_type == ECMA_TYPE_NUMBER );
|
||||
ecma_number_t * num_p = (ecma_number_t*)ecma_get_pointer(cond_value.value.value);
|
||||
ecma_number_t * num_p = (ecma_number_t*)ECMA_GET_POINTER(cond_value.value.value);
|
||||
uint32_t int_num = (uint32_t)*num_p;
|
||||
led_toggle (int_num);
|
||||
ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -430,7 +430,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
ECMA_TRY_CATCH (cond_value, get_variable_value (int_data, opdata.data.call_1.arg1_lit_idx, false), ret_value);
|
||||
JERRY_ASSERT(cond_value.value.value_type == ECMA_TYPE_NUMBER );
|
||||
ecma_number_t * num_p = (ecma_number_t*)ecma_get_pointer(cond_value.value.value);
|
||||
ecma_number_t * num_p = (ecma_number_t*)ECMA_GET_POINTER(cond_value.value.value);
|
||||
uint32_t int_num = (uint32_t)*num_p;
|
||||
led_on (int_num);
|
||||
ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -441,7 +441,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
ECMA_TRY_CATCH (cond_value, get_variable_value (int_data, opdata.data.call_1.arg1_lit_idx, false), ret_value);
|
||||
JERRY_ASSERT(cond_value.value.value_type == ECMA_TYPE_NUMBER );
|
||||
ecma_number_t * num_p = (ecma_number_t*)ecma_get_pointer(cond_value.value.value);
|
||||
ecma_number_t * num_p = (ecma_number_t*)ECMA_GET_POINTER(cond_value.value.value);
|
||||
uint32_t int_num = (uint32_t)*num_p;
|
||||
led_off (int_num);
|
||||
ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -452,7 +452,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
ECMA_TRY_CATCH (cond_value, get_variable_value (int_data, opdata.data.call_1.arg1_lit_idx, false), ret_value);
|
||||
JERRY_ASSERT(cond_value.value.value_type == ECMA_TYPE_NUMBER );
|
||||
ecma_number_t * num_p = (ecma_number_t*)ecma_get_pointer(cond_value.value.value);
|
||||
ecma_number_t * num_p = (ecma_number_t*)ECMA_GET_POINTER(cond_value.value.value);
|
||||
uint32_t int_num = (uint32_t)*num_p;
|
||||
led_blink_once (int_num);
|
||||
ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -463,7 +463,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
ECMA_TRY_CATCH (cond_value, get_variable_value (int_data, opdata.data.call_1.arg1_lit_idx, false), ret_value);
|
||||
JERRY_ASSERT(cond_value.value.value_type == ECMA_TYPE_NUMBER );
|
||||
ecma_number_t * num_p = (ecma_number_t*)ecma_get_pointer(cond_value.value.value);
|
||||
ecma_number_t * num_p = (ecma_number_t*)ECMA_GET_POINTER(cond_value.value.value);
|
||||
uint32_t int_num = (uint32_t)*num_p;
|
||||
wait_ms (int_num);
|
||||
ret_value = ecma_make_empty_completion_value ();
|
||||
@@ -474,7 +474,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
ECMA_TRY_CATCH (cond_value, get_variable_value (int_data, opdata.data.call_1.arg1_lit_idx, false), ret_value);
|
||||
JERRY_ASSERT(cond_value.value.value_type == ECMA_TYPE_NUMBER );
|
||||
ecma_number_t * num_p = (ecma_number_t*)ecma_get_pointer(cond_value.value.value);
|
||||
ecma_number_t * num_p = (ecma_number_t*)ECMA_GET_POINTER(cond_value.value.value);
|
||||
opfunc_exitval (getop_exitval ((T_IDX)*num_p), int_data);
|
||||
ret_value = ecma_make_empty_completion_value ();
|
||||
ECMA_FINALIZE (cond_value);
|
||||
@@ -920,7 +920,7 @@ opfunc_pre_incr(OPCODE opdata, /**< operation data */
|
||||
// 4.
|
||||
ecma_number_t* new_num_p = ecma_alloc_number();
|
||||
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ecma_get_pointer( old_num_value.value.value);
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ECMA_GET_POINTER( old_num_value.value.value);
|
||||
*new_num_p= ecma_op_number_add (*old_num_p, ECMA_NUMBER_ONE);
|
||||
|
||||
ecma_value_t new_num_value = ecma_make_number_value( new_num_p);
|
||||
@@ -970,7 +970,7 @@ opfunc_pre_decr(OPCODE opdata, /**< operation data */
|
||||
// 4.
|
||||
ecma_number_t* new_num_p = ecma_alloc_number();
|
||||
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ecma_get_pointer( old_num_value.value.value);
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ECMA_GET_POINTER( old_num_value.value.value);
|
||||
*new_num_p= ecma_op_number_substract (*old_num_p, ECMA_NUMBER_ONE);
|
||||
|
||||
ecma_value_t new_num_value = ecma_make_number_value( new_num_p);
|
||||
@@ -1020,7 +1020,7 @@ opfunc_post_incr(OPCODE opdata, /**< operation data */
|
||||
// 4.
|
||||
ecma_number_t* new_num_p = ecma_alloc_number();
|
||||
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ecma_get_pointer( old_num_value.value.value);
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ECMA_GET_POINTER( old_num_value.value.value);
|
||||
*new_num_p= ecma_op_number_add (*old_num_p, ECMA_NUMBER_ONE);
|
||||
|
||||
// 5.
|
||||
@@ -1068,7 +1068,7 @@ opfunc_post_decr(OPCODE opdata, /**< operation data */
|
||||
// 4.
|
||||
ecma_number_t* new_num_p = ecma_alloc_number();
|
||||
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ecma_get_pointer( old_num_value.value.value);
|
||||
ecma_number_t* old_num_p = (ecma_number_t*)ECMA_GET_POINTER( old_num_value.value.value);
|
||||
*new_num_p= ecma_op_number_substract (*old_num_p, ECMA_NUMBER_ONE);
|
||||
|
||||
// 5.
|
||||
@@ -1410,7 +1410,7 @@ opfunc_call_0( OPCODE opdata, /**< operation data */
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_object_t *func_obj_p = ecma_get_pointer( func_value.value.value);
|
||||
ecma_object_t *func_obj_p = ECMA_GET_POINTER( func_value.value.value);
|
||||
|
||||
ECMA_TRY_CATCH( this_value, ecma_op_implicit_this_value( int_data->lex_env_p), ret_value);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ ecma_init_gc_info(ecma_object_t *object_p) /**< object */
|
||||
object_p->gc_info.refs = 1;
|
||||
|
||||
object_p->gc_info.generation = ECMA_GC_GEN_0;
|
||||
ecma_set_pointer( object_p->gc_info.next, ecma_gc_objects_lists[ ECMA_GC_GEN_0 ]);
|
||||
ECMA_SET_POINTER( object_p->gc_info.next, ecma_gc_objects_lists[ ECMA_GC_GEN_0 ]);
|
||||
ecma_gc_objects_lists[ ECMA_GC_GEN_0 ] = object_p;
|
||||
|
||||
/* Should be set to false at the beginning of garbage collection */
|
||||
@@ -103,7 +103,7 @@ ecma_gc_update_may_ref_younger_object_flag_by_value( ecma_object_t *obj_p, /**<
|
||||
return;
|
||||
}
|
||||
|
||||
ecma_object_t *ref_obj_p = ecma_get_pointer( value.value);
|
||||
ecma_object_t *ref_obj_p = ECMA_GET_POINTER( value.value);
|
||||
JERRY_ASSERT( ref_obj_p != NULL );
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( obj_p, ref_obj_p);
|
||||
@@ -152,7 +152,7 @@ ecma_gc_mark( ecma_object_t *object_p, /**< start object */
|
||||
|
||||
if ( object_p->is_lexical_environment )
|
||||
{
|
||||
ecma_object_t *lex_env_p = ecma_get_pointer( object_p->u.lexical_environment.outer_reference_p);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_POINTER( object_p->u.lexical_environment.outer_reference_p);
|
||||
if ( lex_env_p != NULL
|
||||
&& lex_env_p->gc_info.generation <= maximum_gen_to_traverse )
|
||||
{
|
||||
@@ -166,7 +166,7 @@ ecma_gc_mark( ecma_object_t *object_p, /**< start object */
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_object_t *proto_p = ecma_get_pointer( object_p->u.object.prototype_object_p);
|
||||
ecma_object_t *proto_p = ECMA_GET_POINTER( object_p->u.object.prototype_object_p);
|
||||
if ( proto_p != NULL
|
||||
&& proto_p->gc_info.generation <= maximum_gen_to_traverse )
|
||||
{
|
||||
@@ -179,11 +179,11 @@ ecma_gc_mark( ecma_object_t *object_p, /**< start object */
|
||||
}
|
||||
}
|
||||
|
||||
for ( ecma_property_t *property_p = ecma_get_pointer( object_p->properties_p), *next_property_p;
|
||||
for ( ecma_property_t *property_p = ECMA_GET_POINTER( object_p->properties_p), *next_property_p;
|
||||
property_p != NULL;
|
||||
property_p = next_property_p )
|
||||
{
|
||||
next_property_p = ecma_get_pointer( property_p->next_property_p);
|
||||
next_property_p = ECMA_GET_POINTER( property_p->next_property_p);
|
||||
|
||||
switch ( (ecma_property_type_t) property_p->type )
|
||||
{
|
||||
@@ -193,7 +193,7 @@ ecma_gc_mark( ecma_object_t *object_p, /**< start object */
|
||||
|
||||
if ( value.value_type == ECMA_TYPE_OBJECT )
|
||||
{
|
||||
ecma_object_t *value_obj_p = ecma_get_pointer( value.value);
|
||||
ecma_object_t *value_obj_p = ECMA_GET_POINTER( value.value);
|
||||
|
||||
if ( value_obj_p->gc_info.generation <= maximum_gen_to_traverse )
|
||||
{
|
||||
@@ -211,8 +211,8 @@ ecma_gc_mark( ecma_object_t *object_p, /**< start object */
|
||||
|
||||
case ECMA_PROPERTY_NAMEDACCESSOR:
|
||||
{
|
||||
ecma_object_t *getter_obj_p = ecma_get_pointer( property_p->u.named_accessor_property.get_p);
|
||||
ecma_object_t *setter_obj_p = ecma_get_pointer( property_p->u.named_accessor_property.set_p);
|
||||
ecma_object_t *getter_obj_p = ECMA_GET_POINTER( property_p->u.named_accessor_property.get_p);
|
||||
ecma_object_t *setter_obj_p = ECMA_GET_POINTER( property_p->u.named_accessor_property.set_p);
|
||||
|
||||
if ( getter_obj_p != NULL )
|
||||
{
|
||||
@@ -265,7 +265,7 @@ ecma_gc_mark( ecma_object_t *object_p, /**< start object */
|
||||
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
|
||||
case ECMA_INTERNAL_PROPERTY_BINDING_OBJECT: /* an object */
|
||||
{
|
||||
ecma_object_t *obj_p = ecma_get_pointer( property_value);
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER( property_value);
|
||||
|
||||
if ( obj_p->gc_info.generation <= maximum_gen_to_traverse )
|
||||
{
|
||||
@@ -302,12 +302,12 @@ ecma_gc_sweep( ecma_object_t *object_p) /**< object to free */
|
||||
&& !object_p->gc_info.visited
|
||||
&& object_p->gc_info.refs == 0 );
|
||||
|
||||
for ( ecma_property_t *property = ecma_get_pointer( object_p->properties_p),
|
||||
for ( ecma_property_t *property = ECMA_GET_POINTER( object_p->properties_p),
|
||||
*next_property_p;
|
||||
property != NULL;
|
||||
property = next_property_p )
|
||||
{
|
||||
next_property_p = ecma_get_pointer( property->next_property_p);
|
||||
next_property_p = ECMA_GET_POINTER( property->next_property_p);
|
||||
|
||||
ecma_free_property( property);
|
||||
}
|
||||
@@ -328,7 +328,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
{
|
||||
for ( ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ gen_id ];
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = ecma_get_pointer( obj_iter_p->gc_info.next) )
|
||||
obj_iter_p = ECMA_GET_POINTER( obj_iter_p->gc_info.next) )
|
||||
{
|
||||
obj_iter_p->gc_info.visited = false;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
{
|
||||
for ( ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ gen_id ];
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = ecma_get_pointer( obj_iter_p->gc_info.next) )
|
||||
obj_iter_p = ECMA_GET_POINTER( obj_iter_p->gc_info.next) )
|
||||
{
|
||||
if ( obj_iter_p->gc_info.refs > 0
|
||||
&& !obj_iter_p->gc_info.visited )
|
||||
@@ -357,7 +357,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
{
|
||||
for ( ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ gen_id ];
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = ecma_get_pointer( obj_iter_p->gc_info.next) )
|
||||
obj_iter_p = ECMA_GET_POINTER( obj_iter_p->gc_info.next) )
|
||||
{
|
||||
if ( obj_iter_p->gc_info.may_ref_younger_objects > 0 )
|
||||
{
|
||||
@@ -380,7 +380,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = obj_next_p )
|
||||
{
|
||||
obj_next_p = ecma_get_pointer( obj_iter_p->gc_info.next);
|
||||
obj_next_p = ECMA_GET_POINTER( obj_iter_p->gc_info.next);
|
||||
|
||||
if ( !obj_iter_p->gc_info.visited )
|
||||
{
|
||||
@@ -388,7 +388,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
|
||||
if ( likely( obj_prev_p != NULL ) )
|
||||
{
|
||||
ecma_set_pointer( obj_prev_p->gc_info.next, obj_next_p);
|
||||
ECMA_SET_POINTER( obj_prev_p->gc_info.next, obj_next_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -420,7 +420,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
/* promoting to next generation */
|
||||
if ( gen_last_obj_p[ gen_to_promote ] != NULL )
|
||||
{
|
||||
ecma_set_pointer( gen_last_obj_p[ gen_to_promote ]->gc_info.next, ecma_gc_objects_lists[ gen_to_promote + 1 ]);
|
||||
ECMA_SET_POINTER( gen_last_obj_p[ gen_to_promote ]->gc_info.next, ecma_gc_objects_lists[ gen_to_promote + 1 ]);
|
||||
ecma_gc_objects_lists[ gen_to_promote + 1 ] = ecma_gc_objects_lists[ gen_to_promote ];
|
||||
ecma_gc_objects_lists[ gen_to_promote ] = NULL;
|
||||
}
|
||||
@@ -440,7 +440,7 @@ ecma_gc_run( ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
{
|
||||
for ( ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ gen_id ];
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = ecma_get_pointer( obj_iter_p->gc_info.next) )
|
||||
obj_iter_p = ECMA_GET_POINTER( obj_iter_p->gc_info.next) )
|
||||
{
|
||||
JERRY_ASSERT( obj_iter_p->gc_info.generation == gen_id );
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ ecma_make_number_value( ecma_number_t* num_p) /**< number to reference in value
|
||||
ecma_value_t number_value;
|
||||
|
||||
number_value.value_type = ECMA_TYPE_NUMBER;
|
||||
ecma_set_pointer( number_value.value, num_p);
|
||||
ECMA_SET_POINTER( number_value.value, num_p);
|
||||
|
||||
return number_value;
|
||||
} /* ecma_make_number_value */
|
||||
@@ -128,7 +128,7 @@ ecma_make_string_value( ecma_array_first_chunk_t* ecma_string_p) /**< string to
|
||||
ecma_value_t string_value;
|
||||
|
||||
string_value.value_type = ECMA_TYPE_STRING;
|
||||
ecma_set_pointer( string_value.value, ecma_string_p);
|
||||
ECMA_SET_POINTER( string_value.value, ecma_string_p);
|
||||
|
||||
return string_value;
|
||||
} /* ecma_make_string_value */
|
||||
@@ -144,7 +144,7 @@ ecma_make_object_value( ecma_object_t* object_p) /**< object to reference in val
|
||||
ecma_value_t object_value;
|
||||
|
||||
object_value.value_type = ECMA_TYPE_OBJECT;
|
||||
ecma_set_pointer( object_value.value, object_p);
|
||||
ECMA_SET_POINTER( object_value.value, object_p);
|
||||
|
||||
return object_value;
|
||||
} /* ecma_make_object_value */
|
||||
@@ -187,32 +187,32 @@ ecma_copy_value( const ecma_value_t value, /**< ecma-value */
|
||||
}
|
||||
case ECMA_TYPE_NUMBER:
|
||||
{
|
||||
ecma_number_t *num_p = ecma_get_pointer( value.value);
|
||||
ecma_number_t *num_p = ECMA_GET_POINTER( value.value);
|
||||
JERRY_ASSERT( num_p != NULL );
|
||||
|
||||
ecma_number_t *number_copy_p = ecma_alloc_number();
|
||||
*number_copy_p = *num_p;
|
||||
|
||||
value_copy = (ecma_value_t) { .value_type = ECMA_TYPE_NUMBER };
|
||||
ecma_set_non_null_pointer( value_copy.value, number_copy_p);
|
||||
ECMA_SET_NON_NULL_POINTER( value_copy.value, number_copy_p);
|
||||
|
||||
break;
|
||||
}
|
||||
case ECMA_TYPE_STRING:
|
||||
{
|
||||
ecma_array_first_chunk_t *string_p = ecma_get_pointer( value.value);
|
||||
ecma_array_first_chunk_t *string_p = ECMA_GET_POINTER( value.value);
|
||||
JERRY_ASSERT( string_p != NULL );
|
||||
|
||||
ecma_array_first_chunk_t *string_copy_p = ecma_duplicate_ecma_string( string_p);
|
||||
|
||||
value_copy = (ecma_value_t) { .value_type = ECMA_TYPE_STRING };
|
||||
ecma_set_pointer( value_copy.value, string_copy_p);
|
||||
ECMA_SET_POINTER( value_copy.value, string_copy_p);
|
||||
|
||||
break;
|
||||
}
|
||||
case ECMA_TYPE_OBJECT:
|
||||
{
|
||||
ecma_object_t *obj_p = ecma_get_pointer( value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER( value.value);
|
||||
JERRY_ASSERT( obj_p != NULL );
|
||||
|
||||
if ( do_ref_if_object )
|
||||
@@ -251,14 +251,14 @@ ecma_free_value( ecma_value_t value, /**< value description */
|
||||
|
||||
case ECMA_TYPE_NUMBER:
|
||||
{
|
||||
ecma_number_t *number_p = ecma_get_pointer( value.value);
|
||||
ecma_number_t *number_p = ECMA_GET_POINTER( value.value);
|
||||
ecma_dealloc_number( number_p);
|
||||
break;
|
||||
}
|
||||
|
||||
case ECMA_TYPE_STRING:
|
||||
{
|
||||
ecma_array_first_chunk_t *string_p = ecma_get_pointer( value.value);
|
||||
ecma_array_first_chunk_t *string_p = ECMA_GET_POINTER( value.value);
|
||||
ecma_free_array( string_p);
|
||||
break;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ ecma_free_value( ecma_value_t value, /**< value description */
|
||||
{
|
||||
if ( do_deref_if_object )
|
||||
{
|
||||
ecma_deref_object( ecma_get_pointer( value.value));
|
||||
ecma_deref_object( ECMA_GET_POINTER( value.value));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ ecma_create_object( ecma_object_t *prototype_object_p, /**< pointer to prototybe
|
||||
object_p->is_lexical_environment = false;
|
||||
|
||||
object_p->u.object.extensible = is_extensible;
|
||||
ecma_set_pointer( object_p->u.object.prototype_object_p, prototype_object_p);
|
||||
ECMA_SET_POINTER( object_p->u.object.prototype_object_p, prototype_object_p);
|
||||
object_p->u.object.type = type;
|
||||
|
||||
return object_p;
|
||||
@@ -74,7 +74,7 @@ ecma_create_decl_lex_env(ecma_object_t *outer_lexical_environment_p) /**< outer
|
||||
|
||||
new_lexical_environment_p->properties_p = ECMA_NULL_POINTER;
|
||||
|
||||
ecma_set_pointer( new_lexical_environment_p->u.lexical_environment.outer_reference_p, outer_lexical_environment_p);
|
||||
ECMA_SET_POINTER( new_lexical_environment_p->u.lexical_environment.outer_reference_p, outer_lexical_environment_p);
|
||||
|
||||
return new_lexical_environment_p;
|
||||
} /* ecma_create_decl_lex_env */
|
||||
@@ -104,13 +104,13 @@ ecma_create_object_lex_env(ecma_object_t *outer_lexical_environment_p, /**< oute
|
||||
|
||||
new_lexical_environment_p->properties_p = ECMA_NULL_POINTER;
|
||||
|
||||
ecma_set_pointer( new_lexical_environment_p->u.lexical_environment.outer_reference_p, outer_lexical_environment_p);
|
||||
ECMA_SET_POINTER( new_lexical_environment_p->u.lexical_environment.outer_reference_p, outer_lexical_environment_p);
|
||||
|
||||
ecma_property_t *provide_this_prop_p = ecma_create_internal_property( new_lexical_environment_p, ECMA_INTERNAL_PROPERTY_PROVIDE_THIS);
|
||||
provide_this_prop_p->u.internal_property.value = provide_this;
|
||||
|
||||
ecma_property_t *binding_object_prop_p = ecma_create_internal_property( new_lexical_environment_p, ECMA_INTERNAL_PROPERTY_BINDING_OBJECT);
|
||||
ecma_set_pointer( binding_object_prop_p->u.internal_property.value, binding_obj_p);
|
||||
ECMA_SET_POINTER( binding_object_prop_p->u.internal_property.value, binding_obj_p);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( new_lexical_environment_p, binding_obj_p);
|
||||
|
||||
@@ -131,9 +131,9 @@ ecma_create_internal_property(ecma_object_t *object_p, /**< the object */
|
||||
|
||||
new_property_p->type = ECMA_PROPERTY_INTERNAL;
|
||||
|
||||
ecma_property_t *list_head_p = ecma_get_pointer( object_p->properties_p);
|
||||
ecma_set_pointer( new_property_p->next_property_p, list_head_p);
|
||||
ecma_set_non_null_pointer( object_p->properties_p, new_property_p);
|
||||
ecma_property_t *list_head_p = ECMA_GET_POINTER( object_p->properties_p);
|
||||
ECMA_SET_POINTER( new_property_p->next_property_p, list_head_p);
|
||||
ECMA_SET_NON_NULL_POINTER( object_p->properties_p, new_property_p);
|
||||
|
||||
new_property_p->u.internal_property.type = property_id;
|
||||
new_property_p->u.internal_property.value = ECMA_NULL_POINTER;
|
||||
@@ -156,9 +156,9 @@ ecma_find_internal_property(ecma_object_t *object_p, /**< object descriptor */
|
||||
JERRY_ASSERT( property_id != ECMA_INTERNAL_PROPERTY_PROTOTYPE
|
||||
&& property_id != ECMA_INTERNAL_PROPERTY_EXTENSIBLE );
|
||||
|
||||
for ( ecma_property_t *property_p = ecma_get_pointer( object_p->properties_p);
|
||||
for ( ecma_property_t *property_p = ECMA_GET_POINTER( object_p->properties_p);
|
||||
property_p != NULL;
|
||||
property_p = ecma_get_pointer( property_p->next_property_p) )
|
||||
property_p = ECMA_GET_POINTER( property_p->next_property_p) )
|
||||
{
|
||||
if ( property_p->type == ECMA_PROPERTY_INTERNAL )
|
||||
{
|
||||
@@ -210,7 +210,7 @@ ecma_create_named_data_property(ecma_object_t *obj_p, /**< object */
|
||||
|
||||
prop_p->type = ECMA_PROPERTY_NAMEDDATA;
|
||||
|
||||
ecma_set_non_null_pointer( prop_p->u.named_data_property.name_p, ecma_new_ecma_string( name_p));
|
||||
ECMA_SET_NON_NULL_POINTER( prop_p->u.named_data_property.name_p, ecma_new_ecma_string( name_p));
|
||||
|
||||
prop_p->u.named_data_property.writable = writable;
|
||||
prop_p->u.named_data_property.enumerable = enumerable;
|
||||
@@ -218,10 +218,10 @@ ecma_create_named_data_property(ecma_object_t *obj_p, /**< object */
|
||||
|
||||
prop_p->u.named_data_property.value = ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
|
||||
ecma_property_t *list_head_p = ecma_get_pointer( obj_p->properties_p);
|
||||
ecma_property_t *list_head_p = ECMA_GET_POINTER( obj_p->properties_p);
|
||||
|
||||
ecma_set_pointer( prop_p->next_property_p, list_head_p);
|
||||
ecma_set_non_null_pointer( obj_p->properties_p, prop_p);
|
||||
ECMA_SET_POINTER( prop_p->next_property_p, list_head_p);
|
||||
ECMA_SET_NON_NULL_POINTER( obj_p->properties_p, prop_p);
|
||||
|
||||
return prop_p;
|
||||
} /* ecma_create_named_data_property */
|
||||
@@ -245,20 +245,20 @@ ecma_create_named_accessor_property(ecma_object_t *obj_p, /**< object */
|
||||
|
||||
prop_p->type = ECMA_PROPERTY_NAMEDACCESSOR;
|
||||
|
||||
ecma_set_non_null_pointer( prop_p->u.named_accessor_property.name_p, ecma_new_ecma_string( name_p));
|
||||
ECMA_SET_NON_NULL_POINTER( prop_p->u.named_accessor_property.name_p, ecma_new_ecma_string( name_p));
|
||||
|
||||
ecma_set_pointer( prop_p->u.named_accessor_property.get_p, get_p);
|
||||
ECMA_SET_POINTER( prop_p->u.named_accessor_property.get_p, get_p);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( obj_p, get_p);
|
||||
|
||||
ecma_set_pointer( prop_p->u.named_accessor_property.set_p, set_p);
|
||||
ECMA_SET_POINTER( prop_p->u.named_accessor_property.set_p, set_p);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( obj_p, set_p);
|
||||
|
||||
prop_p->u.named_accessor_property.enumerable = enumerable;
|
||||
prop_p->u.named_accessor_property.configurable = configurable;
|
||||
|
||||
ecma_property_t *list_head_p = ecma_get_pointer( obj_p->properties_p);
|
||||
ecma_set_pointer( prop_p->next_property_p, list_head_p);
|
||||
ecma_set_non_null_pointer( obj_p->properties_p, prop_p);
|
||||
ecma_property_t *list_head_p = ECMA_GET_POINTER( obj_p->properties_p);
|
||||
ECMA_SET_POINTER( prop_p->next_property_p, list_head_p);
|
||||
ECMA_SET_NON_NULL_POINTER( obj_p->properties_p, prop_p);
|
||||
|
||||
return prop_p;
|
||||
} /* ecma_create_named_accessor_property */
|
||||
@@ -276,18 +276,18 @@ ecma_find_named_property(ecma_object_t *obj_p, /**< object to find property in *
|
||||
JERRY_ASSERT( obj_p != NULL );
|
||||
JERRY_ASSERT( name_p != NULL );
|
||||
|
||||
for ( ecma_property_t *property_p = ecma_get_pointer( obj_p->properties_p);
|
||||
for ( ecma_property_t *property_p = ECMA_GET_POINTER( obj_p->properties_p);
|
||||
property_p != NULL;
|
||||
property_p = ecma_get_pointer( property_p->next_property_p) )
|
||||
property_p = ECMA_GET_POINTER( property_p->next_property_p) )
|
||||
{
|
||||
ecma_array_first_chunk_t *property_name_p;
|
||||
|
||||
if ( property_p->type == ECMA_PROPERTY_NAMEDDATA )
|
||||
{
|
||||
property_name_p = ecma_get_pointer( property_p->u.named_data_property.name_p);
|
||||
property_name_p = ECMA_GET_POINTER( property_p->u.named_data_property.name_p);
|
||||
} else if ( property_p->type == ECMA_PROPERTY_NAMEDACCESSOR )
|
||||
{
|
||||
property_name_p = ecma_get_pointer( property_p->u.named_accessor_property.name_p);
|
||||
property_name_p = ECMA_GET_POINTER( property_p->u.named_accessor_property.name_p);
|
||||
} else
|
||||
{
|
||||
continue;
|
||||
@@ -358,7 +358,7 @@ ecma_free_named_data_property( ecma_property_t *property_p) /**< the property */
|
||||
{
|
||||
JERRY_ASSERT( property_p->type == ECMA_PROPERTY_NAMEDDATA );
|
||||
|
||||
ecma_free_array( ecma_get_pointer( property_p->u.named_data_property.name_p));
|
||||
ecma_free_array( ECMA_GET_POINTER( property_p->u.named_data_property.name_p));
|
||||
ecma_free_value( property_p->u.named_data_property.value, false);
|
||||
|
||||
ecma_dealloc_property( property_p);
|
||||
@@ -372,7 +372,7 @@ ecma_free_named_accessor_property( ecma_property_t *property_p) /**< the propert
|
||||
{
|
||||
JERRY_ASSERT( property_p->type == ECMA_PROPERTY_NAMEDACCESSOR );
|
||||
|
||||
ecma_free_array( ecma_get_pointer( property_p->u.named_accessor_property.name_p));
|
||||
ecma_free_array( ECMA_GET_POINTER( property_p->u.named_accessor_property.name_p));
|
||||
|
||||
ecma_dealloc_property( property_p);
|
||||
} /* ecma_free_named_accessor_property */
|
||||
@@ -394,7 +394,7 @@ ecma_free_internal_property( ecma_property_t *property_p) /**< the property */
|
||||
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* an array */
|
||||
case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* an array */
|
||||
{
|
||||
ecma_free_array( ecma_get_pointer( property_value));
|
||||
ecma_free_array( ECMA_GET_POINTER( property_value));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -453,11 +453,11 @@ void
|
||||
ecma_delete_property(ecma_object_t *obj_p, /**< object */
|
||||
ecma_property_t *prop_p) /**< property */
|
||||
{
|
||||
for ( ecma_property_t *cur_prop_p = ecma_get_pointer( obj_p->properties_p), *prev_prop_p = NULL, *next_prop_p;
|
||||
for ( ecma_property_t *cur_prop_p = ECMA_GET_POINTER( obj_p->properties_p), *prev_prop_p = NULL, *next_prop_p;
|
||||
cur_prop_p != NULL;
|
||||
prev_prop_p = cur_prop_p, cur_prop_p = next_prop_p )
|
||||
{
|
||||
next_prop_p = ecma_get_pointer( cur_prop_p->next_property_p);
|
||||
next_prop_p = ECMA_GET_POINTER( cur_prop_p->next_property_p);
|
||||
|
||||
if ( cur_prop_p == prop_p )
|
||||
{
|
||||
@@ -465,10 +465,10 @@ ecma_delete_property(ecma_object_t *obj_p, /**< object */
|
||||
|
||||
if ( prev_prop_p == NULL )
|
||||
{
|
||||
ecma_set_pointer( obj_p->properties_p, next_prop_p);
|
||||
ECMA_SET_POINTER( obj_p->properties_p, next_prop_p);
|
||||
} else
|
||||
{
|
||||
ecma_set_pointer( prev_prop_p->next_property_p, next_prop_p);
|
||||
ECMA_SET_POINTER( prev_prop_p->next_property_p, next_prop_p);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -524,7 +524,7 @@ ecma_new_ecma_string(const ecma_char_t *string_p) /**< zero-terminated string of
|
||||
chars_left -= chars_to_copy;
|
||||
copy_pointer += chars_to_copy * sizeof (ecma_char_t);
|
||||
|
||||
ecma_set_non_null_pointer( *next_chunk_compressed_pointer_p, string_non_first_chunk_p);
|
||||
ECMA_SET_NON_NULL_POINTER( *next_chunk_compressed_pointer_p, string_non_first_chunk_p);
|
||||
next_chunk_compressed_pointer_p = &string_non_first_chunk_p->next_chunk_p;
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ ecma_copy_ecma_string_chars_to_buffer(ecma_array_first_chunk_t *first_chunk_p, /
|
||||
dest_pointer += copy_chunk_chars * sizeof (ecma_char_t);
|
||||
chars_left -= copy_chunk_chars;
|
||||
|
||||
ecma_array_non_first_chunk_t *non_first_chunk_p = ecma_get_pointer( first_chunk_p->header.next_chunk_p);
|
||||
ecma_array_non_first_chunk_t *non_first_chunk_p = ECMA_GET_POINTER( first_chunk_p->header.next_chunk_p);
|
||||
|
||||
while ( chars_left > 0 )
|
||||
{
|
||||
@@ -577,7 +577,7 @@ ecma_copy_ecma_string_chars_to_buffer(ecma_array_first_chunk_t *first_chunk_p, /
|
||||
dest_pointer += copy_chunk_chars * sizeof (ecma_char_t);
|
||||
chars_left -= copy_chunk_chars;
|
||||
|
||||
non_first_chunk_p = ecma_get_pointer( non_first_chunk_p->next_chunk_p);
|
||||
non_first_chunk_p = ECMA_GET_POINTER( non_first_chunk_p->next_chunk_p);
|
||||
}
|
||||
|
||||
return (ssize_t) required_buffer_size;
|
||||
@@ -597,18 +597,18 @@ ecma_duplicate_ecma_string( ecma_array_first_chunk_t *first_chunk_p) /**< first
|
||||
__memcpy( first_chunk_copy_p, first_chunk_p, sizeof (ecma_array_first_chunk_t));
|
||||
|
||||
ecma_array_non_first_chunk_t *non_first_chunk_p, *non_first_chunk_copy_p;
|
||||
non_first_chunk_p = ecma_get_pointer( first_chunk_p->header.next_chunk_p);
|
||||
non_first_chunk_p = ECMA_GET_POINTER( first_chunk_p->header.next_chunk_p);
|
||||
uint16_t *next_pointer_p = &first_chunk_copy_p->header.next_chunk_p;
|
||||
|
||||
while ( non_first_chunk_p != NULL )
|
||||
{
|
||||
non_first_chunk_copy_p = ecma_alloc_array_non_first_chunk();
|
||||
ecma_set_pointer( *next_pointer_p, non_first_chunk_copy_p);
|
||||
ECMA_SET_POINTER( *next_pointer_p, non_first_chunk_copy_p);
|
||||
next_pointer_p = &non_first_chunk_copy_p->next_chunk_p;
|
||||
|
||||
__memcpy( non_first_chunk_copy_p, non_first_chunk_p, sizeof (ecma_array_non_first_chunk_t));
|
||||
|
||||
non_first_chunk_p = ecma_get_pointer( non_first_chunk_p->next_chunk_p);
|
||||
non_first_chunk_p = ECMA_GET_POINTER( non_first_chunk_p->next_chunk_p);
|
||||
}
|
||||
|
||||
*next_pointer_p = ECMA_NULL_POINTER;
|
||||
@@ -660,7 +660,7 @@ ecma_compare_zt_string_to_ecma_string(const ecma_char_t *string_p, /**< zero-ter
|
||||
if ( current_chunk_chars_cur == current_chunk_chars_end )
|
||||
{
|
||||
/* switching to next chunk */
|
||||
ecma_array_non_first_chunk_t *next_chunk_p = ecma_get_pointer( *next_chunk_compressed_pointer_p);
|
||||
ecma_array_non_first_chunk_t *next_chunk_p = ECMA_GET_POINTER( *next_chunk_compressed_pointer_p);
|
||||
|
||||
JERRY_ASSERT( next_chunk_p != NULL );
|
||||
|
||||
@@ -699,13 +699,13 @@ ecma_free_array( ecma_array_first_chunk_t *first_chunk_p) /**< first chunk of th
|
||||
{
|
||||
JERRY_ASSERT( first_chunk_p != NULL );
|
||||
|
||||
ecma_array_non_first_chunk_t *non_first_chunk_p = ecma_get_pointer( first_chunk_p->header.next_chunk_p);
|
||||
ecma_array_non_first_chunk_t *non_first_chunk_p = ECMA_GET_POINTER( first_chunk_p->header.next_chunk_p);
|
||||
|
||||
ecma_dealloc_array_first_chunk( first_chunk_p);
|
||||
|
||||
while ( non_first_chunk_p != NULL )
|
||||
{
|
||||
ecma_array_non_first_chunk_t *next_chunk_p = ecma_get_pointer( non_first_chunk_p->next_chunk_p);
|
||||
ecma_array_non_first_chunk_t *next_chunk_p = ECMA_GET_POINTER( non_first_chunk_p->next_chunk_p);
|
||||
|
||||
ecma_dealloc_array_non_first_chunk( non_first_chunk_p);
|
||||
|
||||
|
||||
@@ -29,14 +29,14 @@
|
||||
/**
|
||||
* Get value of pointer from specified compressed pointer field.
|
||||
*/
|
||||
#define ecma_get_pointer( field) \
|
||||
#define ECMA_GET_POINTER( field) \
|
||||
( ( unlikely( field == ECMA_NULL_POINTER ) ) ? NULL : mem_decompress_pointer( field) )
|
||||
|
||||
/**
|
||||
* Set value of compressed pointer field so that it will correspond
|
||||
* to specified non_compressed_pointer.
|
||||
*/
|
||||
#define ecma_set_pointer( field, non_compressed_pointer) \
|
||||
#define ECMA_SET_POINTER( field, non_compressed_pointer) \
|
||||
do { \
|
||||
void *__temp_pointer = non_compressed_pointer; \
|
||||
non_compressed_pointer = __temp_pointer; \
|
||||
@@ -50,7 +50,7 @@
|
||||
* Set value of non-null compressed pointer field so that it will correspond
|
||||
* to specified non_compressed_pointer.
|
||||
*/
|
||||
#define ecma_set_non_null_pointer( field, non_compressed_pointer) \
|
||||
#define ECMA_SET_NON_NULL_POINTER( field, non_compressed_pointer) \
|
||||
(field) = ( mem_compress_pointer( non_compressed_pointer) & ( ( 1u << ECMA_POINTER_FIELD_WIDTH ) - 1) )
|
||||
|
||||
/* ecma-helpers-value.c */
|
||||
|
||||
@@ -70,16 +70,16 @@ ecma_op_abstract_equality_compare(ecma_value_t x, /**< first operand */
|
||||
return true;
|
||||
} else if ( is_x_number )
|
||||
{ // c.
|
||||
ecma_number_t x_num = *(ecma_number_t*)( ecma_get_pointer(x.value) );
|
||||
ecma_number_t y_num = *(ecma_number_t*)( ecma_get_pointer(y.value) );
|
||||
ecma_number_t x_num = *(ecma_number_t*)( ECMA_GET_POINTER(x.value) );
|
||||
ecma_number_t y_num = *(ecma_number_t*)( ECMA_GET_POINTER(y.value) );
|
||||
|
||||
TODO( Implement according to ECMA );
|
||||
|
||||
return (x_num == y_num);
|
||||
} else if ( is_x_string )
|
||||
{ // d.
|
||||
ecma_array_first_chunk_t* x_str = (ecma_array_first_chunk_t*)( ecma_get_pointer(x.value) );
|
||||
ecma_array_first_chunk_t* y_str = (ecma_array_first_chunk_t*)( ecma_get_pointer(y.value) );
|
||||
ecma_array_first_chunk_t* x_str = (ecma_array_first_chunk_t*)( ECMA_GET_POINTER(x.value) );
|
||||
ecma_array_first_chunk_t* y_str = (ecma_array_first_chunk_t*)( ECMA_GET_POINTER(y.value) );
|
||||
|
||||
return ecma_compare_ecma_string_to_ecma_string( x_str, y_str);
|
||||
} else if ( is_x_boolean )
|
||||
@@ -137,8 +137,8 @@ ecma_op_abstract_relational_compare(ecma_value_t x, /**< first operand */
|
||||
// b.
|
||||
ECMA_TRY_CATCH( ny, ecma_op_to_number( py.value), ret_value);
|
||||
|
||||
ecma_number_t* num_x_p = (ecma_number_t*)ecma_get_pointer( nx.value.value);
|
||||
ecma_number_t* num_y_p = (ecma_number_t*)ecma_get_pointer( ny.value.value);
|
||||
ecma_number_t* num_x_p = (ecma_number_t*)ECMA_GET_POINTER( nx.value.value);
|
||||
ecma_number_t* num_y_p = (ecma_number_t*)ECMA_GET_POINTER( ny.value.value);
|
||||
|
||||
TODO( /* Implement according to ECMA */ );
|
||||
|
||||
|
||||
@@ -123,16 +123,16 @@ ecma_op_same_value( ecma_value_t x, /**< ecma-value */
|
||||
{
|
||||
TODO( Implement according to ECMA );
|
||||
|
||||
ecma_number_t *x_num_p = (ecma_number_t*)ecma_get_pointer( x.value);
|
||||
ecma_number_t *y_num_p = (ecma_number_t*)ecma_get_pointer( y.value);
|
||||
ecma_number_t *x_num_p = (ecma_number_t*)ECMA_GET_POINTER( x.value);
|
||||
ecma_number_t *y_num_p = (ecma_number_t*)ECMA_GET_POINTER( y.value);
|
||||
|
||||
return ( *x_num_p == *y_num_p );
|
||||
}
|
||||
|
||||
if ( is_x_string )
|
||||
{
|
||||
ecma_array_first_chunk_t* x_str_p = (ecma_array_first_chunk_t*)( ecma_get_pointer(x.value) );
|
||||
ecma_array_first_chunk_t* y_str_p = (ecma_array_first_chunk_t*)( ecma_get_pointer(y.value) );
|
||||
ecma_array_first_chunk_t* x_str_p = (ecma_array_first_chunk_t*)( ECMA_GET_POINTER(x.value) );
|
||||
ecma_array_first_chunk_t* y_str_p = (ecma_array_first_chunk_t*)( ECMA_GET_POINTER(y.value) );
|
||||
|
||||
return ecma_compare_ecma_string_to_ecma_string( x_str_p, y_str_p);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ ecma_op_same_value( ecma_value_t x, /**< ecma-value */
|
||||
|
||||
JERRY_ASSERT( is_x_object );
|
||||
|
||||
return ( ecma_get_pointer( x.value) == ecma_get_pointer( y.value) );
|
||||
return ( ECMA_GET_POINTER( x.value) == ECMA_GET_POINTER( y.value) );
|
||||
} /* ecma_op_same_value */
|
||||
|
||||
/**
|
||||
@@ -200,7 +200,7 @@ ecma_op_to_boolean( ecma_value_t value) /**< ecma-value */
|
||||
{
|
||||
case ECMA_TYPE_NUMBER:
|
||||
{
|
||||
ecma_number_t *num_p = ecma_get_pointer( value.value);
|
||||
ecma_number_t *num_p = ECMA_GET_POINTER( value.value);
|
||||
|
||||
TODO( Implement according to ECMA );
|
||||
|
||||
@@ -227,7 +227,7 @@ ecma_op_to_boolean( ecma_value_t value) /**< ecma-value */
|
||||
}
|
||||
case ECMA_TYPE_STRING:
|
||||
{
|
||||
ecma_array_first_chunk_t *str_p = ecma_get_pointer( value.value);
|
||||
ecma_array_first_chunk_t *str_p = ECMA_GET_POINTER( value.value);
|
||||
|
||||
return ecma_make_simple_completion_value( ( str_p->header.unit_number == 0 ) ? ECMA_SIMPLE_VALUE_FALSE
|
||||
: ECMA_SIMPLE_VALUE_TRUE );
|
||||
|
||||
@@ -90,7 +90,7 @@ ecma_op_is_callable( ecma_value_t value) /**< ecma-value */
|
||||
return false;
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_pointer( value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER( value.value);
|
||||
|
||||
JERRY_ASSERT( obj_p != NULL );
|
||||
JERRY_ASSERT( !obj_p->is_lexical_environment );
|
||||
@@ -131,7 +131,7 @@ ecma_op_create_function_object( const ecma_char_t* formal_parameter_list_p[], /*
|
||||
|
||||
// 9.
|
||||
ecma_property_t *scope_prop_p = ecma_create_internal_property( f, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_set_pointer( scope_prop_p->u.internal_property.value, scope_p);
|
||||
ECMA_SET_POINTER( scope_prop_p->u.internal_property.value, scope_p);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( f, scope_p);
|
||||
|
||||
@@ -244,7 +244,7 @@ ecma_op_function_call( ecma_object_t *func_obj_p, /**< Function object */
|
||||
ecma_property_t *scope_prop_p = ecma_get_internal_property( func_obj_p, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_property_t *code_prop_p = ecma_get_internal_property( func_obj_p, ECMA_INTERNAL_PROPERTY_CODE);
|
||||
|
||||
ecma_object_t *scope_p = ecma_get_pointer( scope_prop_p->u.internal_property.value);
|
||||
ecma_object_t *scope_p = ECMA_GET_POINTER( scope_prop_p->u.internal_property.value);
|
||||
uint32_t code_prop_value = code_prop_p->u.internal_property.value;
|
||||
|
||||
bool is_strict;
|
||||
|
||||
@@ -49,7 +49,7 @@ ecma_op_get_value( ecma_reference_t ref) /**< ECMA-reference */
|
||||
|| base.value_type == ECMA_TYPE_NUMBER
|
||||
|| base.value_type == ECMA_TYPE_STRING );
|
||||
const bool has_object_base = ( base.value_type == ECMA_TYPE_OBJECT
|
||||
&& !((ecma_object_t*)ecma_get_pointer(base.value))->is_lexical_environment );
|
||||
&& !((ecma_object_t*)ECMA_GET_POINTER(base.value))->is_lexical_environment );
|
||||
const bool is_property_reference = has_primitive_base || has_object_base;
|
||||
|
||||
// GetValue_3
|
||||
@@ -63,7 +63,7 @@ ecma_op_get_value( ecma_reference_t ref) /**< ECMA-reference */
|
||||
{
|
||||
if ( !has_primitive_base ) // GetValue_4.a
|
||||
{
|
||||
ecma_object_t *obj_p = ecma_get_pointer( base.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER( base.value);
|
||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||
|
||||
// GetValue_4.b case 1
|
||||
@@ -84,7 +84,7 @@ ecma_op_get_value( ecma_reference_t ref) /**< ECMA-reference */
|
||||
{
|
||||
JERRY_ASSERT( property->Type == ECMA_PROPERTY_NAMEDACCESSOR );
|
||||
|
||||
ecma_object_t *getter = ecma_get_pointer( property->u.named_accessor_property.get_p);
|
||||
ecma_object_t *getter = ECMA_GET_POINTER( property->u.named_accessor_property.get_p);
|
||||
|
||||
if ( getter == NULL )
|
||||
{
|
||||
@@ -102,7 +102,7 @@ ecma_op_get_value( ecma_reference_t ref) /**< ECMA-reference */
|
||||
} else
|
||||
{
|
||||
// GetValue_5
|
||||
ecma_object_t *lex_env_p = ecma_get_pointer( base.value);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_POINTER( base.value);
|
||||
|
||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||
|
||||
@@ -128,7 +128,7 @@ ecma_op_put_value(ecma_reference_t ref, /**< ECMA-reference */
|
||||
|| base.value_type == ECMA_TYPE_NUMBER
|
||||
|| base.value_type == ECMA_TYPE_STRING );
|
||||
const bool has_object_base = ( base.value_type == ECMA_TYPE_OBJECT
|
||||
&& !((ecma_object_t*)ecma_get_pointer(base.value))->is_lexical_environment );
|
||||
&& !((ecma_object_t*)ECMA_GET_POINTER(base.value))->is_lexical_environment );
|
||||
const bool is_property_reference = has_primitive_base || has_object_base;
|
||||
|
||||
if ( is_unresolvable_reference ) // PutValue_3
|
||||
@@ -209,7 +209,7 @@ ecma_op_put_value(ecma_reference_t ref, /**< ECMA-reference */
|
||||
if ( ecma_OpIsAccessorDescriptor( prop) )
|
||||
{
|
||||
// PutValue_sub_6.a
|
||||
ecma_object_t *setter = ecma_get_pointer( property->u.named_accessor_property.set_p);
|
||||
ecma_object_t *setter = ECMA_GET_POINTER( property->u.named_accessor_property.set_p);
|
||||
JERRY_ASSERT( setter != NULL );
|
||||
|
||||
// PutValue_sub_6.b
|
||||
@@ -234,7 +234,7 @@ ecma_op_put_value(ecma_reference_t ref, /**< ECMA-reference */
|
||||
} else
|
||||
{
|
||||
// PutValue_7
|
||||
ecma_object_t *lex_env_p = ecma_get_pointer( base.value);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_POINTER( base.value);
|
||||
|
||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||
|
||||
|
||||
@@ -43,11 +43,11 @@ ecma_get_lex_env_binding_object( ecma_object_t* obj_lex_env_p) /**< object lexic
|
||||
&& obj_lex_env_p->is_lexical_environment
|
||||
&& obj_lex_env_p->u.lexical_environment.type == ECMA_LEXICAL_ENVIRONMENT_OBJECTBOUND );
|
||||
|
||||
ecma_property_t *binding_obj_prop_p = ecma_get_pointer( obj_lex_env_p->properties_p);
|
||||
ecma_property_t *binding_obj_prop_p = ECMA_GET_POINTER( obj_lex_env_p->properties_p);
|
||||
JERRY_ASSERT( binding_obj_prop_p != NULL
|
||||
&& binding_obj_prop_p->u.internal_property.type == ECMA_INTERNAL_PROPERTY_BINDING_OBJECT );
|
||||
|
||||
return ecma_get_pointer( binding_obj_prop_p->u.internal_property.value);
|
||||
return ECMA_GET_POINTER( binding_obj_prop_p->u.internal_property.value);
|
||||
} /* ecma_get_lex_env_binding_object */
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,7 +86,7 @@ ecma_op_object_get( ecma_object_t *obj_p, /**< the object */
|
||||
else
|
||||
{
|
||||
// 4.
|
||||
ecma_object_t *getter = ecma_get_pointer( prop_p->u.named_accessor_property.get_p);
|
||||
ecma_object_t *getter = ECMA_GET_POINTER( prop_p->u.named_accessor_property.get_p);
|
||||
|
||||
// 5.
|
||||
if ( getter == NULL )
|
||||
@@ -162,7 +162,7 @@ ecma_op_object_get_property( ecma_object_t *obj_p, /**< the object */
|
||||
}
|
||||
|
||||
// 3.
|
||||
ecma_object_t *prototype_p = ecma_get_pointer( obj_p->u.object.prototype_object_p);
|
||||
ecma_object_t *prototype_p = ECMA_GET_POINTER( obj_p->u.object.prototype_object_p);
|
||||
|
||||
// 4., 5.
|
||||
if ( prototype_p != NULL )
|
||||
@@ -237,7 +237,7 @@ ecma_op_object_put( ecma_object_t *obj_p, /**< the object */
|
||||
&& desc_p->type == ECMA_PROPERTY_NAMEDACCESSOR )
|
||||
{
|
||||
// a.
|
||||
ecma_object_t *setter_p = ecma_get_pointer( desc_p->u.named_accessor_property.set_p);
|
||||
ecma_object_t *setter_p = ECMA_GET_POINTER( desc_p->u.named_accessor_property.set_p);
|
||||
|
||||
JERRY_ASSERT( setter_p != NULL );
|
||||
|
||||
@@ -308,7 +308,7 @@ ecma_op_object_can_put( ecma_object_t *obj_p, /**< the object */
|
||||
// a.
|
||||
if ( prop_p->type == ECMA_PROPERTY_NAMEDACCESSOR )
|
||||
{
|
||||
ecma_object_t *setter_p = ecma_get_pointer( prop_p->u.named_accessor_property.set_p);
|
||||
ecma_object_t *setter_p = ECMA_GET_POINTER( prop_p->u.named_accessor_property.set_p);
|
||||
|
||||
// i.
|
||||
if ( setter_p == NULL )
|
||||
@@ -330,7 +330,7 @@ ecma_op_object_can_put( ecma_object_t *obj_p, /**< the object */
|
||||
}
|
||||
|
||||
// 3.
|
||||
ecma_object_t *proto_p = ecma_get_pointer( obj_p->u.object.prototype_object_p);
|
||||
ecma_object_t *proto_p = ECMA_GET_POINTER( obj_p->u.object.prototype_object_p);
|
||||
|
||||
// 4.
|
||||
if ( proto_p == NULL )
|
||||
@@ -350,7 +350,7 @@ ecma_op_object_can_put( ecma_object_t *obj_p, /**< the object */
|
||||
// 7.
|
||||
if ( inherited_p->type == ECMA_PROPERTY_NAMEDACCESSOR )
|
||||
{
|
||||
ecma_object_t *setter_p = ecma_get_pointer( inherited_p->u.named_accessor_property.set_p);
|
||||
ecma_object_t *setter_p = ECMA_GET_POINTER( inherited_p->u.named_accessor_property.set_p);
|
||||
|
||||
// a.
|
||||
if ( setter_p == NULL )
|
||||
@@ -613,7 +613,7 @@ ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
||||
if ( property_desc.is_get_defined )
|
||||
{
|
||||
if ( !is_current_accessor_descriptor
|
||||
|| property_desc.get_p != ecma_get_pointer( current_p->u.named_accessor_property.get_p) )
|
||||
|| property_desc.get_p != ECMA_GET_POINTER( current_p->u.named_accessor_property.get_p) )
|
||||
{
|
||||
is_every_field_in_desc_also_occurs_in_current_desc_with_same_value = false;
|
||||
}
|
||||
@@ -622,7 +622,7 @@ ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
||||
if ( property_desc.is_set_defined )
|
||||
{
|
||||
if ( !is_current_accessor_descriptor
|
||||
|| property_desc.set_p != ecma_get_pointer( current_p->u.named_accessor_property.set_p) )
|
||||
|| property_desc.set_p != ECMA_GET_POINTER( current_p->u.named_accessor_property.set_p) )
|
||||
{
|
||||
is_every_field_in_desc_also_occurs_in_current_desc_with_same_value = false;
|
||||
}
|
||||
@@ -734,9 +734,9 @@ ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
||||
// a.
|
||||
|
||||
if ( ( property_desc.is_get_defined
|
||||
&& property_desc.get_p != ecma_get_pointer( current_p->u.named_accessor_property.get_p) )
|
||||
&& property_desc.get_p != ECMA_GET_POINTER( current_p->u.named_accessor_property.get_p) )
|
||||
|| ( property_desc.is_set_defined
|
||||
&& property_desc.set_p != ecma_get_pointer( current_p->u.named_accessor_property.set_p) ) )
|
||||
&& property_desc.set_p != ECMA_GET_POINTER( current_p->u.named_accessor_property.set_p) ) )
|
||||
{
|
||||
// i., ii.
|
||||
return ecma_reject( is_throw);
|
||||
@@ -766,7 +766,7 @@ ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
||||
{
|
||||
JERRY_ASSERT( is_current_accessor_descriptor );
|
||||
|
||||
ecma_set_pointer( current_p->u.named_accessor_property.get_p, property_desc.get_p);
|
||||
ECMA_SET_POINTER( current_p->u.named_accessor_property.get_p, property_desc.get_p);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( obj_p, property_desc.get_p);
|
||||
}
|
||||
@@ -775,7 +775,7 @@ ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
||||
{
|
||||
JERRY_ASSERT( is_current_accessor_descriptor );
|
||||
|
||||
ecma_set_pointer( current_p->u.named_accessor_property.set_p, property_desc.set_p);
|
||||
ECMA_SET_POINTER( current_p->u.named_accessor_property.set_p, property_desc.set_p);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object( obj_p, property_desc.set_p);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, /**< lexical environm
|
||||
JERRY_ASSERT( ecma_is_completion_value_normal_false( completion_value) );
|
||||
}
|
||||
|
||||
lex_env_iter_p = ecma_get_pointer( lex_env_iter_p->u.lexical_environment.outer_reference_p);
|
||||
lex_env_iter_p = ECMA_GET_POINTER( lex_env_iter_p->u.lexical_environment.outer_reference_p);
|
||||
}
|
||||
|
||||
return ecma_make_reference( ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED),
|
||||
|
||||
Reference in New Issue
Block a user