@@ -1439,19 +1439,11 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
14391439#endif /* ENABLED (JERRY_DEBUGGER) */
14401440
14411441#if ENABLED (JERRY_ES2015 )
1442+ ecma_value_t * base_p = ecma_compiled_code_resolve_arguments_start (bytecode_p );
1443+
14421444 if (bytecode_p -> status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS )
14431445 {
1444- ecma_length_t formal_params_number = ecma_compiled_code_get_formal_params (bytecode_p );
1445-
1446- uint8_t * byte_p = (uint8_t * ) bytecode_p ;
1447- byte_p += ((size_t ) bytecode_p -> size ) << JMEM_ALIGNMENT_LOG ;
1448-
1449- ecma_value_t * tagged_base_p = (ecma_value_t * ) byte_p ;
1450- tagged_base_p -= formal_params_number ;
1451-
1452- ecma_collection_t * coll_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t , tagged_base_p [-1 ]);
1453-
1454- ecma_collection_destroy (coll_p );
1446+ ecma_collection_destroy (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t , base_p [-2 ]));
14551447 }
14561448#endif /* ENABLED (JERRY_ES2015) */
14571449
@@ -1484,17 +1476,18 @@ ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *b
14841476 JERRY_ASSERT (bytecode_header_p != NULL );
14851477 JERRY_ASSERT (bytecode_header_p -> status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS );
14861478
1487- uint8_t * byte_p = (uint8_t * ) bytecode_header_p ;
1488- byte_p += ((size_t ) bytecode_header_p -> size ) << JMEM_ALIGNMENT_LOG ;
1479+ ecma_value_t * tagged_base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p );
14891480
1490- ecma_value_t * tagged_base_p = (ecma_value_t * ) byte_p ;
1491- tagged_base_p -= ecma_compiled_code_get_formal_params (bytecode_header_p );
1481+ if (!(bytecode_header_p -> status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR ))
1482+ {
1483+ tagged_base_p -- ;
1484+ }
14921485
14931486 return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t , tagged_base_p [-1 ]);
14941487} /* ecma_compiled_code_get_tagged_template_collection */
14951488#endif /* ENABLED (JERRY_ES2015) */
14961489
1497- #if ENABLED (JERRY_LINE_INFO ) || ENABLED ( JERRY_ES2015_MODULE_SYSTEM ) || ENABLED (JERRY_ES2015 )
1490+ #if ENABLED (JERRY_RESOURCE_NAME ) || ENABLED (JERRY_ES2015 )
14981491/**
14991492 * Get the number of formal parameters of the compiled code
15001493 *
@@ -1515,7 +1508,35 @@ ecma_compiled_code_get_formal_params (const ecma_compiled_code_t *bytecode_heade
15151508
15161509 return ((cbc_uint8_arguments_t * ) bytecode_header_p )-> argument_end ;
15171510} /* ecma_compiled_code_get_formal_params */
1518- #endif /* ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) || ENABLED (JERRY_ES2015) */
1511+
1512+ /**
1513+ * Resolve the position of the arguments list start of the compiled code
1514+ *
1515+ * @return start position of the arguments list start of the compiled code
1516+ */
1517+ ecma_value_t *
1518+ ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t * bytecode_header_p )
1519+ {
1520+ JERRY_ASSERT (bytecode_header_p != NULL );
1521+
1522+ uint8_t * byte_p = (uint8_t * ) bytecode_header_p ;
1523+ byte_p += ((size_t ) bytecode_header_p -> size ) << JMEM_ALIGNMENT_LOG ;
1524+
1525+ return ((ecma_value_t * ) byte_p ) - ecma_compiled_code_get_formal_params (bytecode_header_p );
1526+ } /* ecma_compiled_code_resolve_arguments_start */
1527+
1528+ /**
1529+ * Resolve the position of the function name of the compiled code
1530+ *
1531+ * @return position of the function name of the compiled code
1532+ */
1533+ inline ecma_value_t * JERRY_ATTR_ALWAYS_INLINE
1534+ ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t * bytecode_header_p )
1535+ {
1536+ JERRY_ASSERT (bytecode_header_p != NULL );
1537+ return ecma_compiled_code_resolve_arguments_start (bytecode_header_p ) - 1 ;
1538+ } /* ecma_compiled_code_resolve_function_name */
1539+ #endif /* ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ES2015) */
15191540
15201541#if (JERRY_STACK_LIMIT != 0 )
15211542/**
0 commit comments