Skip to content

Commit

Permalink
Add custom dispatcher to every builtin object for consistency
Browse files Browse the repository at this point in the history
JerryScript-DCO-1.0-Signed-off-by: Orkenyi Virag [email protected]
  • Loading branch information
orkvi committed Aug 18, 2021
1 parent 3bcd48f commit 731e460
Show file tree
Hide file tree
Showing 30 changed files with 765 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-aggregateerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID aggregate_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down
26 changes: 26 additions & 0 deletions jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-aggregateerror.inc.h"
#define BUILTIN_UNDERSCORED_ID aggregate_error
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down Expand Up @@ -103,6 +108,27 @@ ecma_builtin_aggregate_error_dispatch_construct (const ecma_value_t *arguments_l
return result;
} /* ecma_builtin_aggregate_error_dispatch_construct */

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_aggregate_error_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_aggregate_error_dispatch_routine */

/**
* @}
* @}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,36 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-array-prototype-unscopables.inc.h"
#define BUILTIN_UNDERSCORED_ID array_prototype_unscopables
#include "ecma-builtin-internal-routines-template.inc.h"

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_array_prototype_unscopables_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide
* routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed
* to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_array_prototype_unscopables_dispatch_routine */

#endif /* JERRY_ESNEXT */
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-async-function-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID async_function_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
Expand All @@ -34,6 +39,28 @@
* @{
*/

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_async_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide
* routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_async_function_prototype_dispatch_routine */

/**
* @}
* @}
Expand Down
26 changes: 26 additions & 0 deletions jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#include "ecma-builtins-internal.h"
#include "ecma-function-object.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-async-function.inc.h"
#define BUILTIN_UNDERSCORED_ID async_function
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down Expand Up @@ -65,6 +70,27 @@ ecma_builtin_async_function_dispatch_construct (const ecma_value_t *arguments_li
return ecma_builtin_async_function_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_async_function_dispatch_construct */

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_async_function_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_async_function_dispatch_routine */

/**
* @}
* @}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#include "ecma-builtins-internal.h"
#include "ecma-function-object.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-async-generator-function.inc.h"
#define BUILTIN_UNDERSCORED_ID async_generator_function
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down Expand Up @@ -65,6 +70,28 @@ ecma_builtin_async_generator_function_dispatch_construct (const ecma_value_t *ar
return ecma_builtin_async_generator_function_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_async_generator_function_dispatch_construct */

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_async_generator_function_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide
* routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_async_generator_function_dispatch_routine */

/**
* @}
* @}
Expand Down
26 changes: 26 additions & 0 deletions jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-async-generator.inc.h"
#define BUILTIN_UNDERSCORED_ID async_generator
#include "ecma-builtin-internal-routines-template.inc.h"
Expand All @@ -34,6 +39,27 @@
* @{
*/

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_async_generator_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_async_generator_dispatch_routine */

/**
* @}
* @}
Expand Down
26 changes: 26 additions & 0 deletions jerry-core/ecma/builtin-objects/ecma-builtin-bigint.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-bigint.inc.h"
#define BUILTIN_UNDERSCORED_ID bigint
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down Expand Up @@ -71,6 +76,27 @@ ecma_builtin_bigint_dispatch_construct (const ecma_value_t *arguments_list_p, /*
return ecma_raise_type_error (ECMA_ERR_MSG ("BigInt function is not a constructor"));
} /* ecma_builtin_bigint_dispatch_construct */

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_bigint_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_bigint_dispatch_routine */

/**
* @}
* @}
Expand Down
26 changes: 26 additions & 0 deletions jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-boolean.inc.h"
#define BUILTIN_UNDERSCORED_ID boolean
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down Expand Up @@ -89,6 +94,27 @@ ecma_builtin_boolean_dispatch_construct (const ecma_value_t *arguments_list_p, /
}
} /* ecma_builtin_boolean_dispatch_construct */

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_boolean_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_boolean_dispatch_routine */

/**
* @}
* @}
Expand Down
26 changes: 26 additions & 0 deletions jerry-core/ecma/builtin-objects/ecma-builtin-dataview.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

/**
* This object has a custom dispatch function.
*/
#define BUILTIN_CUSTOM_DISPATCH

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-dataview.inc.h"
#define BUILTIN_UNDERSCORED_ID dataview
#include "ecma-builtin-internal-routines-template.inc.h"
Expand Down Expand Up @@ -62,6 +67,27 @@ ecma_builtin_dataview_dispatch_construct (const ecma_value_t *arguments_list_p,
return ecma_op_dataview_create (arguments_list_p, arguments_list_len);
} /* ecma_builtin_dataview_dispatch_construct */

/**
* Dispatcher of the built-in's routines
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
ecma_builtin_dataview_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (builtin_routine_id);

JERRY_UNREACHABLE ();
} /* ecma_builtin_dataview_dispatch_routine */

/**
* @}
* @}
Expand Down
Loading

0 comments on commit 731e460

Please sign in to comment.