Implementing register variables.

This commit is contained in:
Ruben Ayrapetyan
2014-07-24 18:13:32 +04:00
parent c837c7d435
commit b7a3a13bc9
13 changed files with 169 additions and 59 deletions
+1 -1
View File
@@ -63,11 +63,11 @@ typedef enum {
* Simple ecma-values
*/
typedef enum {
ECMA_SIMPLE_VALUE_EMPTY, /**< empty value (see also: ECMA-262 v5, 8.9 Completion specification type) */
ECMA_SIMPLE_VALUE_UNDEFINED, /**< undefined value */
ECMA_SIMPLE_VALUE_NULL, /**< null value */
ECMA_SIMPLE_VALUE_FALSE, /**< boolean false */
ECMA_SIMPLE_VALUE_TRUE, /**< boolean true */
ECMA_SIMPLE_VALUE_EMPTY, /**< empty value (see also: ECMA-262 v5, 8.9 Completion specification type) */
ECMA_SIMPLE_VALUE_ARRAY_REDIRECT, /**< special value for an array's elements that exists,
but is stored directly in the array's property list
(used for array elements with non-default attribute values) */
+12
View File
@@ -26,6 +26,18 @@
#include "ecma-helpers.h"
#include "globals.h"
/**
* Check if the value is empty.
*
* @return true - if the value contains implementation-defined empty simple value,
* false - otherwise.
*/
bool
ecma_is_value_empty( ecma_value_t value) /**< ecma-value */
{
return ( value.value_type == ECMA_TYPE_SIMPLE && value.value == ECMA_SIMPLE_VALUE_EMPTY );
} /* ecma_is_value_empty */
/**
* Check if the value is undefined.
*
+1
View File
@@ -42,6 +42,7 @@ extern void* ecma_decompress_pointer(uintptr_t compressed_pointer);
(field) = ecma_compress_pointer( non_compressed_pointer) & ( ( 1u << ECMA_POINTER_FIELD_WIDTH ) - 1)
/* ecma-helpers-value.c */
extern bool ecma_is_value_empty( ecma_value_t value);
extern bool ecma_is_value_undefined( ecma_value_t value);
extern bool ecma_is_value_null( ecma_value_t value);
extern bool ecma_is_value_boolean( ecma_value_t value);