Skip to content

Remove completion value. #888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jerry-core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
#endif /* CONFIG_ECMA_COMPACT_PROFILE */

/**
* Number of ecma-values inlined into VM stack frame
* Number of ecma values inlined into VM stack frame
*/
#define CONFIG_VM_STACK_FRAME_INLINED_VALUES_NUMBER (16)

Expand Down
3 changes: 0 additions & 3 deletions jerry-core/ecma/base/ecma-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ JERRY_STATIC_ASSERT (ECMA_OBJECT_LEX_ENV_TYPE_SIZE <= sizeof (uint64_t) * JERRY_
JERRY_STATIC_ASSERT (sizeof (ecma_collection_header_t) == sizeof (uint64_t));
JERRY_STATIC_ASSERT (sizeof (ecma_collection_chunk_t) == sizeof (uint64_t));
JERRY_STATIC_ASSERT (sizeof (ecma_string_t) == sizeof (uint64_t));
JERRY_STATIC_ASSERT (sizeof (ecma_completion_value_t) == sizeof (uint32_t));
JERRY_STATIC_ASSERT (sizeof (ecma_label_descriptor_t) == sizeof (uint64_t));
JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t));

/** \addtogroup ecma ECMA
Expand Down Expand Up @@ -87,7 +85,6 @@ DECLARE_ROUTINES_FOR (number)
DECLARE_ROUTINES_FOR (collection_header)
DECLARE_ROUTINES_FOR (collection_chunk)
DECLARE_ROUTINES_FOR (string)
DECLARE_ROUTINES_FOR (label_descriptor)
DECLARE_ROUTINES_FOR (getter_setter_pointers)
DECLARE_ROUTINES_FOR (external_pointer)

Expand Down
12 changes: 0 additions & 12 deletions jerry-core/ecma/base/ecma-alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,6 @@ extern ecma_string_t *ecma_alloc_string (void);
*/
extern void ecma_dealloc_string (ecma_string_t *);

/**
* Allocate memory for label descriptor
*
* @return pointer to allocated memory
*/
extern ecma_label_descriptor_t *ecma_alloc_label_descriptor (void);

/**
* Dealloc memory from label descriptor
*/
extern void ecma_dealloc_label_descriptor (ecma_label_descriptor_t *);

/**
* Allocate memory for getter-setter pointer pair
*
Expand Down
8 changes: 4 additions & 4 deletions jerry-core/ecma/base/ecma-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */

switch (property_id)
{
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection of ecma-values */
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection of ecma-values */
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection of ecma values */
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection of ecma values */
{
JERRY_UNIMPLEMENTED ("Indexed array storage is not implemented yet.");
}
Expand Down Expand Up @@ -363,7 +363,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
break;
}

