|
31 | 31 | #include "lit-char-helpers.h" |
32 | 32 | #include "lit-magic-strings.h" |
33 | 33 | #include "vm.h" |
| 34 | +#include "rcs-records.h" |
34 | 35 |
|
35 | 36 | /** |
36 | 37 | * Maximum length of strings' concatenation |
@@ -328,24 +329,27 @@ ecma_init_ecma_string_from_lit_cp (ecma_string_t *string_p, /**< descriptor to i |
328 | 329 | JERRY_ASSERT (is_stack_var == (!mem_is_heap_pointer (string_p))); |
329 | 330 | #endif /* !JERRY_NDEBUG */ |
330 | 331 |
|
331 | | - literal_t lit = lit_get_literal_by_cp (lit_cp); |
332 | | - if (lit->get_type () == LIT_MAGIC_STR_T) |
| 332 | + lit_literal_t lit = lit_get_literal_by_cp (lit_cp); |
| 333 | + rcs_record_type_t type = rcs_record_get_type (lit); |
| 334 | + |
| 335 | + if (RCS_RECORD_TYPE_IS_MAGIC_STR (type)) |
333 | 336 | { |
334 | 337 | ecma_init_ecma_string_from_magic_string_id (string_p, |
335 | | - lit_magic_record_get_magic_str_id (lit), |
| 338 | + lit_magic_literal_get_magic_str_id (lit), |
336 | 339 | is_stack_var); |
337 | 340 |
|
338 | 341 | return; |
339 | 342 | } |
340 | | - else if (lit->get_type () == LIT_MAGIC_STR_EX_T) |
| 343 | + |
| 344 | + if (RCS_RECORD_TYPE_IS_MAGIC_STR_EX (type)) |
341 | 345 | { |
342 | 346 | ecma_init_ecma_string_from_magic_string_ex_id (string_p, |
343 | | - lit_magic_record_ex_get_magic_str_id (lit), |
| 347 | + lit_magic_literal_ex_get_magic_str_id (lit), |
344 | 348 | is_stack_var); |
345 | 349 | return; |
346 | 350 | } |
347 | 351 |
|
348 | | - JERRY_ASSERT (lit->get_type () == LIT_STR_T); |
| 352 | + JERRY_ASSERT (RCS_RECORD_TYPE_IS_CHARSET (type)); |
349 | 353 |
|
350 | 354 | string_p->refs = 1; |
351 | 355 | string_p->is_stack_var = (is_stack_var != 0); |
@@ -972,8 +976,8 @@ ecma_string_to_utf8_string (const ecma_string_t *string_desc_p, /**< ecma-string |
972 | 976 | } |
973 | 977 | case ECMA_STRING_CONTAINER_LIT_TABLE: |
974 | 978 | { |
975 | | - literal_t lit = lit_get_literal_by_cp (string_desc_p->u.lit_cp); |
976 | | - JERRY_ASSERT (lit->get_type () == LIT_STR_T); |
| 979 | + lit_literal_t lit = lit_get_literal_by_cp (string_desc_p->u.lit_cp); |
| 980 | + JERRY_ASSERT (RCS_RECORD_IS_CHARSET (lit)); |
977 | 981 | lit_literal_to_utf8_string (lit, buffer_p, (size_t) required_buffer_size); |
978 | 982 | break; |
979 | 983 | } |
@@ -1308,9 +1312,9 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */ |
1308 | 1312 |
|
1309 | 1313 | if (container == ECMA_STRING_CONTAINER_LIT_TABLE) |
1310 | 1314 | { |
1311 | | - literal_t lit = lit_get_literal_by_cp (string_p->u.lit_cp); |
1312 | | - JERRY_ASSERT (lit->get_type () == LIT_STR_T); |
1313 | | - return lit_charset_record_get_length (lit); |
| 1315 | + lit_literal_t lit = lit_get_literal_by_cp (string_p->u.lit_cp); |
| 1316 | + JERRY_ASSERT (RCS_RECORD_IS_CHARSET (lit)); |
| 1317 | + return lit_charset_literal_get_length (lit); |
1314 | 1318 | } |
1315 | 1319 | else if (container == ECMA_STRING_CONTAINER_MAGIC_STRING) |
1316 | 1320 | { |
@@ -1385,10 +1389,10 @@ ecma_string_get_size (const ecma_string_t *string_p) /**< ecma-string */ |
1385 | 1389 |
|
1386 | 1390 | if (container == ECMA_STRING_CONTAINER_LIT_TABLE) |
1387 | 1391 | { |
1388 | | - literal_t lit = lit_get_literal_by_cp (string_p->u.lit_cp); |
1389 | | - JERRY_ASSERT (lit->get_type () == LIT_STR_T); |
| 1392 | + lit_literal_t lit = lit_get_literal_by_cp (string_p->u.lit_cp); |
| 1393 | + JERRY_ASSERT (RCS_RECORD_IS_CHARSET (lit)); |
1390 | 1394 |
|
1391 | | - return lit_charset_record_get_size (lit); |
| 1395 | + return lit_charset_literal_get_size (lit); |
1392 | 1396 | } |
1393 | 1397 | else if (container == ECMA_STRING_CONTAINER_MAGIC_STRING) |
1394 | 1398 | { |
|
0 commit comments