Introduce integer ecma-value representation to reduce the double allocations.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -48,7 +48,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
|
||||
return conv_to_num_completion;
|
||||
}
|
||||
|
||||
ecma_number_t *prim_value_p = ecma_get_number_from_value (conv_to_num_completion);
|
||||
ecma_number_t prim_value = ecma_get_number_from_value (conv_to_num_completion);
|
||||
|
||||
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
|
||||
@@ -66,8 +66,11 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
|
||||
|
||||
ecma_property_t *prim_value_prop_p = ecma_create_internal_property (obj_p,
|
||||
ECMA_INTERNAL_PROPERTY_PRIMITIVE_NUMBER_VALUE);
|
||||
ecma_number_t *prim_value_p = ecma_alloc_number ();
|
||||
*prim_value_p = prim_value;
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (ECMA_PROPERTY_VALUE_PTR (prim_value_prop_p)->value, prim_value_p);
|
||||
|
||||
ecma_free_value (conv_to_num_completion);
|
||||
return ecma_make_object_value (obj_p);
|
||||
} /* ecma_op_create_number_object */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user