case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_THIS: /* an ecma-value */
case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_THIS: /* an ecma value */
{
if (ecma_is_value_object (property_value))
{
Expand All @@ -375,7 +375,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
break;
}

case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_ARGS: /* a collection of ecma-values */
case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_ARGS: /* a collection of ecma values */
{
ecma_collection_header_t *bound_arg_list_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_header_t,
property_value);
Expand Down
101 changes: 15 additions & 86 deletions jerry-core/ecma/base/ecma-globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/

/**
* Ecma-pointer field is used to calculate ecma-value's address.
* Ecma-pointer field is used to calculate ecma value's address.
*
* Ecma-pointer contains value's shifted offset from common Ecma-pointers' base.
* The offset is shifted right by MEM_ALIGNMENT_LOG.
Expand All @@ -52,7 +52,7 @@
*/

/**
* Type of ecma-value
* Type of ecma value
*/
typedef enum
{
Expand All @@ -63,7 +63,7 @@ typedef enum
} ecma_type_t;

/**
* Simple ecma-values
* Simple ecma values
*/
typedef enum
{
Expand All @@ -80,7 +80,7 @@ typedef enum
ECMA_SIMPLE_VALUE_TRUE, /**< boolean true */
ECMA_SIMPLE_VALUE_ARRAY_HOLE, /**< array hole, used for initialization of an array literal */
ECMA_SIMPLE_VALUE_REGISTER_REF, /**< register reference, a special "base" value for vm */
ECMA_SIMPLE_VALUE__COUNT /** count of simple ecma-values */
ECMA_SIMPLE_VALUE__COUNT /** count of simple ecma values */
} ecma_simple_value_t;

/**
Expand All @@ -94,40 +94,9 @@ typedef enum
} ecma_property_type_t;

/**
* Type of block evaluation (completion) result.
* Description of an ecma value
*
* See also: ECMA-262 v5, 8.9.
*/
typedef enum
{
ECMA_COMPLETION_TYPE_NORMAL, /**< default completion */
ECMA_COMPLETION_TYPE_RETURN, /**< completion with return */
ECMA_COMPLETION_TYPE_JUMP, /**< implementation-defined completion type
* for jump statements (break, continue)
* that require completion of one or several
* statements, before performing related jump.
*
* For example, 'break' in the following code
* requires to return from opfunc_with handler
* before performing jump to the loop end:
*
* for (var i = 0; i < 10; i++)
* {
* with (obj)
* {
* break;
* }
* }
*/
ECMA_COMPLETION_TYPE_THROW, /**< completion with throw */
ECMA_COMPLETION_TYPE_META /**< implementation-defined completion type
for meta opcode */
} ecma_completion_type_t;

/**
* Description of an ecma-value
*
* Bit-field structure: type (2) | value (ECMA_POINTER_FIELD_WIDTH)
* Bit-field structure: type (2) | error (1) | value (ECMA_POINTER_FIELD_WIDTH)
*/
typedef uint32_t ecma_value_t;

Expand All @@ -138,63 +107,23 @@ typedef uint32_t ecma_value_t;
#define ECMA_VALUE_TYPE_WIDTH (2)

/**
* Simple value (ecma_simple_value_t) or compressed pointer to value (depending on value_type)
* Value is error (boolean)
*/
#define ECMA_VALUE_VALUE_POS (ECMA_VALUE_TYPE_POS + \
#define ECMA_VALUE_ERROR_POS (ECMA_VALUE_TYPE_POS + \
ECMA_VALUE_TYPE_WIDTH)
#define ECMA_VALUE_VALUE_WIDTH (ECMA_POINTER_FIELD_WIDTH)

/**
* Size of ecma value description, in bits
*/
#define ECMA_VALUE_SIZE (ECMA_VALUE_VALUE_POS + ECMA_VALUE_VALUE_WIDTH)

/**
* Description of a block completion value
*
* See also: ECMA-262 v5, 8.9.
*
* value (16)
* Bit-field structure: type (8) | padding (8) <
* break / continue target
*/
typedef uint32_t ecma_completion_value_t;
#define ECMA_VALUE_ERROR_WIDTH (1)

/**
* Value
*
* Used for normal, return, throw and exit completion types.
*/
#define ECMA_COMPLETION_VALUE_VALUE_POS (0)
#define ECMA_COMPLETION_VALUE_VALUE_WIDTH (ECMA_VALUE_SIZE)

/**
* Type (ecma_completion_type_t)
*/
#define ECMA_COMPLETION_VALUE_TYPE_POS (JERRY_ALIGNUP (ECMA_COMPLETION_VALUE_VALUE_POS + \
ECMA_COMPLETION_VALUE_VALUE_WIDTH, \
JERRY_BITSINBYTE))
#define ECMA_COMPLETION_VALUE_TYPE_WIDTH (8)

/**
* Size of ecma completion value description, in bits
* Simple value (ecma_simple_value_t) or compressed pointer to value (depending on value_type)
*/
#define ECMA_COMPLETION_VALUE_SIZE (ECMA_COMPLETION_VALUE_TYPE_POS + \
ECMA_COMPLETION_VALUE_TYPE_WIDTH)
#define ECMA_VALUE_VALUE_POS (ECMA_VALUE_ERROR_POS + \
ECMA_VALUE_ERROR_WIDTH)
#define ECMA_VALUE_VALUE_WIDTH (ECMA_POINTER_FIELD_WIDTH)

/**
* Label
*
* Used for break and continue completion types.
* Size of ecma value description, in bits
*/
typedef struct
{
/** Target's offset */
uint32_t offset;

/** Levels to label left */
uint32_t depth;
} ecma_label_descriptor_t;
#define ECMA_VALUE_SIZE (ECMA_VALUE_VALUE_POS + ECMA_VALUE_VALUE_WIDTH)

/**
* Internal properties' identifiers.
Expand Down
Loading