Skip to content

Commit

Permalink
Add JERRY_ATTR_ALWAYS_INLINE to all inline only function
Browse files Browse the repository at this point in the history
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
  • Loading branch information
lygstate committed Nov 14, 2024
1 parent 3fa9a64 commit 363193f
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions jerry-core/ecma/base/ecma-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ecma_create_lex_env_class (ecma_object_t *outer_lexical_environment_p, /**< oute
* @return true - if object is a lexical environment
* false - otherwise
*/
extern inline bool JERRY_ATTR_PURE
extern inline bool JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE
ecma_is_lexical_environment (const ecma_object_t *object_p) /**< object or lexical environment */
{
JERRY_ASSERT (object_p != NULL);
Expand All @@ -229,7 +229,7 @@ ecma_op_ordinary_object_set_extensible (ecma_object_t *object_p) /**< object */
*
* @return type of the object (ecma_object_type_t)
*/
extern inline ecma_object_type_t JERRY_ATTR_PURE
extern inline ecma_object_type_t JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE
ecma_get_object_type (const ecma_object_t *object_p) /**< object */
{
JERRY_ASSERT (object_p != NULL);
Expand Down Expand Up @@ -280,7 +280,7 @@ ecma_object_class_is (ecma_object_t *object_p, /**< object */
*
* @return type of the lexical environment (ecma_lexical_environment_type_t)
*/
extern inline ecma_lexical_environment_type_t JERRY_ATTR_PURE
extern inline ecma_lexical_environment_type_t JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE
ecma_get_lex_env_type (const ecma_object_t *object_p) /**< lexical environment */
{
JERRY_ASSERT (object_p != NULL);
Expand All @@ -294,7 +294,7 @@ ecma_get_lex_env_type (const ecma_object_t *object_p) /**< lexical environment *
*
* @return pointer to ecma object
*/
extern inline ecma_object_t *JERRY_ATTR_PURE
extern inline ecma_object_t *JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE
ecma_get_lex_env_binding_object (const ecma_object_t *object_p) /**< object-bound lexical environment */
{
JERRY_ASSERT (object_p != NULL);
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/builtin-objects/ecma-builtin-promise.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ enum
* @return ecma value of the new promise.
* Returned value must be freed with ecma_free_value.
*/
static inline ecma_value_t
static inline ecma_value_t JERRY_ATTR_ALWAYS_INLINE
ecma_builtin_promise_perform_race (ecma_value_t iterator, /**< the iterator for race */
ecma_value_t next_method, /**< next method */
ecma_object_t *capability_obj_p, /**< PromiseCapability record */
Expand Down Expand Up @@ -170,7 +170,7 @@ ecma_builtin_promise_perform_race (ecma_value_t iterator, /**< the iterator for
* @return ecma value of the new promise.
* Returned value must be freed with ecma_free_value.
*/
static inline ecma_value_t
static inline ecma_value_t JERRY_ATTR_ALWAYS_INLINE
ecma_builtin_promise_perform (ecma_value_t iterator, /**< iteratorRecord */
ecma_value_t next_method, /**< next method */
ecma_object_t *capability_obj_p, /**< PromiseCapability record */
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/operations/ecma-container-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*
* @return pointer to the internal buffer
*/
static inline ecma_collection_t *
static inline ecma_collection_t *JERRY_ATTR_ALWAYS_INLINE
ecma_op_create_internal_buffer (void)
{
ecma_collection_t *collection_p = ecma_new_collection ();
Expand Down Expand Up @@ -82,7 +82,7 @@ ecma_op_internal_buffer_append (ecma_collection_t *container_p, /**< internal co
/**
* Update the value of a given entry.
*/
static inline void
static inline void JERRY_ATTR_ALWAYS_INLINE
ecma_op_internal_buffer_update (ecma_value_t *entry_p, /**< entry pointer */
ecma_value_t value_arg, /**< value argument */
lit_magic_string_id_t lit_id) /**< class id */
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/operations/ecma-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,7 @@ ecma_builtin_is (ecma_object_t *object_p, /**< pointer to an object */
* @return true - if class name is an object
* false - otherwise
*/
static inline bool
static inline bool JERRY_ATTR_ALWAYS_INLINE
ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
{
#ifndef JERRY_NDEBUG
Expand Down Expand Up @@ -3253,7 +3253,7 @@ ecma_op_ordinary_object_set_prototype_of (ecma_object_t *obj_p, /**< base object
* @return true - if object is extensible
* false - otherwise
*/
extern inline bool JERRY_ATTR_PURE
extern inline bool JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE
ecma_op_ordinary_object_is_extensible (ecma_object_t *object_p) /**< object */
{
JERRY_ASSERT (!ECMA_OBJECT_IS_PROXY (object_p));
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/parser/js/js-parser-expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ JERRY_STATIC_ASSERT (sizeof (parser_binary_precedence_table) == 42,
/**
* Generate byte code for operators with lvalue.
*/
static inline void
static inline void JERRY_ATTR_ALWAYS_INLINE
parser_push_result (parser_context_t *context_p) /**< context */
{
if (CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode))
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/parser/js/js-parser-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ parser_stack_pop (parser_context_t *context_p, /**< context */
/**
* Initialize stack iterator.
*/
extern inline void
extern inline void JERRY_ATTR_ALWAYS_INLINE
parser_stack_iterator_init (parser_context_t *context_p, /**< context */
parser_stack_iterator_t *iterator) /**< iterator */
{
Expand All @@ -642,7 +642,7 @@ parser_stack_iterator_init (parser_context_t *context_p, /**< context */
*
* @return byte
*/
extern inline uint8_t
extern inline uint8_t JERRY_ATTR_ALWAYS_INLINE
parser_stack_iterator_read_uint8 (parser_stack_iterator_t *iterator) /**< iterator */
{
JERRY_ASSERT (iterator->current_position > 0 && iterator->current_position <= PARSER_STACK_PAGE_SIZE);
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/parser/js/js-parser-statm.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ typedef struct
*
* @return size consumed by a statement.
*/
static inline size_t
static inline size_t JERRY_ATTR_ALWAYS_INLINE
parser_statement_length (uint8_t type) /**< type of statement */
{
static const uint8_t statement_lengths[] = {
Expand Down Expand Up @@ -293,7 +293,7 @@ parser_statement_length (uint8_t type) /**< type of statement */
/**
* Parse expression enclosed in parens.
*/
static inline void
static inline void JERRY_ATTR_ALWAYS_INLINE
parser_parse_enclosed_expr (parser_context_t *context_p) /**< context */
{
lexer_next_token (context_p);
Expand Down
4 changes: 2 additions & 2 deletions jerry-ext/debugger/debugger-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef struct
/**
* Correctly close a file descriptor.
*/
static inline void
static inline void JERRY_ATTR_ALWAYS_INLINE
jerryx_debugger_serial_close_fd (int fd) /**< file descriptor to close */
{
if (close (fd) != 0)
Expand Down Expand Up @@ -103,7 +103,7 @@ jerryx_debugger_serial_set_blocking (int fd, bool blocking)
* @return true if everything is ok
* false if there was an error
*/
static inline bool
static inline bool JERRY_ATTR_ALWAYS_INLINE
jerryx_debugger_serial_configure_attributes (int fd, jerryx_debugger_transport_serial_config_t serial_config)
{
struct termios options;
Expand Down
4 changes: 2 additions & 2 deletions jerry-ext/debugger/debugger-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ typedef struct
*
* @return last error value.
*/
static inline int
static inline int JERRY_ATTR_ALWAYS_INLINE
jerryx_debugger_tcp_get_errno (void)
{
#ifdef _WIN32
Expand All @@ -99,7 +99,7 @@ jerryx_debugger_tcp_get_errno (void)
/**
* Correctly close a single socket.
*/
static inline void
static inline void JERRY_ATTR_ALWAYS_INLINE
jerryx_debugger_tcp_close_socket (jerryx_socket_t socket_id) /**< socket to close */
{
#ifdef _WIN32
Expand Down

0 comments on commit 363193f

Please sign in to comment.