Skip to content

Commit 091c1b8

Browse files
committed
Create extend byte code flags with function types.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent e76a138 commit 091c1b8

File tree

8 files changed

+153
-84
lines changed

8 files changed

+153
-84
lines changed

jerry-core/api/jerry-snapshot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled
161161
ecma_compiled_code_t *copied_code_p = (ecma_compiled_code_t *) copied_code_start_p;
162162

163163
#if ENABLED (JERRY_ES2015)
164-
if (compiled_code_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS)
164+
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
165165
{
166166
const char * const error_message_p = "Unsupported feature: tagged template literals.";
167167
globals_p->snapshot_error = jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) error_message_p);
168168
return 0;
169169
}
170170

171-
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR)
171+
if (CBC_FUNCTION_GET_TYPE (compiled_code_p->status_flags) == CBC_FUNCTION_CONSTRUCTOR)
172172
{
173173
globals_p->class_found = true;
174174
}
@@ -620,13 +620,13 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
620620

621621
#if ENABLED (JERRY_ES2015)
622622
/* function name */
623-
if (!(bytecode_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
623+
if (CBC_FUNCTION_GET_TYPE (bytecode_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
624624
{
625625
extra_bytes += (uint32_t) sizeof (ecma_value_t);
626626
}
627627

628628
/* tagged template literals */
629-
if (bytecode_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS)
629+
if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
630630
{
631631
extra_bytes += (uint32_t) sizeof (ecma_value_t);
632632
}

jerry-core/ecma/base/ecma-gc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ ecma_gc_mark_set_object (ecma_object_t *object_p) /**< object */
405405
static void
406406
ecma_gc_mark_tagged_template_literals (const ecma_compiled_code_t *byte_code_p)
407407
{
408-
JERRY_ASSERT (byte_code_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS);
408+
JERRY_ASSERT (byte_code_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS);
409409

410410
ecma_collection_t *collection_p = ecma_compiled_code_get_tagged_template_collection (byte_code_p);
411411

@@ -702,12 +702,12 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
702702
#if ENABLED (JERRY_ES2015)
703703
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code (ext_func_p);
704704

705-
if (byte_code_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS)
705+
if (byte_code_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
706706
{
707707
ecma_gc_mark_tagged_template_literals (byte_code_p);
708708
}
709709

710-
if (byte_code_p->status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION)
710+
if (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_ARROW)
711711
{
712712
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
713713

@@ -1225,7 +1225,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
12251225
ext_func_p->u.function.bytecode_cp));
12261226

12271227
#if ENABLED (JERRY_ES2015)
1228-
if (byte_code_p->status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION)
1228+
if (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_ARROW)
12291229
{
12301230
ecma_free_value_if_not_object (((ecma_arrow_function_t *) object_p)->this_binding);
12311231
ecma_free_value_if_not_object (((ecma_arrow_function_t *) object_p)->new_target);

jerry-core/ecma/base/ecma-helpers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
14391439
#endif /* ENABLED (JERRY_DEBUGGER) */
14401440

14411441
#if ENABLED (JERRY_ES2015)
1442-
if (bytecode_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS)
1442+
if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
14431443
{
14441444
ecma_collection_destroy (ecma_compiled_code_get_tagged_template_collection (bytecode_p));
14451445
}
@@ -1472,7 +1472,7 @@ ecma_collection_t *
14721472
ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *bytecode_header_p) /**< compiled code */
14731473
{
14741474
JERRY_ASSERT (bytecode_header_p != NULL);
1475-
JERRY_ASSERT (bytecode_header_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS);
1475+
JERRY_ASSERT (bytecode_header_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS);
14761476

14771477
ecma_value_t *base_p = ecma_compiled_code_resolve_function_name (bytecode_header_p);
14781478

@@ -1534,7 +1534,7 @@ ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t *bytecode_h
15341534
ecma_value_t *base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p);
15351535

15361536
#if ENABLED (JERRY_ES2015)
1537-
if (!(bytecode_header_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
1537+
if (CBC_FUNCTION_GET_TYPE (bytecode_header_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
15381538
{
15391539
base_p--;
15401540
}

jerry-core/ecma/base/ecma-literal-storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ ecma_snapshot_resolve_serializable_values (ecma_compiled_code_t *compiled_code_p
570570

571571
#if ENABLED (JERRY_ES2015)
572572
/* function name */
573-
if (!(compiled_code_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
573+
if (CBC_FUNCTION_GET_TYPE (compiled_code_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
574574
{
575575
base_p--;
576576
}

jerry-core/ecma/operations/ecma-function-object.c

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,9 @@ ecma_op_function_is_generator (ecma_object_t *obj_p) /**< object */
602602
&& !ecma_get_object_is_builtin (obj_p))
603603
{
604604
ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) obj_p;
605-
const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_obj_p);
605+
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code (ext_func_obj_p);
606606

607-
return (bytecode_data_p->status_flags & CBC_CODE_FLAGS_GENERATOR) != 0;
607+
return CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_GENERATOR;
608608
}
609609

610610
return false;
@@ -843,26 +843,20 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
843843
uint16_t status_flags = bytecode_data_p->status_flags;
844844

845845
#if ENABLED (JERRY_ES2015)
846-
bool is_construct_call = JERRY_CONTEXT (current_new_target) != NULL;
847-
if (JERRY_UNLIKELY (status_flags & (CBC_CODE_FLAGS_CLASS_CONSTRUCTOR | CBC_CODE_FLAGS_GENERATOR)))
848-
{
849-
if (!is_construct_call && (status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
850-
{
851-
return ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
852-
}
846+
uint16_t function_type = CBC_FUNCTION_GET_TYPE (status_flags);
853847

854-
if ((status_flags & CBC_CODE_FLAGS_GENERATOR) && is_construct_call)
855-
{
856-
return ecma_raise_type_error (ECMA_ERR_MSG ("Generator functions cannot be invoked with 'new'."));
857-
}
848+
if (JERRY_UNLIKELY (function_type == CBC_FUNCTION_CONSTRUCTOR)
849+
&& JERRY_CONTEXT (current_new_target) == NULL)
850+
{
851+
return ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
858852
}
859853
#endif /* ENABLED (JERRY_ES2015) */
860854

861855
/* 1. */
862856
#if ENABLED (JERRY_ES2015)
863857
ecma_object_t *old_function_object_p = JERRY_CONTEXT (current_function_obj_p);
864858

865-
if (JERRY_UNLIKELY (status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION))
859+
if (JERRY_UNLIKELY (function_type == CBC_FUNCTION_ARROW))
866860
{
867861
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) func_obj_p;
868862

@@ -920,7 +914,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
920914
}
921915
#if ENABLED (JERRY_ES2015)
922916
// ECMAScript v6, 9.2.2.8
923-
if (JERRY_UNLIKELY (status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
917+
if (JERRY_UNLIKELY (function_type == CBC_FUNCTION_CONSTRUCTOR))
924918
{
925919
ecma_value_t lexical_this;
926920
lexical_this = (ECMA_GET_THIRD_BIT_FROM_POINTER_TAG (ext_func_p->u.function.scope_cp) ? ECMA_VALUE_UNINITIALIZED
@@ -1278,20 +1272,39 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
12781272

12791273
ecma_object_t *new_this_obj_p = NULL;
12801274
ecma_value_t this_arg;
1275+
1276+
#if ENABLED (JERRY_ES2015)
12811277
ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
12821278
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code (ext_func_obj_p);
12831279

1284-
if (byte_code_p->status_flags & (CBC_CODE_FLAGS_ARROW_FUNCTION | CBC_CODE_FLAGS_ACCESSOR))
1280+
if (!CBC_FUNCTION_IS_CONSTRUCTABLE (byte_code_p->status_flags))
12851281
{
1286-
if (byte_code_p->status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION)
1282+
const char *message_p;
1283+
1284+
switch (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags))
12871285
{
1288-
return ecma_raise_type_error (ECMA_ERR_MSG ("Arrow functions have no constructor."));
1286+
case CBC_FUNCTION_GENERATOR:
1287+
{
1288+
message_p = ECMA_ERR_MSG ("Generator functions cannot be invoked with 'new'.");
1289+
break;
1290+
}
1291+
case CBC_FUNCTION_ARROW:
1292+
{
1293+
message_p = ECMA_ERR_MSG ("Arrow functions cannot be invoked with 'new'.");
1294+
break;
1295+
}
1296+
default:
1297+
{
1298+
JERRY_ASSERT (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_ACCESSOR);
1299+
1300+
message_p = ECMA_ERR_MSG ("Accessor functions cannot be invoked with 'new'.");
1301+
break;
1302+
}
12891303
}
12901304

1291-
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a constructor."));
1305+
return ecma_raise_type_error (message_p);
12921306
}
12931307

1294-
#if ENABLED (JERRY_ES2015)
12951308
/* 6. */
12961309
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
12971310
JERRY_CONTEXT (current_new_target) = new_target_p;
@@ -1366,17 +1379,18 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun
13661379
{
13671380
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
13681381

1369-
if (byte_code_p->status_flags & CBC_CODE_FLAGS_GENERATOR)
1382+
if (!CBC_FUNCTION_HAS_PROTOTYPE (byte_code_p->status_flags))
1383+
{
1384+
return NULL;
1385+
}
1386+
1387+
if (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_GENERATOR)
13701388
{
13711389
proto_object_p = ecma_create_object (ecma_builtin_get (ECMA_BUILTIN_ID_GENERATOR_PROTOTYPE),
13721390
0,
13731391
ECMA_OBJECT_TYPE_GENERAL);
13741392
init_constructor = false;
13751393
}
1376-
else if (byte_code_p->status_flags & (CBC_CODE_FLAGS_ARROW_FUNCTION | CBC_CODE_FLAGS_ACCESSOR))
1377-
{
1378-
return NULL;
1379-
}
13801394
}
13811395
#endif /* ENABLED (JERRY_ES2015) */
13821396

@@ -1474,7 +1488,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
14741488
ECMA_SET_SECOND_BIT_TO_POINTER_TAG (ext_func_p->u.function.scope_cp);
14751489
const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
14761490

1477-
if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
1491+
if (CBC_FUNCTION_GET_TYPE (bytecode_data_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
14781492
{
14791493
ecma_value_t value = *ecma_compiled_code_resolve_function_name (bytecode_data_p);
14801494
if (value != ECMA_VALUE_EMPTY)
@@ -1694,7 +1708,7 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
16941708
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
16951709

16961710
#if ENABLED (JERRY_ES2015)
1697-
if (bytecode_data_p->status_flags & (CBC_CODE_FLAGS_ARROW_FUNCTION | CBC_CODE_FLAGS_ACCESSOR))
1711+
if (!CBC_FUNCTION_HAS_PROTOTYPE (bytecode_data_p->status_flags))
16981712
{
16991713
return;
17001714
}

jerry-core/parser/js/byte-code.h

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -813,16 +813,59 @@ typedef enum
813813
CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED = (1u << 4), /**< mapped arguments object must be constructed */
814814
CBC_CODE_FLAGS_UNMAPPED_ARGUMENTS_NEEDED = (1u << 5), /**< mapped arguments object must be constructed */
815815
CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED = (1u << 6), /**< no need to create a lexical environment */
816-
CBC_CODE_FLAGS_ARROW_FUNCTION = (1u << 7), /**< this function is an arrow function */
817-
CBC_CODE_FLAGS_STATIC_FUNCTION = (1u << 8), /**< this function is a static snapshot function */
818-
CBC_CODE_FLAGS_DEBUGGER_IGNORE = (1u << 9), /**< this function should be ignored by debugger */
819-
CBC_CODE_FLAGS_CLASS_CONSTRUCTOR = (1u << 10), /**< this function is a class constructor */
820-
CBC_CODE_FLAGS_GENERATOR = (1u << 11), /**< this function is a generator */
821-
CBC_CODE_FLAGS_REST_PARAMETER = (1u << 12), /**< this function has rest parameter */
822-
CBC_CODE_FLAG_HAS_TAGGED_LITERALS = (1u << 13), /**< this function has tagged template literal list */
823-
CBC_CODE_FLAGS_LEXICAL_BLOCK_NEEDED = (1u << 14), /**< compiled code needs a lexical block */
824-
CBC_CODE_FLAGS_ACCESSOR = (1u << 15) /**< accessor propety 'get' and 'set' functions */
825-
} cbc_code_flags;
816+
CBC_CODE_FLAGS_STATIC_FUNCTION = (1u << 7), /**< this function is a static snapshot function */
817+
CBC_CODE_FLAGS_DEBUGGER_IGNORE = (1u << 8), /**< this function should be ignored by debugger */
818+
CBC_CODE_FLAGS_REST_PARAMETER = (1u << 9), /**< this function has rest parameter */
819+
CBC_CODE_FLAGS_HAS_TAGGED_LITERALS = (1u << 10), /**< this function has tagged template literal list */
820+
CBC_CODE_FLAGS_LEXICAL_BLOCK_NEEDED = (1u << 11), /**< compiled code needs a lexical block */
821+
822+
/* Bits from bit 13 is reserved for function types (see CBC_CODE_FLAGS_FUNCTION_TYPE_SHIFT). */
823+
} cbc_code_flags_t;
824+
825+
/**
826+
* Compact byte code function types.
827+
*/
828+
typedef enum
829+
{
830+
CBC_FUNCTION_NORMAL, /**< function without special properties */
831+
CBC_FUNCTION_CONSTRUCTOR, /**< constructor function */
832+
833+
/* The following functions cannot be constructed (see CBC_FUNCTION_IS_CONSTRUCTABLE) */
834+
CBC_FUNCTION_GENERATOR, /**< generator function */
835+
836+
/* The following functions has no prototype (see CBC_FUNCTION_HAS_PROTOTYPE) */
837+
CBC_FUNCTION_ARROW, /**< arrow function */
838+
CBC_FUNCTION_ACCESSOR, /**< property accessor function */
839+
} cbc_code_function_types_t;
840+
841+
/**
842+
* Shift for getting / setting the function type of a byte code.
843+
*/
844+
#define CBC_FUNCTION_TYPE_SHIFT 13
845+
846+
/**
847+
* Set function type in the code flags.
848+
*/
849+
#define CBC_FUNCTION_SET_TYPE(flags, name) \
850+
((flags) |= ((name) << CBC_FUNCTION_TYPE_SHIFT))
851+
852+
/**
853+
* Get function type from the code flags.
854+
*/
855+
#define CBC_FUNCTION_GET_TYPE(flags) \
856+
((uint16_t) ((flags) >> CBC_FUNCTION_TYPE_SHIFT))
857+
858+
/**
859+
* Checks whether the function cannot be called with new operator.
860+
*/
861+
#define CBC_FUNCTION_IS_CONSTRUCTABLE(flags) \
862+
((flags) < (CBC_FUNCTION_GENERATOR << CBC_FUNCTION_TYPE_SHIFT))
863+
864+
/**
865+
* Checks whether the function has prototype property.
866+
*/
867+
#define CBC_FUNCTION_HAS_PROTOTYPE(flags) \
868+
((flags) < (CBC_FUNCTION_ARROW << CBC_FUNCTION_TYPE_SHIFT))
826869

827870
/**
828871
* Any arguments object is needed

jerry-core/parser/js/js-parser.c

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -670,19 +670,28 @@ parse_print_final_cbc (ecma_compiled_code_t *compiled_code_p, /**< compiled code
670670
}
671671

672672
#if ENABLED (JERRY_ES2015)
673-
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION)
673+
switch (CBC_FUNCTION_GET_TYPE (compiled_code_p->status_flags))
674674
{
675-
JERRY_DEBUG_MSG (",arrow");
676-
}
677-
678-
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR)
679-
{
680-
JERRY_DEBUG_MSG (",constructor");
681-
}
682-
683-
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_GENERATOR)
684-
{
685-
JERRY_DEBUG_MSG (",generator");
675+
case CBC_FUNCTION_CONSTRUCTOR:
676+
{
677+
JERRY_DEBUG_MSG (",constructor");
678+
break;
679+
}
680+
case CBC_FUNCTION_GENERATOR:
681+
{
682+
JERRY_DEBUG_MSG (",generator");
683+
break;
684+
}
685+
case CBC_FUNCTION_ARROW:
686+
{
687+
JERRY_DEBUG_MSG (",arrow");
688+
break;
689+
}
690+
case CBC_FUNCTION_ACCESSOR:
691+
{
692+
JERRY_DEBUG_MSG (",accessor");
693+
break;
694+
}
686695
}
687696
#endif /* ENABLED (JERRY_ES2015) */
688697

@@ -1313,22 +1322,19 @@ parser_post_processing (parser_context_t *context_p) /**< context */
13131322
#if ENABLED (JERRY_ES2015)
13141323
if (context_p->status_flags & (PARSER_IS_PROPERTY_GETTER | PARSER_IS_PROPERTY_SETTER))
13151324
{
1316-
compiled_code_p->status_flags |= CBC_CODE_FLAGS_ACCESSOR;
1325+
CBC_FUNCTION_SET_TYPE (compiled_code_p->status_flags, CBC_FUNCTION_ACCESSOR);
13171326
}
1318-
1319-
if (context_p->status_flags & PARSER_IS_ARROW_FUNCTION)
1327+
else if (context_p->status_flags & PARSER_IS_ARROW_FUNCTION)
13201328
{
1321-
compiled_code_p->status_flags |= CBC_CODE_FLAGS_ARROW_FUNCTION;
1329+
CBC_FUNCTION_SET_TYPE (compiled_code_p->status_flags, CBC_FUNCTION_ARROW);
13221330
}
1323-
1324-
if (context_p->status_flags & PARSER_CLASS_CONSTRUCTOR)
1331+
else if (context_p->status_flags & PARSER_CLASS_CONSTRUCTOR)
13251332
{
1326-
compiled_code_p->status_flags |= CBC_CODE_FLAGS_CLASS_CONSTRUCTOR;
1333+
CBC_FUNCTION_SET_TYPE (compiled_code_p->status_flags, CBC_FUNCTION_CONSTRUCTOR);
13271334
}
1328-
1329-
if (context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION)
1335+
else if (context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION)
13301336
{
1331-
compiled_code_p->status_flags |= CBC_CODE_FLAGS_GENERATOR;
1337+
CBC_FUNCTION_SET_TYPE (compiled_code_p->status_flags, CBC_FUNCTION_GENERATOR);
13321338
}
13331339

13341340
if (context_p->status_flags & PARSER_FUNCTION_HAS_REST_PARAM)
@@ -1338,7 +1344,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */
13381344

13391345
if (context_p->tagged_template_literal_cp != JMEM_CP_NULL)
13401346
{
1341-
compiled_code_p->status_flags |= CBC_CODE_FLAG_HAS_TAGGED_LITERALS;
1347+
compiled_code_p->status_flags |= CBC_CODE_FLAGS_HAS_TAGGED_LITERALS;
13421348
}
13431349

13441350
if (context_p->status_flags & PARSER_LEXICAL_BLOCK_NEEDED)

0 commit comments

Comments
 (0)