Skip to content

Commit 6f33ab3

Browse files
committed
Improve equal operations.
The implementation is simplified and optimized resulting the removal a large amount of code. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent 5c852ab commit 6f33ab3

File tree

6 files changed

+171
-319
lines changed

6 files changed

+171
-319
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ ecma_get_pointer_from_ecma_value (ecma_value_t value) /**< value */
113113
#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
114114
} /* ecma_get_pointer_from_ecma_value */
115115

116+
/**
117+
* Check if the value is direct ecma-value.
118+
*
119+
* @return true - if the value is a direct value,
120+
* false - otherwise.
121+
*/
122+
inline bool __attr_pure___ __attr_always_inline___
123+
ecma_is_value_direct (ecma_value_t value) /**< ecma value */
124+
{
125+
return (ecma_get_value_type_field (value) == ECMA_TYPE_DIRECT);
126+
} /* ecma_is_value_direct */
127+
116128
/**
117129
* Check if the value is simple ecma-value.
118130
*

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
}
115115

116116
/* ecma-helpers-value.c */
117+
extern bool ecma_is_value_direct (ecma_value_t) __attr_pure___;
117118
extern bool ecma_is_value_simple (ecma_value_t) __attr_pure___;
118119
extern bool ecma_is_value_empty (ecma_value_t) __attr_pure___;
119120
extern bool ecma_is_value_undefined (ecma_value_t) __attr_pure___;

0 commit comments

Comments
 (0)