Adding libecmaoperations module that implements ECMA-262 defined operations.

This commit is contained in:
Ruben Ayrapetyan
2014-07-10 14:28:01 +04:00
parent c4d2c4c916
commit fa63065412
5 changed files with 92 additions and 3 deletions
+33
View File
@@ -67,6 +67,10 @@ typedef enum {
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) */
ECMA_SIMPLE_VALUE__COUNT /** count of simple ecma-values */
} ecma_SimpleValue_t;
@@ -79,6 +83,19 @@ typedef enum {
ECMA_PROPERTY_INTERNAL /**< internal property */
} ecma_PropertyType_t;
/**
* Type of block evaluation (completion) result.
*
* See also: ECMA-262 v5, 8.9.
*/
typedef enum {
ECMA_COMPLETION_TYPE_NORMAL, /**< default block completion */
ECMA_COMPLETION_TYPE_RETURN, /**< block completed with return */
ECMA_COMPLETION_TYPE_BREAK, /**< block completed with break */
ECMA_COMPLETION_TYPE_CONTINUE, /**< block completed with continue */
ECMA_COMPLETION_TYPE_THROW /**< block completed with throw */
} ecma_CompletionType_t;
/**
* Description of an ecma-value
*/
@@ -92,6 +109,22 @@ typedef struct {
uint32_t m_Value : ECMA_POINTER_FIELD_WIDTH;
} __packed ecma_Value_t;
/**
* Description of a block completion value
*
* See also: ECMA-262 v5, 8.9.
*/
typedef struct {
/** Type (ecma_CompletionType_t) */
uint32_t completion_type : 3;
/** Value */
ecma_Value_t completion_value;
/** Target */
uint32_t target : 8;
} __packed ecma_CompletionValue_t;
/**
* Internal properties' identifiers.
*/