25
25
26
26
#include "config.h"
27
27
#include "jrt.h"
28
+ #include "lit-globals.h"
29
+ #include "lit-magic-strings.h"
28
30
#include "mem-allocator.h"
29
31
#include "rcs-recordset.h"
30
32
@@ -566,24 +568,6 @@ typedef struct
566
568
bool is_configurable ;
567
569
} ecma_property_descriptor_t ;
568
570
569
- #if CONFIG_ECMA_CHAR_ENCODING == CONFIG_ECMA_CHAR_ASCII
570
- /**
571
- * Description of an ecma-character
572
- */
573
- typedef uint8_t ecma_char_t ;
574
- #elif CONFIG_ECMA_CHAR_ENCODING == CONFIG_ECMA_CHAR_UTF16
575
- /**
576
- * Description of an ecma-character
577
- */
578
- typedef uint16_t ecma_char_t ;
579
- #endif /* CONFIG_ECMA_CHAR_ENCODING == CONFIG_ECMA_CHAR_UTF16 */
580
-
581
- /**
582
- * Description of an ecma-character pointer
583
- */
584
- typedef ecma_char_t * ecma_char_ptr_t ;
585
-
586
-
587
571
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
588
572
/**
589
573
* Description of an ecma-number
@@ -689,11 +673,6 @@ typedef double ecma_number_t;
689
673
*/
690
674
#define ECMA_NUMBER_SQRT2 ((ecma_number_t)1.4142135623730951)
691
675
692
- /**
693
- * Null character (zt-string end marker)
694
- */
695
- #define ECMA_CHAR_NULL ((ecma_char_t) '\0')
696
-
697
676
/**
698
677
* Maximum number of characters in string representation of ecma-number
699
678
*/
@@ -712,22 +691,17 @@ typedef double ecma_number_t;
712
691
*/
713
692
#define ECMA_MAX_VALUE_OF_VALID_ARRAY_INDEX ((uint32_t) (-1))
714
693
715
- /**
716
- * Description of a collection's/string's length
717
- */
718
- typedef uint16_t ecma_length_t ;
719
-
720
694
/**
721
695
* Description of a collection's header.
722
696
*/
723
697
typedef struct
724
698
{
725
- /** Compressed pointer to next chunk with collection's data */
726
- mem_cpointer_t next_chunk_cp ;
727
-
728
699
/** Number of elements in the collection */
729
700
ecma_length_t unit_number ;
730
701
702
+ /** Compressed pointer to next chunk with collection's data */
703
+ mem_cpointer_t next_chunk_cp ;
704
+
731
705
/** Place for the collection's data */
732
706
uint8_t data [ sizeof (uint64_t ) - sizeof (mem_cpointer_t ) - sizeof (ecma_length_t ) ];
733
707
} ecma_collection_header_t ;
@@ -741,7 +715,7 @@ typedef struct
741
715
mem_cpointer_t next_chunk_cp ;
742
716
743
717
/** Characters */
744
- uint8_t data [ sizeof (uint64_t ) - sizeof (mem_cpointer_t ) ];
718
+ lit_utf8_byte_t data [ sizeof (uint64_t ) - sizeof (mem_cpointer_t ) ];
745
719
} ecma_collection_chunk_t ;
746
720
747
721
/**
@@ -768,39 +742,6 @@ FIXME (Move to library that should define the type (literal.h /* ? */))
768
742
typedef rcs_record_t * literal_t ;
769
743
typedef rcs_cpointer_t lit_cpointer_t ;
770
744
771
- /**
772
- * Identifiers of ECMA and implementation-defined magic string constants
773
- */
774
- typedef enum
775
- {
776
- #define ECMA_MAGIC_STRING_DEF(id, ascii_zt_string) \
777
- id,
778
- #include "ecma-magic-strings.inc.h"
779
- #undef ECMA_MAGIC_STRING_DEF
780
-
781
- ECMA_MAGIC_STRING__COUNT /**< number of magic strings */
782
- } ecma_magic_string_id_t ;
783
-
784
- /**
785
- * Identifiers of implementation-defined external magic string constants
786
- */
787
- typedef uint32_t ecma_magic_string_ex_id_t ;
788
-
789
- /**
790
- * ECMA string hash
791
- */
792
- typedef uint8_t ecma_string_hash_t ;
793
-
794
- /**
795
- * Length of string hash, in bits
796
- */
797
- #define ECMA_STRING_HASH_BITS (sizeof (ecma_string_hash_t) * JERRY_BITSINBYTE)
798
-
799
- /**
800
- * Number of string's last characters to use for hash calculation
801
- */
802
- #define ECMA_STRING_HASH_LAST_CHARS_COUNT (2)
803
-
804
745
/**
805
746
* ECMA string-value descriptor
806
747
*/
@@ -817,7 +758,7 @@ typedef struct ecma_string_t
817
758
uint8_t container ;
818
759
819
760
/** Hash of the string (calculated from two last characters of the string) */
820
- ecma_string_hash_t hash ;
761
+ lit_string_hash_t hash ;
821
762
822
763
/**
823
764
* Actual data or identifier of it's place in container (depending on 'container' field)
@@ -844,10 +785,10 @@ typedef struct ecma_string_t
844
785
} concatenation ;
845
786
846
787
/** Identifier of magic string */
847
- ecma_magic_string_id_t magic_string_id ;
788
+ lit_magic_string_id_t magic_string_id ;
848
789
849
790
/** Identifier of external magic string */
850
- ecma_magic_string_ex_id_t magic_string_ex_id ;
791
+ lit_magic_string_ex_id_t magic_string_ex_id ;
851
792
852
793
/** For zeroing and comparison in some cases */
853
794
uint32_t common_field ;
0 commit comments