From 363193f13361dfa0e4506da6937fffe18db8d029 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 1 Jan 2021 09:58:49 -0800 Subject: [PATCH] Add JERRY_ATTR_ALWAYS_INLINE to all inline only function JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com --- jerry-core/ecma/base/ecma-helpers.c | 8 ++++---- jerry-core/ecma/builtin-objects/ecma-builtin-promise.c | 4 ++-- jerry-core/ecma/operations/ecma-container-object.c | 4 ++-- jerry-core/ecma/operations/ecma-objects.c | 4 ++-- jerry-core/parser/js/js-parser-expr.c | 2 +- jerry-core/parser/js/js-parser-mem.c | 4 ++-- jerry-core/parser/js/js-parser-statm.c | 4 ++-- jerry-ext/debugger/debugger-serial.c | 4 ++-- jerry-ext/debugger/debugger-tcp.c | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c index 94f6ac39a6..581f87d7b0 100644 --- a/jerry-core/ecma/base/ecma-helpers.c +++ b/jerry-core/ecma/base/ecma-helpers.c @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c index 02f600c55a..d9d252641c 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c @@ -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 */ @@ -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 */ diff --git a/jerry-core/ecma/operations/ecma-container-object.c b/jerry-core/ecma/operations/ecma-container-object.c index c9bc10cb36..5ce05c228d 100644 --- a/jerry-core/ecma/operations/ecma-container-object.c +++ b/jerry-core/ecma/operations/ecma-container-object.c @@ -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 (); @@ -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 */ diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index 306cadf447..dc0a88efd0 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -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 @@ -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)); diff --git a/jerry-core/parser/js/js-parser-expr.c b/jerry-core/parser/js/js-parser-expr.c index 02cd16f002..969d2cbbfe 100644 --- a/jerry-core/parser/js/js-parser-expr.c +++ b/jerry-core/parser/js/js-parser-expr.c @@ -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)) diff --git a/jerry-core/parser/js/js-parser-mem.c b/jerry-core/parser/js/js-parser-mem.c index 14f87c2c4e..0867355591 100644 --- a/jerry-core/parser/js/js-parser-mem.c +++ b/jerry-core/parser/js/js-parser-mem.c @@ -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 */ { @@ -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); diff --git a/jerry-core/parser/js/js-parser-statm.c b/jerry-core/parser/js/js-parser-statm.c index 10df37e514..72fed79d3a 100644 --- a/jerry-core/parser/js/js-parser-statm.c +++ b/jerry-core/parser/js/js-parser-statm.c @@ -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[] = { @@ -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); diff --git a/jerry-ext/debugger/debugger-serial.c b/jerry-ext/debugger/debugger-serial.c index 3a4215f087..cb1209d871 100644 --- a/jerry-ext/debugger/debugger-serial.c +++ b/jerry-ext/debugger/debugger-serial.c @@ -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) @@ -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; diff --git a/jerry-ext/debugger/debugger-tcp.c b/jerry-ext/debugger/debugger-tcp.c index fc8e18b2ca..6feaf38fe8 100644 --- a/jerry-ext/debugger/debugger-tcp.c +++ b/jerry-ext/debugger/debugger-tcp.c @@ -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 @@ -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