Revert "Switching get_variable_value to returning value through ecma-stack (stack convention)."

This reverts commit 6415130925187a877b83b14db40cade0c336ea44.
This commit is contained in:
Ruben Ayrapetyan
2015-01-15 17:26:08 +03:00
parent e570d18936
commit eef966869a
14 changed files with 360 additions and 601 deletions
+13 -13
View File
@@ -436,13 +436,13 @@ ecma_free_value (ecma_value_t value, /**< value description */
*
* @return type field
*/
ecma_completion_type_t __attribute_const__
ecma_get_completion_value_type (ecma_completion_value_t completion_value) /**< completion value */
static ecma_completion_type_t __attribute_const__
ecma_get_completion_value_type_field (ecma_completion_value_t completion_value) /**< completion value */
{
return jrt_extract_bit_field (completion_value,
ECMA_COMPLETION_VALUE_TYPE_POS,
ECMA_COMPLETION_VALUE_TYPE_WIDTH);
} /* ecma_get_completion_value_type */
} /* ecma_get_completion_value_type_field */
/**
* Get value field of completion value
@@ -702,7 +702,7 @@ ecma_make_meta_completion_value (void)
inline ecma_value_t __attribute_const__ __attribute_always_inline__
ecma_get_completion_value_value (ecma_completion_value_t completion_value) /**< completion value */
{
const ecma_completion_type_t type = ecma_get_completion_value_type (completion_value);
const ecma_completion_type_t type = ecma_get_completion_value_type_field (completion_value);
const bool is_type_ok = (type == ECMA_COMPLETION_TYPE_NORMAL
#ifdef CONFIG_ECMA_EXCEPTION_SUPPORT
@@ -757,7 +757,7 @@ ecma_get_object_from_completion_value (ecma_completion_value_t completion_value)
ecma_completion_value_t
ecma_copy_completion_value (ecma_completion_value_t value) /**< completion value */
{
const ecma_completion_type_t type = ecma_get_completion_value_type (value);
const ecma_completion_type_t type = ecma_get_completion_value_type_field (value);
const bool is_type_ok = (type == ECMA_COMPLETION_TYPE_NORMAL
#ifdef CONFIG_ECMA_EXCEPTION_SUPPORT
|| type == ECMA_COMPLETION_TYPE_THROW
@@ -778,7 +778,7 @@ ecma_copy_completion_value (ecma_completion_value_t value) /**< completion value
void
ecma_free_completion_value (ecma_completion_value_t completion_value) /**< completion value */
{
switch (ecma_get_completion_value_type (completion_value))
switch (ecma_get_completion_value_type_field (completion_value))
{
case ECMA_COMPLETION_TYPE_NORMAL:
#ifdef CONFIG_ECMA_EXCEPTION_SUPPORT
@@ -816,7 +816,7 @@ ecma_free_completion_value (ecma_completion_value_t completion_value) /**< compl
inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_normal (ecma_completion_value_t value) /**< completion value */
{
return (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_NORMAL);
return (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_NORMAL);
} /* ecma_is_completion_value_normal */
/**
@@ -829,7 +829,7 @@ inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_throw (ecma_completion_value_t value) /**< completion value */
{
#ifdef CONFIG_ECMA_EXCEPTION_SUPPORT
return (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_THROW);
return (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_THROW);
#else /* CONFIG_ECMA_EXCEPTION_SUPPORT */
(void) value;
@@ -846,7 +846,7 @@ ecma_is_completion_value_throw (ecma_completion_value_t value) /**< completion v
inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_return (ecma_completion_value_t value) /**< completion value */
{
return (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_RETURN);
return (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_RETURN);
} /* ecma_is_completion_value_return */
/**
@@ -858,7 +858,7 @@ ecma_is_completion_value_return (ecma_completion_value_t value) /**< completion
inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_exit (ecma_completion_value_t value) /**< completion value */
{
if (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_EXIT)
if (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_EXIT)
{
JERRY_ASSERT (ecma_is_value_boolean (ecma_get_completion_value_value_field (value)));
@@ -879,7 +879,7 @@ ecma_is_completion_value_exit (ecma_completion_value_t value) /**< completion va
inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_meta (ecma_completion_value_t value) /**< completion value */
{
if (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_META)
if (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_META)
{
JERRY_ASSERT (ecma_is_value_empty (ecma_get_completion_value_value_field (value)));
@@ -900,7 +900,7 @@ ecma_is_completion_value_meta (ecma_completion_value_t value) /**< completion va
inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_break (ecma_completion_value_t value) /**< completion value */
{
return (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_BREAK);
return (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_BREAK);
} /* ecma_is_completion_value_break */
/**
@@ -912,7 +912,7 @@ ecma_is_completion_value_break (ecma_completion_value_t value) /**< completion v
inline bool __attribute_const__ __attribute_always_inline__
ecma_is_completion_value_continue (ecma_completion_value_t value) /**< completion value */
{
return (ecma_get_completion_value_type (value) == ECMA_COMPLETION_TYPE_CONTINUE);
return (ecma_get_completion_value_type_field (value) == ECMA_COMPLETION_TYPE_CONTINUE);
} /* ecma_is_completion_value_continue */
/**
+1 -3
View File
@@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -96,8 +96,6 @@ extern ecma_completion_value_t ecma_make_empty_completion_value (void);
extern ecma_completion_value_t ecma_make_return_completion_value (ecma_value_t value);
extern ecma_completion_value_t ecma_make_exit_completion_value (bool is_successful);
extern ecma_completion_value_t ecma_make_meta_completion_value (void);
extern ecma_completion_type_t __attribute_const__
ecma_get_completion_value_type (ecma_completion_value_t completion_value);
extern ecma_value_t ecma_get_completion_value_value (ecma_completion_value_t completion_value);
extern ecma_number_t* __attribute_const__
ecma_get_number_from_completion_value (ecma_completion_value_t completion_value);
+1 -19
View File
@@ -70,10 +70,6 @@ ecma_stack_add_frame (ecma_stack_frame_t *frame_p) /**< frame to initialize */
frame_p->top_chunk_p = NULL;
frame_p->dynamically_allocated_value_slots_p = frame_p->inlined_values;
frame_p->current_slot_index = 0;
#ifndef JERRY_NDEBUG
frame_p->items_number = 0;
#endif /* !JERRY_NDEBUG */
} /* ecma_stack_add_frame */
/**
@@ -138,10 +134,6 @@ void
ecma_stack_push_value (ecma_stack_frame_t *frame_p, /**< ecma-stack frame */
ecma_value_t value) /**< ecma-value */
{
#ifndef JERRY_NDEBUG
frame_p->items_number++;
#endif /* !JERRY_NDEBUG */
frame_p->current_slot_index++;
if (frame_p->current_slot_index >= JERRY_MIN (ECMA_STACK_FRAME_INLINED_VALUES_NUMBER,
@@ -158,13 +150,9 @@ ecma_stack_push_value (ecma_stack_frame_t *frame_p, /**< ecma-stack frame */
/**
* Get top value from ecma-stack
*/
ecma_value_t
inline ecma_value_t __attribute_always_inline__
ecma_stack_top_value (ecma_stack_frame_t *frame_p) /**< ecma-stack frame */
{
#ifndef JERRY_NDEBUG
JERRY_ASSERT (frame_p->items_number > 0);
#endif /* !JERRY_NDEBUG */
const size_t slots_in_top_chunk = ecma_stack_slots_in_top_chunk (frame_p);
JERRY_ASSERT (frame_p->current_slot_index < slots_in_top_chunk);
@@ -217,12 +205,6 @@ ecma_stack_pop (ecma_stack_frame_t *frame_p) /**< ecma-stack frame */
frame_p->current_slot_index--;
}
#ifndef JERRY_NDEBUG
JERRY_ASSERT (frame_p->items_number > 0);
frame_p->items_number--;
#endif /* !JERRY_NDEBUG */
ecma_free_value (value, true);
} /* ecma_stack_pop */
-4
View File
@@ -52,10 +52,6 @@ typedef struct ecma_stack_frame_t
ecma_value_t inlined_values [ECMA_STACK_FRAME_INLINED_VALUES_NUMBER]; /**< place for values inlined in stack frame
* (instead of being dynamically allocated
* on the heap) */
#ifndef JERRY_NDEBUG
uint32_t items_number; /**< number of items pushed on the current frame */
#endif /* !JERRY_NDEBUG */
} ecma_stack_frame_t;
extern void ecma_stack_init (void);