@@ -111,15 +111,13 @@ typedef enum
111111 ECMA_PARSE_EVAL = (1u << 2 ), /**< eval is called */
112112 ECMA_PARSE_DIRECT_EVAL = (1u << 3 ), /**< eval is called directly (ECMA-262 v5, 15.1.2.1.1) */
113113
114- /* These four status flags must be in this order. See PARSER_CLASS_PARSE_OPTS_OFFSET. */
114+ /* These two status flags must be in this order. See PARSER_CLASS_PARSE_OPTS_OFFSET. */
115115 ECMA_PARSE_CLASS_CONSTRUCTOR = (1u << 4 ), /**< a class constructor is being parsed (this value must be kept in
116116 * in sync with PARSER_CLASS_CONSTRUCTOR) */
117- ECMA_PARSE_HAS_SUPER = (1u << 5 ), /**< the current context has super reference */
118- ECMA_PARSE_HAS_IMPL_SUPER = (1u << 6 ), /**< the current context has implicit parent class */
119- ECMA_PARSE_HAS_STATIC_SUPER = (1u << 7 ), /**< the current context is a static class method */
117+ ECMA_PARSE_CLASS_HERITAGE = (1u << 5 ), /**< the current method is in a heritage context */
120118
121- ECMA_PARSE_CALLED_FROM_FUNCTION = (1u << 8 ), /**< a function body is parsed or the code is inside a function */
122- ECMA_PARSE_GENERATOR_FUNCTION = (1u << 9 ), /**< generator function is parsed */
119+ ECMA_PARSE_CALLED_FROM_FUNCTION = (1u << 6 ), /**< a function body is parsed or the code is inside a function */
120+ ECMA_PARSE_GENERATOR_FUNCTION = (1u << 7 ), /**< generator function is parsed */
123121
124122 /* These flags are internally used by the parser. */
125123} ecma_parse_opts_t ;
195193 * ecma_op_object_find */
196194 ECMA_VALUE_REGISTER_REF = ECMA_MAKE_VALUE (8 ), /**< register reference,
197195 * a special "base" value for vm */
198- ECMA_VALUE_IMPLICIT_CONSTRUCTOR = ECMA_MAKE_VALUE (9 ), /**< special value for bound class constructors */
196+ ECMA_VALUE_CLASS_ENVIRONMENT = ECMA_MAKE_VALUE (9 ), /**< a special value for class encironment record on the stack */
199197 ECMA_VALUE_UNINITIALIZED = ECMA_MAKE_VALUE (10 ), /**< a special value for uninitialized let/const declarations */
200198 ECMA_VALUE_SPREAD_ELEMENT = ECMA_MAKE_VALUE (11 ), /**< a special value for spread elements in array initialization
201199 * or function call argument list */
@@ -661,12 +659,12 @@ typedef enum
661659 ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 13 , /**< declarative lexical environment */
662660 ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 14 , /**< object-bound lexical environment
663661 * with provideThis flag */
664- ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND = 15 , /**< object-bound lexical environment
665- * with provided super reference */
662+ ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND = 15 , /**< object-bound lexical environment
663+ * with provided home object reference */
666664
667665 ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE , /**< first lexical
668666 * environment type */
669- ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND /**< maximum value */
667+ ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND /**< maximum value */
670668} ecma_lexical_environment_type_t ;
671669
672670#if ENABLED (JERRY_ES2015 )
@@ -778,8 +776,9 @@ typedef struct
778776 union
779777 {
780778 jmem_cpointer_t property_list_cp ; /**< compressed pointer to object's
781- * or declerative lexical environments's property list */
779+ * or declerative lexical environments's property list */
782780 jmem_cpointer_t bound_object_cp ; /**< compressed pointer to lexical environments's the bound object */
781+ jmem_cpointer_t home_object_cp ; /**< compressed pointer to lexical environments's the home object */
783782 } u1 ;
784783
785784 /** object prototype or outer reference */
@@ -953,13 +952,12 @@ typedef struct
953952#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
954953
955954#if ENABLED (JERRY_ES2015 )
956-
957955/**
958956 * Description of arrow function objects.
959957 */
960958typedef struct
961959{
962- ecma_extended_object_t header ; /**< extended object header */
960+ ecma_extended_object_t header ; /**< object header */
963961 ecma_value_t this_binding ; /**< value of 'this' binding */
964962} ecma_arrow_function_t ;
965963
@@ -1862,6 +1860,32 @@ typedef struct
18621860 ecma_extended_object_t header ; /**< header part */
18631861 ecma_value_t proxy ; /**< [[RevocableProxy]] internal slot */
18641862} ecma_revocable_proxy_object_t ;
1863+
1864+ /**
1865+ * Set "derived" [[ConstructorKind]] flag for the [[Construct]] method.
1866+ *
1867+ * Whenever this flag is set the new_target_p parameter contains the current [[ThisBindingValue]]
1868+ *
1869+ * @param new_target_p new.target to invoke the [[Construct]] with
1870+ */
1871+ #define ECMA_SET_DERIVED_FLAG (new_target_p ) \
1872+ ((ecma_object_t *) (((uintptr_t) (new_target_p)) | (uintptr_t) 0x01))
1873+
1874+ /**
1875+ * Check whether the "derived" [[ConstructorKind]] flag is set
1876+ *
1877+ * @param new_target_p new.target which the [[Construct]] was invoked
1878+ */
1879+ #define ECMA_HAS_DERIVED_FLAG (new_target_p ) (((uintptr_t) (new_target_p)) & (uintptr_t) 0x1)
1880+
1881+ /**
1882+ * Clear the "derived" [[ConstructorKind]] flag from the parameter
1883+ *
1884+ * @param new_target_p new.target which the [[Construct]] was invoked
1885+ */
1886+ #define ECMA_CLEAR_DERIVED_FLAG (new_target_p ) \
1887+ ((ecma_object_t *) (((uintptr_t) (new_target_p)) & ((uintptr_t) ~0x01)))
1888+
18651889#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
18661890
18671891/**
0 commit comments