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