@@ -142,7 +142,7 @@ typedef int32_t ecma_integer_value_t;
142
142
*/
143
143
#define ECMA_DIRECT_SHIFT 4
144
144
145
- /* ECMA make simple value */
145
+ /** ECMA make simple value */
146
146
#define ECMA_MAKE_VALUE (value ) \
147
147
((((ecma_value_t) (value)) << ECMA_DIRECT_SHIFT) | ECMA_DIRECT_TYPE_SIMPLE_VALUE)
148
148
@@ -171,25 +171,43 @@ enum
171
171
* a special "base" value for vm */
172
172
};
173
173
174
+ #if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
174
175
/**
175
176
* Maximum integer number for an ecma value
176
177
*/
177
- #if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
178
178
#define ECMA_INTEGER_NUMBER_MAX 0x7fffff
179
+ /**
180
+ * Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
181
+ */
179
182
#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7fffff0
180
183
#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
184
+ /**
185
+ * Maximum integer number for an ecma value
186
+ */
181
187
#define ECMA_INTEGER_NUMBER_MAX 0x7ffffff
188
+ /**
189
+ * Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
190
+ */
182
191
#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7ffffff0
183
192
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
184
193
194
+ #if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
185
195
/**
186
196
* Minimum integer number for an ecma value
187
197
*/
188
- #if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
189
198
#define ECMA_INTEGER_NUMBER_MIN -0x7fffff
199
+ /**
200
+ * Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
201
+ */
190
202
#define ECMA_INTEGER_NUMBER_MIN_SHIFTED -0x7fffff0
191
203
#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
204
+ /**
205
+ * Minimum integer number for an ecma value
206
+ */
192
207
#define ECMA_INTEGER_NUMBER_MIN -0x8000000
208
+ /**
209
+ * Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
210
+ */
193
211
#define ECMA_INTEGER_NUMBER_MIN_SHIFTED (-0x7fffffff - 1) /* -0x80000000 */
194
212
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
195
213
@@ -708,33 +726,33 @@ typedef struct
708
726
{
709
727
ecma_object_t object ; /**< object header */
710
728
711
- /*
712
- * Description of extra fields. These extra fields depends on the object type.
729
+ /**
730
+ * Description of extra fields. These extra fields depend on the object type.
713
731
*/
714
732
union
715
733
{
716
734
ecma_built_in_props_t built_in ; /**< built-in object part */
717
735
718
- /*
736
+ /**
719
737
* Description of objects with class.
720
738
*/
721
739
struct
722
740
{
723
741
uint16_t class_id ; /**< class id of the object */
724
742
uint16_t extra_info ; /**< extra information for the object
725
- e.g. array buffer type info (external/internal) */
743
+ * e.g. array buffer type info (external/internal) */
726
744
727
- /*
728
- * Description of extra fields. These extra fields depends on the class_id.
745
+ /**
746
+ * Description of extra fields. These extra fields depend on the class_id.
729
747
*/
730
748
union
731
749
{
732
750
ecma_value_t value ; /**< value of the object (e.g. boolean, number, string, etc.) */
733
- uint32_t length ; /**< length related property (e.g. length of ArrayBuffer) */
751
+ uint32_t length ; /**< length related property (e.g. length of ArrayBuffer) */
734
752
} u ;
735
753
} class_prop ;
736
754
737
- /*
755
+ /**
738
756
* Description of function objects.
739
757
*/
740
758
struct
@@ -743,7 +761,7 @@ typedef struct
743
761
ecma_value_t bytecode_cp ; /**< function byte code */
744
762
} function ;
745
763
746
- /*
764
+ /**
747
765
* Description of array objects.
748
766
*/
749
767
struct
@@ -752,14 +770,14 @@ typedef struct
752
770
ecma_property_t length_prop ; /**< length property */
753
771
} array ;
754
772
755
- /*
773
+ /**
756
774
* Description of pseudo array objects.
757
775
*/
758
776
struct
759
777
{
760
778
uint8_t type ; /**< pseudo array type, e.g. Arguments, TypedArray*/
761
- uint8_t extra_info ; /**< extra infomations about the object.
762
- * e.g. element_width_shift for typed arrays */
779
+ uint8_t extra_info ; /**< extra information about the object.
780
+ * e.g. element_width_shift for typed arrays */
763
781
union
764
782
{
765
783
uint16_t length ; /**< for arguments: length of names */
@@ -772,7 +790,7 @@ typedef struct
772
790
} u2 ;
773
791
} pseudo_array ;
774
792
775
- /*
793
+ /**
776
794
* Description of bound function object.
777
795
*/
778
796
struct
@@ -802,10 +820,10 @@ typedef struct
802
820
uint16_t size ; /**< real size >> JMEM_ALIGNMENT_LOG */
803
821
uint16_t refs ; /**< reference counter for the byte code */
804
822
uint16_t status_flags ; /**< various status flags:
805
- * CBC_CODE_FLAGS_FUNCTION flag tells whether
806
- * the byte code is function or regular expression.
807
- * If function, the other flags must be CBC_CODE_FLAGS...
808
- * If regexp, the other flags must be RE_FLAG... */
823
+ * CBC_CODE_FLAGS_FUNCTION flag tells whether
824
+ * the byte code is function or regular expression.
825
+ * If function, the other flags must be CBC_CODE_FLAGS...
826
+ * If regexp, the other flags must be RE_FLAG... */
809
827
} ecma_compiled_code_t ;
810
828
811
829
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
@@ -902,6 +920,7 @@ typedef struct
902
920
* Description of an ecma-number
903
921
*/
904
922
typedef float ecma_number_t ;
923
+
905
924
#define DOUBLE_TO_ECMA_NUMBER_T (value ) (ecma_number_t) (value)
906
925
907
926
/**
@@ -937,6 +956,7 @@ typedef float ecma_number_t;
937
956
* Description of an ecma-number
938
957
*/
939
958
typedef double ecma_number_t ;
959
+
940
960
#define DOUBLE_TO_ECMA_NUMBER_T (value ) value
941
961
942
962
/**
@@ -994,21 +1014,28 @@ typedef double ecma_number_t;
994
1014
*/
995
1015
#define ECMA_NUMBER_MINUS_ONE ((ecma_number_t) -1)
996
1016
1017
+ #if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
997
1018
/**
998
- * Minimum positive and maximum value of ecma-number
1019
+ * Number.MIN_VALUE (i.e., the smallest positive value of ecma-number)
1020
+ *
1021
+ * See also: ECMA_262 v5, 15.7.3.3
999
1022
*/
1000
- #if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
1001
1023
# define ECMA_NUMBER_MIN_VALUE (FLT_MIN)
1024
+ /**
1025
+ * Number.MAX_VALUE (i.e., the maximum value of ecma-number)
1026
+ *
1027
+ * See also: ECMA_262 v5, 15.7.3.2
1028
+ */
1002
1029
# define ECMA_NUMBER_MAX_VALUE (FLT_MAX)
1003
1030
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
1004
1031
/**
1005
- * Number.MAX_VALUE
1032
+ * Number.MAX_VALUE (i.e., the maximum value of ecma-number)
1006
1033
*
1007
1034
* See also: ECMA_262 v5, 15.7.3.2
1008
1035
*/
1009
1036
# define ECMA_NUMBER_MAX_VALUE ((ecma_number_t) 1.7976931348623157e+308)
1010
1037
/**
1011
- * Number.MIN_VALUE
1038
+ * Number.MIN_VALUE (i.e., the smallest positive value of ecma-number)
1012
1039
*
1013
1040
* See also: ECMA_262 v5, 15.7.3.3
1014
1041
*/
0 commit comments