@@ -3426,7 +3426,7 @@ typedef struct
3426
3426
{
3427
3427
jerry_typedarray_type_t api_type ; /**< api type */
3428
3428
ecma_builtin_id_t prototype_id ; /**< prototype ID */
3429
- lit_magic_string_id_t lit_id ; /**< literal ID */
3429
+ ecma_typedarray_type_t id ; /**< typedArray ID */
3430
3430
uint8_t element_size_shift ; /**< element size shift */
3431
3431
} jerry_typedarray_mapping_t ;
3432
3432
@@ -3437,7 +3437,7 @@ static jerry_typedarray_mapping_t jerry_typedarray_mappings[] =
3437
3437
{
3438
3438
#define TYPEDARRAY_ENTRY (NAME , LIT_NAME , SIZE_SHIFT ) \
3439
3439
{ JERRY_TYPEDARRAY_ ## NAME , ECMA_BUILTIN_ID_ ## NAME ## ARRAY_PROTOTYPE, \
3440
- LIT_MAGIC_STRING_ ## LIT_NAME ## _ARRAY_UL , SIZE_SHIFT }
3440
+ ECMA_ ## LIT_NAME ## _ARRAY , SIZE_SHIFT }
3441
3441
3442
3442
TYPEDARRAY_ENTRY (UINT8 , UINT8 , 0 ),
3443
3443
TYPEDARRAY_ENTRY (UINT8CLAMPED , UINT8_CLAMPED , 0 ),
@@ -3455,7 +3455,7 @@ static jerry_typedarray_mapping_t jerry_typedarray_mappings[] =
3455
3455
};
3456
3456
3457
3457
/**
3458
- * Helper function to get the TypedArray prototype, literal id, and element size shift
3458
+ * Helper function to get the TypedArray prototype, typedArray id, and element size shift
3459
3459
* information.
3460
3460
*
3461
3461
* @return true - if the TypedArray information was found
@@ -3464,19 +3464,19 @@ static jerry_typedarray_mapping_t jerry_typedarray_mappings[] =
3464
3464
static bool
3465
3465
jerry_typedarray_find_by_type (jerry_typedarray_type_t type_name , /**< type of the TypedArray */
3466
3466
ecma_builtin_id_t * prototype_id , /**< [out] found prototype object id */
3467
- lit_magic_string_id_t * lit_id , /**< [out] found literal id */
3467
+ ecma_typedarray_type_t * id , /**< [out] found typedArray id */
3468
3468
uint8_t * element_size_shift ) /**< [out] found element size shift value */
3469
3469
{
3470
3470
JERRY_ASSERT (prototype_id != NULL );
3471
- JERRY_ASSERT (lit_id != NULL );
3471
+ JERRY_ASSERT (id != NULL );
3472
3472
JERRY_ASSERT (element_size_shift != NULL );
3473
3473
3474
3474
for (uint32_t i = 0 ; i < sizeof (jerry_typedarray_mappings ) / sizeof (jerry_typedarray_mappings [0 ]); i ++ )
3475
3475
{
3476
3476
if (type_name == jerry_typedarray_mappings [i ].api_type )
3477
3477
{
3478
3478
* prototype_id = jerry_typedarray_mappings [i ].prototype_id ;
3479
- * lit_id = jerry_typedarray_mappings [i ].lit_id ;
3479
+ * id = jerry_typedarray_mappings [i ].id ;
3480
3480
* element_size_shift = jerry_typedarray_mappings [i ].element_size_shift ;
3481
3481
return true;
3482
3482
}
@@ -3505,10 +3505,10 @@ jerry_create_typedarray (jerry_typedarray_type_t type_name, /**< type of TypedAr
3505
3505
3506
3506
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY )
3507
3507
ecma_builtin_id_t prototype_id = 0 ;
3508
- lit_magic_string_id_t lit_id = 0 ;
3508
+ ecma_typedarray_type_t id = 0 ;
3509
3509
uint8_t element_size_shift = 0 ;
3510
3510
3511
- if (!jerry_typedarray_find_by_type (type_name , & prototype_id , & lit_id , & element_size_shift ))
3511
+ if (!jerry_typedarray_find_by_type (type_name , & prototype_id , & id , & element_size_shift ))
3512
3512
{
3513
3513
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("incorrect type for TypedArray." )));
3514
3514
}
@@ -3518,7 +3518,7 @@ jerry_create_typedarray (jerry_typedarray_type_t type_name, /**< type of TypedAr
3518
3518
ecma_value_t array_value = ecma_typedarray_create_object_with_length (length ,
3519
3519
prototype_obj_p ,
3520
3520
element_size_shift ,
3521
- lit_id );
3521
+ id );
3522
3522
3523
3523
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (array_value ));
3524
3524
@@ -3549,10 +3549,10 @@ jerry_create_typedarray_for_arraybuffer_sz (jerry_typedarray_type_t type_name, /
3549
3549
3550
3550
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY )
3551
3551
ecma_builtin_id_t prototype_id = 0 ;
3552
- lit_magic_string_id_t lit_id = 0 ;
3552
+ ecma_typedarray_type_t id = 0 ;
3553
3553
uint8_t element_size_shift = 0 ;
3554
3554
3555
- if (!jerry_typedarray_find_by_type (type_name , & prototype_id , & lit_id , & element_size_shift ))
3555
+ if (!jerry_typedarray_find_by_type (type_name , & prototype_id , & id , & element_size_shift ))
3556
3556
{
3557
3557
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("incorrect type for TypedArray." )));
3558
3558
}
@@ -3570,7 +3570,7 @@ jerry_create_typedarray_for_arraybuffer_sz (jerry_typedarray_type_t type_name, /
3570
3570
ecma_make_uint32_value (length )
3571
3571
};
3572
3572
3573
- ecma_value_t array_value = ecma_op_create_typedarray (arguments_p , 3 , prototype_obj_p , element_size_shift , lit_id );
3573
+ ecma_value_t array_value = ecma_op_create_typedarray (arguments_p , 3 , prototype_obj_p , element_size_shift , id );
3574
3574
ecma_free_value (arguments_p [1 ]);
3575
3575
ecma_free_value (arguments_p [2 ]);
3576
3576
@@ -3627,11 +3627,11 @@ jerry_get_typedarray_type (jerry_value_t value) /**< object to get the TypedArra
3627
3627
}
3628
3628
3629
3629
ecma_object_t * array_p = ecma_get_object_from_value (value );
3630
+ ecma_typedarray_type_t class_type = ecma_get_typedarray_id (array_p );
3630
3631
3631
- lit_magic_string_id_t class_name_id = ecma_object_get_class_name (array_p );
3632
3632
for (uint32_t i = 0 ; i < sizeof (jerry_typedarray_mappings ) / sizeof (jerry_typedarray_mappings [0 ]); i ++ )
3633
3633
{
3634
- if (class_name_id == jerry_typedarray_mappings [i ].lit_id )
3634
+ if (class_type == jerry_typedarray_mappings [i ].id )
3635
3635
{
3636
3636
return jerry_typedarray_mappings [i ].api_type ;
3637
3637
}
0 commit comments