Skip to content

Added rules for coding style checking. #42

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
May 14, 2015
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
4 changes: 2 additions & 2 deletions jerry-core/ecma/base/ecma-alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t)
* Declaration of alloc/free routine for specified ecma-type.
*/
#define DECLARE_ROUTINES_FOR(ecma_type) \
ALLOC(ecma_type) \
DEALLOC(ecma_type)
ALLOC (ecma_type) \
DEALLOC (ecma_type)

DECLARE_ROUTINES_FOR (object)
DECLARE_ROUTINES_FOR (property)
Expand Down
47 changes: 24 additions & 23 deletions jerry-core/ecma/base/ecma-gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef enum
/**
* List of marked (visited during current GC session) and umarked objects
*/
static ecma_object_t *ecma_gc_objects_lists [ECMA_GC_COLOR__COUNT];
static ecma_object_t *ecma_gc_objects_lists[ECMA_GC_COLOR__COUNT];

/**
* Current state of an object's visited flag that indicates whether the object is in visited state:
Expand Down Expand Up @@ -177,8 +177,8 @@ ecma_init_gc_info (ecma_object_t *object_p) /**< object */
{
ecma_gc_set_object_refs (object_p, 1);

ecma_gc_set_object_next (object_p, ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY]);
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = object_p;
ecma_gc_set_object_next (object_p, ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY]);
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = object_p;

/* Should be set to false at the beginning of garbage collection */
ecma_gc_set_object_visited (object_p, false);
Expand All @@ -199,7 +199,7 @@ ecma_ref_object (ecma_object_t *object_p) /**< object */
void
ecma_deref_object (ecma_object_t *object_p) /**< object */
{
JERRY_ASSERT(ecma_gc_get_object_refs (object_p) > 0);
JERRY_ASSERT (ecma_gc_get_object_refs (object_p) > 0);
ecma_gc_set_object_refs (object_p, ecma_gc_get_object_refs (object_p) - 1);
} /* ecma_deref_object */

Expand All @@ -209,8 +209,8 @@ ecma_deref_object (ecma_object_t *object_p) /**< object */
void
ecma_gc_init (void)
{
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = NULL;
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = NULL;
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = NULL;
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = NULL;
} /* ecma_gc_init */

/**
Expand All @@ -219,7 +219,7 @@ ecma_gc_init (void)
void
ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
{
JERRY_ASSERT(object_p != NULL);
JERRY_ASSERT (object_p != NULL);
JERRY_ASSERT (ecma_gc_is_object_visited (object_p));

bool traverse_properties = true;
Expand Down Expand Up @@ -302,7 +302,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
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.");
JERRY_UNIMPLEMENTED ("Indexed array storage is not implemented yet.");
}

case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t
Expand All @@ -312,7 +312,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
case ECMA_INTERNAL_PROPERTY__COUNT: /* not a real internal property type,
* but number of the real internal property types */
{
JERRY_UNREACHABLE();
JERRY_UNREACHABLE ();
}

case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* a collection of strings */
Expand All @@ -336,7 +336,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
case ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP: /* an object */
{
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER(ecma_object_t, property_value);
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, property_value);

ecma_gc_set_object_visited (obj_p, true);

Expand All @@ -357,9 +357,9 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
void
ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
{
JERRY_ASSERT(object_p != NULL
&& !ecma_gc_is_object_visited (object_p)
&& ecma_gc_get_object_refs (object_p) == 0);
JERRY_ASSERT (object_p != NULL
&& !ecma_gc_is_object_visited (object_p)
&& ecma_gc_get_object_refs (object_p) == 0);

if (!ecma_is_lexical_environment (object_p))
{
Expand Down Expand Up @@ -405,10 +405,10 @@ ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
void
ecma_gc_run (void)
{
JERRY_ASSERT (ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] == NULL);
JERRY_ASSERT (ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] == NULL);

/* if some object is referenced from stack or globals (i.e. it is root), mark it */
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY];
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY];
obj_iter_p != NULL;
obj_iter_p = ecma_gc_get_object_next (obj_iter_p))
{
Expand Down Expand Up @@ -445,7 +445,7 @@ ecma_gc_run (void)
{
marked_anything_during_current_iteration = false;

for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY], *obj_prev_p = NULL, *obj_next_p;
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY], *obj_prev_p = NULL, *obj_next_p;
obj_iter_p != NULL;
obj_iter_p = obj_next_p)
{
Expand All @@ -454,8 +454,8 @@ ecma_gc_run (void)
if (ecma_gc_is_object_visited (obj_iter_p))
{
/* Moving the object to list of marked objects */
ecma_gc_set_object_next (obj_iter_p, ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK]);
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = obj_iter_p;
ecma_gc_set_object_next (obj_iter_p, ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK]);
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = obj_iter_p;

if (likely (obj_prev_p != NULL))
{
Expand All @@ -465,7 +465,7 @@ ecma_gc_run (void)
}
else
{
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
}

ecma_gc_mark (obj_iter_p);
Expand All @@ -476,10 +476,11 @@ ecma_gc_run (void)
obj_prev_p = obj_iter_p;
}
}
} while (marked_anything_during_current_iteration);
}
while (marked_anything_during_current_iteration);

/* Sweeping objects that are currently unmarked */
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY], *obj_next_p;
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY], *obj_next_p;
obj_iter_p != NULL;
obj_iter_p = obj_next_p)
{
Expand All @@ -491,8 +492,8 @@ ecma_gc_run (void)
}

/* Unmarking all objects */
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK];
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = NULL;
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK];
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = NULL;

ecma_gc_visited_flip_flag = !ecma_gc_visited_flip_flag;
} /* ecma_gc_run */
Expand Down
Loading