Removing ECMA_TYPE__COUNT enum value; fixing comment to ecma_copy_value

This commit is contained in:
Ruben Ayrapetyan
2014-08-22 17:50:57 +04:00
parent a8486b01ed
commit dca9bcc387
4 changed files with 8 additions and 45 deletions
+1 -2
View File
@@ -56,8 +56,7 @@ typedef enum
ECMA_TYPE_SIMPLE, /**< simple value */ ECMA_TYPE_SIMPLE, /**< simple value */
ECMA_TYPE_NUMBER, /**< 64-bit integer */ ECMA_TYPE_NUMBER, /**< 64-bit integer */
ECMA_TYPE_STRING, /**< pointer to description of a string */ ECMA_TYPE_STRING, /**< pointer to description of a string */
ECMA_TYPE_OBJECT, /**< pointer to description of an object */ ECMA_TYPE_OBJECT /**< pointer to description of an object */
ECMA_TYPE__COUNT /**< count of types */
} ecma_type_t; } ecma_type_t;
/** /**
+7 -20
View File
@@ -163,17 +163,17 @@ ecma_make_object_value (ecma_object_t* object_p) /**< object to reference in val
* switch (valuetype) * switch (valuetype)
* case simple: * case simple:
* simply return the value as it was passed; * simply return the value as it was passed;
* case number/string: * case number:
* copy the number/string * copy the number
* and return new ecma-value * and return new ecma-value
* pointing to copy of the number/string; * pointing to copy of the number;
* case string:
* increase reference counter of the string
* and return the value as it was passed.
* case object; * case object;
* increase reference counter of the object if do_ref_if_object is true * increase reference counter of the object if do_ref_if_object is true
* and return the value as it was passed. * and return the value as it was passed.
* *
* TODO:
* reference counter in strings
*
* @return See note. * @return See note.
*/ */
ecma_value_t ecma_value_t
@@ -214,11 +214,7 @@ ecma_copy_value (const ecma_value_t value, /**< ecma-value */
ecma_ref_ecma_string (string_p); ecma_ref_ecma_string (string_p);
value_copy = (ecma_value_t) value_copy = value;
{
.value_type = ECMA_TYPE_STRING
};
ECMA_SET_POINTER(value_copy.value, string_p);
break; break;
} }
@@ -236,10 +232,6 @@ ecma_copy_value (const ecma_value_t value, /**< ecma-value */
break; break;
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
return value_copy; return value_copy;
@@ -283,11 +275,6 @@ ecma_free_value (ecma_value_t value, /**< value description */
} }
break; break;
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
} /* ecma_free_value */ } /* ecma_free_value */
-19
View File
@@ -69,11 +69,6 @@ ecma_op_check_object_coercible (ecma_value_t value) /**< ecma-value */
{ {
break; break;
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
return ecma_make_empty_completion_value (); return ecma_make_empty_completion_value ();
@@ -180,11 +175,6 @@ ecma_op_to_primitive (ecma_value_t value, /**< ecma-value */
{ {
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(preferred_type); JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(preferred_type);
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
JERRY_UNREACHABLE(); JERRY_UNREACHABLE();
@@ -249,10 +239,6 @@ ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */
break; break;
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
JERRY_UNREACHABLE(); JERRY_UNREACHABLE();
@@ -293,10 +279,6 @@ ecma_op_to_number (ecma_value_t value) /**< ecma-value */
return completion_to_number; return completion_to_number;
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
JERRY_UNREACHABLE(); JERRY_UNREACHABLE();
@@ -386,7 +368,6 @@ ecma_op_to_string (ecma_value_t value) /**< ecma-value */
} }
case ECMA_TYPE_OBJECT: case ECMA_TYPE_OBJECT:
case ECMA_TYPE__COUNT:
{ {
JERRY_UNREACHABLE (); JERRY_UNREACHABLE ();
} }
@@ -110,10 +110,6 @@ ecma_op_create_object_object_arg (ecma_value_t value) /**< argument of construct
ecma_make_object_value (obj_p), ecma_make_object_value (obj_p),
ECMA_TARGET_ID_RESERVED); ECMA_TARGET_ID_RESERVED);
} }
case ECMA_TYPE__COUNT:
{
JERRY_UNREACHABLE();
}
} }
JERRY_UNREACHABLE(); JERRY_UNREACHABLE();