Improve date internals (#4593)

- Optimize year from time calculation
- Force arithmetic operations to int32_t/int64_t whenever possible
- Optimize number conversion in date parse
- Cache local TZA of the date object
- Fix a bug in Date.parse timezone parsing

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
Robert Fancsik
2021-02-17 16:07:54 +01:00
committed by GitHub
parent 67e7e89c8e
commit 488a0bf7e8
10 changed files with 810 additions and 785 deletions
+5 -2
View File
@@ -1577,9 +1577,12 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
case LIT_MAGIC_STRING_DATE_UL:
{
ecma_number_t *num_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t,
ext_object_p->u.class_prop.u.value);
#if JERRY_ESNEXT
ext_object_size = sizeof (ecma_date_object_t);
#else /* !JERRY_ESNEXT */
ecma_number_t *num_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.class_prop.u.date);
ecma_dealloc_number (num_p);
#endif /* JERRY_ESNEXT */
break;
}
case LIT_MAGIC_STRING_REGEXP_UL: