mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Adding missing may_ref_younger flags updates and assertion check for the flags value.
This commit is contained in:
parent
1d02085dc6
commit
32f20a02a3
@ -514,6 +514,14 @@ ecma_gc_run (ecma_gc_gen_t max_gen_to_collect) /**< maximum generation to run co
|
||||
{
|
||||
ecma_gc_mark (obj_iter_p, max_gen_to_collect);
|
||||
}
|
||||
#ifndef JERRY_NDEBUG
|
||||
else
|
||||
{
|
||||
ecma_gc_set_object_may_ref_younger_objects (obj_iter_p, true);
|
||||
ecma_gc_mark (obj_iter_p, max_gen_to_collect);
|
||||
JERRY_ASSERT (!ecma_gc_is_object_may_ref_younger_objects (obj_iter_p));
|
||||
}
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -160,7 +160,6 @@ ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< out
|
||||
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_gc_update_may_ref_younger_object_flag_by_object (new_lexical_environment_p, binding_obj_p);
|
||||
|
||||
return new_lexical_environment_p;
|
||||
|
||||
@ -159,7 +159,6 @@ ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], /**< f
|
||||
// 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_gc_update_may_ref_younger_object_flag_by_object (f, scope_p);
|
||||
|
||||
// 10., 11.
|
||||
|
||||
@ -200,8 +200,7 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment
|
||||
{
|
||||
ecma_free_value (property_p->u.named_data_property.value, false);
|
||||
property_p->u.named_data_property.value = ecma_copy_value (value, false);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (lex_env_p, value);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (lex_env_p, property_p->u.named_data_property.value);
|
||||
}
|
||||
else if (is_strict)
|
||||
{
|
||||
@ -476,8 +475,7 @@ ecma_op_initialize_immutable_binding (ecma_object_t *lex_env_p, /**< lexical env
|
||||
&& ecma_is_value_empty (prop_p->u.named_data_property.value));
|
||||
|
||||
prop_p->u.named_data_property.value = ecma_copy_value (value, false);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (lex_env_p, value);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (lex_env_p, prop_p->u.named_data_property.value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -187,10 +187,12 @@ ecma_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */
|
||||
ecma_property_t *parameters_map_prop_p = ecma_create_internal_property (obj_p,
|
||||
ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP);
|
||||
ECMA_SET_POINTER(parameters_map_prop_p->u.internal_property.value, map_p);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object (obj_p, map_p);
|
||||
|
||||
ecma_property_t *scope_prop_p = ecma_create_internal_property (map_p,
|
||||
ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ECMA_SET_POINTER(scope_prop_p->u.internal_property.value, lex_env_p);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_object (map_p, lex_env_p);
|
||||
|
||||
ecma_deref_object (map_p);
|
||||
}
|
||||
@ -364,6 +366,7 @@ ecma_op_arguments_object_get_own_property (ecma_object_t *obj_p, /**< the object
|
||||
|
||||
ecma_free_value (desc_p->u.named_data_property.value, false);
|
||||
desc_p->u.named_data_property.value = ecma_copy_value (completion.u.value, false);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (obj_p, desc_p->u.named_data_property.value);
|
||||
|
||||
ecma_free_completion_value (completion);
|
||||
}
|
||||
|
||||
@ -614,8 +614,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
property_desc.configurable);
|
||||
|
||||
new_prop_p->u.named_data_property.value = ecma_copy_value (property_desc.value, false);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (obj_p, property_desc.value);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (obj_p, new_prop_p->u.named_data_property.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -817,8 +816,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
|
||||
ecma_free_value (current_p->u.named_data_property.value, false);
|
||||
current_p->u.named_data_property.value = ecma_copy_value (property_desc.value, false);
|
||||
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (obj_p, property_desc.value);
|
||||
ecma_gc_update_may_ref_younger_object_flag_by_value (obj_p, current_p->u.named_data_property.value);
|
||||
}
|
||||
|
||||
if (property_desc.is_writable_defined)
|
||||
@ -833,7 +831,6 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
JERRY_ASSERT(is_current_accessor_descriptor);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -842,7 +839,6 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
JERRY_ASSERT(is_current_accessor_descriptor);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user